Feature #2168 ยป 0061-srv_-.-ch-Replace-NULL-with-nullptr.patch
| server/srv_entrypoint.c | ||
|---|---|---|
|
int inx;
|
||
|
bool showhelp = FALSE;
|
||
|
bool showvers = FALSE;
|
||
|
char *option = NULL;
|
||
|
char *option = nullptr;
|
||
|
executable_init();
|
||
|
setup_interrupt_handlers();
|
||
| ... | ... | |
|
con_write(C_VERSION, _("This is the server for %s"), freeciv_name_version());
|
||
|
/* TRANS: No full stop after the URL, could cause confusion. */
|
||
|
con_write(C_COMMENT, _("You can learn a lot about Freeciv at %s"),
|
||
|
HOMEPAGE_URL);
|
||
|
HOMEPAGE_URL);
|
||
|
if (showhelp) {
|
||
|
struct cmdhelp *help = cmdhelp_new(argv[0]);
|
||
| ... | ... | |
|
/* TRANS: "saves" is exactly what user must type, do not translate. */
|
||
|
_("saves DIR"),
|
||
|
_("Save games to directory DIR"));
|
||
|
cmdhelp_add(help, NULL,
|
||
|
cmdhelp_add(help, nullptr,
|
||
|
/* TRANS: "scenarios" is exactly what user must type, do not translate. */
|
||
|
_("scenarios DIR"),
|
||
|
_("Save scenarios to directory DIR"));
|
||
| ... | ... | |
|
/* TRANS: "Ranklog" is exactly what user must type, do not translate. */
|
||
|
_("Ranklog FILE"),
|
||
|
_("Use FILE as ranking logfile"));
|
||
|
cmdhelp_add(help, NULL,
|
||
|
cmdhelp_add(help, nullptr,
|
||
|
/* TRANS: "ruleset" is exactly what user must type, do not translate. */
|
||
|
_("ruleset RULESET"),
|
||
|
_("Load ruleset RULESET"));
|
||
| server/srv_log.c | ||
|---|---|---|
|
cat_snprintf(buffer, sizeof(buffer), "%s", buffer2);
|
||
|
if (notify) {
|
||
|
notify_conn(NULL, NULL, E_AI_DEBUG, ftc_log, "%s", buffer);
|
||
|
notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", buffer);
|
||
|
}
|
||
|
do_log(file, function, line, FALSE, level, "%s", buffer);
|
||
|
}
|
||
| ... | ... | |
|
cat_snprintf(buffer, sizeof(buffer), "%s", buffer2);
|
||
|
if (notify) {
|
||
|
notify_conn(NULL, NULL, E_AI_DEBUG, ftc_log, "%s", buffer);
|
||
|
notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", buffer);
|
||
|
}
|
||
|
do_log(file, function, line, FALSE, level, "%s", buffer);
|
||
|
}
|
||
| ... | ... | |
|
timer_read_seconds(aitimer[which][0]), \
|
||
|
timer_read_seconds(aitimer[which][1])); \
|
||
|
log_test("%s", buf); \
|
||
|
notify_conn(NULL, NULL, E_AI_DEBUG, ftc_log, "%s", buf);
|
||
|
notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", buf);
|
||
|
log_test(" --- AI timing results ---");
|
||
| ... | ... | |
|
fc_snprintf(buf, sizeof(buf), " %s: %g sec turn, %g sec game", text, \
|
||
|
timer_read_seconds(aitimer[which][0]), \
|
||
|
timer_read_seconds(aitimer[which][1])); \
|
||
|
notify_conn(NULL, NULL, E_AI_DEBUG, ftc_log, "%s", buf);
|
||
|
notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", buf);
|
||
|
#endif /* LOG_TIMERS */
|
||
|
notify_conn(NULL, NULL, E_AI_DEBUG, ftc_log,
|
||
|
notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log,
|
||
|
" --- AI timing results ---");
|
||
|
AILOG_OUT("Total AI time", AIT_ALL);
|
||
|
AILOG_OUT("Movemap", AIT_MOVEMAP);
|
||
| server/srv_main.h | ||
|---|---|---|
|
bool metaconnection_persistent;
|
||
|
char identity_name[256];
|
||
|
unsigned short int metaserver_port;
|
||
|
/* Address this server is to listen on (NULL => INADDR_ANY) */
|
||
|
/* Address this server is to listen on (nullptr => INADDR_ANY) */
|
||
|
char *bind_addr;
|
||
|
/* This server's listen port */
|
||
|
int port;
|
||
|
/* Address to bind when connecting to the metaserver (NULL => bind_addr) */
|
||
|
/* Address to bind when connecting to the metaserver (nullptr => bind_addr) */
|
||
|
char *bind_meta_addr;
|
||
|
/* The log level */
|
||
|
enum log_level loglevel;
|
||
| server/srv_signal.c | ||
|---|---|---|
|
} \
|
||
|
exit(EXIT_SUCCESS);
|
||
|
static struct timer *signal_timer = NULL;
|
||
|
static struct timer *signal_timer = nullptr;
|
||
|
/**********************************************************************//**
|
||
|
This function is called when a SIGINT (ctrl-c) is received. It will exit
|
||
| ... | ... | |
|
{
|
||
|
switch (sig) {
|
||
|
case SIGINT:
|
||
|
if (signal_timer != NULL && timer_read_seconds(signal_timer) <= 1.0) {
|
||
|
if (signal_timer != nullptr && timer_read_seconds(signal_timer) <= 1.0) {
|
||
|
save_and_exit(SIGINT);
|
||
|
} else {
|
||
|
if (game.info.timeout == -1) {
|
||
|
log_normal(_("Setting timeout to 0. Autogame will stop."));
|
||
|
game.info.timeout = 0;
|
||
|
}
|
||
|
if (signal_timer == NULL) {
|
||
|
if (signal_timer == nullptr) {
|
||
|
log_normal(_("You must interrupt Freeciv twice "
|
||
|
"within one second to make it exit."));
|
||
|
}
|
||
|
}
|
||
|
signal_timer = timer_renew(signal_timer, TIMER_USER, TIMER_ACTIVE,
|
||
|
signal_timer != NULL ? NULL : "ctrlc");
|
||
|
signal_timer != nullptr ? nullptr : "ctrlc");
|
||
|
timer_start(signal_timer);
|
||
|
break;
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
void signal_timer_free(void)
|
||
|
{
|
||
|
if (signal_timer != NULL) {
|
||
|
if (signal_timer != nullptr) {
|
||
|
timer_destroy(signal_timer);
|
||
|
signal_timer = NULL;
|
||
|
signal_timer = nullptr;
|
||
|
}
|
||
|
}
|
||