Rewrite simple pointer casts from C style to reinterpret_cast<>
This pass only targets int16_t and uint16_t. s/(\s*\(u\?int16_t\s*\*\+\)\s*)\s*(/reinterpret_cast<\1>(/g
This commit is contained in:
parent
19f31eb420
commit
f5aed82d83
|
@ -1726,8 +1726,8 @@ static int newdemo_read_demo_start(enum purpose_type purpose)
|
|||
if (purpose == PURPOSE_REWRITE)
|
||||
nd_write_int(i.score);
|
||||
} else {
|
||||
nd_read_short((int16_t *)(&i.net_killed_total));
|
||||
nd_read_short((int16_t *)(&i.net_kills_total));
|
||||
nd_read_short(reinterpret_cast<int16_t *>(&i.net_killed_total));
|
||||
nd_read_short(reinterpret_cast<int16_t *>(&i.net_kills_total));
|
||||
if (purpose == PURPOSE_REWRITE)
|
||||
{
|
||||
nd_write_short(i.net_killed_total);
|
||||
|
@ -3291,7 +3291,7 @@ void newdemo_goto_end(int to_rewrite)
|
|||
get_local_player_vulcan_ammo() = s;
|
||||
}
|
||||
range_for (auto &i, get_local_player_secondary_ammo())
|
||||
nd_read_short((int16_t *)(&i));
|
||||
nd_read_short(reinterpret_cast<int16_t *>(&i));
|
||||
{
|
||||
int8_t i;
|
||||
nd_read_byte(&i);
|
||||
|
@ -3316,8 +3316,8 @@ void newdemo_goto_end(int to_rewrite)
|
|||
if (Newdemo_game_mode & GM_MULTI_COOP) {
|
||||
nd_read_int(&(i.score));
|
||||
} else {
|
||||
nd_read_short((int16_t *)(&i.net_killed_total));
|
||||
nd_read_short((int16_t *)(&i.net_kills_total));
|
||||
nd_read_short(reinterpret_cast<int16_t *>(&i.net_killed_total));
|
||||
nd_read_short(reinterpret_cast<int16_t *>(&i.net_kills_total));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -122,7 +122,7 @@ static short pof_read_short(ubyte *bufp)
|
|||
{
|
||||
short s;
|
||||
|
||||
s = *((int16_t *) (&bufp[Pof_addr]));
|
||||
s = *(reinterpret_cast<int16_t *>(&bufp[Pof_addr]));
|
||||
Pof_addr += 2;
|
||||
return INTEL_SHORT(s);
|
||||
// if (PHYSFS_read(f,&s,sizeof(s),1) != 1)
|
||||
|
|
Loading…
Reference in a new issue