diff --git a/engine/client/cl_frame.c b/engine/client/cl_frame.c index 170eedce..f956e8bf 100644 --- a/engine/client/cl_frame.c +++ b/engine/client/cl_frame.c @@ -95,8 +95,7 @@ static void CL_ResetPositions( cl_entity_t *ent ) ent->current_position = 1; memset( ent->ph, 0, sizeof( position_history_t ) * HISTORY_MAX ); - memcpy( &ent->ph[1], &store, sizeof( position_history_t )); - memcpy( &ent->ph[0], &store, sizeof( position_history_t )); + ent->ph[1] = ent->ph[0] = store; } /* @@ -752,7 +751,7 @@ static void CL_DeltaEntity( sizebuf_t *msg, frame_t *frame, int newnum, entity_s if( has_update ) alive = MSG_ReadDeltaEntity( msg, old, state, newnum, delta_type, cl.mtime[0] ); - else memcpy( state, old, sizeof( entity_state_t )); + else *state = *old; if( !alive ) { diff --git a/engine/client/cl_gameui.c b/engine/client/cl_gameui.c index 29344677..39fa8f41 100644 --- a/engine/client/cl_gameui.c +++ b/engine/client/cl_gameui.c @@ -1315,7 +1315,7 @@ qboolean UI_LoadProgs( void ) gameui.use_extended_api = false; // make local copy of engfuncs to prevent overwrite it with user dll - memcpy( &gpEngfuncs, &gEngfuncs, sizeof( gpEngfuncs )); + gpEngfuncs = gEngfuncs; gameui.mempool = Mem_AllocPool( "Menu Pool" ); @@ -1329,7 +1329,7 @@ qboolean UI_LoadProgs( void ) } // make local copy of engfuncs to prevent overwrite it with user dll - memcpy( &gpExtendedfuncs, &gExtendedfuncs, sizeof( gExtendedfuncs )); + gpExtendedfuncs = gExtendedfuncs; memset( &gameui.dllFuncs2, 0, sizeof( gameui.dllFuncs2 )); // try to initialize new extended API diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 95e320e0..cd90cd7b 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -2670,7 +2670,7 @@ void CL_ProcessFile( qboolean successfully_received, const char *filename ) else { Con_Printf( "Downloaded %i bytes for purported %i byte file, ignoring download\n", - cls.netchan.tempbuffersize, p->nDownloadSize ); + cls.netchan.tempbuffersize, p->nDownloadSize ); } if( cls.netchan.tempbuffer ) diff --git a/engine/client/cl_mobile.c b/engine/client/cl_mobile.c index 6c63ed4b..5c0da8f7 100644 --- a/engine/client/cl_mobile.c +++ b/engine/client/cl_mobile.c @@ -123,7 +123,7 @@ qboolean Mobile_Init( void ) { static mobile_engfuncs_t mobile_engfuncs; // keep a copy, don't let user change engine pointers - memcpy( &mobile_engfuncs, &gMobileEngfuncs, sizeof( mobile_engfuncs )); + mobile_engfuncs = gMobileEngfuncs; if( !ExportToClient( &mobile_engfuncs )) { diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index b7cc47a4..4dfe07e9 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -251,7 +251,7 @@ void CL_ParseMovevars( sizebuf_t *msg ) if( Q_strcmp( clgame.oldmovevars.skyName, clgame.movevars.skyName ) && cl.video_prepped ) R_SetupSky( clgame.movevars.skyName ); - memcpy( &clgame.oldmovevars, &clgame.movevars, sizeof( movevars_t )); + clgame.oldmovevars = clgame.movevars; clgame.entities->curstate.scale = clgame.movevars.waveHeight; // keep features an actual! @@ -1403,7 +1403,7 @@ void CL_UpdateUserinfo( sizebuf_t *msg, qboolean legacy ) if( !legacy ) MSG_ReadBytes( msg, player->hashedcdkey, sizeof( player->hashedcdkey )); - if( slot == cl.playernum ) memcpy( &gameui.playerinfo, player, sizeof( player_info_t )); + if( slot == cl.playernum ) gameui.playerinfo = *player; } else { diff --git a/engine/client/cl_qparse.c b/engine/client/cl_qparse.c index eb603b12..b9b4ed84 100644 --- a/engine/client/cl_qparse.c +++ b/engine/client/cl_qparse.c @@ -328,7 +328,7 @@ static void CL_ParseQuakeServerInfo( sizebuf_t *msg ) clgame.movevars.gravity = 800.0f; // quake doesn't write gravity in demos clgame.movevars.maxvelocity = 2000.0f; - memcpy( &clgame.oldmovevars, &clgame.movevars, sizeof( movevars_t )); + clgame.oldmovevars = clgame.movevars; } /* @@ -715,8 +715,7 @@ static void CL_ParseQuakeBaseline( sizebuf_t *msg ) ent = CL_EDICT_NUM( newnum ); ent->index = newnum; ent->player = CL_IsPlayerIndex( newnum ); - memcpy( &ent->baseline, &state, sizeof( entity_state_t )); - memcpy( &ent->prevstate, &state, sizeof( entity_state_t )); + ent->prevstate = ent->baseline = state; } /* diff --git a/engine/client/ref_common.c b/engine/client/ref_common.c index a4d04b0f..a5d0e494 100644 --- a/engine/client/ref_common.c +++ b/engine/client/ref_common.c @@ -491,7 +491,7 @@ static qboolean R_LoadProgs( const char *name ) } // make local copy of engfuncs to prevent overwrite it with user dll - memcpy( &gpEngfuncs, &gEngfuncs, sizeof( gpEngfuncs )); + gpEngfuncs = gEngfuncs; if( GetRefAPI( REF_API_VERSION, &ref.dllFuncs, &gpEngfuncs, &refState ) != REF_API_VERSION ) { diff --git a/engine/client/vgui/vgui_draw.c b/engine/client/vgui/vgui_draw.c index 1f0d65b9..4d7d35a4 100644 --- a/engine/client/vgui/vgui_draw.c +++ b/engine/client/vgui/vgui_draw.c @@ -282,7 +282,7 @@ qboolean VGui_LoadProgs( HINSTANCE hInstance ) void (*F)( vguiapi_t* ); qboolean client = hInstance != NULL; - memcpy( &vgui.dllFuncs, &gEngfuncs, sizeof( vgui.dllFuncs )); + vgui.dllFuncs = gEngfuncs; // not loading interface from client.dll, load vgui_support.dll instead if( !client ) @@ -373,7 +373,7 @@ void VGui_Shutdown( void ) COM_FreeLibrary( vgui.hInstance ); // drop pointers to now unloaded vgui_support - memcpy( &vgui.dllFuncs, &gEngfuncs, sizeof( vgui.dllFuncs )); + vgui.dllFuncs = gEngfuncs; vgui.hInstance = NULL; }