Skip to content

Commit ff2b514

Browse files
authored
fix gcc 12.1 compilation (alliedmodders#1056)
Co-authored-by: Flummi <[email protected]>
1 parent df6b589 commit ff2b514

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

modules/cstrike/csx/CMisc.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ void CPlayer::Connect(const char* address ){
127127

128128
void CPlayer::restartStats(bool all)
129129
{
130-
if ( all ) memset(weapons,0,sizeof(weapons));
131-
memset(weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats
132-
memset(attackers,0,sizeof(attackers));
133-
memset(victims,0,sizeof(victims));
130+
if ( all ) memset(&weapons,0,sizeof(weapons));
131+
memset(&weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats
132+
memset(&attackers,0,sizeof(attackers));
133+
memset(&victims,0,sizeof(victims));
134134
life = {};
135135
}
136136

modules/dod/dodx/CMisc.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ void CPlayer::restartStats(bool all)
9494
{
9595
if ( all )
9696
{
97-
memset(weapons,0,sizeof(weapons));
97+
memset(&weapons,0,sizeof(weapons));
9898
memset(static_cast<void *>(&round),0,sizeof(round));
99-
memset(weaponsRnd,0,sizeof(weaponsRnd));
99+
memset(&weaponsRnd,0,sizeof(weaponsRnd));
100100
}
101101

102-
memset(weaponsLife,0,sizeof(weaponsLife)); //DEC-Weapon (Round) stats
103-
memset(attackers,0,sizeof(attackers));
104-
memset(victims,0,sizeof(victims));
102+
memset(&weaponsLife,0,sizeof(weaponsLife)); //DEC-Weapon (Round) stats
103+
memset(&attackers,0,sizeof(attackers));
104+
memset(&victims,0,sizeof(victims));
105105
life = {};
106106
}
107107

modules/dod/dodx/moduleconfig.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void PlayerPreThink_Post(edict_t *pEntity)
173173
{
174174
pPlayer->clearRound = 0.0f;
175175
memset(static_cast<void *>(&pPlayer->round),0,sizeof(pPlayer->round));
176-
memset(pPlayer->weaponsRnd,0,sizeof(pPlayer->weaponsRnd));
176+
memset(&pPlayer->weaponsRnd,0,sizeof(pPlayer->weaponsRnd));
177177
}
178178

179179
if (pPlayer->sendScore && pPlayer->sendScore < gpGlobals->time)

modules/mysqlx/AMBuilder

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ if AMXX.mysql_path:
1717

1818
binary.sources = []
1919

20-
if builder.target_platform is 'linux' or builder.target_platform is 'mac':
20+
if builder.target_platform == 'linux' or builder.target_platform == 'mac':
2121
binary.compiler.defines += ['stricmp=strcasecmp']
2222
binary.compiler.linkflags += [
2323
os.path.join(AMXX.mysql_path, 'lib', 'libmysqlclient_r.a'),
2424
'-lpthread',
2525
'-lm',
2626
]
27-
if builder.target_platform is 'linux':
27+
if builder.target_platform == 'linux':
2828
binary.compiler.linkflags += [
2929
'-lrt'
3030
]
31-
elif builder.target_platform is 'windows':
31+
elif builder.target_platform == 'windows':
3232
binary.compiler.linkflags += [
3333
os.path.join(AMXX.mysql_path, 'lib', 'mysqlclient.lib'),
3434
'ws2_32.lib',

modules/sqlite/AMBuilder

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ binary.compiler.defines += [
1212
'HAVE_STDINT_H',
1313
]
1414

15-
if builder.target_platform is 'linux' or builder.target_platform is 'mac':
15+
if builder.target_platform == 'linux' or builder.target_platform == 'mac':
1616
binary.compiler.defines += ['stricmp=strcasecmp']
1717
binary.compiler.postlink += ['-lpthread']
1818

modules/tfcx/CMisc.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ void CPlayer::Connect(const char* address ){
126126

127127
void CPlayer::restartStats(bool all)
128128
{
129-
if ( all ) memset(weapons,0,sizeof(weapons));
130-
memset(weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats
131-
memset(attackers,0,sizeof(attackers));
132-
memset(victims,0,sizeof(victims));
129+
if ( all ) memset(&weapons,0,sizeof(weapons));
130+
memset(&weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats
131+
memset(&attackers,0,sizeof(attackers));
132+
memset(&victims,0,sizeof(victims));
133133
life = {};
134134
}
135135

modules/ts/tsx/CMisc.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ void CPlayer::Connect(const char* ippp)
7878

7979
void CPlayer::restartStats(bool all)
8080
{
81-
if ( all ) memset(weapons,0,sizeof(weapons));
82-
memset(weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats
83-
memset(attackers,0,sizeof(attackers));
84-
memset(victims,0,sizeof(victims));
81+
if ( all ) memset(&weapons,0,sizeof(weapons));
82+
memset(&weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats
83+
memset(&attackers,0,sizeof(attackers));
84+
memset(&victims,0,sizeof(victims));
8585
life = {};
8686
}
8787

third_party/zlib/AMBuilder

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import os, platform
33

44
lib = builder.compiler.StaticLibrary('zlib')
55

6-
if builder.target_platform is 'linux' or builder.target_platform is 'mac':
6+
if builder.target_platform == 'linux' or builder.target_platform == 'mac':
77
lib.compiler.defines += [
88
'HAVE_UNISTD_H'
99
]

0 commit comments

Comments
 (0)