Catch a few things found with more aggressive g++ warnings
This commit is contained in:
@@ -33,7 +33,7 @@ namespace chaiscript
|
|||||||
}
|
}
|
||||||
|
|
||||||
bad_boxed_cast(const std::string &t_what) throw()
|
bad_boxed_cast(const std::string &t_what) throw()
|
||||||
: m_what(t_what)
|
: to(0), m_what(t_what)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -48,6 +48,7 @@ namespace chaiscript
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual Boxed_Value convert(const Boxed_Value &derived) = 0;
|
virtual Boxed_Value convert(const Boxed_Value &derived) = 0;
|
||||||
|
|
||||||
const Type_Info &base()
|
const Type_Info &base()
|
||||||
{
|
{
|
||||||
return m_base;
|
return m_base;
|
||||||
@@ -63,6 +64,8 @@ namespace chaiscript
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual ~Dynamic_Conversion() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Type_Info m_base;
|
Type_Info m_base;
|
||||||
Type_Info m_derived;
|
Type_Info m_derived;
|
||||||
|
@@ -39,39 +39,40 @@ namespace chaiscript
|
|||||||
public:
|
public:
|
||||||
Type_Info(bool t_is_const, bool t_is_reference, bool t_is_pointer, bool t_is_void,
|
Type_Info(bool t_is_const, bool t_is_reference, bool t_is_pointer, bool t_is_void,
|
||||||
bool t_is_arithmetic, const std::type_info *t_ti, const std::type_info *t_bareti)
|
bool t_is_arithmetic, const std::type_info *t_ti, const std::type_info *t_bareti)
|
||||||
: m_is_const(t_is_const), m_is_reference(t_is_reference), m_is_pointer(t_is_pointer),
|
: m_type_info(t_ti), m_bare_type_info(t_bareti),
|
||||||
|
m_is_const(t_is_const), m_is_reference(t_is_reference), m_is_pointer(t_is_pointer),
|
||||||
m_is_void(t_is_void), m_is_arithmetic(t_is_arithmetic),
|
m_is_void(t_is_void), m_is_arithmetic(t_is_arithmetic),
|
||||||
m_type_info(t_ti), m_bare_type_info(t_bareti),
|
|
||||||
m_is_undef(false)
|
m_is_undef(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Type_Info()
|
Type_Info()
|
||||||
: m_is_const(false), m_is_reference(false), m_is_pointer(false),
|
: m_type_info(0), m_bare_type_info(0),
|
||||||
m_is_void(false), m_is_arithmetic(false), m_type_info(0), m_bare_type_info(0),
|
m_is_const(false), m_is_reference(false), m_is_pointer(false),
|
||||||
|
m_is_void(false), m_is_arithmetic(false),
|
||||||
m_is_undef(true)
|
m_is_undef(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Type_Info(const Type_Info &ti)
|
Type_Info(const Type_Info &ti)
|
||||||
: m_is_const(ti.m_is_const), m_is_reference(ti.m_is_reference),
|
: m_type_info(ti.m_type_info),
|
||||||
|
m_bare_type_info(ti.m_bare_type_info),
|
||||||
|
m_is_const(ti.m_is_const), m_is_reference(ti.m_is_reference),
|
||||||
m_is_pointer(ti.m_is_pointer),
|
m_is_pointer(ti.m_is_pointer),
|
||||||
m_is_void(ti.m_is_void), m_is_arithmetic(ti.m_is_arithmetic),
|
m_is_void(ti.m_is_void), m_is_arithmetic(ti.m_is_arithmetic),
|
||||||
m_type_info(ti.m_type_info),
|
|
||||||
m_bare_type_info(ti.m_bare_type_info),
|
|
||||||
m_is_undef(ti.m_is_undef)
|
m_is_undef(ti.m_is_undef)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Type_Info &operator=(const Type_Info &ti)
|
Type_Info &operator=(const Type_Info &ti)
|
||||||
{
|
{
|
||||||
|
m_type_info = ti.m_type_info;
|
||||||
|
m_bare_type_info = ti.m_bare_type_info;
|
||||||
m_is_const = ti.m_is_const;
|
m_is_const = ti.m_is_const;
|
||||||
m_is_reference = ti.m_is_reference;
|
m_is_reference = ti.m_is_reference;
|
||||||
m_is_pointer = ti.m_is_pointer;
|
m_is_pointer = ti.m_is_pointer;
|
||||||
m_is_void = ti.m_is_void;
|
m_is_void = ti.m_is_void;
|
||||||
m_is_arithmetic = ti.m_is_arithmetic;
|
m_is_arithmetic = ti.m_is_arithmetic;
|
||||||
m_type_info = ti.m_type_info;
|
|
||||||
m_bare_type_info = ti.m_bare_type_info;
|
|
||||||
m_is_undef = ti.m_is_undef;
|
m_is_undef = ti.m_is_undef;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -126,13 +127,13 @@ namespace chaiscript
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
const std::type_info *m_type_info;
|
||||||
|
const std::type_info *m_bare_type_info;
|
||||||
bool m_is_const;
|
bool m_is_const;
|
||||||
bool m_is_reference;
|
bool m_is_reference;
|
||||||
bool m_is_pointer;
|
bool m_is_pointer;
|
||||||
bool m_is_void;
|
bool m_is_void;
|
||||||
bool m_is_arithmetic;
|
bool m_is_arithmetic;
|
||||||
const std::type_info *m_type_info;
|
|
||||||
const std::type_info *m_bare_type_info;
|
|
||||||
bool m_is_undef;
|
bool m_is_undef;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -215,6 +215,7 @@ int main(int argc, char *argv[])
|
|||||||
case eInteractive : interactive(chai); break;
|
case eInteractive : interactive(chai); break;
|
||||||
case eCommand : val = chai.eval(arg); break;
|
case eCommand : val = chai.eval(arg); break;
|
||||||
case eFile : val = chai.eval_file(arg); break;
|
case eFile : val = chai.eval_file(arg); break;
|
||||||
|
default : std::cout << "Unrecognized execution mode" << std::endl; return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const chaiscript::exception::eval_error &ee) {
|
catch (const chaiscript::exception::eval_error &ee) {
|
||||||
|
Reference in New Issue
Block a user