diff --git a/engine/client/cl_demo.c b/engine/client/cl_demo.c index 82d26bb1..d0bd9e45 100644 --- a/engine/client/cl_demo.c +++ b/engine/client/cl_demo.c @@ -624,11 +624,10 @@ static void CL_ReadDemoUserCmd( qboolean discard ) if( !discard ) { - usercmd_t nullcmd; + const usercmd_t nullcmd = { 0 }; sizebuf_t buf; demoangle_t *a; - memset( &nullcmd, 0, sizeof( nullcmd )); MSG_Init( &buf, "UserCmd", data, sizeof( data )); // a1ba: I have no proper explanation why diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 4d5fd66a..b0a52535 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -593,7 +593,7 @@ CL_CreateCmd */ static void CL_CreateCmd( void ) { - usercmd_t nullcmd, *cmd; + usercmd_t nullcmd = { 0 }, *cmd; runcmd_t *pcmd; qboolean active; double accurate_ms; @@ -645,7 +645,6 @@ static void CL_CreateCmd( void ) } else { - memset( &nullcmd, 0, sizeof( nullcmd )); cmd = &nullcmd; } diff --git a/engine/common/hpak.c b/engine/common/hpak.c index 1939010a..d5d4b3f6 100644 --- a/engine/common/hpak.c +++ b/engine/common/hpak.c @@ -104,7 +104,7 @@ static void HPAK_CreatePak( const char *filename, resource_t *pResource, byte *p string pakname; byte md5[16]; file_t *fout; - MD5Context_t ctx; + MD5Context_t ctx = { 0 }; if( !COM_CheckString( filename )) return; @@ -125,7 +125,6 @@ static void HPAK_CreatePak( const char *filename, resource_t *pResource, byte *p } // let's hash it. - memset( &ctx, 0, sizeof( MD5Context_t )); MD5Init( &ctx ); if( pData == NULL ) @@ -214,7 +213,7 @@ void HPAK_AddLump( qboolean bUseQueue, const char *name, resource_t *pResource, file_t *file_src; file_t *file_dst; byte md5[16]; - MD5Context_t ctx; + MD5Context_t ctx = { 0 }; if( pData == NULL && pFile == NULL ) return; @@ -226,7 +225,6 @@ void HPAK_AddLump( qboolean bUseQueue, const char *name, resource_t *pResource, } // hash it - memset( &ctx, 0, sizeof( MD5Context_t )); MD5Init( &ctx ); if( !pData ) diff --git a/engine/common/identification.c b/engine/common/identification.c index 376d35cd..3b2b65c3 100644 --- a/engine/common/identification.c +++ b/engine/common/identification.c @@ -611,7 +611,7 @@ void GAME_EXPORT ID_SetCustomClientID( const char *id ) void ID_Init( void ) { - MD5Context_t hash = {0}; + MD5Context_t hash = { 0 }; byte md5[16]; int i;