mirror of
https://github.com/zeldaret/tww.git
synced 2026-07-07 21:30:47 -04:00
functionvalue matches and cleanup
This commit is contained in:
@@ -6,14 +6,19 @@
|
||||
namespace JGadget {
|
||||
template <typename T>
|
||||
struct TAllocator {
|
||||
static TAllocator get() { }
|
||||
// TODO: this constructor declaration needs to be removed in order to match TFunctionValue_composite's constructor
|
||||
// in functionvalue.cpp, and in order to get the @564 struct literal to appear in the .sbss section of that TU.
|
||||
// however, removing this declaration also causes that bss literal to appear in hundreds of other TUs it shouldn't.
|
||||
TAllocator();
|
||||
|
||||
inline TAllocator();
|
||||
// TODO
|
||||
void AllocateRaw(u32) {}
|
||||
void DeallocateRaw(void*) {}
|
||||
void allocate(u32, const void*) {}
|
||||
void deallocate(T*, u32) {}
|
||||
void destroy(T*) {}
|
||||
|
||||
/* 0x00 */ u8 _00;
|
||||
/* 0x04 */ u32 _04;
|
||||
/* 0x08 */ u32 _08;
|
||||
/* 0x0C */ u32 _0C;
|
||||
};
|
||||
|
||||
typedef TAllocator<void*> TVoidAllocator;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace JGadget {
|
||||
template <typename T>
|
||||
inline const T& toValueFromIndex(int idx, const T* pValue, u32 count, const T& fallback) {
|
||||
ASSERT(pValue != NULL);
|
||||
return (idx >= count) ? fallback : pValue[idx];
|
||||
return (idx < count) ? pValue[idx] : fallback;
|
||||
}
|
||||
|
||||
} // namespace JGadget
|
||||
|
||||
@@ -76,8 +76,7 @@ public:
|
||||
|
||||
class TFunctionValueAttribute_refer : public JGadget::TVector_pointer<TFunctionValue*> {
|
||||
public:
|
||||
TFunctionValueAttribute_refer() :
|
||||
JGadget::TVector_pointer<TFunctionValue*>(JGadget::TAllocator<void*>()) {}
|
||||
TFunctionValueAttribute_refer() : JGadget::TVector_pointer<TFunctionValue*>(JGadget::TAllocator<void*>()) {}
|
||||
~TFunctionValueAttribute_refer() {}
|
||||
|
||||
void refer_initialize();
|
||||
|
||||
Reference in New Issue
Block a user