mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-12-25 10:16:53 +01:00
engine: add checks to verify resource_t, customization_t and HPAK data structs sizes
This commit is contained in:
parent
2f26fcdc2a
commit
a7d63649f8
@ -76,6 +76,8 @@ typedef struct
|
|||||||
int infotableofs;
|
int infotableofs;
|
||||||
} hpak_header_t;
|
} hpak_header_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( hpak_header_t ) == 12, "invalid hpak_header_t size" );
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
dresource_t resource;
|
dresource_t resource;
|
||||||
@ -83,6 +85,8 @@ typedef struct
|
|||||||
int disksize;
|
int disksize;
|
||||||
} hpak_lump_t;
|
} hpak_lump_t;
|
||||||
|
|
||||||
|
STATIC_ASSERT( sizeof( hpak_lump_t ) == 144, "invalid hpak_lump_t size" );
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
|
@ -90,4 +90,12 @@ typedef struct customization_s
|
|||||||
#define FCUST_WIPEDATA ( 1<<1 )
|
#define FCUST_WIPEDATA ( 1<<1 )
|
||||||
#define FCUST_IGNOREINIT ( 1<<2 )
|
#define FCUST_IGNOREINIT ( 1<<2 )
|
||||||
|
|
||||||
|
#if !XASH_64BIT
|
||||||
|
STATIC_ASSERT( sizeof( customization_t ) == 164, "invalid customization_t size, broken API" );
|
||||||
|
STATIC_ASSERT( sizeof( resource_t ) == 136, "invalid resource_t size, broken API" );
|
||||||
|
#else
|
||||||
|
STATIC_ASSERT( sizeof( customization_t ) == 192, "invalid customization_t size, broken API" );
|
||||||
|
STATIC_ASSERT( sizeof( resource_t ) == 144, "invalid resource_t size, broken API" );
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // CUSTOM_H
|
#endif // CUSTOM_H
|
||||||
|
Loading…
Reference in New Issue
Block a user