From ec21450522e3c2124f3510eef5cfd88420483248 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 26 Jun 2014 18:18:01 -0700 Subject: Low hanging fruit --- src/char/char.cpp | 14 +++++++------- src/char/int_storage.cpp | 2 +- src/char/inter.cpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/char') diff --git a/src/char/char.cpp b/src/char/char.cpp index a0a92f1..3b0d43e 100644 --- a/src/char/char.cpp +++ b/src/char/char.cpp @@ -1083,7 +1083,7 @@ int set_account_reg2(AccountId acc, Slice reg) static int char_divorce(CharPair *cp) { - if (cp == NULL) + if (cp == nullptr) return 0; CharKey *ck = &cp->key; @@ -2465,7 +2465,7 @@ void parse_char(Session *s) else PRINTF("Account Logged On; Account ID: %d.\n"_fmt, account_id); - if (sd == NULL) + if (sd == nullptr) { s->session_data = make_unique(); sd = static_cast(s->session_data.get()); @@ -2833,14 +2833,14 @@ void check_connect_login_server(TimerData *, tick_t) static bool char_lan_config(XString w1, ZString w2) { - struct hostent *h = NULL; + struct hostent *h = nullptr; { if (w1 == "lan_map_ip"_s) { // Read map-server Lan IP Address h = gethostbyname(w2.c_str()); - if (h != NULL) + if (h != nullptr) { lan_map_ip = IP4Address({ static_cast(h->h_addr[0]), @@ -2894,7 +2894,7 @@ bool lan_check() static bool char_config(XString w1, ZString w2) { - struct hostent *h = NULL; + struct hostent *h = nullptr; { if (w1 == "userid"_s) @@ -2914,7 +2914,7 @@ bool char_config(XString w1, ZString w2) else if (w1 == "login_ip"_s) { h = gethostbyname(w2.c_str()); - if (h != NULL) + if (h != nullptr) { login_ip = IP4Address({ static_cast(h->h_addr[0]), @@ -2938,7 +2938,7 @@ bool char_config(XString w1, ZString w2) else if (w1 == "char_ip"_s) { h = gethostbyname(w2.c_str()); - if (h != NULL) + if (h != nullptr) { char_ip = IP4Address({ static_cast(h->h_addr[0]), diff --git a/src/char/int_storage.cpp b/src/char/int_storage.cpp index 9527806..784347b 100644 --- a/src/char/int_storage.cpp +++ b/src/char/int_storage.cpp @@ -116,7 +116,7 @@ bool extract(XString str, Storage *p) Storage *account2storage(AccountId account_id) { Storage *s = storage_db.search(account_id); - if (s == NULL) + if (s == nullptr) { s = storage_db.init(account_id); s->account_id = account_id; diff --git a/src/char/inter.cpp b/src/char/inter.cpp index 04c1146..354cba7 100644 --- a/src/char/inter.cpp +++ b/src/char/inter.cpp @@ -406,7 +406,7 @@ RecvResult mapif_parse_AccReg(Session *s) struct accreg *reg = accreg_db.search(head.account_id); - if (reg == NULL) + if (reg == nullptr) { AccountId account_id = head.account_id; reg = accreg_db.init(account_id); -- cgit v1.2.3-70-g09d2