]> granicus.if.org Git - nethack/commitdiff
resolve a couple of build failures when STATUS_HILITES is not defined
authornhmall <nhmall@nethack.org>
Wed, 5 Feb 2020 17:24:15 +0000 (12:24 -0500)
committernhmall <nhmall@nethack.org>
Wed, 5 Feb 2020 17:24:15 +0000 (12:24 -0500)
This addresses the build failures but it is unknown
whether the logic remains sound.

src/botl.c
win/share/safeproc.c

index 37594ff7c0bcc7461a6b1683b22d499ec45b515a..a9e9a9bccaae63b99292749d1a270a7661a7f336 100644 (file)
@@ -750,7 +750,11 @@ boolean *valsetlist;
      *  [Affects exp_percent_changing() too.]
      */
     if (((chg || g.update_all || fld == BL_XP)
-         && curr->percent_matters && curr->thresholds)
+         && curr->percent_matters
+#ifdef STATUS_HILITES
+         && curr->thresholds
+#endif
+        )
         /* when 'hitpointbar' is On, percent matters even if HP
            hasn't changed and has no percentage rules (in case HPmax
            has changed when HP hasn't, where we ordinarily wouldn't
@@ -1288,9 +1292,12 @@ exp_percentage()
 boolean
 exp_percent_changing()
 {
-    int pc, color_dummy;
+    int pc;
     anything a;
+#ifdef STATUS_HILITES
+    int color_dummy;
     struct hilite_s *rule;
+#endif
     struct istat_s *curr;
 
     /* if status update is already requested, skip this processing */
@@ -1302,14 +1309,19 @@ exp_percent_changing()
         curr = &g.blstats[g.now_or_before_idx][BL_XP];
         /* TODO: [see eval_notify_windowport_field() about percent_matters
            and the check against 'thresholds'] */
-        if (curr->percent_matters && curr->thresholds
+        if (curr->percent_matters
+#ifdef STATUS_HILITES
+            && curr->thresholds
+#endif
             && (pc = exp_percentage()) != curr->percent_value) {
             a = cg.zeroany;
             a.a_int = (int) u.ulevel;
+#ifdef STATUS_HILITES
             rule = get_hilite(g.now_or_before_idx, BL_XP,
                               (genericptr_t) &a, 0, pc, &color_dummy);
             if (rule != curr->hilite_rule)
                 return TRUE; /* caller should set 'g.context.botl' to True */
+#endif
         }
     }
     return FALSE;
index 5c54961ca0806444932030aba14993bf417018c1..d506600c2120e55f0ff004a63a27f66ed064eea8 100644 (file)
@@ -96,11 +96,7 @@ struct window_procs safe_procs = {
     safe_getmsghistory, safe_putmsghistory,
     safe_status_init,
     safe_status_finish, safe_status_enablefield,
-#ifdef STATUS_HILITES
     safe_status_update,
-#else
-    safe_status_update,
-#endif
     safe_can_suspend,
 };
 
@@ -495,7 +491,6 @@ boolean enable;
 {
 }
 
-#ifdef STATUS_HILITES
 /* call once for each field, then call with BL_FLUSH to output the result */
 void
 safe_status_update(idx, ptr, chg, percent, color, colormasks)
@@ -505,7 +500,6 @@ int chg UNUSED, percent UNUSED, color UNUSED;
 unsigned long *colormasks UNUSED;
 {
 }
-#endif /* STATUS_HILITES */
 
 /**************************************************************
  * These are some optionally selectable routines that add