From: Ari Johnson Date: Fri, 2 May 2025 14:38:54 +0000 (-0400) Subject: Additional compilability fixes X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=a4043b54a1b04b62e8e802821be4fab63be80aac;p=cobramush.git Additional compilability fixes --- diff --git a/src/extchat.c b/src/extchat.c index 41b8df1..7815f19 100644 --- a/src/extchat.c +++ b/src/extchat.c @@ -1368,7 +1368,7 @@ do_channel(dbref player, const char *name, const char *target, const char *com) return; } u = onchannel(victim, chan); - strcpy(title, (u &&CUtitle(u)) ? CUtitle(u) : ""); + strcpy(title, u ? CUtitle(u) : ""); if (remove_user(u, chan)) { if (!Channel_Quiet(chan) && !DarkLegal(victim)) { format_channel_broadcast(chan, NULL, victim, @@ -1483,7 +1483,7 @@ channel_leave_self(dbref player, const char *name) break; } u = onchannel(player, chan); - strcpy(title, (u &&CUtitle(u)) ? CUtitle(u) : ""); + strcpy(title, u ? CUtitle(u) : ""); if (remove_user(u, chan)) { if (!Channel_Quiet(chan) && !DarkLegal(player)) format_channel_broadcast(chan, NULL, player, CB_CHECKQUIET | CB_PRESENCE, @@ -1650,7 +1650,7 @@ do_chat(dbref player, CHAN *chan, const char *arg1) return; } - if (!Channel_NoTitles(chan) && u &&CUtitle(u) && *CUtitle(u)) + if (!Channel_NoTitles(chan) && u && *CUtitle(u)) title = CUtitle(u); else title = NULL; @@ -2259,8 +2259,8 @@ do_channel_list(dbref player, const char *partname) ChanCreator(c) == player ? '*' : '-', /* User status */ u ? (Chanuser_Gag(u) ? "Gag" : "On") : "Off", - (u &&Chanuser_Quiet(u)) ? 'Q' : ' ', - (u &&Chanuser_Hide(u)) ? 'H' : ' ', + (u && Chanuser_Quiet(u)) ? 'Q' : ' ', + (u && Chanuser_Hide(u)) ? 'H' : ' ', bufferq_lines(ChanBufferQ(c))); } } @@ -3310,7 +3310,7 @@ FUNCTION(fun_crecall) } u = onchannel(executor, chan); - if (!u &&!Chan_Can_Access(chan, executor)) { + if (!u && !Chan_Can_Access(chan, executor)) { safe_str(T(e_perm), buff, bp); return; } @@ -3589,7 +3589,7 @@ do_chan_recall(dbref player, const char *name, char *lineinfo[], int quiet) return; } u = onchannel(player, chan); - if (!u &&!Chan_Can_Access(chan, player)) { + if (!u && !Chan_Can_Access(chan, player)) { notify(player, T("CHAT: You must join a channel to recall from it.")); return; } @@ -3712,7 +3712,7 @@ format_channel_broadcast(CHAN *chan, CHANUSER *u, dbref victim, int flags, if (extra && *extra) title = extra; - else if (u &&CUtitle(u)) + else if (u) title = CUtitle(u); if (flags & CB_NONAME) { diff --git a/src/funlist.c b/src/funlist.c index c71be8a..642354d 100644 --- a/src/funlist.c +++ b/src/funlist.c @@ -119,7 +119,7 @@ int elist2arr(char *r[], int max, char *list, char sep) { /* Do first */ while(p && *p && (i <= max)) { - if(*p == '\\' && (p + 1)) { + if(*p == '\\' && *(p + 1)) { /* Remove This Char & let the next char in */ *p++ = '\0'; safe_str(lp, cbufp, &bp); diff --git a/src/funmisc.c b/src/funmisc.c index 9fb1a4b..c9b3860 100644 --- a/src/funmisc.c +++ b/src/funmisc.c @@ -170,8 +170,7 @@ FUNCTION(fun_setq) for (n = 0; n < nargs; n += 2) { if (*args[n] && (*(args[n] + 1) == '\0') && - ((qindex = qreg_indexes[(unsigned char) args[n][0]]) != -1) - && global_eval_context.renv[qindex]) { + ((qindex = qreg_indexes[(unsigned char) args[n][0]]) != -1)) { strcpy(global_eval_context.renv[qindex], args[n + 1]); if (n == 0 && !strcmp(called_as, "SETR")) safe_strl(args[n + 1], arglens[n + 1], buff, bp); @@ -194,8 +193,7 @@ FUNCTION(fun_r) int qindex; if (*args[0] && (*(args[0] + 1) == '\0') && - ((qindex = qreg_indexes[(unsigned char) args[0][0]]) != -1) - && global_eval_context.renv[qindex]) + ((qindex = qreg_indexes[(unsigned char) args[0][0]]) != -1)) safe_str(global_eval_context.renv[qindex], buff, bp); else if (*args[0]) safe_str(get_namedreg(&global_eval_context.namedregs, args[0]), buff, bp); diff --git a/src/game.c b/src/game.c index 163b35d..2f5f47f 100644 --- a/src/game.c +++ b/src/game.c @@ -2309,7 +2309,7 @@ db_open(const char *filename) { FILE *f; #ifndef WIN32 - if (options.uncompressprog && *options.uncompressprog) { + if (*options.uncompressprog) { /* We do this because on some machines (SGI Irix, for example), * the popen will not return NULL if the mailfile isn't there. */ @@ -2362,7 +2362,7 @@ db_open_write(const char *filename) errno, strerror(errno)); } #ifndef WIN32 - if (options.compressprog && *options.compressprog) { + if (*options.compressprog) { f = #ifdef __LCC__ (FILE *) @@ -2389,7 +2389,7 @@ static void db_close(FILE * f) { #ifndef WIN32 - if (options.compressprog && *options.compressprog) { + if (*options.compressprog) { pclose(f); } else #endif /* WIN32 */ diff --git a/src/parse.c b/src/parse.c index eea4908..96d98e2 100644 --- a/src/parse.c +++ b/src/parse.c @@ -951,8 +951,7 @@ process_expression(char *buff, char **bp, char const **str, } else { if ((qindex = qreg_indexes[(unsigned char) nextc]) == -1) break; - if (global_eval_context.renv[qindex]) - safe_str(global_eval_context.renv[qindex], buff, bp); + safe_str(global_eval_context.renv[qindex], buff, bp); } break; case 'R':