From ff2b5142f9c4213beee8646d50609cfed315202e Mon Sep 17 00:00:00 2001 From: SW Date: Mon, 18 Jul 2022 03:05:27 +0200 Subject: [PATCH] fix gcc 12.1 compilation (#1056) Co-authored-by: Flummi --- modules/cstrike/csx/CMisc.cpp | 8 ++++---- modules/dod/dodx/CMisc.cpp | 10 +++++----- modules/dod/dodx/moduleconfig.cpp | 2 +- modules/mysqlx/AMBuilder | 6 +++--- modules/sqlite/AMBuilder | 2 +- modules/tfcx/CMisc.cpp | 8 ++++---- modules/ts/tsx/CMisc.cpp | 8 ++++---- third_party/zlib/AMBuilder | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/modules/cstrike/csx/CMisc.cpp b/modules/cstrike/csx/CMisc.cpp index 101dfbe9..97f15a09 100644 --- a/modules/cstrike/csx/CMisc.cpp +++ b/modules/cstrike/csx/CMisc.cpp @@ -127,10 +127,10 @@ void CPlayer::Connect(const char* address ){ void CPlayer::restartStats(bool all) { - if ( all ) memset(weapons,0,sizeof(weapons)); - memset(weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats - memset(attackers,0,sizeof(attackers)); - memset(victims,0,sizeof(victims)); + if ( all ) memset(&weapons,0,sizeof(weapons)); + memset(&weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats + memset(&attackers,0,sizeof(attackers)); + memset(&victims,0,sizeof(victims)); life = {}; } diff --git a/modules/dod/dodx/CMisc.cpp b/modules/dod/dodx/CMisc.cpp index 34d45f05..55ff1830 100644 --- a/modules/dod/dodx/CMisc.cpp +++ b/modules/dod/dodx/CMisc.cpp @@ -94,14 +94,14 @@ void CPlayer::restartStats(bool all) { if ( all ) { - memset(weapons,0,sizeof(weapons)); + memset(&weapons,0,sizeof(weapons)); memset(static_cast(&round),0,sizeof(round)); - memset(weaponsRnd,0,sizeof(weaponsRnd)); + memset(&weaponsRnd,0,sizeof(weaponsRnd)); } - memset(weaponsLife,0,sizeof(weaponsLife)); //DEC-Weapon (Round) stats - memset(attackers,0,sizeof(attackers)); - memset(victims,0,sizeof(victims)); + memset(&weaponsLife,0,sizeof(weaponsLife)); //DEC-Weapon (Round) stats + memset(&attackers,0,sizeof(attackers)); + memset(&victims,0,sizeof(victims)); life = {}; } diff --git a/modules/dod/dodx/moduleconfig.cpp b/modules/dod/dodx/moduleconfig.cpp index 8ca5851a..6009d729 100644 --- a/modules/dod/dodx/moduleconfig.cpp +++ b/modules/dod/dodx/moduleconfig.cpp @@ -173,7 +173,7 @@ void PlayerPreThink_Post(edict_t *pEntity) { pPlayer->clearRound = 0.0f; memset(static_cast(&pPlayer->round),0,sizeof(pPlayer->round)); - memset(pPlayer->weaponsRnd,0,sizeof(pPlayer->weaponsRnd)); + memset(&pPlayer->weaponsRnd,0,sizeof(pPlayer->weaponsRnd)); } if (pPlayer->sendScore && pPlayer->sendScore < gpGlobals->time) diff --git a/modules/mysqlx/AMBuilder b/modules/mysqlx/AMBuilder index 7c7bcc93..afe86a12 100644 --- a/modules/mysqlx/AMBuilder +++ b/modules/mysqlx/AMBuilder @@ -17,18 +17,18 @@ if AMXX.mysql_path: binary.sources = [] - if builder.target_platform is 'linux' or builder.target_platform is 'mac': + if builder.target_platform == 'linux' or builder.target_platform == 'mac': binary.compiler.defines += ['stricmp=strcasecmp'] binary.compiler.linkflags += [ os.path.join(AMXX.mysql_path, 'lib', 'libmysqlclient_r.a'), '-lpthread', '-lm', ] - if builder.target_platform is 'linux': + if builder.target_platform == 'linux': binary.compiler.linkflags += [ '-lrt' ] - elif builder.target_platform is 'windows': + elif builder.target_platform == 'windows': binary.compiler.linkflags += [ os.path.join(AMXX.mysql_path, 'lib', 'mysqlclient.lib'), 'ws2_32.lib', diff --git a/modules/sqlite/AMBuilder b/modules/sqlite/AMBuilder index 581e307f..644a8cf3 100644 --- a/modules/sqlite/AMBuilder +++ b/modules/sqlite/AMBuilder @@ -12,7 +12,7 @@ binary.compiler.defines += [ 'HAVE_STDINT_H', ] -if builder.target_platform is 'linux' or builder.target_platform is 'mac': +if builder.target_platform == 'linux' or builder.target_platform == 'mac': binary.compiler.defines += ['stricmp=strcasecmp'] binary.compiler.postlink += ['-lpthread'] diff --git a/modules/tfcx/CMisc.cpp b/modules/tfcx/CMisc.cpp index 6733b875..7e53b4e7 100644 --- a/modules/tfcx/CMisc.cpp +++ b/modules/tfcx/CMisc.cpp @@ -126,10 +126,10 @@ void CPlayer::Connect(const char* address ){ void CPlayer::restartStats(bool all) { - if ( all ) memset(weapons,0,sizeof(weapons)); - memset(weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats - memset(attackers,0,sizeof(attackers)); - memset(victims,0,sizeof(victims)); + if ( all ) memset(&weapons,0,sizeof(weapons)); + memset(&weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats + memset(&attackers,0,sizeof(attackers)); + memset(&victims,0,sizeof(victims)); life = {}; } diff --git a/modules/ts/tsx/CMisc.cpp b/modules/ts/tsx/CMisc.cpp index 316254e8..e42cdfcd 100644 --- a/modules/ts/tsx/CMisc.cpp +++ b/modules/ts/tsx/CMisc.cpp @@ -78,10 +78,10 @@ void CPlayer::Connect(const char* ippp) void CPlayer::restartStats(bool all) { - if ( all ) memset(weapons,0,sizeof(weapons)); - memset(weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats - memset(attackers,0,sizeof(attackers)); - memset(victims,0,sizeof(victims)); + if ( all ) memset(&weapons,0,sizeof(weapons)); + memset(&weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats + memset(&attackers,0,sizeof(attackers)); + memset(&victims,0,sizeof(victims)); life = {}; } diff --git a/third_party/zlib/AMBuilder b/third_party/zlib/AMBuilder index 02a9175b..df1856cf 100644 --- a/third_party/zlib/AMBuilder +++ b/third_party/zlib/AMBuilder @@ -3,7 +3,7 @@ import os, platform lib = builder.compiler.StaticLibrary('zlib') -if builder.target_platform is 'linux' or builder.target_platform is 'mac': +if builder.target_platform == 'linux' or builder.target_platform == 'mac': lib.compiler.defines += [ 'HAVE_UNISTD_H' ]