Skip to content

Commit 308ee84

Browse files
committed
Renamed bswap macros
1 parent e3000e8 commit 308ee84

31 files changed

+191
-179
lines changed

game/source/cseries/cseries.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ int32 __cdecl ascii_stricmp(char const* s1, char const* s2)
351351

352352
char* tag_to_string(tag _tag, char* buffer)
353353
{
354-
*(tag*)buffer = bswap_dword(_tag);
354+
*(tag*)buffer = bswap_uint32(_tag);
355355
buffer[4] = 0;
356356

357357
return buffer;

game/source/cseries/cseries.hpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,67 +1349,67 @@ struct c_static_string
13491349
return csstrnlen(m_string, k_maximum_count);
13501350
}
13511351

1352-
bool is_equal(char const* _string) const
1352+
bool is_equal(char const* string) const
13531353
{
1354-
ASSERT(_string);
1354+
ASSERT(string);
13551355

1356-
return csstrnlen(_string, k_maximum_count) == length() && csmemcmp(get_string(), _string, length()) == 0;
1356+
return csstrnlen(string, k_maximum_count) == length() && csmemcmp(get_string(), string, length()) == 0;
13571357
}
13581358

1359-
bool starts_with(char const* _string) const
1359+
bool starts_with(char const* string) const
13601360
{
1361-
ASSERT(_string);
1361+
ASSERT(string);
13621362

1363-
return csmemcmp(_string, get_string(), csstrnlen(_string, k_maximum_count)) == 0;
1363+
return csmemcmp(string, get_string(), csstrnlen(string, k_maximum_count)) == 0;
13641364
}
13651365

1366-
bool ends_with(char const* _string) const
1366+
bool ends_with(char const* string) const
13671367
{
1368-
ASSERT(_string);
1368+
ASSERT(string);
13691369

13701370
int32 _length = length();
1371-
int32 suffix_length = csstrnlen(_string, k_maximum_count);
1371+
int32 suffix_length = csstrnlen(string, k_maximum_count);
13721372

13731373
if (suffix_length > _length)
13741374
return false;
13751375

13761376
char const* suffix = get_string() + (_length - suffix_length);
13771377

1378-
bool result = csmemcmp(suffix, _string, suffix_length) == 0;
1378+
bool result = csmemcmp(suffix, string, suffix_length) == 0;
13791379
return result;
13801380
}
13811381

1382-
int32 next_index_of(char const* _string, int32 index) const
1382+
int32 next_index_of(char const* string, int32 index) const
13831383
{
1384-
ASSERT(_string);
1384+
ASSERT(string);
13851385

13861386
int32 result = NONE;
13871387

13881388
if (index < length())
13891389
{
1390-
char const* s = csstrstr(m_string + index, _string);
1390+
char const* s = csstrstr(m_string + index, string);
13911391
if (s)
13921392
result = s - get_string();
13931393
}
13941394

13951395
return result;
13961396
}
13971397

1398-
int32 index_of(char const* _string) const
1398+
int32 index_of(char const* string) const
13991399
{
1400-
ASSERT(_string);
1400+
ASSERT(string);
14011401

1402-
return next_index_of(_string, 0);
1402+
return next_index_of(string, 0);
14031403
}
14041404

1405-
void set_bounded(char const* _string, int32 _length)
1405+
void set_bounded(char const* string, int32 _length)
14061406
{
14071407
if (_length + 1 < k_maximum_count)
14081408
_length++;
14091409
else
14101410
_length = k_maximum_count;
14111411

1412-
csstrnzcpy(m_string, _string, _length);
1412+
csstrnzcpy(m_string, string, _length);
14131413
}
14141414

14151415
bool substring(int32 index, int32 _length, c_static_string<k_maximum_count>& s) const

game/source/game/game_engine_assault.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ void c_game_engine_assault_variant::byteswap()
1010
{
1111
c_game_engine_base_variant::byteswap();
1212

13-
bswap_word_inplace(m_variant_flags);
14-
bswap_word_inplace(m_respawn);
15-
bswap_word_inplace(m_game_type);
16-
bswap_word_inplace(m_enemy_bomb_waypoint);
17-
bswap_word_inplace(m_score_to_win);
18-
bswap_word_inplace(m_score_unknown0);
19-
bswap_word_inplace(m_score_unknown1);
20-
bswap_word_inplace(m_score_unknown2);
21-
bswap_word_inplace(m_score_unknown3);
22-
bswap_word_inplace(m_sudden_death_time);
23-
bswap_word_inplace(m_bomb_reset_time);
24-
bswap_word_inplace(m_bomb_arming_time);
25-
bswap_word_inplace(m_bomb_disarming_time);
26-
bswap_word_inplace(m_bomb_fuse_time);
13+
bswap_uint16_inplace(m_variant_flags);
14+
bswap_uint16_inplace(m_respawn);
15+
bswap_uint16_inplace(m_game_type);
16+
bswap_uint16_inplace(m_enemy_bomb_waypoint);
17+
bswap_uint16_inplace(m_score_to_win);
18+
bswap_uint16_inplace(m_score_unknown0);
19+
bswap_uint16_inplace(m_score_unknown1);
20+
bswap_uint16_inplace(m_score_unknown2);
21+
bswap_uint16_inplace(m_score_unknown3);
22+
bswap_uint16_inplace(m_sudden_death_time);
23+
bswap_uint16_inplace(m_bomb_reset_time);
24+
bswap_uint16_inplace(m_bomb_arming_time);
25+
bswap_uint16_inplace(m_bomb_disarming_time);
26+
bswap_uint16_inplace(m_bomb_fuse_time);
2727
m_carrier_traits.byteswap();
2828
m_arming_traits.byteswap();
2929

game/source/game/game_engine_ctf.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ void c_game_engine_ctf_variant::byteswap()
1010
{
1111
c_game_engine_base_variant::byteswap();
1212

13-
bswap_word_inplace(m_touch_return_timeout);
14-
bswap_word_inplace(m_sudden_death_time);
15-
bswap_word_inplace(m_score_to_win);
16-
bswap_word_inplace(m_score_unknown);
17-
bswap_word_inplace(m_flag_reset_time);
13+
bswap_uint16_inplace(m_touch_return_timeout);
14+
bswap_uint16_inplace(m_sudden_death_time);
15+
bswap_uint16_inplace(m_score_to_win);
16+
bswap_uint16_inplace(m_score_unknown);
17+
bswap_uint16_inplace(m_flag_reset_time);
1818
m_carrier_traits.byteswap();
1919

2020
ASSERT(array_is_zeroed(m_pad1));

game/source/game/game_engine_default.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ void c_game_engine_base_variant::byteswap()
326326
m_respawn_options.byteswap();
327327
m_social_options.byteswap();
328328
m_map_override_options.byteswap();
329-
bswap_word_inplace(m_flags);
330-
bswap_word_inplace(m_team_scoring_method);
329+
bswap_uint16_inplace(m_flags);
330+
bswap_uint16_inplace(m_team_scoring_method);
331331
}
332332

333333
void c_game_engine_base_variant::set(c_game_engine_base_variant const* variant, bool force)

game/source/game/game_engine_infection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ void c_game_engine_infection_variant::byteswap()
1010
{
1111
c_game_engine_base_variant::byteswap();
1212

13-
bswap_word_inplace(m_safe_haven_movement_time);
13+
bswap_uint16_inplace(m_safe_haven_movement_time);
1414
m_zombie_traits.byteswap();
1515
m_first_zombie_traits.byteswap();
1616
m_safe_haven_defender_traits.byteswap();

game/source/game/game_engine_juggernaut.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ void c_game_engine_juggernaut_variant::byteswap()
1010
{
1111
c_game_engine_base_variant::byteswap();
1212

13-
bswap_word_inplace(m_score_to_win_round);
14-
bswap_word_inplace(m_score_unknown);
13+
bswap_uint16_inplace(m_score_to_win_round);
14+
bswap_uint16_inplace(m_score_unknown);
1515

1616
ASSERT(array_is_zeroed(m_pad));
1717

game/source/game/game_engine_king.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ void c_game_engine_king_variant::byteswap()
1010
{
1111
c_game_engine_base_variant::byteswap();
1212

13-
bswap_dword_inplace(m_variant_flags);
14-
bswap_word_inplace(m_score_to_win);
15-
bswap_word_inplace(m_score_unknown);
13+
bswap_uint32_inplace(m_variant_flags);
14+
bswap_uint16_inplace(m_score_to_win);
15+
bswap_uint16_inplace(m_score_unknown);
1616
m_inside_hill_traits.byteswap();
1717

1818
ASSERT(array_is_zeroed(m_pad1));

game/source/game/game_engine_oddball.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ void c_game_engine_oddball_variant::byteswap()
1010
{
1111
c_game_engine_base_variant::byteswap();
1212

13-
bswap_dword_inplace(m_variant_flags);
14-
bswap_word_inplace(m_score_to_win);
15-
bswap_word_inplace(m_score_unknown);
16-
bswap_word_inplace(m_carrying_points);
17-
bswap_word_inplace(m_ball_spawn_delay);
18-
bswap_word_inplace(m_ball_inactive_respawn_delay);
13+
bswap_uint32_inplace(m_variant_flags);
14+
bswap_uint16_inplace(m_score_to_win);
15+
bswap_uint16_inplace(m_score_unknown);
16+
bswap_uint16_inplace(m_carrying_points);
17+
bswap_uint16_inplace(m_ball_spawn_delay);
18+
bswap_uint16_inplace(m_ball_inactive_respawn_delay);
1919
m_carrier_traits.byteswap();
2020

2121
ASSERT(array_is_zeroed(m_pad1));

game/source/game/game_engine_player_traits.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ real32 c_player_trait_shield_vitality::get_maximum_shield_vitality()
432432

433433
void c_player_trait_weapons::byteswap()
434434
{
435-
bswap_word_inplace(m_initial_grenade_count_setting);
435+
bswap_uint16_inplace(m_initial_grenade_count_setting);
436436
}
437437

438438
void c_player_trait_weapons::set(c_player_trait_weapons const* traits, bool force)
@@ -1039,8 +1039,8 @@ void c_player_trait_appearance::set_forced_change_color_setting(e_forced_change_
10391039

10401040
void c_player_trait_sensors::byteswap()
10411041
{
1042-
bswap_word_inplace(m_motion_tracker_setting);
1043-
bswap_word_inplace(m_motion_tracker_range_setting);
1042+
bswap_uint16_inplace(m_motion_tracker_setting);
1043+
bswap_uint16_inplace(m_motion_tracker_range_setting);
10441044
}
10451045

10461046
void c_player_trait_sensors::set(c_player_trait_sensors const* traits, bool force)

0 commit comments

Comments
 (0)