From: SHIRAKATA Kentaro Date: Tue, 14 Apr 2020 20:44:57 +0000 (+0900) Subject: eliminate warnings X-Git-Tag: v3.6.6-0.1~5 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=13241875dc8ea2ee63b23ce26c8c183d279762e0;p=jnethack%2Fsource.git eliminate warnings --- diff --git a/src/apply.c b/src/apply.c index 4af1971..4347499 100644 --- a/src/apply.c +++ b/src/apply.c @@ -535,7 +535,9 @@ register struct obj *obj; const char *what = "thing"; */ const char *what = "•¨‘Ì"; +#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; diff --git a/src/artifact.c b/src/artifact.c index 562d20a..99f2e9f 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -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) { diff --git a/src/cmd.c b/src/cmd.c index 9958388..cd986d3 100644 --- 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); diff --git a/src/do.c b/src/do.c index 1a97863..c07b20d 100644 --- 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)) diff --git a/src/do_wear.c b/src/do_wear.c index 5c8d4bd..7074cbb 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -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 diff --git a/src/dokick.c b/src/dokick.c index 22adbf0..a73d235 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -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) { diff --git a/src/objnam.c b/src/objnam.c index 22b10a0..e96dfdf 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -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*//*“ú–{Œê‚É‚ÍŽO’PŒ»‚Ìs‚Í‚È‚¢*/ +/* 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*//*“ú–{Œê‚É‚ÍŽO’PŒ»‚Ìs‚Í‚È‚¢*/ /* 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) diff --git a/src/pager.c b/src/pager.c index ecbbb80..5196cdb 100644 --- a/src/pager.c +++ b/src/pager.c @@ -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) { diff --git a/src/pline.c b/src/pline.c index 2070161..93cff76 100644 --- a/src/pline.c +++ b/src/pline.c @@ -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", diff --git a/src/shk.c b/src/shk.c index 5d9da2e..a877e6c 100644 --- 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); } diff --git a/win/tty/termcap.c b/win/tty/termcap.c index f629c80..4ad6835 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -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 diff --git a/win/tty/wintty.c b/win/tty/wintty.c index bdd316b..c95f531 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -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 --