Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Haxe 3 Code #1083

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions hxcpp/StaticMysql.hx

This file was deleted.

23 changes: 0 additions & 23 deletions hxcpp/StaticRegexp.hx

This file was deleted.

24 changes: 0 additions & 24 deletions hxcpp/StaticSqlite.hx

This file was deleted.

25 changes: 0 additions & 25 deletions hxcpp/StaticStd.hx

This file was deleted.

29 changes: 0 additions & 29 deletions hxcpp/StaticZlib.hx

This file was deleted.

101 changes: 1 addition & 100 deletions include/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES ArrayCommon : public hx::Object
// Plain old data element size - or 0 if not plain-old-data
int getArrayConvertId() const { return mArrayConvertId; }

#if (HXCPP_API_LEVEL>330)
virtual hx::Object *__GetRealObject() { return this; }
#endif
};

// --- hx::ArrayBase ----------------------------------------------------
Expand Down Expand Up @@ -174,11 +172,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES ArrayBase : public ArrayCommon
hx::Class __GetClass() const { return __mClass; }
String toString();
String __ToString() const;


#if (HXCPP_API_LEVEL>330)
int __Compare(const hx::Object *inRHS) const;
#endif


void setData(void *inData, int inElements)
Expand Down Expand Up @@ -248,39 +242,6 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES ArrayBase : public ArrayCommon
// Dynamic interface
hx::Val __Field(const String &inString ,hx::PropertyAccess inCallProp);

#if (HXCPP_API_LEVEL < 330)
virtual Dynamic __concat(const Dynamic &a0) = 0;
virtual Dynamic __copy() = 0;
virtual Dynamic __insert(const Dynamic &a0,const Dynamic &a1) = 0;
virtual Dynamic __iterator() = 0;
virtual Dynamic __keyValueIterator() = 0;
virtual Dynamic __join(const Dynamic &a0) = 0;
virtual Dynamic __pop() = 0;
virtual Dynamic __push(const Dynamic &a0) = 0;
virtual Dynamic __remove(const Dynamic &a0) = 0;
virtual Dynamic __removeAt(const Dynamic &a0) = 0;
virtual Dynamic __indexOf(const Dynamic &a0,const Dynamic &a1) = 0;
virtual Dynamic __lastIndexOf(const Dynamic &a0,const Dynamic &a1) = 0;
virtual Dynamic __reverse() = 0;
virtual Dynamic __shift() = 0;
virtual Dynamic __slice(const Dynamic &a0,const Dynamic &a1) = 0;
virtual Dynamic __splice(const Dynamic &a0,const Dynamic &a1) =0;
virtual Dynamic __sort(const Dynamic &a0) = 0;
virtual Dynamic __toString() = 0;
virtual Dynamic __unshift(const Dynamic &a0) = 0;
virtual Dynamic __map(const Dynamic &func) = 0;
virtual Dynamic __filter(const Dynamic &func) = 0;
inline Dynamic ____SetSize(const Dynamic &len) { resize(len); return this; }
inline Dynamic ____SetSizeExact(const Dynamic &len) { __SetSizeExact(len); return this; }
inline Dynamic ____unsafe_set(const Dynamic &i, const Dynamic &val) { return __SetItem(i,val); }
inline Dynamic ____unsafe_get(const Dynamic &i) { return __GetItem(i); }
virtual Dynamic __blit(const Dynamic &a0,const Dynamic &a1,const Dynamic &a2,const Dynamic &a3) = 0;
inline Dynamic __zero(const Dynamic &a0,const Dynamic &a1) { zero(a0,a1); return null(); }
virtual Dynamic __memcmp(const Dynamic &a0) = 0;
virtual void __qsort(Dynamic inCompare) = 0;
virtual Dynamic __resize(const Dynamic &a0) = 0;

#else
inline void ____SetSize(int len) { resize(len); }
inline void ____SetSizeExact(int len) { __SetSizeExact(len); }
inline Dynamic ____unsafe_set(const Dynamic &i, const Dynamic &val) { return __SetItem(i,val); }
Expand Down Expand Up @@ -316,7 +277,6 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES ArrayBase : public ArrayCommon

virtual void set(int inIdx, const cpp::Variant &inValue) = 0;
virtual void setUnsafe(int inIdx, const cpp::Variant &inValue) = 0;
#endif

Dynamic concat_dyn();
Dynamic copy_dyn();
Expand Down Expand Up @@ -420,9 +380,7 @@ namespace cpp
}


#if (HXCPP_API_LEVEL>=330)
#include "cpp/VirtualArray.h"
#endif



Expand Down Expand Up @@ -515,13 +473,10 @@ class Array_obj : public hx::ArrayBase
static Array<ELEM_> __newConstWrapper(ELEM_ *inData,int inSize);
static Array<ELEM_> fromData(const ELEM_ *inData,int inCount);


#if (HXCPP_API_LEVEL>331)
bool _hx_isInstanceOf(int inClassId)
{
return inClassId==1 || inClassId==(int)hx::clsIdArrayBase || inClassId==(int)_hx_ClassId;
}
#endif

virtual bool AllocAtomic() const { return !hx::ContainsPointers<ELEM_>(); }

Expand Down Expand Up @@ -768,11 +723,7 @@ class Array_obj : public hx::ArrayBase
hx::ArrayBase::Splice(0,inPos,len);
}

#if HXCPP_API_LEVEL>=330
cpp::VirtualArray map(Dynamic inFunc);
#else
Dynamic map(Dynamic inFunc);
#endif
Array<ELEM_> filter(Dynamic inFunc);

void insert(int inPos, ELEM_ inValue)
Expand Down Expand Up @@ -879,34 +830,6 @@ class Array_obj : public hx::ArrayBase


// Dynamic interface
#if (HXCPP_API_LEVEL < 330)
virtual Dynamic __concat(const Dynamic &a0) { return concat(a0); }
virtual Dynamic __copy() { return copy(); }
virtual Dynamic __insert(const Dynamic &a0,const Dynamic &a1) { insert(a0,a1); return null(); }
virtual Dynamic __iterator() { return iterator(); }
virtual Dynamic __keyValueIterator() { return keyValueIterator(); }
virtual Dynamic __join(const Dynamic &a0) { return join(a0); }
virtual Dynamic __pop() { return pop(); }
virtual Dynamic __push(const Dynamic &a0) { return push(a0);}
virtual Dynamic __remove(const Dynamic &a0) { return remove(a0); }
virtual Dynamic __removeAt(const Dynamic &a0) { return removeAt(a0); }
virtual Dynamic __indexOf(const Dynamic &a0,const Dynamic &a1) { return indexOf(a0, a1); }
virtual Dynamic __lastIndexOf(const Dynamic &a0,const Dynamic &a1) { return lastIndexOf(a0, a1); }
virtual Dynamic __reverse() { reverse(); return null(); }
virtual Dynamic __shift() { return shift(); }
virtual Dynamic __slice(const Dynamic &a0,const Dynamic &a1) { return slice(a0,a1); }
virtual Dynamic __splice(const Dynamic &a0,const Dynamic &a1) { return splice(a0,a1); }
virtual Dynamic __sort(const Dynamic &a0) { sort(a0); return null(); }
virtual Dynamic __toString() { return toString(); }
virtual Dynamic __unshift(const Dynamic &a0) { unshift(a0); return null(); }
virtual Dynamic __map(const Dynamic &func) { return map(func); }
virtual Dynamic __filter(const Dynamic &func) { return filter(func); }
virtual Dynamic __blit(const Dynamic &a0,const Dynamic &a1,const Dynamic &a2,const Dynamic &a3) { blit(a0,a1,a2,a3); return null(); }
virtual Dynamic __memcmp(const Dynamic &a0) { return memcmp(a0); }
virtual Dynamic __resize(const Dynamic &a0) { resize(a0); return null(); }
virtual void __qsort(Dynamic inCompare) { this->qsort(inCompare); };
#else //(HXCPP_API_LEVEL < 330)

virtual hx::ArrayBase *__concat(const cpp::VirtualArray &a0) { return concat(a0).mPtr; }
virtual hx::ArrayBase *__copy() { return copy().mPtr; }
virtual void __insert(int inIndex,const Dynamic &a1) { insert(inIndex,a1);}
Expand Down Expand Up @@ -950,9 +873,6 @@ class Array_obj : public hx::ArrayBase
elem = ELEM_(inValue);
if (hx::ContainsPointers<ELEM_>()) { HX_OBJ_WB_GET(this,hx::PointerOf(elem)); }
}


#endif
};


Expand Down Expand Up @@ -1123,12 +1043,8 @@ class Array : public hx::ObjectPtr< Array_obj<ELEM_> >
return *this;
}


#if (HXCPP_API_LEVEL >= 330)
inline bool operator==(const cpp::VirtualArray &varray) const { return varray==*this; }
inline bool operator!=(const cpp::VirtualArray &varray) const { return varray!=*this; }
#endif


inline ELEM_ &operator[](int inIdx) { return CheckGetPtr()->Item(inIdx); }
inline ELEM_ operator[](int inIdx) const { return CheckGetPtr()->__get(inIdx); }
Expand Down Expand Up @@ -1258,8 +1174,6 @@ inline typename ARRAY::Elem _hx_array_unsafe_get(ARRAY inArray, int inIndex)
#include "cpp/VirtualArray.h"
#endif


#if HXCPP_API_LEVEL >= 330
template<typename ELEM_>
cpp::VirtualArray Array_obj<ELEM_>::map(Dynamic inFunc)
{
Expand All @@ -1269,17 +1183,4 @@ cpp::VirtualArray Array_obj<ELEM_>::map(Dynamic inFunc)
return result;
}

#else
template<typename ELEM_>
Dynamic Array_obj<ELEM_>::map(Dynamic inFunc)
{
Array_obj<Dynamic> *result = new Array_obj<Dynamic>(length,0);
for(int i=0;i<length;i++)
result->__unsafe_set(i,inFunc(__unsafe_get(i)));
return result;
}
#endif



#endif
#endif
20 changes: 0 additions & 20 deletions include/Dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES Dynamic : public hx::ObjectPtr<hx::Object>
{
if (mPtr==0) return inRHS.mPtr==0 ? 0 : -1;
if (inRHS.mPtr==0) return -1;
#if (HXCPP_API_LEVEL>=331)
return mPtr->__Compare(inRHS.mPtr);
#else
return mPtr->__Compare(inRHS.mPtr->__GetRealObject());
#endif
}

bool operator==(const null &inRHS) const { return mPtr==0; }
Expand All @@ -146,11 +142,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES Dynamic : public hx::ObjectPtr<hx::Object>
//if (mPtr==inRHS.mPtr) return true;
if (!mPtr && !inRHS.mPtr) return true;
if (!mPtr || !inRHS.mPtr) return false;
#if (HXCPP_API_LEVEL>=331)
return mPtr->__Compare(inRHS.mPtr)==0;
#else
return mPtr->__Compare(inRHS.mPtr->__GetRealObject())==0;
#endif
}

bool operator != (const Dynamic &inRHS) const
Expand All @@ -159,11 +151,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES Dynamic : public hx::ObjectPtr<hx::Object>
//if (mPtr==inRHS.mPtr) return true;
if (!mPtr && !inRHS.mPtr) return false;
if (!mPtr || !inRHS.mPtr) return true;
#if (HXCPP_API_LEVEL>=331)
return mPtr->__Compare(inRHS.mPtr)!=0;
#else
return mPtr->__Compare(inRHS.mPtr->__GetRealObject())!=0;
#endif
}


Expand Down Expand Up @@ -217,23 +205,15 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES Dynamic : public hx::ObjectPtr<hx::Object>
{
if (mPtr==inRHS.mPtr) return true;
if (!mPtr || !inRHS.mPtr) return false;
#if (HXCPP_API_LEVEL>=331)
return mPtr == inRHS.mPtr;
#else
return mPtr->__GetRealObject() == inRHS.mPtr->__GetRealObject();
#endif
}

template<typename T_>
bool operator!=(const hx::ObjectPtr<T_> &inRHS) const
{
if (mPtr==inRHS.mPtr) return false;
if (!mPtr || !inRHS.mPtr) return true;
#if (HXCPP_API_LEVEL>=331)
return mPtr != inRHS.mPtr;
#else
return mPtr->__GetRealObject() != inRHS.mPtr->__GetRealObject();
#endif
}


Expand Down
Loading