File tree Expand file tree Collapse file tree 6 files changed +27
-0
lines changed
Expand file tree Collapse file tree 6 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES Dynamic : public hx::ObjectPtr<hx::Object>
3030 Dynamic (float inVal);
3131 Dynamic (cpp::Int64 inVal);
3232 Dynamic (cpp::UInt64 inVal);
33+ Dynamic (unsigned long inVal);
3334 Dynamic (hx::Object *inObj) : super(inObj) { }
3435 Dynamic (const String &inString);
3536 Dynamic (const null &inNull) : super(0 ) { }
@@ -74,6 +75,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES Dynamic : public hx::ObjectPtr<hx::Object>
7475 inline operator bool () const { return mPtr && mPtr ->__ToInt (); }
7576 inline operator cpp::Int64 () const { return mPtr ? mPtr ->__ToInt64 () : 0 ; }
7677 inline operator cpp::UInt64 () const { return mPtr ? mPtr ->__ToInt64 () : 0 ; }
78+ inline operator unsigned long () const { return mPtr ? mPtr ->__ToInt64 () : 0 ; }
7779
7880 // Conversion to generic pointer requires you to tag the class with a typedef
7981 template <typename T>
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ namespace cpp
7070
7171 inline Variant (cpp::Int64 inValue) : type(typeInt64), valInt64(inValue) { }
7272 inline Variant (cpp::UInt64 inValue) : type(typeInt64), valInt64(inValue) { }
73+ inline Variant (unsigned long inValue) : type(typeInt64), valInt64(inValue) { }
7374 inline Variant (int inValue) : type(typeInt), valInt(inValue) { }
7475 inline Variant (cpp::UInt32 inValue) : type(typeInt), valInt(inValue) { }
7576 inline Variant (cpp::Int16 inValue) : type(typeInt), valInt(inValue) { }
@@ -111,6 +112,7 @@ namespace cpp
111112 inline operator signed char () const { return asInt (); }
112113 inline operator cpp::Int64 () const { return asInt64 (); }
113114 inline operator cpp::UInt64 () const { return asInt64 (); }
115+ inline operator unsigned long () const { return asInt64 (); }
114116 inline bool operator !() const { return !asInt (); }
115117
116118 inline int Compare (hx::Object *inRHS) const ;
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES String
9595 String (const float &inRHS);
9696 String (const cpp::Int64 &inRHS);
9797 String (const cpp::UInt64 &inRHS);
98+ String (const unsigned long &inRHS);
9899 explicit String (const bool &inRHS);
99100 inline String (const null &inRHS) : __s (0 ), length (0 ) { }
100101 String (hx::Null< ::String > inRHS) : __s (inRHS.value .__s ), length (inRHS.value .length ) { }
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ class null
9292 operator signed char () { return 0 ; }
9393 operator short () { return 0 ; }
9494 operator unsigned short () { return 0 ; }
95+ operator unsigned long () { return 0 ; }
9596 operator cpp::UInt64 () { return 0 ; }
9697 operator cpp::Int64 () { return 0 ; }
9798 template <typename T>
Original file line number Diff line number Diff line change @@ -440,6 +440,19 @@ Dynamic::Dynamic(cpp::UInt64 inVal)
440440 mPtr = (hx::Object *)new Int64Data (inVal);
441441}
442442
443+ Dynamic::Dynamic (unsigned long inVal)
444+ {
445+ if ( (int )inVal==inVal && inVal<256 )
446+ {
447+ int idx = inVal+1 ;
448+ mPtr = sConstDynamicInts [idx].mPtr ;
449+ if (!mPtr )
450+ mPtr = sConstDynamicInts [idx].mPtr = new (hx::NewObjConst)IntData (inVal);
451+ }
452+ else
453+ mPtr = (hx::Object *)new Int64Data (inVal);
454+ }
455+
443456
444457
445458
Original file line number Diff line number Diff line change @@ -862,6 +862,14 @@ String::String(const cpp::UInt64 &inRHS)
862862 __s = GCStringDup (buf,-1 ,&length);
863863}
864864
865+ String::String (const unsigned long &inRHS)
866+ {
867+ char buf[100 ];
868+ SPRINTF (buf,100 ," %llu" , (unsigned long long int )inRHS);
869+ buf[99 ]=' \0 ' ;
870+ __s = GCStringDup (buf,-1 ,&length);
871+ }
872+
865873String::String (const float &inRHS)
866874{
867875 char buf[100 ];
You can’t perform that action at this time.
0 commit comments