engine: use zero initializers instead of memset
This commit is contained in:
parent
04125284a3
commit
49426721d8
4 changed files with 5 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Add table
Reference in a new issue