Skip to content

Commit 0e6a476

Browse files
committed
refactor: use RETAIL_COMPATIBLE_XFER_SAVE flag and change glueEnforcer to void
1 parent 04ebb42 commit 0e6a476

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

Core/Libraries/Source/WWVegas/WWLib/always.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private: \
144144
return The##ARGCLASS##Pool; \
145145
} \
146146
protected: \
147-
virtual int glueEnforcer() const { return sizeof(*this); } \
147+
virtual void glueEnforcer() const { } \
148148
public: \
149149
inline void* operator new(size_t s) { return allocateFromW3DMemPool(getClassMemoryPool(), s); } \
150150
inline void operator delete(void *p) { freeFromW3DMemPool(getClassMemoryPool(), p); } \
@@ -162,7 +162,7 @@ class W3DMPO
162162
}
163163
protected:
164164
// we never call this; it is present to cause compile errors in descendent classes
165-
virtual int glueEnforcer() const = 0;
165+
virtual void glueEnforcer() const = 0;
166166
public:
167167
virtual ~W3DMPO() { /* nothing */ }
168168
};

Generals/Code/GameEngine/Include/Common/BitFlagsIO.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,10 @@ void BitFlags<NUMBITS>::xfer(Xfer* xfer)
214214
{
215215

216216
// just call the xfer implementation on the data values
217-
// TheSuperHackers @bugfix bobtista 05/12/2025 Fix sizeof(this) bug
218-
// Original code used sizeof(this) which is pointer size
219-
#ifndef RETAIL_COMPATIBLE_CRC
220-
xfer->xferUser( this, sizeof( *this ) );
221-
#else
217+
#if RETAIL_COMPATIBLE_XFER_SAVE
222218
xfer->xferUser( this, sizeof( this ) );
219+
#else
220+
xfer->xferUser( this, sizeof( *this ) );
223221
#endif
224222

225223
}

GeneralsMD/Code/GameEngine/Include/Common/BitFlagsIO.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,10 @@ void BitFlags<NUMBITS>::xfer(Xfer* xfer)
214214
{
215215

216216
// just call the xfer implementation on the data values
217-
// TheSuperHackers @bugfix bobtista 05/12/2025 Fix sizeof(this) bug
218-
// Original code used sizeof(this) which is pointer size
219-
#ifndef RETAIL_COMPATIBLE_CRC
220-
xfer->xferUser( this, sizeof( *this ) );
221-
#else
217+
#if RETAIL_COMPATIBLE_XFER_SAVE
222218
xfer->xferUser( this, sizeof( this ) );
219+
#else
220+
xfer->xferUser( this, sizeof( *this ) );
223221
#endif
224222

225223
}

0 commit comments

Comments
 (0)