OSDN Git Service

eliminate warnings
authorSHIRAKATA Kentaro <argrath@ub32.org>
Tue, 14 Apr 2020 20:44:57 +0000 (05:44 +0900)
committerSHIRAKATA Kentaro <argrath@ub32.org>
Fri, 17 Apr 2020 18:47:23 +0000 (03:47 +0900)
12 files changed:
src/apply.c
src/artifact.c
src/cmd.c
src/do.c
src/do_wear.c
src/dokick.c
src/objnam.c
src/pager.c
src/pline.c
src/shk.c
win/tty/termcap.c
win/tty/wintty.c

index 4af1971..4347499 100644 (file)
@@ -535,7 +535,9 @@ register struct obj *obj;
             const char *what = "thing";
 */
             const char *what = "\95¨\91Ì";
+#if 0 /*JP*//*unused*/
             boolean use_plural = FALSE;
+#endif
             struct obj dummyobj, *odummy;
 
             switch (M_AP_TYPE(mtmp)) {
@@ -554,8 +556,10 @@ register struct obj *obj;
                 } else {
                     what = simple_typename(odummy->otyp);
                 }
+#if 0 /*JP*/
                 use_plural = (is_boots(odummy) || is_gloves(odummy)
                               || odummy->otyp == LENSES);
+#endif
                 break;
             case M_AP_MONSTER: /* ignore Hallucination here */
                 what = mons[mtmp->mappearance].mname;
index 562d20a..99f2e9f 100644 (file)
@@ -1001,7 +1001,11 @@ char *hittee;              /* target's name: "you" or mon_nam(mdef) */
     const char *verb;
     boolean youattack = (magr == &youmonst), youdefend = (mdef == &youmonst),
             resisted = FALSE, do_stun, do_confuse, result;
+#if 0 /*JP*/
     int attack_indx, fakeidx, scare_dieroll = MB_MAX_DIEROLL / 2;
+#else
+    int attack_indx, scare_dieroll = MB_MAX_DIEROLL / 2;
+#endif
 
     result = FALSE; /* no message given yet */
     /* the most severe effects are less likely at higher enchantment */
@@ -1163,7 +1167,9 @@ char *hittee;              /* target's name: "you" or mon_nam(mdef) */
 
     /* now give message(s) describing side-effects; Use fakename
        so vtense() won't be fooled by assigned name ending in 's' */
+#if 0 /*JP*/
     fakeidx = youdefend ? 1 : 0;
+#endif
     if (youattack || youdefend || vis) {
         (void) upstart(hittee); /* capitalize */
         if (resisted) {
index 9958388..cd986d3 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -2478,7 +2478,9 @@ basics_enlightenment(mode, final)
 int mode UNUSED;
 int final;
 {
+#if 0 /*JP*//*unused*/
     static char Power[] = "energy points (spell power)";
+#endif
     char buf[BUFSZ];
     int pw = u.uen, hp = (Upolyd ? u.mh : u.uhp),
         pwmax = u.uenmax, hpmax = (Upolyd ? u.mhmax : u.uhpmax);
index 1a97863..c07b20d 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -183,8 +183,10 @@ const char *verb;
     struct trap *t;
     struct monst *mtmp;
     struct obj *otmp;
+#if 0 /*JP*//*unused*/
     boolean tseen;
     int ttyp = NO_TRAP;
+#endif
 
     if (obj->where != OBJ_FREE)
         panic("flooreffects: obj not free");
@@ -196,8 +198,10 @@ const char *verb;
         return TRUE;
     } else if (obj->otyp == BOULDER && (t = t_at(x, y)) != 0
                && (is_pit(t->ttyp) || is_hole(t->ttyp))) {
+#if 0 /*JP*/
         ttyp = t->ttyp;
         tseen = t->tseen ? TRUE : FALSE;
+#endif
         if (((mtmp = m_at(x, y)) && mtmp->mtrapped)
             || (u.utrap && u.ux == x && u.uy == y)) {
             if (*verb && (cansee(x, y) || distu(x, y) == 0))
index 5c8d4bd..7074cbb 100644 (file)
@@ -1767,8 +1767,10 @@ struct obj *otmp;
     }
     /* Curses, like chickens, come home to roost. */
     if ((otmp == uwep) ? welded(otmp) : (int) otmp->cursed) {
+#if 0 /*JP*//*unused*/
         boolean use_plural = (is_boots(otmp) || is_gloves(otmp)
                               || otmp->otyp == LENSES || otmp->quan > 1L);
+#endif
 
         /* might be trying again after applying grease to hands */
         if (Glib && otmp->bknown
index 22adbf0..a73d235 100644 (file)
@@ -2215,7 +2215,11 @@ register struct obj *otmp;
 register boolean nodrop;
 long num;
 {
+#if 0 /*JP*/
     char *optr = 0, obuf[BUFSZ], xbuf[BUFSZ];
+#else
+    char obuf[BUFSZ], xbuf[BUFSZ];
+#endif
 
 #if 0 /*JP*/
     if (otmp->otyp == CORPSE) {
index 22b10a0..e96dfdf 100644 (file)
@@ -21,7 +21,9 @@
 #define NUMOBUF 12
 
 STATIC_DCL char *FDECL(strprepend, (char *, const char *));
+#if 0 /*JP*/
 STATIC_DCL short FDECL(rnd_otyp_by_wpnskill, (SCHAR_P));
+#endif
 STATIC_DCL short FDECL(rnd_otyp_by_namedesc, (const char *, CHAR_P, int));
 STATIC_DCL boolean FDECL(wishymatch, (const char *, const char *, BOOLEAN_P));
 STATIC_DCL char *NDECL(nextobuf);
@@ -33,8 +35,8 @@ STATIC_DCL char *FDECL(just_an, (char *str, const char *));
 #if 0 /*JP*/
 STATIC_DCL boolean FDECL(singplur_lookup, (char *, char *, BOOLEAN_P,
                                            const char *const *));
-#endif
 STATIC_DCL char *FDECL(singplur_compound, (char *));
+#endif
 STATIC_DCL char *FDECL(xname_flags, (struct obj *, unsigned));
 #if 0 /*JP*/
 STATIC_DCL boolean FDECL(badman, (const char *, BOOLEAN_P));
@@ -2642,8 +2644,8 @@ static const char wrpsym[] = { WAND_CLASS,   RING_CLASS,   POTION_CLASS,
                                ARMOR_CLASS,  TOOL_CLASS,   FOOD_CLASS,
                                FOOD_CLASS };
 
-/* return form of the verb (input plural) if xname(otmp) were the subject */
 #if 0 /*JP*//*\93ú\96{\8cê\82É\82Í\8eO\92P\8c»\82Ìs\82Í\82È\82¢*/
+/* return form of the verb (input plural) if xname(otmp) were the subject */
 char *
 otense(otmp, verb)
 struct obj *otmp;
@@ -2663,7 +2665,6 @@ const char *verb;
     Strcpy(buf, verb);
     return buf;
 }
-#endif
 
 /* various singular words that vtense would otherwise categorize as plural;
    also used by makesingular() to catch some special cases */
@@ -2678,7 +2679,6 @@ static const char *const special_subjs[] = {
        to accommodate usage by makesingular during wishing */
 };
 
-#if 0 /*JP*//*\93ú\96{\8cê\82É\82Í\8eO\92P\8c»\82Ìs\82Í\82È\82¢*/
 /* return form of the verb (input plural) for present tense 3rd person subj */
 char *
 vtense(subj, verb)
@@ -3487,7 +3487,6 @@ static const struct alt_spellings {
     { "flintstone", FLINT },
     { (const char *) 0, 0 },
 };
-#endif
 
 STATIC_OVL short
 rnd_otyp_by_wpnskill(skill)
@@ -3512,6 +3511,7 @@ schar skill;
     }
     return otyp;
 }
+#endif
 
 STATIC_OVL short
 rnd_otyp_by_namedesc(name, oclass, xtra_prob)
index ecbbb80..5196cdb 100644 (file)
@@ -843,8 +843,10 @@ char *supplemental_name;
        "wet towel"; for "moist towel", we also want to ask about "wet towel".
        (note: strncpy() only terminates output string if the specified
        count is bigger than the length of the substring being copied) */
+#if 0 /*JP*/
     if (!strncmp(dbase_str, "moist towel", 11))
         (void) strncpy(dbase_str += 2, "wet", 3); /* skip "mo" replace "ist" */
+#endif
 
     /* Make sure the name is non-empty. */
     if (*dbase_str) {
index 2070161..93cff76 100644 (file)
@@ -131,8 +131,10 @@ VA_DECL(const char *, line)
     int ln;
     int msgtyp;
 #if !defined(NO_VSNPRINTF)
+#if 0 /*JP*/
     int vlen = 0;
 #endif
+#endif
     boolean no_repeat;
     /* Do NOT use VA_START and VA_END in here... see above */
 
@@ -147,7 +149,11 @@ VA_DECL(const char *, line)
 
     if (index(line, '%')) {
 #if !defined(NO_VSNPRINTF)
+#if 0 /*JP*/
         vlen = vsnprintf(pbuf, sizeof pbuf, line, VA_ARGS);
+#else
+        vsnprintf(pbuf, sizeof pbuf, line, VA_ARGS);
+#endif
 #if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) && defined(DEBUG)
         if (vlen >= (int) sizeof pbuf)
             panic("%s: truncation of buffer at %zu of %d bytes",
@@ -670,12 +676,18 @@ VA_DECL(const char *, str)
 #endif /* ?(USE_STDARG || USE_VARARG) */
 {       /* start of vconf...() or of nested block in USE_OLDARG's conf...() */
 #if !defined(NO_VSNPRINTF)
+#if 0 /*JP*/
     int vlen = 0;
 #endif
+#endif
     char buf[BIGBUFSZ]; /* will be chopped down to BUFSZ-1 if longer */
 
 #if !defined(NO_VSNPRINTF)
+#if 0 /*JP*/
     vlen = vsnprintf(buf, sizeof buf, str, VA_ARGS);
+#else
+    vsnprintf(buf, sizeof buf, str, VA_ARGS);
+#endif
 #if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) && defined(DEBUG)
     if (vlen >= (int) sizeof buf)
         panic("%s: truncation of buffer at %zu of %d bytes",
index 5d9da2e..a877e6c 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -3422,13 +3422,21 @@ boolean peaceful, silent;
     char roomno = *in_rooms(x, y, SHOPBASE);
     struct bill_x *bp;
     struct monst *shkp = 0;
+#if 0 /*JP*/
     boolean was_unpaid;
     long c_count = 0L, u_count = 0L;
+#else
+    long u_count = 0L;
+#endif
 
     /* gather information for message(s) prior to manipulating bill */
+#if 0 /*JP*/
     was_unpaid = obj->unpaid ? TRUE : FALSE;
+#endif
     if (Has_contents(obj)) {
+#if 0 /*JP*/
         c_count = count_contents(obj, TRUE, FALSE, TRUE, FALSE);
+#endif
         u_count = count_contents(obj, TRUE, FALSE, FALSE, FALSE);
     }
 
index f629c80..4ad6835 100644 (file)
@@ -583,6 +583,9 @@ int c; /* actually char, but explicitly specify its widened type */
     (void) putchar(c);
 */
     (void) cputchar(c);
+#if 1 /*JP*/
+    return 0;
+#endif
 }
 
 void
index bdd316b..c95f531 100644 (file)
@@ -2367,7 +2367,9 @@ winid window;
 struct WinDesc *cw;
 {
     int i, n, attr;
+#if 0 /*JP*/
     boolean linestart;
+#endif
     register char *cp;
 
     for (n = 0, i = 0; i < cw->maxrow; i++) {
@@ -2405,7 +2407,11 @@ struct WinDesc *cw;
                 ++ttyDisplay->curx;
             }
             term_start_attr(attr);
+#if 0 /*JP*/
             for (cp = &cw->data[i][1], linestart = TRUE;
+#else
+            for (cp = &cw->data[i][1];
+#endif
 #ifndef WIN32CON
                  *cp && (int) ++ttyDisplay->curx < (int) ttyDisplay->cols;
                  cp++
@@ -2799,10 +2805,10 @@ const char *str;
 #ifndef STATUS_HILITES
     register const char *nb;
     register long j;
-#endif
 #if 1 /*JP*/
     int kchar2 = 0;             /* if 1, kanji 2nd byte */
 #endif
+#endif
 
     HUPSKIP();
     /* Assume there's a real problem if the window is missing --