From 503727d1eee9910d0219fa5e5eed054e2cbbd3a0 Mon Sep 17 00:00:00 2001 From: Elizabeth Myers Date: Wed, 9 Mar 2016 02:19:31 -0600 Subject: [PATCH] More bool conversions --- extensions/sno_farconnect.c | 2 +- extensions/sno_globalnickchange.c | 2 +- include/ircd.h | 10 +++++----- ircd/ircd.c | 14 +++++++------- ircd/modules.c | 2 +- ircd/s_conf.c | 4 ++-- ircd/sslproc.c | 8 ++++---- ssld/ssld.c | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/extensions/sno_farconnect.c b/extensions/sno_farconnect.c index 9638592a..78780658 100644 --- a/extensions/sno_farconnect.c +++ b/extensions/sno_farconnect.c @@ -38,7 +38,7 @@ _modinit(void) snomask_modes['F'] = find_snomask_slot(); /* show the fact that we are showing user information in /version */ - opers_see_all_users = 1; + opers_see_all_users = true; return 0; } diff --git a/extensions/sno_globalnickchange.c b/extensions/sno_globalnickchange.c index 9c53d48d..0e338c5c 100644 --- a/extensions/sno_globalnickchange.c +++ b/extensions/sno_globalnickchange.c @@ -28,7 +28,7 @@ static int _modinit(void) { /* show the fact that we are showing user information in /version */ - opers_see_all_users = 1; + opers_see_all_users = true; return 0; } diff --git a/include/ircd.h b/include/ircd.h index 3e941452..48e901eb 100644 --- a/include/ircd.h +++ b/include/ircd.h @@ -69,9 +69,9 @@ extern bool dorehash; extern bool dorehashbans; extern bool doremotd; extern bool kline_queued; -extern int server_state_foreground; -extern int opers_see_all_users; /* sno_farconnect.so loaded, operspy without - accountability, etc */ +extern bool server_state_foreground; +extern bool opers_see_all_users; /* sno_farconnect.so loaded, operspy without + accountability, etc */ extern struct Client me; extern rb_dlink_list global_client_list; @@ -99,8 +99,8 @@ extern int testing_conf; extern struct ev_entry *check_splitmode_ev; -extern int ssl_ok; -extern int zlib_ok; +extern bool ssl_ok; +extern bool zlib_ok; extern int maxconnections; void ircd_shutdown(const char *reason); diff --git a/ircd/ircd.c b/ircd/ircd.c index 9343b6bc..c96edb32 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -103,10 +103,10 @@ bool dorehash = false; bool dorehashbans = false; bool doremotd = false; bool kline_queued = false; -int server_state_foreground = 0; -int opers_see_all_users = 0; -int ssl_ok = 0; -int zlib_ok = 1; +bool server_state_foreground = false; +bool opers_see_all_users = false; +bool ssl_ok = false; +bool zlib_ok = true; int testing_conf = 0; time_t startup_time; @@ -605,7 +605,7 @@ charybdis_main(int argc, char *argv[]) setup_signals(); if (testing_conf) - server_state_foreground = 1; + server_state_foreground = true; /* Make sure fd 0, 1 and 2 are in use -- jilles */ do @@ -713,10 +713,10 @@ charybdis_main(int argc, char *argv[]) if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list)) { ilog(L_MAIN, "WARNING: Unable to setup SSL."); - ssl_ok = 0; + ssl_ok = false; } else - ssl_ok = 1; + ssl_ok = true; } if (testing_conf) diff --git a/ircd/modules.c b/ircd/modules.c index 395559a6..8175c624 100644 --- a/ircd/modules.c +++ b/ircd/modules.c @@ -295,7 +295,7 @@ load_one_module(const char *path, int origin, int coremodule) struct stat statbuf; - if (server_state_foreground == 1) + if (server_state_foreground) inotice("loading module %s ...", path); if(coremodule != 0) diff --git a/ircd/s_conf.c b/ircd/s_conf.c index d952981b..aaa9f867 100644 --- a/ircd/s_conf.c +++ b/ircd/s_conf.c @@ -868,9 +868,9 @@ validate_conf(void) if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list)) { ilog(L_MAIN, "WARNING: Unable to setup SSL."); - ssl_ok = 0; + ssl_ok = false; } else { - ssl_ok = 1; + ssl_ok = true; send_new_ssl_certs(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list); } diff --git a/ircd/sslproc.c b/ircd/sslproc.c index f9f26eaf..9f01f229 100644 --- a/ircd/sslproc.c +++ b/ircd/sslproc.c @@ -489,7 +489,7 @@ ssl_process_cmd_recv(ssl_ctl_t * ctl) switch (*ctl_buf->buf) { case 'N': - ssl_ok = 0; /* ssld says it can't do ssl/tls */ + ssl_ok = false; /* ssld says it can't do ssl/tls */ break; case 'D': ssl_process_dead_fd(ctl, ctl_buf); @@ -504,13 +504,13 @@ ssl_process_cmd_recv(ssl_ctl_t * ctl) ssl_process_zipstats(ctl, ctl_buf); break; case 'I': - ssl_ok = 0; + ssl_ok = false; ilog(L_MAIN, "%s", cannot_setup_ssl); sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", cannot_setup_ssl); break; case 'U': zlib_ok = 0; - ssl_ok = 0; + ssl_ok = false; ilog(L_MAIN, "%s", no_ssl_or_zlib); sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", no_ssl_or_zlib); ssl_killall(); @@ -722,7 +722,7 @@ send_new_ssl_certs(const char *ssl_cert, const char *ssl_private_key, const char rb_dlink_node *ptr; if(ssl_cert == NULL || ssl_private_key == NULL || ssl_dh_params == NULL) { - ssl_ok = 0; + ssl_ok = false; return; } RB_DLINK_FOREACH(ptr, ssl_daemons.head) diff --git a/ssld/ssld.c b/ssld/ssld.c index 32f95fb4..6446a656 100644 --- a/ssld/ssld.c +++ b/ssld/ssld.c @@ -151,12 +151,12 @@ static void conn_plain_read_cb(rb_fde_t *fd, void *data); static void conn_plain_read_shutdown_cb(rb_fde_t *fd, void *data); static void mod_cmd_write_queue(mod_ctl_t * ctl, const void *data, size_t len); static const char *remote_closed = "Remote host closed the connection"; -static int ssl_ok; +static bool ssl_ok; static int certfp_method = RB_SSL_CERTFP_METH_SHA1; #ifdef HAVE_LIBZ -static int zlib_ok = 1; +static bool zlib_ok = true; #else -static int zlib_ok = 0; +static bool zlib_ok = false; #endif