Additional compilability fixes master
authorAri Johnson <ari@theari.com>
Fri, 2 May 2025 14:38:54 +0000 (10:38 -0400)
committerAri Johnson <ari@theari.com>
Fri, 2 May 2025 14:38:54 +0000 (10:38 -0400)
src/extchat.c
src/funlist.c
src/funmisc.c
src/game.c
src/parse.c

index 41b8df167f1ae098e30f3e585ca1455b5e8378c0..7815f1956a87edc2812ebe0693034d396efc5cd7 100644 (file)
@@ -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) {
index c71be8adc3fdf0d8cf4676c7c20d7c2c5a65d129..642354d182eac8b4ec088d1c4fe248c72f3722ef 100644 (file)
@@ -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);
index 9fb1a4b23f42df7f5fedc88358c292689e8da669..c9b3860eecd1598f5271d248d241cdf7706ceddc 100644 (file)
@@ -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);
index 163b35d5cadab74d166f5e37b60e2d91ce5be897..2f5f47fe92ade063cc78237586407edd3ee3d968 100644 (file)
@@ -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 */
index eea49081a2e81bd8f9925178fb9bf82e17df9ae5..96d98e2d62dfb16385269b99a4fdc80cebea2424 100644 (file)
@@ -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':