File tree 6 files changed +27
-5
lines changed
6 files changed +27
-5
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>
30
30
Dynamic (float inVal);
31
31
Dynamic (cpp::Int64 inVal);
32
32
Dynamic (cpp::UInt64 inVal);
33
+ Dynamic (unsigned long inVal);
33
34
Dynamic (hx::Object *inObj) : super(inObj) { }
34
35
Dynamic (const String &inString);
35
36
Dynamic (const null &inNull) : super(0 ) { }
@@ -40,7 +41,6 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES Dynamic : public hx::ObjectPtr<hx::Object>
40
41
Dynamic (const hx::Native<T *> &inInterface):super(inInterface.ptr ? inInterface->__GetRealObject () : (hx::Object *)0 ) { }
41
42
#if !defined(__GNUC__) || defined(__MINGW32__) || (defined(__WORDSIZE) && (__WORDSIZE != 64))
42
43
Dynamic (long inVal);
43
- Dynamic (unsigned long inVal);
44
44
#endif
45
45
#ifdef __OBJC__
46
46
#ifdef HXCPP_OBJC
@@ -74,6 +74,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES Dynamic : public hx::ObjectPtr<hx::Object>
74
74
inline operator bool () const { return mPtr && mPtr ->__ToInt (); }
75
75
inline operator cpp::Int64 () const { return mPtr ? mPtr ->__ToInt64 () : 0 ; }
76
76
inline operator cpp::UInt64 () const { return mPtr ? mPtr ->__ToInt64 () : 0 ; }
77
+ inline operator unsigned long () const { return mPtr ? mPtr ->__ToInt64 () : 0 ; }
77
78
78
79
// Conversion to generic pointer requires you to tag the class with a typedef
79
80
template <typename T>
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ namespace cpp
70
70
71
71
inline Variant (cpp::Int64 inValue) : type(typeInt64), valInt64(inValue) { }
72
72
inline Variant (cpp::UInt64 inValue) : type(typeInt64), valInt64(inValue) { }
73
+ inline Variant (unsigned long inValue) : type(typeInt64), valInt64(inValue) { }
73
74
inline Variant (int inValue) : type(typeInt), valInt(inValue) { }
74
75
inline Variant (cpp::UInt32 inValue) : type(typeInt), valInt(inValue) { }
75
76
inline Variant (cpp::Int16 inValue) : type(typeInt), valInt(inValue) { }
@@ -111,6 +112,7 @@ namespace cpp
111
112
inline operator signed char () const { return asInt (); }
112
113
inline operator cpp::Int64 () const { return asInt64 (); }
113
114
inline operator cpp::UInt64 () const { return asInt64 (); }
115
+ inline operator unsigned long () const { return asInt64 (); }
114
116
inline bool operator !() const { return !asInt (); }
115
117
116
118
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
95
95
String (const float &inRHS);
96
96
String (const cpp::Int64 &inRHS);
97
97
String (const cpp::UInt64 &inRHS);
98
+ String (const unsigned long &inRHS);
98
99
explicit String (const bool &inRHS);
99
100
inline String (const null &inRHS) : __s (0 ), length (0 ) { }
100
101
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
92
92
operator signed char () { return 0 ; }
93
93
operator short () { return 0 ; }
94
94
operator unsigned short () { return 0 ; }
95
+ operator unsigned long () { return 0 ; }
95
96
operator cpp::UInt64 () { return 0 ; }
96
97
operator cpp::Int64 () { return 0 ; }
97
98
template <typename T>
Original file line number Diff line number Diff line change @@ -367,10 +367,6 @@ Dynamic::Dynamic(short inVal)
367
367
}
368
368
369
369
#if !defined(__GNUC__) || defined(__MINGW32__) || (defined(__WORDSIZE) && (__WORDSIZE != 64))
370
- Dynamic::Dynamic (unsigned long inVal)
371
- {
372
- mPtr = fromInt (inVal);
373
- }
374
370
Dynamic::Dynamic (long inVal)
375
371
{
376
372
mPtr = fromInt (inVal);
@@ -440,6 +436,19 @@ Dynamic::Dynamic(cpp::UInt64 inVal)
440
436
mPtr = (hx::Object *)new Int64Data (inVal);
441
437
}
442
438
439
+ Dynamic::Dynamic (unsigned long inVal)
440
+ {
441
+ if ( (int )inVal==inVal && inVal<256 )
442
+ {
443
+ int idx = inVal+1 ;
444
+ mPtr = sConstDynamicInts [idx].mPtr ;
445
+ if (!mPtr )
446
+ mPtr = sConstDynamicInts [idx].mPtr = new (hx::NewObjConst)IntData (inVal);
447
+ }
448
+ else
449
+ mPtr = (hx::Object *)new Int64Data (inVal);
450
+ }
451
+
443
452
444
453
445
454
Original file line number Diff line number Diff line change @@ -862,6 +862,14 @@ String::String(const cpp::UInt64 &inRHS)
862
862
__s = GCStringDup (buf,-1 ,&length);
863
863
}
864
864
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
+
865
873
String::String (const float &inRHS)
866
874
{
867
875
char buf[100 ];
You can’t perform that action at this time.
0 commit comments