fixes for compiling on r18

This commit is contained in:
dborth 2009-05-21 21:52:41 +00:00
parent f8b3bdf41c
commit 31da4f95c9
2 changed files with 18 additions and 13 deletions

View File

@ -26,6 +26,7 @@
#pragma warning ( disable : 4290 ) #pragma warning ( disable : 4290 )
#endif #endif
#include <stdio.h>
#ifndef CH_LIST #ifndef CH_LIST
#define CH_LIST #define CH_LIST
@ -51,11 +52,11 @@ public:
Hex():_hex(0) { }; Hex():_hex(0) { };
bool operator==(Hex const& other) {return _hex == other._hex;} bool operator==(Hex const& other) {return _hex == other._hex;}
operator int () const { return _hex; } operator int () const { return _hex; }
}; };
class Value { class Value {
/* /*
* Multitype storage container that is aware of the currently stored type in it. * Multitype storage container that is aware of the currently stored type in it.
* Value st = "hello"; * Value st = "hello";
* Value in = 1; * Value in = 1;
@ -71,7 +72,7 @@ private:
public: public:
class WrongType { }; // Conversion error class class WrongType { }; // Conversion error class
enum Etype { V_NONE, V_HEX, V_BOOL, V_INT, V_STRING, V_DOUBLE,V_CURRENT} type; enum Etype { V_NONE, V_HEX, V_BOOL, V_INT, V_STRING, V_DOUBLE,V_CURRENT} type;
/* Constructors */ /* Constructors */
Value() :_string(0), type(V_NONE) { }; Value() :_string(0), type(V_NONE) { };
Value(Hex in) :_hex(in), type(V_HEX) { }; Value(Hex in) :_hex(in), type(V_HEX) { };
@ -83,7 +84,7 @@ public:
Value(Value const& in):_string(0) {plaincopy(in);} Value(Value const& in):_string(0) {plaincopy(in);}
~Value() { destroy();}; ~Value() { destroy();};
Value(std::string const& in,Etype _t) :_string(0),type(V_NONE) {SetValue(in,_t);} Value(std::string const& in,Etype _t) :_string(0),type(V_NONE) {SetValue(in,_t);}
/* Assigment operators */ /* Assigment operators */
Value& operator= (Hex in) throw(WrongType) { return copy(Value(in));} Value& operator= (Hex in) throw(WrongType) { return copy(Value(in));}
Value& operator= (int in) throw(WrongType) { return copy(Value(in));} Value& operator= (int in) throw(WrongType) { return copy(Value(in));}
@ -131,7 +132,7 @@ public:
virtual bool CheckValue(Value const& in, bool warn); virtual bool CheckValue(Value const& in, bool warn);
//Set interval value to in or default if in is invalid. force always sets the value. //Set interval value to in or default if in is invalid. force always sets the value.
void SetVal(Value const& in, bool forced,bool warn=true) {if(forced || CheckValue(in,warn)) value = in; else value = default_value;} void SetVal(Value const& in, bool forced,bool warn=true) {if(forced || CheckValue(in,warn)) value = in; else value = default_value;}
virtual ~Property(){ } virtual ~Property(){ }
virtual const std::vector<Value>& GetValues() const; virtual const std::vector<Value>& GetValues() const;
Value::Etype Get_type(){return default_value.type;} Value::Etype Get_type(){return default_value.type;}
@ -146,12 +147,12 @@ protected:
class Prop_int:public Property { class Prop_int:public Property {
public: public:
Prop_int(std::string const& _propname,Changeable::Value when, int _value) Prop_int(std::string const& _propname,Changeable::Value when, int _value)
:Property(_propname,when) { :Property(_propname,when) {
default_value = value = _value; default_value = value = _value;
min = max = -1; min = max = -1;
} }
Prop_int(std::string const& _propname,Changeable::Value when, int _min,int _max,int _value) Prop_int(std::string const& _propname,Changeable::Value when, int _min,int _max,int _value)
:Property(_propname,when) { :Property(_propname,when) {
default_value = value = _value; default_value = value = _value;
min = _min; min = _min;
max = _max; max = _max;
@ -177,7 +178,7 @@ public:
class Prop_bool:public Property { class Prop_bool:public Property {
public: public:
Prop_bool(std::string const& _propname, Changeable::Value when, bool _value) Prop_bool(std::string const& _propname, Changeable::Value when, bool _value)
:Property(_propname,when) { :Property(_propname,when) {
default_value = value = _value; default_value = value = _value;
} }
void SetValue(std::string const& in); void SetValue(std::string const& in);
@ -187,7 +188,7 @@ public:
class Prop_string:public Property{ class Prop_string:public Property{
public: public:
Prop_string(std::string const& _propname, Changeable::Value when, char const * const _value) Prop_string(std::string const& _propname, Changeable::Value when, char const * const _value)
:Property(_propname,when) { :Property(_propname,when) {
default_value = value = _value; default_value = value = _value;
} }
void SetValue(std::string const& in); void SetValue(std::string const& in);
@ -198,7 +199,7 @@ class Prop_path:public Prop_string{
public: public:
std::string realpath; std::string realpath;
Prop_path(std::string const& _propname, Changeable::Value when, char const * const _value) Prop_path(std::string const& _propname, Changeable::Value when, char const * const _value)
:Prop_string(_propname,when,_value) { :Prop_string(_propname,when,_value) {
default_value = value = _value; default_value = value = _value;
realpath = _value; realpath = _value;
} }
@ -209,7 +210,7 @@ public:
class Prop_hex:public Property { class Prop_hex:public Property {
public: public:
Prop_hex(std::string const& _propname, Changeable::Value when, Hex _value) Prop_hex(std::string const& _propname, Changeable::Value when, Hex _value)
:Property(_propname,when) { :Property(_propname,when) {
default_value = value = _value; default_value = value = _value;
} }
void SetValue(std::string const& in); void SetValue(std::string const& in);
@ -263,7 +264,7 @@ public:
Prop_path* Add_path(std::string const& _propname, Property::Changeable::Value when, char const * const _value=NULL); Prop_path* Add_path(std::string const& _propname, Property::Changeable::Value when, char const * const _value=NULL);
Prop_bool* Add_bool(std::string const& _propname, Property::Changeable::Value when, bool _value=false); Prop_bool* Add_bool(std::string const& _propname, Property::Changeable::Value when, bool _value=false);
Prop_hex* Add_hex(std::string const& _propname, Property::Changeable::Value when, Hex _value=0); Prop_hex* Add_hex(std::string const& _propname, Property::Changeable::Value when, Hex _value=0);
// void Add_double(char const * const _propname, double _value=0.0); // void Add_double(char const * const _propname, double _value=0.0);
Prop_multival *Add_multi(std::string const& _propname, Property::Changeable::Value when,std::string const& sep); Prop_multival *Add_multi(std::string const& _propname, Property::Changeable::Value when,std::string const& sep);
Prop_multival_remain *Add_multiremain(std::string const& _propname, Property::Changeable::Value when,std::string const& sep); Prop_multival_remain *Add_multiremain(std::string const& _propname, Property::Changeable::Value when,std::string const& sep);
@ -306,7 +307,7 @@ public:
virtual void SetValue(std::string const& input); virtual void SetValue(std::string const& input);
}; };
class Section_line: public Section{ class Section_line: public Section{
public: public:
Section_line(std::string const& _sectionname):Section(_sectionname){} Section_line(std::string const& _sectionname):Section(_sectionname){}

View File

@ -65,6 +65,10 @@ Revision History:
//#include "driver.h" /* use M.A.M.E. */ //#include "driver.h" /* use M.A.M.E. */
#include "fmopl.h" #include "fmopl.h"
#ifdef HW_RVL
#include "../platform/wii/config.h"
#endif
#ifndef PI #ifndef PI
#define PI 3.14159265358979323846 #define PI 3.14159265358979323846
#endif #endif