]> granicus.if.org Git - nethack/commitdiff
suppress some warnings if SND_SPEECH is not defined
authornhmall <nhmall@nethack.org>
Wed, 8 Feb 2023 17:44:14 +0000 (12:44 -0500)
committernhmall <nhmall@nethack.org>
Wed, 8 Feb 2023 17:44:14 +0000 (12:44 -0500)
apply.c:1413:27: warning: unused variable 'shkp' [-Wunused-variable]
            struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                          ^
apply.c:1570:27: warning: unused variable 'shkp' [-Wunused-variable]
            struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                          ^
apply.c:1650:31: warning: unused variable 'shkp' [-Wunused-variable]
                struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                              ^
apply.c:1697:23: warning: unused variable 'shkp' [-Wunused-variable]
        struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                      ^
apply.c:2157:31: warning: unused variable 'shkp' [-Wunused-variable]
                struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                              ^
apply.c:2165:31: warning: unused variable 'shkp' [-Wunused-variable]
                struct monst *shkp = shop_keeper(*in_rooms(corpse->ox,

include/sndprocs.h
src/apply.c

index a095d7f75bb237125ace1f565c948ee035788d76..f6e8dca672b37943fa02b27f95bcf752d56e2b60 100755 (executable)
@@ -447,7 +447,14 @@ SoundAchievement(0, sa2_xpleveldown, level);
 #undef SOUNDLIBONLY
 #endif
 #define SOUNDLIBONLY
-#else  /*  NO SOUNDLIB SELECTED AFTER THIS */
+#ifdef SND_SPEECH
+#define VOICEONLY
+#else
+#define VOICEONLY UNUSED
+#endif
+
+#else  /*  NO SOUNDLIB IS INTEGRATED AFTER THIS */
+
 #ifdef SND_LIB_INTEGRATED
 #undef SND_LIB_INTEGRATED
 #endif
@@ -461,7 +468,15 @@ SoundAchievement(0, sa2_xpleveldown, level);
 #undef SOUNDLIBONLY
 #endif
 #define SOUNDLIBONLY UNUSED
+#ifdef SND_SPEECH
+#undef SND_SPEECH
 #endif
+#ifdef VOICEONLY
+#undef VOICEONLY
+#endif
+#define VOICEONLY UNUSED
+
+#endif  /* No SOUNDLIB */
 
 enum findsound_approaches {
     findsound_embedded,
index 7d8c93b5d3c3729e1442875eceb7cc4364cea8c5..5d381f490c3d833f8668467ac516789c03dc86d2 100644 (file)
@@ -1410,7 +1410,7 @@ use_candle(struct obj **optr)
         else if (!otmp->lamplit && was_lamplit)
             pline("%s out.", (obj->quan > 1L) ? "They go" : "It goes");
         if (obj->unpaid) {
-            struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
+            struct monst *shkp VOICEONLY = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
 
             SetVoice(shkp, 0, 80, 0);
             verbalize("You %s %s, you bought %s!",
@@ -1567,7 +1567,7 @@ catch_lit(struct obj *obj)
         if (obj->otyp == POT_OIL)
             makeknown(obj->otyp);
         if (carried(obj) && obj->unpaid && costly_spot(u.ux, u.uy)) {
-            struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
+            struct monst *shkp VOICEONLY = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
 
             /* if it catches while you have it, then it's your tough luck */
             check_unpaid(obj);
@@ -1647,7 +1647,7 @@ use_lamp(struct obj *obj)
             if (obj->unpaid && costly_spot(u.ux, u.uy)
                 && obj->age == 20L * (long) objects[obj->otyp].oc_cost) {
                 const char *ithem = (obj->quan > 1L) ? "them" : "it";
-                struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
+                struct monst *shkp VOICEONLY = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
 
                 SetVoice(shkp, 0, 80, 0);
                 verbalize("You burn %s, you bought %s!", ithem, ithem);
@@ -1694,7 +1694,7 @@ light_cocktail(struct obj **optr)
         Blind ? "" : "  It gives off a dim light.");
 
     if (obj->unpaid && costly_spot(u.ux, u.uy)) {
-        struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
+        struct monst *shkp VOICEONLY = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
 
         /* Normally, we shouldn't both partially and fully charge
          * for an item, but (Yendorian Fuel) Taxes are inevitable...
@@ -2154,7 +2154,8 @@ use_tinning_kit(struct obj *obj)
         set_tin_variety(can, HOMEMADE_TIN);
         if (carried(corpse)) {
             if (corpse->unpaid) {
-                struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
+                struct monst *shkp VOICEONLY = shop_keeper(*in_rooms(
+                                                       u.ux, u.uy, SHOPBASE));
 
                 SetVoice(shkp, 0, 80, 0);
                 verbalize(you_buy_it);
@@ -2162,7 +2163,7 @@ use_tinning_kit(struct obj *obj)
             useup(corpse);
         } else {
             if (costly_spot(corpse->ox, corpse->oy) && !corpse->no_charge) {
-                struct monst *shkp = shop_keeper(*in_rooms(corpse->ox,
+                struct monst *shkp VOICEONLY = shop_keeper(*in_rooms(corpse->ox,
                                                  corpse->oy, SHOPBASE));
                 SetVoice(shkp, 0, 80, 0);
                 verbalize(you_buy_it);