[Maintenance] Correctly define `nullptr` as `far` for far-data memory models

Turns out I've misread the execl() documentation. That function does in
fact *not* need a second `nullptr` parameter for envp, because it
doesn't pass envp.

Part of P0216, funded by JonathKane.
This commit is contained in:
nmlgc 2022-08-15 03:30:33 +02:00
parent 08fa2151ca
commit ed3fbde7d7
4 changed files with 10 additions and 6 deletions

View File

@ -33,7 +33,11 @@
/// ----------
#if (__cplusplus < 201103L)
#define nullptr 0
#ifdef __LARGE__
#define nullptr 0UL
#else
#define nullptr 0U
#endif
#endif
// Message-less static_assert() wasn't available until C++17

View File

@ -96,5 +96,5 @@ void main(int argc, const char *argv[])
game_init();
end_and_verdict_and_regist_animate();
game_switch_binary();
execl(BINARY_OP, BINARY_OP, nullptr, nullptr);
execl(BINARY_OP, BINARY_OP, nullptr);
}

View File

@ -240,7 +240,7 @@ bool16 continue_menu(void)
resident->snd_need_init = false;
game_switch_binary();
resident->point_value = 0;
execl(BINARY_MAIN_CAPS, BINARY_MAIN_CAPS, nullptr, nullptr);
execl(BINARY_MAIN_CAPS, BINARY_MAIN_CAPS, nullptr);
} else {
no_continue:
player_is_hit = false;

View File

@ -891,7 +891,7 @@ int main(void)
}
frame_delay(120);
game_switch_binary();
execl(BINARY_END, BINARY_END, nullptr, nullptr);
execl(BINARY_END, BINARY_END, nullptr);
}
// ZUN quirk: Placing this after the [game_cleared] branch robs
@ -956,7 +956,7 @@ int main(void)
mdrv2_bgm_fade_out_nonblock();
resident->bombs = bombs;
game_switch_binary();
execl(BINARY_MAIN, BINARY_MAIN, nullptr, nullptr);
execl(BINARY_MAIN, BINARY_MAIN, nullptr);
}
orb_in_portal = false;
if(boss_id == BID_NONE) {
@ -1002,6 +1002,6 @@ op:
game_switch_binary();
key_end();
arc_free();
execl(BINARY_OP, BINARY_OP, nullptr, nullptr);
execl(BINARY_OP, BINARY_OP, nullptr);
return 0;
}