You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LibGens and namely LibGens::File class use size_t type for reading/writing addresses stored in files. size_t is unsigned int on 32-bit systems, but for 64-bit ones it is unsigned long int (8 bytes). This breaks code portability. readInt32A and readInt32BEA, as well as corresponding write functions, are supposed to always read 32-bit value even on 64-bit systems for file formats compatibility. There are different ways to approach this, and I'm not sure what would be the correct one.
Replace size_t by unsigned int where needed. This should be save as long as it's used for file offsets, and not for memory pointers, but might require a lot of code edits.
Introduce a custom typedef for unsigned int. The rest is the same as first.
Modify read functions to ensure they always read 4 bytes and then properly put them into 8 bytes size_t variables, as well as do the opposite to write. The easiest, but seems like a hack to me.
The text was updated successfully, but these errors were encountered:
LibGens and namely LibGens::File class use size_t type for reading/writing addresses stored in files.
size_t is unsigned int on 32-bit systems, but for 64-bit ones it is unsigned long int (8 bytes). This breaks code portability.
readInt32A and readInt32BEA, as well as corresponding write functions, are supposed to always read 32-bit value even on 64-bit systems for file formats compatibility. There are different ways to approach this, and I'm not sure what would be the correct one.
The text was updated successfully, but these errors were encountered: