From 9f19b60147ef6ab9053c087309239b14d47ee2ac Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 9 Nov 2015 01:47:18 -0800 Subject: [PATCH 01/51] fix makedefs If makedefs.c is compiled with MONITOR_HEAP defined, attempted calls to free() resulted in link failure. Since makedefs doesn't use alloc(), call free() directly instead of redirecting to nhfree(). Also some assorted reformatting.... --- util/makedefs.c | 115 +++++++++++++++++++++++++----------------------- 1 file changed, 60 insertions(+), 55 deletions(-) diff --git a/util/makedefs.c b/util/makedefs.c index 624d0186a..0e340b478 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1,12 +1,15 @@ -/* NetHack 3.6 makedefs.c $NHDT-Date: 1434151372 2015/06/12 23:22:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.103 $ */ +/* NetHack 3.6 makedefs.c $NHDT-Date: 1447062431 2015/11/09 09:47:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.105 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ -/* Copyright (c) M. Stephenson, 1990, 1991. */ -/* Copyright (c) Dean Luick, 1990. */ +/* Copyright (c) M. Stephenson, 1990, 1991. */ +/* Copyright (c) Dean Luick, 1990. */ /* NetHack may be freely redistributed. See license for details. */ #define MAKEDEFS_C /* use to conditionally include file sections */ #include "config.h" +#ifdef MONITOR_HEAP +#undef free /* makedefs doesn't use the alloc and free in src/alloc.c */ +#endif #include "permonst.h" #include "objclass.h" #include "monsym.h" @@ -228,8 +231,8 @@ main(void) if (buf[0] == '-' && buf[1] == '-') { #if 0 - split up buf into words - do_ext_makedefs(fakeargc, fakeargv); + split up buf into words + do_ext_makedefs(fakeargc, fakeargv); #else printf("extended makedefs not implemented for Mac OS9\n"); exit(EXIT_FAILURE); @@ -589,12 +592,12 @@ do_ext_makedefs(int argc, char **argv) existing lines in the docs look like that) Control lines: - ^^ a line starting with a (single) literal caret - ^# a comment - the line is ignored - ^?ID if defined(ID) - ^!ID if !defined(ID) - ^: else - ^. endif + ^^ a line starting with a (single) literal caret + ^# a comment - the line is ignored + ^?ID if defined(ID) + ^!ID if !defined(ID) + ^: else + ^. endif */ #define GREP_MAGIC '^' @@ -891,6 +894,7 @@ unsigned long old_rumor_offset; we ameliorate the latter by padding the shortest lines, increasing the chance of the random seek landing in them */ int len = (int) strlen(line); + if (len <= PAD_RUMORS_TO) { char *base = index(line, '\n'); /* this is only safe because fgetline() overallocates */ @@ -903,8 +907,8 @@ unsigned long old_rumor_offset; #endif (*rumor_count)++; #if 0 - /*[if we forced binary output, this would be sufficient]*/ - *rumor_size += strlen(line); /* includes newline */ + /*[if we forced binary output, this would be sufficient]*/ + *rumor_size += strlen(line); /* includes newline */ #endif (void) fputs(xcrypt(line), tfp); free(line); @@ -1204,8 +1208,8 @@ const char *build_date; version_string(versbuf, "."), PORT_ID, subbuf, &build_date[4]); #if 0 Sprintf(outbuf, "%s NetHack%s %s Copyright 1985-%s (built %s)", - PORT_ID, subbuf, version_string(versbuf,"."), RELEASE_YEAR, - &build_date[4]); + PORT_ID, subbuf, version_string(versbuf,"."), RELEASE_YEAR, + &build_date[4]); #endif return outbuf; } @@ -1593,21 +1597,21 @@ char *line; /* * New format (v3.1) of 'data' file which allows much faster lookups [pr] -"do not edit" first record is a comment line -01234567 hexadecimal formatted offset to text area -name-a first name of interest -123,4 offset to name's text, and number of lines for it -name-b next name of interest -name-c multiple names which share same description also -456,7 share a single offset,count line -. sentinel to mark end of names -789,0 dummy record containing offset, count of EOF -text-a 4 lines of descriptive text for name-a -text-a at file position 0x01234567L + 123L +"do not edit" first record is a comment line +01234567 hexadecimal formatted offset to text area +name-a first name of interest +123,4 offset to name's text, and number of lines for it +name-b next name of interest +name-c multiple names which share same description also +456,7 share a single offset,count line +. sentinel to mark end of names +789,0 dummy record containing offset, count of EOF +text-a 4 lines of descriptive text for name-a +text-a at file position 0x01234567L + 123L text-a text-a -text-b/text-c 7 lines of text for names-b and -c -text-b/text-c at fseek(0x01234567L + 456L) +text-b/text-c 7 lines of text for names-b and -c +text-b/text-c at fseek(0x01234567L + 456L) ... * */ @@ -1985,7 +1989,7 @@ register struct permonst *ptr; return TRUE; } - return (FALSE); + return FALSE; } /* This routine is designed to return an integer value which represents @@ -2001,22 +2005,22 @@ struct permonst *ptr; if (tmp > 49) /* special fixed hp monster */ tmp = 2 * (tmp - 6) / 4; - /* For creation in groups */ + /* For creation in groups */ n = (!!(ptr->geno & G_SGROUP)); n += (!!(ptr->geno & G_LGROUP)) << 1; - /* For ranged attacks */ + /* For ranged attacks */ if (ranged_attk(ptr)) n++; - /* For higher ac values */ + /* For higher ac values */ n += (ptr->ac < 4); n += (ptr->ac < 0); - /* For very fast monsters */ + /* For very fast monsters */ n += (ptr->mmove >= 18); - /* For each attack and "special" attack */ + /* For each attack and "special" attack */ for (i = 0; i < NATTK; i++) { tmp2 = ptr->mattk[i].aatyp; n += (tmp2 > 0); @@ -2024,7 +2028,7 @@ struct permonst *ptr; n += (tmp2 == AT_WEAP && (ptr->mflags2 & M2_STRONG)); } - /* For each "special" damage type */ + /* For each "special" damage type */ for (i = 0; i < NATTK; i++) { tmp2 = ptr->mattk[i].adtyp; if ((tmp2 == AD_DRLI) || (tmp2 == AD_STON) || (tmp2 == AD_DRST) @@ -2035,13 +2039,12 @@ struct permonst *ptr; n += ((int) (ptr->mattk[i].damd * ptr->mattk[i].damn) > 23); } - /* Leprechauns are special cases. They have many hit dice so they - can hit and are hard to kill, but they don't really do much - damage. */ + /* Leprechauns are special cases. They have many hit dice so they can + hit and are hard to kill, but they don't really do much damage. */ if (!strcmp(ptr->mname, "leprechaun")) n -= 2; - /* Finally, adjust the monster level 0 <= n <= 24 (approx.) */ + /* Finally, adjust the monster level 0 <= n <= 24 (approx.) */ if (n == 0) tmp--; else if (n >= 6) @@ -2049,7 +2052,7 @@ struct permonst *ptr; else tmp += (n / 3 + 1); - return ((tmp >= 0) ? tmp : 0); + return (tmp >= 0) ? tmp : 0; } void @@ -2134,7 +2137,7 @@ do_permonst() return; } -/* Start of Quest text file processing. */ +/* Start of Quest text file processing. */ #include "qtext.h" static struct qthdr qt_hdr; @@ -2151,15 +2154,15 @@ qt_comment(s) char *s; { if (s[0] == '#') - return (TRUE); - return ((boolean)(!in_msg && strlen(s) == NO_MSG)); + return TRUE; + return (boolean) (!in_msg && strlen(s) == NO_MSG); } static boolean qt_control(s) char *s; { - return ((boolean)(s[0] == '%' && (s[1] == 'C' || s[1] == 'E'))); + return (boolean) (s[0] == '%' && (s[1] == 'C' || s[1] == 'E')); } static int @@ -2170,9 +2173,9 @@ char *code; for (i = 0; i < qt_hdr.n_hdr; i++) if (!strncmp(code, qt_hdr.id[i], LEN_HDR)) - return (++i); + return ++i; - return (0); + return 0; } static boolean @@ -2181,13 +2184,13 @@ char *code; { if (qt_hdr.n_hdr >= N_HDR) { Fprintf(stderr, OUT_OF_HEADERS, qt_line); - return (FALSE); + return FALSE; } strncpy(&qt_hdr.id[qt_hdr.n_hdr][0], code, LEN_HDR); msg_hdr[qt_hdr.n_hdr].n_msg = 0; qt_hdr.offset[qt_hdr.n_hdr++] = 0L; - return (TRUE); + return TRUE; } static boolean @@ -2198,9 +2201,9 @@ int num, id; for (i = 0; i < msg_hdr[num].n_msg; i++) if (msg_hdr[num].qt_msg[i].msgnum == id) - return (TRUE); + return TRUE; - return (FALSE); + return FALSE; } static void @@ -2364,7 +2367,7 @@ put_qt_hdrs() int i; /* - * The main header record. + * The main header record. */ if (debug) Fprintf(stderr, "%ld: header info.\n", ftell(ofp)); @@ -2380,7 +2383,7 @@ put_qt_hdrs() } /* - * The individual class headers. + * The individual class headers. */ for (i = 0; i < qt_hdr.n_hdr; i++) { if (debug) @@ -2392,10 +2395,12 @@ put_qt_hdrs() sizeof(struct qtmsg), msg_hdr[i].n_msg, ofp); if (debug) { int j; + for (j = 0; j < msg_hdr[i].n_msg; j++) { - Fprintf( - stderr, "msg %d @ %ld (%ld)", msg_hdr[i].qt_msg[j].msgnum, - msg_hdr[i].qt_msg[j].offset, msg_hdr[i].qt_msg[j].size); + Fprintf(stderr, "msg %d @ %ld (%ld)", + msg_hdr[i].qt_msg[j].msgnum, + msg_hdr[i].qt_msg[j].offset, + msg_hdr[i].qt_msg[j].size); if (msg_hdr[i].qt_msg[j].summary_size) Fprintf(stderr, " [%ld]", msg_hdr[i].qt_msg[j].summary_size); From d195052796effd1efc129a39356f27a26c0b3614 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Nov 2015 13:06:19 +0200 Subject: [PATCH 02/51] Remove trailing whitespaces --- src/botl.c | 2 +- src/hacklib.c | 2 +- src/monst.c | 2 +- src/questpgr.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/botl.c b/src/botl.c index f58227ad8..134305f89 100644 --- a/src/botl.c +++ b/src/botl.c @@ -643,7 +643,7 @@ boolean } for (i = 0; i < MAXBLSTATS; ++i) { enum statusfields fld = initblstats[i].fld; - + switch (fld) { case BL_TITLE: fieldfmt = "%s"; diff --git a/src/hacklib.c b/src/hacklib.c index f7499decb..a590968d9 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -8,7 +8,7 @@ Assorted 'small' utility routines. They're virtually independent of NetHack, except that rounddiv may call panic(). setrandom calls one of srandom(), srand48(), or srand() depending upon configuration. - + return type routine name argument type(s) boolean digit (char) boolean letter (char) diff --git a/src/monst.c b/src/monst.c index 9a4185773..cf14f9e29 100644 --- a/src/monst.c +++ b/src/monst.c @@ -1464,7 +1464,7 @@ struct permonst _mons2[] = { M2_HOSTILE | M2_STRONG | M2_NASTY | M2_COLLECT, M3_INFRAVISIBLE, CLR_ORANGE), #if 0 /* DEFERRED */ - MON("vorpal jabberwock", S_JABBERWOCK, + MON("vorpal jabberwock", S_JABBERWOCK, LVL(20, 12, -2, 50, 0), (G_GENO | 1), A(ATTK(AT_BITE, AD_PHYS, 3, 10), ATTK(AT_BITE, AD_PHYS, 3, 10), ATTK(AT_CLAW, AD_PHYS, 3, 10), ATTK(AT_CLAW, AD_PHYS, 3, 10), diff --git a/src/questpgr.c b/src/questpgr.c index cf13f30b0..09099c85e 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -241,7 +241,7 @@ char who, /* 'd' => deity, 'l' => leader, 'n' => nemesis, 'o' => artifact */ if (who == 'o' && (strstri(cvt_buf, "Eyes ") || strcmpi(cvt_buf, makesingular(cvt_buf)))) { - pnoun = (lwhich == 'h') ? "they" + pnoun = (lwhich == 'h') ? "they" : (lwhich == 'i') ? "them" : (lwhich == 'j') ? "their" : "?"; } else { From 7132f56901670cb37b914240729dedf7cf2c6487 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Nov 2015 13:24:40 +0200 Subject: [PATCH 03/51] Unwrap t-shirt and apron texts, and add one t-shirt msg --- src/read.c | 69 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 21 deletions(-) diff --git a/src/read.c b/src/read.c index 5977763ee..d4fd16923 100644 --- a/src/read.c +++ b/src/read.c @@ -82,38 +82,62 @@ char *buf; "I survived Yendor Military Boot Camp", "Ludios Accounting School Intra-Mural Lacrosse Team", "Oracle(TM) Fountains 10th Annual Wet T-Shirt Contest", - "Hey, black dragon! Disintegrate THIS!", "I'm With Stupid -->", - "Don't blame me, I voted for Izchak!", "Don't Panic", /* HHGTTG */ + "Hey, black dragon! Disintegrate THIS!", + "I'm With Stupid -->", + "Don't blame me, I voted for Izchak!", + "Don't Panic", /* HHGTTG */ "Furinkan High School Athletic Dept.", /* Ranma 1/2 */ "Hel-LOOO, Nurse!", /* Animaniacs */ - "=^.^=", "100% goblin hair - do not wash", "Aberzombie and Fitch", + "=^.^=", + "100% goblin hair - do not wash", + "Aberzombie and Fitch", "cK -- Cockatrice touches the Kop", - "Don't ask me, I only adventure here", "Down with pants!", - "d, your dog or a killer?", "FREE PUG AND NEWT!", "Go team ant!", - "Got newt?", "Hello, my darlings!", /* Charlie Drake */ - "Hey! Nymphs! Steal This T-Shirt!", "I <3 Dungeon of Doom", + "Don't ask me, I only adventure here", + "Down with pants!", + "d, your dog or a killer?", + "FREE PUG AND NEWT!", + "Go team ant!", + "Got newt?", + "Hello, my darlings!", /* Charlie Drake */ + "Hey! Nymphs! Steal This T-Shirt!", + "I <3 Dungeon of Doom", "I <3 Maud", "I am a Valkyrie. If you see me running, try to keep up.", "I am not a pack rat - I am a collector", "I bounced off a rubber tree", /* Monkey Island */ "Plunder Island Brimstone Beach Club", /* Monkey Island */ "If you can read this, I can hit you with my polearm", - "I'm confused!", "I scored with the princess", - "I want to live forever or die in the attempt.", "Lichen Park", - "LOST IN THOUGHT - please send search party", "Meat is Mordor", - "Minetown Better Business Bureau", "Minetown Watch", + "I'm confused!", + "I scored with the princess", + "I want to live forever or die in the attempt.", + "Lichen Park", + "LOST IN THOUGHT - please send search party", + "Meat is Mordor", + "Minetown Better Business Bureau", + "Minetown Watch", "Ms. Palm's House of Negotiable Affection -- A Very Reputable House Of Disrepute", - "Protection Racketeer", "Real men love Crom", - "Somebody stole my Mojo!", "The Hellhound Gang", "The Werewolves", + "Protection Racketeer", + "Real men love Crom", + "Somebody stole my Mojo!", + "The Hellhound Gang", + "The Werewolves", "They Might Be Storm Giants", - "Weapons don't kill people, I kill people", "White Zombie", + "Weapons don't kill people, I kill people", + "White Zombie", "You're killing me!", "Anhur State University - Home of the Fighting Fire Ants!", - "FREE HUGS", "Serial Ascender", "Real men are valkyries", - "Young Men's Cavedigging Association", "Occupy Fort Ludios", - "I couldn't afford this T-shirt so I stole it!", "Mind flayers suck", - "I'm not wearing any pants", "Down with the living!", - "Pudding farmer", "Vegetarian", + "FREE HUGS", + "Serial Ascender", + "Real men are valkyries", + "Young Men's Cavedigging Association", + "Occupy Fort Ludios", + "I couldn't afford this T-shirt so I stole it!", + "Mind flayers suck", + "I'm not wearing any pants", + "Down with the living!", + "Pudding farmer", + "Vegetarian", + "Hello, I'm War!", }; Strcpy(buf, shirt_msgs[tshirt->o_id % SIZE(shirt_msgs)]); @@ -126,8 +150,11 @@ struct obj *apron; char *buf; { static const char *apron_msgs[] = { - "Kiss the cook", "I'm making SCIENCE!", "Don't mess with the chef", - "Don't make me poison you", "Gehennom's Kitchen", + "Kiss the cook", + "I'm making SCIENCE!", + "Don't mess with the chef", + "Don't make me poison you", + "Gehennom's Kitchen", "Rat: The other white meat", "If you can't stand the heat, get out of Gehennom!", "If we weren't meant to eat animals, why are they made out of meat?", From 2c0f24896f65576149e9d3f094441007a5b7c01f Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Nov 2015 21:37:28 +0200 Subject: [PATCH 04/51] Unify blind feel_location or newsym info single func --- include/extern.h | 1 + src/apply.c | 10 ++-------- src/detect.c | 5 +---- src/dig.c | 10 ++-------- src/display.c | 17 +++++++++++++++++ src/dokick.c | 15 +++------------ src/lock.c | 10 ++-------- src/trap.c | 5 +---- 8 files changed, 29 insertions(+), 44 deletions(-) diff --git a/include/extern.h b/include/extern.h index 7e5195cc8..8f6bb1c84 100644 --- a/include/extern.h +++ b/include/extern.h @@ -306,6 +306,7 @@ E void FDECL(map_object, (struct obj *, int)); E void FDECL(map_invisible, (XCHAR_P, XCHAR_P)); E void FDECL(unmap_object, (int, int)); E void FDECL(map_location, (int, int, int)); +E void FDECL(feel_newsym, (XCHAR_P, XCHAR_P)); E void FDECL(feel_location, (XCHAR_P, XCHAR_P)); E void FDECL(newsym, (int, int)); E void FDECL(shieldeff, (XCHAR_P, XCHAR_P)); diff --git a/src/apply.c b/src/apply.c index 9379fb24c..952e5fa7b 100644 --- a/src/apply.c +++ b/src/apply.c @@ -401,19 +401,13 @@ register struct obj *obj; case SDOOR: You_hear(hollow_str, "door"); cvt_sdoor_to_door(lev); /* ->typ = DOOR */ - if (Blind) - feel_location(rx, ry); - else - newsym(rx, ry); + feel_newsym(rx, ry); return res; case SCORR: You_hear(hollow_str, "passage"); lev->typ = CORR; unblock_point(rx, ry); - if (Blind) - feel_location(rx, ry); - else - newsym(rx, ry); + feel_newsym(rx, ry); return res; } diff --git a/src/detect.c b/src/detect.c index c8f824eed..f33ce7139 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1291,10 +1291,7 @@ struct trap *trap; trap->tseen = 1; exercise(A_WIS, TRUE); - if (Blind) - feel_location(trap->tx, trap->ty); - else - newsym(trap->tx, trap->ty); + feel_newsym(trap->tx, trap->ty); if (levl[trap->tx][trap->ty].glyph != trap_to_glyph(trap)) { /* There's too much clutter to see your find otherwise */ diff --git a/src/dig.c b/src/dig.c index 0631c4365..17fcf4553 100644 --- a/src/dig.c +++ b/src/dig.c @@ -81,10 +81,7 @@ boolean waslit, rockit; lev->typ = (rockit ? STONE : ROOM); if (dist >= 3) impossible("mkcavepos called with dist %d", dist); - if (Blind) - feel_location(x, y); - else - newsym(x, y); + feel_newsym(x, y); } STATIC_OVL void @@ -437,10 +434,7 @@ dig(VOID_ARGS) if (!does_block(dpx, dpy, &levl[dpx][dpy])) unblock_point(dpx, dpy); /* vision: can see through */ - if (Blind) - feel_location(dpx, dpy); - else - newsym(dpx, dpy); + feel_newsym(dpx, dpy); if (digtxt && !context.digging.quiet) pline1(digtxt); /* after newsym */ if (dmgtxt) diff --git a/src/display.c b/src/display.c index c6c7f7206..e75f74d53 100644 --- a/src/display.c +++ b/src/display.c @@ -486,6 +486,23 @@ register struct monst *mon; show_glyph(x, y, glyph); } + +/* + * feel_newsym() + * + * When hero knows what happened to location, even when blind. + */ +void +feel_newsym(x, y) +xchar x, y; +{ + if (Blind) + feel_location(x, y); + else + newsym(x, y); +} + + /* * feel_location() * diff --git a/src/dokick.c b/src/dokick.c index 1f4d1b42a..ca4e2a6bc 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -973,10 +973,7 @@ dokick() } else if (maploc->doormask != D_NODOOR && !(maploc->doormask & D_LOCKED)) maploc->doormask = D_ISOPEN; - if (Blind) - feel_location(x, y); /* we know it's gone */ - else - newsym(x, y); + feel_newsym(x, y); /* we know it's gone */ if (maploc->doormask == D_ISOPEN || maploc->doormask == D_NODOOR) unblock_point(x, y); /* vision */ @@ -989,10 +986,7 @@ dokick() pline("Crash! You kick open a secret passage!"); exercise(A_DEX, TRUE); maploc->typ = CORR; - if (Blind) - feel_location(x, y); /* we know it's gone */ - else - newsym(x, y); + feel_newsym(x, y); /* we know it's gone */ unblock_point(x, y); /* vision */ return 1; } else @@ -1267,10 +1261,7 @@ dokick() exercise(A_STR, TRUE); maploc->doormask = D_BROKEN; } - if (Blind) - feel_location(x, y); /* we know we broke it */ - else - newsym(x, y); + feel_newsym(x, y); /* we know we broke it */ unblock_point(x, y); /* vision */ if (shopdoor) { add_damage(x, y, 400L); diff --git a/src/lock.c b/src/lock.c index db9a57995..0f6ab0f71 100644 --- a/src/lock.c +++ b/src/lock.c @@ -648,10 +648,7 @@ int x, y; add_damage(cc.x, cc.y, 0L); } else door->doormask = D_ISOPEN; - if (Blind) - feel_location(cc.x, cc.y); /* the hero knows she opened it */ - else - newsym(cc.x, cc.y); + feel_newsym(cc.x, cc.y); /* the hero knows she opened it */ unblock_point(cc.x, cc.y); /* vision: new see through there */ } else { exercise(A_STR, TRUE); @@ -781,10 +778,7 @@ doclose() || rn2(25) < (ACURRSTR + ACURR(A_DEX) + ACURR(A_CON)) / 3) { pline_The("door closes."); door->doormask = D_CLOSED; - if (Blind) - feel_location(x, y); /* the hero knows she closed it */ - else - newsym(x, y); + feel_newsym(x, y); /* the hero knows she closed it */ block_point(x, y); /* vision: no longer see there */ } else { exercise(A_STR, TRUE); diff --git a/src/trap.c b/src/trap.c index ebc1eede1..3bef3ccae 100644 --- a/src/trap.c +++ b/src/trap.c @@ -760,10 +760,7 @@ boolean shatter; otmp = nxtobj(otmp, STATUE, TRUE); } - if (Blind) - feel_location(x, y); - else - newsym(x, y); + feel_newsym(x, y); return mtmp; } From 010859bcca14c9a6fb4d2930bbf6e45cb4269aa3 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 9 Nov 2015 17:21:20 -0800 Subject: [PATCH 05/51] SYSCF tiny memory leak Free sysopt.shellers and sysopt.explorers when releasing the memory used for other sysopt fields. Also some formatting stuff since sys.c was previously untouched. --- src/sys.c | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/sys.c b/src/sys.c index ad42e01b2..03beb607a 100644 --- a/src/sys.c +++ b/src/sys.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 sys.c $NHDT-Date: 1432512769 2015/05/25 00:12:49 $ $NHDT-Branch: master $:$NHDT-Revision: 1.33 $ */ +/* NetHack 3.6 sys.c $NHDT-Date: 1447118472 2015/11/10 01:21:12 $ $NHDT-Branch: master $:$NHDT-Revision: 1.34 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -6,9 +6,11 @@ #ifndef SYSCF /* !SYSCF configurations need '#define DEBUGFILES "foo.c bar.c"' - to enable debugging feedback for source files foo.c and bar.c; - to activate debugpline(), set an appropriate value and uncomment */ + * to enable debugging feedback for source files foo.c and bar.c; + * to activate debugpline(), set an appropriate value and uncomment + */ /* # define DEBUGFILES "*" */ + /* note: DEBUGFILES value here or in sysconf.DEBUGFILES can be overridden at runtime by setting up a value for "DEBUGFILES" in the environment */ #endif @@ -18,21 +20,21 @@ struct sysopt sysopt; void sys_early_init() { - sysopt.support = NULL; - sysopt.recover = NULL; + sysopt.support = (char *) 0; + sysopt.recover = (char *) 0; #ifdef SYSCF - sysopt.wizards = NULL; + sysopt.wizards = (char *) 0; #else sysopt.wizards = dupstr(WIZARD_NAME); #endif #if defined(SYSCF) || !defined(DEBUGFILES) - sysopt.debugfiles = NULL; + sysopt.debugfiles = (char *) 0; #else sysopt.debugfiles = dupstr(DEBUGFILES); #endif sysopt.env_dbgfl = 0; /* haven't checked getenv("DEBUGFILES") yet */ - sysopt.shellers = NULL; - sysopt.explorers = NULL; + sysopt.shellers = (char *) 0; + sysopt.explorers = (char *) 0; sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */ /* record file */ @@ -72,25 +74,31 @@ sys_early_init() sysopt.check_save_uid = 1; sysopt.seduce = 1; /* if it's compiled in, default to on */ sysopt_seduce_set(sysopt.seduce); + return; } void sysopt_release() { if (sysopt.support) - free(sysopt.support), sysopt.support = NULL; + free(sysopt.support), sysopt.support = (char *) 0; if (sysopt.recover) - free(sysopt.recover), sysopt.recover = NULL; + free(sysopt.recover), sysopt.recover = (char *) 0; if (sysopt.wizards) - free(sysopt.wizards), sysopt.wizards = NULL; + free(sysopt.wizards), sysopt.wizards = (char *) 0; + if (sysopt.explorers) + free(sysopt.explorers), sysopt.explorers = (char *) 0; + if (sysopt.shellers) + free(sysopt.shellers), sysopt.shellers = (char *) 0; if (sysopt.debugfiles) - free(sysopt.debugfiles), sysopt.debugfiles = NULL; + free(sysopt.debugfiles), sysopt.debugfiles = (char *) 0; #ifdef PANICTRACE if (sysopt.gdbpath) - free(sysopt.gdbpath), sysopt.gdbpath = NULL; + free(sysopt.gdbpath), sysopt.gdbpath = (char *) 0; if (sysopt.greppath) - free(sysopt.greppath), sysopt.greppath = NULL; + free(sysopt.greppath), sysopt.greppath = (char *) 0; #endif + return; } extern struct attack sa_yes[NATTK]; @@ -102,8 +110,12 @@ int val; { struct attack *setval = val ? sa_yes : sa_no; int x; + for (x = 0; x < NATTK; x++) { mons[PM_INCUBUS].mattk[x] = setval[x]; mons[PM_SUCCUBUS].mattk[x] = setval[x]; } + return; } + +/*sys.c*/ From 8f0252c5d83cb4355ef1770f09156054eaed82c9 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 9 Nov 2015 18:37:00 -0800 Subject: [PATCH 06/51] update util/.gitignore Tell git to ignore the presence of the heaputil program in util/. (It lives in NHinternal/devteam/util/heaputil.c but working with it from there is inconvenient.) --- util/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/.gitignore b/util/.gitignore index 6982f2d05..95b7c4db1 100644 --- a/util/.gitignore +++ b/util/.gitignore @@ -17,3 +17,6 @@ gif2txt txt2ppm tile2img.ttp xpm2ppm.ttp +# dev tool for analyzing data collected by nethack's #define MONITOR_HEAP +heaputil +heaputil.c From 85b234e1fc22c33057358f46c368439905ea6fc4 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 9 Nov 2015 19:11:41 -0800 Subject: [PATCH 07/51] tiny symset memory leak Symbol set names weren't being freed upon exit. --- include/extern.h | 3 ++- src/drawing.c | 4 +--- src/options.c | 13 ++++++++++++- src/save.c | 3 ++- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/include/extern.h b/include/extern.h index 8f6bb1c84..54c6ed2b3 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 extern.h $NHDT-Date: 1446516834 2015/11/03 02:13:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.513 $ */ +/* NetHack 3.6 extern.h $NHDT-Date: 1447124656 2015/11/10 03:04:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.515 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1638,6 +1638,7 @@ E void FDECL(set_option_mod_status, (const char *, int)); E int FDECL(add_autopickup_exception, (const char *)); E void NDECL(free_autopickup_exceptions); E int FDECL(load_symset, (const char *, int)); +E void NDECL(free_symsets); E void FDECL(parsesymbols, (char *)); E struct symparse *FDECL(match_sym, (char *)); E void NDECL(set_playmode); diff --git a/src/drawing.c b/src/drawing.c index 515872a2a..96bbd2da2 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 drawing.c $NHDT-Date: 1446975466 2015/11/08 09:37:46 $ $NHDT-Branch: master $:$NHDT-Revision: 1.48 $ */ +/* NetHack 3.6 drawing.c $NHDT-Date: 1447124657 2015/11/10 03:04:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.49 $ */ /* Copyright (c) NetHack Development Team 1992. */ /* NetHack may be freely redistributed. See license for details. */ @@ -520,9 +520,7 @@ boolean name_too; free((genericptr_t) symset[which_set].desc); symset[which_set].desc = (char *) 0; - symset[which_set].nocolor = 0; symset[which_set].handling = H_UNK; - symset[which_set].desc = (char *) 0; symset[which_set].nocolor = 0; /* initialize restriction bits */ symset[which_set].primary = 0; diff --git a/src/options.c b/src/options.c index 140fb02da..dd3097f33 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 options.c $NHDT-Date: 1446854231 2015/11/06 23:57:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.236 $ */ +/* NetHack 3.6 options.c $NHDT-Date: 1447124657 2015/11/10 03:04:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.238 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -4933,6 +4933,17 @@ int which_set; return 1; } +void +free_symsets() +{ + clear_symsetentry(PRIMARY, TRUE); + clear_symsetentry(ROGUESET, TRUE); + + /* symset_list is cleaned up as soon as it's used, so we shouldn't + have to anything about it here */ + /* assert( symset_list == NULL ); */ +} + /* Parse the value of a SYMBOLS line from a config file */ void parsesymbols(opts) diff --git a/src/save.c b/src/save.c index 18d9a1534..dccd3a785 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 save.c $NHDT-Date: 1446892456 2015/11/07 10:34:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.92 $ */ +/* NetHack 3.6 save.c $NHDT-Date: 1447124658 2015/11/10 03:04:18 $ $NHDT-Branch: master $:$NHDT-Revision: 1.93 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1396,6 +1396,7 @@ freedynamicdata() /* miscellaneous */ free_pickinv_cache(); + free_symsets(); #endif /* FREE_ALL_MEMORY */ #ifdef STATUS_VIA_WINDOWPORT status_finish(); From 2e3ef24762bd0ca466fc89706af210eb5cf78c72 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 9 Nov 2015 19:20:19 -0800 Subject: [PATCH 08/51] options.c cleanup Replace several 'foo = alloc(strlen(bar)+1), strcpy(foo,bar)' sequences with 'foo = dupstr(bar)' calls. Change 'free(foo)' into 'free((genericptr_t) foo)' to possibly pacify 'lint' and/or really old compilers. Add braces around 'if something;' when 'else { otherwise; }' has braces. Simplify option value formatting for 'sortloot'. --- src/options.c | 202 ++++++++++++++++++++++++-------------------------- 1 file changed, 97 insertions(+), 105 deletions(-) diff --git a/src/options.c b/src/options.c index dd3097f33..d9c6a3ea9 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 options.c $NHDT-Date: 1447124657 2015/11/10 03:04:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.238 $ */ +/* NetHack 3.6 options.c $NHDT-Date: 1447125615 2015/11/10 03:20:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.239 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -710,8 +710,10 @@ initoptions_init() #if defined(UNIX) || defined(VMS) #ifdef TTY_GRAPHICS /* detect whether a "vt" terminal can handle alternate charsets */ - if ((opts = nh_getenv("TERM")) && !strncmpi(opts, "vt", 2) && AS && AE - && index(AS, '\016') && index(AE, '\017')) { + if ((opts = nh_getenv("TERM")) + /* [could also check "xterm" which emulates vtXXX by default] */ + && !strncmpi(opts, "vt", 2) + && AS && AE && index(AS, '\016') && index(AE, '\017')) { if (!symset[PRIMARY].name) load_symset("DECGraphics", PRIMARY); switch_symbols(TRUE); @@ -1057,9 +1059,9 @@ const char *optn; else flags.suppress_alert = fnv; if (rejectver) { - if (!initial) + if (!initial) { You_cant("disable new feature alerts for future versions."); - else { + } else { Sprintf(buf, "\n%s=%s Invalid reference to a future version ignored", optn, op); @@ -1372,7 +1374,7 @@ int typ; char *pattern; { struct plinemsg_type *tmp - = (struct plinemsg_type *) alloc(sizeof (struct plinemsg_type)); + = (struct plinemsg_type *) alloc(sizeof (struct plinemsg_type)); if (!tmp) return FALSE; @@ -1387,7 +1389,7 @@ char *pattern; pline("%s: %s", re_error, regex_error_desc(tmp->regex)); wait_synch(); regex_free(tmp->regex); - free(tmp); + free((genericptr_t) tmp); return FALSE; } tmp->pattern = dupstr(pattern); @@ -1655,7 +1657,7 @@ boolean tinitial, tfrom_file; { register char *op; unsigned num; - boolean negated, duplicate; + boolean negated, val_negated, duplicate; int i; const char *fullname; @@ -1730,10 +1732,10 @@ boolean tinitial, tfrom_file; /* align:string */ fullname = "align"; if (match_optname(opts, fullname, sizeof("align") - 1, TRUE)) { - if (negated) + if (negated) { bad_negation(fullname, FALSE); - else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { - boolean val_negated = FALSE; + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + val_negated = FALSE; while ((*op == '!') || !strncmpi(op, "no", 2)) { if (*op == '!') op++; @@ -1758,10 +1760,10 @@ boolean tinitial, tfrom_file; fullname = "role"; if (match_optname(opts, fullname, 4, TRUE) || match_optname(opts, (fullname = "character"), 4, TRUE)) { - if (negated) + if (negated) { bad_negation(fullname, FALSE); - else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { - boolean val_negated = FALSE; + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + val_negated = FALSE; while ((*op == '!') || !strncmpi(op, "no", 2)) { if (*op == '!') op++; @@ -1787,10 +1789,10 @@ boolean tinitial, tfrom_file; /* race:string */ fullname = "race"; if (match_optname(opts, fullname, 4, TRUE)) { - if (negated) + if (negated) { bad_negation(fullname, FALSE); - else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { - boolean val_negated = FALSE; + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + val_negated = FALSE; while ((*op == '!') || !strncmpi(op, "no", 2)) { if (*op == '!') op++; @@ -1816,10 +1818,10 @@ boolean tinitial, tfrom_file; /* gender:string */ fullname = "gender"; if (match_optname(opts, fullname, 4, TRUE)) { - if (negated) + if (negated) { bad_negation(fullname, FALSE); - else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { - boolean val_negated = FALSE; + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + val_negated = FALSE; while ((*op == '!') || !strncmpi(op, "no", 2)) { if (*op == '!') op++; @@ -1968,11 +1970,10 @@ boolean tinitial, tfrom_file; if (match_optname(opts, fullname, 7, TRUE)) { if (duplicate) complain_about_duplicate(opts, 1); - if (negated) + if (negated) { bad_negation(fullname, FALSE); - else if ((op = string_for_opt(opts, FALSE)) != 0) { - symset[ROGUESET].name = (char *) alloc(strlen(op) + 1); - Strcpy(symset[ROGUESET].name, op); + } else if ((op = string_for_opt(opts, FALSE)) != 0) { + symset[ROGUESET].name = dupstr(op); if (!read_sym_file(ROGUESET)) { clear_symsetentry(ROGUESET, TRUE); raw_printf("Unable to load symbol set \"%s\" from \"%s\".", @@ -1991,11 +1992,10 @@ boolean tinitial, tfrom_file; if (match_optname(opts, fullname, 6, TRUE)) { if (duplicate) complain_about_duplicate(opts, 1); - if (negated) + if (negated) { bad_negation(fullname, FALSE); - else if ((op = string_for_opt(opts, FALSE)) != 0) { - symset[PRIMARY].name = (char *) alloc(strlen(op) + 1); - Strcpy(symset[PRIMARY].name, op); + } else if ((op = string_for_opt(opts, FALSE)) != 0) { + symset[PRIMARY].name = dupstr(op); if (!read_sym_file(PRIMARY)) { clear_symsetentry(PRIMARY, TRUE); raw_printf("Unable to load symbol set \"%s\" from \"%s\".", @@ -2370,9 +2370,9 @@ boolean tinitial, tfrom_file; if (match_optname(opts, fullname, 4, TRUE)) { if (duplicate) complain_about_duplicate(opts, 1); - if (negated) + if (negated) { bad_negation(fullname, FALSE); - else if ((op = string_for_opt(opts, negated))) { + } else if ((op = string_for_opt(opts, negated)) != 0) { #ifdef WIN32 (void) strncpy(iflags.altkeyhandler, op, MAX_ALTKEYHANDLER - 5); load_keyboard_handler(); @@ -2973,9 +2973,9 @@ boolean tinitial, tfrom_file; fullname = "subkeyvalue"; if (match_optname(opts, fullname, 5, TRUE)) { /* no duplicate complaint here */ - if (negated) + if (negated) { bad_negation(fullname, FALSE); - else { + } else { #if defined(WIN32) op = string_for_opt(opts, 0); map_subkeyvalue(op); @@ -3140,9 +3140,9 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); if (match_optname(opts, fullname, (int) strlen(fullname), TRUE)) { - if (negated) + if (negated) { bad_negation(fullname, FALSE); - else if ((op = string_for_opt(opts, FALSE)) != 0) { + } else if ((op = string_for_opt(opts, FALSE)) != 0) { int j; char c, op_buf[BUFSZ]; boolean isbad = FALSE; @@ -3197,11 +3197,10 @@ boolean tinitial, tfrom_file; complain_about_duplicate(opts, 1); if (!negated) { /* There is no rogue level DECgraphics-specific set */ - if (symset[PRIMARY].name) + if (symset[PRIMARY].name) { badflag = TRUE; - else { - symset[PRIMARY].name = (char *) alloc(strlen(fullname) + 1); - Strcpy(symset[PRIMARY].name, fullname); + } else { + symset[PRIMARY].name = dupstr(fullname); if (!read_sym_file(PRIMARY)) { badflag = TRUE; clear_symsetentry(PRIMARY, TRUE); @@ -3224,13 +3223,12 @@ boolean tinitial, tfrom_file; complain_about_duplicate(opts, 1); if (!negated) { for (i = 0; i < NUM_GRAPHICS; ++i) { - if (symset[i].name) + if (symset[i].name) { badflag = TRUE; - else { + } else { if (i == ROGUESET) sym_name = "RogueIBM"; - symset[i].name = (char *) alloc(strlen(sym_name) + 1); - Strcpy(symset[i].name, sym_name); + symset[i].name = dupstr(sym_name); if (!read_sym_file(i)) { badflag = TRUE; clear_symsetentry(i, TRUE); @@ -3258,11 +3256,10 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); if (!negated) { - if (symset[PRIMARY].name) + if (symset[PRIMARY].name) { badflag = TRUE; - else { - symset[PRIMARY].name = (char *) alloc(strlen(fullname) + 1); - Strcpy(symset[PRIMARY].name, fullname); + } else { + symset[PRIMARY].name = dupstr(fullname); if (!read_sym_file(PRIMARY)) { badflag = TRUE; clear_symsetentry(PRIMARY, TRUE); @@ -3355,9 +3352,8 @@ boolean tinitial, tfrom_file; || (boolopt[i].addr) == &flags.showrace || (boolopt[i].addr) == &iflags.hilite_pet) { need_redraw = TRUE; - } #ifdef TEXTCOLOR - else if ((boolopt[i].addr) == &iflags.use_color) { + } else if ((boolopt[i].addr) == &iflags.use_color) { need_redraw = TRUE; #ifdef TOS if ((boolopt[i].addr) == &iflags.use_color && iflags.BIOS) { @@ -3367,9 +3363,8 @@ boolean tinitial, tfrom_file; set_colors(); } #endif +#endif /* TEXTCOLOR */ } -#endif - return; } } @@ -3417,9 +3412,9 @@ void add_menu_cmd_alias(from_ch, to_ch) char from_ch, to_ch; { - if (n_menu_mapped >= MAX_MENU_MAPPED_CMDS) + if (n_menu_mapped >= MAX_MENU_MAPPED_CMDS) { pline("out of menu map space."); - else { + } else { mapped_menu_cmds[n_menu_mapped] = from_ch; mapped_menu_op[n_menu_mapped] = to_ch; n_menu_mapped++; @@ -3604,19 +3599,20 @@ doset() } any.a_int = -4; Sprintf(buf2, n_currently_set, msgtype_count()); - Sprintf(buf, fmtstr_doset_add_menu, any.a_int ? "" : " ", "message types", - buf2); + Sprintf(buf, fmtstr_doset_add_menu, any.a_int ? "" : " ", + "message types", buf2); add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED); any.a_int = -3; Sprintf(buf2, n_currently_set, count_menucolors()); - Sprintf(buf, fmtstr_doset_add_menu, any.a_int ? "" : " ", "menucolors", - buf2); + Sprintf(buf, fmtstr_doset_add_menu, any.a_int ? "" : " ", + "menucolors", buf2); add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED); #ifdef STATUS_VIA_WINDOWPORT #ifdef STATUS_HILITES any.a_int = -2; get_status_hilites(buf2, 60); - if (!*buf2) Sprintf(buf2, "%s", "(none)"); + if (!*buf2) + Sprintf(buf2, "%s", "(none)"); if (!iflags.menu_tab_sep) Sprintf(buf, fmtstr_doset_add_menu, any.a_int ? "" : " ", "status_hilites", buf2); @@ -3966,6 +3962,7 @@ boolean setinitial, setfromfile; } else if (!strcmp("sortloot", optname)) { const char *sortl_name; menu_item *sortl_pick = (menu_item *) 0; + tmpwin = create_nhwindow(NHW_MENU); start_menu(tmpwin); any = zeroany; @@ -4258,13 +4255,12 @@ boolean setinitial, setfromfile; || !strcmp("roguesymset", optname)) { menu_item *symset_pick = (menu_item *) 0; boolean primaryflag = (*optname == 's'), - rogueflag = (*optname == 'r'), ready_to_switch = FALSE, + rogueflag = (*optname == 'r'), + ready_to_switch = FALSE, nothing_to_do = FALSE; - int res; char *symset_name, fmtstr[20]; struct symsetentry *sl; - int setcount = 0; - int chosen = -2, which_set; + int res, which_set, setcount = 0, chosen = -2; if (rogueflag) which_set = ROGUESET; @@ -4359,14 +4355,13 @@ boolean setinitial, setfromfile; } sl = sl->next; } - } - - else if (chosen == -1) { + } else if (chosen == -1) { /* explicit selection of defaults */ /* free the now stale symset attributes */ - if (symset_name) + if (symset_name) { free((genericptr_t) symset_name); - symset_name = (char *) 0; + symset_name = (char *) 0; + } clear_symsetentry(which_set, TRUE); } else nothing_to_do = TRUE; @@ -4399,7 +4394,7 @@ boolean setinitial, setfromfile; return TRUE; if (!symset[which_set].name && symset_name) - symset[which_set].name = symset_name; + symset[which_set].name = symset_name; /* not dupstr() here */ /* Set default symbols and clear the handling value */ if (rogueflag) @@ -4408,9 +4403,9 @@ boolean setinitial, setfromfile; init_l_symbols(); if (symset[which_set].name) { - if (read_sym_file(which_set)) + if (read_sym_file(which_set)) { ready_to_switch = TRUE; - else { + } else { clear_symsetentry(which_set, TRUE); return TRUE; } @@ -4586,9 +4581,9 @@ char *buf; Sprintf(buf, "%s", to_be_done); else if (!strcmp(optname, "menu_invert_all")) Sprintf(buf, "%s", to_be_done); - else if (!strcmp(optname, "menu_headings")) { + else if (!strcmp(optname, "menu_headings")) Sprintf(buf, "%s", attr2attrname(iflags.menu_headings)); - } else if (!strcmp(optname, "menu_invert_page")) + else if (!strcmp(optname, "menu_invert_page")) Sprintf(buf, "%s", to_be_done); else if (!strcmp(optname, "menu_last_page")) Sprintf(buf, "%s", to_be_done); @@ -4602,12 +4597,12 @@ char *buf; Sprintf(buf, "%s", to_be_done); else if (!strcmp(optname, "menu_select_page")) Sprintf(buf, "%s", to_be_done); - else if (!strcmp(optname, "monsters")) + else if (!strcmp(optname, "monsters")) { Sprintf(buf, "%s", to_be_done); - else if (!strcmp(optname, "msghistory")) + } else if (!strcmp(optname, "msghistory")) { Sprintf(buf, "%u", iflags.msg_history); #ifdef TTY_GRAPHICS - else if (!strcmp(optname, "msg_window")) + } else if (!strcmp(optname, "msg_window")) { Sprintf(buf, "%s", (iflags.prevmsg_window == 's') ? "single" : (iflags.prevmsg_window == 'c') @@ -4616,9 +4611,9 @@ char *buf; ? "full" : "reversed"); #endif - else if (!strcmp(optname, "name")) + } else if (!strcmp(optname, "name")) { Sprintf(buf, "%s", plname); - else if (!strcmp(optname, "number_pad")) { + } else if (!strcmp(optname, "number_pad")) { static const char *numpadmodes[] = { "0=off", "1=on", "2=on, MSDOS compatible", "3=on, phone-style layout", @@ -4699,14 +4694,11 @@ char *buf; else Strcpy(buf, defopt); } else if (!strcmp(optname, "sortloot")) { - char *sortname = (char *) NULL; - - for (i = 0; i < SIZE(sortltype) && sortname == (char *) NULL; i++) { - if (flags.sortloot == sortltype[i][0]) - sortname = (char *) sortltype[i]; - } - if (sortname != (char *) NULL) - Sprintf(buf, "%s", sortname); + for (i = 0; i < SIZE(sortltype); i++) + if (flags.sortloot == sortltype[i][0]) { + Strcpy(buf, sortltype[i]); + break; + } } else if (!strcmp(optname, "player_selection")) { Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog"); #ifdef MSDOS @@ -4831,15 +4823,15 @@ const char *mapping; apehead = (grab) ? &iflags.autopickup_exceptions[AP_GRAB] : &iflags.autopickup_exceptions[AP_LEAVE]; ape = (struct autopickup_exception *) alloc( - sizeof(struct autopickup_exception)); + sizeof (struct autopickup_exception)); ape->regex = regex_init(); if (!regex_compile(text2, ape->regex)) { raw_print("regex error in AUTOPICKUP_EXCEPTION"); regex_free(ape->regex); - free(ape); + free((genericptr_t) ape); return 0; } - ape->pattern = (char *)alloc(strlen(text2) + 1); + ape->pattern = (char *) alloc(strlen(text2) + 1); strcpy(ape->pattern, text2); ape->grab = grab; ape->next = *apehead; @@ -4861,14 +4853,15 @@ struct autopickup_exception *whichape; for (ape = iflags.autopickup_exceptions[chain]; ape;) { if (ape == whichape) { struct autopickup_exception *freeape = ape; + ape = ape->next; if (prev) prev->next = ape; else iflags.autopickup_exceptions[chain] = ape; regex_free(freeape->regex); - free(freeape->pattern); - free(freeape); + free((genericptr_t) freeape->pattern); + free((genericptr_t) freeape); } else { prev = ape; ape = ape->next; @@ -4907,9 +4900,9 @@ free_autopickup_exceptions() for (pass = AP_LEAVE; pass <= AP_GRAB; ++pass) { while ((ape = iflags.autopickup_exceptions[pass]) != 0) { regex_free(ape->regex); - free(ape->pattern); + free((genericptr_t) ape->pattern); iflags.autopickup_exceptions[pass] = ape->next; - free(ape); + free((genericptr_t) ape); } } } @@ -4922,11 +4915,13 @@ int which_set; { clear_symsetentry(which_set, TRUE); - symset[which_set].name = (char *) alloc(strlen(s) + 1); - Strcpy(symset[which_set].name, s); - if (read_sym_file(which_set)) + if (symset[which_set].name) + free((genericptr_t) symset[which_set].name); + symset[which_set].name = dupstr(s); + + if (read_sym_file(which_set)) { switch_symbols(TRUE); - else { + } else { clear_symsetentry(which_set, TRUE); return 0; } @@ -5115,7 +5110,7 @@ const char *str; Strcat(buf, ", "); } else { putstr(datawin, 0, str); - free(buf), buf = 0; + free((genericptr_t) buf), buf = 0; } return; } @@ -5561,9 +5556,8 @@ char *fontname; } if (fn) { if (*fn) - free(*fn); - *fn = (char *) alloc(strlen(fontname) + 1); - Strcpy(*fn, fontname); + free((genericptr_t) *fn); + *fn = dupstr(fontname); } return; } @@ -5649,15 +5643,13 @@ char *op; if (!strcmpi(wn, wnames[j]) || !strcmpi(wn, shortnames[j])) { if (tfg && !strstri(tfg, " ")) { if (*fgp[j]) - free(*fgp[j]); - *fgp[j] = (char *) alloc(strlen(tfg) + 1); - Strcpy(*fgp[j], tfg); + free((genericptr_t) *fgp[j]); + *fgp[j] = dupstr(tfg); } if (tbg && !strstri(tbg, " ")) { if (*bgp[j]) - free(*bgp[j]); - *bgp[j] = (char *) alloc(strlen(tbg) + 1); - Strcpy(*bgp[j], tbg); + free((genericptr_t) *bgp[j]); + *bgp[j] = dupstr(tbg); } break; } From aa729ca9564983cc013001eaf8907ee865adacb2 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 10 Nov 2015 01:49:21 -0800 Subject: [PATCH 09/51] README and dat/history update README - add VMS back as a tested platform; thanks KevinS! dat/history - add VMS update, remove trailing whitespace, two spaces; instead of just one (recently added stuff) for sentence separation; sys/vms/Install.vms - minimal update; Files - reformat the win32 project section to fit within 80 columns. --- Files | 7 +-- README | 8 +-- dat/history | 116 +++++++++++++++++++++++--------------------- sys/vms/Install.vms | 31 ++++++------ 4 files changed, 84 insertions(+), 78 deletions(-) diff --git a/Files b/Files index 5235fa5c0..345e0aced 100644 --- a/Files +++ b/Files @@ -272,9 +272,10 @@ mnsel.uu mnselcnt.uu mnunsel.uu mswproc.c petmark.uu pilemark.uu resource.h rip.uu splash.uu tiles.mak winMS.h winhack.c winhack.rc (files for Visual Studio 2010 Express Edition builds) -dgncomp.vcxproj dgnstuff.vcxproj dgnstuff.mak dlb_main.vcxproj levcomp.vcxproj -levstuff.vcxproj levstuff.mak makedefs.vcxproj NetHack.sln uudecode.vcxproj -NetHackW.vcxproj tile2bmp.vcxproj recover.vcxproj tilemap.vcxproj tiles.vcxproj +dgncomp.vcxproj dgnstuff.vcxproj dgnstuff.mak dlb_main.vcxproj +levcomp.vcxproj levstuff.vcxproj levstuff.mak makedefs.vcxproj +NetHack.sln uudecode.vcxproj NetHackW.vcxproj tile2bmp.vcxproj +recover.vcxproj tilemap.vcxproj tiles.vcxproj This is a list of files produced by auxiliary programs. They can all be regenerated from the files in the distribution. diff --git a/README b/README index daa68c33e..eecf978db 100644 --- a/README +++ b/README @@ -57,12 +57,14 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. for particular windowing environments. Reading them, and the man pages, should answer most of your questions. - At the time of this release, NetHack 3.6 has been tested to run/compile on: + At the time of this release, NetHack 3.6 has been tested to run/compile + on: Intel Pentium or better (or clone) running Linux, BSDI, or Windows (XP through 8.1) Intel 80386 or greater (or clone) boxes running Linux, or BSDI Mac OS X 10.9 + OpenVMS (aka VMS) V8.4 on Alpha and on Integrity/Itanium/IA64 Previous versions of NetHack were tested and known to run on the following systems, but it is unknown if they can still build and @@ -107,8 +109,8 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Sun SPARC based machine running SunOS 4.x, Solaris 2.x, or Solaris 7 Valid Logic Systems SCALD-System - Previous versions, using a cross-compiler hosted on another platform, such as - win32, could also build the following from source: + Previous versions, using a cross-compiler hosted on another platform, + such as win32, could also build the following from source: Pocket PC devices running Windows CE 3.0 and higher H/PC Pro devices running Windows CE 2.11 and higher Palm Size PC 1.1 devices running Windows CE 2.11 diff --git a/dat/history b/dat/history index 48a2c2b45..6095a1ef2 100644 --- a/dat/history +++ b/dat/history @@ -11,7 +11,8 @@ UNIX(tm) machines to the Usenet. Don G. Kneller ported Hack 1.0.3 to Microsoft(tm) C and MS-DOS(tm), producing PC HACK 1.01e, added support for DEC Rainbow graphics in version 1.03g, and -went on to produce at least four more versions (3.0, 3.2, 3.51, and 3.6). +went on to produce at least four more versions (3.0, 3.2, 3.51, and 3.6; +note that these are old Hack version numbers, not contemporary NetHack ones). R. Black ported PC HACK 3.51 to Lattice(tm) C and the Atari 520/1040ST, producing ST Hack 1.03. @@ -20,7 +21,7 @@ Mike Stephenson merged these various versions back together, incorporating many of the added features, and produced NetHack version 1.4 in 1987. He then coordinated a cast of thousands in enhancing and debugging NetHack 1.4 and released NetHack versions 2.2 and 2.3. - + Later, Mike coordinated a major rewrite of the game, heading a team which included Ken Arromdee, Jean-Christophe Collet, Steve Creps, Eric Hendrickson, Izchak Miller, Eric S. Raymond, John Rupley, Mike Threepoint, and Janet Walz, @@ -37,7 +38,7 @@ Spackman and Pierre Martineau designed overlay code for PC NetHack 3.0. Johnny Lee ported NetHack 3.0 to the Macintosh. Along with various other Dungeoneers, they continued to enhance the PC, Macintosh, and Amiga ports through the later revisions of 3.0. - + Headed by Mike Stephenson and coordinated by Izchak Miller and Janet Walz, the development team which now included Ken Arromdee, David Cohrs, Jean-Christophe Collet, Kevin Darcy, Matt Day, Timo Hakulinen, Steve Linhart, @@ -56,7 +57,7 @@ Spackman, Steve VanDevender, and Paul Winner, ported NetHack 3.1 to the PC. Jon W{tte and Hao-yang Wang, with help from Ross Brown, Mike Engber, David Hairston, Michael Hamel, Jonathan Handler, Johnny Lee, Tim Lennan, Rob Menke, and Andy Swanson developed NetHack 3.1 for the Macintosh, porting it for -MPW. Building on their development, Barton House added a Think C port. +MPW. Building on their development, Barton House added a Think C port. Timo Hakulinen ported NetHack 3.1 to OS/2. Eric Smith ported NetHack 3.1 to the Atari. Pat Rankin, with help from Joshua Delahunty, is responsible @@ -103,17 +104,17 @@ DevTeam and incorporated the best of these ideas in NetHack 3.3. The final update to 3.2 was the bug fix release 3.2.3, which was released simultaneously with 3.3.0 in December 1999 just in time for the Year 2000. -The 3.3 development team, consisting of Michael Allison, Ken Arromdee, -David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, Timo Hakulinen, -Kevin Hugo, Steve Linhart, Ken Lorber, Dean Luick, Pat Rankin, Eric Smith, -Mike Stephenson, Janet Walz, and Paul Winner, released 3.3.0 in +The 3.3 development team, consisting of Michael Allison, Ken Arromdee, +David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, Timo Hakulinen, +Kevin Hugo, Steve Linhart, Ken Lorber, Dean Luick, Pat Rankin, Eric Smith, +Mike Stephenson, Janet Walz, and Paul Winner, released 3.3.0 in December 1999 and 3.3.1 in August of 2000. -Version 3.3 offered many firsts. It was the first version to separate race -and profession. The Elf class was removed in preference to an elf race, -and the races of dwarves, gnomes, and orcs made their first appearance in -the game alongside the familiar human race. Monk and Ranger roles joined -Archeologists, Barbarians, Cavemen, Healers, Knights, Priests, Rogues, +Version 3.3 offered many firsts. It was the first version to separate race +and profession. The Elf class was removed in preference to an elf race, +and the races of dwarves, gnomes, and orcs made their first appearance in +the game alongside the familiar human race. Monk and Ranger roles joined +Archeologists, Barbarians, Cavemen, Healers, Knights, Priests, Rogues, Samurai, Tourists, Valkyries and of course, Wizards. It was also the first version to allow you to ride a steed, and was the first version to have a publicly available web-site listing all the bugs that had been discovered. @@ -130,61 +131,61 @@ well as supporting ports on the different platforms that NetHack runs on: Pat Rankin maintained 3.4 for VMS. -Michael Allison maintained NetHack 3.4 for the MS-DOS platform. +Michael Allison maintained NetHack 3.4 for the MS-DOS platform. Paul Winner and Yitzhak Sapir provided encouragement. Dean Luick, Mark Modrall, and Kevin Hugo maintained and enhanced the Macintosh port of 3.4. -Michael Allison, David Cohrs, Alex Kompel, Dion Nicolaas, and Yitzhak Sapir -maintained and enhanced 3.4 for the Microsoft Windows platform. Alex Kompel -contributed a new graphical interface for the Windows port. Alex Kompel also +Michael Allison, David Cohrs, Alex Kompel, Dion Nicolaas, and Yitzhak Sapir +maintained and enhanced 3.4 for the Microsoft Windows platform. Alex Kompel +contributed a new graphical interface for the Windows port. Alex Kompel also contributed a Windows CE port for 3.4.1. Ron Van Iwaarden maintained 3.4 for OS/2. -Janne Salmijarvi and Teemu Suikki maintained and enhanced the +Janne Salmijarvi and Teemu Suikki maintained and enhanced the Amiga port of 3.5 after Janne Salmijarvi resurrected it for 3.3.1. Christian `Marvin' Bressler maintained 3.5 for the Atari after he resurrected it for 3.3.1. -The release of NetHack 3.4.3 in December 2003 marked the beginning of a -long release hiatus. 3.4.3 proved to be a remarkably stable version that -provided continued enjoyment by the community for more than a decade. The -devteam slowly and quietly continued to work on the game behind the scenes -during the tenure of 3.4.3. It was during that same period that several new -variants emerged within the NetHack community. Notably sporkhack by -Derek S. Ray, unnethack by Patric Mueller, nitrohack and its successors -originally by Daniel Thaler and then by Alex Smith, and -Dynahack by Tung Nguyen. Some of those variants continue to be developed, +The release of NetHack 3.4.3 in December 2003 marked the beginning of a +long release hiatus. 3.4.3 proved to be a remarkably stable version that +provided continued enjoyment by the community for more than a decade. The +devteam slowly and quietly continued to work on the game behind the scenes +during the tenure of 3.4.3. It was during that same period that several +new variants emerged within the NetHack community. Notably sporkhack by +Derek S. Ray, unnethack by Patric Mueller, nitrohack and its successors +originally by Daniel Thaler and then by Alex Smith, and +Dynahack by Tung Nguyen. Some of those variants continue to be developed, maintained, and enjoyed by the community to this day. -In September 2014, an interim snapshot of the code under development was -released publicly by other parties. Since that code was a work-in-progress -and had not gone through a period of debugging, it was decided that the -version numbers present on that code snapshot would be retired and never -used in an official NetHack release. An announcement was posted on the -devteam's official nethack.org website to that effect, stating that there +In September 2014, an interim snapshot of the code under development was +released publicly by other parties. Since that code was a work-in-progress +and had not gone through a period of debugging, it was decided that the +version numbers present on that code snapshot would be retired and never +used in an official NetHack release. An announcement was posted on the +devteam's official nethack.org website to that effect, stating that there would never be a 3.4.4, 3.5, or 3.5.0 official release version. -In January 2015, preparation began for the release of NetHack 3.6. +In January 2015, preparation began for the release of NetHack 3.6. At the beginning of development for what would eventually get released -as 3.6.0, the development team consisted of Michael Allison, -Warwick Allison, Ken Arromdee, David Cohrs, Jessie Collet, Ken Lorber, +as 3.6.0, the development team consisted of Michael Allison, +Warwick Allison, Ken Arromdee, David Cohrs, Jessie Collet, Ken Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet Walz, and Paul Winner. -Leading up to the release of 3.6.0 in early 2015, new members Sean Hunt, +Leading up to the release of 3.6.0 in early 2015, new members Sean Hunt, Pasi Kallinen, and Derek S. Ray joined the NetHack development team. -In January 2015, preparation began for the release of NetHack 3.6. The 3.6 -version merges work done by the development team since the previous release with -some of the beloved community patches. Many bugs were fixed and some code was -restructured. +In January 2015, preparation began for the release of NetHack 3.6. The 3.6 +version merges work done by the development team since the previous release +with some of the beloved community patches. Many bugs were fixed and some +code was restructured. The development team, as well as Steve VanDevender and Kevin Smolkowski ensured that NetHack 3.6.0 continued to operate on various Unix flavors -as well as maintaining the X11 interface. +as well as maintaining the X11 interface. Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick maintained the port of NetHack 3.6.0 for Mac. @@ -192,28 +193,33 @@ of NetHack 3.6.0 for Mac. Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, Dion Nicolaas, and David Cohrs maintained the port of NetHack 3.6.0 for Microsoft Windows. -This version of the game is special in a particular way. Near the end of -the development of 3.6, one of the significant inspirations for many of the -humorous and fun features found in the game, author Terry Pratchett, +Pat Rankin attempted to keep the VMS port running for NetHack 3.6.0, +hindered by limited access. Kevin Smolkowski has updated and tested it +for the most recent version of OpenVMS (V8.4 as of this writing) on Alpha +and Integrity (aka Itanium aka IA64) but not VAX. + +This version of the game is special in a particular way. Near the end of +the development of 3.6, one of the significant inspirations for many of +the humorous and fun features found in the game, author Terry Pratchett, passed away. This version of the game includes a tribute to him. -An official NetHack web site continues to be maintained by Ken Lorber at +An official NetHack web site continues to be maintained by Ken Lorber at http://www.nethack.org/. -- SHOUT-OUTS -The devteam would like to give a special "shout-out" to thank the generous -people primarily responsible for the public NetHack servers available for -playing the game at nethack.alt.org and devnull.net. In addition to providing -a way for the public to play a game of NetHack from almost anywhere, they -have hosted annual NetHack tournaments for many, many years. +The devteam would like to give a special "shout-out" to thank the generous +people primarily responsible for the public NetHack servers available for +playing the game at nethack.alt.org and devnull.net. In addition to +providing a way for the public to play a game of NetHack from almost +anywhere, they have hosted annual NetHack tournaments for many, many years. -On behalf of the NetHack community, thank you very much to +On behalf of the NetHack community, thank you very much to M. Drew Streib, Pasi Kallinen and Robin Bandy. - - - - - - - - - - - + - - - - - - - - - - From time to time, some depraved individual out there in netland sends a particularly intriguing modification to help out with the game. The Gods of @@ -258,5 +264,5 @@ in this, the list of Dungeoneers: Hao-yang Wang Mike Engber Warren Cheung Helge Hafting Mike Gallop Warwick Allison Irina Rempt-Drijfhout Mike Passaretti Yitzhak Sapir - Izchak Miller Mike Stephenson - J. Ali Harlow Mikko Juola + Izchak Miller Mike Stephenson + J. Ali Harlow Mikko Juola diff --git a/sys/vms/Install.vms b/sys/vms/Install.vms index 6b45140e1..ccdfa3111 100644 --- a/sys/vms/Install.vms +++ b/sys/vms/Install.vms @@ -5,18 +5,10 @@ 0. Please read this entire file before trying to build or install NetHack, then read it again! -1. Building NetHack requires a C compiler (either Compaq C, DEC C, - VAX C, or GNU C) and VMS version V4.6 or later (but see note #9). - This release has been tested with Compaq C V6.4 on Alpha/VMS V7.3-1 - and with VAX C V3.2 and GNU C 2.7.1 on VAX/VMS V5.5-2. The build - procedure (vmsbuild.com) should not need to be modified; it accepts - an option for selecting the compiler, and it can detect different - versions which might require specific command qualifiers. Versions - of VAXC earlier than V2.3 will produce many warning messages (about - 200 per source file; over to 25,000 total!), but NetHack has been - verified to compile, link, and execute correctly when built with VAXC - V2.2 using vmsbuild.com. There is also a set of Makefiles suitable for - use with MMS or MMK; they may or may not work with other make utilities. +1. Build testing was done using a recent version of HP C (aka Compaq C + aka--and more widely known as--DEC C). Older versions of DEC C will + probably work too. Ancient VAX C probably will not. The set of + Makefiles are known to be out of date; use vmsbuild.com instead. 2. Make sure all the NetHack files are in the appropriate directory structure. You should set up a directory--referred to as "top" below @@ -43,6 +35,7 @@ [.sys .os2] -- OS/2 [.sys .share .sounds] -- AIFF format audio files [.sys .unix] -- guess :-) + [.sys .unit .hints] -- configuration data for setup.sh [.sys .wince] -- Windows CE [.sys .wince .ceinc] -- more WinCE [.sys .wince .ceinc .sys] -- ditto @@ -136,10 +129,11 @@ Notes: -1. Save files and bones files from 3.4.x and earlier versions - will not work with 3.5.0. The scoreboard file (RECORD) from - 3.4.x or 3.3.x will work; one from version 3.2.x is a slightly different - format but should be compatible. +0. Versions 3.5.0 was never publicly released. + +1. Save files and bones files from 3.4.x and earlier versions + will not work with 3.6.0. The scoreboard file (RECORD) from + 3.4.x or 3.3.x will work. 2. To specify user-preference options in your environment, define the logical name NETHACKOPTIONS to have the value of a quoted string @@ -174,7 +168,9 @@ Notes: placed in the playground directory by install.com. Also, an example configuration file can be found in [.win.X11]nethack.rc.) -3. Instead of using vmsbuild.com to compile and link everything, you can +3. [As mentioned above, the set of Makefiles is out of date so disregard + this note....] + Instead of using vmsbuild.com to compile and link everything, you can use the set of Makefiles found in the vms subdirectory, provided you have an appropriate and compatible make utility. They've been tested using MMK, a freeware clone of Digital's MMS. There are five of them, @@ -477,3 +473,4 @@ Notes: and the C compiler used. 20-OCT-2003 +minimally updated 9-NOV-2015... From 98de6630834846c8b68d1aa685754f7bf554ac9f Mon Sep 17 00:00:00 2001 From: keni Date: Tue, 10 Nov 2015 09:44:21 -0500 Subject: [PATCH 10/51] Add the DEVEL tree to Files. --- Files | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Files b/Files index 345e0aced..ee9db8e1c 100644 --- a/Files +++ b/Files @@ -6,7 +6,7 @@ from or not transferred to your system if you wish. .: (files in top directory) -Files Porting README +DEVEL Files Porting README dat: (files for all versions) @@ -353,6 +353,21 @@ tiletxt.c (files generated for win32 at compile time) uudecode.exe +DEVEL: +(files for people developing changes to NetHack) +DOTGIT code_style.txt nhgitset.pl +Developer.txt git_recipes.txt +code_features.txt hooksdir + +DEVEL/hooksdir: +NHadd nhsub pre-auto-gc +NHgithook.pm post-applypatch pre-commit +NHsubst post-checkout pre-push +NHtext post-commit pre-rebase +TARGET post-merge prepare-commit-msg +applypatch-msg post-rewrite +commit-msg pre-applypatch + .: (files for win32 that are moved into . at compile time) nethack.dsw From b31033b7a0221ae27651f0568197cd698db160cd Mon Sep 17 00:00:00 2001 From: keni Date: Tue, 10 Nov 2015 13:27:32 -0500 Subject: [PATCH 11/51] add Windows info --- DEVEL/Developer.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DEVEL/Developer.txt b/DEVEL/Developer.txt index 956ed11de..b30fa06c9 100644 --- a/DEVEL/Developer.txt +++ b/DEVEL/Developer.txt @@ -4,7 +4,7 @@ |___/\___|\_/\___|_\___/ .__/\___|_| |_| -$NHDT-Date: 1429884664 2015/04/24 14:11:04 $ +$NHDT-Date: 1447180052 2015/11/10 18:27:32 $ Welcome to the NetHack Infrastructure Developer's Guide. @@ -58,7 +58,8 @@ A. If you have never set up git on this machine before: You probably want to set up a credential cache. Mac OS X: git config --global credential.helper osxkeychain -XXX windows + Windows: + git config --global credential.helper store XXX linux B. Specify the prefix for variable substitution: (This assumes you are not a member of DevTeam or any variant's development From cbeb562d2035576829b89aa0bfd9df58d1273890 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 11 Nov 2015 01:28:04 -0800 Subject: [PATCH 12/51] doset() -> special_handling() -> free(NULL) This isn't urgent, but I figure that until the mac build stuff gets merged in, the core is still fair game.... 'O' command's autopickup_exceptions was freeing a menu pick-list even when it hadn't been allocated (for the list case, and for the remove case if nothing was chosen for removal). That code was evidently used as the model for msgtype and menucolors; they had the same situation. I think ANSI and ISO sanction free(NULL) as a no-op, but pre-ANSI free implementations don't necessarily handle that benignly. Even if they all do, freeing something--even if that 'something' is nothing--which hasn't been allocated is a bug on our end. --- src/options.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/options.c b/src/options.c index d9c6a3ea9..7772dcf51 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 options.c $NHDT-Date: 1447125615 2015/11/10 03:20:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.239 $ */ +/* NetHack 3.6 options.c $NHDT-Date: 1447234076 2015/11/11 09:27:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.240 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3820,8 +3820,7 @@ boolean setinitial, setfromfile; could have toggled off preselected ones to end up with 0 */ flags.paranoia_bits = 0; if (i > 0) { - /* at least one item set, either preselected or newly picked - */ + /* at least 1 item set, either preselected or newly picked */ while (--i >= 0) flags.paranoia_bits |= paranoia_picks[i].item.a_int; free((genericptr_t) paranoia_picks); @@ -3831,6 +3830,7 @@ boolean setinitial, setfromfile; } else if (!strcmp("pickup_burden", optname)) { const char *burden_name, *burden_letters = "ubsntl"; menu_item *burden_pick = (menu_item *) 0; + tmpwin = create_nhwindow(NHW_MENU); start_menu(tmpwin); any = zeroany; @@ -3918,6 +3918,7 @@ boolean setinitial, setfromfile; } else if (!strcmp("runmode", optname)) { const char *mode_name; menu_item *mode_pick = (menu_item *) 0; + tmpwin = create_nhwindow(NHW_MENU); start_menu(tmpwin); any = zeroany; @@ -3937,6 +3938,7 @@ boolean setinitial, setfromfile; #ifdef TTY_GRAPHICS /* by Christian W. Cooper */ menu_item *window_pick = (menu_item *) 0; + tmpwin = create_nhwindow(NHW_MENU); start_menu(tmpwin); any = zeroany; @@ -4116,9 +4118,8 @@ boolean setinitial, setfromfile; for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) free_one_msgtype(pick_list[pick_idx].item.a_int - 1 - pick_idx); + free((genericptr_t) pick_list), pick_list = (menu_item *) 0; } - free((genericptr_t) pick_list); - pick_list = (menu_item *) 0; destroy_nhwindow(tmpwin); if (pick_cnt >= 0) goto msgtypes_again; @@ -4172,15 +4173,15 @@ boolean setinitial, setfromfile; Sprintf(mcbuf, "%s menu colors", (opt_idx == 1) ? "List of" : "Remove which"); end_menu(tmpwin, mcbuf); - pick_cnt = select_menu( - tmpwin, (opt_idx == 1) ? PICK_NONE : PICK_ANY, &pick_list); + pick_cnt = select_menu(tmpwin, + (opt_idx == 1) ? PICK_NONE : PICK_ANY, + &pick_list); if (pick_cnt > 0) { for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) free_one_menu_coloring(pick_list[pick_idx].item.a_int - 1 - pick_idx); + free((genericptr_t) pick_list), pick_list = (menu_item *) 0; } - free((genericptr_t) pick_list); - pick_list = (menu_item *) 0; destroy_nhwindow(tmpwin); if (pick_cnt >= 0) goto menucolors_again; @@ -4237,16 +4238,16 @@ boolean setinitial, setfromfile; Sprintf(apebuf, "%s autopickup exceptions", (opt_idx == 1) ? "List of" : "Remove which"); end_menu(tmpwin, apebuf); - pick_cnt = select_menu( - tmpwin, (opt_idx == 1) ? PICK_NONE : PICK_ANY, &pick_list); + pick_cnt = select_menu(tmpwin, + (opt_idx == 1) ? PICK_NONE : PICK_ANY, + &pick_list); if (pick_cnt > 0) { for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) remove_autopickup_exception( - (struct autopickup_exception *) pick_list[pick_idx] - .item.a_void); + (struct autopickup_exception *) + pick_list[pick_idx].item.a_void); + free((genericptr_t) pick_list), pick_list = (menu_item *) 0; } - free((genericptr_t) pick_list); - pick_list = (menu_item *) 0; destroy_nhwindow(tmpwin); if (pick_cnt >= 0) goto ape_again; From f97c3dec0a6df743165868ad53c1adaa878749b1 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 11 Nov 2015 01:43:03 -0800 Subject: [PATCH 13/51] tty memory management at program termination Release some dynamically allocated memory prior to exit. These were previously left alone due to assumed complexity (at least by me...), but dealing with them turned out to be straightforward. |#if FREE_ALL_MEMORY free BASE_WINDOW -- tty-specific; other windows are drawn on top of it free ttyDisplay -- tty's basic data structure |#endif free nh_HI, nh_HE -- termcap values handled differently from the rest These are the last things that 'heaputil' always reported as not freed for the basic Unix+tty configuration. (I've observed other things not being freed; those are post-3.4.3 bugs that need to be found and fixed.) --- win/tty/termcap.c | 79 ++++++++++++++++++++++++++--------------------- win/tty/wintty.c | 22 ++++++++++--- 2 files changed, 61 insertions(+), 40 deletions(-) diff --git a/win/tty/termcap.c b/win/tty/termcap.c index 8528ffecb..262c89a46 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 termcap.c $NHDT-Date: 1446856761 2015/11/07 00:39:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.22 $ */ +/* NetHack 3.6 termcap.c $NHDT-Date: 1447234979 2015/11/11 09:42:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.23 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -30,8 +30,7 @@ static void NDECL(init_hilite); static void NDECL(kill_hilite); #endif -/* (see tcap.h) -- nh_CM, nh_ND, nh_CD, nh_HI,nh_HE, nh_US,nh_UE, - ul_hack */ +/* (see tcap.h) -- nh_CM, nh_ND, nh_CD, nh_HI,nh_HE, nh_US,nh_UE, ul_hack */ struct tc_lcl_data tc_lcl_data = { 0, 0, 0, 0, 0, 0, 0, FALSE }; STATIC_VAR char *HO, *CL, *CE, *UP, *XD, *BC, *SO, *SE, *TI, *TE; @@ -44,6 +43,7 @@ STATIC_VAR char *MD; /* may already be in use below */ #endif #ifdef TERMLIB +boolean dynamic_HIHE = FALSE; #ifdef TEXTCOLOR STATIC_VAR char *MD; #endif @@ -152,9 +152,9 @@ int *wid, *hgt; nh_US = "\033[4m"; MR = "\033[7m"; TI = nh_HE = ME = SE = nh_UE = "\033[0m"; -/* strictly, SE should be 2, and nh_UE should be 24, - but we can't trust all ANSI emulators to be - that complete. -3. */ + /* strictly, SE should be 2, and nh_UE should be 24, + but we can't trust all ANSI emulators to be + that complete. -3. */ #ifndef MICRO AS = "\016"; AE = "\017"; @@ -221,11 +221,11 @@ int *wid, *hgt; #else HO = Tgetstr("ho"); #endif -/* - * LI and CO are set in ioctl.c via a TIOCGWINSZ if available. If - * the kernel has values for either we should use them rather than - * the values from TERMCAP ... - */ + /* + * LI and CO are set in ioctl.c via a TIOCGWINSZ if available. If + * the kernel has values for either we should use them rather than + * the values from TERMCAP ... + */ #ifndef MICRO if (!CO) CO = tgetnum("co"); @@ -233,18 +233,17 @@ int *wid, *hgt; LI = tgetnum("li"); #else #if defined(TOS) && defined(__GNUC__) - if (!strcmp(term, "builtin")) + if (!strcmp(term, "builtin")) { get_scr_size(); - else { + } else #endif + { CO = tgetnum("co"); LI = tgetnum("li"); if (!LI || !CO) /* if we don't override it */ get_scr_size(); -#if defined(TOS) && defined(__GNUC__) } -#endif -#endif +#endif /* ?MICRO */ #ifdef CLIPPING if (CO < COLNO || LI < ROWNO + 3) setclipped(); @@ -298,16 +297,14 @@ int *wid, *hgt; * pager as a string - so how can you send it NULs??? * -jsb */ - nh_HI = (char *) alloc((unsigned) (strlen(SO) + 1)); - nh_HE = (char *) alloc((unsigned) (strlen(ME) + 1)); - i = 0; - while (digit(SO[i])) - i++; - Strcpy(nh_HI, &SO[i]); - i = 0; - while (digit(ME[i])) - i++; - Strcpy(nh_HE, &ME[i]); + for (i = 0; digit(SO[i]); ++i) + continue; + nh_HI = dupstr(&SO[i]); + for (i = 0; digit(ME[i]); ++i) + continue; + nh_HE = dupstr(&ME[i]); + dynamic_HIHE = TRUE; + AS = Tgetstr("as"); AE = Tgetstr("ae"); nh_CD = Tgetstr("cd"); @@ -340,10 +337,17 @@ int *wid, *hgt; void tty_shutdown() { -#if defined(TEXTCOLOR) && defined(TERMLIB) + /* we only attempt to clean up a few individual termcap variables */ +#ifdef TERMLIB +#ifdef TEXTCOLOR kill_hilite(); #endif - /* we don't attempt to clean up individual termcap variables [yet?] */ + if (dynamic_HIHE) { + free((genericptr_t) nh_HI), nh_HI = (char *) 0; + free((genericptr_t) nh_HE), nh_HE = (char *) 0; + dynamic_HIHE = FALSE; + } +#endif return; } @@ -570,7 +574,8 @@ register int x, y; } /* See note above. xputc() is a special function. */ -void xputc(c) +void +xputc(c) #if defined(apollo) int c; #else @@ -758,7 +763,7 @@ tty_delay_output() #else /* MICRO */ /* BUG: if the padding character is visible, as it is on the 5620 then this looks terrible. */ - if (flags.null) + if (flags.null) { #ifdef TERMINFO /* cbosgd!cbcephus!pds for SYS V R2 */ #ifdef NHSTDC @@ -774,7 +779,7 @@ tty_delay_output() #endif #endif - else if (ospeed > 0 && ospeed < SIZE(tmspc10) && nh_CM) { + } else if (ospeed > 0 && ospeed < SIZE(tmspc10) && nh_CM) { /* delay by sending cm(here) an appropriate number of times */ register int cmlen = strlen(tgoto(nh_CM, ttyDisplay->curx, ttyDisplay->cury)); @@ -788,13 +793,15 @@ tty_delay_output() #endif /* MICRO */ } -void cl_eos() /* free after Robert Viduya */ -{ /* must only be called with curx = 1 */ - - if (nh_CD) +/* must only be called with curx = 1 */ +void +cl_eos() /* free after Robert Viduya */ +{ + if (nh_CD) { xputs(nh_CD); - else { + } else { register int cy = ttyDisplay->cury + 1; + while (cy <= LI - 2) { cl_end(); xputc('\n'); diff --git a/win/tty/wintty.c b/win/tty/wintty.c index a9bdadc47..e32b5609e 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintty.c $NHDT-Date: 1446856765 2015/11/07 00:39:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.110 $ */ +/* NetHack 3.6 wintty.c $NHDT-Date: 1447234979 2015/11/11 09:42:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.112 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1192,14 +1192,28 @@ const char *str; /* Just forget any windows existed, since we're about to exit anyway. * Disable windows to avoid calls to window routines. */ - for (i = 0; i < MAXWIN; i++) - if (wins[i] && (i != BASE_WINDOW)) { + for (i = 0; i < MAXWIN; i++) { + if (i == BASE_WINDOW) + continue; /* handle wins[BASE_WINDOW] last */ + if (wins[i]) { #ifdef FREE_ALL_MEMORY free_window_info(wins[i], TRUE); free((genericptr_t) wins[i]); #endif - wins[i] = 0; + wins[i] = (struct WinDesc *) 0; } + } +#ifdef FREE_ALL_MEMORY + if (BASE_WINDOW != WIN_ERR && wins[BASE_WINDOW]) { + free_window_info(wins[BASE_WINDOW], TRUE); + free((genericptr_t) wins[BASE_WINDOW]); + wins[BASE_WINDOW] = (struct WinDesc *) 0; + BASE_WINDOW = WIN_ERR; + } + free((genericptr_t) ttyDisplay); + ttyDisplay = (struct DisplayDesc *) 0; +#endif + #ifndef NO_TERMS /*(until this gets added to the window interface)*/ tty_shutdown(); /* cleanup termcap/terminfo/whatever */ #endif From c634164ac10f8f4352507445796e5b125912ee75 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 11 Nov 2015 09:19:06 -0500 Subject: [PATCH 14/51] Windows 10 Changes to be committed: modified: README Changes not staged for commit: modified: sys/winnt/Install.nt --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index eecf978db..f3f9b78bc 100644 --- a/README +++ b/README @@ -61,7 +61,7 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. on: Intel Pentium or better (or clone) running Linux, BSDI, or - Windows (XP through 8.1) + Windows (XP through 10) Intel 80386 or greater (or clone) boxes running Linux, or BSDI Mac OS X 10.9 OpenVMS (aka VMS) V8.4 on Alpha and on Integrity/Itanium/IA64 From 38080e921f1315358e0d5d206bb73a880c99da4e Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 11 Nov 2015 09:20:19 -0500 Subject: [PATCH 15/51] Windows 10 --- sys/winnt/Install.nt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/winnt/Install.nt b/sys/winnt/Install.nt index 5cc2585eb..1862590f1 100644 --- a/sys/winnt/Install.nt +++ b/sys/winnt/Install.nt @@ -3,7 +3,7 @@ ============================================================== Instructions for compiling and installing NetHack 3.6 on a Windows system - (Windows 7/8.x or later only. XP may work but is untested) + (Windows 7/8.x/10 or later only. XP may work but is untested) ============================================================== Last revision: $NHDT-Date: 1434806470 2015/06/20 13:21:10 $ From ecd277cec2e956d74a65a28d8a9107d0e4043b49 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 11 Nov 2015 09:57:05 -0500 Subject: [PATCH 16/51] unused parameter warning and an invalid index Changes to be committed: modified: win/tty/wintty.c --- win/tty/wintty.c | 59 ++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index e32b5609e..f27cee9fb 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintty.c $NHDT-Date: 1447234979 2015/11/11 09:42:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.112 $ */ +/* NetHack 3.6 wintty.c $NHDT-Date: 1447253778 2015/11/11 14:56:18 $ $NHDT-Branch: master $:$NHDT-Revision: 1.113 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -3022,7 +3022,8 @@ void tty_print_glyph(window, x, y, glyph, bkglyph) winid window; xchar x, y; -int glyph, bkglyph; +int glyph; +int bkglyph UNUSED; { int ch; boolean reverse_on = FALSE; @@ -3312,22 +3313,22 @@ genericptr_t ptr; long cond, *condptr = (long *) ptr; register int i; char *text = (char *) ptr; - /* Mapping BL attributes to tty attributes - * BL_HILITE_NONE -1 + 3 = 2 (statusattr[2]) - * BL_HILITE_INVERSE -2 + 3 = 1 (statusattr[1]) - * BL_HILITE_BOLD -3 + 3 = 0 (statusattr[0]) - */ + /* Mapping BL attributes to tty attributes + * BL_HILITE_NONE -1 + 3 = 2 (statusattr[2]) + * BL_HILITE_INVERSE -2 + 3 = 1 (statusattr[1]) + * BL_HILITE_BOLD -3 + 3 = 0 (statusattr[0]) + */ int statusattr[] = {ATR_BOLD, ATR_INVERSE, ATR_NONE}; int attridx = 0; long value = -1L; static boolean beenhere = FALSE; enum statusfields fieldorder[2][15] = { { BL_TITLE, BL_STR, BL_DX, BL_CO, BL_IN, BL_WI, BL_CH, BL_ALIGN, - BL_SCORE, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, - BL_FLUSH }, + BL_SCORE, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, + BL_FLUSH }, { BL_LEVELDESC, BL_GOLD, BL_HP, BL_HPMAX, BL_ENE, BL_ENEMAX, - BL_AC, BL_XP, BL_EXP, BL_HD, BL_TIME, BL_HUNGER, - BL_CAP, BL_CONDITION, BL_FLUSH } + BL_AC, BL_XP, BL_EXP, BL_HD, BL_TIME, BL_HUNGER, + BL_CAP, BL_CONDITION, BL_FLUSH } }; if (fldidx != BL_FLUSH) { @@ -3356,14 +3357,13 @@ genericptr_t ptr; default: value = atol(text); Sprintf(status_vals[fldidx], - status_fieldfmt[fldidx] ? status_fieldfmt[fldidx] : - "%s", text); + status_fieldfmt[fldidx] ? status_fieldfmt[fldidx] : + "%s", text); break; } - } #ifdef STATUS_HILITES - switch (tty_status_hilites[fldidx].behavior) { + switch (tty_status_hilites[fldidx].behavior) { case BL_TH_NONE: tty_status_colors[fldidx] = NO_COLOR; break; @@ -3378,23 +3378,23 @@ genericptr_t ptr; break; case BL_TH_VAL_PERCENTAGE: - { + { int pct_th = 0; if (tty_status_hilites[fldidx].thresholdtype != ANY_INT) { impossible( - "tty_status_update: unsupported percentage threshold type %d", - tty_status_hilites[fldidx].thresholdtype); + "tty_status_update: unsupported percentage threshold type %d", + tty_status_hilites[fldidx].thresholdtype); break; } pct_th = tty_status_hilites[fldidx].threshold.a_int; tty_status_colors[fldidx] = (percent >= pct_th) - ? tty_status_hilites[fldidx].over - : tty_status_hilites[fldidx].under; - } - break; + ? tty_status_hilites[fldidx].over + : tty_status_hilites[fldidx].under; + } + break; case BL_TH_VAL_ABSOLUTE: - { + { int c = NO_COLOR; int o = tty_status_hilites[fldidx].over; int u = tty_status_hilites[fldidx].under; @@ -3417,15 +3417,16 @@ genericptr_t ptr; break; default: impossible( - "tty_status_update: unsupported absolute threshold type %d\n", - tty_status_hilites[fldidx].thresholdtype); - break; + "tty_status_update: unsupported absolute threshold type %d\n", + tty_status_hilites[fldidx].thresholdtype); + break; } tty_status_colors[fldidx] = c; - } - break; - } + } + break; + } #endif /* STATUS_HILITES */ + } /* For now, this version copied from the genl_ version currently * updates everything on the display, everytime From fad2eab749cce970fa87fa46186218b2dfe1adc1 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 11 Nov 2015 21:47:51 +0200 Subject: [PATCH 17/51] Fix infinite looping when bound digging on solid map --- src/mkmaze.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mkmaze.c b/src/mkmaze.c index ce3066f81..f602cb45a 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -824,7 +824,7 @@ bound_digging() return; /* everything diggable here */ found = nonwall = FALSE; - for (xmin = 0; !found; xmin++) { + for (xmin = 0; !found && xmin <= COLNO; xmin++) { lev = &levl[xmin][0]; for (y = 0; y <= ROWNO - 1; y++, lev++) { typ = lev->typ; @@ -840,7 +840,7 @@ bound_digging() xmin = 0; found = nonwall = FALSE; - for (xmax = COLNO - 1; !found; xmax--) { + for (xmax = COLNO - 1; !found && xmax >= 0; xmax--) { lev = &levl[xmax][0]; for (y = 0; y <= ROWNO - 1; y++, lev++) { typ = lev->typ; @@ -856,7 +856,7 @@ bound_digging() xmax = COLNO - 1; found = nonwall = FALSE; - for (ymin = 0; !found; ymin++) { + for (ymin = 0; !found && ymin <= ROWNO; ymin++) { lev = &levl[xmin][ymin]; for (x = xmin; x <= xmax; x++, lev += ROWNO) { typ = lev->typ; @@ -870,7 +870,7 @@ bound_digging() ymin -= (nonwall || !level.flags.is_maze_lev) ? 2 : 1; found = nonwall = FALSE; - for (ymax = ROWNO - 1; !found; ymax--) { + for (ymax = ROWNO - 1; !found && ymax >= 0; ymax--) { lev = &levl[xmin][ymax]; for (x = xmin; x <= xmax; x++, lev += ROWNO) { typ = lev->typ; From 39a16676772f78f8cfa4f884fb22c64760a25d2b Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 12 Nov 2015 00:42:52 -0500 Subject: [PATCH 18/51] Repair recent tile mapping error when MAIL is undefined Changes to be committed: modified: src/objects.c modified: win/share/tilemap.c Warnings during tile builds (and incorrect tile mappings at run time when MAIL wasn't defined): Creating 16x16 binary tile files (this may take some time) warning: for tile 325 (numbered 325) of objects.txt, found 'ETAOIN SHRDLU' while expecting 'stamped / mail' warning: for tile 326 (numbered 326) of objects.txt, found 'LOREM IPSUM' while expecting 'ETAOIN SHRDLU' The recent addition of the first new extra scroll descriptions in a very long time caused this problem to show up when MAIL was undefined. There was a magic number in use that made an assumption that there were only 4 such extra scroll descriptions, those being "FOOBIE BLETCH", "TEMOV","GARVEN DEH","READ ME" --- src/objects.c | 3 ++- win/share/tilemap.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/objects.c b/src/objects.c index 62e62da50..fb8499b66 100644 --- a/src/objects.c +++ b/src/objects.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 objects.c $NHDT-Date: 1444617222 2015/10/12 02:33:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.46 $ */ +/* NetHack 3.6 objects.c $NHDT-Date: 1447306896 2015/11/12 05:41:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.48 $ */ /* Copyright (c) Mike Threepoint, 1989. */ /* NetHack may be freely redistributed. See license for details. */ @@ -847,6 +847,7 @@ SCROLL("punishment", "VE FORBRYDERNE", 1, 15, 300), SCROLL("charging", "HACKEM MUCHE", 1, 15, 300), SCROLL("stinking cloud", "VELOX NEB", 1, 15, 300), /* extra descriptions, shuffled into use at start of new game */ +/* Code in win/share/tilemap.c depends on SCR_STINKING_CLOUD preceding these */ SCROLL(None, "FOOBIE BLETCH", 1, 0, 100), SCROLL(None, "TEMOV", 1, 0, 100), SCROLL(None, "GARVEN DEH", 1, 0, 100), diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 0239d84fc..e41d618e6 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 tilemap.c $NHDT-Date: 1432512803 2015/05/25 00:13:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ +/* NetHack 3.6 tilemap.c $NHDT-Date: 1447306925 2015/11/12 05:42:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ */ /* NetHack may be freely redistributed. See license for details. */ /* @@ -28,6 +28,8 @@ extern void FDECL(exit, (int)); #define OBJ_GLYPH 2 #define OTH_GLYPH 3 /* fortunately unnecessary */ +#define EXTRA_SCROLL_DESCR_COUNT ((SCR_BLANK_PAPER - SCR_STINKING_CLOUD) - 1) + /* note that the ifdefs here should be the opposite sense from monst.c/ * objects.c/rm.h */ @@ -64,7 +66,7 @@ struct conditionals { * don't know what a slime mold should look like when renamed anyway */ #ifndef MAIL - { OBJ_GLYPH, SCR_STINKING_CLOUD + 4, "stamped / mail" }, + { OBJ_GLYPH, SCR_STINKING_CLOUD + EXTRA_SCROLL_DESCR_COUNT, "stamped / mail" }, #endif { 0, 0, 0 } }; From a14b1f99924dcfb26001142e25135d3ca09cbc1c Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 11 Nov 2015 22:56:57 -0800 Subject: [PATCH 19/51] fix PATCHLEVEL > Somebody has changed versioning so that the game incorrectly states > 3.6.1 in messages. It looks like someone updated patchlevel instead of > editlevel? Yes, that was me. I meant to increment EDITLEVEL and nobody noticed the mistake until now.... This changes PATCHLEVEL back to the correct value of 0, and implicitly resets EDITLEVEL to 0 for release (by not changing it to 1 as it was supposed to have been for the past 3-4 weeks). Data files from Oct. 18 through today are actually compatible but will be rejected once anyone rebuilds with this fix, same as would happen when EDITLEVEL changs. Data files from before Oct. 18 will be incompatible but be accepted by nethack but not work correctly due to a change in the 'context' structure. --- include/patchlevel.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/patchlevel.h b/include/patchlevel.h index ca276c52c..cbc717e54 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 patchlevel.h $NHDT-Date: 1445215015 2015/10/19 00:36:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.109 $ */ +/* NetHack 3.6 patchlevel.h $NHDT-Date: 1447311411 2015/11/12 06:56:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.110 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -8,7 +8,7 @@ /* * PATCHLEVEL is updated for each release. */ -#define PATCHLEVEL 1 +#define PATCHLEVEL 0 /* * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. From b9d5b35078d43941622fdb15fa690cf4d6f4a963 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 11 Nov 2015 23:30:59 -0800 Subject: [PATCH 20/51] src/objects.c formatting Fit the new comments within 80 (actually 78) columns. --- src/objects.c | 62 ++++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/src/objects.c b/src/objects.c index fb8499b66..3c686746c 100644 --- a/src/objects.c +++ b/src/objects.c @@ -1,5 +1,5 @@ -/* NetHack 3.6 objects.c $NHDT-Date: 1447306896 2015/11/12 05:41:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.48 $ */ -/* Copyright (c) Mike Threepoint, 1989. */ +/* NetHack 3.6 objects.c $NHDT-Date: 1447313395 2015/11/12 07:29:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.49 $ */ +/* Copyright (c) Mike Threepoint, 1989. */ /* NetHack may be freely redistributed. See license for details. */ /* @@ -846,34 +846,40 @@ SCROLL("earth", "KIRJE", 1, 18, 200), SCROLL("punishment", "VE FORBRYDERNE", 1, 15, 300), SCROLL("charging", "HACKEM MUCHE", 1, 15, 300), SCROLL("stinking cloud", "VELOX NEB", 1, 15, 300), -/* extra descriptions, shuffled into use at start of new game */ -/* Code in win/share/tilemap.c depends on SCR_STINKING_CLOUD preceding these */ -SCROLL(None, "FOOBIE BLETCH", 1, 0, 100), -SCROLL(None, "TEMOV", 1, 0, 100), -SCROLL(None, "GARVEN DEH", 1, 0, 100), -SCROLL(None, "READ ME", 1, 0, 100), -SCROLL(None, "ETAOIN SHRDLU", 1, 0, 100), -SCROLL(None, "LOREM IPSUM", 1, 0, 100), -SCROLL(None, "FNORD", 1, 0, 100), /* Illuminati */ -SCROLL(None, "KO BATE", 1, 0, 100), /* Kurd Lasswitz */ -SCROLL(None, "ABRA KA DABRA", 1, 0, 100), /* traditional incantation */ -SCROLL(None, "ASHPD SODALG", 1, 0, 100), /* Portal */ -SCROLL(None, "ZLORFIK", 1, 0, 100), /* Zak McKracken */ -SCROLL(None, "GNIK SISI VLE", 1, 0, 100), /* Zak McKracken */ -SCROLL(None, "HAPAX LEGOMENON", 1, 0, 100), -SCROLL(None, "EIRIS SAZUN IDISI", 1, 0, 100), /* Merseburg Incantations */ -SCROLL(None, "PHOL ENDE WODAN", 1, 0, 100), /* Merseburg Incantations */ -SCROLL(None, "GHOTI", 1, 0, 100), /* pronounced as 'fish', George Bernard Shaw */ -SCROLL(None, "MAPIRO MAHAMA DIROMAT", 1, 0, 100), /* Wizardry */ -SCROLL(None, "VAS CORP BET MANI", 1, 0, 100), /* Ultima */ -SCROLL(None, "XOR OTA", 1, 0, 100), /* Aarne Haapakoski */ -SCROLL(None, "STRC PRST SKRZ KRK", 1, 0, 100), /* Czech and Slovak tongue-twister */ -/* these must come last because they have special descriptions - */ + /* Extra descriptions, shuffled into use at start of new game. + * Code in win/share/tilemap.c depends on SCR_STINKING_CLOUD preceding + * these and on how many of them there are. If a real scroll gets added + * after stinking cloud or the number of extra descriptions changes, + * tilemap.c must be modified to match. + */ +SCROLL(None, "FOOBIE BLETCH", 1, 0, 100), +SCROLL(None, "TEMOV", 1, 0, 100), +SCROLL(None, "GARVEN DEH", 1, 0, 100), +SCROLL(None, "READ ME", 1, 0, 100), +SCROLL(None, "ETAOIN SHRDLU", 1, 0, 100), +SCROLL(None, "LOREM IPSUM", 1, 0, 100), +SCROLL(None, "FNORD", 1, 0, 100), /* Illuminati */ +SCROLL(None, "KO BATE", 1, 0, 100), /* Kurd Lasswitz */ +SCROLL(None, "ABRA KA DABRA", 1, 0, 100), /* traditional incantation */ +SCROLL(None, "ASHPD SODALG", 1, 0, 100), /* Portal */ +SCROLL(None, "ZLORFIK", 1, 0, 100), /* Zak McKracken */ +SCROLL(None, "GNIK SISI VLE", 1, 0, 100), /* Zak McKracken */ +SCROLL(None, "HAPAX LEGOMENON", 1, 0, 100), +SCROLL(None, "EIRIS SAZUN IDISI", 1, 0, 100), /* Merseburg Incantations */ +SCROLL(None, "PHOL ENDE WODAN", 1, 0, 100), /* Merseburg Incantations */ +SCROLL(None, "GHOTI", 1, 0, 100), /* pronounced as 'fish', + George Bernard Shaw */ +SCROLL(None, "MAPIRO MAHAMA DIROMAT", 1, 0, 100), /* Wizardry */ +SCROLL(None, "VAS CORP BET MANI", 1, 0, 100), /* Ultima */ +SCROLL(None, "XOR OTA", 1, 0, 100), /* Aarne Haapakoski */ +SCROLL(None, "STRC PRST SKRZ KRK", 1, 0, 100), /* Czech and Slovak + tongue-twister */ + /* These must come last because they have special fixed descriptions. + */ #ifdef MAIL -SCROLL("mail", "stamped", 0, 0, 0), +SCROLL("mail", "stamped", 0, 0, 0), #endif -SCROLL("blank paper", "unlabeled", 0, 28, 60), +SCROLL("blank paper", "unlabeled", 0, 28, 60), #undef SCROLL /* spellbooks ... */ From ef2a6e6f1bacf627a4aef4511b815be04a5916a4 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 11 Nov 2015 23:46:19 -0800 Subject: [PATCH 21/51] make depend dungeon.o depending on lev.h is the only change found by 'make depend'. (I'm a bit suspicious about that.) I haven't attempted to reconcile the vms Makefiles with the Unix ones, just put in this one new dependency. I know vms/Makefile.src lacks handling for sys/share/*regex.c and vms/Makefile.top and install.com both lack handling for 'sysconf'. --- sys/unix/Makefile.src | 5 +++-- sys/vms/Makefile.src | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index 3a9365ba4..16d087472 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -1,5 +1,5 @@ # NetHack Makefile. -# NetHack 3.6 Makefile.src $NHDT-Date: 1434446945 2015/06/16 09:29:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.44 $ +# NetHack 3.6 Makefile.src $NHDT-Date: 1447313972 2015/11/12 07:39:32 $ $NHDT-Branch: master $:$NHDT-Revision: 1.45 $ # Root of source tree: NHSROOT=.. @@ -750,7 +750,8 @@ dogmove.o: dogmove.c $(HACK_H) ../include/mfndpos.h dokick.o: dokick.c $(HACK_H) dothrow.o: dothrow.c $(HACK_H) drawing.o: drawing.c $(HACK_H) ../include/tcap.h -dungeon.o: dungeon.c $(HACK_H) ../include/dgn_file.h ../include/dlb.h +dungeon.o: dungeon.c $(HACK_H) ../include/dgn_file.h ../include/dlb.h \ + ../include/lev.h eat.o: eat.c $(HACK_H) end.o: end.c $(HACK_H) ../include/lev.h ../include/dlb.h engrave.o: engrave.c $(HACK_H) ../include/lev.h diff --git a/sys/vms/Makefile.src b/sys/vms/Makefile.src index 6995b0359..8274024c7 100644 --- a/sys/vms/Makefile.src +++ b/sys/vms/Makefile.src @@ -1,5 +1,5 @@ # NetHack Makefile (VMS) - for building nethack itself. -# NetHack 3.6 Makefile.src $NHDT-Date: 1432512790 2015/05/25 00:13:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ +# NetHack 3.6 Makefile.src $NHDT-Date: 1447314365 2015/11/12 07:46:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.27 $ # Copy this file to [.src]Makefile. and then edit it as needed. # The default configuration is for building with DEC C (aka Compaq C). @@ -392,7 +392,7 @@ dogmove.obj : dogmove.c $(HACK_H) $(INC)mfndpos.h dokick.obj : dokick.c $(HACK_H) dothrow.obj : dothrow.c $(HACK_H) drawing.obj : drawing.c $(HACK_H) $(INC)tcap.h -dungeon.obj : dungeon.c $(HACK_H) $(INC)dgn_file.h $(INC)dlb.h +dungeon.obj : dungeon.c $(HACK_H) $(INC)dgn_file.h $(INC)dlb.h $(INC)lev.h eat.obj : eat.c $(HACK_H) end.obj : end.c $(HACK_H) $(INC)lev.h $(INC)dlb.h engrave.obj : engrave.c $(HACK_H) $(INC)lev.h From f1106d136ec3cfe9a07774546b782ca8eb316333 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 12 Nov 2015 01:47:04 -0800 Subject: [PATCH 22/51] tribute: Going Postal --- dat/tribute | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 166 insertions(+), 6 deletions(-) diff --git a/dat/tribute b/dat/tribute index 9fd099653..89ac2d4f4 100644 --- a/dat/tribute +++ b/dat/tribute @@ -3934,14 +3934,174 @@ is 'me'?" # # # -%title Going Postal (1) +%title Going Postal (13) %passage 1 +What was magic, after all, but something that happened at the snap of +a finger? Where was the magic in that? It was mumbled words and weird +drawings in old books and in the wrong hands it was dangerous as hell, +but not one half as dangerous as it could be in the right hands. -What was magic, after all, but something that happened at the -snap of a finger? Where was the magic in that? It was mumbled -words and weird drawings in old books and in the wrong hands it -was dangerous as hell, but not one half as dangerous as it could -be in the right hands. + [Going Postal, by Terry Pratchett] +%e passage +# p. 5 (Harper Torch edition) +%passage 2 +They say that the prospect of being hanged in the morning concentrates +a man's mind wonderfully; unfortunately, what the mind inevitably +concentrates on is that, in the morning, it will be in a body that is +going to be hanged. + + [Going Postal, by Terry Pratchett] +%e passage +# p. 18 +%passage 3 +There is a saying, "You can't fool an honest man," which is much quoted +by people who make a profitable living by fooling honest men. Moist +never tried it, knowingly anyway. If you did fool an honest man, he +tended to complain to the local Watch, and these days they were harder +to buy off. Fooling dishonest men was a lot safer, and somehow, more +sporting. And, of course, there were so many more of them. You hardly +had to aim. + + [Going Postal, by Terry Pratchett] +%e passage +# p. 47 (passage starts mid-paragraph; +# italics because it's Moist von Lipwig's internal monolog) +%passage 4 +/What kind of man would put a known criminal in charge of a major branch +of government? Apart from, say, the average voter./ + + [Going Postal, by Terry Pratchett] +%e passage +# p. 137 +%passage 5 +Now he could see the mysterious order clearly. They were robed, of course, +because you couldn't have a secret order without robes. They had pushed +the hoods back now, and each man(1) was wearing a peaked cap with a bird +skeleton wired to it. + +(1) Women are always significantly underrepresented in secret orders. + + [Going Postal, by Terry Pratchett] +%e passage +# p. 184 ('Tubso' and 'Bissonomy' are accurate) +%passage 6 +Just below the dome, staring down from their niches, were statues of the +Virtues: Patience, Chastity, Silence, Charity, Hope, Tubso, Bissonomy,(1) +and Fortitude. + +(1) Many cultures practice neither of these in the hustle and bustle of +the modern world, because no one can remember what they are. + + [Going Postal, by Terry Pratchett] +%e passage +# pp. 249-250 (Moist and Miss Dearheart are in a fancy restaurant) +%passage 7 +She froze, staring over his shoulder. He saw her right hand scrabble +frantically among the cutlery and grab a knife. + +"That bastard has just walked into the place!" she hissed. "Reacher Gilt! +I'll just kill him and join you for the pudding..." + +"You can't do that!" hissed Moist. + +"Oh? Why not?" + +"You're using the wrong knife! That's for the fish! You'll get into +trouble!" + +She glared at him, but her hand relaxed, and something like a smile +appeared on her face. + +"They don't have a knife for stabbing rich, murdering bastards?" she said. + +"They bring it to the table when you order one," said Moist urgently. +"Look, this isn't the Drum, they don't just throw the body into the river! +They'll call the Watch! Get a grip. Not on a knife! And get ready to +run." + +"Why?" + +"Because I forged his signature on Grand Trunk notepaper to get us in +here, that's why." + + [Going Postal, by Terry Pratchett] +%e passage +# pp 260-261 (Mr. Groat: elderly postal employee recently attacked in +# the palacial but severely dilapidated post office; +# "his imagination": Moist's; "him": Mr. Groat; "he": Moist) +%passage 8 +The vision of Mr. Groat's chest kept bumping insistently against his +imagination. It looked as though something with claws had taken a swipe +at him, and only the thick uniform coat prevented him from being opened +like a clam. But that didn't sound like a vampire. They weren't messy +like that. It was a waste of good food. + +Nevertheless, he picked up a piece of smashed chair. It had splintered +nicely. And the nice thing about a stake through the heart was that it +also worked on non-vampires. + + [Going Postal, by Terry Pratchett] +%e passage +# p. 262 (Stanley, a young postal employee who collects pins, recently +# fought off /something/ using a bag of pins as a weapon) +# [this passage doesn't have a very satisfactory ending...] +%passage 9 +You probably couldn't /kill/ a vampire with pins... + +And after a thought like that is when you realize that however hard you +try to look behind you, there's a behind you, behind you, where you aren't +looking. Moist flung his back to the cold stone wall where he slithered +along it until he ran out of wall and acquired a doorframe. + + [Going Postal, by Terry Pratchett] +%e passage +#p. 278 ('thoughted' and 'thoughting' are accurate) +%passage 10 +"Oh, Mr. Lipwig!" + +It is not often that a wailing woman rushes into a room and throws herself +at a man. It had never happened to Moist before. Now it happened, and it +seemed such a waste that the woman was Miss Maccalariat. + +She tottered forward and clung to the startled Moist, tears streaming down +her face. + +"Oh, Mr. Lipwig!" she wailed. "Oh, Mr. Lipwig!" + +Moist reeled under her weight. She was dragging at his collar so hard +that he was likely to end up on the floor, and the thought of being found +on the floor with Miss Maccalariat was--well, a thought that just couldn't +be thoughted. The head would explode before thoughting it. + + [Going Postal, by Terry Pratchett] +%e passage +#p. 315 +%passage 11 +Always remember that the crowd that applauds your coronation is the same +crowd that will applaud your beheading. People like a show. + + [Going Postal, by Terry Pratchett] +%e passage +# p. 326 (homage to "To Have and Have Not"; Lauren Bacall's character says +# to Humphrey Bogart's character, "You know how to whistle, don't +# you Steve? Just put your lips together and--blow." +# Miss Dearheart's slight pause seems better placed...) +%passage 12 +Miss Dearheart stubbed out her cigarette. "Go up there tonight, Mr. Lipwig. +Get yourself a little bit closer to heaven. And then get down on your +knees and pray. You know how to pray, don't you? You just put your hands +together--and hope." + + [Going Postal, by Terry Pratchett] +%e passage +# p. 333 ('crackers' have been sending and receiving clandestine clacks +# messages without owners/operators of the clacks network noticing) +%passage 13 +It was a little like stealing. It was exactly like stealing. It was, in +fact, stealing. But there was no law against it, because no one knew the +crime existed, so is it really stealing if what's stolen isn't missed? +And is it stealing if you're stealing from thieves? Anyway, all property +is theft, except mine. [Going Postal, by Terry Pratchett] %e passage From 0bcb713b4fd58bd70dcec333308b6ee82cf69489 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 12 Nov 2015 18:00:55 +0200 Subject: [PATCH 23/51] Fix special level loader memory leaks --- src/sp_lev.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/sp_lev.c b/src/sp_lev.c index 2ad495305..d93988660 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -471,6 +471,7 @@ opvar_var_conversion(coder, ov) struct sp_coder *coder; struct opvar *ov; { + static const char nhFunc[] = "opvar_var_conversion"; struct splev_var *tmp; struct opvar *tmpov; struct opvar *array_idx = NULL; @@ -483,14 +484,14 @@ struct opvar *ov; while (tmp) { if (!strcmp(tmp->name, OV_s(ov))) { if ((tmp->svtyp & SPOVAR_ARRAY)) { - array_idx = opvar_var_conversion( - coder, splev_stack_pop(coder->stack)); + array_idx = opvar_var_conversion(coder, splev_stack_pop(coder->stack)); if (!array_idx || OV_typ(array_idx) != SPOVAR_INT) panic("array idx not an int"); if (tmp->array_len < 1) panic("array len < 1"); OV_i(array_idx) = (OV_i(array_idx) % tmp->array_len); tmpov = opvar_clone(tmp->data.arrayvalues[OV_i(array_idx)]); + opvar_free(array_idx); return tmpov; } else { tmpov = opvar_clone(tmp->data.value); @@ -525,15 +526,21 @@ splev_stack_getdat(coder, typ) struct sp_coder *coder; xchar typ; { + static const char nhFunc[] = "splev_stack_getdat"; if (coder && coder->stack) { struct opvar *tmp = splev_stack_pop(coder->stack); + struct opvar *ret = NULL; if (!tmp) panic("no value type %i in stack.", typ); - if (tmp->spovartyp == SPOVAR_VARIABLE) - tmp = opvar_var_conversion(coder, tmp); + if (tmp->spovartyp == SPOVAR_VARIABLE) { + ret = opvar_var_conversion(coder, tmp); + opvar_free(tmp); + tmp = ret; + } if (tmp->spovartyp == typ) return tmp; + else opvar_free(tmp); } return NULL; } @@ -542,10 +549,14 @@ struct opvar * splev_stack_getdat_any(coder) struct sp_coder *coder; { + static const char nhFunc[] = "splev_stack_getdat_any"; if (coder && coder->stack) { struct opvar *tmp = splev_stack_pop(coder->stack); - if (tmp && tmp->spovartyp == SPOVAR_VARIABLE) - tmp = opvar_var_conversion(coder, tmp); + if (tmp && tmp->spovartyp == SPOVAR_VARIABLE) { + struct opvar *ret = opvar_var_conversion(coder, tmp); + opvar_free(tmp); + return ret; + } return tmp; } return NULL; @@ -4736,6 +4747,7 @@ struct sp_coder *coder; break; } opvar_free(r); + opvar_free(typ); } void From 8451f67dff82e71de755fb055a7ecf9042963a22 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 12 Nov 2015 18:29:33 +0200 Subject: [PATCH 24/51] Fix wallification and wallify catacombs mine end --- dat/mines.des | 1 + src/sp_lev.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dat/mines.des b/dat/mines.des index 70069e04e..7f76d7b3e 100644 --- a/dat/mines.des +++ b/dat/mines.des @@ -1142,6 +1142,7 @@ DOOR:closed,(73,5) DOOR:closed,(2,15) MAZEWALK:(36,8),west STAIR:(42,8),up +WALLIFY # Objects OBJECT:('*',"diamond"),random diff --git a/src/sp_lev.c b/src/sp_lev.c index d93988660..c2350f9dc 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -4736,9 +4736,9 @@ struct sp_coder *coder; dy1 = (xchar) SP_REGION_Y1(OV_i(r)); dx2 = (xchar) SP_REGION_X2(OV_i(r)); dy2 = (xchar) SP_REGION_Y2(OV_i(r)); - wallify_map(dx1 < 0 ? xstart : dx1, dy1 < 0 ? ystart : dy1, - dx2 < 0 ? xstart + xsize : dx2, - dy2 < 0 ? ystart + ysize : dy2); + wallify_map(dx1 < 0 ? (xstart-1) : dx1, dy1 < 0 ? (ystart-1) : dy1, + dx2 < 0 ? (xstart + xsize + 1) : dx2, + dy2 < 0 ? (ystart + ysize + 1) : dy2); break; case 1: if (!OV_pop_typ(r, SPOVAR_SEL)) From c1e34f17f7c235d36d299039512e1e838c48e208 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 12 Nov 2015 20:11:45 +0200 Subject: [PATCH 25/51] Prevent a rnd(0) call --- src/zap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zap.c b/src/zap.c index 61e4033c9..a88ee1b9e 100644 --- a/src/zap.c +++ b/src/zap.c @@ -2979,7 +2979,8 @@ STATIC_OVL void skiprange(range, skipstart, skipend) int range, *skipstart, *skipend; { - int tmp = range - (rnd(range / 4)); + int tr = (range / 4); + int tmp = range - ((tr > 0) ? rnd(tr) : 0); *skipstart = tmp; *skipend = tmp - ((tmp / 4) * rnd(3)); if (*skipend >= tmp) From ca02f00208e2107d609bc135be3ae7f56a51e86a Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 12 Nov 2015 22:01:47 +0200 Subject: [PATCH 26/51] Prevent buffer overflow --- src/pickup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pickup.c b/src/pickup.c index 058ec3a05..bf655281d 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -144,7 +144,7 @@ struct obj *objs; boolean here; int *menu_on_demand; { - char ilets[20], inbuf[BUFSZ]; + char ilets[30], inbuf[BUFSZ]; /* FIXME: hardcoded ilets[] length */ int iletct, oclassct; boolean not_everything; char qbuf[QBUFSZ]; From 489d56d4bb5c32d257bcc071b9056f9496434b38 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 13 Nov 2015 00:06:07 +0200 Subject: [PATCH 27/51] Fix hiding under nothing when corpse rotted away --- src/dig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dig.c b/src/dig.c index 17fcf4553..0d1c24187 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1983,7 +1983,8 @@ long timeout; if (mtmp && !OBJ_AT(x, y) && mtmp->mundetected && hides_under(mtmp->data)) { mtmp->mundetected = 0; - } + } else if (x == u.ux && y == u.uy && u.uundetected && hides_under(youmonst.data)) + (void) hideunder(&youmonst); newsym(x, y); } else if (in_invent) update_inventory(); From 4387bde9689c67f270987a5df93f62fe975378fa Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 13 Nov 2015 00:07:43 +0200 Subject: [PATCH 28/51] Clear thrownobj when punished and swallowed As per Pat's suggestion, this actually does work correctly; I have no idea why I thought it didn't ... --- src/dothrow.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/dothrow.c b/src/dothrow.c index 7c83a6247..8de02854d 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -1161,10 +1161,9 @@ boolean ; /* missile has already been handled */ } else if (u.uswallow) { /* ball is not picked up by monster */ - if (obj != uball) { + if (obj != uball) (void) mpickobj(u.ustuck, obj); - thrownobj = (struct obj *) 0; - } + thrownobj = (struct obj *) 0; } else { /* the code following might become part of dropy() */ if (obj->oartifact == ART_MJOLLNIR && Role_if(PM_VALKYRIE) From 2e5818d80387b800acc9aff2f6a8b0a81aa423dc Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 13 Nov 2015 01:12:43 -0800 Subject: [PATCH 29/51] tty build warning Use casts to try to suppress a couple of assignments of long to short that Michael's compiler warns about. 'cw->maxrow' might have a value that's too big for 'short' (when dealing with really big menus), but 'cw->maxcol' never will (unless someone comes up with a terminal or emulator that's wider that 32K-1 characters...). --- win/tty/wintty.c | 66 +++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index f27cee9fb..372545351 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintty.c $NHDT-Date: 1447253778 2015/11/11 14:56:18 $ $NHDT-Branch: master $:$NHDT-Revision: 1.113 $ */ +/* NetHack 3.6 wintty.c $NHDT-Date: 1447405953 2015/11/13 09:12:33 $ $NHDT-Branch: master $:$NHDT-Revision: 1.114 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1312,9 +1312,10 @@ int type; newwin->datlen = (short *) alloc(sizeof(short) * (unsigned) newwin->maxrow); if (newwin->maxcol) { + /* WIN_STATUS */ for (i = 0; i < newwin->maxrow; i++) { newwin->data[i] = (char *) alloc((unsigned) newwin->maxcol); - newwin->datlen[i] = newwin->maxcol; + newwin->datlen[i] = (short) newwin->maxcol; } } else { for (i = 0; i < newwin->maxrow; i++) { @@ -2031,6 +2032,7 @@ winid window; boolean blocking; /* with ttys, all windows are blocking */ { register struct WinDesc *cw = 0; + short s_maxcol; if (window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0) panic(winpanicstr, window); @@ -2067,15 +2069,18 @@ boolean blocking; /* with ttys, all windows are blocking */ /*FALLTHRU*/ case NHW_MENU: cw->active = 1; + /* cw->maxcol is a long, but its value is constrained to + be <= ttyDisplay->cols, so is sure to fit within a short */ + s_maxcol = (short) cw->maxcol; #ifdef H2344_BROKEN cw->offx = (cw->type == NHW_TEXT) ? 0 : min(min(82, ttyDisplay->cols / 2), - ttyDisplay->cols - cw->maxcol - 1); + ttyDisplay->cols - s_maxcol - 1); #else /* avoid converting to uchar before calculations are finished */ - cw->offx = (uchar)(int) max( - (int) 10, (int) (ttyDisplay->cols - cw->maxcol - 1)); + cw->offx = (uchar) max((int) 10, + (int) (ttyDisplay->cols - s_maxcol - 1)); #endif if (cw->offx < 0) cw->offx = 0; @@ -3318,17 +3323,17 @@ genericptr_t ptr; * BL_HILITE_INVERSE -2 + 3 = 1 (statusattr[1]) * BL_HILITE_BOLD -3 + 3 = 0 (statusattr[0]) */ - int statusattr[] = {ATR_BOLD, ATR_INVERSE, ATR_NONE}; + int statusattr[] = { ATR_BOLD, ATR_INVERSE, ATR_NONE }; int attridx = 0; long value = -1L; static boolean beenhere = FALSE; enum statusfields fieldorder[2][15] = { { BL_TITLE, BL_STR, BL_DX, BL_CO, BL_IN, BL_WI, BL_CH, BL_ALIGN, - BL_SCORE, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, - BL_FLUSH }, + BL_SCORE, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, + BL_FLUSH }, { BL_LEVELDESC, BL_GOLD, BL_HP, BL_HPMAX, BL_ENE, BL_ENEMAX, - BL_AC, BL_XP, BL_EXP, BL_HD, BL_TIME, BL_HUNGER, - BL_CAP, BL_CONDITION, BL_FLUSH } + BL_AC, BL_XP, BL_EXP, BL_HD, BL_TIME, BL_HUNGER, + BL_CAP, BL_CONDITION, BL_FLUSH } }; if (fldidx != BL_FLUSH) { @@ -3357,8 +3362,8 @@ genericptr_t ptr; default: value = atol(text); Sprintf(status_vals[fldidx], - status_fieldfmt[fldidx] ? status_fieldfmt[fldidx] : - "%s", text); + status_fieldfmt[fldidx] ? status_fieldfmt[fldidx] : "%s", + text); break; } @@ -3367,7 +3372,6 @@ genericptr_t ptr; case BL_TH_NONE: tty_status_colors[fldidx] = NO_COLOR; break; - case BL_TH_UPDOWN: if (chg > 0) tty_status_colors[fldidx] = tty_status_hilites[fldidx].over; @@ -3376,29 +3380,27 @@ genericptr_t ptr; else tty_status_colors[fldidx] = NO_COLOR; break; - - case BL_TH_VAL_PERCENTAGE: - { + case BL_TH_VAL_PERCENTAGE: { int pct_th = 0; + if (tty_status_hilites[fldidx].thresholdtype != ANY_INT) { impossible( - "tty_status_update: unsupported percentage threshold type %d", - tty_status_hilites[fldidx].thresholdtype); - break; + "tty_status_update: unsupported percentage threshold type %d", + tty_status_hilites[fldidx].thresholdtype); + } else { + pct_th = tty_status_hilites[fldidx].threshold.a_int; + tty_status_colors[fldidx] = (percent >= pct_th) + ? tty_status_hilites[fldidx].over + : tty_status_hilites[fldidx].under; } - pct_th = tty_status_hilites[fldidx].threshold.a_int; - tty_status_colors[fldidx] = (percent >= pct_th) - ? tty_status_hilites[fldidx].over - : tty_status_hilites[fldidx].under; + break; } - break; - - case BL_TH_VAL_ABSOLUTE: - { + case BL_TH_VAL_ABSOLUTE: { int c = NO_COLOR; int o = tty_status_hilites[fldidx].over; int u = tty_status_hilites[fldidx].under; anything *t = &tty_status_hilites[fldidx].threshold; + switch (tty_status_hilites[fldidx].thresholdtype) { case ANY_LONG: c = (value >= t->a_long) ? o : u; @@ -3417,14 +3419,14 @@ genericptr_t ptr; break; default: impossible( - "tty_status_update: unsupported absolute threshold type %d\n", - tty_status_hilites[fldidx].thresholdtype); + "tty_status_update: unsupported absolute threshold type %d\n", + tty_status_hilites[fldidx].thresholdtype); break; } tty_status_colors[fldidx] = c; - } - break; - } + break; + } /* case */ + } /* switch */ #endif /* STATUS_HILITES */ } From 24099c50b287831c8d782b52d766c96797bd9142 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 13 Nov 2015 09:14:50 -0500 Subject: [PATCH 30/51] suppress an MSC warning in cppregex.cpp Changes to be committed: modified: include/ntconf.h --- include/ntconf.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/include/ntconf.h b/include/ntconf.h index 065eabd6f..48b149bfa 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 ntconf.h $NHDT-Date: 1432512777 2015/05/25 00:12:57 $ $NHDT-Branch: master $:$NHDT-Revision: 1.47 $ */ +/* NetHack 3.6 ntconf.h $NHDT-Date: 1447424077 2015/11/13 14:14:37 $ $NHDT-Branch: master $:$NHDT-Revision: 1.48 $ */ /* Copyright (c) NetHack PC Development Team 1993, 1994. */ /* NetHack may be freely redistributed. See license for details. */ @@ -107,11 +107,12 @@ extern void FDECL(interject, (int)); #ifdef YYPREFIX #pragma warning(disable : 4102) /* unreferenced label */ #endif -#if 0 -#pragma warning(disable : 4018) /* signed/unsigned mismatch */ -#pragma warning(disable : 4305) /* init, conv from 'const int' to 'char' */ -#endif +#ifdef __cplusplus +/* suppress a warning in cppregex.cpp */ +#pragma warning(disable : 4101) /* unreferenced local variable */ #endif +#endif /* _MSC_VER */ + #define RUNTIME_PORT_ID /* trigger run-time port identification for \ * identification of exe CPU architecture \ @@ -187,10 +188,6 @@ extern void FDECL(interject, (int)); #define FILENAME_CMP stricmp /* case insensitive */ #endif -#if 0 -extern char levels[], bones[], permbones[], -#endif /* 0 */ - /* this was part of the MICRO stuff in the past */ extern const char *alllevels, *allbones; extern char hackdir[]; From 95772261dcbd8d30dba0ead204d5955a541e0b66 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 13 Nov 2015 20:39:10 -0800 Subject: [PATCH 31/51] fix memory leak: obj->oextra->omonst->mextra The memory leak (monst->mextra->edog, monst->mextra->mname, monst->mextra for some monster were not released) I noticed recently was due to recording a pet's full monster attributes with its corpse. During save and restore, obj->oextra->omonst was being treated as a full-fledged monster so worked as intended, but when freed, omonst was treated as a black box and its mextra details weren't handled. --- include/extern.h | 5 +++-- src/mkobj.c | 36 ++++++++++++++++++++++++++---------- src/mon.c | 15 +++++++++------ src/zap.c | 7 +++---- 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/include/extern.h b/include/extern.h index 54c6ed2b3..5add97a44 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 extern.h $NHDT-Date: 1447124656 2015/11/10 03:04:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.515 $ */ +/* NetHack 3.6 extern.h $NHDT-Date: 1447475941 2015/11/14 04:39:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.516 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1070,6 +1070,7 @@ E int FDECL(monhp_per_lvl, (struct monst *)); E void FDECL(newmonhp, (struct monst *, int)); E struct mextra *NDECL(newmextra); E void FDECL(copy_mextra, (struct monst *, struct monst *)); +E void FDECL(dealloc_mextra, (struct monst *)); E struct monst *FDECL(makemon, (struct permonst *, int, int, int)); E boolean FDECL(create_critters, (int, struct permonst *, BOOLEAN_P)); E struct permonst *NDECL(rndmonst); @@ -1203,7 +1204,7 @@ E const char *FDECL(waterbody_name, (XCHAR_P, XCHAR_P)); E struct oextra *NDECL(newoextra); E void FDECL(copy_oextra, (struct obj *, struct obj *)); -E void FDECL(dealloc_oextra, (struct oextra *)); +E void FDECL(dealloc_oextra, (struct obj *)); E void FDECL(newomonst, (struct obj *)); E void FDECL(free_omonst, (struct obj *)); E void FDECL(newomid, (struct obj *)); diff --git a/src/mkobj.c b/src/mkobj.c index bfc5b6cee..6b56739a2 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mkobj.c $NHDT-Date: 1446892448 2015/11/07 10:34:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.112 $ */ +/* NetHack 3.6 mkobj.c $NHDT-Date: 1447475943 2015/11/14 04:39:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.113 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -79,21 +79,25 @@ newoextra() } void -dealloc_oextra(x) -struct oextra *x; +dealloc_oextra(o) +struct obj *o; { + struct oextra *x = o->oextra; + if (x) { if (x->oname) free((genericptr_t) x->oname); if (x->omonst) - free((genericptr_t) x->omonst); + free_omonst(o); /* 'o' rather than 'x' */ if (x->omid) free((genericptr_t) x->omid); if (x->olong) free((genericptr_t) x->olong); if (x->omailcmd) free((genericptr_t) x->omailcmd); + free((genericptr_t) x); + o->oextra = (struct oextra *) 0; } } @@ -104,8 +108,13 @@ struct obj *otmp; if (!otmp->oextra) otmp->oextra = newoextra(); if (!OMONST(otmp)) { - OMONST(otmp) = (struct monst *) alloc(sizeof (struct monst)); - (void) memset((genericptr_t) OMONST(otmp), 0, sizeof (struct monst)); + struct monst *m = newmonst(); + + /* newmonst() allocates memory but doesn't initialize anything */ + (void) memset((genericptr_t) m, 0, sizeof (struct monst)); + m->mextra = (struct mextra *) 0; + m->nmon = (struct monst *) 0; + OMONST(otmp) = m; } } @@ -113,9 +122,15 @@ void free_omonst(otmp) struct obj *otmp; { - if (otmp->oextra && OMONST(otmp)) { - free((genericptr_t) OMONST(otmp)); - OMONST(otmp) = (struct monst *) 0; + if (otmp->oextra) { + struct monst *m = OMONST(otmp); + + if (m) { + if (m->mextra) + dealloc_mextra(m); + free((genericptr_t) m); + OMONST(otmp) = (struct monst *) 0; + } } } @@ -1511,6 +1526,7 @@ struct monst *mtmp; newomonst(obj); if (has_omonst(obj)) { struct monst *mtmp2 = OMONST(obj); + *mtmp2 = *mtmp; mtmp2->mextra = (struct mextra *) 0; if (mtmp->data) @@ -2053,7 +2069,7 @@ struct obj *obj; kickedobj = 0; if (obj->oextra) - dealloc_oextra(obj->oextra); + dealloc_oextra(obj); free((genericptr_t) obj); } diff --git a/src/mon.c b/src/mon.c index 889599b84..8e251092c 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mon.c $NHDT-Date: 1446458009 2015/11/02 09:53:29 $ $NHDT-Branch: master $:$NHDT-Revision: 1.194 $ */ +/* NetHack 3.6 mon.c $NHDT-Date: 1447475944 2015/11/14 04:39:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.196 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -18,7 +18,6 @@ STATIC_DCL long FDECL(mm_aggression, (struct monst *, struct monst *)); STATIC_DCL long FDECL(mm_displacement, (struct monst *, struct monst *)); STATIC_DCL int NDECL(pick_animal); STATIC_DCL void FDECL(kill_eggs, (struct obj *)); -STATIC_DCL void FDECL(dealloc_mextra, (struct mextra *)); STATIC_DCL int FDECL(pickvampshape, (struct monst *)); STATIC_DCL boolean FDECL(isspecmon, (struct monst *)); STATIC_DCL boolean FDECL(validspecmon, (struct monst *, int)); @@ -1597,10 +1596,12 @@ struct monst *mtmp2, *mtmp1; MCORPSENM(mtmp2) = MCORPSENM(mtmp1); } -STATIC_OVL void -dealloc_mextra(x) -struct mextra *x; +void +dealloc_mextra(m) +struct monst *m; { + struct mextra *x = m->mextra; + if (x) { if (x->mname) free((genericptr_t) x->mname); @@ -1615,7 +1616,9 @@ struct mextra *x; if (x->edog) free((genericptr_t) x->edog); /* [no action needed for x->mcorpsenm] */ + free((genericptr_t) x); + m->mextra = (struct mextra *) 0; } } @@ -1626,7 +1629,7 @@ struct monst *mon; if (mon->nmon) panic("dealloc_monst with nmon"); if (mon->mextra) - dealloc_mextra(mon->mextra); + dealloc_mextra(mon); free((genericptr_t) mon); } diff --git a/src/zap.c b/src/zap.c index a88ee1b9e..34c4b6d31 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 zap.c $NHDT-Date: 1446887542 2015/11/07 09:12:22 $ $NHDT-Branch: master $:$NHDT-Revision: 1.233 $ */ +/* NetHack 3.6 zap.c $NHDT-Date: 1447475947 2015/11/14 04:39:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.235 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -4462,9 +4462,8 @@ register struct obj *obj; /* no texts here! */ obj->owt = weight(obj); obj->dknown = obj->bknown = obj->rknown = 0; obj->known = objects[obj->otyp].oc_uses_known ? 0 : 1; - if (obj->oextra) - dealloc_oextra(obj->oextra); - obj->oextra = (struct oextra *) 0; + dealloc_oextra(obj); + if (obj->where == OBJ_FLOOR) { obj_extract_self(obj); /* move rocks back on top */ place_object(obj, obj->ox, obj->oy); From 739b6708ee244d7857ef87e2f4f71e4fa9813c56 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 14 Nov 2015 09:59:35 +0200 Subject: [PATCH 32/51] Fix enexto complaint when morguemon returned null --- src/mkroom.c | 2 +- src/polyself.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mkroom.c b/src/mkroom.c index a56afc59c..c7f6196e4 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -422,7 +422,7 @@ int mm_flags; while (cnt--) { mdat = morguemon(); - if (enexto(&cc, mm->x, mm->y, mdat) + if (mdat && enexto(&cc, mm->x, mm->y, mdat) && (!revive_corpses || !(otmp = sobj_at(CORPSE, cc.x, cc.y)) || !revive(otmp, FALSE))) diff --git a/src/polyself.c b/src/polyself.c index 80f1d6f06..4c9380b72 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -448,7 +448,7 @@ int psflags; || mntmp == urole.femalenum)) { const char *pm_name; - /* mkclass_ploy() can pick a !polyok() + /* mkclass_poly() can pick a !polyok() candidate; if so, usually try again */ if (class) { if (rn2(3) || --tryct > 0) From ffcc6f1bc2943cc63ad1e07d9bd14f678e21ca9d Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 14 Nov 2015 10:29:44 +0200 Subject: [PATCH 33/51] Remove the useless FUN STUFF section The fun stuff section in config.h contains nothing fun anymore, so let's remove it. Move SCORE_ON_BOTL to the next section, and add couple other defines there too. --- include/config.h | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/include/config.h b/include/config.h index d75972732..fc389f72d 100644 --- a/include/config.h +++ b/include/config.h @@ -400,19 +400,7 @@ typedef unsigned char uchar; #endif #endif -/* - * Section 4: THE FUN STUFF!!! - * - * Conditional compilation of special options are controlled here. - * If you define the following flags, you will add not only to the - * complexity of the game but also to the size of the load module. - */ -/* display features */ -/* dungeon features */ -/* dungeon levels */ -/* monsters & objects */ -/* I/O */ #if !defined(MAC) #if !defined(NOCLIPPING) #define CLIPPING /* allow smaller screens -- ERS */ @@ -421,10 +409,9 @@ typedef unsigned char uchar; #define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ -/* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ /* - * Section 5: EXPERIMENTAL STUFF + * Section 4: EXPERIMENTAL STUFF * * Conditional compilation of new or experimental options are controlled here. * Enable any of these at your own risk -- there are almost certainly @@ -434,8 +421,12 @@ typedef unsigned char uchar; /* #define STATUS_VIA_WINDOWPORT */ /* re-work of the status line updating process */ /* #define STATUS_HILITES */ /* support hilites of status fields */ /* #define WINCHAIN*/ /* stacked window systems */ +/* #define SCORE_ON_BOTL */ /* show estimated score on status line */ +#define FREE_ALL_MEMORY /* free all memory at exit */ +/* #define DEBUG_MIGRATING_MONS */ /* add a wizard-mode command to help debug + migrating monsters */ -/* End of Section 5 */ +/* End of Section 4 */ #include "global.h" /* Define everything else according to choices above */ From 272d32b343d8dcf515d072956a20602803a13e9d Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 14 Nov 2015 00:46:19 -0800 Subject: [PATCH 34/51] readobjnam()'s "overlapping strcat" Replace the code that uses strcat with two pointers into the same buffer. Treated separately, they point at distinct strings (no overlap possible), but the C standard does disallow that in order to enable optimizations using block transfer or such, so the tool that complained about it isn't wrong. The characters getting appended to the output pointer can end up overlapping the beginning of the other input pointer, conceivably breaking an implementation that didn't use simple left-to-right byte-at- a-time copying. Also, I noticed that wishing for "luck stone" gave me a random gem. There's code to strip off " stone" and compare against gem types, but it prevents other code that accepts "foo bar" as a match for "foobar" and vice versa from finding a match, since "luck" doesn't match anything once "stone" is gone. So add the four gray stones into the array of alternate spellings. Another bit: it now accepts " gem" in addition to " stone" as optional gem suffix, so "ruby", "ruby stone", and "ruby gem" all yield ruby. ("luck gem" won't work; you'll end up with a random gem-class object.) And a last other bit: wishing for "lamp (lit) named foo" would yield an unlit, unnamed lamp because "(lit)" followed by anything didn't match "(lit)" and threw away everything past the opening paren. Now it will produce "lamp named foo (lit)"--a lit lamp named "foo". (Wishing for "lamp named foo (lit)" produces an unlit lamp named "foo (lit)". That's acceptable to me... I'm not crawling any farther down this hole. Maybe object formatting should be changed to keep the lit attribute in front of the name?) --- src/objnam.c | 77 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 30 deletions(-) diff --git a/src/objnam.c b/src/objnam.c index 3a1a66acb..18d78fee1 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 objnam.c $NHDT-Date: 1446892450 2015/11/07 10:34:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.153 $ */ +/* NetHack 3.6 objnam.c $NHDT-Date: 1447490776 2015/11/14 08:46:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.154 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2364,6 +2364,13 @@ struct alt_spellings { { "grappling iron", GRAPPLING_HOOK }, { "grapnel", GRAPPLING_HOOK }, { "grapple", GRAPPLING_HOOK }, + /* normally we wouldn't have to worry about unnecessary , but + " stone" will get stripped off, preventing a wishymatch; that actually + lets "flint stone" be a match, so we also accept bogus "flintstone" */ + { "luck stone", LUCKSTONE }, + { "load stone", LOADSTONE }, + { "touch stone", TOUCHSTONE }, + { "flintstone", FLINT }, { (const char *) 0, 0 }, }; @@ -2429,7 +2436,6 @@ struct obj *no_wish; * "2 3 alarm chilis". Currently this isn't allowed; options.c * automatically sticks 'candied' in front of such names. */ - char oclass; char *un, *dn, *actualn; const char *name = 0; @@ -2556,35 +2562,44 @@ struct obj *no_wish; } if (!cnt) cnt = 1; /* %% what with "gems" etc. ? */ - if (strlen(bp) > 1) { - if ((p = rindex(bp, '(')) != 0) { - if (p > bp && p[-1] == ' ') - p[-1] = 0; - else - *p = 0; - p++; - if (!strcmpi(p, "lit)")) { - islit = 1; - } else { + if (strlen(bp) > 1 && (p = rindex(bp, '(')) != 0) { + boolean keeptrailingchars = TRUE; + + p[(p > bp && p[-1] == ' ') ? -1 : 0] = '\0'; /*terminate bp */ + ++p; /* advance past '(' */ + if (!strncmpi(p, "lit)", 4)) { + islit = 1; + p += 4 - 1; /* point at ')' */ + } else { + spe = atoi(p); + while (digit(*p)) + p++; + if (*p == ':') { + p++; + rechrg = spe; spe = atoi(p); while (digit(*p)) p++; - if (*p == ':') { - p++; - rechrg = spe; - spe = atoi(p); - while (digit(*p)) - p++; - } - if (*p != ')') { - spe = rechrg = 0; - } else { - spesgn = 1; - p++; - if (*p) - Strcat(bp, p); - } } + if (*p != ')') { + spe = rechrg = 0; + /* mis-matched parentheses; rest of string will be ignored + * [probably we should restore everything back to '(' + * instead since it might be part of "named ..."] + */ + keeptrailingchars = FALSE; + } else { + spesgn = 1; + } + } + if (keeptrailingchars) { + char *pp = eos(bp); + + /* 'pp' points at 'pb's terminating '\0', + 'p' points at ')' and will be incremented past it */ + do { + *pp++ = *++p; + } while (*p); } } /* @@ -2892,8 +2907,8 @@ retry: goto typfnd; } - if (!BSTRCMPI(bp, p - 6, " stone")) { - p[-6] = 0; + if (!BSTRCMPI(bp, p - 6, " stone") || !BSTRCMPI(bp, p - 4, " gem")) { + p[!strcmpi(p - 4, " gem") ? -4 : -6] = '\0'; oclass = GEM_CLASS; dn = actualn = bp; goto srch; @@ -2918,8 +2933,9 @@ retry: goto typfnd; else typ = 0; /* somebody changed objects[]? punt */ - } else { /* try to construct canonical form */ + } else { /* try to construct canonical form */ char tbuf[BUFSZ]; + Strcpy(tbuf, "worthless piece of "); Strcat(tbuf, g); /* assume it starts with the color */ Strcpy(bp, tbuf); @@ -2967,6 +2983,7 @@ srch: } if (actualn) { struct Jitem *j = Japanese_items; + while (j->item) { if (actualn && !strcmpi(actualn, j->name)) { typ = j->item; From 9eb14f684c0fb9a44343cb49a3ab6afdfeb615a2 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 14 Nov 2015 17:41:27 +0200 Subject: [PATCH 35/51] Extract guard gold before disposing it If the gold is still in monster inventory, dealloc_obj will panic. --- src/steal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/steal.c b/src/steal.c index 94fcaca2e..4b5378d96 100644 --- a/src/steal.c +++ b/src/steal.c @@ -676,6 +676,7 @@ boolean is_pet; /* If true, pet should keep wielded/worn items */ if (canspotmon(mtmp)) pline("%s gold %s.", s_suffix(Monnam(mtmp)), canseemon(mtmp) ? "vanishes" : "seems to vanish"); + obj_extract_self(otmp); obfree(otmp, (struct obj *) 0); } /* isgd && has gold */ From b2ab8f25047855b9b678d89fb756406d581b6704 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 15 Nov 2015 09:09:45 +0200 Subject: [PATCH 36/51] Update precompiled lev_comp lex and yacc files --- sys/share/lev_lex.c | 2566 ++++++++++++++----------- sys/share/lev_yacc.c | 4358 ++++++++++++++++++------------------------ 2 files changed, 3309 insertions(+), 3615 deletions(-) diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index dbfdb4187..4b2b27df7 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -1,67 +1,113 @@ -/* A lexical scanner generated by flex */ -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ - */ +#line 3 "lex.yy.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 39 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ #include +#include +#include +#include +/* end standard C headers. */ -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 #endif +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ #ifdef __cplusplus -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) -#define YY_USE_PROTOS #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -76,71 +122,79 @@ * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ -#define BEGIN yy_start = 1 + 2 * +#define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ -#define YY_START ((yy_start - 1) / 2) +#define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) +#define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; -extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - +#define unput(c) yyunput( c, (yytext_ptr) ) +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; @@ -156,7 +210,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -177,12 +231,16 @@ struct yy_buffer_state */ int yy_at_bol; + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; + #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process @@ -196,28 +254,38 @@ struct yy_buffer_state * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 - }; -static YY_BUFFER_STATE yy_current_buffer = 0; + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". + * + * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER yy_current_buffer +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ +static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches @@ -225,185 +293,212 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart YY_PROTO(( FILE *input_file )); +void yyrestart (FILE *input_file ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); +void yy_delete_buffer (YY_BUFFER_STATE b ); +void yy_flush_buffer (YY_BUFFER_STATE b ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state (void ); -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) +static void yyensure_buffer_stack (void ); +static void yy_load_buffer_state (void ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); + +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ typedef unsigned char YY_CHAR; + FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + typedef int yy_state_type; + +extern int yylineno; + +int yylineno = 1; + extern char *yytext; #define yytext_ptr yytext -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; + (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 199 -#define YY_END_OF_BUFFER 200 -static yyconst short int yy_accept[1046] = +#define YY_NUM_RULES 200 +#define YY_END_OF_BUFFER 201 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[1057] = { 0, - 0, 0, 0, 0, 200, 198, 194, 193, 198, 198, - 198, 198, 198, 198, 197, 183, 191, 198, 192, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 198, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 194, 198, 197, 2, 198, 194, 198, 198, 197, 183, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 194, 198, 194, 193, 187, 0, 184, 185, - 0, 0, 181, 197, 180, 182, 183, 197, 189, 188, + 0, 0, 0, 0, 201, 199, 195, 194, 199, 199, + 199, 199, 199, 199, 198, 184, 192, 199, 193, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 199, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 195, 199, 198, 2, 199, 195, 199, 199, 198, 184, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 195, 199, 195, 194, 188, 0, 185, 186, + 0, 0, 182, 198, 181, 183, 184, 198, 190, 189, - 186, 190, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 39, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 55, 197, 197, 0, 0, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, + 187, 191, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 39, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 55, 198, 198, 0, 0, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 154, 197, 197, 194, 0, 0, 3, 197, - 2, 2, 0, 194, 0, 181, 197, 180, 183, 197, - 197, 197, 197, 39, 197, 197, 197, 197, 197, 197, - 194, 0, 2, 0, 0, 196, 0, 196, 178, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 54, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 0, 197, 104, 197, 83, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 154, 198, 198, 195, 0, 0, 3, 198, + 2, 2, 0, 195, 0, 182, 198, 181, 184, 198, + 198, 198, 198, 39, 198, 198, 198, 198, 198, 198, + 195, 0, 2, 0, 0, 197, 0, 197, 179, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 54, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 0, 198, 104, 198, 83, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 79, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 81, - 197, 197, 197, 197, 139, 197, 197, 197, 197, 128, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 16, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 126, 197, 197, 197, 197, 197, 197, 197, 197, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 79, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 81, + 198, 198, 198, 198, 198, 139, 198, 198, 198, 198, + 128, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 16, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 126, 198, 198, 198, 198, 198, 198, 198, - 80, 197, 197, 197, 197, 197, 197, 197, 197, 195, - 197, 197, 197, 58, 197, 197, 197, 22, 197, 40, - 197, 41, 197, 197, 197, 197, 49, 197, 197, 197, - 197, 56, 6, 197, 197, 197, 53, 197, 197, 197, - 36, 197, 197, 197, 197, 42, 197, 35, 197, 197, - 197, 197, 197, 21, 197, 0, 179, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 160, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 155, 158, 114, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 69, 197, 197, 197, 197, + 198, 80, 198, 198, 198, 198, 198, 198, 198, 198, + 196, 198, 198, 198, 58, 198, 198, 198, 22, 198, + 40, 198, 41, 198, 198, 198, 198, 49, 198, 198, + 198, 198, 56, 6, 198, 198, 198, 53, 198, 198, + 198, 36, 198, 198, 198, 198, 42, 198, 35, 198, + 198, 198, 198, 198, 21, 198, 0, 180, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 160, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 155, 158, 114, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 69, 198, 198, 198, - 197, 197, 197, 197, 121, 197, 197, 67, 197, 197, - 197, 197, 161, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 119, 197, 197, 197, 197, 107, 197, 197, - 197, 197, 197, 197, 197, 65, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 157, 197, 197, 197, 197, 197, - 116, 15, 0, 197, 197, 197, 197, 197, 28, 197, - 59, 197, 197, 197, 197, 197, 13, 197, 197, 197, - 50, 197, 197, 7, 197, 197, 197, 197, 5, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 30, 197, + 198, 198, 198, 198, 198, 198, 121, 198, 198, 67, + 198, 198, 198, 198, 161, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 119, 198, 198, 198, 198, 107, + 198, 198, 198, 198, 198, 198, 198, 65, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 157, 198, 198, 198, + 198, 198, 116, 15, 0, 198, 198, 198, 198, 198, + 28, 198, 59, 198, 198, 198, 198, 198, 13, 198, + 198, 198, 50, 198, 198, 7, 198, 198, 198, 198, + 5, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 197, 197, 197, 197, 120, 153, 197, 197, 197, 147, - 197, 197, 162, 197, 197, 197, 197, 197, 141, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 156, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 11, 197, 197, 197, 197, - 197, 197, 197, 113, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 125, 197, 12, - 197, 197, 197, 197, 197, 197, 197, 82, 115, 197, - 197, 197, 197, 197, 197, 197, 197, 129, 197, 197, + 30, 198, 198, 198, 198, 198, 120, 153, 198, 198, + 198, 147, 198, 198, 162, 198, 198, 198, 198, 198, + 141, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 156, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 11, 198, + 198, 198, 198, 198, 198, 198, 113, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 125, 198, 12, 198, 198, 198, 198, 198, 198, 198, + 82, 115, 198, 198, 198, 198, 198, 198, 198, 198, - 197, 197, 33, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 29, 197, 197, 197, 197, 197, 197, 17, - 31, 197, 27, 197, 197, 197, 197, 57, 197, 197, - 197, 197, 146, 97, 197, 197, 127, 111, 86, 197, - 123, 72, 108, 197, 197, 197, 197, 165, 197, 197, - 87, 197, 94, 130, 197, 74, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 135, - 197, 197, 109, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 110, 168, 197, 197, 197, 16, 197, 197, - 197, 197, 77, 197, 117, 197, 197, 197, 197, 197, + 129, 198, 198, 198, 198, 33, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 29, 198, 198, 198, 198, + 198, 198, 17, 31, 198, 27, 198, 198, 198, 198, + 57, 198, 198, 198, 198, 146, 97, 198, 198, 127, + 111, 86, 198, 123, 72, 108, 198, 198, 198, 198, + 165, 198, 198, 87, 198, 94, 130, 198, 74, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 135, 198, 198, 109, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 110, 168, 198, 198, + 198, 16, 198, 198, 198, 198, 77, 198, 117, 198, - 112, 197, 197, 197, 152, 173, 197, 197, 78, 197, - 197, 197, 197, 197, 197, 197, 197, 1, 57, 197, - 197, 197, 60, 197, 197, 197, 197, 197, 197, 197, - 4, 197, 19, 197, 197, 197, 197, 197, 62, 43, - 197, 46, 26, 197, 163, 99, 197, 197, 197, 197, - 197, 73, 159, 197, 197, 98, 197, 197, 197, 93, - 197, 197, 197, 197, 145, 197, 197, 197, 197, 136, - 197, 197, 197, 197, 197, 20, 63, 140, 138, 197, - 197, 197, 197, 197, 197, 197, 197, 118, 197, 132, - 96, 197, 151, 197, 197, 197, 197, 197, 101, 47, + 198, 198, 198, 198, 112, 198, 198, 198, 152, 173, + 198, 198, 78, 198, 198, 198, 198, 198, 198, 198, + 198, 1, 57, 198, 198, 198, 60, 198, 198, 198, + 198, 198, 198, 198, 4, 198, 19, 198, 198, 198, + 198, 198, 62, 43, 198, 46, 26, 198, 163, 99, + 198, 198, 198, 198, 198, 73, 159, 198, 198, 98, + 198, 198, 198, 93, 198, 198, 198, 198, 145, 198, + 198, 198, 198, 198, 136, 198, 198, 198, 198, 198, + 20, 63, 140, 138, 198, 198, 198, 198, 198, 198, + 198, 198, 118, 198, 132, 96, 198, 151, 198, 198, - 89, 197, 197, 197, 197, 197, 197, 45, 197, 197, - 34, 61, 14, 8, 25, 197, 197, 197, 197, 197, - 23, 197, 169, 197, 197, 197, 102, 177, 197, 66, - 197, 75, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 150, 9, 197, 197, 197, 197, 197, - 144, 197, 85, 68, 197, 71, 197, 197, 197, 197, - 176, 164, 131, 134, 197, 106, 18, 197, 51, 197, - 197, 197, 197, 197, 197, 95, 142, 197, 197, 70, - 174, 122, 197, 167, 197, 175, 92, 133, 84, 148, - 149, 171, 197, 197, 197, 100, 172, 91, 197, 64, + 198, 198, 198, 101, 47, 89, 198, 198, 198, 198, + 198, 198, 45, 198, 198, 34, 61, 14, 8, 25, + 198, 198, 198, 198, 198, 23, 198, 169, 198, 198, + 198, 102, 177, 198, 66, 198, 75, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, 198, 150, + 9, 198, 198, 198, 198, 198, 144, 198, 85, 68, + 198, 71, 198, 198, 198, 198, 176, 164, 131, 134, + 198, 106, 18, 198, 51, 198, 198, 198, 198, 198, + 198, 95, 142, 198, 198, 70, 174, 122, 198, 167, + 198, 175, 198, 92, 133, 84, 148, 149, 171, 198, - 197, 10, 137, 24, 52, 197, 197, 197, 197, 197, - 76, 88, 124, 105, 197, 197, 166, 103, 197, 197, - 197, 197, 197, 197, 197, 90, 197, 37, 38, 197, - 197, 197, 143, 170, 197, 197, 197, 197, 197, 197, - 197, 48, 32, 44, 0 + 198, 198, 100, 172, 91, 198, 64, 198, 10, 137, + 24, 52, 198, 198, 198, 198, 198, 76, 88, 124, + 105, 198, 198, 198, 166, 103, 198, 198, 198, 198, + 198, 198, 198, 198, 90, 198, 37, 38, 198, 198, + 198, 198, 143, 170, 198, 198, 198, 178, 198, 198, + 198, 198, 48, 32, 44, 0 } ; -static yyconst int yy_ec[256] = +static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -435,7 +530,7 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[75] = +static yyconst flex_int32_t yy_meta[75] = { 0, 1, 2, 3, 2, 2, 1, 1, 2, 1, 1, 1, 2, 4, 2, 4, 1, 1, 1, 5, 5, @@ -447,247 +542,249 @@ static yyconst int yy_meta[75] = 6, 5, 6, 6 } ; -static yyconst short int yy_base[1053] = +static yyconst flex_int16_t yy_base[1064] = { 0, - 0, 73, 102, 77, 1243, 1244, 75, 1244, 1239, 1224, - 1233, 0, 1193, 1223, 1222, 78, 66, 1219, 1218, 1204, - 1197, 57, 63, 59, 64, 101, 0, 63, 79, 119, - 94, 1212, 1198, 122, 123, 121, 1211, 104, 105, 100, - 124, 90, 129, 137, 1163, 84, 117, 1165, 139, 150, - 151, 151, 156, 1158, 163, 168, 166, 56, 1173, 1172, - 232, 1221, 216, 1244, 1220, 242, 248, 251, 264, 196, - 155, 167, 208, 228, 241, 1207, 249, 242, 195, 277, - 284, 223, 319, 334, 257, 1244, 1244, 1214, 1244, 0, - 1209, 1208, 1203, 0, 1202, 1244, 298, 1201, 1244, 1244, + 0, 73, 102, 77, 1254, 1255, 75, 1255, 1250, 1235, + 1244, 0, 1204, 1234, 1233, 78, 66, 1230, 1229, 1215, + 1208, 57, 63, 59, 64, 101, 0, 63, 79, 119, + 94, 1223, 1209, 122, 123, 121, 1222, 104, 105, 100, + 124, 90, 129, 137, 1174, 84, 117, 1176, 139, 150, + 151, 151, 156, 1169, 163, 168, 166, 56, 1184, 1183, + 232, 1232, 216, 1255, 1231, 242, 248, 251, 264, 196, + 155, 167, 208, 228, 241, 1218, 249, 242, 195, 277, + 284, 223, 319, 334, 257, 1255, 1255, 1225, 1255, 0, + 1220, 1219, 1214, 0, 1213, 1255, 298, 1212, 1255, 1255, - 1244, 1244, 1177, 263, 1177, 264, 1189, 1179, 1192, 1173, - 1184, 1181, 1188, 270, 1174, 1172, 1174, 1184, 0, 1175, - 1179, 1160, 1166, 1154, 1160, 1164, 1163, 1163, 280, 1165, - 292, 1160, 301, 1158, 1151, 1157, 1169, 1167, 1159, 259, - 0, 1166, 1154, 203, 304, 272, 1110, 1132, 1121, 1127, - 1130, 288, 1110, 1114, 1110, 1113, 1112, 1124, 1106, 1108, - 308, 1104, 1098, 1095, 1100, 1099, 1105, 1109, 1100, 1102, - 1100, 1100, 234, 281, 296, 299, 1106, 1088, 1091, 1099, - 1084, 81, 315, 1103, 324, 26, 1091, 1090, 1090, 1081, - 330, 1091, 1095, 1081, 1097, 1092, 1095, 281, 333, 1088, + 1255, 1255, 1188, 263, 1188, 264, 1200, 1190, 1203, 1184, + 1195, 1192, 1199, 270, 1185, 1183, 1185, 1195, 0, 1186, + 1190, 1171, 1177, 1165, 1171, 1175, 1174, 1174, 280, 1176, + 292, 1171, 301, 1169, 1162, 1168, 1180, 1178, 1170, 259, + 0, 1177, 1165, 203, 304, 272, 1121, 1143, 1132, 1138, + 1141, 288, 1121, 1125, 1121, 1124, 1123, 1135, 1117, 1119, + 308, 1115, 1109, 1106, 1111, 1110, 1116, 1120, 1111, 1113, + 1111, 1111, 234, 281, 296, 299, 1117, 282, 1103, 1111, + 1096, 81, 315, 1115, 324, 26, 1103, 1102, 1102, 1093, + 330, 1103, 1107, 1093, 1109, 1104, 1107, 281, 333, 1100, - 1090, 1086, 1078, 342, 323, 321, 1070, 1069, 1071, 1072, - 345, 350, 0, 1069, 332, 407, 1131, 1130, 1244, 363, - 1244, 1244, 1129, 411, 415, 416, 1116, 0, 412, 390, - 396, 404, 415, 1115, 337, 410, 420, 417, 423, 424, - 0, 0, 1244, 1126, 0, 1244, 1117, 1116, 1111, 1106, - 1092, 1104, 1099, 1083, 1084, 1100, 1082, 1076, 1093, 1079, - 1076, 1088, 0, 1080, 1090, 1079, 1087, 1068, 1069, 1084, - 1082, 1070, 1080, 1065, 1078, 1063, 1076, 1079, 1049, 1073, - 1065, 1056, 1071, 1065, 1061, 1059, 1065, 1059, 1060, 1050, - 1047, 1061, 1047, 1048, 1051, 326, 1025, 0, 1030, 0, + 1102, 1098, 1090, 342, 323, 321, 1082, 1081, 1083, 1084, + 345, 350, 0, 1081, 332, 407, 1143, 1142, 1255, 363, + 1255, 1255, 1141, 411, 415, 416, 1128, 0, 412, 390, + 396, 404, 415, 1127, 410, 420, 421, 422, 423, 424, + 0, 0, 1255, 1138, 0, 1255, 1129, 1128, 1123, 1118, + 1104, 1116, 1111, 1095, 1096, 1112, 1094, 1088, 1105, 1091, + 1088, 1100, 0, 1092, 1102, 1091, 1099, 1080, 1081, 1096, + 1094, 1082, 1092, 1077, 1090, 1075, 1088, 1091, 1061, 1085, + 1077, 1068, 1083, 1077, 1073, 1071, 1077, 1071, 1072, 1062, + 1059, 1073, 1059, 1060, 1063, 435, 1037, 0, 1042, 0, - 1015, 1024, 1014, 1016, 1007, 1011, 1009, 1003, 1011, 380, - 1018, 1000, 1004, 1015, 998, 1004, 999, 1008, 995, 993, - 997, 0, 990, 989, 999, 989, 1002, 986, 1003, 380, - 998, 987, 389, 1000, 977, 993, 994, 988, 976, 0, - 991, 985, 988, 978, 0, 971, 972, 980, 983, 0, - 976, 981, 970, 982, 972, 977, 976, 376, 975, 959, - 966, 962, 963, 394, 955, 398, 969, 959, 971, 968, - 957, 955, 959, 963, 397, 945, 956, 956, 960, 941, - 958, 942, 945, 953, 939, 398, 947, 935, 953, 939, - 934, 0, 935, 945, 928, 939, 932, 937, 925, 924, + 1027, 1036, 1026, 1028, 1019, 1023, 1021, 1015, 1023, 385, + 1030, 1012, 1016, 1027, 1010, 1016, 1011, 1020, 1007, 1005, + 1009, 0, 1002, 1001, 1011, 1001, 1014, 998, 1015, 383, + 1010, 999, 392, 1012, 989, 1005, 1006, 1000, 988, 0, + 1003, 1003, 996, 999, 989, 0, 982, 983, 991, 994, + 0, 987, 992, 981, 993, 983, 988, 987, 378, 986, + 970, 977, 973, 974, 404, 966, 408, 980, 970, 982, + 979, 968, 966, 970, 974, 392, 956, 967, 967, 971, + 952, 969, 953, 956, 964, 950, 395, 958, 946, 964, + 950, 945, 0, 946, 956, 939, 950, 943, 948, 936, - 0, 453, 443, 445, 960, 448, 451, 452, 454, 1244, - 954, 968, 959, 0, 968, 959, 946, 0, 964, 0, - 964, 0, 945, 943, 942, 956, 0, 955, 929, 953, - 945, 0, 933, 954, 936, 933, 0, 936, 448, 948, - 0, 949, 934, 933, 946, 942, 939, 0, 926, 928, - 939, 925, 939, 0, 930, 466, 1244, 894, 889, 888, - 900, 897, 898, 883, 897, 896, 884, 893, 892, 0, - 891, 890, 875, 881, 887, 882, 878, 868, 875, 882, - 0, 0, 0, 870, 884, 879, 878, 870, 419, 876, - 871, 875, 869, 872, 857, 0, 910, 868, 847, 863, + 935, 0, 462, 448, 453, 971, 454, 456, 434, 455, + 1255, 965, 979, 970, 0, 979, 970, 957, 0, 975, + 0, 975, 0, 956, 954, 953, 967, 0, 966, 940, + 964, 956, 0, 944, 965, 947, 944, 0, 947, 452, + 959, 0, 960, 945, 944, 957, 953, 950, 0, 937, + 939, 950, 936, 950, 0, 941, 468, 1255, 905, 900, + 899, 911, 908, 909, 894, 908, 907, 895, 904, 903, + 0, 902, 901, 886, 892, 898, 893, 889, 879, 886, + 893, 0, 0, 0, 881, 895, 890, 889, 881, 422, + 887, 882, 886, 880, 883, 868, 0, 921, 879, 858, - 855, 851, 862, 863, 0, 862, 846, 0, 860, 863, - 849, 852, 0, 419, 842, 840, 834, 840, 848, 841, - 854, 839, 0, 845, 832, 839, 847, 0, 837, 843, - 846, 826, 844, 417, 843, 0, 831, 820, 821, 825, - 834, 818, 832, 836, 832, 814, 819, 811, 827, 822, - 811, 814, 826, 810, 0, 807, 812, 814, 415, 813, - 0, 1244, 866, 460, 849, 466, 471, 472, 0, 841, - 0, 839, 843, 834, 827, 822, 0, 842, 833, 821, - 0, 827, 821, 0, 837, 830, 835, 830, 0, 825, - 832, 812, 819, 817, 815, 825, 812, 814, 0, 810, + 874, 866, 878, 861, 872, 873, 0, 872, 856, 0, + 870, 873, 859, 862, 0, 429, 852, 850, 844, 850, + 858, 851, 864, 849, 0, 855, 842, 849, 857, 0, + 847, 853, 856, 836, 854, 417, 853, 0, 841, 830, + 831, 835, 844, 828, 842, 846, 842, 824, 829, 821, + 837, 832, 821, 824, 836, 820, 0, 817, 822, 824, + 426, 823, 0, 1255, 876, 463, 859, 466, 475, 476, + 0, 851, 0, 849, 853, 844, 837, 832, 0, 852, + 843, 831, 0, 837, 831, 0, 847, 840, 845, 840, + 0, 835, 842, 822, 829, 827, 825, 835, 822, 824, - 816, 808, 813, 815, 0, 0, 785, 773, 783, 0, - 782, 781, 0, 772, 770, 779, 770, 763, 0, 775, - 775, 771, 772, 757, 774, 770, 754, 750, 436, 0, - 766, 766, 764, 750, 753, 760, 760, 739, 758, 429, - 750, 746, 748, 744, 749, 736, 752, 748, 749, 749, - 732, 732, 745, 731, 743, 0, 742, 730, 744, 737, - 725, 726, 740, 0, 722, 734, 718, 712, 730, 719, - 725, 721, 723, 718, 712, 728, 723, 0, 712, 0, - 705, 705, 704, 703, 703, 716, 716, 437, 0, 714, - 713, 708, 711, 696, 702, 699, 703, 0, 708, 724, + 0, 820, 826, 818, 823, 825, 0, 0, 795, 783, + 793, 0, 792, 791, 0, 782, 780, 789, 780, 773, + 0, 785, 785, 781, 782, 767, 784, 780, 764, 760, + 440, 0, 776, 776, 774, 760, 763, 770, 770, 749, + 768, 435, 760, 756, 758, 754, 763, 758, 745, 761, + 757, 758, 758, 741, 741, 754, 740, 752, 0, 751, + 739, 753, 746, 734, 735, 749, 0, 731, 743, 727, + 721, 739, 728, 734, 730, 732, 727, 721, 737, 732, + 0, 721, 0, 714, 714, 713, 712, 712, 725, 725, + 443, 0, 723, 722, 717, 720, 705, 711, 708, 712, - 478, 482, 0, 725, 723, 717, 727, 726, 725, 718, - 714, 730, 0, 718, 724, 713, 688, 86, 121, 0, - 0, 182, 0, 240, 465, 478, 472, 0, 469, 475, - 465, 460, 0, 0, 458, 459, 0, 0, 0, 452, - 0, 0, 0, 452, 454, 463, 443, 0, 465, 466, - 0, 454, 0, 0, 470, 0, 467, 466, 462, 476, - 474, 474, 471, 466, 468, 478, 469, 483, 474, 0, - 478, 484, 0, 468, 470, 488, 483, 471, 476, 490, - 484, 483, 0, 0, 486, 498, 484, 0, 475, 481, - 487, 484, 0, 491, 509, 500, 490, 505, 492, 498, + 0, 717, 733, 483, 490, 0, 734, 732, 726, 736, + 735, 734, 727, 723, 739, 0, 724, 712, 81, 122, + 205, 226, 0, 0, 311, 0, 350, 460, 483, 476, + 0, 472, 478, 468, 463, 0, 0, 461, 464, 0, + 0, 0, 457, 0, 0, 0, 456, 458, 467, 447, + 0, 469, 470, 0, 458, 0, 0, 474, 0, 471, + 470, 466, 480, 478, 478, 475, 470, 472, 482, 473, + 470, 488, 479, 0, 483, 489, 0, 473, 475, 493, + 488, 476, 481, 495, 489, 488, 0, 0, 491, 503, + 489, 0, 480, 486, 492, 489, 0, 496, 514, 505, - 0, 494, 504, 505, 0, 0, 506, 510, 0, 513, - 504, 515, 515, 516, 517, 503, 523, 0, 558, 559, - 552, 540, 0, 555, 546, 547, 548, 538, 548, 554, - 0, 557, 0, 560, 549, 566, 540, 553, 0, 0, - 552, 0, 0, 531, 0, 0, 539, 540, 541, 543, - 543, 0, 0, 534, 530, 0, 539, 532, 535, 0, - 549, 549, 542, 538, 0, 547, 548, 560, 547, 0, - 545, 559, 545, 562, 562, 0, 0, 0, 0, 559, - 553, 555, 566, 560, 568, 549, 570, 1244, 571, 0, - 0, 573, 0, 577, 564, 573, 569, 557, 0, 0, + 495, 510, 497, 503, 0, 499, 509, 510, 0, 0, + 511, 515, 0, 518, 509, 520, 520, 521, 522, 508, + 528, 0, 563, 564, 557, 545, 0, 560, 551, 552, + 553, 543, 553, 559, 0, 562, 0, 565, 554, 571, + 545, 558, 0, 0, 557, 0, 0, 536, 0, 0, + 544, 545, 546, 548, 548, 0, 0, 539, 535, 0, + 544, 537, 540, 0, 554, 554, 547, 543, 0, 552, + 546, 554, 566, 553, 0, 551, 565, 551, 568, 568, + 0, 0, 0, 0, 565, 559, 561, 572, 566, 574, + 555, 576, 1255, 577, 0, 0, 579, 0, 583, 570, - 0, 579, 580, 581, 581, 575, 600, 0, 612, 613, - 0, 0, 0, 0, 0, 595, 621, 600, 609, 605, - 0, 596, 0, 593, 594, 585, 0, 0, 585, 0, - 589, 0, 598, 583, 596, 587, 605, 588, 603, 591, - 596, 606, 594, 0, 0, 601, 607, 599, 598, 613, - 0, 614, 0, 0, 615, 0, 604, 607, 614, 611, - 0, 0, 0, 0, 620, 0, 0, 650, 0, 651, - 655, 657, 641, 655, 643, 0, 0, 612, 627, 0, - 0, 0, 614, 0, 623, 0, 0, 0, 0, 0, - 0, 0, 622, 632, 618, 0, 0, 0, 620, 0, + 579, 575, 563, 0, 0, 0, 585, 586, 587, 587, + 581, 606, 0, 618, 619, 0, 0, 0, 0, 0, + 601, 627, 606, 615, 611, 0, 602, 0, 599, 600, + 591, 0, 0, 591, 0, 595, 0, 604, 589, 602, + 593, 611, 594, 605, 610, 598, 603, 613, 601, 0, + 0, 608, 614, 606, 605, 620, 0, 621, 0, 0, + 622, 0, 611, 614, 621, 618, 0, 0, 0, 0, + 627, 0, 0, 657, 0, 658, 662, 664, 648, 662, + 650, 0, 0, 619, 634, 0, 0, 0, 621, 0, + 630, 0, 641, 0, 0, 0, 0, 0, 0, 630, - 620, 0, 0, 0, 0, 659, 660, 655, 656, 670, - 0, 0, 0, 0, 641, 643, 0, 0, 643, 674, - 668, 672, 664, 676, 650, 0, 651, 0, 0, 682, - 686, 679, 0, 0, 674, 681, 676, 674, 679, 680, - 676, 0, 0, 0, 1244, 713, 715, 721, 724, 730, - 735, 740 + 640, 626, 0, 0, 0, 628, 0, 628, 0, 0, + 0, 0, 667, 668, 663, 664, 678, 0, 0, 0, + 0, 642, 650, 652, 0, 0, 652, 683, 677, 681, + 673, 685, 658, 660, 0, 661, 0, 0, 692, 696, + 689, 650, 0, 0, 685, 692, 687, 0, 685, 690, + 691, 687, 0, 0, 0, 1255, 724, 726, 732, 735, + 741, 746, 751 } ; -static yyconst short int yy_def[1053] = +static yyconst flex_int16_t yy_def[1064] = { 0, - 1045, 1, 1, 3, 1045, 1045, 1045, 1045, 1045, 1045, - 1046, 1047, 1048, 1045, 1049, 1049, 1045, 1045, 1045, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1045, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1045, 1050, 1049, 1045, 1045, 1051, 1051, 1051, 1049, 69, - 69, 69, 69, 1049, 69, 69, 69, 69, 69, 69, - 69, 69, 1051, 1050, 1045, 1045, 1045, 1046, 1045, 1047, - 1045, 1052, 1045, 1049, 1049, 1045, 1049, 1049, 1045, 1045, + 1056, 1, 1, 3, 1056, 1056, 1056, 1056, 1056, 1056, + 1057, 1058, 1059, 1056, 1060, 1060, 1056, 1056, 1056, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1056, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1056, 1061, 1060, 1056, 1056, 1062, 1062, 1062, 1060, 69, + 69, 69, 69, 1060, 69, 69, 69, 69, 69, 69, + 69, 69, 1062, 1061, 1056, 1056, 1056, 1057, 1056, 1058, + 1056, 1063, 1056, 1060, 1060, 1056, 1060, 1060, 1056, 1056, - 1045, 1045, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1045, 1045, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1056, 1056, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1056, 1056, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1045, 1050, 1050, 1045, 1049, - 1045, 1045, 1045, 83, 83, 83, 69, 69, 69, 69, - 69, 1049, 69, 69, 69, 69, 69, 69, 69, 69, - 83, 84, 1045, 1050, 84, 1045, 1045, 1045, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1045, 1049, 1049, 1049, 1049, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1056, 1061, 1061, 1056, 1060, + 1056, 1056, 1056, 83, 83, 83, 69, 69, 69, 69, + 69, 1060, 69, 69, 69, 69, 69, 69, 69, 69, + 83, 84, 1056, 1061, 84, 1056, 1056, 1056, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1056, 1060, 1060, 1060, 1060, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1049, 1049, 69, 69, 1049, 69, 69, 69, 69, 1045, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1045, 1045, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1060, 1060, 1060, 69, 69, 1060, 69, 69, 69, 69, + 1056, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1056, 1056, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1045, 1045, 69, 1049, 69, 69, 69, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1056, 1056, 69, 1060, 69, 69, 69, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 69, 69, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1060, 1060, 1060, 69, 69, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 69, 69, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1045, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 69, 69, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1056, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, - 1049, 1049, 1049, 1049, 0, 1045, 1045, 1045, 1045, 1045, - 1045, 1045 + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 0, 1056, 1056, 1056, 1056, + 1056, 1056, 1056 } ; -static yyconst short int yy_nxt[1319] = +static yyconst flex_int16_t yy_nxt[1330] = { 0, 6, 7, 8, 9, 7, 10, 11, 6, 12, 6, 13, 14, 15, 6, 16, 17, 18, 19, 20, 21, @@ -698,14 +795,14 @@ static yyconst short int yy_nxt[1319] = 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 27, 27, 27, 61, 105, 85, 61, 61, 85, 62, 83, 99, 100, 84, 107, 119, 96, 110, 106, - 111, 355, 97, 113, 120, 108, 114, 121, 109, 356, + 111, 356, 97, 113, 120, 108, 114, 121, 109, 357, 112, 122, 115, 63, 64, 65, 66, 63, 144, 67, - 834, 123, 128, 68, 69, 67, 70, 212, 145, 213, + 836, 123, 128, 68, 69, 67, 70, 212, 145, 213, 71, 72, 73, 116, 74, 75, 129, 76, 77, 98, - 76, 78, 175, 117, 346, 79, 118, 124, 80, 81, + 76, 78, 175, 117, 347, 79, 118, 124, 80, 81, 132, 125, 82, 140, 133, 126, 176, 67, 135, 136, - 347, 127, 163, 141, 134, 164, 142, 835, 165, 152, + 348, 127, 163, 141, 134, 164, 142, 837, 165, 152, 137, 138, 153, 139, 146, 154, 147, 177, 155, 227, 148, 149, 156, 76, 150, 151, 157, 166, 178, 158, 159, 227, 179, 160, 230, 170, 161, 181, 167, 171, @@ -713,11 +810,11 @@ static yyconst short int yy_nxt[1319] = 192, 184, 104, 190, 194, 96, 187, 144, 195, 227, 229, 198, 188, 191, 193, 199, 203, 145, 209, 200, - 204, 196, 227, 205, 201, 202, 231, 131, 210, 836, + 204, 196, 227, 205, 201, 202, 231, 131, 210, 838, 206, 211, 207, 216, 220, 208, 216, 227, 125, 217, - 106, 240, 126, 85, 222, 223, 224, 98, 127, 1045, - 222, 223, 1045, 222, 223, 227, 227, 110, 85, 232, - 235, 85, 837, 227, 122, 226, 222, 223, 225, 112, + 106, 240, 126, 85, 222, 223, 224, 98, 127, 1056, + 222, 223, 1056, 222, 223, 227, 227, 110, 85, 232, + 235, 85, 839, 227, 122, 226, 222, 223, 225, 112, 233, 225, 234, 114, 123, 225, 227, 225, 228, 115, 120, 251, 227, 227, 227, 252, 331, 227, 292, 227, 227, 227, 227, 227, 293, 254, 332, 227, 227, 255, @@ -725,37 +822,37 @@ static yyconst short int yy_nxt[1319] = 227, 227, 236, 237, 227, 263, 140, 96, 264, 225, 278, 279, 97, 296, 238, 138, 141, 239, 145, 142, 216, 222, 223, 241, 281, 284, 242, 282, 297, 333, - 456, 298, 373, 334, 285, 227, 243, 244, 245, 299, - 305, 245, 374, 335, 306, 245, 245, 245, 245, 98, - 307, 227, 245, 245, 245, 336, 316, 245, 270, 245, + 342, 298, 374, 334, 285, 227, 243, 244, 245, 299, + 305, 245, 375, 335, 306, 245, 245, 245, 245, 98, + 307, 343, 245, 245, 245, 336, 316, 245, 840, 245, 245, 337, 245, 245, 338, 339, 340, 245, 317, 318, - 245, 245, 457, 319, 245, 348, 349, 352, 361, 245, - 387, 362, 350, 375, 353, 385, 354, 376, 386, 388, - 363, 364, 382, 393, 383, 365, 402, 366, 400, 401, + 245, 245, 841, 319, 245, 349, 350, 353, 362, 245, + 388, 363, 351, 376, 354, 386, 355, 377, 387, 389, + 364, 365, 383, 394, 384, 366, 403, 367, 401, 402, - 395, 384, 377, 396, 227, 245, 273, 397, 216, 398, - 227, 216, 85, 394, 217, 224, 1045, 1045, 225, 225, - 225, 96, 225, 225, 227, 405, 229, 403, 260, 227, - 226, 227, 404, 406, 227, 407, 469, 227, 227, 489, - 493, 470, 516, 517, 522, 525, 523, 490, 287, 408, - 526, 288, 535, 409, 547, 562, 563, 227, 494, 227, - 548, 564, 227, 98, 536, 227, 227, 414, 227, 590, - 456, 632, 423, 654, 227, 697, 673, 566, 655, 674, - 227, 591, 698, 568, 633, 227, 227, 751, 762, 567, - 807, 701, 227, 808, 763, 569, 227, 838, 702, 752, + 396, 385, 378, 397, 227, 245, 273, 398, 216, 399, + 227, 216, 85, 395, 217, 224, 1056, 1056, 225, 225, + 225, 96, 225, 225, 227, 406, 229, 404, 260, 227, + 226, 270, 405, 407, 227, 227, 227, 227, 227, 457, + 408, 470, 490, 494, 518, 519, 471, 537, 227, 409, + 491, 549, 288, 410, 524, 527, 525, 550, 287, 538, + 528, 495, 227, 98, 564, 565, 566, 227, 227, 227, + 227, 569, 457, 592, 634, 415, 676, 227, 424, 677, + 227, 458, 568, 657, 570, 593, 700, 635, 658, 227, + 227, 754, 842, 701, 765, 704, 811, 227, 571, 812, - 839, 599, 840, 819, 841, 820, 842, 843, 844, 845, - 846, 847, 457, 848, 849, 850, 851, 852, 853, 854, + 766, 601, 705, 755, 227, 843, 844, 845, 823, 846, + 847, 848, 849, 824, 458, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, - 905, 906, 227, 227, 907, 908, 909, 910, 911, 912, + 905, 906, 907, 908, 909, 910, 911, 227, 227, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, - 933, 843, 934, 935, 936, 937, 938, 939, 940, 941, + 933, 934, 935, 936, 937, 938, 847, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, @@ -767,76 +864,77 @@ static yyconst short int yy_nxt[1319] = 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, - 1042, 1043, 1044, 88, 88, 88, 88, 88, 88, 90, - 90, 91, 91, 833, 91, 91, 91, 94, 94, 94, - 218, 218, 218, 218, 218, 218, 225, 225, 225, 225, - 247, 247, 832, 247, 247, 247, 831, 830, 829, 828, - 827, 826, 825, 824, 823, 822, 821, 818, 817, 816, - 815, 814, 813, 812, 811, 810, 809, 806, 805, 804, - 803, 802, 801, 800, 799, 798, 797, 796, 795, 794, - 793, 792, 791, 790, 789, 788, 787, 786, 785, 784, - 783, 782, 781, 780, 779, 778, 777, 776, 775, 774, + 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, + 1052, 1053, 1054, 1055, 88, 88, 88, 88, 88, 88, + 90, 90, 91, 91, 835, 91, 91, 91, 94, 94, + 94, 218, 218, 218, 218, 218, 218, 225, 225, 225, + 225, 247, 247, 834, 247, 247, 247, 833, 832, 831, + 830, 829, 828, 827, 826, 825, 822, 821, 820, 819, + 818, 817, 816, 815, 814, 813, 810, 809, 808, 807, + 806, 805, 804, 803, 802, 801, 800, 799, 798, 797, + 796, 795, 794, 793, 792, 791, 790, 789, 788, 787, - 773, 772, 771, 770, 769, 768, 767, 766, 765, 764, - 761, 760, 759, 758, 757, 756, 755, 754, 753, 750, - 749, 748, 747, 746, 745, 744, 743, 742, 741, 740, - 739, 738, 737, 736, 735, 734, 733, 732, 731, 730, - 729, 728, 727, 726, 725, 724, 723, 722, 721, 720, - 719, 718, 717, 716, 715, 714, 713, 712, 711, 710, - 709, 708, 707, 706, 705, 704, 703, 700, 562, 699, - 696, 695, 694, 693, 692, 691, 690, 689, 688, 687, - 686, 685, 684, 683, 682, 681, 680, 679, 678, 677, - 676, 675, 672, 671, 670, 669, 668, 667, 666, 665, + 786, 785, 784, 783, 782, 781, 780, 779, 778, 777, + 776, 775, 774, 773, 772, 771, 770, 769, 768, 767, + 764, 763, 762, 761, 760, 759, 758, 757, 756, 753, + 752, 751, 750, 749, 748, 747, 746, 745, 744, 743, + 742, 741, 740, 739, 738, 737, 736, 735, 734, 733, + 732, 731, 730, 729, 728, 727, 726, 725, 724, 723, + 722, 721, 720, 719, 718, 717, 716, 715, 714, 713, + 712, 711, 710, 709, 708, 707, 706, 703, 564, 702, + 699, 698, 697, 696, 695, 694, 693, 692, 691, 690, + 689, 688, 687, 686, 685, 684, 683, 682, 681, 680, - 664, 663, 662, 661, 660, 659, 658, 657, 656, 653, - 652, 651, 650, 649, 648, 647, 646, 645, 644, 643, - 642, 641, 640, 639, 638, 637, 636, 635, 634, 631, - 630, 629, 628, 627, 626, 625, 624, 623, 622, 621, - 620, 619, 618, 617, 616, 615, 614, 613, 612, 611, - 610, 609, 608, 607, 606, 605, 604, 603, 602, 601, - 600, 599, 598, 597, 596, 595, 594, 593, 592, 589, - 588, 587, 586, 585, 584, 583, 582, 581, 580, 579, - 578, 577, 576, 575, 574, 573, 572, 571, 570, 569, - 565, 561, 560, 559, 558, 557, 556, 555, 554, 553, + 679, 678, 675, 674, 673, 672, 671, 670, 669, 668, + 667, 666, 665, 664, 663, 662, 661, 660, 659, 656, + 655, 654, 653, 652, 651, 650, 649, 648, 647, 646, + 645, 644, 643, 642, 641, 640, 639, 638, 637, 636, + 633, 632, 631, 630, 629, 628, 627, 626, 625, 624, + 623, 622, 621, 620, 619, 618, 617, 616, 615, 614, + 613, 612, 611, 610, 609, 608, 607, 606, 605, 604, + 603, 602, 601, 600, 599, 598, 597, 596, 595, 594, + 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, + 581, 580, 579, 578, 577, 576, 575, 574, 573, 572, - 552, 551, 550, 549, 546, 545, 544, 543, 542, 541, - 540, 539, 538, 537, 534, 533, 532, 531, 530, 529, - 528, 527, 524, 521, 520, 519, 518, 437, 515, 514, - 513, 512, 511, 510, 509, 508, 507, 506, 505, 504, - 503, 502, 501, 500, 499, 498, 497, 496, 495, 492, - 491, 488, 487, 486, 485, 484, 483, 482, 481, 480, - 479, 478, 477, 476, 475, 474, 473, 472, 471, 468, - 467, 466, 465, 464, 463, 462, 461, 460, 459, 458, - 455, 454, 453, 452, 451, 450, 449, 448, 447, 446, - 445, 444, 443, 442, 441, 440, 439, 438, 437, 436, + 571, 567, 563, 562, 561, 560, 559, 558, 557, 556, + 555, 554, 553, 552, 551, 548, 547, 546, 545, 544, + 543, 542, 541, 540, 539, 536, 535, 534, 533, 532, + 531, 530, 529, 526, 523, 522, 521, 520, 438, 517, + 516, 515, 514, 513, 512, 511, 510, 509, 508, 507, + 506, 505, 504, 503, 502, 501, 500, 499, 498, 497, + 496, 493, 492, 489, 488, 487, 486, 485, 484, 483, + 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, + 472, 469, 468, 467, 466, 465, 464, 463, 462, 461, + 460, 459, 456, 455, 454, 453, 452, 451, 450, 449, - 435, 434, 433, 432, 431, 430, 429, 428, 427, 426, - 425, 424, 423, 422, 421, 420, 419, 418, 417, 416, - 415, 414, 413, 412, 411, 249, 410, 410, 243, 227, - 227, 222, 219, 219, 399, 392, 391, 390, 389, 381, - 380, 379, 378, 372, 371, 370, 369, 368, 367, 360, - 359, 358, 357, 351, 345, 344, 343, 342, 341, 330, - 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, - 315, 314, 313, 312, 311, 310, 309, 308, 304, 303, - 302, 301, 300, 295, 294, 291, 290, 289, 288, 287, - 286, 283, 280, 277, 276, 275, 274, 273, 272, 271, + 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, + 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, + 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, + 418, 417, 416, 415, 414, 413, 412, 249, 411, 411, + 243, 227, 227, 222, 219, 219, 400, 393, 392, 391, + 390, 382, 381, 380, 379, 373, 372, 371, 370, 369, + 368, 361, 360, 359, 358, 352, 346, 345, 344, 341, + 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, + 320, 315, 314, 313, 312, 311, 310, 309, 308, 304, + 303, 302, 301, 300, 295, 294, 291, 290, 289, 288, - 270, 269, 268, 267, 266, 265, 262, 261, 260, 259, - 258, 257, 256, 253, 250, 249, 95, 93, 248, 246, - 89, 227, 221, 219, 215, 214, 197, 180, 174, 143, - 131, 130, 104, 103, 102, 101, 95, 93, 92, 89, - 87, 86, 1045, 5, 1045, 1045, 1045, 1045, 1045, 1045, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + 287, 286, 283, 280, 277, 276, 275, 274, 273, 272, + 271, 270, 269, 268, 267, 266, 265, 262, 261, 260, + 259, 258, 257, 256, 253, 250, 249, 95, 93, 248, + 246, 89, 227, 221, 219, 215, 214, 197, 180, 174, + 143, 131, 130, 104, 103, 102, 101, 95, 93, 92, + 89, 87, 86, 1056, 5, 1056, 1056, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045 + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056 } ; -static yyconst short int yy_chk[1319] = +static yyconst flex_int16_t yy_chk[1330] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -850,11 +948,11 @@ static yyconst short int yy_chk[1319] = 24, 186, 16, 25, 28, 23, 25, 29, 23, 186, 24, 29, 25, 2, 3, 3, 3, 4, 38, 3, - 718, 29, 31, 3, 3, 3, 3, 58, 38, 58, + 719, 29, 31, 3, 3, 3, 3, 58, 38, 58, 3, 3, 3, 26, 3, 3, 31, 3, 3, 16, 3, 3, 46, 26, 182, 3, 26, 30, 3, 3, 34, 30, 3, 36, 34, 30, 46, 3, 35, 35, - 182, 30, 42, 36, 34, 42, 36, 719, 42, 40, + 182, 30, 42, 36, 34, 42, 36, 720, 42, 40, 35, 35, 40, 35, 39, 40, 39, 47, 40, 71, 39, 39, 41, 3, 39, 39, 41, 43, 47, 41, 41, 72, 47, 41, 71, 44, 41, 49, 43, 44, @@ -862,11 +960,11 @@ static yyconst short int yy_chk[1319] = 52, 49, 72, 51, 53, 70, 50, 144, 53, 79, 70, 55, 50, 51, 52, 55, 56, 144, 57, 55, - 56, 53, 73, 56, 55, 55, 73, 79, 57, 722, + 56, 53, 73, 56, 55, 55, 73, 79, 57, 721, 56, 57, 56, 61, 63, 56, 61, 82, 63, 61, 73, 82, 63, 66, 66, 66, 66, 70, 63, 67, 67, 67, 68, 68, 68, 75, 78, 74, 85, 74, - 78, 85, 724, 77, 78, 68, 69, 69, 69, 74, + 78, 85, 722, 77, 78, 68, 69, 69, 69, 74, 75, 69, 77, 75, 78, 69, 69, 69, 69, 75, 77, 104, 69, 69, 69, 104, 173, 69, 140, 69, 69, 80, 69, 69, 140, 106, 173, 69, 81, 106, @@ -874,120 +972,124 @@ static yyconst short int yy_chk[1319] = 69, 69, 80, 80, 69, 114, 81, 97, 114, 69, 129, 129, 97, 145, 80, 80, 81, 80, 145, 81, 83, 83, 83, 83, 131, 133, 83, 131, 146, 174, - 296, 146, 198, 174, 133, 69, 84, 84, 84, 146, + 178, 146, 198, 174, 133, 69, 84, 84, 84, 146, 152, 84, 198, 174, 152, 84, 84, 84, 84, 97, - 152, 235, 84, 84, 84, 175, 161, 84, 235, 84, + 152, 178, 84, 84, 84, 175, 161, 84, 725, 84, 84, 175, 84, 84, 176, 176, 176, 84, 161, 161, - 84, 84, 296, 161, 84, 183, 183, 185, 191, 84, + 84, 84, 727, 161, 84, 183, 183, 185, 191, 84, 206, 191, 183, 199, 185, 205, 185, 199, 205, 206, 191, 191, 204, 211, 204, 191, 220, 191, 215, 215, 212, 204, 199, 212, 230, 84, 220, 212, 216, 212, 231, 216, 224, 211, 216, 224, 225, 226, 224, 225, - 226, 229, 225, 226, 236, 232, 229, 230, 232, 233, - 226, 238, 231, 233, 237, 238, 310, 239, 240, 330, - 333, 310, 358, 358, 364, 366, 364, 330, 236, 239, - 366, 237, 375, 240, 386, 402, 402, 403, 333, 404, - 386, 403, 406, 229, 375, 407, 408, 404, 409, 439, - 456, 489, 406, 514, 564, 559, 534, 407, 514, 534, - 566, 439, 559, 409, 489, 567, 568, 629, 640, 408, - 688, 567, 701, 688, 640, 564, 702, 725, 568, 629, + 226, 229, 225, 226, 235, 232, 229, 230, 232, 233, + 226, 235, 231, 233, 236, 237, 238, 239, 240, 296, + 238, 310, 330, 333, 359, 359, 310, 376, 409, 239, + 330, 387, 237, 240, 365, 367, 365, 387, 236, 376, + 367, 333, 404, 229, 403, 403, 404, 405, 407, 410, + 408, 409, 457, 440, 490, 405, 536, 566, 407, 536, + 568, 296, 408, 516, 410, 440, 561, 490, 516, 569, + 570, 631, 728, 561, 642, 569, 691, 704, 566, 691, - 726, 566, 727, 701, 729, 702, 730, 731, 732, 735, - 736, 740, 456, 744, 745, 746, 747, 749, 750, 752, - 755, 757, 758, 759, 760, 761, 762, 763, 764, 765, - 766, 767, 768, 769, 771, 772, 774, 775, 776, 777, - 778, 779, 780, 781, 782, 785, 786, 787, 789, 790, - 791, 792, 794, 795, 796, 797, 798, 799, 800, 802, - 803, 804, 807, 808, 810, 811, 812, 813, 814, 815, - 816, 817, 819, 820, 821, 822, 824, 825, 826, 827, - 828, 829, 830, 832, 834, 835, 836, 837, 838, 841, - 844, 847, 848, 849, 850, 851, 854, 855, 857, 858, + 642, 568, 570, 631, 705, 729, 730, 732, 704, 733, + 734, 735, 738, 705, 457, 739, 743, 747, 748, 749, + 750, 752, 753, 755, 758, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 775, + 776, 778, 779, 780, 781, 782, 783, 784, 785, 786, + 789, 790, 791, 793, 794, 795, 796, 798, 799, 800, + 801, 802, 803, 804, 806, 807, 808, 811, 812, 814, + 815, 816, 817, 818, 819, 820, 821, 823, 824, 825, + 826, 828, 829, 830, 831, 832, 833, 834, 836, 838, + 839, 840, 841, 842, 845, 848, 851, 852, 853, 854, - 859, 820, 861, 862, 863, 864, 866, 867, 868, 869, - 871, 872, 873, 874, 875, 880, 881, 882, 883, 884, - 885, 886, 887, 889, 892, 894, 895, 896, 897, 898, - 902, 903, 904, 905, 906, 907, 909, 910, 916, 917, - 918, 919, 920, 922, 924, 925, 926, 929, 931, 933, - 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, - 946, 947, 948, 949, 950, 952, 955, 957, 958, 959, - 960, 965, 968, 970, 971, 972, 973, 974, 975, 978, - 979, 983, 985, 993, 994, 995, 999, 1001, 1006, 1007, - 1008, 1009, 1010, 1015, 1016, 1019, 1020, 1021, 1022, 1023, + 855, 858, 859, 861, 862, 863, 824, 865, 866, 867, + 868, 870, 871, 872, 873, 874, 876, 877, 878, 879, + 880, 885, 886, 887, 888, 889, 890, 891, 892, 894, + 897, 899, 900, 901, 902, 903, 907, 908, 909, 910, + 911, 912, 914, 915, 921, 922, 923, 924, 925, 927, + 929, 930, 931, 934, 936, 938, 939, 940, 941, 942, + 943, 944, 945, 946, 947, 948, 949, 952, 953, 954, + 955, 956, 958, 961, 963, 964, 965, 966, 971, 974, + 976, 977, 978, 979, 980, 981, 984, 985, 989, 991, + 993, 1000, 1001, 1002, 1006, 1008, 1013, 1014, 1015, 1016, - 1024, 1025, 1027, 1030, 1031, 1032, 1035, 1036, 1037, 1038, - 1039, 1040, 1041, 1046, 1046, 1046, 1046, 1046, 1046, 1047, - 1047, 1048, 1048, 717, 1048, 1048, 1048, 1049, 1049, 1049, - 1050, 1050, 1050, 1050, 1050, 1050, 1051, 1051, 1051, 1051, - 1052, 1052, 716, 1052, 1052, 1052, 715, 714, 712, 711, - 710, 709, 708, 707, 706, 705, 704, 700, 699, 697, - 696, 695, 694, 693, 692, 691, 690, 687, 686, 685, - 684, 683, 682, 681, 679, 677, 676, 675, 674, 673, - 672, 671, 670, 669, 668, 667, 666, 665, 663, 662, - 661, 660, 659, 658, 657, 655, 654, 653, 652, 651, + 1017, 1022, 1023, 1024, 1027, 1028, 1029, 1030, 1031, 1032, + 1033, 1034, 1036, 1039, 1040, 1041, 1042, 1045, 1046, 1047, + 1049, 1050, 1051, 1052, 1057, 1057, 1057, 1057, 1057, 1057, + 1058, 1058, 1059, 1059, 718, 1059, 1059, 1059, 1060, 1060, + 1060, 1061, 1061, 1061, 1061, 1061, 1061, 1062, 1062, 1062, + 1062, 1063, 1063, 717, 1063, 1063, 1063, 715, 714, 713, + 712, 711, 710, 709, 708, 707, 703, 702, 700, 699, + 698, 697, 696, 695, 694, 693, 690, 689, 688, 687, + 686, 685, 684, 682, 680, 679, 678, 677, 676, 675, + 674, 673, 672, 671, 670, 669, 668, 666, 665, 664, - 650, 649, 648, 647, 646, 645, 644, 643, 642, 641, - 639, 638, 637, 636, 635, 634, 633, 632, 631, 628, - 627, 626, 625, 624, 623, 622, 621, 620, 618, 617, - 616, 615, 614, 612, 611, 609, 608, 607, 604, 603, - 602, 601, 600, 598, 597, 596, 595, 594, 593, 592, - 591, 590, 588, 587, 586, 585, 583, 582, 580, 579, - 578, 576, 575, 574, 573, 572, 570, 565, 563, 560, - 558, 557, 556, 554, 553, 552, 551, 550, 549, 548, - 547, 546, 545, 544, 543, 542, 541, 540, 539, 538, - 537, 535, 533, 532, 531, 530, 529, 527, 526, 525, + 663, 662, 661, 660, 658, 657, 656, 655, 654, 653, + 652, 651, 650, 649, 648, 647, 646, 645, 644, 643, + 641, 640, 639, 638, 637, 636, 635, 634, 633, 630, + 629, 628, 627, 626, 625, 624, 623, 622, 620, 619, + 618, 617, 616, 614, 613, 611, 610, 609, 606, 605, + 604, 603, 602, 600, 599, 598, 597, 596, 595, 594, + 593, 592, 590, 589, 588, 587, 585, 584, 582, 581, + 580, 578, 577, 576, 575, 574, 572, 567, 565, 562, + 560, 559, 558, 556, 555, 554, 553, 552, 551, 550, + 549, 548, 547, 546, 545, 544, 543, 542, 541, 540, - 524, 522, 521, 520, 519, 518, 517, 516, 515, 512, - 511, 510, 509, 507, 506, 504, 503, 502, 501, 500, - 499, 498, 497, 495, 494, 493, 492, 491, 490, 488, - 487, 486, 485, 484, 480, 479, 478, 477, 476, 475, - 474, 473, 472, 471, 469, 468, 467, 466, 465, 464, - 463, 462, 461, 460, 459, 458, 455, 453, 452, 451, - 450, 449, 447, 446, 445, 444, 443, 442, 440, 438, - 436, 435, 434, 433, 431, 430, 429, 428, 426, 425, - 424, 423, 421, 419, 417, 416, 415, 413, 412, 411, - 405, 400, 399, 398, 397, 396, 395, 394, 393, 391, + 539, 537, 535, 534, 533, 532, 531, 529, 528, 527, + 526, 524, 523, 522, 521, 520, 519, 518, 517, 514, + 513, 512, 511, 509, 508, 506, 505, 504, 503, 502, + 501, 500, 499, 498, 496, 495, 494, 493, 492, 491, + 489, 488, 487, 486, 485, 481, 480, 479, 478, 477, + 476, 475, 474, 473, 472, 470, 469, 468, 467, 466, + 465, 464, 463, 462, 461, 460, 459, 456, 454, 453, + 452, 451, 450, 448, 447, 446, 445, 444, 443, 441, + 439, 437, 436, 435, 434, 432, 431, 430, 429, 427, + 426, 425, 424, 422, 420, 418, 417, 416, 414, 413, - 390, 389, 388, 387, 385, 384, 383, 382, 381, 380, - 379, 378, 377, 376, 374, 373, 372, 371, 370, 369, - 368, 367, 365, 363, 362, 361, 360, 359, 357, 356, - 355, 354, 353, 352, 351, 349, 348, 347, 346, 344, - 343, 342, 341, 339, 338, 337, 336, 335, 334, 332, - 331, 329, 328, 327, 326, 325, 324, 323, 321, 320, - 319, 318, 317, 316, 315, 314, 313, 312, 311, 309, - 308, 307, 306, 305, 304, 303, 302, 301, 299, 297, - 295, 294, 293, 292, 291, 290, 289, 288, 287, 286, - 285, 284, 283, 282, 281, 280, 279, 278, 277, 276, + 412, 406, 401, 400, 399, 398, 397, 396, 395, 394, + 392, 391, 390, 389, 388, 386, 385, 384, 383, 382, + 381, 380, 379, 378, 377, 375, 374, 373, 372, 371, + 370, 369, 368, 366, 364, 363, 362, 361, 360, 358, + 357, 356, 355, 354, 353, 352, 350, 349, 348, 347, + 345, 344, 343, 342, 341, 339, 338, 337, 336, 335, + 334, 332, 331, 329, 328, 327, 326, 325, 324, 323, + 321, 320, 319, 318, 317, 316, 315, 314, 313, 312, + 311, 309, 308, 307, 306, 305, 304, 303, 302, 301, + 299, 297, 295, 294, 293, 292, 291, 290, 289, 288, - 275, 274, 273, 272, 271, 270, 269, 268, 267, 266, - 265, 264, 262, 261, 260, 259, 258, 257, 256, 255, - 254, 253, 252, 251, 250, 249, 248, 247, 244, 234, - 227, 223, 218, 217, 214, 210, 209, 208, 207, 203, - 202, 201, 200, 197, 196, 195, 194, 193, 192, 190, - 189, 188, 187, 184, 181, 180, 179, 178, 177, 172, - 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, - 160, 159, 158, 157, 156, 155, 154, 153, 151, 150, - 149, 148, 147, 143, 142, 139, 138, 137, 136, 135, - 134, 132, 130, 128, 127, 126, 125, 124, 123, 122, + 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, + 277, 276, 275, 274, 273, 272, 271, 270, 269, 268, + 267, 266, 265, 264, 262, 261, 260, 259, 258, 257, + 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, + 244, 234, 227, 223, 218, 217, 214, 210, 209, 208, + 207, 203, 202, 201, 200, 197, 196, 195, 194, 193, + 192, 190, 189, 188, 187, 184, 181, 180, 179, 177, + 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, + 162, 160, 159, 158, 157, 156, 155, 154, 153, 151, + 150, 149, 148, 147, 143, 142, 139, 138, 137, 136, - 121, 120, 118, 117, 116, 115, 113, 112, 111, 110, - 109, 108, 107, 105, 103, 98, 95, 93, 92, 91, - 88, 76, 65, 62, 60, 59, 54, 48, 45, 37, - 33, 32, 21, 20, 19, 18, 15, 14, 13, 11, - 10, 9, 5, 1045, 1045, 1045, 1045, 1045, 1045, 1045, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + 135, 134, 132, 130, 128, 127, 126, 125, 124, 123, + 122, 121, 120, 118, 117, 116, 115, 113, 112, 111, + 110, 109, 108, 107, 105, 103, 98, 95, 93, 92, + 91, 88, 76, 65, 62, 60, 59, 54, 48, 45, + 37, 33, 32, 21, 20, 19, 18, 15, 14, 13, + 11, 10, 9, 5, 1056, 1056, 1056, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, - 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045 + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, + 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; +extern int yy_flex_debug; +int yy_flex_debug = 0; + /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ @@ -997,7 +1099,6 @@ static char *yy_last_accepting_cpos; #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lev_comp.l" -#define INITIAL 0 #line 2 "lev_comp.l" /* NetHack 3.6 lev_comp.l $NHDT-Date: 1432512785 2015/05/25 00:13:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.19 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ @@ -1095,9 +1196,54 @@ FILE *orig_yyin = NULL; #define ST_RET(x) do { savetoken(yytext); return x; } while (0); #define ST_RETF(y, x) do { savetoken(yytext); y; return x; } while (0); + +#line 1201 "lex.yy.c" + +#define INITIAL 0 #define MAPC 1 -#line 1101 "lex.yy.c" +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +yy_size_t yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1105,79 +1251,48 @@ FILE *orig_yyin = NULL; #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); +extern "C" int yywrap (void ); #else -extern int yywrap YY_PROTO(( void )); +extern int yywrap (void ); #endif #endif -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - + static void yyunput (int c,char *buf_ptr ); + #ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); +static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT + #ifdef __cplusplus -static int yyinput YY_PROTO(( void )); +static int yyinput (void ); #else -static int input YY_PROTO(( void )); -#endif +static int input (void ); #endif -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ - #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1185,9 +1300,10 @@ YY_MALLOC_DECL */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ - int c = '*', n; \ + int c = '*'; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1197,9 +1313,22 @@ YY_MALLOC_DECL YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -1220,12 +1349,18 @@ YY_MALLOC_DECL #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif +/* end tables serialization structures and prototypes */ + /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif +#define YY_DECL_IS_OURS 1 + +extern int yylex (void); + +#define YY_DECL int yylex (void) +#endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. @@ -1241,30 +1376,28 @@ YY_MALLOC_DECL #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION +/** The main scanner function which does all the work. + */ YY_DECL - { +{ register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - -#line 103 "lev_comp.l" - -#line 1257 "lex.yy.c" - - if ( yy_init ) + + if ( !(yy_init) ) { - yy_init = 0; + (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! yy_start ) - yy_start = 1; /* first start state */ + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; @@ -1272,69 +1405,74 @@ YY_DECL if ( ! yyout ) yyout = stdout; - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); } + yy_load_buffer_state( ); + } + + { +#line 103 "lev_comp.l" + +#line 1421 "lex.yy.c" + while ( 1 ) /* loops until end-of-file is reached */ { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); /* Support of yytext. */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; - yy_current_state = yy_start; + yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1046 ) + if ( yy_current_state >= 1057 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 1244 ); + while ( yy_base[yy_current_state] != 1255 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; - do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: @@ -1351,6 +1489,7 @@ YY_RULE_SETUP } YY_BREAK case 2: +/* rule 2 can match eol */ YY_RULE_SETUP #line 113 "lev_comp.l" { @@ -1366,6 +1505,7 @@ YY_RULE_SETUP } YY_BREAK case 3: +/* rule 3 can match eol */ YY_RULE_SETUP #line 124 "lev_comp.l" { savetoken(yytext); newline(); } @@ -1426,6 +1566,7 @@ YY_RULE_SETUP ST_RET(GEOMETRY_ID); YY_BREAK case 15: +/* rule 15 can match eol */ YY_RULE_SETUP #line 136 "lev_comp.l" { savetoken(yytext); BEGIN(MAPC); newline(); } @@ -2243,6 +2384,11 @@ YY_RULE_SETUP case 178: YY_RULE_SETUP #line 299 "lev_comp.l" +{ savetoken(yytext); yylval.i=CHECK_INACCESSIBLES; return FLAG_TYPE; } + YY_BREAK +case 179: +YY_RULE_SETUP +#line 300 "lev_comp.l" { char *p = strchr(yytext, 'd'); savetoken(yytext); if (p) { @@ -2254,60 +2400,56 @@ YY_RULE_SETUP return DICE; } YY_BREAK -case 179: +case 180: YY_RULE_SETUP -#line 309 "lev_comp.l" +#line 310 "lev_comp.l" { savetoken(yytext); yylval.i = atoi(yytext + 1); if (yylval.i < 0 || yylval.i > 100) lc_error("Unexpected percentile '%li%%'", yylval.i); return PERCENT; } YY_BREAK -case 180: -YY_RULE_SETUP -#line 313 "lev_comp.l" -{ savetoken(yytext); yylval.i=atoi(yytext); return MINUS_INTEGER; } - YY_BREAK case 181: YY_RULE_SETUP #line 314 "lev_comp.l" -{ savetoken(yytext); yylval.i=atoi(yytext); return PLUS_INTEGER; } +{ savetoken(yytext); yylval.i=atoi(yytext); return MINUS_INTEGER; } YY_BREAK case 182: YY_RULE_SETUP #line 315 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return PLUS_INTEGER; } + YY_BREAK +case 183: +YY_RULE_SETUP +#line 316 "lev_comp.l" { savetoken(yytext); yylval.i = atoi(yytext); if (yylval.i < 0 || yylval.i > 100) lc_error("Unexpected percentile '%li%%'", yylval.i); return SPERCENT; } YY_BREAK -case 183: -YY_RULE_SETUP -#line 319 "lev_comp.l" -{ savetoken(yytext); yylval.i=atoi(yytext); return INTEGER; } - YY_BREAK case 184: YY_RULE_SETUP #line 320 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return INTEGER; } + YY_BREAK +case 185: +/* rule 185 can match eol */ +YY_RULE_SETUP +#line 321 "lev_comp.l" { savetoken(yytext); yytext[yyleng-1] = 0; /* Discard the trailing \" */ yylval.map = (char *) alloc(strlen(yytext+1)+1); Strcpy(yylval.map, yytext+1); /* Discard the first \" */ return STRING; } YY_BREAK -case 185: -YY_RULE_SETUP -#line 325 "lev_comp.l" -{ savetoken(yytext); return handle_varstring_check(); } - YY_BREAK case 186: YY_RULE_SETUP #line 326 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JE; return COMPARE_TYPE; } +{ savetoken(yytext); return handle_varstring_check(); } YY_BREAK case 187: YY_RULE_SETUP #line 327 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } +{ savetoken(yytext); yylval.i = SPO_JE; return COMPARE_TYPE; } YY_BREAK case 188: YY_RULE_SETUP @@ -2317,59 +2459,65 @@ YY_RULE_SETUP case 189: YY_RULE_SETUP #line 329 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JLE; return COMPARE_TYPE; } +{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } YY_BREAK case 190: YY_RULE_SETUP #line 330 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JGE; return COMPARE_TYPE; } +{ savetoken(yytext); yylval.i = SPO_JLE; return COMPARE_TYPE; } YY_BREAK case 191: YY_RULE_SETUP #line 331 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JL; return COMPARE_TYPE; } +{ savetoken(yytext); yylval.i = SPO_JGE; return COMPARE_TYPE; } YY_BREAK case 192: YY_RULE_SETUP #line 332 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JG; return COMPARE_TYPE; } +{ savetoken(yytext); yylval.i = SPO_JL; return COMPARE_TYPE; } YY_BREAK case 193: YY_RULE_SETUP #line 333 "lev_comp.l" -{ newline(); } +{ savetoken(yytext); yylval.i = SPO_JG; return COMPARE_TYPE; } YY_BREAK case 194: +/* rule 194 can match eol */ YY_RULE_SETUP #line 334 "lev_comp.l" -{ advancepos(yytext); } +{ newline(); } YY_BREAK case 195: YY_RULE_SETUP #line 335 "lev_comp.l" -{ savetoken(yytext); yylval.i = yytext[2]; return CHAR; } +{ advancepos(yytext); } YY_BREAK case 196: YY_RULE_SETUP #line 336 "lev_comp.l" -{ savetoken(yytext); yylval.i = yytext[1]; return CHAR; } +{ savetoken(yytext); yylval.i = yytext[2]; return CHAR; } YY_BREAK case 197: YY_RULE_SETUP #line 337 "lev_comp.l" -ST_RET(UNKNOWN_TYPE); +{ savetoken(yytext); yylval.i = yytext[1]; return CHAR; } YY_BREAK case 198: YY_RULE_SETUP #line 338 "lev_comp.l" -{ savetoken(yytext); return yytext[0]; } +ST_RET(UNKNOWN_TYPE); YY_BREAK case 199: YY_RULE_SETUP #line 339 "lev_comp.l" +{ savetoken(yytext); return yytext[0]; } + YY_BREAK +case 200: +YY_RULE_SETUP +#line 340 "lev_comp.l" ECHO; YY_BREAK -#line 2373 "lex.yy.c" +#line 2521 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(MAPC): yyterminate(); @@ -2377,26 +2525,26 @@ case YY_STATE_EOF(MAPC): case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our + * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position @@ -2406,13 +2554,13 @@ case YY_STATE_EOF(MAPC): * end-of-buffer state). Contrast this with the test * in input(). */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have @@ -2425,30 +2573,30 @@ case YY_STATE_EOF(MAPC): yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; + yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); goto yy_find_action; } } - else switch ( yy_get_next_buffer() ) + else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { - yy_did_buffer_switch_on_eof = 0; + (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap() ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -2459,7 +2607,7 @@ case YY_STATE_EOF(MAPC): * YY_NULL, it'll still work - another * YY_NULL will get returned. */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; @@ -2467,30 +2615,30 @@ case YY_STATE_EOF(MAPC): else { - if ( ! yy_did_buffer_switch_on_eof ) + if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; @@ -2501,8 +2649,8 @@ case YY_STATE_EOF(MAPC): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of yylex */ - + } /* end of user's declarations */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -2511,21 +2659,20 @@ case YY_STATE_EOF(MAPC): * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); - if ( yy_current_buffer->yy_fill_buffer == 0 ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. @@ -2545,38 +2692,34 @@ static int yy_get_next_buffer() /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); + (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2585,8 +2728,7 @@ static int yy_get_next_buffer() b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -2596,35 +2738,35 @@ static int yy_get_next_buffer() YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = yy_current_buffer->yy_buf_size - + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; -#endif + } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); - yy_current_buffer->yy_n_chars = yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - if ( yy_n_chars == 0 ) + if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); + yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } @@ -2632,153 +2774,146 @@ static int yy_get_next_buffer() else ret_val = EOB_ACT_CONTINUE_SCAN; - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} /* yy_get_previous_state - get the state just before the EOB char was reached */ -static yy_state_type yy_get_previous_state() - { + static yy_state_type yy_get_previous_state (void) +{ register yy_state_type yy_current_state; register char *yy_cp; - - yy_current_state = yy_start; + + yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1046 ) + if ( yy_current_state >= 1057 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; - } - +} /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; + register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1046 ) + if ( yy_current_state >= 1057 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 1045); + yy_is_jam = (yy_current_state == 1056); - return yy_is_jam ? 0 : yy_current_state; - } + return yy_is_jam ? 0 : yy_current_state; +} - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; + register yy_size_t number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while ( source > yy_current_buffer->yy_ch_buf ) + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - +#ifndef YY_NO_INPUT #ifdef __cplusplus -static int yyinput() + static int yyinput (void) #else -static int input() + static int input (void) #endif - { + +{ int c; + + *(yy_c_buf_p) = (yy_hold_char); - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ - *yy_c_buf_p = '\0'; + *(yy_c_buf_p) = '\0'; else { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); - switch ( yy_get_next_buffer() ) + switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() @@ -2792,16 +2927,16 @@ static int input() */ /* Reset buffer status. */ - yyrestart( yyin ); + yyrestart(yyin ); - /* fall through */ + /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap() ) + if ( yywrap( ) ) return EOF; - if ( ! yy_did_buffer_switch_on_eof ) + if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); @@ -2811,91 +2946,94 @@ static int input() } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; + (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); - yy_current_buffer->yy_at_bol = (c == '\n'); + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); } + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); +} -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) return; - if ( yy_current_buffer ) + if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - yy_current_buffer = new_buffer; - yy_load_buffer_state(); + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ - yy_did_buffer_switch_on_eof = 1; - } + (yy_did_buffer_switch_on_eof) = 1; +} +static void yy_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +{ YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2904,80 +3042,71 @@ int size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer( b, file ); + yy_init_buffer(b,file ); return b; - } +} - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); + yyfree((void *) b->yy_ch_buf ); - yy_flex_free( (void *) b ); - } + yyfree((void *) b ); +} +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); +{ + int oerrno = errno; + + yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; b->yy_n_chars = 0; @@ -2994,29 +3123,125 @@ YY_BUFFER_STATE b; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == yy_current_buffer ) - yy_load_buffer_state(); + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (void) +{ + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; } + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +{ YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); @@ -3030,56 +3255,51 @@ yy_size_t size; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer( b ); + yy_switch_to_buffer(b ); return b; - } -#endif +} +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +{ + + return yy_scan_bytes(yystr,strlen(yystr) ); +} -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +{ YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; - + yy_size_t i; + /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); + n = _yybytes_len + 2; + buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer( buf, n ); + b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); @@ -3089,78 +3309,17 @@ int len; b->yy_is_our_buffer = 1; return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif +} #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); - } - - +} /* Redefine yyless() so it works in section 3 code. */ @@ -3169,68 +3328,177 @@ char msg[]; do \ { \ /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ } \ while ( 0 ) +/* Accessor methods (get/set functions) to struct members. */ -/* Internal utility routines. */ +/** Get the current line number. + * + */ +int yyget_lineno (void) +{ + + return yylineno; +} + +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} + +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} + +/** Get the length of the current token. + * + */ +yy_size_t yyget_leng (void) +{ + return yyleng; +} + +/** Get the current token. + * + */ + +char *yyget_text (void) +{ + return yytext; +} + +/** Set the current line number. + * @param line_number + * + */ +void yyset_lineno (int line_number ) +{ + + yylineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * in_str ) +{ + yyin = in_str ; +} + +void yyset_out (FILE * out_str ) +{ + yyout = out_str ; +} + +int yyget_debug (void) +{ + return yy_flex_debug; +} + +void yyset_debug (int bdebug ) +{ + yy_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = (FILE *) 0; + yyout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ #ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; - } +} #endif #ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { +static int yy_flex_strlen (yyconst char * s ) +{ register int n; for ( n = 0; s[n]; ++n ) ; return n; - } +} #endif - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { +void *yyalloc (yy_size_t size ) +{ return (void *) malloc( size ); - } +} -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { +void *yyrealloc (void * ptr, yy_size_t size ) +{ /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -3239,27 +3507,18 @@ yy_size_t size; * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); - } +} -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif #line 339 "lev_comp.l" + #ifdef AMIGA long *alloc(n) unsigned n; @@ -3335,3 +3594,4 @@ char *s; } /*lev_comp.l*/ + diff --git a/sys/share/lev_yacc.c b/sys/share/lev_yacc.c index 970dd96da..621684bd2 100644 --- a/sys/share/lev_yacc.c +++ b/sys/share/lev_yacc.c @@ -1,21 +1,19 @@ +/* A Bison parser, made by GNU Bison 3.0.2. */ -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -28,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -46,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.1" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -60,15 +58,11 @@ /* Pull parsers. */ #define YYPULL 1 -/* Using locations. */ -#define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ - -/* Line 189 of yacc.c */ -#line 1 "lev_comp.y" +#line 1 "lev_comp.y" /* yacc.c:339 */ /* NetHack 3.6 lev_comp.y $NHDT-Date: 1432512785 2015/05/25 00:13:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.16 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ @@ -213,14 +207,15 @@ extern const char *fname; extern char curr_token[512]; +#line 211 "y.tab.c" /* yacc.c:339 */ -/* Line 189 of yacc.c */ -#line 219 "y.tab.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -230,193 +225,198 @@ extern char curr_token[512]; # define YYERROR_VERBOSE 0 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 +/* In a future release of Bison, this section will be replaced + by #include "y.tab.h". */ +#ifndef YY_YY_Y_TAB_H_INCLUDED +# define YY_YY_Y_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; #endif - -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - CHAR = 258, - INTEGER = 259, - BOOLEAN = 260, - PERCENT = 261, - SPERCENT = 262, - MINUS_INTEGER = 263, - PLUS_INTEGER = 264, - MAZE_GRID_ID = 265, - SOLID_FILL_ID = 266, - MINES_ID = 267, - ROGUELEV_ID = 268, - MESSAGE_ID = 269, - MAZE_ID = 270, - LEVEL_ID = 271, - LEV_INIT_ID = 272, - GEOMETRY_ID = 273, - NOMAP_ID = 274, - OBJECT_ID = 275, - COBJECT_ID = 276, - MONSTER_ID = 277, - TRAP_ID = 278, - DOOR_ID = 279, - DRAWBRIDGE_ID = 280, - object_ID = 281, - monster_ID = 282, - terrain_ID = 283, - MAZEWALK_ID = 284, - WALLIFY_ID = 285, - REGION_ID = 286, - FILLING = 287, - IRREGULAR = 288, - JOINED = 289, - ALTAR_ID = 290, - LADDER_ID = 291, - STAIR_ID = 292, - NON_DIGGABLE_ID = 293, - NON_PASSWALL_ID = 294, - ROOM_ID = 295, - PORTAL_ID = 296, - TELEPRT_ID = 297, - BRANCH_ID = 298, - LEV = 299, - MINERALIZE_ID = 300, - CORRIDOR_ID = 301, - GOLD_ID = 302, - ENGRAVING_ID = 303, - FOUNTAIN_ID = 304, - POOL_ID = 305, - SINK_ID = 306, - NONE = 307, - RAND_CORRIDOR_ID = 308, - DOOR_STATE = 309, - LIGHT_STATE = 310, - CURSE_TYPE = 311, - ENGRAVING_TYPE = 312, - DIRECTION = 313, - RANDOM_TYPE = 314, - RANDOM_TYPE_BRACKET = 315, - A_REGISTER = 316, - ALIGNMENT = 317, - LEFT_OR_RIGHT = 318, - CENTER = 319, - TOP_OR_BOT = 320, - ALTAR_TYPE = 321, - UP_OR_DOWN = 322, - SUBROOM_ID = 323, - NAME_ID = 324, - FLAGS_ID = 325, - FLAG_TYPE = 326, - MON_ATTITUDE = 327, - MON_ALERTNESS = 328, - MON_APPEARANCE = 329, - ROOMDOOR_ID = 330, - IF_ID = 331, - ELSE_ID = 332, - TERRAIN_ID = 333, - HORIZ_OR_VERT = 334, - REPLACE_TERRAIN_ID = 335, - EXIT_ID = 336, - SHUFFLE_ID = 337, - QUANTITY_ID = 338, - BURIED_ID = 339, - LOOP_ID = 340, - FOR_ID = 341, - TO_ID = 342, - SWITCH_ID = 343, - CASE_ID = 344, - BREAK_ID = 345, - DEFAULT_ID = 346, - ERODED_ID = 347, - TRAPPED_STATE = 348, - RECHARGED_ID = 349, - INVIS_ID = 350, - GREASED_ID = 351, - FEMALE_ID = 352, - CANCELLED_ID = 353, - REVIVED_ID = 354, - AVENGE_ID = 355, - FLEEING_ID = 356, - BLINDED_ID = 357, - PARALYZED_ID = 358, - STUNNED_ID = 359, - CONFUSED_ID = 360, - SEENTRAPS_ID = 361, - ALL_ID = 362, - MONTYPE_ID = 363, - GRAVE_ID = 364, - ERODEPROOF_ID = 365, - FUNCTION_ID = 366, - MSG_OUTPUT_TYPE = 367, - COMPARE_TYPE = 368, - UNKNOWN_TYPE = 369, - rect_ID = 370, - fillrect_ID = 371, - line_ID = 372, - randline_ID = 373, - grow_ID = 374, - selection_ID = 375, - flood_ID = 376, - rndcoord_ID = 377, - circle_ID = 378, - ellipse_ID = 379, - filter_ID = 380, - complement_ID = 381, - gradient_ID = 382, - GRADIENT_TYPE = 383, - LIMITED = 384, - HUMIDITY_TYPE = 385, - STRING = 386, - MAP_ID = 387, - NQSTRING = 388, - VARSTRING = 389, - CFUNC = 390, - CFUNC_INT = 391, - CFUNC_STR = 392, - CFUNC_COORD = 393, - CFUNC_REGION = 394, - VARSTRING_INT = 395, - VARSTRING_INT_ARRAY = 396, - VARSTRING_STRING = 397, - VARSTRING_STRING_ARRAY = 398, - VARSTRING_VAR = 399, - VARSTRING_VAR_ARRAY = 400, - VARSTRING_COORD = 401, - VARSTRING_COORD_ARRAY = 402, - VARSTRING_REGION = 403, - VARSTRING_REGION_ARRAY = 404, - VARSTRING_MAPCHAR = 405, - VARSTRING_MAPCHAR_ARRAY = 406, - VARSTRING_MONST = 407, - VARSTRING_MONST_ARRAY = 408, - VARSTRING_OBJ = 409, - VARSTRING_OBJ_ARRAY = 410, - VARSTRING_SEL = 411, - VARSTRING_SEL_ARRAY = 412, - METHOD_INT = 413, - METHOD_INT_ARRAY = 414, - METHOD_STRING = 415, - METHOD_STRING_ARRAY = 416, - METHOD_VAR = 417, - METHOD_VAR_ARRAY = 418, - METHOD_COORD = 419, - METHOD_COORD_ARRAY = 420, - METHOD_REGION = 421, - METHOD_REGION_ARRAY = 422, - METHOD_MAPCHAR = 423, - METHOD_MAPCHAR_ARRAY = 424, - METHOD_MONST = 425, - METHOD_MONST_ARRAY = 426, - METHOD_OBJ = 427, - METHOD_OBJ_ARRAY = 428, - METHOD_SEL = 429, - METHOD_SEL_ARRAY = 430, - DICE = 431 - }; + enum yytokentype + { + CHAR = 258, + INTEGER = 259, + BOOLEAN = 260, + PERCENT = 261, + SPERCENT = 262, + MINUS_INTEGER = 263, + PLUS_INTEGER = 264, + MAZE_GRID_ID = 265, + SOLID_FILL_ID = 266, + MINES_ID = 267, + ROGUELEV_ID = 268, + MESSAGE_ID = 269, + MAZE_ID = 270, + LEVEL_ID = 271, + LEV_INIT_ID = 272, + GEOMETRY_ID = 273, + NOMAP_ID = 274, + OBJECT_ID = 275, + COBJECT_ID = 276, + MONSTER_ID = 277, + TRAP_ID = 278, + DOOR_ID = 279, + DRAWBRIDGE_ID = 280, + object_ID = 281, + monster_ID = 282, + terrain_ID = 283, + MAZEWALK_ID = 284, + WALLIFY_ID = 285, + REGION_ID = 286, + FILLING = 287, + IRREGULAR = 288, + JOINED = 289, + ALTAR_ID = 290, + LADDER_ID = 291, + STAIR_ID = 292, + NON_DIGGABLE_ID = 293, + NON_PASSWALL_ID = 294, + ROOM_ID = 295, + PORTAL_ID = 296, + TELEPRT_ID = 297, + BRANCH_ID = 298, + LEV = 299, + MINERALIZE_ID = 300, + CORRIDOR_ID = 301, + GOLD_ID = 302, + ENGRAVING_ID = 303, + FOUNTAIN_ID = 304, + POOL_ID = 305, + SINK_ID = 306, + NONE = 307, + RAND_CORRIDOR_ID = 308, + DOOR_STATE = 309, + LIGHT_STATE = 310, + CURSE_TYPE = 311, + ENGRAVING_TYPE = 312, + DIRECTION = 313, + RANDOM_TYPE = 314, + RANDOM_TYPE_BRACKET = 315, + A_REGISTER = 316, + ALIGNMENT = 317, + LEFT_OR_RIGHT = 318, + CENTER = 319, + TOP_OR_BOT = 320, + ALTAR_TYPE = 321, + UP_OR_DOWN = 322, + SUBROOM_ID = 323, + NAME_ID = 324, + FLAGS_ID = 325, + FLAG_TYPE = 326, + MON_ATTITUDE = 327, + MON_ALERTNESS = 328, + MON_APPEARANCE = 329, + ROOMDOOR_ID = 330, + IF_ID = 331, + ELSE_ID = 332, + TERRAIN_ID = 333, + HORIZ_OR_VERT = 334, + REPLACE_TERRAIN_ID = 335, + EXIT_ID = 336, + SHUFFLE_ID = 337, + QUANTITY_ID = 338, + BURIED_ID = 339, + LOOP_ID = 340, + FOR_ID = 341, + TO_ID = 342, + SWITCH_ID = 343, + CASE_ID = 344, + BREAK_ID = 345, + DEFAULT_ID = 346, + ERODED_ID = 347, + TRAPPED_STATE = 348, + RECHARGED_ID = 349, + INVIS_ID = 350, + GREASED_ID = 351, + FEMALE_ID = 352, + CANCELLED_ID = 353, + REVIVED_ID = 354, + AVENGE_ID = 355, + FLEEING_ID = 356, + BLINDED_ID = 357, + PARALYZED_ID = 358, + STUNNED_ID = 359, + CONFUSED_ID = 360, + SEENTRAPS_ID = 361, + ALL_ID = 362, + MONTYPE_ID = 363, + GRAVE_ID = 364, + ERODEPROOF_ID = 365, + FUNCTION_ID = 366, + MSG_OUTPUT_TYPE = 367, + COMPARE_TYPE = 368, + UNKNOWN_TYPE = 369, + rect_ID = 370, + fillrect_ID = 371, + line_ID = 372, + randline_ID = 373, + grow_ID = 374, + selection_ID = 375, + flood_ID = 376, + rndcoord_ID = 377, + circle_ID = 378, + ellipse_ID = 379, + filter_ID = 380, + complement_ID = 381, + gradient_ID = 382, + GRADIENT_TYPE = 383, + LIMITED = 384, + HUMIDITY_TYPE = 385, + STRING = 386, + MAP_ID = 387, + NQSTRING = 388, + VARSTRING = 389, + CFUNC = 390, + CFUNC_INT = 391, + CFUNC_STR = 392, + CFUNC_COORD = 393, + CFUNC_REGION = 394, + VARSTRING_INT = 395, + VARSTRING_INT_ARRAY = 396, + VARSTRING_STRING = 397, + VARSTRING_STRING_ARRAY = 398, + VARSTRING_VAR = 399, + VARSTRING_VAR_ARRAY = 400, + VARSTRING_COORD = 401, + VARSTRING_COORD_ARRAY = 402, + VARSTRING_REGION = 403, + VARSTRING_REGION_ARRAY = 404, + VARSTRING_MAPCHAR = 405, + VARSTRING_MAPCHAR_ARRAY = 406, + VARSTRING_MONST = 407, + VARSTRING_MONST_ARRAY = 408, + VARSTRING_OBJ = 409, + VARSTRING_OBJ_ARRAY = 410, + VARSTRING_SEL = 411, + VARSTRING_SEL_ARRAY = 412, + METHOD_INT = 413, + METHOD_INT_ARRAY = 414, + METHOD_STRING = 415, + METHOD_STRING_ARRAY = 416, + METHOD_VAR = 417, + METHOD_VAR_ARRAY = 418, + METHOD_COORD = 419, + METHOD_COORD_ARRAY = 420, + METHOD_REGION = 421, + METHOD_REGION_ARRAY = 422, + METHOD_MAPCHAR = 423, + METHOD_MAPCHAR_ARRAY = 424, + METHOD_MONST = 425, + METHOD_MONST_ARRAY = 426, + METHOD_OBJ = 427, + METHOD_OBJ_ARRAY = 428, + METHOD_SEL = 429, + METHOD_SEL_ARRAY = 430, + DICE = 431 + }; #endif /* Tokens. */ #define CHAR 258 @@ -594,15 +594,12 @@ extern char curr_token[512]; #define METHOD_SEL_ARRAY 430 #define DICE 431 - - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - -/* Line 214 of yacc.c */ -#line 147 "lev_comp.y" +#line 147 "lev_comp.y" /* yacc.c:355 */ long i; char* map; @@ -639,22 +636,22 @@ typedef union YYSTYPE char *varstr; } meth; - - -/* Line 214 of yacc.c */ -#line 646 "y.tab.c" -} YYSTYPE; +#line 640 "y.tab.c" /* yacc.c:355 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +extern YYSTYPE yylval; + +int yyparse (void); + +#endif /* !YY_YY_Y_TAB_H_INCLUDED */ + /* Copy the second part of user declarations. */ - -/* Line 264 of yacc.c */ -#line 658 "y.tab.c" +#line 655 "y.tab.c" /* yacc.c:358 */ #ifdef short # undef short @@ -668,11 +665,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -692,8 +686,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -704,41 +697,70 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YYUSE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + #if ! defined yyoverflow || YYERROR_VERBOSE @@ -757,11 +779,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -769,8 +791,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -784,25 +806,23 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -812,7 +832,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -830,42 +850,46 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 9 /* YYLAST -- Last index in YYTABLE. */ @@ -877,17 +901,19 @@ union yyalloc #define YYNNTS 160 /* YYNRULES -- Number of rules. */ #define YYNRULES 406 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 866 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 431 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -937,197 +963,7 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 4, 6, 8, 11, 15, 19, 25, - 27, 29, 35, 41, 45, 62, 63, 66, 67, 70, - 71, 74, 76, 78, 79, 83, 87, 89, 90, 93, - 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, - 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, - 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, - 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, - 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, - 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, - 217, 219, 221, 223, 225, 227, 229, 231, 235, 239, - 245, 249, 255, 261, 267, 271, 275, 281, 287, 293, - 301, 309, 317, 323, 325, 329, 331, 335, 337, 341, - 343, 347, 349, 353, 355, 359, 361, 365, 366, 367, - 376, 381, 383, 384, 386, 388, 394, 398, 399, 400, - 410, 411, 414, 415, 421, 422, 427, 429, 432, 434, - 441, 442, 446, 447, 454, 455, 460, 461, 466, 468, - 469, 474, 478, 480, 484, 488, 494, 500, 508, 513, - 514, 525, 526, 539, 540, 543, 549, 551, 557, 559, - 565, 567, 573, 575, 585, 591, 593, 595, 597, 599, - 601, 605, 607, 609, 611, 619, 625, 627, 629, 631, - 633, 637, 638, 644, 649, 650, 654, 656, 658, 660, - 662, 665, 667, 669, 671, 673, 675, 679, 683, 687, - 689, 691, 695, 697, 699, 703, 707, 708, 714, 717, - 718, 722, 724, 728, 730, 734, 738, 740, 742, 746, - 748, 750, 752, 756, 758, 760, 762, 768, 776, 782, - 791, 793, 797, 803, 809, 817, 825, 832, 838, 839, - 842, 846, 850, 854, 856, 862, 872, 878, 882, 886, - 887, 898, 899, 901, 909, 915, 921, 925, 931, 939, - 949, 951, 953, 955, 957, 959, 960, 963, 965, 969, - 971, 973, 975, 977, 979, 981, 983, 985, 987, 989, - 991, 993, 997, 999, 1001, 1006, 1008, 1010, 1015, 1017, - 1019, 1024, 1026, 1031, 1037, 1039, 1043, 1045, 1049, 1051, - 1053, 1058, 1068, 1070, 1072, 1077, 1079, 1085, 1087, 1089, - 1094, 1096, 1098, 1104, 1106, 1108, 1110, 1115, 1117, 1119, - 1125, 1127, 1129, 1133, 1135, 1137, 1141, 1143, 1148, 1152, - 1156, 1160, 1164, 1168, 1172, 1174, 1176, 1180, 1182, 1186, - 1187, 1189, 1191, 1193, 1195, 1199, 1200, 1202, 1204, 1207, - 1210, 1215, 1222, 1227, 1234, 1241, 1248, 1255, 1258, 1265, - 1274, 1283, 1294, 1309, 1312, 1314, 1318, 1320, 1324, 1326, - 1328, 1330, 1332, 1334, 1336, 1338, 1340, 1342, 1344, 1346, - 1348, 1350, 1352, 1354, 1356, 1358, 1369 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 195, 0, -1, -1, 196, -1, 197, -1, 197, 196, - -1, 198, 205, 207, -1, 16, 132, 139, -1, 15, - 132, 139, 131, 199, -1, 59, -1, 3, -1, 17, - 132, 11, 131, 297, -1, 17, 132, 10, 131, 3, - -1, 17, 132, 13, -1, 17, 132, 12, 131, 3, - 131, 3, 131, 5, 131, 5, 131, 316, 131, 204, - 203, -1, -1, 131, 129, -1, -1, 131, 323, -1, - -1, 131, 3, -1, 5, -1, 59, -1, -1, 70, - 132, 206, -1, 71, 131, 206, -1, 71, -1, -1, - 209, 207, -1, 137, 207, 138, -1, 250, -1, 200, - -1, 305, -1, 306, -1, 292, -1, 252, -1, 215, - -1, 214, -1, 300, -1, 264, -1, 284, -1, 308, - -1, 309, -1, 294, -1, 307, -1, 230, -1, 240, - -1, 242, -1, 246, -1, 244, -1, 227, -1, 237, - -1, 223, -1, 226, -1, 287, -1, 269, -1, 285, - -1, 272, -1, 278, -1, 301, -1, 296, -1, 290, - -1, 251, -1, 302, -1, 257, -1, 255, -1, 295, - -1, 299, -1, 298, -1, 288, -1, 289, -1, 291, - -1, 283, -1, 286, -1, 149, -1, 151, -1, 153, - -1, 155, -1, 157, -1, 159, -1, 161, -1, 163, - -1, 165, -1, 148, -1, 150, -1, 152, -1, 154, - -1, 156, -1, 158, -1, 160, -1, 162, -1, 164, - -1, 210, -1, 211, -1, 142, -1, 142, -1, 211, - -1, 82, 132, 210, -1, 212, 190, 335, -1, 212, - 190, 120, 132, 344, -1, 212, 190, 334, -1, 212, - 190, 350, 132, 328, -1, 212, 190, 349, 132, 330, - -1, 212, 190, 348, 132, 332, -1, 212, 190, 323, - -1, 212, 190, 326, -1, 212, 190, 137, 221, 138, - -1, 212, 190, 137, 220, 138, -1, 212, 190, 137, - 219, 138, -1, 212, 190, 350, 132, 137, 218, 138, - -1, 212, 190, 349, 132, 137, 217, 138, -1, 212, - 190, 348, 132, 137, 216, 138, -1, 212, 190, 137, - 222, 138, -1, 333, -1, 216, 131, 333, -1, 331, - -1, 217, 131, 331, -1, 329, -1, 218, 131, 329, - -1, 327, -1, 219, 131, 327, -1, 324, -1, 220, - 131, 324, -1, 335, -1, 221, 131, 335, -1, 334, - -1, 222, 131, 334, -1, -1, -1, 111, 141, 133, - 224, 339, 134, 225, 208, -1, 141, 133, 342, 134, - -1, 81, -1, -1, 6, -1, 6, -1, 135, 335, - 113, 335, 136, -1, 135, 335, 136, -1, -1, -1, - 88, 231, 135, 322, 136, 232, 137, 233, 138, -1, - -1, 234, 233, -1, -1, 89, 346, 132, 235, 207, - -1, -1, 91, 132, 236, 207, -1, 90, -1, 191, - 191, -1, 87, -1, 86, 213, 190, 335, 238, 335, - -1, -1, 239, 241, 208, -1, -1, 85, 135, 322, - 136, 243, 208, -1, -1, 229, 132, 245, 209, -1, - -1, 76, 229, 247, 248, -1, 208, -1, -1, 208, - 249, 77, 208, -1, 14, 132, 334, -1, 53, -1, - 53, 132, 346, -1, 53, 132, 59, -1, 46, 132, - 253, 131, 253, -1, 46, 132, 253, 131, 346, -1, - 133, 4, 131, 58, 131, 268, 134, -1, 311, 228, - 131, 316, -1, -1, 68, 132, 254, 131, 261, 131, - 263, 312, 256, 208, -1, -1, 40, 132, 254, 131, - 260, 131, 262, 131, 263, 312, 258, 208, -1, -1, - 131, 5, -1, 133, 4, 131, 4, 134, -1, 59, - -1, 133, 4, 131, 4, 134, -1, 59, -1, 133, - 270, 131, 271, 134, -1, 59, -1, 133, 4, 131, - 4, 134, -1, 59, -1, 75, 132, 265, 131, 315, - 131, 266, 131, 268, -1, 24, 132, 315, 131, 344, - -1, 5, -1, 59, -1, 267, -1, 59, -1, 58, - -1, 58, 192, 267, -1, 4, -1, 59, -1, 19, - -1, 18, 132, 270, 131, 271, 259, 140, -1, 18, - 132, 323, 259, 140, -1, 63, -1, 64, -1, 65, - -1, 64, -1, 22, 132, 274, -1, -1, 22, 132, - 274, 273, 208, -1, 330, 131, 323, 275, -1, -1, - 275, 131, 276, -1, 334, -1, 72, -1, 73, -1, - 318, -1, 74, 334, -1, 97, -1, 95, -1, 98, - -1, 99, -1, 100, -1, 101, 132, 322, -1, 102, - 132, 322, -1, 103, 132, 322, -1, 104, -1, 105, - -1, 106, 132, 277, -1, 139, -1, 107, -1, 139, - 192, 277, -1, 20, 132, 280, -1, -1, 21, 132, - 280, 279, 208, -1, 332, 281, -1, -1, 281, 131, - 282, -1, 56, -1, 108, 132, 330, -1, 347, -1, - 69, 132, 334, -1, 83, 132, 322, -1, 84, -1, - 55, -1, 92, 132, 322, -1, 110, -1, 54, -1, - 93, -1, 94, 132, 322, -1, 95, -1, 96, -1, - 323, -1, 23, 132, 310, 131, 323, -1, 25, 132, - 323, 131, 58, 131, 315, -1, 29, 132, 323, 131, - 58, -1, 29, 132, 323, 131, 58, 131, 5, 203, - -1, 30, -1, 30, 132, 344, -1, 36, 132, 323, - 131, 67, -1, 37, 132, 323, 131, 67, -1, 37, - 132, 352, 131, 352, 131, 67, -1, 41, 132, 352, - 131, 352, 131, 139, -1, 42, 132, 352, 131, 352, - 293, -1, 43, 132, 352, 131, 352, -1, -1, 131, - 67, -1, 49, 132, 344, -1, 51, 132, 344, -1, - 50, 132, 344, -1, 3, -1, 133, 3, 131, 316, - 134, -1, 80, 132, 326, 131, 328, 131, 328, 131, - 7, -1, 78, 132, 344, 131, 328, -1, 38, 132, - 326, -1, 39, 132, 326, -1, -1, 31, 132, 326, - 131, 316, 131, 311, 312, 303, 304, -1, -1, 208, - -1, 35, 132, 323, 131, 317, 131, 319, -1, 109, - 132, 323, 131, 334, -1, 109, 132, 323, 131, 59, - -1, 109, 132, 323, -1, 47, 132, 335, 131, 323, - -1, 48, 132, 323, 131, 351, 131, 334, -1, 45, - 132, 322, 131, 322, 131, 322, 131, 322, -1, 45, - -1, 139, -1, 59, -1, 139, -1, 59, -1, -1, - 131, 313, -1, 314, -1, 314, 131, 313, -1, 32, - -1, 33, -1, 34, -1, 54, -1, 59, -1, 55, - -1, 59, -1, 62, -1, 320, -1, 59, -1, 62, - -1, 320, -1, 61, 132, 59, -1, 66, -1, 59, - -1, 61, 135, 4, 136, -1, 139, -1, 150, -1, - 151, 135, 335, 136, -1, 335, -1, 324, -1, 122, - 133, 344, 134, -1, 154, -1, 155, 135, 335, 136, - -1, 133, 4, 131, 4, 134, -1, 59, -1, 60, - 325, 136, -1, 130, -1, 130, 131, 325, -1, 327, - -1, 156, -1, 157, 135, 335, 136, -1, 133, 4, - 131, 4, 131, 4, 131, 4, 134, -1, 329, -1, - 158, -1, 159, 135, 335, 136, -1, 3, -1, 133, - 3, 131, 316, 134, -1, 331, -1, 160, -1, 161, - 135, 335, 136, -1, 139, -1, 3, -1, 133, 3, - 131, 139, 134, -1, 59, -1, 333, -1, 162, -1, - 163, 135, 335, 136, -1, 139, -1, 3, -1, 133, - 3, 131, 139, 134, -1, 59, -1, 321, -1, 334, - 191, 321, -1, 4, -1, 345, -1, 133, 8, 134, - -1, 148, -1, 149, 135, 335, 136, -1, 335, 185, - 335, -1, 335, 186, 335, -1, 335, 187, 335, -1, - 335, 188, 335, -1, 335, 189, 335, -1, 133, 335, - 134, -1, 144, -1, 145, -1, 212, 132, 336, -1, - 337, -1, 338, 131, 337, -1, -1, 338, -1, 335, - -1, 334, -1, 340, -1, 341, 131, 340, -1, -1, - 341, -1, 323, -1, 115, 326, -1, 116, 326, -1, - 117, 323, 131, 323, -1, 118, 323, 131, 323, 131, - 335, -1, 119, 133, 344, 134, -1, 119, 133, 267, - 131, 344, 134, -1, 125, 133, 7, 131, 344, 134, - -1, 125, 133, 344, 131, 344, 134, -1, 125, 133, - 328, 131, 344, 134, -1, 121, 323, -1, 123, 133, - 323, 131, 335, 134, -1, 123, 133, 323, 131, 335, - 131, 32, 134, -1, 124, 133, 323, 131, 335, 131, - 335, 134, -1, 124, 133, 323, 131, 335, 131, 335, - 131, 32, 134, -1, 127, 133, 128, 131, 133, 335, - 186, 335, 201, 134, 131, 323, 202, 134, -1, 126, - 343, -1, 164, -1, 133, 344, 134, -1, 343, -1, - 343, 193, 344, -1, 184, -1, 8, -1, 9, -1, - 4, -1, 8, -1, 9, -1, 4, -1, 345, -1, - 26, -1, 20, -1, 27, -1, 22, -1, 28, -1, - 78, -1, 57, -1, 59, -1, 353, -1, 44, 133, - 4, 131, 4, 131, 4, 131, 4, 134, -1, 133, - 4, 131, 4, 131, 4, 131, 4, 134, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 274, 274, 275, 278, 279, 282, 304, 309, 330, @@ -1152,29 +988,29 @@ static const yytype_uint16 yyrline[] = 1349, 1355, 1356, 1359, 1366, 1374, 1382, 1383, 1386, 1387, 1390, 1395, 1394, 1408, 1415, 1421, 1429, 1434, 1440, 1446, 1452, 1458, 1463, 1468, 1473, 1478, 1483, 1488, 1493, 1498, - 1503, 1508, 1516, 1523, 1527, 1540, 1547, 1546, 1562, 1570, - 1576, 1584, 1590, 1595, 1600, 1605, 1610, 1615, 1620, 1625, - 1630, 1641, 1646, 1651, 1656, 1661, 1668, 1674, 1703, 1708, - 1716, 1722, 1728, 1735, 1742, 1752, 1762, 1777, 1788, 1791, - 1797, 1803, 1809, 1815, 1820, 1827, 1834, 1840, 1846, 1853, - 1852, 1877, 1880, 1886, 1893, 1897, 1902, 1909, 1915, 1922, - 1926, 1933, 1941, 1944, 1954, 1958, 1961, 1967, 1971, 1978, - 1982, 1986, 1992, 1993, 1996, 1997, 2000, 2001, 2002, 2008, - 2009, 2010, 2016, 2017, 2020, 2029, 2034, 2041, 2051, 2057, - 2061, 2065, 2072, 2081, 2087, 2091, 2097, 2101, 2109, 2113, - 2120, 2129, 2140, 2144, 2151, 2160, 2169, 2180, 2184, 2191, - 2200, 2209, 2218, 2227, 2233, 2237, 2244, 2253, 2263, 2272, - 2281, 2288, 2289, 2295, 2299, 2303, 2307, 2315, 2324, 2328, - 2332, 2336, 2340, 2344, 2347, 2354, 2363, 2391, 2392, 2395, - 2396, 2399, 2403, 2410, 2417, 2428, 2431, 2439, 2443, 2447, - 2451, 2455, 2460, 2464, 2468, 2473, 2478, 2483, 2487, 2492, - 2497, 2501, 2505, 2510, 2514, 2521, 2527, 2531, 2537, 2544, - 2545, 2546, 2549, 2553, 2557, 2561, 2567, 2568, 2571, 2572, - 2575, 2576, 2579, 2580, 2583, 2587, 2605 + 1503, 1508, 1516, 1524, 1528, 1541, 1548, 1547, 1563, 1571, + 1577, 1585, 1591, 1596, 1601, 1606, 1611, 1616, 1621, 1626, + 1631, 1642, 1647, 1652, 1657, 1662, 1669, 1675, 1704, 1709, + 1717, 1723, 1729, 1736, 1743, 1753, 1763, 1778, 1789, 1792, + 1798, 1804, 1810, 1816, 1821, 1828, 1835, 1841, 1847, 1854, + 1853, 1878, 1881, 1887, 1894, 1898, 1903, 1910, 1916, 1923, + 1927, 1934, 1942, 1945, 1955, 1959, 1962, 1968, 1972, 1979, + 1983, 1987, 1993, 1994, 1997, 1998, 2001, 2002, 2003, 2009, + 2010, 2011, 2017, 2018, 2021, 2030, 2035, 2042, 2052, 2058, + 2062, 2066, 2073, 2082, 2088, 2092, 2098, 2102, 2110, 2114, + 2121, 2130, 2141, 2145, 2152, 2161, 2170, 2181, 2185, 2192, + 2201, 2211, 2220, 2230, 2236, 2240, 2247, 2256, 2266, 2275, + 2285, 2292, 2293, 2299, 2303, 2307, 2311, 2319, 2328, 2332, + 2336, 2340, 2344, 2348, 2351, 2358, 2367, 2395, 2396, 2399, + 2400, 2403, 2407, 2414, 2421, 2432, 2435, 2443, 2447, 2451, + 2455, 2459, 2464, 2468, 2472, 2477, 2482, 2487, 2491, 2496, + 2501, 2505, 2509, 2514, 2518, 2525, 2531, 2535, 2541, 2548, + 2549, 2550, 2553, 2557, 2561, 2565, 2571, 2572, 2575, 2576, + 2579, 2580, 2583, 2584, 2587, 2591, 2609 }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -1256,13 +1092,13 @@ static const char *const yytname[] = "func_call_param_part", "func_call_param_list", "func_call_params_list", "ter_selection_x", "ter_selection", "dice", "all_integers", "all_ints_push", "objectid", "monsterid", "terrainid", "engraving_type", - "lev_region", "region", 0 + "lev_region", "region", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -1288,216 +1124,18 @@ static const yytype_uint16 yytoknum[] = }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = -{ - 0, 194, 195, 195, 196, 196, 197, 198, 198, 199, - 199, 200, 200, 200, 200, 201, 201, 202, 202, 203, - 203, 204, 204, 205, 205, 206, 206, 207, 207, 208, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 212, 212, 212, 213, 213, 214, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 216, 216, 217, 217, 218, 218, 219, - 219, 220, 220, 221, 221, 222, 222, 224, 225, 223, - 226, 227, 228, 228, 229, 229, 229, 231, 232, 230, - 233, 233, 235, 234, 236, 234, 237, 238, 238, 239, - 241, 240, 243, 242, 245, 244, 247, 246, 248, 249, - 248, 250, 251, 251, 251, 252, 252, 253, 254, 256, - 255, 258, 257, 259, 259, 260, 260, 261, 261, 262, - 262, 263, 263, 264, 264, 265, 265, 266, 266, 267, - 267, 268, 268, 269, 269, 269, 270, 270, 271, 271, - 272, 273, 272, 274, 275, 275, 276, 276, 276, 276, - 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, - 276, 276, 277, 277, 277, 278, 279, 278, 280, 281, - 281, 282, 282, 282, 282, 282, 282, 282, 282, 282, - 282, 282, 282, 282, 282, 282, 283, 284, 285, 285, - 286, 286, 287, 288, 289, 290, 291, 292, 293, 293, - 294, 295, 296, 297, 297, 298, 299, 300, 301, 303, - 302, 304, 304, 305, 306, 306, 306, 307, 308, 309, - 309, 310, 310, 311, 311, 312, 312, 313, 313, 314, - 314, 314, 315, 315, 316, 316, 317, 317, 317, 318, - 318, 318, 319, 319, 320, 321, 321, 321, 322, 323, - 323, 323, 323, 324, 324, 324, 325, 325, 326, 326, - 326, 327, 328, 328, 328, 329, 329, 330, 330, 330, - 331, 331, 331, 331, 332, 332, 332, 333, 333, 333, - 333, 334, 334, 335, 335, 335, 335, 335, 335, 335, - 335, 335, 335, 335, 336, 336, 337, 338, 338, 339, - 339, 340, 340, 341, 341, 342, 342, 343, 343, 343, - 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, - 343, 343, 343, 343, 343, 343, 344, 344, 345, 346, - 346, 346, 347, 347, 347, 347, 348, 348, 349, 349, - 350, 350, 351, 351, 352, 352, 353 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 1, 1, 2, 3, 3, 5, 1, - 1, 5, 5, 3, 16, 0, 2, 0, 2, 0, - 2, 1, 1, 0, 3, 3, 1, 0, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 3, 5, - 3, 5, 5, 5, 3, 3, 5, 5, 5, 7, - 7, 7, 5, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 1, 3, 0, 0, 8, - 4, 1, 0, 1, 1, 5, 3, 0, 0, 9, - 0, 2, 0, 5, 0, 4, 1, 2, 1, 6, - 0, 3, 0, 6, 0, 4, 0, 4, 1, 0, - 4, 3, 1, 3, 3, 5, 5, 7, 4, 0, - 10, 0, 12, 0, 2, 5, 1, 5, 1, 5, - 1, 5, 1, 9, 5, 1, 1, 1, 1, 1, - 3, 1, 1, 1, 7, 5, 1, 1, 1, 1, - 3, 0, 5, 4, 0, 3, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 3, 3, 3, 1, - 1, 3, 1, 1, 3, 3, 0, 5, 2, 0, - 3, 1, 3, 1, 3, 3, 1, 1, 3, 1, - 1, 1, 3, 1, 1, 1, 5, 7, 5, 8, - 1, 3, 5, 5, 7, 7, 6, 5, 0, 2, - 3, 3, 3, 1, 5, 9, 5, 3, 3, 0, - 10, 0, 1, 7, 5, 5, 3, 5, 7, 9, - 1, 1, 1, 1, 1, 0, 2, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 1, 4, 1, 1, 4, 1, 1, - 4, 1, 4, 5, 1, 3, 1, 3, 1, 1, - 4, 9, 1, 1, 4, 1, 5, 1, 1, 4, - 1, 1, 5, 1, 1, 1, 4, 1, 1, 5, - 1, 1, 3, 1, 1, 3, 1, 4, 3, 3, - 3, 3, 3, 3, 1, 1, 3, 1, 3, 0, - 1, 1, 1, 1, 3, 0, 1, 1, 2, 2, - 4, 6, 4, 6, 6, 6, 6, 2, 6, 8, - 8, 10, 14, 2, 1, 3, 1, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 10, 9 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint16 yydefact[] = -{ - 2, 0, 0, 0, 3, 4, 23, 0, 0, 1, - 5, 0, 27, 0, 7, 0, 134, 0, 0, 0, - 193, 0, 0, 0, 0, 0, 0, 0, 250, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 280, - 0, 0, 0, 0, 0, 0, 162, 0, 0, 0, - 0, 0, 131, 0, 0, 0, 137, 146, 0, 0, - 0, 0, 94, 83, 74, 84, 75, 85, 76, 86, - 77, 87, 78, 88, 79, 89, 80, 90, 81, 91, - 82, 31, 6, 27, 92, 93, 0, 37, 36, 52, - 53, 50, 0, 45, 51, 150, 46, 47, 49, 48, - 30, 62, 35, 65, 64, 39, 55, 57, 58, 72, - 40, 56, 73, 54, 69, 70, 61, 71, 34, 43, - 66, 60, 68, 67, 38, 59, 63, 32, 33, 44, - 41, 42, 0, 26, 24, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, - 0, 95, 96, 0, 0, 0, 0, 343, 0, 346, - 0, 388, 0, 344, 365, 28, 0, 154, 0, 10, - 9, 8, 0, 305, 306, 0, 341, 161, 0, 0, - 0, 13, 314, 0, 196, 197, 0, 0, 311, 0, - 0, 173, 309, 338, 340, 0, 337, 335, 0, 225, - 229, 334, 226, 331, 333, 0, 330, 328, 0, 200, - 0, 327, 282, 281, 0, 292, 293, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 384, 367, 386, 251, 0, 319, 0, 0, - 318, 0, 0, 0, 0, 0, 0, 404, 267, 268, - 284, 283, 0, 132, 0, 0, 0, 0, 0, 308, - 0, 0, 0, 0, 260, 262, 261, 391, 389, 390, - 164, 163, 0, 185, 186, 0, 0, 0, 0, 97, - 0, 0, 0, 276, 127, 0, 0, 0, 0, 136, - 0, 0, 0, 0, 0, 362, 361, 363, 366, 0, - 397, 399, 396, 398, 400, 401, 0, 0, 0, 104, - 105, 100, 98, 0, 0, 0, 0, 27, 151, 25, - 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 228, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 368, 369, 0, 0, 0, - 377, 0, 0, 0, 383, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 133, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 158, 157, 0, 0, 152, 0, 0, 0, 359, - 345, 353, 0, 0, 348, 349, 350, 351, 352, 0, - 130, 0, 343, 0, 0, 0, 0, 121, 119, 125, - 123, 0, 0, 0, 155, 0, 0, 342, 12, 263, - 0, 11, 0, 0, 315, 0, 0, 0, 199, 198, - 173, 174, 195, 0, 0, 0, 227, 0, 0, 202, - 204, 246, 184, 0, 248, 0, 0, 189, 0, 0, - 0, 0, 325, 0, 0, 323, 0, 0, 322, 0, - 0, 385, 387, 0, 0, 294, 295, 0, 298, 0, - 296, 0, 297, 252, 0, 0, 253, 0, 176, 0, - 0, 0, 0, 0, 258, 257, 0, 0, 165, 166, - 277, 402, 403, 0, 178, 0, 0, 0, 0, 0, - 266, 0, 0, 148, 0, 0, 138, 275, 274, 0, - 357, 360, 0, 347, 135, 364, 99, 0, 0, 108, - 0, 107, 0, 106, 0, 112, 0, 103, 0, 102, - 0, 101, 29, 307, 0, 0, 317, 310, 0, 312, - 0, 0, 336, 394, 392, 393, 240, 237, 231, 0, - 0, 236, 0, 241, 0, 243, 244, 0, 239, 230, - 245, 395, 233, 0, 329, 203, 0, 0, 370, 0, - 0, 0, 372, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 320, 0, 0, 0, 0, 0, 0, 0, - 0, 168, 0, 0, 0, 256, 0, 0, 0, 0, - 0, 0, 0, 0, 153, 147, 149, 0, 0, 0, - 128, 0, 120, 122, 124, 126, 0, 113, 0, 115, - 0, 117, 0, 0, 313, 194, 339, 0, 0, 0, - 0, 0, 332, 0, 247, 19, 0, 190, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 285, 0, - 303, 302, 273, 0, 0, 254, 0, 180, 0, 0, - 255, 259, 0, 0, 278, 0, 182, 0, 285, 188, - 0, 187, 160, 0, 140, 354, 355, 356, 358, 0, - 0, 111, 0, 110, 0, 109, 0, 0, 234, 235, - 238, 242, 232, 0, 299, 207, 208, 0, 212, 211, - 213, 214, 215, 0, 0, 0, 219, 220, 0, 205, - 209, 300, 206, 0, 249, 371, 373, 0, 378, 0, - 374, 0, 324, 376, 375, 0, 0, 0, 269, 304, - 0, 0, 0, 0, 0, 0, 191, 192, 0, 0, - 0, 169, 0, 0, 0, 0, 0, 140, 129, 114, - 116, 118, 264, 0, 0, 210, 0, 0, 0, 0, - 20, 0, 0, 326, 0, 0, 289, 290, 291, 286, - 287, 271, 0, 0, 175, 0, 285, 279, 167, 177, - 0, 0, 183, 265, 0, 144, 139, 141, 0, 301, - 216, 217, 218, 223, 222, 221, 379, 0, 380, 349, - 0, 0, 272, 270, 0, 0, 0, 171, 0, 170, - 142, 27, 0, 0, 0, 0, 0, 321, 288, 0, - 406, 179, 0, 181, 27, 145, 0, 224, 381, 16, - 0, 405, 172, 143, 0, 0, 0, 17, 21, 22, - 19, 0, 0, 14, 18, 382 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 3, 4, 5, 6, 191, 81, 836, 862, 734, - 860, 12, 134, 82, 338, 83, 84, 85, 86, 173, - 87, 88, 636, 638, 640, 423, 424, 425, 426, 89, - 409, 699, 90, 91, 389, 92, 93, 174, 627, 766, - 767, 844, 831, 94, 525, 95, 96, 188, 97, 522, - 98, 336, 99, 296, 402, 518, 100, 101, 102, 281, - 272, 103, 801, 104, 842, 352, 500, 516, 679, 688, - 105, 295, 690, 468, 758, 106, 210, 450, 107, 359, - 229, 585, 729, 815, 108, 356, 219, 355, 579, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 615, - 119, 120, 121, 441, 122, 123, 124, 125, 126, 791, - 823, 127, 128, 129, 130, 131, 234, 273, 748, 789, - 790, 237, 487, 491, 730, 672, 492, 196, 278, 253, - 212, 346, 259, 260, 477, 478, 230, 231, 220, 221, - 315, 279, 697, 530, 531, 532, 317, 318, 319, 254, - 376, 183, 291, 582, 333, 334, 335, 513, 266, 267 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ #define YYPACT_NINF -654 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-654))) + +#define YYTABLE_NINF -202 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { 137, 7, 27, 83, -654, 137, 24, -15, 37, -654, @@ -1589,7 +1227,101 @@ static const yytype_int16 yypact[] = 809, -18, 875, -654, -654, -654 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 2, 0, 0, 0, 3, 4, 23, 0, 0, 1, + 5, 0, 27, 0, 7, 0, 134, 0, 0, 0, + 193, 0, 0, 0, 0, 0, 0, 0, 250, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 280, + 0, 0, 0, 0, 0, 0, 162, 0, 0, 0, + 0, 0, 131, 0, 0, 0, 137, 146, 0, 0, + 0, 0, 94, 83, 74, 84, 75, 85, 76, 86, + 77, 87, 78, 88, 79, 89, 80, 90, 81, 91, + 82, 31, 6, 27, 92, 93, 0, 37, 36, 52, + 53, 50, 0, 45, 51, 150, 46, 47, 49, 48, + 30, 62, 35, 65, 64, 39, 55, 57, 58, 72, + 40, 56, 73, 54, 69, 70, 61, 71, 34, 43, + 66, 60, 68, 67, 38, 59, 63, 32, 33, 44, + 41, 42, 0, 26, 24, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, + 0, 95, 96, 0, 0, 0, 0, 343, 0, 346, + 0, 388, 0, 344, 365, 28, 0, 154, 0, 10, + 9, 8, 0, 305, 306, 0, 341, 161, 0, 0, + 0, 13, 314, 0, 196, 197, 0, 0, 311, 0, + 0, 173, 309, 338, 340, 0, 337, 335, 0, 225, + 229, 334, 226, 331, 333, 0, 330, 328, 0, 200, + 0, 327, 282, 281, 0, 292, 293, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 384, 367, 386, 251, 0, 319, 0, 0, + 318, 0, 0, 0, 0, 0, 0, 404, 267, 268, + 284, 283, 0, 132, 0, 0, 0, 0, 0, 308, + 0, 0, 0, 0, 260, 262, 261, 391, 389, 390, + 164, 163, 0, 185, 186, 0, 0, 0, 0, 97, + 0, 0, 0, 276, 127, 0, 0, 0, 0, 136, + 0, 0, 0, 0, 0, 362, 361, 363, 366, 0, + 397, 399, 396, 398, 400, 401, 0, 0, 0, 104, + 105, 100, 98, 0, 0, 0, 0, 27, 151, 25, + 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 228, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 368, 369, 0, 0, 0, + 377, 0, 0, 0, 383, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 133, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 158, 157, 0, 0, 152, 0, 0, 0, 359, + 345, 353, 0, 0, 348, 349, 350, 351, 352, 0, + 130, 0, 343, 0, 0, 0, 0, 121, 119, 125, + 123, 0, 0, 0, 155, 0, 0, 342, 12, 263, + 0, 11, 0, 0, 315, 0, 0, 0, 199, 198, + 173, 174, 195, 0, 0, 0, 227, 0, 0, 202, + 204, 246, 184, 0, 248, 0, 0, 189, 0, 0, + 0, 0, 325, 0, 0, 323, 0, 0, 322, 0, + 0, 385, 387, 0, 0, 294, 295, 0, 298, 0, + 296, 0, 297, 252, 0, 0, 253, 0, 176, 0, + 0, 0, 0, 0, 258, 257, 0, 0, 165, 166, + 277, 402, 403, 0, 178, 0, 0, 0, 0, 0, + 266, 0, 0, 148, 0, 0, 138, 275, 274, 0, + 357, 360, 0, 347, 135, 364, 99, 0, 0, 108, + 0, 107, 0, 106, 0, 112, 0, 103, 0, 102, + 0, 101, 29, 307, 0, 0, 317, 310, 0, 312, + 0, 0, 336, 394, 392, 393, 240, 237, 231, 0, + 0, 236, 0, 241, 0, 243, 244, 0, 239, 230, + 245, 395, 233, 0, 329, 203, 0, 0, 370, 0, + 0, 0, 372, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 320, 0, 0, 0, 0, 0, 0, 0, + 0, 168, 0, 0, 0, 256, 0, 0, 0, 0, + 0, 0, 0, 0, 153, 147, 149, 0, 0, 0, + 128, 0, 120, 122, 124, 126, 0, 113, 0, 115, + 0, 117, 0, 0, 313, 194, 339, 0, 0, 0, + 0, 0, 332, 0, 247, 19, 0, 190, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 285, 0, + 303, 302, 273, 0, 0, 254, 0, 180, 0, 0, + 255, 259, 0, 0, 278, 0, 182, 0, 285, 188, + 0, 187, 160, 0, 140, 354, 355, 356, 358, 0, + 0, 111, 0, 110, 0, 109, 0, 0, 234, 235, + 238, 242, 232, 0, 299, 207, 208, 0, 212, 211, + 213, 214, 215, 0, 0, 0, 219, 220, 0, 205, + 209, 300, 206, 0, 249, 371, 373, 0, 378, 0, + 374, 0, 324, 376, 375, 0, 0, 0, 269, 304, + 0, 0, 0, 0, 0, 0, 191, 192, 0, 0, + 0, 169, 0, 0, 0, 0, 0, 140, 129, 114, + 116, 118, 264, 0, 0, 210, 0, 0, 0, 0, + 20, 0, 0, 326, 0, 0, 289, 290, 291, 286, + 287, 271, 0, 0, 175, 0, 285, 279, 167, 177, + 0, 0, 183, 265, 0, 144, 139, 141, 0, 301, + 216, 217, 218, 223, 222, 221, 379, 0, 380, 349, + 0, 0, 272, 270, 0, 0, 0, 171, 0, 170, + 142, 27, 0, 0, 0, 0, 0, 321, 288, 0, + 406, 179, 0, 181, 27, 145, 0, 224, 381, 16, + 0, 405, 172, 143, 0, 0, 0, 17, 21, 22, + 19, 0, 0, 14, 18, 382 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -654, -654, 994, -654, -654, -654, -654, -654, -654, 146, @@ -1610,11 +1342,30 @@ static const yytype_int16 yypgoto[] = -135, 575, -392, -654, -654, -654, -654, -654, -124, -654 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -202 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 3, 4, 5, 6, 191, 81, 836, 862, 734, + 860, 12, 134, 82, 338, 83, 84, 85, 86, 173, + 87, 88, 636, 638, 640, 423, 424, 425, 426, 89, + 409, 699, 90, 91, 389, 92, 93, 174, 627, 766, + 767, 844, 831, 94, 525, 95, 96, 188, 97, 522, + 98, 336, 99, 296, 402, 518, 100, 101, 102, 281, + 272, 103, 801, 104, 842, 352, 500, 516, 679, 688, + 105, 295, 690, 468, 758, 106, 210, 450, 107, 359, + 229, 585, 729, 815, 108, 356, 219, 355, 579, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 615, + 119, 120, 121, 441, 122, 123, 124, 125, 126, 791, + 823, 127, 128, 129, 130, 131, 234, 273, 748, 789, + 790, 237, 487, 491, 730, 672, 492, 196, 278, 253, + 212, 346, 259, 260, 477, 478, 230, 231, 220, 221, + 315, 279, 697, 530, 531, 532, 317, 318, 319, 254, + 376, 183, 291, 582, 333, 334, 335, 513, 266, 267 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 185, 211, 300, 197, 509, 182, 401, 238, 239, 611, @@ -1831,8 +1582,8 @@ static const yytype_int16 yycheck[] = 455, -1, -1, 431 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { 0, 15, 16, 195, 196, 197, 198, 132, 132, 0, @@ -1924,95 +1675,133 @@ static const yytype_uint16 yystos[] = 204, 131, 202, 203, 323, 134 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint16 yyr1[] = +{ + 0, 194, 195, 195, 196, 196, 197, 198, 198, 199, + 199, 200, 200, 200, 200, 201, 201, 202, 202, 203, + 203, 204, 204, 205, 205, 206, 206, 207, 207, 208, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 210, 210, 210, 210, 210, 210, + 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 212, 212, 212, 213, 213, 214, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 216, 216, 217, 217, 218, 218, 219, + 219, 220, 220, 221, 221, 222, 222, 224, 225, 223, + 226, 227, 228, 228, 229, 229, 229, 231, 232, 230, + 233, 233, 235, 234, 236, 234, 237, 238, 238, 239, + 241, 240, 243, 242, 245, 244, 247, 246, 248, 249, + 248, 250, 251, 251, 251, 252, 252, 253, 254, 256, + 255, 258, 257, 259, 259, 260, 260, 261, 261, 262, + 262, 263, 263, 264, 264, 265, 265, 266, 266, 267, + 267, 268, 268, 269, 269, 269, 270, 270, 271, 271, + 272, 273, 272, 274, 275, 275, 276, 276, 276, 276, + 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, + 276, 276, 277, 277, 277, 278, 279, 278, 280, 281, + 281, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 283, 284, 285, 285, + 286, 286, 287, 288, 289, 290, 291, 292, 293, 293, + 294, 295, 296, 297, 297, 298, 299, 300, 301, 303, + 302, 304, 304, 305, 306, 306, 306, 307, 308, 309, + 309, 310, 310, 311, 311, 312, 312, 313, 313, 314, + 314, 314, 315, 315, 316, 316, 317, 317, 317, 318, + 318, 318, 319, 319, 320, 321, 321, 321, 322, 323, + 323, 323, 323, 324, 324, 324, 325, 325, 326, 326, + 326, 327, 328, 328, 328, 329, 329, 330, 330, 330, + 331, 331, 331, 331, 332, 332, 332, 333, 333, 333, + 333, 334, 334, 335, 335, 335, 335, 335, 335, 335, + 335, 335, 335, 335, 336, 336, 337, 338, 338, 339, + 339, 340, 340, 341, 341, 342, 342, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 344, 344, 345, 346, + 346, 346, 347, 347, 347, 347, 348, 348, 349, 349, + 350, 350, 351, 351, 352, 352, 353 +}; -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 1, 1, 2, 3, 3, 5, 1, + 1, 5, 5, 3, 16, 0, 2, 0, 2, 0, + 2, 1, 1, 0, 3, 3, 1, 0, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 3, 5, + 3, 5, 5, 5, 3, 3, 5, 5, 5, 7, + 7, 7, 5, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 0, 0, 8, + 4, 1, 0, 1, 1, 5, 3, 0, 0, 9, + 0, 2, 0, 5, 0, 4, 1, 2, 1, 6, + 0, 3, 0, 6, 0, 4, 0, 4, 1, 0, + 4, 3, 1, 3, 3, 5, 5, 7, 4, 0, + 10, 0, 12, 0, 2, 5, 1, 5, 1, 5, + 1, 5, 1, 9, 5, 1, 1, 1, 1, 1, + 3, 1, 1, 1, 7, 5, 1, 1, 1, 1, + 3, 0, 5, 4, 0, 3, 1, 1, 1, 1, + 2, 1, 1, 1, 1, 1, 3, 3, 3, 1, + 1, 3, 1, 1, 3, 3, 0, 5, 2, 0, + 3, 1, 3, 1, 3, 3, 1, 1, 3, 1, + 1, 1, 3, 1, 1, 1, 5, 7, 5, 8, + 1, 3, 5, 5, 7, 7, 6, 5, 0, 2, + 3, 3, 3, 1, 5, 9, 5, 3, 3, 0, + 10, 0, 1, 7, 5, 5, 3, 5, 7, 9, + 1, 1, 1, 1, 1, 0, 2, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 1, 4, 1, 1, 4, 1, 1, + 4, 1, 4, 5, 1, 3, 1, 3, 1, 1, + 4, 9, 1, 1, 4, 1, 5, 1, 1, 4, + 1, 1, 5, 1, 1, 1, 4, 1, 1, 5, + 1, 1, 3, 1, 1, 3, 1, 4, 3, 3, + 3, 3, 3, 3, 1, 1, 3, 1, 3, 0, + 1, 1, 1, 1, 3, 0, 1, 1, 2, 2, + 4, 6, 4, 6, 6, 6, 6, 2, 6, 8, + 8, 10, 14, 2, 1, 3, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 10, 9 +}; -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -#define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -2022,54 +1811,46 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { + FILE *yyo = yyoutput; + YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -2077,22 +1858,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); @@ -2103,16 +1873,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -2123,49 +1885,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -2179,7 +1934,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -2194,7 +1949,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -2203,15 +1957,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -2227,16 +1974,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -2266,27 +2005,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -2297,161 +2036,160 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) { - int yyn = yypact[yystate]; + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif { YYUSE (yyvaluep); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ + /* The lookahead symbol. */ @@ -2459,49 +2197,26 @@ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; - /* Number of syntax errors so far. */ int yynerrs; +/*----------. +| yyparse. | +`----------*/ -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (void) -#else -int -yyparse () - -#endif -#endif { - - int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. - Refer to the stacks thru separate pointers, to allow yyoverflow + Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -2519,7 +2234,7 @@ yyparse () int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -2537,9 +2252,8 @@ yyparse () Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -2548,14 +2262,6 @@ yyparse () yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - goto yysetstate; /*------------------------------------------------------------. @@ -2576,23 +2282,23 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); - yyss = yyss1; - yyvs = yyvs1; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -2600,22 +2306,22 @@ yyparse () # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -2624,10 +2330,10 @@ yyparse () yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -2647,7 +2353,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -2656,7 +2362,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (); } if (yychar <= YYEOF) @@ -2678,8 +2384,8 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -2696,7 +2402,9 @@ yybackup: yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -2719,7 +2427,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -2733,52 +2441,48 @@ yyreduce: switch (yyn) { case 6: - -/* Line 1455 of yacc.c */ -#line 283 "lev_comp.y" +#line 283 "lev_comp.y" /* yacc.c:1646 */ { if (fatal_error > 0) { (void) fprintf(stderr, "%s: %d errors detected for level \"%s\". No output created!\n", - fname, fatal_error, (yyvsp[(1) - (3)].map)); + fname, fatal_error, (yyvsp[-2].map)); fatal_error = 0; got_errors++; } else if (!got_errors) { - if (!write_level_file((yyvsp[(1) - (3)].map), splev)) { - lc_error("Can't write output file for '%s'!", (yyvsp[(1) - (3)].map)); + if (!write_level_file((yyvsp[-2].map), splev)) { + lc_error("Can't write output file for '%s'!", (yyvsp[-2].map)); exit(EXIT_FAILURE); } } - Free((yyvsp[(1) - (3)].map)); + Free((yyvsp[-2].map)); Free(splev); splev = NULL; vardef_free_all(variable_definitions); variable_definitions = NULL; } +#line 2465 "y.tab.c" /* yacc.c:1646 */ break; case 7: - -/* Line 1455 of yacc.c */ -#line 305 "lev_comp.y" +#line 305 "lev_comp.y" /* yacc.c:1646 */ { - start_level_def(&splev, (yyvsp[(3) - (3)].map)); - (yyval.map) = (yyvsp[(3) - (3)].map); + start_level_def(&splev, (yyvsp[0].map)); + (yyval.map) = (yyvsp[0].map); } +#line 2474 "y.tab.c" /* yacc.c:1646 */ break; case 8: - -/* Line 1455 of yacc.c */ -#line 310 "lev_comp.y" +#line 310 "lev_comp.y" /* yacc.c:1646 */ { - start_level_def(&splev, (yyvsp[(3) - (5)].map)); - if ((yyvsp[(5) - (5)].i) == -1) { + start_level_def(&splev, (yyvsp[-2].map)); + if ((yyvsp[0].i) == -1) { add_opvars(splev, "iiiiiiiio", VA_PASS9(LVLINIT_MAZEGRID,HWALL,0,0, 0,0,0,0, SPO_INITLEVEL)); } else { - long bg = what_map_char((char) (yyvsp[(5) - (5)].i)); + long bg = what_map_char((char) (yyvsp[0].i)); add_opvars(splev, "iiiiiiiio", VA_PASS9(LVLINIT_SOLIDFILL, bg, 0,0, 0,0,0,0, SPO_INITLEVEL)); @@ -2787,49 +2491,45 @@ yyreduce: VA_PASS2(MAZELEVEL, SPO_LEVEL_FLAGS)); max_x_map = COLNO-1; max_y_map = ROWNO; - (yyval.map) = (yyvsp[(3) - (5)].map); + (yyval.map) = (yyvsp[-2].map); } +#line 2497 "y.tab.c" /* yacc.c:1646 */ break; case 9: - -/* Line 1455 of yacc.c */ -#line 331 "lev_comp.y" +#line 331 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = -1; } +#line 2505 "y.tab.c" /* yacc.c:1646 */ break; case 10: - -/* Line 1455 of yacc.c */ -#line 335 "lev_comp.y" +#line 335 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = what_map_char((char) (yyvsp[(1) - (1)].i)); + (yyval.i) = what_map_char((char) (yyvsp[0].i)); } +#line 2513 "y.tab.c" /* yacc.c:1646 */ break; case 11: - -/* Line 1455 of yacc.c */ -#line 341 "lev_comp.y" +#line 341 "lev_comp.y" /* yacc.c:1646 */ { - long filling = (yyvsp[(5) - (5)].terr).ter; + long filling = (yyvsp[0].terr).ter; if (filling == INVALID_TYPE || filling >= MAX_TYPE) lc_error("INIT_MAP: Invalid fill char type."); add_opvars(splev, "iiiiiiiio", - LVLINIT_SOLIDFILL,filling,0,(long)(yyvsp[(5) - (5)].terr).lit, 0,0,0,0, SPO_INITLEVEL); + LVLINIT_SOLIDFILL,filling,0,(long)(yyvsp[0].terr).lit, 0,0,0,0, SPO_INITLEVEL); max_x_map = COLNO-1; max_y_map = ROWNO; } +#line 2527 "y.tab.c" /* yacc.c:1646 */ break; case 12: - -/* Line 1455 of yacc.c */ -#line 351 "lev_comp.y" +#line 351 "lev_comp.y" /* yacc.c:1646 */ { - long filling = what_map_char((char) (yyvsp[(5) - (5)].i)); + long filling = what_map_char((char) (yyvsp[0].i)); if (filling == INVALID_TYPE || filling >= MAX_TYPE) lc_error("INIT_MAP: Invalid fill char type."); add_opvars(splev, "iiiiiiiio", @@ -2838,31 +2538,29 @@ yyreduce: max_x_map = COLNO-1; max_y_map = ROWNO; } +#line 2542 "y.tab.c" /* yacc.c:1646 */ break; case 13: - -/* Line 1455 of yacc.c */ -#line 362 "lev_comp.y" +#line 362 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiiiiiio", VA_PASS9(LVLINIT_ROGUE,0,0,0, 0,0,0,0, SPO_INITLEVEL)); } +#line 2552 "y.tab.c" /* yacc.c:1646 */ break; case 14: - -/* Line 1455 of yacc.c */ -#line 368 "lev_comp.y" +#line 368 "lev_comp.y" /* yacc.c:1646 */ { - long fg = what_map_char((char) (yyvsp[(5) - (16)].i)); - long bg = what_map_char((char) (yyvsp[(7) - (16)].i)); - long smoothed = (yyvsp[(9) - (16)].i); - long joined = (yyvsp[(11) - (16)].i); - long lit = (yyvsp[(13) - (16)].i); - long walled = (yyvsp[(15) - (16)].i); - long filling = (yyvsp[(16) - (16)].i); + long fg = what_map_char((char) (yyvsp[-11].i)); + long bg = what_map_char((char) (yyvsp[-9].i)); + long smoothed = (yyvsp[-7].i); + long joined = (yyvsp[-5].i); + long lit = (yyvsp[-3].i); + long walled = (yyvsp[-1].i); + long filling = (yyvsp[0].i); if (fg == INVALID_TYPE || fg >= MAX_TYPE) lc_error("INIT_MAP: Invalid foreground type."); if (bg == INVALID_TYPE || bg >= MAX_TYPE) @@ -2880,494 +2578,448 @@ yyreduce: max_x_map = COLNO-1; max_y_map = ROWNO; } +#line 2582 "y.tab.c" /* yacc.c:1646 */ break; case 15: - -/* Line 1455 of yacc.c */ -#line 396 "lev_comp.y" +#line 396 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 0; } +#line 2590 "y.tab.c" /* yacc.c:1646 */ break; case 16: - -/* Line 1455 of yacc.c */ -#line 400 "lev_comp.y" +#line 400 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(2) - (2)].i); + (yyval.i) = (yyvsp[0].i); } +#line 2598 "y.tab.c" /* yacc.c:1646 */ break; case 17: - -/* Line 1455 of yacc.c */ -#line 406 "lev_comp.y" +#line 406 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_COPY)); (yyval.i) = 0; } +#line 2607 "y.tab.c" /* yacc.c:1646 */ break; case 18: - -/* Line 1455 of yacc.c */ -#line 411 "lev_comp.y" +#line 411 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 1; } +#line 2615 "y.tab.c" /* yacc.c:1646 */ break; case 19: - -/* Line 1455 of yacc.c */ -#line 417 "lev_comp.y" +#line 417 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = -1; } +#line 2623 "y.tab.c" /* yacc.c:1646 */ break; case 20: - -/* Line 1455 of yacc.c */ -#line 421 "lev_comp.y" +#line 421 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = what_map_char((char) (yyvsp[(2) - (2)].i)); + (yyval.i) = what_map_char((char) (yyvsp[0].i)); } +#line 2631 "y.tab.c" /* yacc.c:1646 */ break; case 23: - -/* Line 1455 of yacc.c */ -#line 432 "lev_comp.y" +#line 432 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", VA_PASS2(0, SPO_LEVEL_FLAGS)); } +#line 2639 "y.tab.c" /* yacc.c:1646 */ break; case 24: - -/* Line 1455 of yacc.c */ -#line 436 "lev_comp.y" +#line 436 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", VA_PASS2((yyvsp[(3) - (3)].i), SPO_LEVEL_FLAGS)); + add_opvars(splev, "io", VA_PASS2((yyvsp[0].i), SPO_LEVEL_FLAGS)); } +#line 2647 "y.tab.c" /* yacc.c:1646 */ break; case 25: - -/* Line 1455 of yacc.c */ -#line 442 "lev_comp.y" +#line 442 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = ((yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i)); + (yyval.i) = ((yyvsp[-2].i) | (yyvsp[0].i)); } +#line 2655 "y.tab.c" /* yacc.c:1646 */ break; case 26: - -/* Line 1455 of yacc.c */ -#line 446 "lev_comp.y" +#line 446 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (1)].i); + (yyval.i) = (yyvsp[0].i); } +#line 2663 "y.tab.c" /* yacc.c:1646 */ break; case 27: - -/* Line 1455 of yacc.c */ -#line 452 "lev_comp.y" +#line 452 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 0; } +#line 2671 "y.tab.c" /* yacc.c:1646 */ break; case 28: - -/* Line 1455 of yacc.c */ -#line 456 "lev_comp.y" +#line 456 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = 1 + (yyvsp[(2) - (2)].i); + (yyval.i) = 1 + (yyvsp[0].i); } +#line 2679 "y.tab.c" /* yacc.c:1646 */ break; case 29: - -/* Line 1455 of yacc.c */ -#line 462 "lev_comp.y" +#line 462 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(2) - (3)].i); + (yyval.i) = (yyvsp[-1].i); } +#line 2687 "y.tab.c" /* yacc.c:1646 */ break; case 97: - -/* Line 1455 of yacc.c */ -#line 545 "lev_comp.y" +#line 545 "lev_comp.y" /* yacc.c:1646 */ { struct lc_vardefs *vd; - if ((vd = vardef_defined(variable_definitions, (yyvsp[(3) - (3)].map), 1))) { + if ((vd = vardef_defined(variable_definitions, (yyvsp[0].map), 1))) { if (!(vd->var_type & SPOVAR_ARRAY)) - lc_error("Trying to shuffle non-array variable '%s'", (yyvsp[(3) - (3)].map)); - } else lc_error("Trying to shuffle undefined variable '%s'", (yyvsp[(3) - (3)].map)); - add_opvars(splev, "so", VA_PASS2((yyvsp[(3) - (3)].map), SPO_SHUFFLE_ARRAY)); - Free((yyvsp[(3) - (3)].map)); + lc_error("Trying to shuffle non-array variable '%s'", (yyvsp[0].map)); + } else lc_error("Trying to shuffle undefined variable '%s'", (yyvsp[0].map)); + add_opvars(splev, "so", VA_PASS2((yyvsp[0].map), SPO_SHUFFLE_ARRAY)); + Free((yyvsp[0].map)); } +#line 2701 "y.tab.c" /* yacc.c:1646 */ break; case 98: - -/* Line 1455 of yacc.c */ -#line 557 "lev_comp.y" +#line 557 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_INT); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (3)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_INT); + add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-2].map), SPO_VAR_INIT)); + Free((yyvsp[-2].map)); } +#line 2711 "y.tab.c" /* yacc.c:1646 */ break; case 99: - -/* Line 1455 of yacc.c */ -#line 563 "lev_comp.y" +#line 563 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_SEL); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (5)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_SEL); + add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-4].map), SPO_VAR_INIT)); + Free((yyvsp[-4].map)); } +#line 2721 "y.tab.c" /* yacc.c:1646 */ break; case 100: - -/* Line 1455 of yacc.c */ -#line 569 "lev_comp.y" +#line 569 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_STRING); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (3)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_STRING); + add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-2].map), SPO_VAR_INIT)); + Free((yyvsp[-2].map)); } +#line 2731 "y.tab.c" /* yacc.c:1646 */ break; case 101: - -/* Line 1455 of yacc.c */ -#line 575 "lev_comp.y" +#line 575 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_MAPCHAR); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (5)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_MAPCHAR); + add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-4].map), SPO_VAR_INIT)); + Free((yyvsp[-4].map)); } +#line 2741 "y.tab.c" /* yacc.c:1646 */ break; case 102: - -/* Line 1455 of yacc.c */ -#line 581 "lev_comp.y" +#line 581 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_MONST); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (5)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_MONST); + add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-4].map), SPO_VAR_INIT)); + Free((yyvsp[-4].map)); } +#line 2751 "y.tab.c" /* yacc.c:1646 */ break; case 103: - -/* Line 1455 of yacc.c */ -#line 587 "lev_comp.y" +#line 587 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_OBJ); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (5)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_OBJ); + add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-4].map), SPO_VAR_INIT)); + Free((yyvsp[-4].map)); } +#line 2761 "y.tab.c" /* yacc.c:1646 */ break; case 104: - -/* Line 1455 of yacc.c */ -#line 593 "lev_comp.y" +#line 593 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_COORD); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (3)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_COORD); + add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-2].map), SPO_VAR_INIT)); + Free((yyvsp[-2].map)); } +#line 2771 "y.tab.c" /* yacc.c:1646 */ break; case 105: - -/* Line 1455 of yacc.c */ -#line 599 "lev_comp.y" +#line 599 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_REGION); - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (3)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_REGION); + add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-2].map), SPO_VAR_INIT)); + Free((yyvsp[-2].map)); } +#line 2781 "y.tab.c" /* yacc.c:1646 */ break; case 106: - -/* Line 1455 of yacc.c */ -#line 605 "lev_comp.y" +#line 605 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(4) - (5)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_INT|SPOVAR_ARRAY); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_INT|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (5)].map)); + VA_PASS3(n_items, (yyvsp[-4].map), SPO_VAR_INIT)); + Free((yyvsp[-4].map)); } +#line 2793 "y.tab.c" /* yacc.c:1646 */ break; case 107: - -/* Line 1455 of yacc.c */ -#line 613 "lev_comp.y" +#line 613 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(4) - (5)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_COORD|SPOVAR_ARRAY); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_COORD|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (5)].map)); + VA_PASS3(n_items, (yyvsp[-4].map), SPO_VAR_INIT)); + Free((yyvsp[-4].map)); } +#line 2805 "y.tab.c" /* yacc.c:1646 */ break; case 108: - -/* Line 1455 of yacc.c */ -#line 621 "lev_comp.y" +#line 621 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(4) - (5)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_REGION|SPOVAR_ARRAY); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_REGION|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (5)].map)); + VA_PASS3(n_items, (yyvsp[-4].map), SPO_VAR_INIT)); + Free((yyvsp[-4].map)); } +#line 2817 "y.tab.c" /* yacc.c:1646 */ break; case 109: - -/* Line 1455 of yacc.c */ -#line 629 "lev_comp.y" +#line 629 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(6) - (7)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (7)].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-6].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[(1) - (7)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (7)].map)); + VA_PASS3(n_items, (yyvsp[-6].map), SPO_VAR_INIT)); + Free((yyvsp[-6].map)); } +#line 2829 "y.tab.c" /* yacc.c:1646 */ break; case 110: - -/* Line 1455 of yacc.c */ -#line 637 "lev_comp.y" +#line 637 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(6) - (7)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (7)].map), SPOVAR_MONST|SPOVAR_ARRAY); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-6].map), SPOVAR_MONST|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[(1) - (7)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (7)].map)); + VA_PASS3(n_items, (yyvsp[-6].map), SPO_VAR_INIT)); + Free((yyvsp[-6].map)); } +#line 2841 "y.tab.c" /* yacc.c:1646 */ break; case 111: - -/* Line 1455 of yacc.c */ -#line 645 "lev_comp.y" +#line 645 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(6) - (7)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (7)].map), SPOVAR_OBJ|SPOVAR_ARRAY); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-6].map), SPOVAR_OBJ|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[(1) - (7)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (7)].map)); + VA_PASS3(n_items, (yyvsp[-6].map), SPO_VAR_INIT)); + Free((yyvsp[-6].map)); } +#line 2853 "y.tab.c" /* yacc.c:1646 */ break; case 112: - -/* Line 1455 of yacc.c */ -#line 653 "lev_comp.y" +#line 653 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(4) - (5)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_STRING|SPOVAR_ARRAY); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_STRING|SPOVAR_ARRAY); add_opvars(splev, "iso", - VA_PASS3(n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT)); - Free((yyvsp[(1) - (5)].map)); + VA_PASS3(n_items, (yyvsp[-4].map), SPO_VAR_INIT)); + Free((yyvsp[-4].map)); } +#line 2865 "y.tab.c" /* yacc.c:1646 */ break; case 113: - -/* Line 1455 of yacc.c */ -#line 663 "lev_comp.y" +#line 663 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "O", VA_PASS1((yyvsp[(1) - (1)].i))); + add_opvars(splev, "O", VA_PASS1((yyvsp[0].i))); (yyval.i) = 1; } +#line 2874 "y.tab.c" /* yacc.c:1646 */ break; case 114: - -/* Line 1455 of yacc.c */ -#line 668 "lev_comp.y" +#line 668 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "O", VA_PASS1((yyvsp[(3) - (3)].i))); - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + add_opvars(splev, "O", VA_PASS1((yyvsp[0].i))); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2883 "y.tab.c" /* yacc.c:1646 */ break; case 115: - -/* Line 1455 of yacc.c */ -#line 675 "lev_comp.y" +#line 675 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "M", VA_PASS1((yyvsp[(1) - (1)].i))); + add_opvars(splev, "M", VA_PASS1((yyvsp[0].i))); (yyval.i) = 1; } +#line 2892 "y.tab.c" /* yacc.c:1646 */ break; case 116: - -/* Line 1455 of yacc.c */ -#line 680 "lev_comp.y" +#line 680 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "M", VA_PASS1((yyvsp[(3) - (3)].i))); - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + add_opvars(splev, "M", VA_PASS1((yyvsp[0].i))); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2901 "y.tab.c" /* yacc.c:1646 */ break; case 117: - -/* Line 1455 of yacc.c */ -#line 687 "lev_comp.y" +#line 687 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "m", VA_PASS1((yyvsp[(1) - (1)].i))); + add_opvars(splev, "m", VA_PASS1((yyvsp[0].i))); (yyval.i) = 1; } +#line 2910 "y.tab.c" /* yacc.c:1646 */ break; case 118: - -/* Line 1455 of yacc.c */ -#line 692 "lev_comp.y" +#line 692 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "m", VA_PASS1((yyvsp[(3) - (3)].i))); - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + add_opvars(splev, "m", VA_PASS1((yyvsp[0].i))); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2919 "y.tab.c" /* yacc.c:1646 */ break; case 119: - -/* Line 1455 of yacc.c */ -#line 699 "lev_comp.y" +#line 699 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 1; } +#line 2927 "y.tab.c" /* yacc.c:1646 */ break; case 120: - -/* Line 1455 of yacc.c */ -#line 703 "lev_comp.y" +#line 703 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2935 "y.tab.c" /* yacc.c:1646 */ break; case 121: - -/* Line 1455 of yacc.c */ -#line 709 "lev_comp.y" +#line 709 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "c", VA_PASS1((yyvsp[(1) - (1)].i))); + add_opvars(splev, "c", VA_PASS1((yyvsp[0].i))); (yyval.i) = 1; } +#line 2944 "y.tab.c" /* yacc.c:1646 */ break; case 122: - -/* Line 1455 of yacc.c */ -#line 714 "lev_comp.y" +#line 714 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "c", VA_PASS1((yyvsp[(3) - (3)].i))); - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + add_opvars(splev, "c", VA_PASS1((yyvsp[0].i))); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2953 "y.tab.c" /* yacc.c:1646 */ break; case 123: - -/* Line 1455 of yacc.c */ -#line 721 "lev_comp.y" +#line 721 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 1; } +#line 2961 "y.tab.c" /* yacc.c:1646 */ break; case 124: - -/* Line 1455 of yacc.c */ -#line 725 "lev_comp.y" +#line 725 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2969 "y.tab.c" /* yacc.c:1646 */ break; case 125: - -/* Line 1455 of yacc.c */ -#line 731 "lev_comp.y" +#line 731 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 1; } +#line 2977 "y.tab.c" /* yacc.c:1646 */ break; case 126: - -/* Line 1455 of yacc.c */ -#line 735 "lev_comp.y" +#line 735 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2985 "y.tab.c" /* yacc.c:1646 */ break; case 127: - -/* Line 1455 of yacc.c */ -#line 741 "lev_comp.y" +#line 741 "lev_comp.y" /* yacc.c:1646 */ { struct lc_funcdefs *funcdef; if (in_function_definition) - lc_error("Recursively defined functions not allowed (function %s).", (yyvsp[(2) - (3)].map)); + lc_error("Recursively defined functions not allowed (function %s).", (yyvsp[-1].map)); in_function_definition++; - if (funcdef_defined(function_definitions, (yyvsp[(2) - (3)].map), 1)) - lc_error("Function '%s' already defined once.", (yyvsp[(2) - (3)].map)); + if (funcdef_defined(function_definitions, (yyvsp[-1].map), 1)) + lc_error("Function '%s' already defined once.", (yyvsp[-1].map)); - funcdef = funcdef_new(-1, (yyvsp[(2) - (3)].map)); + funcdef = funcdef_new(-1, (yyvsp[-1].map)); funcdef->next = function_definitions; function_definitions = funcdef; function_splev_backup = splev; splev = &(funcdef->code); - Free((yyvsp[(2) - (3)].map)); + Free((yyvsp[-1].map)); curr_function = funcdef; function_tmp_var_defs = variable_definitions; variable_definitions = NULL; } +#line 3011 "y.tab.c" /* yacc.c:1646 */ break; case 128: - -/* Line 1455 of yacc.c */ -#line 763 "lev_comp.y" +#line 763 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 3019 "y.tab.c" /* yacc.c:1646 */ break; case 129: - -/* Line 1455 of yacc.c */ -#line 767 "lev_comp.y" +#line 767 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", VA_PASS2(0, SPO_RETURN)); splev = function_splev_backup; @@ -3376,26 +3028,25 @@ yyreduce: vardef_free_all(variable_definitions); variable_definitions = function_tmp_var_defs; } +#line 3032 "y.tab.c" /* yacc.c:1646 */ break; case 130: - -/* Line 1455 of yacc.c */ -#line 778 "lev_comp.y" +#line 778 "lev_comp.y" /* yacc.c:1646 */ { struct lc_funcdefs *tmpfunc; - tmpfunc = funcdef_defined(function_definitions, (yyvsp[(1) - (4)].map), 1); + tmpfunc = funcdef_defined(function_definitions, (yyvsp[-3].map), 1); if (tmpfunc) { long l; - long nparams = strlen( (yyvsp[(3) - (4)].map) ); + long nparams = strlen( (yyvsp[-1].map) ); char *fparamstr = funcdef_paramtypes(tmpfunc); - if (strcmp((yyvsp[(3) - (4)].map), fparamstr)) { + if (strcmp((yyvsp[-1].map), fparamstr)) { char *tmps = strdup(decode_parm_str(fparamstr)); - lc_error("Function '%s' requires params '%s', got '%s' instead.", (yyvsp[(1) - (4)].map), tmps, decode_parm_str((yyvsp[(3) - (4)].map))); + lc_error("Function '%s' requires params '%s', got '%s' instead.", (yyvsp[-3].map), tmps, decode_parm_str((yyvsp[-1].map))); Free(tmps); } Free(fparamstr); - Free((yyvsp[(3) - (4)].map)); + Free((yyvsp[-1].map)); if (!(tmpfunc->n_called)) { /* we haven't called the function yet, so insert it in the code */ struct opvar *jmp = New(struct opvar); @@ -3423,84 +3074,76 @@ yyreduce: VA_PASS3(nparams, l, SPO_CALL)); tmpfunc->n_called++; } else { - lc_error("Function '%s' not defined.", (yyvsp[(1) - (4)].map)); + lc_error("Function '%s' not defined.", (yyvsp[-3].map)); } - Free((yyvsp[(1) - (4)].map)); + Free((yyvsp[-3].map)); } +#line 3082 "y.tab.c" /* yacc.c:1646 */ break; case 131: - -/* Line 1455 of yacc.c */ -#line 826 "lev_comp.y" +#line 826 "lev_comp.y" /* yacc.c:1646 */ { add_opcode(splev, SPO_EXIT, NULL); } +#line 3090 "y.tab.c" /* yacc.c:1646 */ break; case 132: - -/* Line 1455 of yacc.c */ -#line 832 "lev_comp.y" +#line 832 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 100; } +#line 3098 "y.tab.c" /* yacc.c:1646 */ break; case 133: - -/* Line 1455 of yacc.c */ -#line 836 "lev_comp.y" +#line 836 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (1)].i); + (yyval.i) = (yyvsp[0].i); } +#line 3106 "y.tab.c" /* yacc.c:1646 */ break; case 134: - -/* Line 1455 of yacc.c */ -#line 842 "lev_comp.y" +#line 842 "lev_comp.y" /* yacc.c:1646 */ { /* val > rn2(100) */ add_opvars(splev, "iio", - VA_PASS3((long)(yyvsp[(1) - (1)].i), 100, SPO_RN2)); + VA_PASS3((long)(yyvsp[0].i), 100, SPO_RN2)); (yyval.i) = SPO_JG; } +#line 3117 "y.tab.c" /* yacc.c:1646 */ break; case 135: - -/* Line 1455 of yacc.c */ -#line 849 "lev_comp.y" +#line 849 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(3) - (5)].i); + (yyval.i) = (yyvsp[-2].i); } +#line 3125 "y.tab.c" /* yacc.c:1646 */ break; case 136: - -/* Line 1455 of yacc.c */ -#line 853 "lev_comp.y" +#line 853 "lev_comp.y" /* yacc.c:1646 */ { /* boolean, explicit foo != 0 */ add_opvars(splev, "i", VA_PASS1(0)); (yyval.i) = SPO_JNE; } +#line 3135 "y.tab.c" /* yacc.c:1646 */ break; case 137: - -/* Line 1455 of yacc.c */ -#line 861 "lev_comp.y" +#line 861 "lev_comp.y" /* yacc.c:1646 */ { is_inconstant_number = 0; } +#line 3143 "y.tab.c" /* yacc.c:1646 */ break; case 138: - -/* Line 1455 of yacc.c */ -#line 865 "lev_comp.y" +#line 865 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *chkjmp; if (in_switch_statement > 0) @@ -3522,12 +3165,11 @@ yyreduce: add_opcode(splev, SPO_JMP, NULL); break_stmt_start(); } +#line 3169 "y.tab.c" /* yacc.c:1646 */ break; case 139: - -/* Line 1455 of yacc.c */ -#line 887 "lev_comp.y" +#line 887 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *endjump = New(struct opvar); int i; @@ -3566,34 +3208,31 @@ yyreduce: } +#line 3212 "y.tab.c" /* yacc.c:1646 */ break; case 142: - -/* Line 1455 of yacc.c */ -#line 932 "lev_comp.y" +#line 932 "lev_comp.y" /* yacc.c:1646 */ { if (n_switch_case_list < MAX_SWITCH_CASES) { struct opvar *tmppush = New(struct opvar); set_opvar_int(tmppush, splev->n_opcodes); - switch_case_value[n_switch_case_list] = (yyvsp[(2) - (3)].i); + switch_case_value[n_switch_case_list] = (yyvsp[-1].i); switch_case_list[n_switch_case_list++] = tmppush; } else lc_error("Too many cases in a switch."); } +#line 3225 "y.tab.c" /* yacc.c:1646 */ break; case 143: - -/* Line 1455 of yacc.c */ -#line 941 "lev_comp.y" +#line 941 "lev_comp.y" /* yacc.c:1646 */ { } +#line 3232 "y.tab.c" /* yacc.c:1646 */ break; case 144: - -/* Line 1455 of yacc.c */ -#line 944 "lev_comp.y" +#line 944 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *tmppush = New(struct opvar); @@ -3603,20 +3242,18 @@ yyreduce: set_opvar_int(tmppush, splev->n_opcodes); switch_default_case = tmppush; } +#line 3246 "y.tab.c" /* yacc.c:1646 */ break; case 145: - -/* Line 1455 of yacc.c */ -#line 954 "lev_comp.y" +#line 954 "lev_comp.y" /* yacc.c:1646 */ { } +#line 3253 "y.tab.c" /* yacc.c:1646 */ break; case 146: - -/* Line 1455 of yacc.c */ -#line 959 "lev_comp.y" +#line 959 "lev_comp.y" /* yacc.c:1646 */ { if (!allow_break_statements) lc_error("Cannot use BREAK outside a statement block."); @@ -3624,12 +3261,11 @@ yyreduce: break_stmt_new(splev, splev->n_opcodes); } } +#line 3265 "y.tab.c" /* yacc.c:1646 */ break; case 149: - -/* Line 1455 of yacc.c */ -#line 973 "lev_comp.y" +#line 973 "lev_comp.y" /* yacc.c:1646 */ { char buf[256], buf2[256]; @@ -3639,48 +3275,46 @@ yyreduce: } /* first, define a variable for the for-loop end value */ - snprintf(buf, 255, "%s end", (yyvsp[(2) - (6)].map)); + snprintf(buf, 255, "%s end", (yyvsp[-4].map)); /* the value of which is already in stack (the 2nd math_expr) */ add_opvars(splev, "iso", VA_PASS3(0, buf, SPO_VAR_INIT)); variable_definitions = add_vardef_type(variable_definitions, - (yyvsp[(2) - (6)].map), SPOVAR_INT); + (yyvsp[-4].map), SPOVAR_INT); /* define the for-loop variable. value is in stack (1st math_expr) */ - add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[(2) - (6)].map), SPO_VAR_INIT)); + add_opvars(splev, "iso", VA_PASS3(0, (yyvsp[-4].map), SPO_VAR_INIT)); /* calculate value for the loop "step" variable */ - snprintf(buf2, 255, "%s step", (yyvsp[(2) - (6)].map)); + snprintf(buf2, 255, "%s step", (yyvsp[-4].map)); /* end - start */ add_opvars(splev, "vvo", - VA_PASS3(buf, (yyvsp[(2) - (6)].map), SPO_MATH_SUB)); + VA_PASS3(buf, (yyvsp[-4].map), SPO_MATH_SUB)); /* sign of that */ add_opvars(splev, "o", VA_PASS1(SPO_MATH_SIGN)); /* save the sign into the step var */ add_opvars(splev, "iso", VA_PASS3(0, buf2, SPO_VAR_INIT)); - forloop_list[n_forloops].varname = strdup((yyvsp[(2) - (6)].map)); + forloop_list[n_forloops].varname = strdup((yyvsp[-4].map)); forloop_list[n_forloops].jmp_point = splev->n_opcodes; n_forloops++; - Free((yyvsp[(2) - (6)].map)); + Free((yyvsp[-4].map)); } +#line 3305 "y.tab.c" /* yacc.c:1646 */ break; case 150: - -/* Line 1455 of yacc.c */ -#line 1011 "lev_comp.y" +#line 1011 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ break_stmt_start(); } +#line 3314 "y.tab.c" /* yacc.c:1646 */ break; case 151: - -/* Line 1455 of yacc.c */ -#line 1016 "lev_comp.y" +#line 1016 "lev_comp.y" /* yacc.c:1646 */ { char buf[256], buf2[256]; n_forloops--; @@ -3706,12 +3340,11 @@ yyreduce: Free(forloop_list[n_forloops].varname); break_stmt_end(splev); } +#line 3344 "y.tab.c" /* yacc.c:1646 */ break; case 152: - -/* Line 1455 of yacc.c */ -#line 1044 "lev_comp.y" +#line 1044 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *tmppush = New(struct opvar); @@ -3725,12 +3358,11 @@ yyreduce: add_opvars(splev, "o", VA_PASS1(SPO_DEC)); break_stmt_start(); } +#line 3362 "y.tab.c" /* yacc.c:1646 */ break; case 153: - -/* Line 1455 of yacc.c */ -#line 1058 "lev_comp.y" +#line 1058 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *tmppush; @@ -3743,12 +3375,11 @@ yyreduce: add_opcode(splev, SPO_POP, NULL); /* get rid of the count value in stack */ break_stmt_end(splev); } +#line 3379 "y.tab.c" /* yacc.c:1646 */ break; case 154: - -/* Line 1455 of yacc.c */ -#line 1073 "lev_comp.y" +#line 1073 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *tmppush2 = New(struct opvar); @@ -3765,15 +3396,14 @@ yyreduce: add_opcode(splev, SPO_PUSH, tmppush2); - add_opcode(splev, reverse_jmp_opcode( (yyvsp[(1) - (2)].i) ), NULL); + add_opcode(splev, reverse_jmp_opcode( (yyvsp[-1].i) ), NULL); } +#line 3403 "y.tab.c" /* yacc.c:1646 */ break; case 155: - -/* Line 1455 of yacc.c */ -#line 1093 "lev_comp.y" +#line 1093 "lev_comp.y" /* yacc.c:1646 */ { if (n_if_list > 0) { struct opvar *tmppush; @@ -3781,12 +3411,11 @@ yyreduce: set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); } else lc_error("IF: Huh?! No start address?"); } +#line 3415 "y.tab.c" /* yacc.c:1646 */ break; case 156: - -/* Line 1455 of yacc.c */ -#line 1103 "lev_comp.y" +#line 1103 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *tmppush2 = New(struct opvar); @@ -3803,24 +3432,22 @@ yyreduce: add_opcode(splev, SPO_PUSH, tmppush2); - add_opcode(splev, reverse_jmp_opcode( (yyvsp[(2) - (2)].i) ), NULL); + add_opcode(splev, reverse_jmp_opcode( (yyvsp[0].i) ), NULL); } +#line 3439 "y.tab.c" /* yacc.c:1646 */ break; case 157: - -/* Line 1455 of yacc.c */ -#line 1123 "lev_comp.y" +#line 1123 "lev_comp.y" /* yacc.c:1646 */ { /* do nothing */ } +#line 3447 "y.tab.c" /* yacc.c:1646 */ break; case 158: - -/* Line 1455 of yacc.c */ -#line 1129 "lev_comp.y" +#line 1129 "lev_comp.y" /* yacc.c:1646 */ { if (n_if_list > 0) { struct opvar *tmppush; @@ -3828,12 +3455,11 @@ yyreduce: set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); } else lc_error("IF: Huh?! No start address?"); } +#line 3459 "y.tab.c" /* yacc.c:1646 */ break; case 159: - -/* Line 1455 of yacc.c */ -#line 1137 "lev_comp.y" +#line 1137 "lev_comp.y" /* yacc.c:1646 */ { if (n_if_list > 0) { struct opvar *tmppush = New(struct opvar); @@ -3850,12 +3476,11 @@ yyreduce: if_list[n_if_list++] = tmppush; } else lc_error("IF: Huh?! No else-part address?"); } +#line 3480 "y.tab.c" /* yacc.c:1646 */ break; case 160: - -/* Line 1455 of yacc.c */ -#line 1154 "lev_comp.y" +#line 1154 "lev_comp.y" /* yacc.c:1646 */ { if (n_if_list > 0) { struct opvar *tmppush; @@ -3863,610 +3488,555 @@ yyreduce: set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); } else lc_error("IF: Huh?! No end address?"); } +#line 3492 "y.tab.c" /* yacc.c:1646 */ break; case 161: - -/* Line 1455 of yacc.c */ -#line 1164 "lev_comp.y" +#line 1164 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_MESSAGE)); } +#line 3500 "y.tab.c" /* yacc.c:1646 */ break; case 162: - -/* Line 1455 of yacc.c */ -#line 1170 "lev_comp.y" +#line 1170 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiiiio", VA_PASS7(-1, 0, -1, -1, -1, -1, SPO_CORRIDOR)); } +#line 3509 "y.tab.c" /* yacc.c:1646 */ break; case 163: - -/* Line 1455 of yacc.c */ -#line 1175 "lev_comp.y" +#line 1175 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiiiio", - VA_PASS7(-1, (yyvsp[(3) - (3)].i), -1, -1, -1, -1, SPO_CORRIDOR)); + VA_PASS7(-1, (yyvsp[0].i), -1, -1, -1, -1, SPO_CORRIDOR)); } +#line 3518 "y.tab.c" /* yacc.c:1646 */ break; case 164: - -/* Line 1455 of yacc.c */ -#line 1180 "lev_comp.y" +#line 1180 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiiiio", VA_PASS7(-1, -1, -1, -1, -1, -1, SPO_CORRIDOR)); } +#line 3527 "y.tab.c" /* yacc.c:1646 */ break; case 165: - -/* Line 1455 of yacc.c */ -#line 1187 "lev_comp.y" +#line 1187 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiiiio", - VA_PASS7((yyvsp[(3) - (5)].corpos).room, (yyvsp[(3) - (5)].corpos).door, (yyvsp[(3) - (5)].corpos).wall, - (yyvsp[(5) - (5)].corpos).room, (yyvsp[(5) - (5)].corpos).door, (yyvsp[(5) - (5)].corpos).wall, + VA_PASS7((yyvsp[-2].corpos).room, (yyvsp[-2].corpos).door, (yyvsp[-2].corpos).wall, + (yyvsp[0].corpos).room, (yyvsp[0].corpos).door, (yyvsp[0].corpos).wall, SPO_CORRIDOR)); } +#line 3538 "y.tab.c" /* yacc.c:1646 */ break; case 166: - -/* Line 1455 of yacc.c */ -#line 1194 "lev_comp.y" +#line 1194 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiiiio", - VA_PASS7((yyvsp[(3) - (5)].corpos).room, (yyvsp[(3) - (5)].corpos).door, (yyvsp[(3) - (5)].corpos).wall, - -1, -1, (long)(yyvsp[(5) - (5)].i), + VA_PASS7((yyvsp[-2].corpos).room, (yyvsp[-2].corpos).door, (yyvsp[-2].corpos).wall, + -1, -1, (long)(yyvsp[0].i), SPO_CORRIDOR)); } +#line 3549 "y.tab.c" /* yacc.c:1646 */ break; case 167: - -/* Line 1455 of yacc.c */ -#line 1203 "lev_comp.y" +#line 1203 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.corpos).room = (yyvsp[(2) - (7)].i); - (yyval.corpos).wall = (yyvsp[(4) - (7)].i); - (yyval.corpos).door = (yyvsp[(6) - (7)].i); + (yyval.corpos).room = (yyvsp[-5].i); + (yyval.corpos).wall = (yyvsp[-3].i); + (yyval.corpos).door = (yyvsp[-1].i); } +#line 3559 "y.tab.c" /* yacc.c:1646 */ break; case 168: - -/* Line 1455 of yacc.c */ -#line 1211 "lev_comp.y" +#line 1211 "lev_comp.y" /* yacc.c:1646 */ { - if (((yyvsp[(2) - (4)].i) < 100) && ((yyvsp[(1) - (4)].i) == OROOM)) + if (((yyvsp[-2].i) < 100) && ((yyvsp[-3].i) == OROOM)) lc_error("Only typed rooms can have a chance."); else { add_opvars(splev, "iii", - VA_PASS3((long)(yyvsp[(1) - (4)].i), (long)(yyvsp[(2) - (4)].i), (long)(yyvsp[(4) - (4)].i))); + VA_PASS3((long)(yyvsp[-3].i), (long)(yyvsp[-2].i), (long)(yyvsp[0].i))); } } +#line 3572 "y.tab.c" /* yacc.c:1646 */ break; case 169: - -/* Line 1455 of yacc.c */ -#line 1222 "lev_comp.y" +#line 1222 "lev_comp.y" /* yacc.c:1646 */ { - long rflags = (yyvsp[(8) - (8)].i); + long rflags = (yyvsp[0].i); if (rflags == -1) rflags = (1 << 0); add_opvars(splev, "iiiiiiio", VA_PASS8(rflags, ERR, ERR, - (yyvsp[(5) - (8)].crd).x, (yyvsp[(5) - (8)].crd).y, (yyvsp[(7) - (8)].sze).width, (yyvsp[(7) - (8)].sze).height, + (yyvsp[-3].crd).x, (yyvsp[-3].crd).y, (yyvsp[-1].sze).width, (yyvsp[-1].sze).height, SPO_SUBROOM)); break_stmt_start(); } +#line 3587 "y.tab.c" /* yacc.c:1646 */ break; case 170: - -/* Line 1455 of yacc.c */ -#line 1233 "lev_comp.y" +#line 1233 "lev_comp.y" /* yacc.c:1646 */ { break_stmt_end(splev); add_opcode(splev, SPO_ENDROOM, NULL); } +#line 3596 "y.tab.c" /* yacc.c:1646 */ break; case 171: - -/* Line 1455 of yacc.c */ -#line 1240 "lev_comp.y" +#line 1240 "lev_comp.y" /* yacc.c:1646 */ { - long rflags = (yyvsp[(8) - (10)].i); + long rflags = (yyvsp[-2].i); if (rflags == -1) rflags = (1 << 0); add_opvars(splev, "iiiiiiio", VA_PASS8(rflags, - (yyvsp[(7) - (10)].crd).x, (yyvsp[(7) - (10)].crd).y, (yyvsp[(5) - (10)].crd).x, (yyvsp[(5) - (10)].crd).y, - (yyvsp[(9) - (10)].sze).width, (yyvsp[(9) - (10)].sze).height, SPO_ROOM)); + (yyvsp[-3].crd).x, (yyvsp[-3].crd).y, (yyvsp[-5].crd).x, (yyvsp[-5].crd).y, + (yyvsp[-1].sze).width, (yyvsp[-1].sze).height, SPO_ROOM)); break_stmt_start(); } +#line 3611 "y.tab.c" /* yacc.c:1646 */ break; case 172: - -/* Line 1455 of yacc.c */ -#line 1251 "lev_comp.y" +#line 1251 "lev_comp.y" /* yacc.c:1646 */ { break_stmt_end(splev); add_opcode(splev, SPO_ENDROOM, NULL); } +#line 3620 "y.tab.c" /* yacc.c:1646 */ break; case 173: - -/* Line 1455 of yacc.c */ -#line 1258 "lev_comp.y" +#line 1258 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 1; } +#line 3628 "y.tab.c" /* yacc.c:1646 */ break; case 174: - -/* Line 1455 of yacc.c */ -#line 1262 "lev_comp.y" +#line 1262 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(2) - (2)].i); + (yyval.i) = (yyvsp[0].i); } +#line 3636 "y.tab.c" /* yacc.c:1646 */ break; case 175: - -/* Line 1455 of yacc.c */ -#line 1268 "lev_comp.y" +#line 1268 "lev_comp.y" /* yacc.c:1646 */ { - if ( (yyvsp[(2) - (5)].i) < 1 || (yyvsp[(2) - (5)].i) > 5 || - (yyvsp[(4) - (5)].i) < 1 || (yyvsp[(4) - (5)].i) > 5 ) { - lc_error("Room positions should be between 1-5: (%li,%li)!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + if ( (yyvsp[-3].i) < 1 || (yyvsp[-3].i) > 5 || + (yyvsp[-1].i) < 1 || (yyvsp[-1].i) > 5 ) { + lc_error("Room positions should be between 1-5: (%li,%li)!", (yyvsp[-3].i), (yyvsp[-1].i)); } else { - (yyval.crd).x = (yyvsp[(2) - (5)].i); - (yyval.crd).y = (yyvsp[(4) - (5)].i); + (yyval.crd).x = (yyvsp[-3].i); + (yyval.crd).y = (yyvsp[-1].i); } } +#line 3650 "y.tab.c" /* yacc.c:1646 */ break; case 176: - -/* Line 1455 of yacc.c */ -#line 1278 "lev_comp.y" +#line 1278 "lev_comp.y" /* yacc.c:1646 */ { (yyval.crd).x = (yyval.crd).y = ERR; } +#line 3658 "y.tab.c" /* yacc.c:1646 */ break; case 177: - -/* Line 1455 of yacc.c */ -#line 1284 "lev_comp.y" +#line 1284 "lev_comp.y" /* yacc.c:1646 */ { - if ( (yyvsp[(2) - (5)].i) < 0 || (yyvsp[(4) - (5)].i) < 0) { - lc_error("Invalid subroom position (%li,%li)!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + if ( (yyvsp[-3].i) < 0 || (yyvsp[-1].i) < 0) { + lc_error("Invalid subroom position (%li,%li)!", (yyvsp[-3].i), (yyvsp[-1].i)); } else { - (yyval.crd).x = (yyvsp[(2) - (5)].i); - (yyval.crd).y = (yyvsp[(4) - (5)].i); + (yyval.crd).x = (yyvsp[-3].i); + (yyval.crd).y = (yyvsp[-1].i); } } +#line 3671 "y.tab.c" /* yacc.c:1646 */ break; case 178: - -/* Line 1455 of yacc.c */ -#line 1293 "lev_comp.y" +#line 1293 "lev_comp.y" /* yacc.c:1646 */ { (yyval.crd).x = (yyval.crd).y = ERR; } +#line 3679 "y.tab.c" /* yacc.c:1646 */ break; case 179: - -/* Line 1455 of yacc.c */ -#line 1299 "lev_comp.y" +#line 1299 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.crd).x = (yyvsp[(2) - (5)].i); - (yyval.crd).y = (yyvsp[(4) - (5)].i); + (yyval.crd).x = (yyvsp[-3].i); + (yyval.crd).y = (yyvsp[-1].i); } +#line 3688 "y.tab.c" /* yacc.c:1646 */ break; case 180: - -/* Line 1455 of yacc.c */ -#line 1304 "lev_comp.y" +#line 1304 "lev_comp.y" /* yacc.c:1646 */ { (yyval.crd).x = (yyval.crd).y = ERR; } +#line 3696 "y.tab.c" /* yacc.c:1646 */ break; case 181: - -/* Line 1455 of yacc.c */ -#line 1310 "lev_comp.y" +#line 1310 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.sze).width = (yyvsp[(2) - (5)].i); - (yyval.sze).height = (yyvsp[(4) - (5)].i); + (yyval.sze).width = (yyvsp[-3].i); + (yyval.sze).height = (yyvsp[-1].i); } +#line 3705 "y.tab.c" /* yacc.c:1646 */ break; case 182: - -/* Line 1455 of yacc.c */ -#line 1315 "lev_comp.y" +#line 1315 "lev_comp.y" /* yacc.c:1646 */ { (yyval.sze).height = (yyval.sze).width = ERR; } +#line 3713 "y.tab.c" /* yacc.c:1646 */ break; case 183: - -/* Line 1455 of yacc.c */ -#line 1321 "lev_comp.y" +#line 1321 "lev_comp.y" /* yacc.c:1646 */ { /* ERR means random here */ - if ((yyvsp[(7) - (9)].i) == ERR && (yyvsp[(9) - (9)].i) != ERR) { + if ((yyvsp[-2].i) == ERR && (yyvsp[0].i) != ERR) { lc_error("If the door wall is random, so must be its pos!"); } else { add_opvars(splev, "iiiio", - VA_PASS5((long)(yyvsp[(9) - (9)].i), (long)(yyvsp[(5) - (9)].i), (long)(yyvsp[(3) - (9)].i), - (long)(yyvsp[(7) - (9)].i), SPO_ROOM_DOOR)); + VA_PASS5((long)(yyvsp[0].i), (long)(yyvsp[-4].i), (long)(yyvsp[-6].i), + (long)(yyvsp[-2].i), SPO_ROOM_DOOR)); } } +#line 3728 "y.tab.c" /* yacc.c:1646 */ break; case 184: - -/* Line 1455 of yacc.c */ -#line 1332 "lev_comp.y" +#line 1332 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", VA_PASS2((long)(yyvsp[(3) - (5)].i), SPO_DOOR)); + add_opvars(splev, "io", VA_PASS2((long)(yyvsp[-2].i), SPO_DOOR)); } +#line 3736 "y.tab.c" /* yacc.c:1646 */ break; case 189: - -/* Line 1455 of yacc.c */ -#line 1346 "lev_comp.y" +#line 1346 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (1)].i); + (yyval.i) = (yyvsp[0].i); } +#line 3744 "y.tab.c" /* yacc.c:1646 */ break; case 190: - -/* Line 1455 of yacc.c */ -#line 1350 "lev_comp.y" +#line 1350 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = ((yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i)); + (yyval.i) = ((yyvsp[-2].i) | (yyvsp[0].i)); } +#line 3752 "y.tab.c" /* yacc.c:1646 */ break; case 193: - -/* Line 1455 of yacc.c */ -#line 1360 "lev_comp.y" +#line 1360 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ciisiio", VA_PASS7(0, 0, 1, (char *)0, 0, 0, SPO_MAP)); max_x_map = COLNO-1; max_y_map = ROWNO; } +#line 3763 "y.tab.c" /* yacc.c:1646 */ break; case 194: - -/* Line 1455 of yacc.c */ -#line 1367 "lev_comp.y" +#line 1367 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "cii", - VA_PASS3(SP_COORD_PACK(((yyvsp[(3) - (7)].i)),((yyvsp[(5) - (7)].i))), - 1, (long)(yyvsp[(6) - (7)].i))); - scan_map((yyvsp[(7) - (7)].map), splev); - Free((yyvsp[(7) - (7)].map)); + VA_PASS3(SP_COORD_PACK(((yyvsp[-4].i)),((yyvsp[-2].i))), + 1, (long)(yyvsp[-1].i))); + scan_map((yyvsp[0].map), splev); + Free((yyvsp[0].map)); } +#line 3775 "y.tab.c" /* yacc.c:1646 */ break; case 195: - -/* Line 1455 of yacc.c */ -#line 1375 "lev_comp.y" +#line 1375 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "ii", VA_PASS2(2, (long)(yyvsp[(4) - (5)].i))); - scan_map((yyvsp[(5) - (5)].map), splev); - Free((yyvsp[(5) - (5)].map)); + add_opvars(splev, "ii", VA_PASS2(2, (long)(yyvsp[-1].i))); + scan_map((yyvsp[0].map), splev); + Free((yyvsp[0].map)); } +#line 3785 "y.tab.c" /* yacc.c:1646 */ break; case 200: - -/* Line 1455 of yacc.c */ -#line 1391 "lev_comp.y" +#line 1391 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", VA_PASS2(0, SPO_MONSTER)); } +#line 3793 "y.tab.c" /* yacc.c:1646 */ break; case 201: - -/* Line 1455 of yacc.c */ -#line 1395 "lev_comp.y" +#line 1395 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", VA_PASS2(1, SPO_MONSTER)); in_container_obj++; break_stmt_start(); } +#line 3803 "y.tab.c" /* yacc.c:1646 */ break; case 202: - -/* Line 1455 of yacc.c */ -#line 1401 "lev_comp.y" +#line 1401 "lev_comp.y" /* yacc.c:1646 */ { break_stmt_end(splev); in_container_obj--; add_opvars(splev, "o", VA_PASS1(SPO_END_MONINVENT)); } +#line 3813 "y.tab.c" /* yacc.c:1646 */ break; case 203: - -/* Line 1455 of yacc.c */ -#line 1409 "lev_comp.y" +#line 1409 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 3821 "y.tab.c" /* yacc.c:1646 */ break; case 204: - -/* Line 1455 of yacc.c */ -#line 1415 "lev_comp.y" +#line 1415 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *stopit = New(struct opvar); set_opvar_int(stopit, SP_M_V_END); add_opcode(splev, SPO_PUSH, stopit); (yyval.i) = 0x0000; } +#line 3832 "y.tab.c" /* yacc.c:1646 */ break; case 205: - -/* Line 1455 of yacc.c */ -#line 1422 "lev_comp.y" +#line 1422 "lev_comp.y" /* yacc.c:1646 */ { - if (( (yyvsp[(1) - (3)].i) & (yyvsp[(3) - (3)].i) )) + if (( (yyvsp[-2].i) & (yyvsp[0].i) )) lc_error("MONSTER extra info defined twice."); - (yyval.i) = ( (yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i) ); + (yyval.i) = ( (yyvsp[-2].i) | (yyvsp[0].i) ); } +#line 3842 "y.tab.c" /* yacc.c:1646 */ break; case 206: - -/* Line 1455 of yacc.c */ -#line 1430 "lev_comp.y" +#line 1430 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", VA_PASS1(SP_M_V_NAME)); (yyval.i) = 0x0001; } +#line 3851 "y.tab.c" /* yacc.c:1646 */ break; case 207: - -/* Line 1455 of yacc.c */ -#line 1435 "lev_comp.y" +#line 1435 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", - VA_PASS2((long)(yyvsp[(1) - (1)].i), SP_M_V_PEACEFUL)); + VA_PASS2((long)(yyvsp[0].i), SP_M_V_PEACEFUL)); (yyval.i) = 0x0002; } +#line 3861 "y.tab.c" /* yacc.c:1646 */ break; case 208: - -/* Line 1455 of yacc.c */ -#line 1441 "lev_comp.y" +#line 1441 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", - VA_PASS2((long)(yyvsp[(1) - (1)].i), SP_M_V_ASLEEP)); + VA_PASS2((long)(yyvsp[0].i), SP_M_V_ASLEEP)); (yyval.i) = 0x0004; } +#line 3871 "y.tab.c" /* yacc.c:1646 */ break; case 209: - -/* Line 1455 of yacc.c */ -#line 1447 "lev_comp.y" +#line 1447 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", - VA_PASS2((long)(yyvsp[(1) - (1)].i), SP_M_V_ALIGN)); + VA_PASS2((long)(yyvsp[0].i), SP_M_V_ALIGN)); (yyval.i) = 0x0008; } +#line 3881 "y.tab.c" /* yacc.c:1646 */ break; case 210: - -/* Line 1455 of yacc.c */ -#line 1453 "lev_comp.y" +#line 1453 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", - VA_PASS2((long)(yyvsp[(1) - (2)].i), SP_M_V_APPEAR)); + VA_PASS2((long)(yyvsp[-1].i), SP_M_V_APPEAR)); (yyval.i) = 0x0010; } +#line 3891 "y.tab.c" /* yacc.c:1646 */ break; case 211: - -/* Line 1455 of yacc.c */ -#line 1459 "lev_comp.y" +#line 1459 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_FEMALE)); (yyval.i) = 0x0020; } +#line 3900 "y.tab.c" /* yacc.c:1646 */ break; case 212: - -/* Line 1455 of yacc.c */ -#line 1464 "lev_comp.y" +#line 1464 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_INVIS)); (yyval.i) = 0x0040; } +#line 3909 "y.tab.c" /* yacc.c:1646 */ break; case 213: - -/* Line 1455 of yacc.c */ -#line 1469 "lev_comp.y" +#line 1469 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_CANCELLED)); (yyval.i) = 0x0080; } +#line 3918 "y.tab.c" /* yacc.c:1646 */ break; case 214: - -/* Line 1455 of yacc.c */ -#line 1474 "lev_comp.y" +#line 1474 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_REVIVED)); (yyval.i) = 0x0100; } +#line 3927 "y.tab.c" /* yacc.c:1646 */ break; case 215: - -/* Line 1455 of yacc.c */ -#line 1479 "lev_comp.y" +#line 1479 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_AVENGE)); (yyval.i) = 0x0200; } +#line 3936 "y.tab.c" /* yacc.c:1646 */ break; case 216: - -/* Line 1455 of yacc.c */ -#line 1484 "lev_comp.y" +#line 1484 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", VA_PASS1(SP_M_V_FLEEING)); (yyval.i) = 0x0400; } +#line 3945 "y.tab.c" /* yacc.c:1646 */ break; case 217: - -/* Line 1455 of yacc.c */ -#line 1489 "lev_comp.y" +#line 1489 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", VA_PASS1(SP_M_V_BLINDED)); (yyval.i) = 0x0800; } +#line 3954 "y.tab.c" /* yacc.c:1646 */ break; case 218: - -/* Line 1455 of yacc.c */ -#line 1494 "lev_comp.y" +#line 1494 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", VA_PASS1(SP_M_V_PARALYZED)); (yyval.i) = 0x1000; } +#line 3963 "y.tab.c" /* yacc.c:1646 */ break; case 219: - -/* Line 1455 of yacc.c */ -#line 1499 "lev_comp.y" +#line 1499 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_STUNNED)); (yyval.i) = 0x2000; } +#line 3972 "y.tab.c" /* yacc.c:1646 */ break; case 220: - -/* Line 1455 of yacc.c */ -#line 1504 "lev_comp.y" +#line 1504 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", VA_PASS2(1, SP_M_V_CONFUSED)); (yyval.i) = 0x4000; } +#line 3981 "y.tab.c" /* yacc.c:1646 */ break; case 221: - -/* Line 1455 of yacc.c */ -#line 1509 "lev_comp.y" +#line 1509 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", - VA_PASS2((long)(yyvsp[(3) - (3)].i), SP_M_V_SEENTRAPS)); + VA_PASS2((long)(yyvsp[0].i), SP_M_V_SEENTRAPS)); (yyval.i) = 0x8000; } +#line 3991 "y.tab.c" /* yacc.c:1646 */ break; case 222: - -/* Line 1455 of yacc.c */ -#line 1517 "lev_comp.y" +#line 1517 "lev_comp.y" /* yacc.c:1646 */ { - int token = get_trap_type((yyvsp[(1) - (1)].map)); + int token = get_trap_type((yyvsp[0].map)); if (token == ERR || token == 0) - lc_error("Unknown trap type '%s'!", (yyvsp[(1) - (1)].map)); + lc_error("Unknown trap type '%s'!", (yyvsp[0].map)); + Free((yyvsp[0].map)); (yyval.i) = (1L << (token - 1)); } +#line 4003 "y.tab.c" /* yacc.c:1646 */ break; case 223: - -/* Line 1455 of yacc.c */ -#line 1524 "lev_comp.y" +#line 1525 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = (long) ~0; } +#line 4011 "y.tab.c" /* yacc.c:1646 */ break; case 224: - -/* Line 1455 of yacc.c */ -#line 1528 "lev_comp.y" +#line 1529 "lev_comp.y" /* yacc.c:1646 */ { - int token = get_trap_type((yyvsp[(1) - (3)].map)); + int token = get_trap_type((yyvsp[-2].map)); if (token == ERR || token == 0) - lc_error("Unknown trap type '%s'!", (yyvsp[(1) - (3)].map)); + lc_error("Unknown trap type '%s'!", (yyvsp[-2].map)); - if ((1L << (token - 1)) & (yyvsp[(3) - (3)].i)) - lc_error("Monster seen_traps, trap '%s' listed twice.", (yyvsp[(1) - (3)].map)); - - (yyval.i) = ((1L << (token - 1)) | (yyvsp[(3) - (3)].i)); + if ((1L << (token - 1)) & (yyvsp[0].i)) + lc_error("Monster seen_traps, trap '%s' listed twice.", (yyvsp[-2].map)); + Free((yyvsp[-2].map)); + (yyval.i) = ((1L << (token - 1)) | (yyvsp[0].i)); } +#line 4026 "y.tab.c" /* yacc.c:1646 */ break; case 225: - -/* Line 1455 of yacc.c */ -#line 1541 "lev_comp.y" +#line 1542 "lev_comp.y" /* yacc.c:1646 */ { long cnt = 0; if (in_container_obj) cnt |= SP_OBJ_CONTENT; add_opvars(splev, "io", VA_PASS2(cnt, SPO_OBJECT)); } +#line 4036 "y.tab.c" /* yacc.c:1646 */ break; case 226: - -/* Line 1455 of yacc.c */ -#line 1547 "lev_comp.y" +#line 1548 "lev_comp.y" /* yacc.c:1646 */ { long cnt = SP_OBJ_CONTAINER; if (in_container_obj) cnt |= SP_OBJ_CONTENT; @@ -4474,227 +4044,206 @@ yyreduce: in_container_obj++; break_stmt_start(); } +#line 4048 "y.tab.c" /* yacc.c:1646 */ break; case 227: - -/* Line 1455 of yacc.c */ -#line 1555 "lev_comp.y" +#line 1556 "lev_comp.y" /* yacc.c:1646 */ { break_stmt_end(splev); in_container_obj--; add_opcode(splev, SPO_POP_CONTAINER, NULL); } +#line 4058 "y.tab.c" /* yacc.c:1646 */ break; case 228: - -/* Line 1455 of yacc.c */ -#line 1563 "lev_comp.y" +#line 1564 "lev_comp.y" /* yacc.c:1646 */ { - if (( (yyvsp[(2) - (2)].i) & 0x4000) && in_container_obj) lc_error("Object cannot have a coord when contained."); - else if (!( (yyvsp[(2) - (2)].i) & 0x4000) && !in_container_obj) lc_error("Object needs a coord when not contained."); + if (( (yyvsp[0].i) & 0x4000) && in_container_obj) lc_error("Object cannot have a coord when contained."); + else if (!( (yyvsp[0].i) & 0x4000) && !in_container_obj) lc_error("Object needs a coord when not contained."); } +#line 4067 "y.tab.c" /* yacc.c:1646 */ break; case 229: - -/* Line 1455 of yacc.c */ -#line 1570 "lev_comp.y" +#line 1571 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *stopit = New(struct opvar); set_opvar_int(stopit, SP_O_V_END); add_opcode(splev, SPO_PUSH, stopit); (yyval.i) = 0x00; } +#line 4078 "y.tab.c" /* yacc.c:1646 */ break; case 230: - -/* Line 1455 of yacc.c */ -#line 1577 "lev_comp.y" +#line 1578 "lev_comp.y" /* yacc.c:1646 */ { - if (( (yyvsp[(1) - (3)].i) & (yyvsp[(3) - (3)].i) )) + if (( (yyvsp[-2].i) & (yyvsp[0].i) )) lc_error("OBJECT extra info '%s' defined twice.", curr_token); - (yyval.i) = ( (yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i) ); + (yyval.i) = ( (yyvsp[-2].i) | (yyvsp[0].i) ); } +#line 4088 "y.tab.c" /* yacc.c:1646 */ break; case 231: - -/* Line 1455 of yacc.c */ -#line 1585 "lev_comp.y" +#line 1586 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", - VA_PASS2((long)(yyvsp[(1) - (1)].i), SP_O_V_CURSE)); + VA_PASS2((long)(yyvsp[0].i), SP_O_V_CURSE)); (yyval.i) = 0x0001; } +#line 4098 "y.tab.c" /* yacc.c:1646 */ break; case 232: - -/* Line 1455 of yacc.c */ -#line 1591 "lev_comp.y" +#line 1592 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", VA_PASS1(SP_O_V_CORPSENM)); (yyval.i) = 0x0002; } +#line 4107 "y.tab.c" /* yacc.c:1646 */ break; case 233: - -/* Line 1455 of yacc.c */ -#line 1596 "lev_comp.y" +#line 1597 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", VA_PASS1(SP_O_V_SPE)); (yyval.i) = 0x0004; } +#line 4116 "y.tab.c" /* yacc.c:1646 */ break; case 234: - -/* Line 1455 of yacc.c */ -#line 1601 "lev_comp.y" +#line 1602 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", VA_PASS1(SP_O_V_NAME)); (yyval.i) = 0x0008; } +#line 4125 "y.tab.c" /* yacc.c:1646 */ break; case 235: - -/* Line 1455 of yacc.c */ -#line 1606 "lev_comp.y" +#line 1607 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", VA_PASS1(SP_O_V_QUAN)); (yyval.i) = 0x0010; } +#line 4134 "y.tab.c" /* yacc.c:1646 */ break; case 236: - -/* Line 1455 of yacc.c */ -#line 1611 "lev_comp.y" +#line 1612 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_BURIED)); (yyval.i) = 0x0020; } +#line 4143 "y.tab.c" /* yacc.c:1646 */ break; case 237: - -/* Line 1455 of yacc.c */ -#line 1616 "lev_comp.y" +#line 1617 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "ii", VA_PASS2((long)(yyvsp[(1) - (1)].i), SP_O_V_LIT)); + add_opvars(splev, "ii", VA_PASS2((long)(yyvsp[0].i), SP_O_V_LIT)); (yyval.i) = 0x0040; } +#line 4152 "y.tab.c" /* yacc.c:1646 */ break; case 238: - -/* Line 1455 of yacc.c */ -#line 1621 "lev_comp.y" +#line 1622 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", VA_PASS1(SP_O_V_ERODED)); (yyval.i) = 0x0080; } +#line 4161 "y.tab.c" /* yacc.c:1646 */ break; case 239: - -/* Line 1455 of yacc.c */ -#line 1626 "lev_comp.y" +#line 1627 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", VA_PASS2(-1, SP_O_V_ERODED)); (yyval.i) = 0x0080; } +#line 4170 "y.tab.c" /* yacc.c:1646 */ break; case 240: - -/* Line 1455 of yacc.c */ -#line 1631 "lev_comp.y" +#line 1632 "lev_comp.y" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (1)].i) == D_LOCKED) { + if ((yyvsp[0].i) == D_LOCKED) { add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_LOCKED)); (yyval.i) = 0x0100; - } else if ((yyvsp[(1) - (1)].i) == D_BROKEN) { + } else if ((yyvsp[0].i) == D_BROKEN) { add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_BROKEN)); (yyval.i) = 0x0200; } else lc_error("DOOR state can only be locked or broken."); } +#line 4185 "y.tab.c" /* yacc.c:1646 */ break; case 241: - -/* Line 1455 of yacc.c */ -#line 1642 "lev_comp.y" +#line 1643 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "ii", VA_PASS2((yyvsp[(1) - (1)].i), SP_O_V_TRAPPED)); + add_opvars(splev, "ii", VA_PASS2((yyvsp[0].i), SP_O_V_TRAPPED)); (yyval.i) = 0x0400; } +#line 4194 "y.tab.c" /* yacc.c:1646 */ break; case 242: - -/* Line 1455 of yacc.c */ -#line 1647 "lev_comp.y" +#line 1648 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", VA_PASS1(SP_O_V_RECHARGED)); (yyval.i) = 0x0800; } +#line 4203 "y.tab.c" /* yacc.c:1646 */ break; case 243: - -/* Line 1455 of yacc.c */ -#line 1652 "lev_comp.y" +#line 1653 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_INVIS)); (yyval.i) = 0x1000; } +#line 4212 "y.tab.c" /* yacc.c:1646 */ break; case 244: - -/* Line 1455 of yacc.c */ -#line 1657 "lev_comp.y" +#line 1658 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", VA_PASS2(1, SP_O_V_GREASED)); (yyval.i) = 0x2000; } +#line 4221 "y.tab.c" /* yacc.c:1646 */ break; case 245: - -/* Line 1455 of yacc.c */ -#line 1662 "lev_comp.y" +#line 1663 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", VA_PASS1(SP_O_V_COORD)); (yyval.i) = 0x4000; } +#line 4230 "y.tab.c" /* yacc.c:1646 */ break; case 246: - -/* Line 1455 of yacc.c */ -#line 1669 "lev_comp.y" +#line 1670 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", VA_PASS2((long)(yyvsp[(3) - (5)].i), SPO_TRAP)); + add_opvars(splev, "io", VA_PASS2((long)(yyvsp[-2].i), SPO_TRAP)); } +#line 4238 "y.tab.c" /* yacc.c:1646 */ break; case 247: - -/* Line 1455 of yacc.c */ -#line 1675 "lev_comp.y" +#line 1676 "lev_comp.y" /* yacc.c:1646 */ { long dir, state = 0; /* convert dir from a DIRECTION to a DB_DIR */ - dir = (yyvsp[(5) - (7)].i); + dir = (yyvsp[-2].i); switch (dir) { case W_NORTH: dir = DB_NORTH; break; case W_SOUTH: dir = DB_SOUTH; break; @@ -4705,1048 +4254,954 @@ yyreduce: break; } - if ( (yyvsp[(7) - (7)].i) == D_ISOPEN ) + if ( (yyvsp[0].i) == D_ISOPEN ) state = 1; - else if ( (yyvsp[(7) - (7)].i) == D_CLOSED ) + else if ( (yyvsp[0].i) == D_CLOSED ) state = 0; - else if ( (yyvsp[(7) - (7)].i) == -1 ) + else if ( (yyvsp[0].i) == -1 ) state = -1; else lc_error("A drawbridge can only be open, closed or random!"); add_opvars(splev, "iio", VA_PASS3(state, dir, SPO_DRAWBRIDGE)); } +#line 4269 "y.tab.c" /* yacc.c:1646 */ break; case 248: - -/* Line 1455 of yacc.c */ -#line 1704 "lev_comp.y" +#line 1705 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiio", - VA_PASS4((long)(yyvsp[(5) - (5)].i), 1, 0, SPO_MAZEWALK)); + VA_PASS4((long)(yyvsp[0].i), 1, 0, SPO_MAZEWALK)); } +#line 4278 "y.tab.c" /* yacc.c:1646 */ break; case 249: - -/* Line 1455 of yacc.c */ -#line 1709 "lev_comp.y" +#line 1710 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiio", - VA_PASS4((long)(yyvsp[(5) - (8)].i), (long)(yyvsp[(7) - (8)].i), - (long)(yyvsp[(8) - (8)].i), SPO_MAZEWALK)); + VA_PASS4((long)(yyvsp[-3].i), (long)(yyvsp[-1].i), + (long)(yyvsp[0].i), SPO_MAZEWALK)); } +#line 4288 "y.tab.c" /* yacc.c:1646 */ break; case 250: - -/* Line 1455 of yacc.c */ -#line 1717 "lev_comp.y" +#line 1718 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "rio", VA_PASS3(SP_REGION_PACK(-1,-1,-1,-1), 0, SPO_WALLIFY)); } +#line 4298 "y.tab.c" /* yacc.c:1646 */ break; case 251: - -/* Line 1455 of yacc.c */ -#line 1723 "lev_comp.y" +#line 1724 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", VA_PASS2(1, SPO_WALLIFY)); } +#line 4306 "y.tab.c" /* yacc.c:1646 */ break; case 252: - -/* Line 1455 of yacc.c */ -#line 1729 "lev_comp.y" +#line 1730 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", - VA_PASS2((long)(yyvsp[(5) - (5)].i), SPO_LADDER)); + VA_PASS2((long)(yyvsp[0].i), SPO_LADDER)); } +#line 4315 "y.tab.c" /* yacc.c:1646 */ break; case 253: - -/* Line 1455 of yacc.c */ -#line 1736 "lev_comp.y" +#line 1737 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", - VA_PASS2((long)(yyvsp[(5) - (5)].i), SPO_STAIR)); + VA_PASS2((long)(yyvsp[0].i), SPO_STAIR)); } +#line 4324 "y.tab.c" /* yacc.c:1646 */ break; case 254: - -/* Line 1455 of yacc.c */ -#line 1743 "lev_comp.y" +#line 1744 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14((yyvsp[(3) - (7)].lregn).x1, (yyvsp[(3) - (7)].lregn).y1, (yyvsp[(3) - (7)].lregn).x2, (yyvsp[(3) - (7)].lregn).y2, (yyvsp[(3) - (7)].lregn).area, - (yyvsp[(5) - (7)].lregn).x1, (yyvsp[(5) - (7)].lregn).y1, (yyvsp[(5) - (7)].lregn).x2, (yyvsp[(5) - (7)].lregn).y2, (yyvsp[(5) - (7)].lregn).area, - (long)(((yyvsp[(7) - (7)].i)) ? LR_UPSTAIR : LR_DOWNSTAIR), + VA_PASS14((yyvsp[-4].lregn).x1, (yyvsp[-4].lregn).y1, (yyvsp[-4].lregn).x2, (yyvsp[-4].lregn).y2, (yyvsp[-4].lregn).area, + (yyvsp[-2].lregn).x1, (yyvsp[-2].lregn).y1, (yyvsp[-2].lregn).x2, (yyvsp[-2].lregn).y2, (yyvsp[-2].lregn).area, + (long)(((yyvsp[0].i)) ? LR_UPSTAIR : LR_DOWNSTAIR), 0, (char *)0, SPO_LEVREGION)); } +#line 4336 "y.tab.c" /* yacc.c:1646 */ break; case 255: - -/* Line 1455 of yacc.c */ -#line 1753 "lev_comp.y" +#line 1754 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14((yyvsp[(3) - (7)].lregn).x1, (yyvsp[(3) - (7)].lregn).y1, (yyvsp[(3) - (7)].lregn).x2, (yyvsp[(3) - (7)].lregn).y2, (yyvsp[(3) - (7)].lregn).area, - (yyvsp[(5) - (7)].lregn).x1, (yyvsp[(5) - (7)].lregn).y1, (yyvsp[(5) - (7)].lregn).x2, (yyvsp[(5) - (7)].lregn).y2, (yyvsp[(5) - (7)].lregn).area, - LR_PORTAL, 0, (yyvsp[(7) - (7)].map), SPO_LEVREGION)); - Free((yyvsp[(7) - (7)].map)); + VA_PASS14((yyvsp[-4].lregn).x1, (yyvsp[-4].lregn).y1, (yyvsp[-4].lregn).x2, (yyvsp[-4].lregn).y2, (yyvsp[-4].lregn).area, + (yyvsp[-2].lregn).x1, (yyvsp[-2].lregn).y1, (yyvsp[-2].lregn).x2, (yyvsp[-2].lregn).y2, (yyvsp[-2].lregn).area, + LR_PORTAL, 0, (yyvsp[0].map), SPO_LEVREGION)); + Free((yyvsp[0].map)); } +#line 4348 "y.tab.c" /* yacc.c:1646 */ break; case 256: - -/* Line 1455 of yacc.c */ -#line 1763 "lev_comp.y" +#line 1764 "lev_comp.y" /* yacc.c:1646 */ { long rtyp = 0; - switch((yyvsp[(6) - (6)].i)) { + switch((yyvsp[0].i)) { case -1: rtyp = LR_TELE; break; case 0: rtyp = LR_DOWNTELE; break; case 1: rtyp = LR_UPTELE; break; } add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14((yyvsp[(3) - (6)].lregn).x1, (yyvsp[(3) - (6)].lregn).y1, (yyvsp[(3) - (6)].lregn).x2, (yyvsp[(3) - (6)].lregn).y2, (yyvsp[(3) - (6)].lregn).area, - (yyvsp[(5) - (6)].lregn).x1, (yyvsp[(5) - (6)].lregn).y1, (yyvsp[(5) - (6)].lregn).x2, (yyvsp[(5) - (6)].lregn).y2, (yyvsp[(5) - (6)].lregn).area, + VA_PASS14((yyvsp[-3].lregn).x1, (yyvsp[-3].lregn).y1, (yyvsp[-3].lregn).x2, (yyvsp[-3].lregn).y2, (yyvsp[-3].lregn).area, + (yyvsp[-1].lregn).x1, (yyvsp[-1].lregn).y1, (yyvsp[-1].lregn).x2, (yyvsp[-1].lregn).y2, (yyvsp[-1].lregn).area, rtyp, 0, (char *)0, SPO_LEVREGION)); } +#line 4365 "y.tab.c" /* yacc.c:1646 */ break; case 257: - -/* Line 1455 of yacc.c */ -#line 1778 "lev_comp.y" +#line 1779 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiii iiiii iiso", - VA_PASS14((yyvsp[(3) - (5)].lregn).x1, (yyvsp[(3) - (5)].lregn).y1, (yyvsp[(3) - (5)].lregn).x2, (yyvsp[(3) - (5)].lregn).y2, (yyvsp[(3) - (5)].lregn).area, - (yyvsp[(5) - (5)].lregn).x1, (yyvsp[(5) - (5)].lregn).y1, (yyvsp[(5) - (5)].lregn).x2, (yyvsp[(5) - (5)].lregn).y2, (yyvsp[(5) - (5)].lregn).area, + VA_PASS14((yyvsp[-2].lregn).x1, (yyvsp[-2].lregn).y1, (yyvsp[-2].lregn).x2, (yyvsp[-2].lregn).y2, (yyvsp[-2].lregn).area, + (yyvsp[0].lregn).x1, (yyvsp[0].lregn).y1, (yyvsp[0].lregn).x2, (yyvsp[0].lregn).y2, (yyvsp[0].lregn).area, (long)LR_BRANCH, 0, (char *)0, SPO_LEVREGION)); } +#line 4377 "y.tab.c" /* yacc.c:1646 */ break; case 258: - -/* Line 1455 of yacc.c */ -#line 1788 "lev_comp.y" +#line 1789 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = -1; } +#line 4385 "y.tab.c" /* yacc.c:1646 */ break; case 259: - -/* Line 1455 of yacc.c */ -#line 1792 "lev_comp.y" +#line 1793 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(2) - (2)].i); + (yyval.i) = (yyvsp[0].i); } +#line 4393 "y.tab.c" /* yacc.c:1646 */ break; case 260: - -/* Line 1455 of yacc.c */ -#line 1798 "lev_comp.y" +#line 1799 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_FOUNTAIN)); } +#line 4401 "y.tab.c" /* yacc.c:1646 */ break; case 261: - -/* Line 1455 of yacc.c */ -#line 1804 "lev_comp.y" +#line 1805 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_SINK)); } +#line 4409 "y.tab.c" /* yacc.c:1646 */ break; case 262: - -/* Line 1455 of yacc.c */ -#line 1810 "lev_comp.y" +#line 1811 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_POOL)); } +#line 4417 "y.tab.c" /* yacc.c:1646 */ break; case 263: - -/* Line 1455 of yacc.c */ -#line 1816 "lev_comp.y" +#line 1817 "lev_comp.y" /* yacc.c:1646 */ { (yyval.terr).lit = -2; - (yyval.terr).ter = what_map_char((char) (yyvsp[(1) - (1)].i)); + (yyval.terr).ter = what_map_char((char) (yyvsp[0].i)); } +#line 4426 "y.tab.c" /* yacc.c:1646 */ break; case 264: - -/* Line 1455 of yacc.c */ -#line 1821 "lev_comp.y" +#line 1822 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.terr).lit = (yyvsp[(4) - (5)].i); - (yyval.terr).ter = what_map_char((char) (yyvsp[(2) - (5)].i)); + (yyval.terr).lit = (yyvsp[-1].i); + (yyval.terr).ter = what_map_char((char) (yyvsp[-3].i)); } +#line 4435 "y.tab.c" /* yacc.c:1646 */ break; case 265: - -/* Line 1455 of yacc.c */ -#line 1828 "lev_comp.y" +#line 1829 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", - VA_PASS2((yyvsp[(9) - (9)].i), SPO_REPLACETERRAIN)); + VA_PASS2((yyvsp[0].i), SPO_REPLACETERRAIN)); } +#line 4444 "y.tab.c" /* yacc.c:1646 */ break; case 266: - -/* Line 1455 of yacc.c */ -#line 1835 "lev_comp.y" +#line 1836 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_TERRAIN)); } +#line 4452 "y.tab.c" /* yacc.c:1646 */ break; case 267: - -/* Line 1455 of yacc.c */ -#line 1841 "lev_comp.y" +#line 1842 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_NON_DIGGABLE)); } +#line 4460 "y.tab.c" /* yacc.c:1646 */ break; case 268: - -/* Line 1455 of yacc.c */ -#line 1847 "lev_comp.y" +#line 1848 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_NON_PASSWALL)); } +#line 4468 "y.tab.c" /* yacc.c:1646 */ break; case 269: - -/* Line 1455 of yacc.c */ -#line 1853 "lev_comp.y" +#line 1854 "lev_comp.y" /* yacc.c:1646 */ { long irr; - long rt = (yyvsp[(7) - (8)].i); - long rflags = (yyvsp[(8) - (8)].i); + long rt = (yyvsp[-1].i); + long rflags = (yyvsp[0].i); if (rflags == -1) rflags = (1 << 0); if (!(rflags & 1)) rt += MAXRTYPE+1; irr = ((rflags & 2) != 0); add_opvars(splev, "iiio", - VA_PASS4((long)(yyvsp[(5) - (8)].i), rt, rflags, SPO_REGION)); + VA_PASS4((long)(yyvsp[-3].i), rt, rflags, SPO_REGION)); (yyval.i) = (irr || (rflags & 1) || rt != OROOM); break_stmt_start(); } +#line 4486 "y.tab.c" /* yacc.c:1646 */ break; case 270: - -/* Line 1455 of yacc.c */ -#line 1867 "lev_comp.y" +#line 1868 "lev_comp.y" /* yacc.c:1646 */ { break_stmt_end(splev); - if ( (yyvsp[(9) - (10)].i) ) { + if ( (yyvsp[-1].i) ) { add_opcode(splev, SPO_ENDROOM, NULL); - } else if ( (yyvsp[(10) - (10)].i) ) + } else if ( (yyvsp[0].i) ) lc_error("Cannot use lev statements in non-permanent REGION"); } +#line 4498 "y.tab.c" /* yacc.c:1646 */ break; case 271: - -/* Line 1455 of yacc.c */ -#line 1877 "lev_comp.y" +#line 1878 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 0; } +#line 4506 "y.tab.c" /* yacc.c:1646 */ break; case 272: - -/* Line 1455 of yacc.c */ -#line 1881 "lev_comp.y" +#line 1882 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (1)].i); + (yyval.i) = (yyvsp[0].i); } +#line 4514 "y.tab.c" /* yacc.c:1646 */ break; case 273: - -/* Line 1455 of yacc.c */ -#line 1887 "lev_comp.y" +#line 1888 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iio", - VA_PASS3((long)(yyvsp[(7) - (7)].i), (long)(yyvsp[(5) - (7)].i), SPO_ALTAR)); + VA_PASS3((long)(yyvsp[0].i), (long)(yyvsp[-2].i), SPO_ALTAR)); } +#line 4523 "y.tab.c" /* yacc.c:1646 */ break; case 274: - -/* Line 1455 of yacc.c */ -#line 1894 "lev_comp.y" +#line 1895 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", VA_PASS2(2, SPO_GRAVE)); } +#line 4531 "y.tab.c" /* yacc.c:1646 */ break; case 275: - -/* Line 1455 of yacc.c */ -#line 1898 "lev_comp.y" +#line 1899 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "sio", VA_PASS3((char *)0, 1, SPO_GRAVE)); } +#line 4540 "y.tab.c" /* yacc.c:1646 */ break; case 276: - -/* Line 1455 of yacc.c */ -#line 1903 "lev_comp.y" +#line 1904 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "sio", VA_PASS3((char *)0, 0, SPO_GRAVE)); } +#line 4549 "y.tab.c" /* yacc.c:1646 */ break; case 277: - -/* Line 1455 of yacc.c */ -#line 1910 "lev_comp.y" +#line 1911 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_GOLD)); } +#line 4557 "y.tab.c" /* yacc.c:1646 */ break; case 278: - -/* Line 1455 of yacc.c */ -#line 1916 "lev_comp.y" +#line 1917 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", - VA_PASS2((long)(yyvsp[(5) - (7)].i), SPO_ENGRAVING)); + VA_PASS2((long)(yyvsp[-2].i), SPO_ENGRAVING)); } +#line 4566 "y.tab.c" /* yacc.c:1646 */ break; case 279: - -/* Line 1455 of yacc.c */ -#line 1923 "lev_comp.y" +#line 1924 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_MINERALIZE)); } +#line 4574 "y.tab.c" /* yacc.c:1646 */ break; case 280: - -/* Line 1455 of yacc.c */ -#line 1927 "lev_comp.y" +#line 1928 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiio", VA_PASS5(-1L, -1L, -1L, -1L, SPO_MINERALIZE)); } +#line 4583 "y.tab.c" /* yacc.c:1646 */ break; case 281: - -/* Line 1455 of yacc.c */ -#line 1934 "lev_comp.y" +#line 1935 "lev_comp.y" /* yacc.c:1646 */ { - int token = get_trap_type((yyvsp[(1) - (1)].map)); + int token = get_trap_type((yyvsp[0].map)); if (token == ERR) - lc_error("Unknown trap type '%s'!", (yyvsp[(1) - (1)].map)); + lc_error("Unknown trap type '%s'!", (yyvsp[0].map)); (yyval.i) = token; - Free((yyvsp[(1) - (1)].map)); + Free((yyvsp[0].map)); } +#line 4595 "y.tab.c" /* yacc.c:1646 */ break; case 283: - -/* Line 1455 of yacc.c */ -#line 1945 "lev_comp.y" +#line 1946 "lev_comp.y" /* yacc.c:1646 */ { - int token = get_room_type((yyvsp[(1) - (1)].map)); + int token = get_room_type((yyvsp[0].map)); if (token == ERR) { - lc_warning("Unknown room type \"%s\"! Making ordinary room...", (yyvsp[(1) - (1)].map)); + lc_warning("Unknown room type \"%s\"! Making ordinary room...", (yyvsp[0].map)); (yyval.i) = OROOM; } else (yyval.i) = token; - Free((yyvsp[(1) - (1)].map)); + Free((yyvsp[0].map)); } +#line 4609 "y.tab.c" /* yacc.c:1646 */ break; case 285: - -/* Line 1455 of yacc.c */ -#line 1958 "lev_comp.y" +#line 1959 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = -1; } +#line 4617 "y.tab.c" /* yacc.c:1646 */ break; case 286: - -/* Line 1455 of yacc.c */ -#line 1962 "lev_comp.y" +#line 1963 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(2) - (2)].i); + (yyval.i) = (yyvsp[0].i); } +#line 4625 "y.tab.c" /* yacc.c:1646 */ break; case 287: - -/* Line 1455 of yacc.c */ -#line 1968 "lev_comp.y" +#line 1969 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (1)].i); + (yyval.i) = (yyvsp[0].i); } +#line 4633 "y.tab.c" /* yacc.c:1646 */ break; case 288: - -/* Line 1455 of yacc.c */ -#line 1972 "lev_comp.y" +#line 1973 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i); + (yyval.i) = (yyvsp[-2].i) | (yyvsp[0].i); } +#line 4641 "y.tab.c" /* yacc.c:1646 */ break; case 289: - -/* Line 1455 of yacc.c */ -#line 1979 "lev_comp.y" +#line 1980 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = ((yyvsp[(1) - (1)].i) << 0); + (yyval.i) = ((yyvsp[0].i) << 0); } +#line 4649 "y.tab.c" /* yacc.c:1646 */ break; case 290: - -/* Line 1455 of yacc.c */ -#line 1983 "lev_comp.y" +#line 1984 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = ((yyvsp[(1) - (1)].i) << 1); + (yyval.i) = ((yyvsp[0].i) << 1); } +#line 4657 "y.tab.c" /* yacc.c:1646 */ break; case 291: - -/* Line 1455 of yacc.c */ -#line 1987 "lev_comp.y" +#line 1988 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = ((yyvsp[(1) - (1)].i) << 2); + (yyval.i) = ((yyvsp[0].i) << 2); } +#line 4665 "y.tab.c" /* yacc.c:1646 */ break; case 298: - -/* Line 1455 of yacc.c */ -#line 2003 "lev_comp.y" +#line 2004 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = - MAX_REGISTERS - 1; } +#line 4673 "y.tab.c" /* yacc.c:1646 */ break; case 301: - -/* Line 1455 of yacc.c */ -#line 2011 "lev_comp.y" +#line 2012 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = - MAX_REGISTERS - 1; } +#line 4681 "y.tab.c" /* yacc.c:1646 */ break; case 304: - -/* Line 1455 of yacc.c */ -#line 2021 "lev_comp.y" +#line 2022 "lev_comp.y" /* yacc.c:1646 */ { - if ( (yyvsp[(3) - (4)].i) >= 3 ) + if ( (yyvsp[-1].i) >= 3 ) lc_error("Register Index overflow!"); else - (yyval.i) = - (yyvsp[(3) - (4)].i) - 1; + (yyval.i) = - (yyvsp[-1].i) - 1; } +#line 4692 "y.tab.c" /* yacc.c:1646 */ break; case 305: - -/* Line 1455 of yacc.c */ -#line 2030 "lev_comp.y" +#line 2031 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "s", VA_PASS1((yyvsp[(1) - (1)].map))); - Free((yyvsp[(1) - (1)].map)); + add_opvars(splev, "s", VA_PASS1((yyvsp[0].map))); + Free((yyvsp[0].map)); } +#line 4701 "y.tab.c" /* yacc.c:1646 */ break; case 306: - -/* Line 1455 of yacc.c */ -#line 2035 "lev_comp.y" +#line 2036 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_STRING); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (1)].map))); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_STRING); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); + Free((yyvsp[0].map)); } +#line 4712 "y.tab.c" /* yacc.c:1646 */ break; case 307: - -/* Line 1455 of yacc.c */ -#line 2042 "lev_comp.y" +#line 2043 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_STRING|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (4)].map))); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_STRING|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); + Free((yyvsp[-3].map)); } +#line 4723 "y.tab.c" /* yacc.c:1646 */ break; case 308: - -/* Line 1455 of yacc.c */ -#line 2052 "lev_comp.y" +#line 2053 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 4731 "y.tab.c" /* yacc.c:1646 */ break; case 309: - -/* Line 1455 of yacc.c */ -#line 2058 "lev_comp.y" +#line 2059 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "c", VA_PASS1((yyvsp[(1) - (1)].i))); + add_opvars(splev, "c", VA_PASS1((yyvsp[0].i))); } +#line 4739 "y.tab.c" /* yacc.c:1646 */ break; case 310: - -/* Line 1455 of yacc.c */ -#line 2062 "lev_comp.y" +#line 2063 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_SEL_RNDCOORD)); } +#line 4747 "y.tab.c" /* yacc.c:1646 */ break; case 311: - -/* Line 1455 of yacc.c */ -#line 2066 "lev_comp.y" +#line 2067 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_COORD); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (1)].map))); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_COORD); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); + Free((yyvsp[0].map)); } +#line 4758 "y.tab.c" /* yacc.c:1646 */ break; case 312: - -/* Line 1455 of yacc.c */ -#line 2073 "lev_comp.y" +#line 2074 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_COORD|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (4)].map))); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_COORD|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); + Free((yyvsp[-3].map)); } +#line 4769 "y.tab.c" /* yacc.c:1646 */ break; case 313: - -/* Line 1455 of yacc.c */ -#line 2082 "lev_comp.y" +#line 2083 "lev_comp.y" /* yacc.c:1646 */ { - if ((yyvsp[(2) - (5)].i) < 0 || (yyvsp[(4) - (5)].i) < 0 || (yyvsp[(2) - (5)].i) >= COLNO || (yyvsp[(4) - (5)].i) >= ROWNO) - lc_error("Coordinates (%li,%li) out of map range!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); - (yyval.i) = SP_COORD_PACK((yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + if ((yyvsp[-3].i) < 0 || (yyvsp[-1].i) < 0 || (yyvsp[-3].i) >= COLNO || (yyvsp[-1].i) >= ROWNO) + lc_error("Coordinates (%li,%li) out of map range!", (yyvsp[-3].i), (yyvsp[-1].i)); + (yyval.i) = SP_COORD_PACK((yyvsp[-3].i), (yyvsp[-1].i)); } +#line 4779 "y.tab.c" /* yacc.c:1646 */ break; case 314: - -/* Line 1455 of yacc.c */ -#line 2088 "lev_comp.y" +#line 2089 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = SP_COORD_PACK_RANDOM(0); } +#line 4787 "y.tab.c" /* yacc.c:1646 */ break; case 315: - -/* Line 1455 of yacc.c */ -#line 2092 "lev_comp.y" +#line 2093 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = SP_COORD_PACK_RANDOM( (yyvsp[(2) - (3)].i) ); + (yyval.i) = SP_COORD_PACK_RANDOM( (yyvsp[-1].i) ); } +#line 4795 "y.tab.c" /* yacc.c:1646 */ break; case 316: - -/* Line 1455 of yacc.c */ -#line 2098 "lev_comp.y" +#line 2099 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (1)].i); + (yyval.i) = (yyvsp[0].i); } +#line 4803 "y.tab.c" /* yacc.c:1646 */ break; case 317: - -/* Line 1455 of yacc.c */ -#line 2102 "lev_comp.y" +#line 2103 "lev_comp.y" /* yacc.c:1646 */ { - if (((yyvsp[(1) - (3)].i) & (yyvsp[(3) - (3)].i))) + if (((yyvsp[-2].i) & (yyvsp[0].i))) lc_warning("Humidity flag used twice."); - (yyval.i) = ((yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i)); + (yyval.i) = ((yyvsp[-2].i) | (yyvsp[0].i)); } +#line 4813 "y.tab.c" /* yacc.c:1646 */ break; case 318: - -/* Line 1455 of yacc.c */ -#line 2110 "lev_comp.y" +#line 2111 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 4821 "y.tab.c" /* yacc.c:1646 */ break; case 319: - -/* Line 1455 of yacc.c */ -#line 2114 "lev_comp.y" +#line 2115 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_REGION); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (1)].map))); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_REGION); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); + Free((yyvsp[0].map)); } +#line 4832 "y.tab.c" /* yacc.c:1646 */ break; case 320: - -/* Line 1455 of yacc.c */ -#line 2121 "lev_comp.y" +#line 2122 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_REGION|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (4)].map))); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_REGION|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); + Free((yyvsp[-3].map)); } +#line 4843 "y.tab.c" /* yacc.c:1646 */ break; case 321: - -/* Line 1455 of yacc.c */ -#line 2130 "lev_comp.y" +#line 2131 "lev_comp.y" /* yacc.c:1646 */ { - long r = SP_REGION_PACK((yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); - if ( (yyvsp[(2) - (9)].i) > (yyvsp[(6) - (9)].i) || (yyvsp[(4) - (9)].i) > (yyvsp[(8) - (9)].i) ) - lc_error("Region start > end: (%li,%li,%li,%li)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + long r = SP_REGION_PACK((yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + if ( (yyvsp[-7].i) > (yyvsp[-3].i) || (yyvsp[-5].i) > (yyvsp[-1].i) ) + lc_error("Region start > end: (%li,%li,%li,%li)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); add_opvars(splev, "r", VA_PASS1(r)); (yyval.i) = r; } +#line 4856 "y.tab.c" /* yacc.c:1646 */ break; case 322: - -/* Line 1455 of yacc.c */ -#line 2141 "lev_comp.y" +#line 2142 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "m", VA_PASS1((yyvsp[(1) - (1)].i))); + add_opvars(splev, "m", VA_PASS1((yyvsp[0].i))); } +#line 4864 "y.tab.c" /* yacc.c:1646 */ break; case 323: - -/* Line 1455 of yacc.c */ -#line 2145 "lev_comp.y" +#line 2146 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_MAPCHAR); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (1)].map))); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_MAPCHAR); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); + Free((yyvsp[0].map)); } +#line 4875 "y.tab.c" /* yacc.c:1646 */ break; case 324: - -/* Line 1455 of yacc.c */ -#line 2152 "lev_comp.y" +#line 2153 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (4)].map))); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); + Free((yyvsp[-3].map)); } +#line 4886 "y.tab.c" /* yacc.c:1646 */ break; case 325: - -/* Line 1455 of yacc.c */ -#line 2161 "lev_comp.y" +#line 2162 "lev_comp.y" /* yacc.c:1646 */ { - if (what_map_char((char) (yyvsp[(1) - (1)].i)) != INVALID_TYPE) - (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[(1) - (1)].i)), -2); + if (what_map_char((char) (yyvsp[0].i)) != INVALID_TYPE) + (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[0].i)), -2); else { - lc_error("Unknown map char type '%c'!", (yyvsp[(1) - (1)].i)); + lc_error("Unknown map char type '%c'!", (yyvsp[0].i)); (yyval.i) = SP_MAPCHAR_PACK(STONE, -2); } } +#line 4899 "y.tab.c" /* yacc.c:1646 */ break; case 326: - -/* Line 1455 of yacc.c */ -#line 2170 "lev_comp.y" +#line 2171 "lev_comp.y" /* yacc.c:1646 */ { - if (what_map_char((char) (yyvsp[(2) - (5)].i)) != INVALID_TYPE) - (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[(2) - (5)].i)), (yyvsp[(4) - (5)].i)); + if (what_map_char((char) (yyvsp[-3].i)) != INVALID_TYPE) + (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[-3].i)), (yyvsp[-1].i)); else { - lc_error("Unknown map char type '%c'!", (yyvsp[(2) - (5)].i)); - (yyval.i) = SP_MAPCHAR_PACK(STONE, (yyvsp[(4) - (5)].i)); + lc_error("Unknown map char type '%c'!", (yyvsp[-3].i)); + (yyval.i) = SP_MAPCHAR_PACK(STONE, (yyvsp[-1].i)); } } +#line 4912 "y.tab.c" /* yacc.c:1646 */ break; case 327: - -/* Line 1455 of yacc.c */ -#line 2181 "lev_comp.y" +#line 2182 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "M", VA_PASS1((yyvsp[(1) - (1)].i))); + add_opvars(splev, "M", VA_PASS1((yyvsp[0].i))); } +#line 4920 "y.tab.c" /* yacc.c:1646 */ break; case 328: - -/* Line 1455 of yacc.c */ -#line 2185 "lev_comp.y" +#line 2186 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_MONST); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (1)].map))); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_MONST); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); + Free((yyvsp[0].map)); } +#line 4931 "y.tab.c" /* yacc.c:1646 */ break; case 329: - -/* Line 1455 of yacc.c */ -#line 2192 "lev_comp.y" +#line 2193 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_MONST|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (4)].map))); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_MONST|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); + Free((yyvsp[-3].map)); } +#line 4942 "y.tab.c" /* yacc.c:1646 */ break; case 330: - -/* Line 1455 of yacc.c */ -#line 2201 "lev_comp.y" +#line 2202 "lev_comp.y" /* yacc.c:1646 */ { - long m = get_monster_id((yyvsp[(1) - (1)].map), (char)0); + long m = get_monster_id((yyvsp[0].map), (char)0); if (m == ERR) { - lc_error("Unknown monster \"%s\"!", (yyvsp[(1) - (1)].map)); + lc_error("Unknown monster \"%s\"!", (yyvsp[0].map)); (yyval.i) = -1; } else (yyval.i) = SP_MONST_PACK(m, def_monsyms[(int)mons[m].mlet].sym); + Free((yyvsp[0].map)); } +#line 4956 "y.tab.c" /* yacc.c:1646 */ break; case 331: - -/* Line 1455 of yacc.c */ -#line 2210 "lev_comp.y" +#line 2212 "lev_comp.y" /* yacc.c:1646 */ { - if (check_monster_char((char) (yyvsp[(1) - (1)].i))) - (yyval.i) = SP_MONST_PACK(-1, (yyvsp[(1) - (1)].i)); + if (check_monster_char((char) (yyvsp[0].i))) + (yyval.i) = SP_MONST_PACK(-1, (yyvsp[0].i)); else { - lc_error("Unknown monster class '%c'!", (yyvsp[(1) - (1)].i)); + lc_error("Unknown monster class '%c'!", (yyvsp[0].i)); (yyval.i) = -1; } } +#line 4969 "y.tab.c" /* yacc.c:1646 */ break; case 332: - -/* Line 1455 of yacc.c */ -#line 2219 "lev_comp.y" +#line 2221 "lev_comp.y" /* yacc.c:1646 */ { - long m = get_monster_id((yyvsp[(4) - (5)].map), (char) (yyvsp[(2) - (5)].i)); + long m = get_monster_id((yyvsp[-1].map), (char) (yyvsp[-3].i)); if (m == ERR) { - lc_error("Unknown monster ('%c', \"%s\")!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].map)); + lc_error("Unknown monster ('%c', \"%s\")!", (yyvsp[-3].i), (yyvsp[-1].map)); (yyval.i) = -1; } else - (yyval.i) = SP_MONST_PACK(m, (yyvsp[(2) - (5)].i)); + (yyval.i) = SP_MONST_PACK(m, (yyvsp[-3].i)); + Free((yyvsp[-1].map)); } +#line 4983 "y.tab.c" /* yacc.c:1646 */ break; case 333: - -/* Line 1455 of yacc.c */ -#line 2228 "lev_comp.y" +#line 2231 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = -1; } +#line 4991 "y.tab.c" /* yacc.c:1646 */ break; case 334: - -/* Line 1455 of yacc.c */ -#line 2234 "lev_comp.y" +#line 2237 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "O", VA_PASS1((yyvsp[(1) - (1)].i))); + add_opvars(splev, "O", VA_PASS1((yyvsp[0].i))); } +#line 4999 "y.tab.c" /* yacc.c:1646 */ break; case 335: - -/* Line 1455 of yacc.c */ -#line 2238 "lev_comp.y" +#line 2241 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_OBJ); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (1)].map))); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_OBJ); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); + Free((yyvsp[0].map)); } +#line 5010 "y.tab.c" /* yacc.c:1646 */ break; case 336: - -/* Line 1455 of yacc.c */ -#line 2245 "lev_comp.y" +#line 2248 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_OBJ|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (4)].map))); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_OBJ|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); + Free((yyvsp[-3].map)); } +#line 5021 "y.tab.c" /* yacc.c:1646 */ break; case 337: - -/* Line 1455 of yacc.c */ -#line 2254 "lev_comp.y" +#line 2257 "lev_comp.y" /* yacc.c:1646 */ { - long m = get_object_id((yyvsp[(1) - (1)].map), (char)0); + long m = get_object_id((yyvsp[0].map), (char)0); if (m == ERR) { - lc_error("Unknown object \"%s\"!", (yyvsp[(1) - (1)].map)); + lc_error("Unknown object \"%s\"!", (yyvsp[0].map)); (yyval.i) = -1; } else (yyval.i) = SP_OBJ_PACK(m, 1); /* obj class != 0 to force generation of a specific item */ - + Free((yyvsp[0].map)); } +#line 5035 "y.tab.c" /* yacc.c:1646 */ break; case 338: - -/* Line 1455 of yacc.c */ -#line 2264 "lev_comp.y" +#line 2267 "lev_comp.y" /* yacc.c:1646 */ { - if (check_object_char((char) (yyvsp[(1) - (1)].i))) - (yyval.i) = SP_OBJ_PACK(-1, (yyvsp[(1) - (1)].i)); + if (check_object_char((char) (yyvsp[0].i))) + (yyval.i) = SP_OBJ_PACK(-1, (yyvsp[0].i)); else { - lc_error("Unknown object class '%c'!", (yyvsp[(1) - (1)].i)); + lc_error("Unknown object class '%c'!", (yyvsp[0].i)); (yyval.i) = -1; } } +#line 5048 "y.tab.c" /* yacc.c:1646 */ break; case 339: - -/* Line 1455 of yacc.c */ -#line 2273 "lev_comp.y" +#line 2276 "lev_comp.y" /* yacc.c:1646 */ { - long m = get_object_id((yyvsp[(4) - (5)].map), (char) (yyvsp[(2) - (5)].i)); + long m = get_object_id((yyvsp[-1].map), (char) (yyvsp[-3].i)); if (m == ERR) { - lc_error("Unknown object ('%c', \"%s\")!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].map)); + lc_error("Unknown object ('%c', \"%s\")!", (yyvsp[-3].i), (yyvsp[-1].map)); (yyval.i) = -1; } else - (yyval.i) = SP_OBJ_PACK(m, (yyvsp[(2) - (5)].i)); + (yyval.i) = SP_OBJ_PACK(m, (yyvsp[-3].i)); + Free((yyvsp[-1].map)); } +#line 5062 "y.tab.c" /* yacc.c:1646 */ break; case 340: - -/* Line 1455 of yacc.c */ -#line 2282 "lev_comp.y" +#line 2286 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = -1; } +#line 5070 "y.tab.c" /* yacc.c:1646 */ break; case 341: - -/* Line 1455 of yacc.c */ -#line 2288 "lev_comp.y" +#line 2292 "lev_comp.y" /* yacc.c:1646 */ { } +#line 5076 "y.tab.c" /* yacc.c:1646 */ break; case 342: - -/* Line 1455 of yacc.c */ -#line 2290 "lev_comp.y" +#line 2294 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_MATH_ADD)); } +#line 5084 "y.tab.c" /* yacc.c:1646 */ break; case 343: - -/* Line 1455 of yacc.c */ -#line 2296 "lev_comp.y" +#line 2300 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "i", VA_PASS1((yyvsp[(1) - (1)].i))); + add_opvars(splev, "i", VA_PASS1((yyvsp[0].i))); } +#line 5092 "y.tab.c" /* yacc.c:1646 */ break; case 344: - -/* Line 1455 of yacc.c */ -#line 2300 "lev_comp.y" +#line 2304 "lev_comp.y" /* yacc.c:1646 */ { is_inconstant_number = 1; } +#line 5100 "y.tab.c" /* yacc.c:1646 */ break; case 345: - -/* Line 1455 of yacc.c */ -#line 2304 "lev_comp.y" +#line 2308 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "i", VA_PASS1((yyvsp[(2) - (3)].i))); + add_opvars(splev, "i", VA_PASS1((yyvsp[-1].i))); } +#line 5108 "y.tab.c" /* yacc.c:1646 */ break; case 346: - -/* Line 1455 of yacc.c */ -#line 2308 "lev_comp.y" +#line 2312 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_INT); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (1)].map))); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_INT); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); + Free((yyvsp[0].map)); is_inconstant_number = 1; } +#line 5120 "y.tab.c" /* yacc.c:1646 */ break; case 347: - -/* Line 1455 of yacc.c */ -#line 2316 "lev_comp.y" +#line 2320 "lev_comp.y" /* yacc.c:1646 */ { check_vardef_type(variable_definitions, - (yyvsp[(1) - (4)].map), SPOVAR_INT|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (4)].map))); - Free((yyvsp[(1) - (4)].map)); + (yyvsp[-3].map), SPOVAR_INT|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[-3].map))); + Free((yyvsp[-3].map)); is_inconstant_number = 1; } +#line 5133 "y.tab.c" /* yacc.c:1646 */ break; case 348: - -/* Line 1455 of yacc.c */ -#line 2325 "lev_comp.y" +#line 2329 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_MATH_ADD)); } +#line 5141 "y.tab.c" /* yacc.c:1646 */ break; case 349: - -/* Line 1455 of yacc.c */ -#line 2329 "lev_comp.y" +#line 2333 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_MATH_SUB)); } +#line 5149 "y.tab.c" /* yacc.c:1646 */ break; case 350: - -/* Line 1455 of yacc.c */ -#line 2333 "lev_comp.y" +#line 2337 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_MATH_MUL)); } +#line 5157 "y.tab.c" /* yacc.c:1646 */ break; case 351: - -/* Line 1455 of yacc.c */ -#line 2337 "lev_comp.y" +#line 2341 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_MATH_DIV)); } +#line 5165 "y.tab.c" /* yacc.c:1646 */ break; case 352: - -/* Line 1455 of yacc.c */ -#line 2341 "lev_comp.y" +#line 2345 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_MATH_MOD)); } +#line 5173 "y.tab.c" /* yacc.c:1646 */ break; case 353: - -/* Line 1455 of yacc.c */ -#line 2344 "lev_comp.y" +#line 2348 "lev_comp.y" /* yacc.c:1646 */ { } +#line 5179 "y.tab.c" /* yacc.c:1646 */ break; case 354: - -/* Line 1455 of yacc.c */ -#line 2348 "lev_comp.y" +#line 2352 "lev_comp.y" /* yacc.c:1646 */ { - if (!strcmp("int", (yyvsp[(1) - (1)].map)) || !strcmp("integer", (yyvsp[(1) - (1)].map))) { + if (!strcmp("int", (yyvsp[0].map)) || !strcmp("integer", (yyvsp[0].map))) { (yyval.i) = (int)'i'; } else - lc_error("Unknown function parameter type '%s'", (yyvsp[(1) - (1)].map)); + lc_error("Unknown function parameter type '%s'", (yyvsp[0].map)); } +#line 5190 "y.tab.c" /* yacc.c:1646 */ break; case 355: - -/* Line 1455 of yacc.c */ -#line 2355 "lev_comp.y" +#line 2359 "lev_comp.y" /* yacc.c:1646 */ { - if (!strcmp("str", (yyvsp[(1) - (1)].map)) || !strcmp("string", (yyvsp[(1) - (1)].map))) { + if (!strcmp("str", (yyvsp[0].map)) || !strcmp("string", (yyvsp[0].map))) { (yyval.i) = (int)'s'; } else - lc_error("Unknown function parameter type '%s'", (yyvsp[(1) - (1)].map)); + lc_error("Unknown function parameter type '%s'", (yyvsp[0].map)); } +#line 5201 "y.tab.c" /* yacc.c:1646 */ break; case 356: - -/* Line 1455 of yacc.c */ -#line 2364 "lev_comp.y" +#line 2368 "lev_comp.y" /* yacc.c:1646 */ { struct lc_funcdefs_parm *tmp = New(struct lc_funcdefs_parm); @@ -5756,8 +5211,8 @@ yyreduce: lc_error("Could not alloc function params."); } else { long vt; - tmp->name = strdup((yyvsp[(1) - (3)].map)); - tmp->parmtype = (char) (yyvsp[(3) - (3)].i); + tmp->name = strdup((yyvsp[-2].map)); + tmp->parmtype = (char) (yyvsp[0].i); tmp->next = curr_function->params; curr_function->params = tmp; curr_function->n_params++; @@ -5768,379 +5223,354 @@ yyreduce: } variable_definitions = add_vardef_type( variable_definitions, - (yyvsp[(1) - (3)].map), vt); + (yyvsp[-2].map), vt); } - Free((yyvsp[(1) - (3)].map)); + Free((yyvsp[-2].map)); } +#line 5231 "y.tab.c" /* yacc.c:1646 */ break; case 361: - -/* Line 1455 of yacc.c */ -#line 2400 "lev_comp.y" +#line 2404 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = (int)'i'; } +#line 5239 "y.tab.c" /* yacc.c:1646 */ break; case 362: - -/* Line 1455 of yacc.c */ -#line 2404 "lev_comp.y" +#line 2408 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = (int)'s'; } +#line 5247 "y.tab.c" /* yacc.c:1646 */ break; case 363: - -/* Line 1455 of yacc.c */ -#line 2411 "lev_comp.y" +#line 2415 "lev_comp.y" /* yacc.c:1646 */ { char tmpbuf[2]; - tmpbuf[0] = (char) (yyvsp[(1) - (1)].i); + tmpbuf[0] = (char) (yyvsp[0].i); tmpbuf[1] = '\0'; (yyval.map) = strdup(tmpbuf); } +#line 5258 "y.tab.c" /* yacc.c:1646 */ break; case 364: - -/* Line 1455 of yacc.c */ -#line 2418 "lev_comp.y" +#line 2422 "lev_comp.y" /* yacc.c:1646 */ { - long len = strlen( (yyvsp[(1) - (3)].map) ); + long len = strlen( (yyvsp[-2].map) ); char *tmp = (char *)alloc(len + 2); - sprintf(tmp, "%c%s", (char) (yyvsp[(3) - (3)].i), (yyvsp[(1) - (3)].map) ); - Free( (yyvsp[(1) - (3)].map) ); + sprintf(tmp, "%c%s", (char) (yyvsp[0].i), (yyvsp[-2].map) ); + Free( (yyvsp[-2].map) ); (yyval.map) = tmp; } +#line 5270 "y.tab.c" /* yacc.c:1646 */ break; case 365: - -/* Line 1455 of yacc.c */ -#line 2428 "lev_comp.y" +#line 2432 "lev_comp.y" /* yacc.c:1646 */ { (yyval.map) = strdup(""); } +#line 5278 "y.tab.c" /* yacc.c:1646 */ break; case 366: - -/* Line 1455 of yacc.c */ -#line 2432 "lev_comp.y" +#line 2436 "lev_comp.y" /* yacc.c:1646 */ { - char *tmp = strdup( (yyvsp[(1) - (1)].map) ); - Free( (yyvsp[(1) - (1)].map) ); + char *tmp = strdup( (yyvsp[0].map) ); + Free( (yyvsp[0].map) ); (yyval.map) = tmp; } +#line 5288 "y.tab.c" /* yacc.c:1646 */ break; case 367: - -/* Line 1455 of yacc.c */ -#line 2440 "lev_comp.y" +#line 2444 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_SEL_POINT)); } +#line 5296 "y.tab.c" /* yacc.c:1646 */ break; case 368: - -/* Line 1455 of yacc.c */ -#line 2444 "lev_comp.y" +#line 2448 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_SEL_RECT)); } +#line 5304 "y.tab.c" /* yacc.c:1646 */ break; case 369: - -/* Line 1455 of yacc.c */ -#line 2448 "lev_comp.y" +#line 2452 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_SEL_FILLRECT)); } +#line 5312 "y.tab.c" /* yacc.c:1646 */ break; case 370: - -/* Line 1455 of yacc.c */ -#line 2452 "lev_comp.y" +#line 2456 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_SEL_LINE)); } +#line 5320 "y.tab.c" /* yacc.c:1646 */ break; case 371: - -/* Line 1455 of yacc.c */ -#line 2456 "lev_comp.y" +#line 2460 "lev_comp.y" /* yacc.c:1646 */ { /* randline (x1,y1),(x2,y2), roughness */ add_opvars(splev, "o", VA_PASS1(SPO_SEL_RNDLINE)); } +#line 5329 "y.tab.c" /* yacc.c:1646 */ break; case 372: - -/* Line 1455 of yacc.c */ -#line 2461 "lev_comp.y" +#line 2465 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", VA_PASS2(W_ANY, SPO_SEL_GROW)); } +#line 5337 "y.tab.c" /* yacc.c:1646 */ break; case 373: - -/* Line 1455 of yacc.c */ -#line 2465 "lev_comp.y" +#line 2469 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", VA_PASS2((yyvsp[(3) - (6)].i), SPO_SEL_GROW)); + add_opvars(splev, "io", VA_PASS2((yyvsp[-3].i), SPO_SEL_GROW)); } +#line 5345 "y.tab.c" /* yacc.c:1646 */ break; case 374: - -/* Line 1455 of yacc.c */ -#line 2469 "lev_comp.y" +#line 2473 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iio", - VA_PASS3((yyvsp[(3) - (6)].i), SPOFILTER_PERCENT, SPO_SEL_FILTER)); + VA_PASS3((yyvsp[-3].i), SPOFILTER_PERCENT, SPO_SEL_FILTER)); } +#line 5354 "y.tab.c" /* yacc.c:1646 */ break; case 375: - -/* Line 1455 of yacc.c */ -#line 2474 "lev_comp.y" +#line 2478 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", VA_PASS2(SPOFILTER_SELECTION, SPO_SEL_FILTER)); } +#line 5363 "y.tab.c" /* yacc.c:1646 */ break; case 376: - -/* Line 1455 of yacc.c */ -#line 2479 "lev_comp.y" +#line 2483 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", VA_PASS2(SPOFILTER_MAPCHAR, SPO_SEL_FILTER)); } +#line 5372 "y.tab.c" /* yacc.c:1646 */ break; case 377: - -/* Line 1455 of yacc.c */ -#line 2484 "lev_comp.y" +#line 2488 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_SEL_FLOOD)); } +#line 5380 "y.tab.c" /* yacc.c:1646 */ break; case 378: - -/* Line 1455 of yacc.c */ -#line 2488 "lev_comp.y" +#line 2492 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "oio", VA_PASS3(SPO_COPY, 1, SPO_SEL_ELLIPSE)); } +#line 5389 "y.tab.c" /* yacc.c:1646 */ break; case 379: - -/* Line 1455 of yacc.c */ -#line 2493 "lev_comp.y" +#line 2497 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "oio", - VA_PASS3(SPO_COPY, (yyvsp[(7) - (8)].i), SPO_SEL_ELLIPSE)); + VA_PASS3(SPO_COPY, (yyvsp[-1].i), SPO_SEL_ELLIPSE)); } +#line 5398 "y.tab.c" /* yacc.c:1646 */ break; case 380: - -/* Line 1455 of yacc.c */ -#line 2498 "lev_comp.y" +#line 2502 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", VA_PASS2(1, SPO_SEL_ELLIPSE)); } +#line 5406 "y.tab.c" /* yacc.c:1646 */ break; case 381: - -/* Line 1455 of yacc.c */ -#line 2502 "lev_comp.y" +#line 2506 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", VA_PASS2((yyvsp[(9) - (10)].i), SPO_SEL_ELLIPSE)); + add_opvars(splev, "io", VA_PASS2((yyvsp[-1].i), SPO_SEL_ELLIPSE)); } +#line 5414 "y.tab.c" /* yacc.c:1646 */ break; case 382: - -/* Line 1455 of yacc.c */ -#line 2506 "lev_comp.y" +#line 2510 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iio", - VA_PASS3((yyvsp[(9) - (14)].i), (yyvsp[(3) - (14)].i), SPO_SEL_GRADIENT)); + VA_PASS3((yyvsp[-5].i), (yyvsp[-11].i), SPO_SEL_GRADIENT)); } +#line 5423 "y.tab.c" /* yacc.c:1646 */ break; case 383: - -/* Line 1455 of yacc.c */ -#line 2511 "lev_comp.y" +#line 2515 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_SEL_COMPLEMENT)); } +#line 5431 "y.tab.c" /* yacc.c:1646 */ break; case 384: - -/* Line 1455 of yacc.c */ -#line 2515 "lev_comp.y" +#line 2519 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_SEL); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", VA_PASS1((yyvsp[(1) - (1)].map))); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_SEL); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", VA_PASS1((yyvsp[0].map))); + Free((yyvsp[0].map)); } +#line 5442 "y.tab.c" /* yacc.c:1646 */ break; case 385: - -/* Line 1455 of yacc.c */ -#line 2522 "lev_comp.y" +#line 2526 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 5450 "y.tab.c" /* yacc.c:1646 */ break; case 386: - -/* Line 1455 of yacc.c */ -#line 2528 "lev_comp.y" +#line 2532 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 5458 "y.tab.c" /* yacc.c:1646 */ break; case 387: - -/* Line 1455 of yacc.c */ -#line 2532 "lev_comp.y" +#line 2536 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", VA_PASS1(SPO_SEL_ADD)); } +#line 5466 "y.tab.c" /* yacc.c:1646 */ break; case 388: - -/* Line 1455 of yacc.c */ -#line 2538 "lev_comp.y" +#line 2542 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iio", - VA_PASS3((yyvsp[(1) - (1)].dice).num, (yyvsp[(1) - (1)].dice).die, SPO_DICE)); + VA_PASS3((yyvsp[0].dice).num, (yyvsp[0].dice).die, SPO_DICE)); } +#line 5475 "y.tab.c" /* yacc.c:1646 */ break; case 392: - -/* Line 1455 of yacc.c */ -#line 2550 "lev_comp.y" +#line 2554 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "i", VA_PASS1((yyvsp[(1) - (1)].i))); + add_opvars(splev, "i", VA_PASS1((yyvsp[0].i))); } +#line 5483 "y.tab.c" /* yacc.c:1646 */ break; case 393: - -/* Line 1455 of yacc.c */ -#line 2554 "lev_comp.y" +#line 2558 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "i", VA_PASS1((yyvsp[(1) - (1)].i))); + add_opvars(splev, "i", VA_PASS1((yyvsp[0].i))); } +#line 5491 "y.tab.c" /* yacc.c:1646 */ break; case 394: - -/* Line 1455 of yacc.c */ -#line 2558 "lev_comp.y" +#line 2562 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "i", VA_PASS1((yyvsp[(1) - (1)].i))); + add_opvars(splev, "i", VA_PASS1((yyvsp[0].i))); } +#line 5499 "y.tab.c" /* yacc.c:1646 */ break; case 395: - -/* Line 1455 of yacc.c */ -#line 2562 "lev_comp.y" +#line 2566 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 5507 "y.tab.c" /* yacc.c:1646 */ break; case 404: - -/* Line 1455 of yacc.c */ -#line 2584 "lev_comp.y" +#line 2588 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.lregn) = (yyvsp[(1) - (1)].lregn); + (yyval.lregn) = (yyvsp[0].lregn); } +#line 5515 "y.tab.c" /* yacc.c:1646 */ break; case 405: - -/* Line 1455 of yacc.c */ -#line 2588 "lev_comp.y" +#line 2592 "lev_comp.y" /* yacc.c:1646 */ { - if ((yyvsp[(3) - (10)].i) <= 0 || (yyvsp[(3) - (10)].i) >= COLNO) - lc_error("Region (%li,%li,%li,%li) out of level range (x1)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); - else if ((yyvsp[(5) - (10)].i) < 0 || (yyvsp[(5) - (10)].i) >= ROWNO) - lc_error("Region (%li,%li,%li,%li) out of level range (y1)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); - else if ((yyvsp[(7) - (10)].i) <= 0 || (yyvsp[(7) - (10)].i) >= COLNO) - lc_error("Region (%li,%li,%li,%li) out of level range (x2)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); - else if ((yyvsp[(9) - (10)].i) < 0 || (yyvsp[(9) - (10)].i) >= ROWNO) - lc_error("Region (%li,%li,%li,%li) out of level range (y2)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); - (yyval.lregn).x1 = (yyvsp[(3) - (10)].i); - (yyval.lregn).y1 = (yyvsp[(5) - (10)].i); - (yyval.lregn).x2 = (yyvsp[(7) - (10)].i); - (yyval.lregn).y2 = (yyvsp[(9) - (10)].i); + if ((yyvsp[-7].i) <= 0 || (yyvsp[-7].i) >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-5].i) < 0 || (yyvsp[-5].i) >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-3].i) <= 0 || (yyvsp[-3].i) >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-1].i) < 0 || (yyvsp[-1].i) >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + (yyval.lregn).x1 = (yyvsp[-7].i); + (yyval.lregn).y1 = (yyvsp[-5].i); + (yyval.lregn).x2 = (yyvsp[-3].i); + (yyval.lregn).y2 = (yyvsp[-1].i); (yyval.lregn).area = 1; } +#line 5535 "y.tab.c" /* yacc.c:1646 */ break; case 406: - -/* Line 1455 of yacc.c */ -#line 2606 "lev_comp.y" +#line 2610 "lev_comp.y" /* yacc.c:1646 */ { /* This series of if statements is a hack for MSC 5.1. It seems that its tiny little brain cannot compile if these are all one big if statement. */ - if ((yyvsp[(2) - (9)].i) < 0 || (yyvsp[(2) - (9)].i) > (int)max_x_map) - lc_error("Region (%li,%li,%li,%li) out of map range (x1)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); - else if ((yyvsp[(4) - (9)].i) < 0 || (yyvsp[(4) - (9)].i) > (int)max_y_map) - lc_error("Region (%li,%li,%li,%li) out of map range (y1)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); - else if ((yyvsp[(6) - (9)].i) < 0 || (yyvsp[(6) - (9)].i) > (int)max_x_map) - lc_error("Region (%li,%li,%li,%li) out of map range (x2)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); - else if ((yyvsp[(8) - (9)].i) < 0 || (yyvsp[(8) - (9)].i) > (int)max_y_map) - lc_error("Region (%li,%li,%li,%li) out of map range (y2)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + if ((yyvsp[-7].i) < 0 || (yyvsp[-7].i) > (int)max_x_map) + lc_error("Region (%li,%li,%li,%li) out of map range (x1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-5].i) < 0 || (yyvsp[-5].i) > (int)max_y_map) + lc_error("Region (%li,%li,%li,%li) out of map range (y1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-3].i) < 0 || (yyvsp[-3].i) > (int)max_x_map) + lc_error("Region (%li,%li,%li,%li) out of map range (x2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-1].i) < 0 || (yyvsp[-1].i) > (int)max_y_map) + lc_error("Region (%li,%li,%li,%li) out of map range (y2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); (yyval.lregn).area = 0; - (yyval.lregn).x1 = (yyvsp[(2) - (9)].i); - (yyval.lregn).y1 = (yyvsp[(4) - (9)].i); - (yyval.lregn).x2 = (yyvsp[(6) - (9)].i); - (yyval.lregn).y2 = (yyvsp[(8) - (9)].i); + (yyval.lregn).x1 = (yyvsp[-7].i); + (yyval.lregn).y1 = (yyvsp[-5].i); + (yyval.lregn).x2 = (yyvsp[-3].i); + (yyval.lregn).y2 = (yyvsp[-1].i); } +#line 5557 "y.tab.c" /* yacc.c:1646 */ break; - -/* Line 1455 of yacc.c */ -#line 6142 "y.tab.c" +#line 5561 "y.tab.c" /* yacc.c:1646 */ default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -6149,7 +5579,7 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -6164,10 +5594,14 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -6175,37 +5609,36 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } @@ -6214,20 +5647,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -6246,7 +5679,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -6259,35 +5692,37 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + if (!yypact_value_is_default (yyn)) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ @@ -6311,7 +5746,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -6323,16 +5758,21 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -6343,15 +5783,9 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - - -/* Line 1675 of yacc.c */ -#line 2626 "lev_comp.y" +#line 2630 "lev_comp.y" /* yacc.c:1906 */ /*lev_comp.y*/ - From d813c6f0eef0d859c9efee4cbe5dcd4ddeecc5e0 Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 15 Nov 2015 00:32:56 -0800 Subject: [PATCH 37/51] window cleanup at exit exit_nhwindows() is called before terminate(), and the tty incarnation destroys all windows--including 'pickinv_cache_win'--without setting the various index variables used to access them to WIN_ERR, then terminate() calls freedynamicdata() which calls free_pickinv_cache() which tries to destroy 'pickinv_cache_win' since it isn't WIN_ERR (if the perm_invent option has been enabled during that playing session). Some of the other _exit_nhwindows() also tear things down without resetting the variables used to track them, so fixing this in exit_nhwindows() would have been pretty messy. Call free_pickinv_cache() before exit_nhwindows() in done(). At the moment it's only called from done(), so other exit paths won't release the small chunk(s) of memory used for the alternate inventory window (if it got created for perm_invent support). --- src/end.c | 17 ++++++++--------- src/invent.c | 4 +--- src/save.c | 4 ++-- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/end.c b/src/end.c index c8560b217..e7c9da20a 100644 --- a/src/end.c +++ b/src/end.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 end.c $NHDT-Date: 1446510332 2015/11/03 00:25:32 $ $NHDT-Branch: master $:$NHDT-Revision: 1.102 $ */ +/* NetHack 3.6 end.c $NHDT-Date: 1447576343 2015/11/15 08:32:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.103 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1094,6 +1094,7 @@ die: /* clean up unneeded windows */ if (have_windows) { wait_synch(); + free_pickinv_cache(); /* extra persistent window if perm_invent */ if (WIN_INVEN != WIN_ERR) destroy_nhwindow(WIN_INVEN), WIN_INVEN = WIN_ERR; display_nhwindow(WIN_MESSAGE, TRUE); @@ -1122,13 +1123,12 @@ die: } if (!done_stopprint) { - Sprintf( - pbuf, "%s %s the %s...", Goodbye(), plname, - how != ASCENDED - ? (const char *) ((flags.female && urole.name.f) + Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname, + (how != ASCENDED) + ? (const char *) ((flags.female && urole.name.f) ? urole.name.f : urole.name.m) - : (const char *) (flags.female ? "Demigoddess" : "Demigod")); + : (const char *) (flags.female ? "Demigoddess" : "Demigod")); putstr(endwin, 0, pbuf); putstr(endwin, 0, ""); } @@ -1254,10 +1254,9 @@ die: putstr(endwin, 0, pbuf); } if (!done_stopprint) { - Sprintf( - pbuf, + Sprintf(pbuf, "You were level %d with a maximum of %d hit point%s when you %s.", - u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]); + u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]); putstr(endwin, 0, pbuf); putstr(endwin, 0, ""); } diff --git a/src/invent.c b/src/invent.c index 5309d3b8d..430894aab 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 invent.c $NHDT-Date: 1446516832 2015/11/03 02:13:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.178 $ */ +/* NetHack 3.6 invent.c $NHDT-Date: 1447576348 2015/11/15 08:32:28 $ $NHDT-Branch: master $:$NHDT-Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1985,7 +1985,6 @@ struct obj *list, **last_found; then regrown to full inventory, possibly being resized in the process */ static winid cached_pickinv_win = WIN_ERR; -/* #ifdef FREE_ALL_MEMORY */ void free_pickinv_cache() { @@ -1994,7 +1993,6 @@ free_pickinv_cache() cached_pickinv_win = WIN_ERR; } } -/* #endif */ /* * Internal function used by display_inventory and getobj that can display diff --git a/src/save.c b/src/save.c index dccd3a785..41dd65a04 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 save.c $NHDT-Date: 1447124658 2015/11/10 03:04:18 $ $NHDT-Branch: master $:$NHDT-Revision: 1.93 $ */ +/* NetHack 3.6 save.c $NHDT-Date: 1447576350 2015/11/15 08:32:30 $ $NHDT-Branch: master $:$NHDT-Revision: 1.94 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1395,7 +1395,7 @@ freedynamicdata() free_autopickup_exceptions(); /* miscellaneous */ - free_pickinv_cache(); + /* free_pickinv_cache(); -- done from done()... */ free_symsets(); #endif /* FREE_ALL_MEMORY */ #ifdef STATUS_VIA_WINDOWPORT From 8a07e2cdc5abb46400e66a4919b61dd9ac04fff2 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 15 Nov 2015 18:55:09 +0200 Subject: [PATCH 38/51] Fix use of data from deleted vault teleport trap --- src/teleport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/teleport.c b/src/teleport.c index 8f7b5860a..5faf0135c 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -490,12 +490,14 @@ int dotele() { struct trap *trap; + boolean trap_once = FALSE; trap = t_at(u.ux, u.uy); if (trap && (!trap->tseen || trap->ttyp != TELEP_TRAP)) trap = 0; if (trap) { + trap_once = trap->once; /* trap may get deleted, save this */ if (trap->once) { pline("This is a vault teleport, usable once only."); if (yn("Jump in?") == 'n') @@ -569,7 +571,7 @@ dotele() } if (next_to_u()) { - if (trap && trap->once) + if (trap && trap_once) vault_tele(); else tele(); From 0072daa952747802986946c9798935f46b9a1b6d Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 15 Nov 2015 15:35:48 -0800 Subject: [PATCH 39/51] tty_exit_nhwindows Keep window bookkeeping up to date when tty interface is shuting down. The other interfaces should do something similar when they make windows known to the core become unavailable. --- win/tty/wintty.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 372545351..de97e48b1 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintty.c $NHDT-Date: 1447405953 2015/11/13 09:12:33 $ $NHDT-Branch: master $:$NHDT-Revision: 1.114 $ */ +/* NetHack 3.6 wintty.c $NHDT-Date: 1447630543 2015/11/15 23:35:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.115 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1189,9 +1189,10 @@ const char *str; winid i; tty_suspend_nhwindows(str); - /* Just forget any windows existed, since we're about to exit anyway. + /* * Disable windows to avoid calls to window routines. */ + free_pickinv_cache(); /* reset its state as well as tear down window */ for (i = 0; i < MAXWIN; i++) { if (i == BASE_WINDOW) continue; /* handle wins[BASE_WINDOW] last */ @@ -1203,6 +1204,10 @@ const char *str; wins[i] = (struct WinDesc *) 0; } } + WIN_MAP = WIN_MESSAGE = WIN_INVEN = WIN_ERR; /* these are all gone now */ +#ifndef STATUS_VIA_WINDOWPORT + WIN_STATUS = WIN_ERR; +#endif #ifdef FREE_ALL_MEMORY if (BASE_WINDOW != WIN_ERR && wins[BASE_WINDOW]) { free_window_info(wins[BASE_WINDOW], TRUE); From 334cfd8a97d20456b4962cb055822d5feb568c8d Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 15 Nov 2015 17:00:08 -0800 Subject: [PATCH 40/51] tribute: Thud! --- dat/tribute | 149 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 117 insertions(+), 32 deletions(-) diff --git a/dat/tribute b/dat/tribute index 89ac2d4f4..d859375d6 100644 --- a/dat/tribute +++ b/dat/tribute @@ -4109,26 +4109,31 @@ is theft, except mine. # # # -%title Thud! (2) +%title Thud! (7) +# p. 39 (Harper Torch edition; passage starts mid-paragraph; speaker is Nobby) %passage 1 -Why bother with a cunning plan when a simple one will do? +"Why mess about with a cunning plan when a simple one will do?" [Thud!, by Terry Pratchett] %e passage +# pp. 334-336 (originally transcribed from some other edition) %passage 2 -#submitted by Boudewijn -He wanted to sleep. He'd never felt this tired before. -Vimes slumped to his knees, and then fell sideways on to the sand. -When he forced open his eyes he saw pale stars above him, and had once -again the sensation that there was someone else present. -He turned his head, wincing at the stab of pain, and saw a small but -brightly lit folding chair on the sand. A robed figure was reclining -in it, reading a book. A scythe was stuck in the sand beside it. -A white skeletal hand turned a page. +He wanted to sleep. He'd never felt this tired before. Vimes slumped to +his knees, and then fell sideways on to the sand. + +When he forced his eyes open, he saw pale stars above him, and had, once +again, the sensation that there was someone else present. + +He turned his head, wincing at the stab of pain, and saw a small but +brightly lit folding chair on the sand. A robed figure was reclining in +it, reading a book. A scythe was stuck in the sand beside it. + +A white, skeletal hand turned a page. + 'You'll be Death, then?' said Vimes, after a while. -AH. MISTER VIMES, ASTUTE AS EVER. GOT IT IN ONE, said Death, shutting -the book on his finger to keep the place. +AH, MISTER VIMES, ASTUTE AS EVER. GOT IT IN ONE, said Death, shutting the +book on his finger to keep the place. 'I've seen you before.' @@ -4136,42 +4141,122 @@ I HAVE WALKED WITH YOU MANY TIMES, MISTER VIMES. 'And this is /it/, is it?' -HAS IT NEVER STRUCK YOU THAT THE CONCEPT OF A WRITTEN NARRATIVE IS -SOMEWHAT STRANGE? said Death. +HAS IT NEVER STRUCK YOU THAT THE CONCEPT OF A WRITTEN NARRATIVE IS SOMEWHAT +STRANGE? said Death. Vimes could tell when people were trying to avoid something they really didn't want to say, and it was happening here. -'Is it?' he insisted. 'Is this it? This time I die?' + +'Is it?' he insisted. 'Is this it? This time I die?' COULD BE. -'Could be? What sort of answer is that?' said Vimes. +'Could be? What sort of answer is that?' said Vimes. -A VERY ACCURATE ONE. YOU SEE, YOU ARE HAVING A NEAR DEATH EXPERIENCE, -WHICH INESCAPABLY MEANS THAT I MUST UNDERGO A NEAR VIMES EXPERIENCE. -DON'T MIND ME. CARRY ON WHATEVER YOU WERE DOING. I HAVE A BOOK. +A VERY ACCURATE ONE. YOU SEE, YOU ARE HAVING A NEAR-DEATH EXPERIENCE, +WHICH INESCAPABLY MEANS THAT I MUST UNDERGO A NEAR-/VIMES/ EXPERIENCE. +DON'T MIND ME. CARRY ON WITH WHATEVER YOU WERE DOING. I HAVE A BOOK. + +Vimes rolled over on to his stomach, gritted his teeth, and pushed himself +on to his hands and knees again. He managed a few yards before slumping +back down. + +He heard the sound of a chair being moved. -Vimes rolled over on to his stomach, gritted his teeth and pushed -himself on to his hands and knees again. He managed a few yards before -slumping back down. He heard the sound of a chair being moved. 'Shouldn't you be somewhere else?' he said. I AM, said Death, sitting down again. - + 'But you're here!' - -AS WELL. Death turned a page and, for a person without breath, managed -a pretty good sigh. IT APPEARS THAT THE BUTLER DID IT. + +AS WELL. Death turned a page and, for a person without breath, managed a +pretty good sigh. IT APPEARS THAT THE BUTLER DID IT. 'Did what?' -IT IS A MADE-UP STORY. VERY STRANGE. ALL ONE NEEDS TO DO IS TURN TO THE -LAST PAGE AND THE ANSWER IS THERE. WHAT, THEREFORE, IS THE POINT OF +IT IS A MADE-UP STORY. VERY STRANGE. ALL ONE NEEDS TO DO IS TURN TO THE +LAST PAGE AND THE ANSWER IS THERE. WHAT, THEREFORE, IS THE POINT OF DELIBERATEDLY NOT KNOWING? -It sounded like gibberish to Vimes, so he ignored it. Some of the aches -had gone, although his head still hammered. There was an empty feeling, -everywhere. He just wanted to sleep. +It sounded like gibberish to Vimes, so he ignored it. Some of the aches +had gone, although his head still hammered. There was an empty feeling +everywhere. He just wanted to sleep. + + [Thud!, by Terry Pratchett] +%e passage +# pp. 225-226 +%passage 3 +And I'm going home, Vimes repeated to himself. Everyone wants something +from Vimes, even though I'm not the sharpest knife in the drawer. Hell, +I'm probably a spoon. Well I'm going to be Vimes, and Vimes reads +/Where's My Cow?/ to Young Sam at six o'clock. With the noises done right. + + [Thud!, by Terry Pratchett] +%e passage +# pp. 261-262 +%passage 4 +Fred Colon peered through the bars. He was, on the whole, a pretty good +jailer; he always had a pot of tea on the go, he was, as a general rule, +amiably disposed to most people, he was too slow to be easily fooled, and +he kept the cell keys in a box in the bottom drawer of his desk, a long +way out of reach of any stick, hand, dog, cunningly thrown belt, or +trained Klatchian monkey spider.(1) + +(1) Making Fred Colon possibly unique in the annals of jail history. + + [Thud!, by Terry Pratchett] +%e passage +# p. 287 (American spelling of 'theater' is accurate [Harper Torch edition]) +%passage 5 +Brushing aside cobwebs with one hand and holding up a lantern with the +other, Sybil led the way past boxes of MEN'S BOOTS, VARIOUS; RISIBLE +PUPPETS, STRING & GLOVE; MODEL THEATER AND SCENERY. Maybe that was the +reason for their wealth: they bought things that were built to last, and +now they seldom had to buy anything at all. Except food, of course, and +even then Vimes would not have been surprised to see boxes labeled APPLE +CORES, VARIOUS, or LEFTOVERS, NEED EATING UP.(1) + +(1) That was a phrase of Sybil's that got to him. She'd announce at lunch, +"we must have the pork tonight, it needs eating up." Vimes never had an +actual problem with this, because he'd been raised to eat what was put in +front of him, and do it quickly, too, before someone else snatched it away. +He was just puzzled at the suggestion that he was there to do the food a +favor. + + [Thud!, by Terry Pratchett] +%e passage +# pp. 296-297 +%passage 6 +"Tell me Drumknott, are you a betting man at all?" + +"I have been know to have the occasional 'little flutter,' sir." + +"Given, then, a contest between an invisible and very powerful quasidemonic +/thing/ of pure vengence on the one hand, and the commander on the other, +where would you wager, say... one dollar?" + +"I wouldn't, sir. That looks like one that would go to the judges." + +"Yes," said Vetinari, staring thoughtfully at the closed door. "Yes, +/indeed/." + + [Thud!, by Terry Pratchett] +%e passage +# p. 351 ('teeth-aching' probably ought to have been 'teeth-achingly') +%passage 7 +Vimes reached up and took a mug of water from Angua. It was teeth-aching +cold and the best drink he'd ever tasted. And his mind worked fast, flying +in emergency supplies of common sense, as human minds do, to construct a +huge anchor in sanity and prove that what happened hadn't really happened +and, if it had happened, hadn't happened very much. + +It was all mystic, that's what it was. Oh, it /might/ all be true, but how +could you ever tell? You had to stick to the things you can see. And you +had to keep reminding yourself of that, too. + +Yeah, that was it. What had really happened, eh? A few signs? Well, +anything can look like you want it to, if you're worried and confused +enough, yes? A sheep can look like a cow, right? Ha! [Thud!, by Terry Pratchett] %e passage From c40982eb239e0a42b088334c5ba2f9fe50190402 Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 15 Nov 2015 21:57:15 -0800 Subject: [PATCH 41/51] tribute enhancement When reading a novel, select a random passage which hasn't been shown already. Once you've run through all the passages, it resets to get them all again (with new random order that might happen to the be same order if there aren't many passages). Switching to a different novel-- even another copy of the same one--will cause the previous passage selection to be discarded and restarted from scratch if the prior book is read again. Passage tracking for the most recently read novel is kept across save and restore. (That means I needed to bump EDITLEVEL, so it will need to be reset to 0 again before release.) --- include/context.h | 9 +++++- include/extern.h | 5 +-- include/patchlevel.h | 4 +-- src/files.c | 77 +++++++++++++++++++++++++++++++------------- src/spell.c | 6 ++-- 5 files changed, 72 insertions(+), 29 deletions(-) diff --git a/include/context.h b/include/context.h index 0e7595ff9..bddc8e94b 100644 --- a/include/context.h +++ b/include/context.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 context.h $NHDT-Date: 1445215010 2015/10/19 00:36:50 $ $NHDT-Branch: master $:$NHDT-Revision: 1.27 $ */ +/* NetHack 3.6 context.h $NHDT-Date: 1447653421 2015/11/16 05:57:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.28 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -90,6 +90,12 @@ struct tribute_info { /* 30 free bits */ }; +struct novel_tracking { /* for choosing random passage when reading novel */ + unsigned id; /* novel oid from previous passage selection */ + int count; /* number of passage indices available in pasg[] */ + xchar pasg[30]; /* pasg[0..count] are passage indices */ +}; + struct context_info { unsigned ident; /* social security number for each monster */ unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */ @@ -124,6 +130,7 @@ struct context_info { struct polearm_info polearm; struct obj_split objsplit; /* track most recently split object stack */ struct tribute_info tribute; + struct novel_tracking novel; }; extern NEARDATA struct context_info context; diff --git a/include/extern.h b/include/extern.h index 5add97a44..2b96c74e8 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 extern.h $NHDT-Date: 1447475941 2015/11/14 04:39:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.516 $ */ +/* NetHack 3.6 extern.h $NHDT-Date: 1447653422 2015/11/16 05:57:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.517 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -766,7 +766,8 @@ E void NDECL(really_close); #ifdef DEBUG E boolean FDECL(debugcore, (const char *, BOOLEAN_P)); #endif -E boolean FDECL(read_tribute, (const char *, const char *, int, char *, int)); +E boolean FDECL(read_tribute, (const char *, const char *, int, + char *, int, unsigned)); E boolean FDECL(Death_quote, (char *, int)); /* ### fountain.c ### */ diff --git a/include/patchlevel.h b/include/patchlevel.h index cbc717e54..2beb4bf15 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 patchlevel.h $NHDT-Date: 1447311411 2015/11/12 06:56:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.110 $ */ +/* NetHack 3.6 patchlevel.h $NHDT-Date: 1447653420 2015/11/16 05:57:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.111 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -13,7 +13,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 0 +#define EDITLEVEL 2 #define COPYRIGHT_BANNER_A "NetHack, Copyright 1985-2015" #define COPYRIGHT_BANNER_B \ diff --git a/src/files.c b/src/files.c index f9638681c..f257046f6 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 files.c $NHDT-Date: 1446955299 2015/11/08 04:01:39 $ $NHDT-Branch: master $:$NHDT-Revision: 1.186 $ */ +/* NetHack 3.6 files.c $NHDT-Date: 1447653425 2015/11/16 05:57:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.187 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3421,20 +3421,55 @@ boolean wildcards; /* ---------- BEGIN TRIBUTE ----------- */ /* 3.6 tribute code - * - * Returns TRUE if you were able to read something. - * */ #define SECTIONSCOPE 1 #define TITLESCOPE 2 #define PASSAGESCOPE 3 +#define MAXPASSAGES SIZE(context.novel.pasg) /* 30 */ + +static int FDECL(choose_passage, (int, unsigned)); + +/* choose a random passage that hasn't been chosen yet; once all have + been chosen, reset the tracking to make all passages available again */ +static int +choose_passage(passagecnt, oid) +int passagecnt; /* total of available passages, 1..MAXPASSAGES */ +unsigned oid; /* book.o_id, used to determine whether re-reading same book */ +{ + int idx, res; + + if (passagecnt < 1) + return 0; + if (passagecnt > MAXPASSAGES) + passagecnt = MAXPASSAGES; + + /* if a different book or we've used up all the passages already, + reset in order to have all 'passagecnt' passages available */ + if (oid != context.novel.id || context.novel.count == 0) { + context.novel.id = oid; + context.novel.count = passagecnt; + for (idx = 0; idx < MAXPASSAGES; idx++) + context.novel.pasg[idx] = (xchar) ((idx < passagecnt) ? idx + 1 + : 0); + } + + idx = rn2(context.novel.count); + res = (int) context.novel.pasg[idx]; + /* move the last slot's passage index into the slot just used + and reduce the number of passages available */ + context.novel.pasg[idx] = context.novel.pasg[--context.novel.count]; + return res; +} + +/* Returns True if you were able to read something. */ boolean -read_tribute(tribsection, tribtitle, tribpassage, nowin_buf, bufsz) +read_tribute(tribsection, tribtitle, tribpassage, nowin_buf, bufsz, oid) const char *tribsection, *tribtitle; int tribpassage, bufsz; char *nowin_buf; +unsigned oid; /* book identifier */ { dlb *fp; char *endp; @@ -3510,22 +3545,17 @@ char *nowin_buf; if ((p2 = index(p1, ')')) != 0) { *p2 = '\0'; passagecnt = atoi(p1); - /* sanity check here caps #passages at 50 */ - if ((passagecnt > 0) && (passagecnt < 50)) { - scope = TITLESCOPE; - if (matchedsection && !strcmpi(st, tribtitle)) { - matchedtitle = TRUE; - if (!tribpassage) { - targetpassage = rnd(passagecnt); - } else { - if (tribpassage <= passagecnt) - targetpassage = tribpassage; - else - targetpassage = 0; - } - } else { - matchedtitle = FALSE; - } + if (passagecnt > MAXPASSAGES) + passagecnt = MAXPASSAGES; + scope = TITLESCOPE; + if (matchedsection && !strcmpi(st, tribtitle)) { + matchedtitle = TRUE; + targetpassage = !tribpassage + ? choose_passage(passagecnt, oid) + : (tribpassage <= passagecnt) + ? tribpassage : 0; + } else { + matchedtitle = FALSE; } } } @@ -3610,8 +3640,11 @@ Death_quote(buf, bufsz) char *buf; int bufsz; { - return read_tribute("Death", "Death Quotes", 0, buf, bufsz); + unsigned death_oid = 1; /* chance of oid #1 being a novel is negligible */ + + return read_tribute("Death", "Death Quotes", 0, buf, bufsz, death_oid); } + /* ---------- END TRIBUTE ----------- */ /*files.c*/ diff --git a/src/spell.c b/src/spell.c index 75fe0b50b..71068c7a6 100644 --- a/src/spell.c +++ b/src/spell.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 spell.c $NHDT-Date: 1446854236 2015/11/06 23:57:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.70 $ */ +/* NetHack 3.6 spell.c $NHDT-Date: 1447653429 2015/11/16 05:57:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.72 $ */ /* Copyright (c) M. Stephenson 1988 */ /* NetHack may be freely redistributed. See license for details. */ @@ -469,7 +469,9 @@ register struct obj *spellbook; if (booktype == SPE_NOVEL) { /* Obtain current Terry Pratchett book title */ const char *tribtitle = noveltitle(&spellbook->novelidx); - if (read_tribute("books", tribtitle, 0, (char *)0, 0)) { + + if (read_tribute("books", tribtitle, 0, (char *) 0, 0, + spellbook->o_id)) { u.uconduct.literate++; check_unpaid(spellbook); if (!u.uevent.read_tribute) { From 807f994d9bd8334df5ae0e4d251da5c3582a4ee2 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 16 Nov 2015 10:24:16 +0200 Subject: [PATCH 42/51] Update Guidebook.txt --- doc/Guidebook.txt | 3812 ++++++++++++++++++++++++--------------------- 1 file changed, 2071 insertions(+), 1741 deletions(-) diff --git a/doc/Guidebook.txt b/doc/Guidebook.txt index 84a5395a6..38ad41809 100644 --- a/doc/Guidebook.txt +++ b/doc/Guidebook.txt @@ -12,17 +12,25 @@ (Guidebook for NetHack) - Eric S. Raymond - (Edited and expanded for 3.6) + Original version ‐ Eric S. Raymond + (Edited and expanded for 3.6 by Mike Stephenson and others) + Preface ‐ Version 3.6 + + This version of the game is special in a particular way. + Near the end of the development of 3.6, one of the significant + inspirations for many of the humorous and fun features found in + the game, author Terry Pratchett, passed away. We have dedicated + this version of the game in his memory. + 1. Introduction - Recently, you have begun to find yourself unfulfilled and distant - in your daily occupation. Strange dreams of prospecting, steal‐ - ing, crusading, and combat have haunted you in your sleep for - many months, but you aren’t sure of the reason. You wonder + Recently, you have begun to find yourself unfulfilled and + distant in your daily occupation. Strange dreams of prospecting, + stealing, crusading, and combat have haunted you in your sleep + for many months, but you aren’t sure of the reason. You wonder whether you have in fact been having those dreams all your life, and somehow managed to forget about them until now. Some nights you awaken suddenly and cry out, terrified at the vivid recollec‐ @@ -50,14 +58,6 @@ immediately realize that there is some profound and undiscovered reason that you are to descend into the caverns and seek out that amulet of which they spoke. Even if the rumors of the amulet’s - powers are untrue, you decide that you should at least be able to - sell the tales of your adventures to the local minstrels for a - tidy sum, especially if you encounter any of the terrifying and - magical creatures of your dreams along the way. You spend one - last night fortifying yourself at the local inn, becoming more - and more depressed as you watch the odds of your success being - posted on the inn’s walls getting lower and lower. - NetHack Guidebook 1 @@ -70,6 +70,15 @@ + powers are untrue, you decide that you should at least be able to + sell the tales of your adventures to the local minstrels for a + tidy sum, especially if you encounter any of the terrifying and + magical creatures of your dreams along the way. You spend one + last night fortifying yourself at the local inn, becoming more + and more depressed as you watch the odds of your success being + posted on the inn’s walls getting lower and lower. + + In the morning you awake, collect your belongings, and set off for the dungeon. After several days of uneventful travel, you see the ancient ruins that mark the entrance to the Mazes of @@ -92,41 +101,32 @@ them to move quickly and sneak up on the local nasties. They start equipped with the tools for a proper scientific expedition. - Barbarians are warriors out of the hinterland, hardened to + Barbarians are warriors out of the hinterland, hardened to battle. They begin their quests with naught but uncommon strength, a trusty hauberk, and a great two‐handed sword. - Cavemen and Cavewomen start with exceptional strength but, + Cavemen and Cavewomen start with exceptional strength but, unfortunately, with neolithic weapons. - Healers are wise in medicine and apothecary. They know the - herbs and simples that can restore vitality, ease pain, anes‐ + Healers are wise in medicine and apothecary. They know the + herbs and simples that can restore vitality, ease pain, anes‐ thetize, and neutralize poisons; and with their instruments, they - can divine a being’s state of health or sickness. Their medical + can divine a being’s state of health or sickness. Their medical practice earns them quite reasonable amounts of money, with which they enter the dungeon. - Knights are distinguished from the common skirmisher by - their devotion to the ideals of chivalry and by the surpassing + Knights are distinguished from the common skirmisher by + their devotion to the ideals of chivalry and by the surpassing excellence of their armor. Monks are ascetics, who by rigorous practice of physical and mental disciplines have become capable of fighting as effectively - without weapons as with. They wear no armor but make up for it + without weapons as with. They wear no armor but make up for it with increased mobility. - Priests and Priestesses are clerics militant, crusaders ad‐ - vancing the cause of righteousness with arms, armor, and arts - thaumaturgic. Their ability to commune with deities via prayer - occasionally extricates them from peril, but can also put them in - it. - - Rangers are most at home in the woods, and some say slightly - out of place in a dungeon. They are, however, experts in archery - as well as tracking and stealthy movement. - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -136,63 +136,63 @@ - Rogues are agile and stealthy thieves, with knowledge of - locks, traps, and poisons. Their advantage lies in surprise, + Priests and Priestesses are clerics militant, crusaders ad‐ + vancing the cause of righteousness with arms, armor, and arts + thaumaturgic. Their ability to commune with deities via prayer + occasionally extricates them from peril, but can also put them in + it. + + Rangers are most at home in the woods, and some say slightly + out of place in a dungeon. They are, however, experts in archery + as well as tracking and stealthy movement. + + Rogues are agile and stealthy thieves, with knowledge of + locks, traps, and poisons. Their advantage lies in surprise, which they employ to great advantage. - Samurai are the elite warriors of feudal Nippon. They are - lightly armored and quick, and wear the dai‐sho, two swords of + Samurai are the elite warriors of feudal Nippon. They are + lightly armored and quick, and wear the dai‐sho, two swords of the deadliest keenness. - Tourists start out with lots of gold (suitable for shopping - with), a credit card, lots of food, some maps, and an expensive + Tourists start out with lots of gold (suitable for shopping + with), a credit card, lots of food, some maps, and an expensive camera. Most monsters don’t like being photographed. - Valkyries are hardy warrior women. Their upbringing in the - harsh Northlands makes them strong, inures them to extremes of + Valkyries are hardy warrior women. Their upbringing in the + harsh Northlands makes them strong, inures them to extremes of cold, and instills in them stealth and cunning. - Wizards start out with a knowledge of magic, a selection of - magical items, and a particular affinity for dweomercraft. Al‐ + Wizards start out with a knowledge of magic, a selection of + magical items, and a particular affinity for dweomercraft. Al‐ though seemingly weak and easy to overcome at first sight, an ex‐ perienced Wizard is a deadly foe. You may also choose the race of your character: Dwarves are smaller than humans or elves, but are stocky and - solid individuals. Dwarves’ most notable trait is their great - expertise in mining and metalwork. Dwarvish armor is said to be + solid individuals. Dwarves’ most notable trait is their great + expertise in mining and metalwork. Dwarvish armor is said to be second in quality not even to the mithril armor of the Elves. - Elves are agile, quick, and perceptive; very little of what - goes on will escape an Elf. The quality of Elven craftsmanship + Elves are agile, quick, and perceptive; very little of what + goes on will escape an Elf. The quality of Elven craftsmanship often gives them an advantage in arms and armor. - Gnomes are smaller than but generally similar to dwarves. - Gnomes are known to be expert miners, and it is known that a se‐ - cret underground mine complex built by this race exists within + Gnomes are smaller than but generally similar to dwarves. + Gnomes are known to be expert miners, and it is known that a se‐ + cret underground mine complex built by this race exists within the Mazes of Menace, filled with both riches and danger. Humans are by far the most common race of the surface world, - and are thus the norm to which other races are often compared. - Although they have no special abilities, they can succeed in any + and are thus the norm to which other races are often compared. + Although they have no special abilities, they can succeed in any role. - Orcs are a cruel and barbaric race that hate every living - thing (including other orcs). Above all others, Orcs hate Elves - with a passion unequalled, and will go out of their way to kill - one at any opportunity. The armor and weapons fashioned by the - Orcs are typically of inferior quality. - - 3. What do all those things on the screen mean? - - On the screen is kept a map of where you have been and what - you have seen on the current dungeon level; as you explore more - of the level, it appears on the screen in front of you. + Orcs are a cruel and barbaric race that hate every living + thing (including other orcs). Above all others, Orcs hate Elves - - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -202,49 +202,72 @@ - When NetHack’s ancestor rogue first appeared, its screen - orientation was almost unique among computer fantasy games. - Since then, screen orientation has become the norm rather than - the exception; NetHack continues this fine tradition. Unlike - text adventure games that accept commands in pseudo‐English sen‐ + with a passion unequalled, and will go out of their way to kill + one at any opportunity. The armor and weapons fashioned by the + Orcs are typically of inferior quality. + + 3. What do all those things on the screen mean? + + On the screen is kept a map of where you have been and what + you have seen on the current dungeon level; as you explore more + of the level, it appears on the screen in front of you. + + When NetHack’s ancestor rogue first appeared, its screen + orientation was almost unique among computer fantasy games. + Since then, screen orientation has become the norm rather than + the exception; NetHack continues this fine tradition. Unlike + text adventure games that accept commands in pseudo‐English sen‐ tences and explain the results in words, NetHack commands are all - one or two keystrokes and the results are displayed graphically - on the screen. A minimum screen size of 24 lines by 80 columns - is recommended; if the screen is larger, only a 21x80 section + one or two keystrokes and the results are displayed graphically + on the screen. A minimum screen size of 24 lines by 80 columns + is recommended; if the screen is larger, only a 21x80 section will be used for the map. NetHack can even be played by blind players, with the assis‐ - tance of Braille readers or speech synthesisers. Instructions - for configuring NetHack for the blind are included later in this + tance of Braille readers or speech synthesisers. Instructions + for configuring NetHack for the blind are included later in this document. NetHack generates a new dungeon every time you play it; even - the authors still find it an entertaining and exciting game de‐ + the authors still find it an entertaining and exciting game de‐ spite having won several times. - NetHack offers a variety of display options. The options - available to you will vary from port to port, depending on the - capabilities of your hardware and software, and whether various + NetHack offers a variety of display options. The options + available to you will vary from port to port, depending on the + capabilities of your hardware and software, and whether various compile‐time options were enabled when your executable was creat‐ ed. The three possible display options are: a monochrome charac‐ - ter interface, a color character interface, and a graphical in‐ + ter interface, a color character interface, and a graphical in‐ terface using small pictures called tiles. The two character in‐ terfaces allow fonts with other characters to be substituted, but - the default assignments use standard ASCII characters to repre‐ + the default assignments use standard ASCII characters to repre‐ sent everything. There is no difference between the various dis‐ play options with respect to game play. Because we cannot repro‐ duce the tiles or colors in the Guidebook, and because it is com‐ - mon to all ports, we will use the default ASCII characters from - the monochrome character display when referring to things you + mon to all ports, we will use the default ASCII characters from + the monochrome character display when referring to things you might see on the screen during your game. - In order to understand what is going on in NetHack, first - you must understand what NetHack is doing with the screen. The - NetHack screen replaces the ‘‘You see ...’’ descriptions of text - adventure games. Figure 1 is a sample of what a NetHack screen - might look like. The way the screen looks for you depends on + In order to understand what is going on in NetHack, first + you must understand what NetHack is doing with the screen. The + NetHack screen replaces the ‘‘You see ...’’ descriptions of text + adventure games. Figure 1 is a sample of what a NetHack screen + might look like. The way the screen looks for you depends on your platform. + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 5 + + + ──────────────────────────────────────────────────────────────────── The bat bites! @@ -257,19 +280,6 @@ - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 5 - - - - - Player the Rambler St:12 Dx:7 Co:18 In:11 Wi:9 Ch:15 Neutral Dlvl:1 $:0 HP:9(12) Pw:3(3) AC:10 Exp:1/19 T:257 Weak @@ -279,9 +289,9 @@ 3.1. The status lines (bottom) - The bottom two lines of the screen contain several cryptic - pieces of information describing your current status. If either - status line becomes longer than the width of the screen, you + The bottom two lines of the screen contain several cryptic + pieces of information describing your current status. If either + status line becomes longer than the width of the screen, you might not see all of it. Here are explanations of what the vari‐ ous status items mean (though your configuration may not have all the status items listed below): @@ -291,40 +301,30 @@ experience level, see below). Strength - A measure of your character’s strength; one of your six ba‐ - sic attributes. A human character’s attributes can range - from 3 to 18 inclusive; non‐humans may exceed these limits + A measure of your character’s strength; one of your six ba‐ + sic attributes. A human character’s attributes can range + from 3 to 18 inclusive; non‐humans may exceed these limits (occasionally you may get super‐strengths of the form 18/xx, - and magic can also cause attributes to exceed the normal - limits). The higher your strength, the stronger you are. + and magic can also cause attributes to exceed the normal + limits). The higher your strength, the stronger you are. Strength affects how successfully you perform physical - tasks, how much damage you do in combat, and how much loot + tasks, how much damage you do in combat, and how much loot you can carry. Dexterity - Dexterity affects your chances to hit in combat, to avoid - traps, and do other tasks requiring agility or manipulation + Dexterity affects your chances to hit in combat, to avoid + traps, and do other tasks requiring agility or manipulation of objects. Constitution - Constitution affects your ability to recover from injuries + Constitution affects your ability to recover from injuries and other strains on your stamina. Intelligence - Intelligence affects your ability to cast spells and read - spellbooks. - - Wisdom - Wisdom comes from your practical experience (especially when - dealing with magic). It affects your magical energy. - - Charisma - Charisma affects how certain creatures react toward you. In - particular, it can affect the prices shopkeepers offer you. + Intelligence affects your ability to cast spells and read - - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -334,6 +334,16 @@ + spellbooks. + + Wisdom + Wisdom comes from your practical experience (especially when + dealing with magic). It affects your magical energy. + + Charisma + Charisma affects how certain creatures react toward you. In + particular, it can affect the prices shopkeepers offer you. + Alignment Lawful, Neutral, or Chaotic. Often, Lawful is taken as good and Chaotic as evil, but legal and ethical do not always co‐ @@ -378,6 +388,18 @@ ence point totals, you gain an experience level. The more experienced you are, the better you fight and withstand mag‐ ical attacks. Many dungeons show only your experience level + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 7 + + + here. Time @@ -389,17 +411,6 @@ Fainting. If your hunger status is normal, it is not dis‐ played. - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 7 - - - Additional status flags may appear after the hunger status: Conf when you’re confused, FoodPois or Ill when sick, Blind when you can’t see, Stun when stunned, and Hallu when hallucinating. @@ -413,12 +424,15 @@ certain that you’ve read the one that is there first. To read the next message, just press the space bar. + To change how and what messages are shown on the message + line, see ‘‘Configuring Message Types‘‘ and the verbose option. + 3.3. The map (rest of the screen) - The rest of the screen is the map of the level as you have - explored it so far. Each symbol on the screen represents some‐ - thing. You can set various graphics options to change some of - the symbols the game uses; otherwise, the game will use default + The rest of the screen is the map of the level as you have + explored it so far. Each symbol on the screen represents some‐ + thing. You can set various graphics options to change some of + the symbols the game uses; otherwise, the game will use default symbols. Here is a list of what the default symbols mean: ‐ and | @@ -426,20 +440,32 @@ . The floor of a room, ice, or a doorless doorway. - # A corridor, or iron bars, or a tree, or possibly a kitchen + # A corridor, or iron bars, or a tree, or possibly a kitchen sink (if your dungeon has sinks), or a drawbridge. > Stairs down: a way to the next level. < Stairs up: a way to the previous level. - + A closed door, or a spellbook containing a spell you may be + + A closed door, or a spellbook containing a spell you may be able to learn. @ Your character or a human. $ A pile of gold. + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 8 + + + ^ A trap (once you have detected it). ) A weapon. @@ -454,18 +480,6 @@ = A ring. - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 8 - - - ! A potion. ( A useful item (pick‐axe, key, lamp...). @@ -487,8 +501,8 @@ \ An opulent throne. a‐zA‐Z and other symbols - Letters and certain other symbols represent the various in‐ - habitants of the Mazes of Menace. Watch out, they can be + Letters and certain other symbols represent the various in‐ + habitants of the Mazes of Menace. Watch out, they can be nasty and vicious. Sometimes, however, they can be helpful. I This marks the last known location of an invisible or other‐ @@ -506,6 +520,18 @@ Some commands, like ‘‘search’’, do not require that any more in‐ formation be collected by NetHack. Other commands might require additional information, for example a direction, or an object to + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 9 + + + be used. For those commands that require additional information, NetHack will present you with either a menu of choices or with a command line prompt requesting information. Which you are pre‐ @@ -520,18 +546,6 @@ example, there is also a ‘*’ indicating that you may choose an object not on the list, if you wanted to use something unexpect‐ ed. Typing a ‘*’ lists your entire inventory, so you can see the - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 9 - - - inventory letters of every object you’re carrying. Finally, if you change your mind and decide you don’t want to do this command after all, you can press the ESC key to abort the command. @@ -571,6 +585,19 @@ & Tell what a command does. + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 10 + + + < Go up to the previous level (if you are on a staircase or ladder). @@ -584,20 +611,6 @@ cause you to fight monsters; the others (below) are ‘‘safe.’’ - - - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 10 - - - y k u 7 8 9 \ | / \ | / h‐ . ‐l 4‐ . ‐6 @@ -638,8 +651,20 @@ the same conditions as the ‘G’ command, but without picking up objects, similar to the ‘M’ command. For ports with mouse support, the command is also invoked when a mouse‐ - click takes place on a location other than the current posi‐ - tion. + click takes place on a location other than the current + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 11 + + + + position. . Rest, do nothing for one turn. @@ -652,18 +677,6 @@ ^A Redo the previous command. - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 11 - - - c Close a door. C Call (name) a monster, an individual object, or a type of @@ -683,9 +696,9 @@ ‘‘What kinds of things do you want to drop? [!%= BUCXaium]’’ - you should type zero or more object symbols possibly fol‐ + you should type zero or more object symbols possibly fol‐ lowed by ‘a’ and/or ‘i’ and/or ‘u’ and/or ‘m’. In addition, - one or more of the blessed/uncursed/cursed groups may be + one or more of the blessed/uncursed/cursed groups may be typed. DB ‐ drop all objects known to be blessed. @@ -706,21 +719,8 @@ E‐ ‐ write in the dust with your fingers. - Engraving the word ‘‘Elbereth’’ will cause most monsters to - not attack you hand‐to‐hand (but if you attack, you will rub - it out); this is often useful to give yourself a breather. - (This feature may be compiled out of the game, so your ver‐ - sion might not have it.) - f Fire one of the objects placed in your quiver (or quiver - sack, or that you have at the ready). You may select ammu‐ - nition with a previous ‘Q’ command, or let the computer pick - something appropriate if autoquiver is true. - - - - - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -730,37 +730,72 @@ + Engraving the word ‘‘Elbereth’’ will cause most monsters to + not attack you hand‐to‐hand (but if you attack, you will rub + it out); this is often useful to give yourself a breather. + (This feature may be compiled out of the game, so your ver‐ + sion might not have it.) + + f Fire one of the objects placed in your quiver (or quiver + sack, or that you have at the ready). You may select ammu‐ + nition with a previous ‘Q’ command, or let the computer pick + something appropriate if autoquiver is true. + i List your inventory (everything you’re carrying). - I List selected parts of your inventory. + I List selected parts of your inventory, usually be specifying + the character for a particular set of objects, like ‘[’ for + armor or ‘!’ for potions. I* ‐ list all gems in inventory; Iu ‐ list all unpaid items; Ix ‐ list all used up items that are on your shopping bill; + IB ‐ list all items known to be blessed; + IU ‐ list all items known to be uncursed; + IC ‐ list all items known to be cursed; + IX ‐ list all items whose bless/curse status is known; I$ ‐ count your money. o Open a door. O Set options. - A menu showing the current option values will be displayed. - You can change most values simply by selecting the menu en‐ + A menu showing the current option values will be displayed. + You can change most values simply by selecting the menu en‐ try for the given option (ie, by typing its letter or click‐ - ing upon it, depending on your user interface). For the - non‐boolean choices, a further menu or prompt will appear - once you’ve closed this menu. The available options are + ing upon it, depending on your user interface). For the + non‐boolean choices, a further menu or prompt will appear + once you’ve closed this menu. The available options are listed later in this Guidebook. Options are usually set be‐ fore the game rather than with the ‘O’ command; see the sec‐ tion on options below. p Pay your shopping bill. - P Put on a ring or other accessory (amulet, blindfold). + P Put on an accessory (ring, amulet, or blindfold). - Use the ’W’ command to wear armor. + This command may also be used to wear armor. The prompt for + which inventory item to use will only list accessories, but + choosing an unlisted item of armor will attempt to wear it. + (See the ‘W’ command below. It lists armor as the inventory + choices but will accept an accessory and attempt to put that + on.) ^P Repeat previous message. + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 13 + + + Subsequent ^P’s repeat earlier messages. The behavior can be varied via the msg_window option. @@ -769,32 +804,25 @@ Q Select an object for your quiver, quiver sack, or just gen‐ erally at the ready (only one of these is available at a time). You can then throw this (or one of these) using the - ‘f’ command. (In versions prior to 3.3 this was the command - to quit the game, which has now been moved to ‘#quit’.) + ‘f’ command. + + (In versions prior to 3.3 this was the command to quit the + game, which has been moved to ‘‘#quit’’.) r Read a scroll or spellbook. - R Remove an accessory (ring, amulet, etc). + R Remove a worn accessory (ring, amulet, or blindfold). If you’re wearing more than one, you’ll be prompted for - which one to remove. If you’re only wearing one, then by + which one to remove. When you’re only wearing one, then by default it will be removed without asking, but you can set the paranoid_confirmation option to require a prompt. - Use the ’T’ command to take off armor. - - - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 13 - - + This command may also be used to take off armor. The prompt + for which inventory item to remove only lists worn acces‐ + sories, but an item of worn armor can be chosen. (See the + ‘T’ command below. It lists armor as the inventory choices + but will accept an accessory and attempt to remove it.) ^R Redraw the screen. @@ -809,11 +837,30 @@ T Take off armor. If you’re wearing more than one piece, you’ll be prompted - for which one to take off. If you’re only wearing one, then - by default it will be taken off without asking, but you can - set the paranoid_confirmation option to require a prompt. + for which one to take off. (Note that this treats a cloak + covering a suit and/or a shirt, or a suit covering a shirt, + as if the underlying items weren’t there.) When you’re only + wearing one, then by default it will be taken off without + asking, but you can set the paranoid_confirmation option to + require a prompt. + + This command may also be used to remove accessories. The + prompt for which inventory item to take off only lists worn + armor, but a worn accessory can be chosen. (See the ‘R’ + command above. It lists accessories as the inventory choic‐ + es but will accept an item of armor and attempt to take it + off.) + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 14 + - Use the ’R’ command to remove accessories. ^T Teleport, if you have the ability. @@ -825,43 +872,40 @@ w‐ ‐ wield nothing, use your bare hands. - Some characters can wield two weapons and once; use the - ‘‘#twoweapon’’ extended command to do so. + Some characters can wield two weapons at once; use the ‘X’ + command (or the ‘‘#twoweapon’’ extended command) to do so. W Wear armor. - Use the ’P’ command to put on accessories. + This command may also be used to put on an accessory (ring, + amulet, or blindfold). The prompt for which inventory item + to use will only list armor, but choosing an unlisted acces‐ + sory will attempt to put it on. (See the ‘P’ command above. + It lists accessories as the inventory choices but will ac‐ + cept an item of armor and attempt to wear it.) x Exchange your wielded weapon with the item in your alternate weapon slot. The latter is used as your secondary weapon when engaging in - two‐weapon combat. Note that if one of these slots is emp‐ + two‐weapon combat. Note that if one of these slots is emp‐ ty, the exchange still takes place. X Toggle two‐weapon combat, if your character can do it. Also - available via the ‘‘#twoweapon’’ extended command + available via the ‘‘#twoweapon’’ extended command. + + (In versions prior to 3.6 this was the command to switch + from normal play to "explore mode", also known as "discovery + mode", which has now been moved to ‘‘#explore’’.) ^X Display basic information about your character. - Displays name, role, race, gender (unless role name makes - that redundant, such as Caveman or Priestess), and align‐ - ment, along with your patron deity and his or her opposi‐ - tion. It also shows most of the various items of informa‐ + Displays name, role, race, gender (unless role name makes + that redundant, such as Caveman or Priestess), and align‐ + ment, along with your patron deity and his or her opposi‐ + tion. It also shows most of the various items of informa‐ tion from the status line(s) in a less terse form, including - several additional things which don’t appear in the normal - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 14 - - - + several additional things which don’t appear in the normal status display due to space considerations. z Zap a wand. @@ -872,6 +916,18 @@ Z. ‐ to cast at yourself, use ‘.’ for the direction. + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 15 + + + ^Z Suspend the game (UNIX(R) versions with job control only). : Look at what is here. @@ -913,21 +969,6 @@ temporary. To make the most recent sort order persist be‐ yond the current ‘+’ command, choose the sort option again and then pick "reassign casting letters". (Any spells - - __________ - (R)UNIX is a registered trademark of AT&T. - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 15 - - - learned after that will be added to the end of the list rather than be inserted into the sorted ordering.) @@ -937,6 +978,22 @@ ! Escape to a shell. + + + __________ + (R)UNIX is a registered trademark of AT&T. + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 16 + + + # Perform an extended command. As you can see, the authors of NetHack used up all the let‐ @@ -983,17 +1040,6 @@ Loot a box or bag on the floor beneath you, or the saddle from a steed standing next to you. - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 16 - - - #monster Use a monster’s special ability (when polymorphed into mon‐ ster form). @@ -1002,6 +1048,18 @@ Name a monster, an individual object, or a type of object. Same as ‘C’. + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 17 + + + #offer Offer a sacrifice to the gods. @@ -1044,32 +1102,34 @@ traps. #tip - Tip over a container (bag or box) to pour out its contents. + Tip over a container (bag or box) to pour out its contents. #turn Turn undead. - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 17 - - - #twoweapon Toggle two‐weapon combat on or off. - Note that you must use suitable weapons for this type of + Note that you must use suitable weapons for this type of combat, or it will be automatically turned off. + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 18 + + + #untrap Untrap something (trap, door, or chest). - In some circumstances it can also be used to rescue trapped + In some circumstances it can also be used to rescue trapped monsters. #version @@ -1082,12 +1142,12 @@ Help menu: get the list of available extended commands. If your keyboard has a meta key (which, when pressed in com‐ - bination with another key, modifies it by setting the ‘meta’ - [8th, or ‘high’] bit), you can invoke many extended commands by + bination with another key, modifies it by setting the ‘meta’ + [8th, or ‘high’] bit), you can invoke many extended commands by meta‐ing the first letter of the command. In NT, OS/2, PC and ST NetHack, the ‘Alt’ key can be used in this fashion; on the Amiga, - set the altmeta option to get this behavior. On other systems, - if typing ‘Alt’ plus another key transmits a two character se‐ + set the altmeta option to get this behavior. On other systems, + if typing ‘Alt’ plus another key transmits a two character se‐ quence consisting of an Escape followed by the other key, you may set the altmeta option to have nethack combine them into meta+key. @@ -1114,24 +1174,24 @@ M‐j #jump - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 18 - - - M‐l #loot M‐m #monster M‐n #name + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 19 + + + M‐o #offer M‐O #overview (if supported) @@ -1156,99 +1216,39 @@ M‐w #wipe - If the number_pad option is on, some additional letter com‐ + If the number_pad option is on, some additional letter com‐ mands are available: - h Help menu: display one of several help texts available, + h Help menu: display one of several help texts available, like ‘‘?’’. j Jump to another location. Same as ‘‘#jump’’ or ‘‘M‐j’’. k Kick something (usually a door). Same as ‘^D’. - l Loot a box or bag on the floor beneath you, or the saddle - from a steed standing next to you. Same as ‘‘#loot’’ or + l Loot a box or bag on the floor beneath you, or the saddle + from a steed standing next to you. Same as ‘‘#loot’’ or ‘‘M‐l’’. - N Name a monster, an individual object, or a type of object. - Same as ‘‘#name’’ (or ‘‘M‐n’’) which is the same as the ‘C’ + N Name a monster, an individual object, or a type of object. + Same as ‘‘#name’’ (or ‘‘M‐n’’) which is the same as the ‘C’ command. - u Untrap a trap, door, or chest. Same as ‘‘#untrap’’ or ‘‘M‐ + u Untrap a trap, door, or chest. Same as ‘‘#untrap’’ or ‘‘M‐ u’’. - - - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 19 - - - 5. Rooms and corridors - Rooms and corridors in the dungeon are either lit or dark. - Any lit areas within your line of sight will be displayed; dark - areas are only displayed if they are within one space of you. + Rooms and corridors in the dungeon are either lit or dark. + Any lit areas within your line of sight will be displayed; dark + areas are only displayed if they are within one space of you. Walls and corridors remain on the map as you explore them. - Secret corridors are hidden. You can find them with the ‘s’ - (search) command. - - 5.1. Doorways - - Doorways connect rooms and corridors. Some doorways have no - doors; you can walk right through. Others have doors in them, - which may be open, closed, or locked. To open a closed door, use - the ‘o’ (open) command; to close it again, use the ‘c’ (close) - command. - - You can get through a locked door by using a tool to pick - the lock with the ‘a’ (apply) command, or by kicking it open with - the ‘^D’ (kick) command. - - Open doors cannot be entered diagonally; you must approach - them straight on, horizontally or vertically. Doorways without - doors are not restricted in this fashion. - - Doors can be useful for shutting out monsters. Most mon‐ - sters cannot open doors, although a few don’t need to (ex. ghosts - can walk through doors). - - Secret doors are hidden. You can find them with the ‘s’ - (search) command. Once found they are in all ways equivalent to - normal doors. - - 5.2. Traps (‘^’) - - There are traps throughout the dungeon to snare the unwary - delver. For example, you may suddenly fall into a pit and be - stuck for a few turns trying to climb out. Traps don’t appear on - your map until you see one triggered by moving onto it, see some‐ - thing fall into it, or you discover it with the ‘s’ (search) com‐ - mand. Monsters can fall prey to traps, too, which can be a very - useful defensive strategy. - - There is a special pre‐mapped branch of the dungeon based on - the classic computer game ‘‘Sokoban.’’ The goal is to push the - boulders into the pits or holes. With careful foresight, it is - possible to complete all of the levels according to the tradi‐ - tional rules of Sokoban. Some allowances are permitted in case - the player gets stuck; however, they will lower your luck. - - - - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -1258,63 +1258,63 @@ + Secret corridors are hidden. You can find them with the ‘s’ + (search) command. + + 5.1. Doorways + + Doorways connect rooms and corridors. Some doorways have no + doors; you can walk right through. Others have doors in them, + which may be open, closed, or locked. To open a closed door, use + the ‘o’ (open) command; to close it again, use the ‘c’ (close) + command. + + You can get through a locked door by using a tool to pick + the lock with the ‘a’ (apply) command, or by kicking it open with + the ‘^D’ (kick) command. + + Open doors cannot be entered diagonally; you must approach + them straight on, horizontally or vertically. Doorways without + doors are not restricted in this fashion. + + Doors can be useful for shutting out monsters. Most mon‐ + sters cannot open doors, although a few don’t need to (ex. ghosts + can walk through doors). + + Secret doors are hidden. You can find them with the ‘s’ + (search) command. Once found they are in all ways equivalent to + normal doors. + + 5.2. Traps (‘^’) + + There are traps throughout the dungeon to snare the unwary + delver. For example, you may suddenly fall into a pit and be + stuck for a few turns trying to climb out. Traps don’t appear on + your map until you see one triggered by moving onto it, see some‐ + thing fall into it, or you discover it with the ‘s’ (search) com‐ + mand. Monsters can fall prey to traps, too, which can be a very + useful defensive strategy. + + There is a special pre‐mapped branch of the dungeon based on + the classic computer game ‘‘Sokoban.’’ The goal is to push the + boulders into the pits or holes. With careful foresight, it is + possible to complete all of the levels according to the tradi‐ + tional rules of Sokoban. Some allowances are permitted in case + the player gets stuck; however, they will lower your luck. + 5.3. Stairs (‘<’, ‘>’) - In general, each level in the dungeon will have a staircase + In general, each level in the dungeon will have a staircase going up (‘<’) to the previous level and another going down (‘>’) - to the next level. There are some exceptions though. For in‐ - stance, fairly early in the dungeon you will find a level with + to the next level. There are some exceptions though. For in‐ + stance, fairly early in the dungeon you will find a level with two down staircases, one continuing into the dungeon and the oth‐ - er branching into an area known as the Gnomish Mines. Those - mines eventually hit a dead end, so after exploring them (if you - choose to do so), you’ll need to climb back up to the main dun‐ - geon. - - When you traverse a set of stairs, or trigger a trap which - sends you to another level, the level you’re leaving will be de‐ - activated and stored in a file on disk. If you’re moving to a - previously visited level, it will be loaded from its file on disk - and reactivated. If you’re moving to a level which has not yet - been visited, it will be created (from scratch for most random - levels, from a template for some ‘‘special’’ levels, or loaded - from the remains of an earlier game for a ‘‘bones’’ level as - briefly described below). Monsters are only active on the cur‐ - rent level; those on other levels are essentially placed into - stasis. - - Ordinarily when you climb a set of stairs, you will arrive - on the corresponding staircase at your destination. However, - pets (see below) and some other monsters will follow along if - they’re close enough when you travel up or down stairs, and occa‐ - sionally one of these creatures will displace you during the - climb. When that occurs, the pet or other monster will arrive on - the staircase and you will end up nearby. - - 5.4. Ladders (‘<’, ‘>’) - - Ladders serve the same purpose as staircases, and the two - types of inter‐level connections are nearly indistinguishable - during game play. - - 5.5. Shops and shopping - - Occasionally you will run across a room with a shopkeeper - near the door and many items lying on the floor. You can buy - items by picking them up and then using the ‘p’ command. You can - inquire about the price of an item prior to picking it up by us‐ - ing the ‘‘#chat’’ command while standing on it. Using an item - prior to paying for it will incur a charge, and the shopkeeper - won’t allow you to leave the shop until you have paid any debt - you owe. - - You can sell items to a shopkeeper by dropping them to the - floor while inside a shop. You will either be offered an amount - of gold and asked whether you’re willing to sell, or you’ll be - told that the shopkeeper isn’t interested (generally, your item - needs to be compatible with the type of merchandise carried by + er branching into an area known as the Gnomish Mines. Those + mines eventually hit a dead end, so after exploring them (if you + choose to do so), you’ll need to climb back up to the main - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -1324,26 +1324,82 @@ + dungeon. + + When you traverse a set of stairs, or trigger a trap which + sends you to another level, the level you’re leaving will be de‐ + activated and stored in a file on disk. If you’re moving to a + previously visited level, it will be loaded from its file on disk + and reactivated. If you’re moving to a level which has not yet + been visited, it will be created (from scratch for most random + levels, from a template for some ‘‘special’’ levels, or loaded + from the remains of an earlier game for a ‘‘bones’’ level as + briefly described below). Monsters are only active on the cur‐ + rent level; those on other levels are essentially placed into + stasis. + + Ordinarily when you climb a set of stairs, you will arrive + on the corresponding staircase at your destination. However, + pets (see below) and some other monsters will follow along if + they’re close enough when you travel up or down stairs, and occa‐ + sionally one of these creatures will displace you during the + climb. When that occurs, the pet or other monster will arrive on + the staircase and you will end up nearby. + + 5.4. Ladders (‘<’, ‘>’) + + Ladders serve the same purpose as staircases, and the two + types of inter‐level connections are nearly indistinguishable + during game play. + + 5.5. Shops and shopping + + Occasionally you will run across a room with a shopkeeper + near the door and many items lying on the floor. You can buy + items by picking them up and then using the ‘p’ command. You can + inquire about the price of an item prior to picking it up by us‐ + ing the ‘‘#chat’’ command while standing on it. Using an item + prior to paying for it will incur a charge, and the shopkeeper + won’t allow you to leave the shop until you have paid any debt + you owe. + + You can sell items to a shopkeeper by dropping them to the + floor while inside a shop. You will either be offered an amount + of gold and asked whether you’re willing to sell, or you’ll be + told that the shopkeeper isn’t interested (generally, your item + needs to be compatible with the type of merchandise carried by the shop). - If you drop something in a shop by accident, the shopkeeper - will usually claim ownership without offering any compensation. + If you drop something in a shop by accident, the shopkeeper + will usually claim ownership without offering any compensation. You’ll have to buy it back if you want to reclaim it. - Shopkeepers sometimes run out of money. When that happens, - you’ll be offered credit instead of gold when you try to sell - something. Credit can be used to pay for purchases, but it is - only good in the shop where it was obtained; other shopkeepers - won’t honor it. (If you happen to find a "credit card" in the + Shopkeepers sometimes run out of money. When that happens, + you’ll be offered credit instead of gold when you try to sell + something. Credit can be used to pay for purchases, but it is + only good in the shop where it was obtained; other shopkeepers + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 22 + + + + won’t honor it. (If you happen to find a "credit card" in the dungeon, don’t bother trying to use it in shops; shopkeepers will not accept it.) - The ‘$’ command, which reports the amount of gold you are + The ‘$’ command, which reports the amount of gold you are carrying (in inventory, not inside bags or boxes), will also show - current shop debt or credit, if any. The ‘Iu’ command lists un‐ + current shop debt or credit, if any. The ‘Iu’ command lists un‐ paid items (those which still belong to the shop) if you are car‐ - rying any. The ‘Ix’ command shows an inventory‐like display of - any unpaid items which have been used up, along with other shop + rying any. The ‘Ix’ command shows an inventory‐like display of + any unpaid items which have been used up, along with other shop fees, if any. 5.5.1. Shop idiosyncracies @@ -1379,74 +1435,18 @@ another when multiple monsters are present. Assigning a name which is just a space will remove any prior name. - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 22 - - - The extended command ‘‘#chat’’ can be used to interact with an adjacent monster. There is no actual dialog (in other words, you don’t get to choose what you’ll say), but chatting with some monsters such as a shopkeeper or the Oracle of Delphi can produce useful results. - 6.1. Fighting - - If you see a monster and you wish to fight it, just attempt - to walk into it. Many monsters you find will mind their own - business unless you attack them. Some of them are very dangerous - when angered. Remember: discretion is the better part of valor. - - In most circumstances, if you attempt to attack a peaceful - monster by moving into its location, you’ll be asked to confirm - your intent. By default an answer of ’y’ acknowledges that in‐ - tent, which can be error prone if you’re using ’y’ to move. You - can set the paranoid_confirmation option to require a response of - "yes" instead. - - If you can’t see a monster (if it is invisible, or if you - are blinded), the symbol ‘I’ will be shown when you learn of its - presence. If you attempt to walk into it, you will try to fight - it just like a monster that you can see; of course, if the mon‐ - ster has moved, you will attack empty air. If you guess that the - monster has moved and you don’t wish to fight, you can use the - ‘m’ command to move without fighting; likewise, if you don’t re‐ - member a monster but want to try fighting anyway, you can use the - ‘F’ command. - - 6.2. Your pet - - You start the game with a little dog (‘d’), cat (‘f’), or - pony (‘u’), which follows you about the dungeon and fights mon‐ - sters with you. Like you, your pet needs food to survive. It - usually feeds itself on fresh carrion and other meats. If you’re - worried about it or want to train it, you can feed it, too, by - throwing it food. A properly trained pet can be very useful un‐ - der certain circumstances. - - Your pet also gains experience from killing monsters, and - can grow over time, gaining hit points and doing more damage. - Initially, your pet may even be better at killing things than - you, which makes pets useful for low‐level characters. - - Your pet will follow you up and down staircases if it is - next to you when you move. Otherwise your pet will be stranded - and may become wild. Similarly, when you trigger certain types - of traps which alter your location (for instance, a trap door - which drops you to a lower dungeon level), any adjacent pet will - accompany you and any non‐adjacent pet will be left behind. Your - pet may trigger such traps itself; you will not be carried along - with it even if adjacent at the time. - NetHack 3.6 March 27, 2015 + + + NetHack 3.6 June 22, 2015 @@ -1456,63 +1456,63 @@ + 6.1. Fighting + + If you see a monster and you wish to fight it, just attempt + to walk into it. Many monsters you find will mind their own + business unless you attack them. Some of them are very dangerous + when angered. Remember: discretion is the better part of valor. + + In most circumstances, if you attempt to attack a peaceful + monster by moving into its location, you’ll be asked to confirm + your intent. By default an answer of ’y’ acknowledges that in‐ + tent, which can be error prone if you’re using ’y’ to move. You + can set the paranoid_confirmation option to require a response of + "yes" instead. + + If you can’t see a monster (if it is invisible, or if you + are blinded), the symbol ‘I’ will be shown when you learn of its + presence. If you attempt to walk into it, you will try to fight + it just like a monster that you can see; of course, if the mon‐ + ster has moved, you will attack empty air. If you guess that the + monster has moved and you don’t wish to fight, you can use the + ‘m’ command to move without fighting; likewise, if you don’t re‐ + member a monster but want to try fighting anyway, you can use the + ‘F’ command. + + 6.2. Your pet + + You start the game with a little dog (‘d’), cat (‘f’), or + pony (‘u’), which follows you about the dungeon and fights mon‐ + sters with you. Like you, your pet needs food to survive. It + usually feeds itself on fresh carrion and other meats. If you’re + worried about it or want to train it, you can feed it, too, by + throwing it food. A properly trained pet can be very useful un‐ + der certain circumstances. + + Your pet also gains experience from killing monsters, and + can grow over time, gaining hit points and doing more damage. + Initially, your pet may even be better at killing things than + you, which makes pets useful for low‐level characters. + + Your pet will follow you up and down staircases if it is + next to you when you move. Otherwise your pet will be stranded + and may become wild. Similarly, when you trigger certain types + of traps which alter your location (for instance, a trap door + which drops you to a lower dungeon level), any adjacent pet will + accompany you and any non‐adjacent pet will be left behind. Your + pet may trigger such traps itself; you will not be carried along + with it even if adjacent at the time. + 6.3. Steeds - Some types of creatures in the dungeon can actually be rid‐ + Some types of creatures in the dungeon can actually be rid‐ den if you have the right equipment and skill. Convincing a wild - beast to let you saddle it up is difficult to say the least. - Many a dungeoneer has had to resort to magic and wizardry in or‐ - der to forge the alliance. Once you do have the beast under your - control however, you can easily climb in and out of the saddle - with the ‘#ride’ command. Lead the beast around the dungeon when - riding, in the same manner as you would move yourself. It is the - beast that you will see displayed on the map. - - Riding skill is managed by the ‘#enhance’ command. See the - section on Weapon proficiency for more information about that. - - 6.4. Bones levels - - You may encounter the shades and corpses of other adventur‐ - ers (or even former incarnations of yourself!) and their personal - effects. Ghosts are hard to kill, but easy to avoid, since - they’re slow and do little damage. You can plunder the deceased - adventurer’s possessions; however, they are likely to be cursed. - Beware of whatever killed the former player; it is probably still - lurking around, gloating over its last victory. + beast to let you saddle it up is difficult to say the least. + Many a dungeoneer has had to resort to magic and wizardry in - 7. Objects - - When you find something in the dungeon, it is common to want - to pick it up. In NetHack, this is accomplished automatically by - walking over the object (unless you turn off the autopickup op‐ - tion (see below), or move with the ‘m’ prefix (see above)), or - manually by using the ‘,’ command. - - If you’re carrying too many items, NetHack will tell you so - and you won’t be able to pick up anything more. Otherwise, it - will add the object(s) to your pack and tell you what you just - picked up. - - As you add items to your inventory, you also add the weight - of that object to your load. The amount that you can carry de‐ - pends on your strength and your constitution. The stronger you - are, the less the additional load will affect you. There comes a - point, though, when the weight of all of that stuff you are car‐ - rying around with you through the dungeon will encumber you. - Your reactions will get slower and you’ll burn calories faster, - requiring food more frequently to cope with it. Eventually, - you’ll be so overloaded that you’ll either have to discard some - of what you’re carrying or collapse under its weight. - - NetHack will tell you how badly you have loaded yourself. - The symbols ‘Burdened’, ‘Stressed’, ‘Strained’, ‘Overtaxed’ and - ‘Overloaded’ are displayed on the bottom line display to indicate - your condition. - - - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -1522,63 +1522,63 @@ + order to forge the alliance. Once you do have the beast under + your control however, you can easily climb in and out of the sad‐ + dle with the ‘#ride’ command. Lead the beast around the dungeon + when riding, in the same manner as you would move yourself. It + is the beast that you will see displayed on the map. + + Riding skill is managed by the ‘#enhance’ command. See the + section on Weapon proficiency for more information about that. + + 6.4. Bones levels + + You may encounter the shades and corpses of other adventur‐ + ers (or even former incarnations of yourself!) and their personal + effects. Ghosts are hard to kill, but easy to avoid, since + they’re slow and do little damage. You can plunder the deceased + adventurer’s possessions; however, they are likely to be cursed. + Beware of whatever killed the former player; it is probably still + lurking around, gloating over its last victory. + + + 7. Objects + + When you find something in the dungeon, it is common to want + to pick it up. In NetHack, this is accomplished automatically by + walking over the object (unless you turn off the autopickup op‐ + tion (see below), or move with the ‘m’ prefix (see above)), or + manually by using the ‘,’ command. + + If you’re carrying too many items, NetHack will tell you so + and you won’t be able to pick up anything more. Otherwise, it + will add the object(s) to your pack and tell you what you just + picked up. + + As you add items to your inventory, you also add the weight + of that object to your load. The amount that you can carry de‐ + pends on your strength and your constitution. The stronger you + are, the less the additional load will affect you. There comes a + point, though, when the weight of all of that stuff you are car‐ + rying around with you through the dungeon will encumber you. + Your reactions will get slower and you’ll burn calories faster, + requiring food more frequently to cope with it. Eventually, + you’ll be so overloaded that you’ll either have to discard some + of what you’re carrying or collapse under its weight. + + NetHack will tell you how badly you have loaded yourself. + The symbols ‘Burdened’, ‘Stressed’, ‘Strained’, ‘Overtaxed’ and + ‘Overloaded’ are displayed on the bottom line display to indicate + your condition. + When you pick up an object, it is assigned an inventory let‐ - ter. Many commands that operate on objects must ask you to find - out which object you want to use. When NetHack asks you to + ter. Many commands that operate on objects must ask you to find + out which object you want to use. When NetHack asks you to choose a particular object you are carrying, you are usually pre‐ - sented with a list of inventory letters to choose from (see Com‐ - mands, above). - - Some objects, such as weapons, are easily differentiated. - Others, like scrolls and potions, are given descriptions which - vary according to type. During a game, any two objects with the - same description are the same type. However, the descriptions - will vary from game to game. - - When you use one of these objects, if its effect is obvious, - NetHack will remember what it is for you. If its effect isn’t - extremely obvious, you will be asked what you want to call this - type of object so you will recognize it later. You can also use - the ‘‘#name’’ command, or its synonym ‘C’, for the same purpose - at any time, to name all objects of a particular type or just an - individual object. When you use ‘‘#name’’ on an object which has - already been named, specifying a space as the value will remove - the prior name instead of assigning a new one. - - 7.1. Curses and Blessings - - Any object that you find may be cursed, even if the object - is otherwise helpful. The most common effect of a curse is being - stuck with (and to) the item. Cursed weapons weld themselves to - your hand when wielded, so you cannot unwield them. Any cursed - item you wear is not removable by ordinary means. In addition, - cursed arms and armor usually, but not always, bear negative en‐ - chantments that make them less effective in combat. Other cursed - objects may act poorly or detrimentally in other ways. - - Objects can also be blessed. Blessed items usually work - better or more beneficially than normal uncursed items. For ex‐ - ample, a blessed weapon will do more damage against demons. - - There are magical means of bestowing or removing curses upon - objects, so even if you are stuck with one, you can still have - the curse lifted and the item removed. Priests and Priestesses - have an innate sensitivity to this property in any object, so - they can more easily avoid cursed objects than other character - roles. - - An item with unknown status will be reported in your inven‐ - tory with no prefix. An item which you know the state of will be - distinguished in your inventory by the presence of the word - ‘‘cursed’’, ‘‘uncursed’’ or ‘‘blessed’’ in the description of the - item. + sented with a list of inventory letters to choose from (see - - - - - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -1588,6 +1588,72 @@ + Commands, above). + + Some objects, such as weapons, are easily differentiated. + Others, like scrolls and potions, are given descriptions which + vary according to type. During a game, any two objects with the + same description are the same type. However, the descriptions + will vary from game to game. + + When you use one of these objects, if its effect is obvious, + NetHack will remember what it is for you. If its effect isn’t + extremely obvious, you will be asked what you want to call this + type of object so you will recognize it later. You can also use + the ‘‘#name’’ command, or its synonym ‘C’, for the same purpose + at any time, to name all objects of a particular type or just an + individual object. When you use ‘‘#name’’ on an object which has + already been named, specifying a space as the value will remove + the prior name instead of assigning a new one. + + 7.1. Curses and Blessings + + Any object that you find may be cursed, even if the object + is otherwise helpful. The most common effect of a curse is being + stuck with (and to) the item. Cursed weapons weld themselves to + your hand when wielded, so you cannot unwield them. Any cursed + item you wear is not removable by ordinary means. In addition, + cursed arms and armor usually, but not always, bear negative en‐ + chantments that make them less effective in combat. Other cursed + objects may act poorly or detrimentally in other ways. + + Objects can also be blessed. Blessed items usually work + better or more beneficially than normal uncursed items. For ex‐ + ample, a blessed weapon will do more damage against demons. + + Objects which are neither cursed nor blessed are referred to + as uncursed. They could just as easily have been described as + unblessed, but the uncursed designation is what you will see + within the game. A ‘‘glass half full versus glass half empty’’ + situation; make of that what you will. + + There are magical means of bestowing or removing curses upon + objects, so even if you are stuck with one, you can still have + the curse lifted and the item removed. Priests and Priestesses + have an innate sensitivity to this property in any object, so + they can more easily avoid cursed objects than other character + roles. + + An item with unknown status will be reported in your inven‐ + tory with no prefix. An item which you know the state of will be + distinguished in your inventory by the presence of the word + ‘‘cursed’’, ‘‘uncursed’’ or ‘‘blessed’’ in the description of the + item. In some cases ‘‘uncursed’’ will be omitted as being redun‐ + dant when enough other information is displayed. + + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 26 + + + 7.2. Weapons (‘)’) Given a chance, most monsters in the Mazes of Menace will @@ -1644,13 +1710,13 @@ age to monsters in NetHack. Some of the more obscure weapons - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 - NetHack Guidebook 26 + NetHack Guidebook 27 @@ -1710,13 +1776,13 @@ prove your skills as you progress through a game, depending on - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 - NetHack Guidebook 27 + NetHack Guidebook 28 @@ -1776,13 +1842,13 @@ swap your primary into your off hand, wield whatever you want as - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 - NetHack Guidebook 28 + NetHack Guidebook 29 @@ -1842,13 +1908,13 @@ - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 - NetHack Guidebook 29 + NetHack Guidebook 30 @@ -1861,120 +1927,54 @@ any ‘‘plusses’’ it provides. Cursed pieces of armor usually have negative enchantments (minuses) in addition to being unremovable. - Many types of armor are subject to some kind of damage like - rust. Such damage can be repaired. Some types of armor may in‐ + Many types of armor are subject to some kind of damage like + rust. Such damage can be repaired. Some types of armor may in‐ hibit spell casting. The commands to use armor are ‘W’ (wear) and ‘T’ (take off). - The ‘A’ command can also be used to take off armor as well as + The ‘A’ command can also be used to take off armor as well as other worn items. 7.4. Food (‘%’) - Food is necessary to survive. If you go too long without - eating you will faint, and eventually die of starvation. Some - types of food will spoil, and become unhealthy to eat, if not + Food is necessary to survive. If you go too long without + eating you will faint, and eventually die of starvation. Some + types of food will spoil, and become unhealthy to eat, if not protected. Food stored in ice boxes or tins (‘‘cans’’) will usu‐ - ally stay fresh, but ice boxes are heavy, and tins take a while + ally stay fresh, but ice boxes are heavy, and tins take a while to open. When you kill monsters, they usually leave corpses which are also ‘‘food.’’ Many, but not all, of these are edible; some also - give you special powers when you eat them. A good rule of thumb + give you special powers when you eat them. A good rule of thumb is ‘‘you are what you eat.’’ Some character roles and some monsters are vegetarian. Veg‐ - etarian monsters will typically never eat animal corpses, while - vegetarian players can, but with some rather unpleasant side‐ef‐ + etarian monsters will typically never eat animal corpses, while + vegetarian players can, but with some rather unpleasant side‐ef‐ fects. - You can name one food item after something you like to eat + You can name one food item after something you like to eat with the fruit option. The command to eat food is ‘e’. 7.5. Scrolls (‘?’) - Scrolls are labeled with various titles, probably chosen by - ancient wizards for their amusement value (ex. ‘‘READ ME,’’ or + Scrolls are labeled with various titles, probably chosen by + ancient wizards for their amusement value (ex. ‘‘READ ME,’’ or ‘‘THANX MAUD’’ backwards). Scrolls disappear after you read them (except for blank ones, without magic spells on them). - One of the most useful of these is the scroll of identify, + One of the most useful of these is the scroll of identify, which can be used to determine what another object is, whether it - is cursed or blessed, and how many uses it has left. Some ob‐ - jects of subtle enchantment are difficult to identify without + is cursed or blessed, and how many uses it has left. Some ob‐ + jects of subtle enchantment are difficult to identify without these. - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 30 - - - - A mail daemon may run up and deliver mail to you as a scroll - of mail (on versions compiled with this feature). To use this - feature on versions where NetHack mail delivery is triggered by - electronic mail appearing in your system mailbox, you must let - NetHack know where to look for new mail by setting the ‘‘MAIL’’ - environment variable to the file name of your mailbox. You may - also want to set the ‘‘MAILREADER’’ environment variable to the - file name of your favorite reader, so NetHack can shell to it - when you read the scroll. On versions of NetHack where mail is - randomly generated internal to the game, these environment vari‐ - ables are ignored. You can disable the mail daemon by turning - off the mail option. - - The command to read a scroll is ‘r’. - - 7.6. Potions (‘!’) - - Potions are distinguished by the color of the liquid inside - the flask. They disappear after you quaff them. - - Clear potions are potions of water. Sometimes these are - blessed or cursed, resulting in holy or unholy water. Holy water - is the bane of the undead, so potions of holy water are good - things to throw (‘t’) at them. It is also sometimes very useful - to dip (‘‘#dip’’) an object into a potion. - - The command to drink a potion is ‘q’ (quaff). - - 7.7. Wands (‘/’) - - Magic wands usually have multiple magical charges. Some - wands are directional—you must give a direction in which to zap - them. You can also zap them at yourself (just give a ‘.’ or ‘s’ - for the direction). Be warned, however, for this is often unwise. - Other wands are nondirectional—they don’t require a direction. - The number of charges in a wand is random and decreases by one - whenever you use it. - - When the number of charges left in a wand becomes zero, at‐ - tempts to use the wand will usually result in nothing happening. - Occasionally, however, it may be possible to squeeze the last few - mana points from an otherwise spent wand, destroying it in the - process. A wand may be recharged by using suitable magic, but - doing so runs the risk of causing it to explode. The chance for - such an explosion starts out very small and increases each time - the wand is recharged. - - In a truly desperate situation, when your back is up against - the wall, you might decide to go for broke and break your wand. - This is not for the faint of heart. Doing so will almost cer‐ - tainly cause a catastrophic release of magical energies. - - When you have fully identified a particular wand, inventory - display will include additional information in parentheses: the - - - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -1984,7 +1984,73 @@ - number of times it has been recharged followed by a colon and + A mail daemon may run up and deliver mail to you as a scroll + of mail (on versions compiled with this feature). To use this + feature on versions where NetHack mail delivery is triggered by + electronic mail appearing in your system mailbox, you must let + NetHack know where to look for new mail by setting the ‘‘MAIL’’ + environment variable to the file name of your mailbox. You may + also want to set the ‘‘MAILREADER’’ environment variable to the + file name of your favorite reader, so NetHack can shell to it + when you read the scroll. On versions of NetHack where mail is + randomly generated internal to the game, these environment vari‐ + ables are ignored. You can disable the mail daemon by turning + off the mail option. + + The command to read a scroll is ‘r’. + + 7.6. Potions (‘!’) + + Potions are distinguished by the color of the liquid inside + the flask. They disappear after you quaff them. + + Clear potions are potions of water. Sometimes these are + blessed or cursed, resulting in holy or unholy water. Holy water + is the bane of the undead, so potions of holy water are good + things to throw (‘t’) at them. It is also sometimes very useful + to dip (‘‘#dip’’) an object into a potion. + + The command to drink a potion is ‘q’ (quaff). + + 7.7. Wands (‘/’) + + Magic wands usually have multiple magical charges. Some + wands are directional—you must give a direction in which to zap + them. You can also zap them at yourself (just give a ‘.’ or ‘s’ + for the direction). Be warned, however, for this is often unwise. + Other wands are nondirectional—they don’t require a direction. + The number of charges in a wand is random and decreases by one + whenever you use it. + + When the number of charges left in a wand becomes zero, at‐ + tempts to use the wand will usually result in nothing happening. + Occasionally, however, it may be possible to squeeze the last few + mana points from an otherwise spent wand, destroying it in the + process. A wand may be recharged by using suitable magic, but + doing so runs the risk of causing it to explode. The chance for + such an explosion starts out very small and increases each time + the wand is recharged. + + In a truly desperate situation, when your back is up against + the wall, you might decide to go for broke and break your wand. + This is not for the faint of heart. Doing so will almost cer‐ + tainly cause a catastrophic release of magical energies. + + When you have fully identified a particular wand, inventory + display will include additional information in parentheses: the + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 32 + + + + number of times it has been recharged followed by a colon and then by its current number of charges. A current charge count of ‐1 is a special case indicating that the wand has been cancelled. @@ -2008,105 +2074,39 @@ 7.9. Spellbooks (‘+’) Spellbooks are tomes of mighty magic. When studied with the - ‘r’ (read) command, they transfer to the reader the knowledge of + ‘r’ (read) command, they transfer to the reader the knowledge of a spell (and therefore eventually become unreadable) — unless the attempt backfires. Reading a cursed spellbook or one with mystic runes beyond your ken can be harmful to your health! - A spell (even when learned) can also backfire when you cast - it. If you attempt to cast a spell well above your experience - level, or if you have little skill with the appropriate spell - type, or cast it at a time when your luck is particularly bad, - you can end up wasting both the energy and the time required in + A spell (even when learned) can also backfire when you cast + it. If you attempt to cast a spell well above your experience + level, or if you have little skill with the appropriate spell + type, or cast it at a time when your luck is particularly bad, + you can end up wasting both the energy and the time required in casting. - Casting a spell calls forth magical energies and focuses - them with your naked mind. Some of the magical energy released - comes from within you, and casting several spells in a row may - tire you. Casting of spells also requires practice. With prac‐ - tice, your skill in each category of spell casting will improve. - Over time, however, your memory of each spell will dim, and you + Casting a spell calls forth magical energies and focuses + them with your naked mind. Some of the magical energy released + comes from within you, and casting several spells in a row may + tire you. Casting of spells also requires practice. With prac‐ + tice, your skill in each category of spell casting will improve. + Over time, however, your memory of each spell will dim, and you will need to relearn it. - Some spells are directional—you must give a direction in - which to cast them. You can also cast them at yourself (just - give a ‘.’ or ‘s’ for the direction). Be warned, however, for + Some spells are directional—you must give a direction in + which to cast them. You can also cast them at yourself (just + give a ‘.’ or ‘s’ for the direction). Be warned, however, for this is often unwise. Other spells are nondirectional—they don’t require a direction. Just as weapons are divided into groups in which a character - can become proficient (to varying degrees), spells are similarly + can become proficient (to varying degrees), spells are similarly grouped. Successfully casting a spell exercises its skill group; - using the ‘#enhance’ command to advance a sufficiently exercised + using the ‘#enhance’ command to advance a sufficiently exercised - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 32 - - - - skill will affect all spells within the group. Advanced skill - may increase the potency of spells, reduce their risk of failure - during casting attempts, and improve the accuracy of the estimate - for how much longer they will be retained in your memory. Skill - slots are shared with weapons skills. (See also the section on - ‘‘Weapon proficiency’’.) - - Casting a spell also requires flexible movement, and wearing - various types of armor may interfere with that. - - The command to read a spellbook is the same as for scrolls, - ‘r’ (read). The ‘+’ command lists each spell you know along with - its level, skill category, chance of failure when casting, and an - estimate of how strongly it is remembered. The ‘Z’ (cast) com‐ - mand casts a spell. - - 7.10. Tools (‘(’) - - Tools are miscellaneous objects with various purposes. Some - tools have a limited number of uses, akin to wand charges. For - example, lamps burn out after a while. Other tools are contain‐ - ers, which objects can be placed into or taken out of. - - The command to use tools is ‘a’ (apply). - - 7.10.1. Containers - - You may encounter bags, boxes, and chests in your travels. - A tool of this sort can be opened with the ‘‘#loot’’ extended - command when you are standing on top of it (that is, on the same - floor spot), or with the ‘a’ (apply) command when you are carry‐ - ing it. However, chests are often locked, and are in any case - unwieldy objects. You must set one down before unlocking it by - using a key or lock‐picking tool with the ‘a’ (apply) command, by - kicking it with the ‘^D’ command, or by using a weapon to force - the lock with the ‘‘#force’’ extended command. - - Some chests are trapped, causing nasty things to happen when - you unlock or open them. You can check for and try to deactivate - traps with the ‘‘#untrap’’ extended command. - - 7.11. Amulets (‘"’) - - Amulets are very similar to rings, and often more powerful. - Like rings, amulets have various magical properties, some benefi‐ - cial, some harmful, which are activated by putting them on. - - Only one amulet may be worn at a time, around your neck. - - The commands to use amulets are the same as for rings, ‘P’ - (put on) and ‘R’ (remove). - - - - - - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -2116,63 +2116,63 @@ - 7.12. Gems (‘*’) + skill will affect all spells within the group. Advanced skill + may increase the potency of spells, reduce their risk of failure + during casting attempts, and improve the accuracy of the estimate + for how much longer they will be retained in your memory. Skill + slots are shared with weapons skills. (See also the section on + ‘‘Weapon proficiency’’.) - Some gems are valuable, and can be sold for a lot of gold. - They are also a far more efficient way of carrying your riches. - Valuable gems increase your score if you bring them with you when - you exit. + Casting a spell also requires flexible movement, and wearing + various types of armor may interfere with that. - Other small rocks are also categorized as gems, but they are - much less valuable. All rocks, however, can be used as projec‐ - tile weapons (if you have a sling). In the most desperate of - cases, you can still throw them by hand. + The command to read a spellbook is the same as for scrolls, + ‘r’ (read). The ‘+’ command lists each spell you know along with + its level, skill category, chance of failure when casting, and an + estimate of how strongly it is remembered. The ‘Z’ (cast) com‐ + mand casts a spell. - 7.13. Large rocks (‘`’) + 7.10. Tools (‘(’) - Statues and boulders are not particularly useful, and are - generally heavy. It is rumored that some statues are not what - they seem. + Tools are miscellaneous objects with various purposes. Some + tools have a limited number of uses, akin to wand charges. For + example, lamps burn out after a while. Other tools are contain‐ + ers, which objects can be placed into or taken out of. - Very large humanoids (giants and their ilk) have been known - to use boulders as weapons. + The command to use tools is ‘a’ (apply). - 7.14. Gold (‘$’) + 7.10.1. Containers - Gold adds to your score, and you can buy things in shops - with it. There are a number of monsters in the dungeon that may - be influenced by the amount of gold you are carrying (shopkeepers - aside). + You may encounter bags, boxes, and chests in your travels. + A tool of this sort can be opened with the ‘‘#loot’’ extended + command when you are standing on top of it (that is, on the same + floor spot), or with the ‘a’ (apply) command when you are carry‐ + ing it. However, chests are often locked, and are in any case + unwieldy objects. You must set one down before unlocking it by + using a key or lock‐picking tool with the ‘a’ (apply) command, by + kicking it with the ‘^D’ command, or by using a weapon to force + the lock with the ‘‘#force’’ extended command. + + Some chests are trapped, causing nasty things to happen when + you unlock or open them. You can check for and try to deactivate + traps with the ‘‘#untrap’’ extended command. + + 7.11. Amulets (‘"’) + + Amulets are very similar to rings, and often more powerful. + Like rings, amulets have various magical properties, some benefi‐ + cial, some harmful, which are activated by putting them on. + + Only one amulet may be worn at a time, around your neck. + + The commands to use amulets are the same as for rings, ‘P’ + (put on) and ‘R’ (remove). - 8. Conduct - - As if winning NetHack were not difficult enough, certain - players seek to challenge themselves by imposing restrictions on - the way they play the game. The game automatically tracks some - of these challenges, which can be checked at any time with the - #conduct command or at the end of the game. When you perform an - action which breaks a challenge, it will no longer be listed. - This gives players extra ‘‘bragging rights’’ for winning the game - with these challenges. Note that it is perfectly acceptable to - win the game without resorting to these restrictions and that it - is unusual for players to adhere to challenges the first time - they win the game. - - Several of the challenges are related to eating behavior. - The most difficult of these is the foodless challenge. Although - creatures can survive long periods of time without food, there is - a physiological need for water; thus there is no restriction on - drinking beverages, even if they provide some minor food bene‐ - fits. Calling upon your god for help with starvation does not - violate any food challenges either. - - A strict vegan diet is one which avoids any food derived - from animals. The primary source of nutrition is fruits and veg‐ - etables. The corpses and tins of blobs (‘b’), jellies (‘j’), and - NetHack 3.6 March 27, 2015 + + NetHack 3.6 June 22, 2015 @@ -2182,63 +2182,63 @@ - fungi (‘F’) are also considered to be vegetable matter. Certain - human food is prepared without animal products; namely, lembas - wafers, cram rations, food rations (gunyoki), K‐rations, and C‐ - rations. Metal or another normally indigestible material eaten - while polymorphed into a creature that can digest it is also con‐ - sidered vegan food. Note however that eating such items still - counts against foodless conduct. + 7.12. Gems (‘*’) - Vegetarians do not eat animals; however, they are less se‐ - lective about eating animal byproducts than vegans. In addition - to the vegan items listed above, they may eat any kind of pudding - (‘P’) other than the black puddings, eggs and food made from eggs - (fortune cookies and pancakes), food made with milk (cream pies - and candy bars), and lumps of royal jelly. Monks are expected to - observe a vegetarian diet. + Some gems are valuable, and can be sold for a lot of gold. + They are also a far more efficient way of carrying your riches. + Valuable gems increase your score if you bring them with you when + you exit. - Eating any kind of meat violates the vegetarian, vegan, and - foodless conducts. This includes tripe rations, the corpses or - tins of any monsters not mentioned above, and the various other - chunks of meat found in the dungeon. Swallowing and digesting a - monster while polymorphed is treated as if you ate the creature’s - corpse. Eating leather, dragon hide, or bone items while poly‐ - morphed into a creature that can digest it, or eating monster - brains while polymorphed into a mind flayer, is considered eating - an animal, although wax is only an animal byproduct. + Other small rocks are also categorized as gems, but they are + much less valuable. All rocks, however, can be used as projec‐ + tile weapons (if you have a sling). In the most desperate of + cases, you can still throw them by hand. - Regardless of conduct, there will be some items which are - indigestible, and others which are hazardous to eat. Using a - swallow‐and‐digest attack against a monster is equivalent to eat‐ - ing the monster’s corpse. Please note that the term ‘‘vegan’’ is - used here only in the context of diet. You are still free to - choose not to use or wear items derived from animals (e.g. - leather, dragon hide, bone, horns, coral), but the game will not - keep track of this for you. Also note that ‘‘milky’’ potions may - be a translucent white, but they do not contain milk, so they are - compatible with a vegan diet. Slime molds or player‐defined - ‘‘fruits’’, although they could be anything from ‘‘cherries’’ to - ‘‘pork chops’’, are also assumed to be vegan. + 7.13. Large rocks (‘`’) - An atheist is one who rejects religion. This means that you - cannot #pray, #offer sacrifices to any god, #turn undead, or - #chat with a priest. Particularly selective readers may argue - that playing Monk or Priest characters should violate this con‐ - duct; that is a choice left to the player. Offering the Amulet - of Yendor to your god is necessary to win the game and is not - counted against this conduct. You are also not penalized for be‐ - ing spoken to by an angry god, priest(ess), or other religious - figure; a true atheist would hear the words but attach no special - meaning to them. + Statues and boulders are not particularly useful, and are + generally heavy. It is rumored that some statues are not what + they seem. - Most players fight with a wielded weapon (or tool intended - to be wielded as a weapon). Another challenge is to win the game - without using such a wielded weapon. You are still permitted to - throw, fire, and kick weapons; use a wand, spell, or other type + Very large humanoids (giants and their ilk) have been known + to use boulders as weapons. + + 7.14. Gold (‘$’) + + Gold adds to your score, and you can buy things in shops + with it. There are a number of monsters in the dungeon that may + be influenced by the amount of gold you are carrying (shopkeepers + aside). - NetHack 3.6 March 27, 2015 + 8. Conduct + + As if winning NetHack were not difficult enough, certain + players seek to challenge themselves by imposing restrictions on + the way they play the game. The game automatically tracks some + of these challenges, which can be checked at any time with the + #conduct command or at the end of the game. When you perform an + action which breaks a challenge, it will no longer be listed. + This gives players extra ‘‘bragging rights’’ for winning the game + with these challenges. Note that it is perfectly acceptable to + win the game without resorting to these restrictions and that it + is unusual for players to adhere to challenges the first time + they win the game. + + Several of the challenges are related to eating behavior. + The most difficult of these is the foodless challenge. Although + creatures can survive long periods of time without food, there is + a physiological need for water; thus there is no restriction on + drinking beverages, even if they provide some minor food bene‐ + fits. Calling upon your god for help with starvation does not + violate any food challenges either. + + A strict vegan diet is one which avoids any food derived + from animals. The primary source of nutrition is fruits and veg‐ + etables. The corpses and tins of blobs (‘b’), jellies (‘j’), and + + + NetHack 3.6 June 22, 2015 @@ -2248,63 +2248,63 @@ - of item; or fight with your hands and feet. + fungi (‘F’) are also considered to be vegetable matter. Certain + human food is prepared without animal products; namely, lembas + wafers, cram rations, food rations (gunyoki), K‐rations, and C‐ + rations. Metal or another normally indigestible material eaten + while polymorphed into a creature that can digest it is also con‐ + sidered vegan food. Note however that eating such items still + counts against foodless conduct. - In NetHack, a pacifist refuses to cause the death of any - other monster (i.e. if you would get experience for the death). - This is a particularly difficult challenge, although it is still - possible to gain experience by other means. + Vegetarians do not eat animals; however, they are less se‐ + lective about eating animal byproducts than vegans. In addition + to the vegan items listed above, they may eat any kind of pudding + (‘P’) other than the black puddings, eggs and food made from eggs + (fortune cookies and pancakes), food made with milk (cream pies + and candy bars), and lumps of royal jelly. Monks are expected to + observe a vegetarian diet. - An illiterate character cannot read or write. This includes - reading a scroll, spellbook, fortune cookie message, or t‐shirt; - writing a scroll; or making an engraving of anything other than a - single ‘‘x’’ (the traditional signature of an illiterate person). - Reading an engraving, or any item that is absolutely necessary to - win the game, is not counted against this conduct. The identity - of scrolls and spellbooks (and knowledge of spells) in your - starting inventory is assumed to be learned from your teachers - prior to the start of the game and isn’t counted. + Eating any kind of meat violates the vegetarian, vegan, and + foodless conducts. This includes tripe rations, the corpses or + tins of any monsters not mentioned above, and the various other + chunks of meat found in the dungeon. Swallowing and digesting a + monster while polymorphed is treated as if you ate the creature’s + corpse. Eating leather, dragon hide, or bone items while poly‐ + morphed into a creature that can digest it, or eating monster + brains while polymorphed into a mind flayer, is considered eating + an animal, although wax is only an animal byproduct. - There are several other challenges tracked by the game. It - is possible to eliminate one or more species of monsters by geno‐ - cide; playing without this feature is considered a challenge. - When the game offers you an opportunity to genocide monsters, you - may respond with the monster type ‘‘none’’ if you want to de‐ - cline. You can change the form of an item into another item of - the same type (‘‘polypiling’’) or the form of your own body into - another creature (‘‘polyself’’) by wand, spell, or potion of - polymorph; avoiding these effects are each considered challenges. - Polymorphing monsters, including pets, does not break either of - these challenges. Finally, you may sometimes receive wishes; a - game without an attempt to wish for any items is a challenge, as - is a game without wishing for an artifact (even if the artifact - immediately disappears). When the game offers you an opportunity - to make a wish for an item, you may choose ‘‘nothing’’ if you - want to decline. + Regardless of conduct, there will be some items which are + indigestible, and others which are hazardous to eat. Using a + swallow‐and‐digest attack against a monster is equivalent to eat‐ + ing the monster’s corpse. Please note that the term ‘‘vegan’’ is + used here only in the context of diet. You are still free to + choose not to use or wear items derived from animals (e.g. + leather, dragon hide, bone, horns, coral), but the game will not + keep track of this for you. Also note that ‘‘milky’’ potions may + be a translucent white, but they do not contain milk, so they are + compatible with a vegan diet. Slime molds or player‐defined + ‘‘fruits’’, although they could be anything from ‘‘cherries’’ to + ‘‘pork chops’’, are also assumed to be vegan. + + An atheist is one who rejects religion. This means that you + cannot #pray, #offer sacrifices to any god, #turn undead, or + #chat with a priest. Particularly selective readers may argue + that playing Monk or Priest characters should violate this con‐ + duct; that is a choice left to the player. Offering the Amulet + of Yendor to your god is necessary to win the game and is not + counted against this conduct. You are also not penalized for be‐ + ing spoken to by an angry god, priest(ess), or other religious + figure; a true atheist would hear the words but attach no special + meaning to them. + + Most players fight with a wielded weapon (or tool intended + to be wielded as a weapon). Another challenge is to win the game + without using such a wielded weapon. You are still permitted to + throw, fire, and kick weapons; use a wand, spell, or other type - 9. Options - - Due to variations in personal tastes and conceptions of how - NetHack should do things, there are options you can set to change - how NetHack behaves. - - 9.1. Setting the options - - Options may be set in a number of ways. Within the game, - the ‘O’ command allows you to view all options and change most of - them. You can also set options automatically by placing them in - the NETHACKOPTIONS environment variable or in a configuration - file. Some versions of NetHack also have front‐end programs that - allow you to set options before starting the game or a global - configuration for system administrators. - - - - - - - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -2314,63 +2314,63 @@ - 9.2. Using the NETHACKOPTIONS environment variable + of item; or fight with your hands and feet. - The NETHACKOPTIONS variable is a comma‐separated list of - initial values for the various options. Some can only be turned - on or off. You turn one of these on by adding the name of the - option to the list, and turn it off by typing a ‘!’ or ‘‘no’’ be‐ - fore the name. Others take a character string as a value. You - can set string options by typing the option name, a colon or - equals sign, and then the value of the string. The value is ter‐ - minated by the next comma or the end of string. + In NetHack, a pacifist refuses to cause the death of any + other monster (i.e. if you would get experience for the death). + This is a particularly difficult challenge, although it is still + possible to gain experience by other means. - For example, to set up an environment variable so that ‘‘au‐ - toquiver’’ is on, ‘‘autopickup’’ is off, the name is set to - ‘‘Blue Meanie’’, and the fruit is set to ‘‘papaya’’, you would - enter the command + An illiterate character cannot read or write. This includes + reading a scroll, spellbook, fortune cookie message, or t‐shirt; + writing a scroll; or making an engraving of anything other than a + single ‘‘x’’ (the traditional signature of an illiterate person). + Reading an engraving, or any item that is absolutely necessary to + win the game, is not counted against this conduct. The identity + of scrolls and spellbooks (and knowledge of spells) in your + starting inventory is assumed to be learned from your teachers + prior to the start of the game and isn’t counted. - % setenv NETHACKOPTIONS "autoquiver,\!autopickup,name:Blue Meanie,fruit:papaya" + There are several other challenges tracked by the game. It + is possible to eliminate one or more species of monsters by geno‐ + cide; playing without this feature is considered a challenge. + When the game offers you an opportunity to genocide monsters, you + may respond with the monster type ‘‘none’’ if you want to de‐ + cline. You can change the form of an item into another item of + the same type (‘‘polypiling’’) or the form of your own body into + another creature (‘‘polyself’’) by wand, spell, or potion of + polymorph; avoiding these effects are each considered challenges. + Polymorphing monsters, including pets, does not break either of + these challenges. Finally, you may sometimes receive wishes; a + game without an attempt to wish for any items is a challenge, as + is a game without wishing for an artifact (even if the artifact + immediately disappears). When the game offers you an opportunity + to make a wish for an item, you may choose ‘‘nothing’’ if you + want to decline. - in csh (note the need to escape the ! since it’s special to the - shell), or - $ NETHACKOPTIONS="autoquiver,!autopickup,name:Blue Meanie,fruit:papaya" - $ export NETHACKOPTIONS + 9. Options - in sh or ksh. + Due to variations in personal tastes and conceptions of how + NetHack should do things, there are options you can set to change + how NetHack behaves. - 9.3. Using a configuration file + 9.1. Setting the options - Any line in the configuration file starting with ‘#’ is - treated as a comment. Any line in the configuration file start‐ - ing with ‘‘OPTIONS=’’ may be filled out with options in the same - syntax as in NETHACKOPTIONS. Any line starting with ‘‘SYMBOLS=’’ - is taken as defining the corresponding symbol in a different syn‐ - tax, a sequence of decimal numbers giving the character position - in the current font to be used in displaying each entry. Such a - sequence can be continued to multiple lines by putting a ‘\’ at - the end of each line to be continued. - - Any line starting with ‘‘AUTOPICKUP_EXCEPTION=’’ is taken as - defining an exception to the pickup_types option. There is a - section of this Guidebook that discusses that. - - The default name of the configuration file varies on differ‐ - ent operating systems, but NETHACKOPTIONS can also be set to the - full name of a file you want to use (possibly preceded by an - ‘@’). - - 9.4. Customization options - - Here are explanations of what the various options do. Char‐ - acter strings that are too long may be truncated. Some of the - options listed may be inactive in your dungeon. + Options may be set in a number of ways. Within the game, + the ‘O’ command allows you to view all options and change most of + them. You can also set options automatically by placing them in + the NETHACKOPTIONS environment variable or in a configuration + file. Some versions of NetHack also have front‐end programs that + allow you to set options before starting the game or a global + configuration for system administrators. - NetHack 3.6 March 27, 2015 + + + NetHack 3.6 June 22, 2015 @@ -2380,26 +2380,100 @@ + 9.2. Using the NETHACKOPTIONS environment variable + + The NETHACKOPTIONS variable is a comma‐separated list of + initial values for the various options. Some can only be turned + on or off. You turn one of these on by adding the name of the + option to the list, and turn it off by typing a ‘!’ or ‘‘no’’ be‐ + fore the name. Others take a character string as a value. You + can set string options by typing the option name, a colon or + equals sign, and then the value of the string. The value is ter‐ + minated by the next comma or the end of string. + + For example, to set up an environment variable so that ‘‘au‐ + toquiver’’ is on, ‘‘autopickup’’ is off, the name is set to + ‘‘Blue Meanie’’, and the fruit is set to ‘‘papaya’’, you would + enter the command + + % setenv NETHACKOPTIONS "autoquiver,\!autopickup,name:Blue Meanie,fruit:papaya" + + in csh (note the need to escape the ! since it’s special to the + shell), or + + $ NETHACKOPTIONS="autoquiver,!autopickup,name:Blue Meanie,fruit:papaya" + $ export NETHACKOPTIONS + + in sh or ksh. + + 9.3. Using a configuration file + + Any line in the configuration file starting with ‘#’ is + treated as a comment. Any line in the configuration file start‐ + ing with ‘‘OPTIONS=’’ may be filled out with options in the same + syntax as in NETHACKOPTIONS. Any line starting with ‘‘SYMBOLS=’’ + is taken as defining the corresponding symbol in a different syn‐ + tax, a sequence of decimal numbers giving the character position + in the current font to be used in displaying each entry. Such a + sequence can be continued to multiple lines by putting a ‘\’ at + the end of each line to be continued. + + Any line starting with ‘‘AUTOPICKUP_EXCEPTION=’’ is taken as + defining an exception to the pickup_types option. There is a + section of this Guidebook that discusses that. + + The default name of the configuration file varies on differ‐ + ent operating systems, but NETHACKOPTIONS can also be set to the + full name of a file you want to use (possibly preceded by an + ‘@’). + + 9.4. Customization options + + Here are explanations of what the various options do. Char‐ + acter strings that are too long may be truncated. Some of the + options listed may be inactive in your dungeon. + + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 38 + + + + Some options are persistent, and are saved and reloaded + along with the game. Changing a persistent option in the config‐ + uration file applies only to new games. + acoustics - Enable messages about what your character hears (default on). + Enable messages about what your character hears (default on). Note that this has nothing to do with your computer’s audio ca‐ - pabilities. + pabilities. Persistent. align - Your starting alignment (align:lawful, align:neutral, or - align:chaotic). You may specify just the first letter. The - default is to randomly pick an appropriate alignment. If you - prefix a ‘!’ or ‘‘no’’ to the value, you can exclude that - alignment from being picked randomly. Cannot be set with the - ‘O’ command. + Your starting alignment (align:lawful, align:neutral, or + align:chaotic). You may specify just the first letter. The + default is to randomly pick an appropriate alignment. If you + prefix a ‘!’ or ‘‘no’’ to the value, you can exclude that + alignment from being picked randomly. Cannot be set with the + ‘O’ command. Persistent. autodig Automatically dig if you are wielding a digging tool and moving - into a place that can be dug (default false). + into a place that can be dug (default false). Persistent. + + autoopen + Walking into a door attempts to open it (default true). Persis‐ + tent. autopickup Automatically pick up things onto which you move (default on). - See pickup_types to refine the behavior. + Persistent. See pickup_types to refine the behavior. autoquiver This option controls what happens when you attempt the ‘f’ @@ -2410,16 +2484,34 @@ enchantment, damage, or quality of the weapon; you are free to manually fill your quiver or quiver sack or make ready with the ‘Q’ command instead. If no weapon is found or the option is - false, the ‘t’ (throw) command is executed instead. (default + false, the ‘t’ (throw) command is executed instead. Persis‐ + tent. (default false) + + blind + Start the character permanently blind. Persistent. (default false) bones - Allow saving and loading bones files. (default true) + Allow saving and loading bones files. Persistent. (default + true) boulder Set the character used to display boulders (default is rock class symbol). + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 39 + + + catname Name your starting cat (ex. ‘‘catname:Morris’’). Cannot be set with the ‘O’ command. @@ -2432,19 +2524,7 @@ checkpoint Save game state after each level change, for possible recovery - after program crash (default on). - - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 38 - - + after program crash (default on). Persistent. checkspace Check free disk space before writing files to disk (default @@ -2463,13 +2543,18 @@ confirm Have user confirm attacks on pets, shopkeepers, and other - peaceable creatures (default on). + peaceable creatures (default on). Persistent. + + dark_room + Show out‐of‐sight areas of lit rooms (default off). Persis‐ + tent. disclose - Controls what information the program reveals when the game - ends. Value is a space separated list of prompting/category - pairs (default is ‘ni na nv ng nc no’, prompt with default re‐ - sponse of ‘n’ for each candidate). The possibilities are: + Controls what information the program reveals when the game + ends. Value is a space separated list of prompting/category + pairs (default is ‘ni na nv ng nc no’, prompt with default re‐ + sponse of ‘n’ for each candidate). Persistent. The possibili‐ + ties are: i ‐ disclose your inventory; a ‐ disclose your attributes; @@ -2482,6 +2567,17 @@ prefix which lets you refine how it behaves. Here are the valid prefixes: + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 40 + + + y ‐ prompt you and default to yes on the prompt; n ‐ prompt you and default to no on the prompt; + ‐ disclose it without prompting; @@ -2499,21 +2595,9 @@ fault to no, and overview to disclose without prompting. Note that the vanquished monsters list includes all monsters - killed by traps and each other as well as by you. And the - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 39 - - - - dungeon overview shows all levels you had visited but does not - reveal things about them that you hadn’t discovered. + killed by traps and each other as well as by you. And the dun‐ + geon overview shows all levels you had visited but does not re‐ + veal things about them that you hadn’t discovered. dogname Name your starting dog (ex. ‘‘dogname:Fang’’). Cannot be set @@ -2533,7 +2617,7 @@ fixinv An object’s inventory letter sticks to it when it’s dropped (default on). If this is off, dropping an object shifts all - the remaining inventory letters. + the remaining inventory letters. Persistent. fruit Name a fruit after something you enjoy eating (ex. ‘‘fruit:man‐ @@ -2547,94 +2631,10 @@ Your starting gender (gender:male or gender:female). You may specify just the first letter. Although you can still denote your gender using the ‘‘male’’ and ‘‘female’’ options, the - ‘‘gender’’ option will take precedence. The default is to ran‐ - domly pick an appropriate gender. If you prefix a ‘!’ or - ‘‘no’’ to the value, you can exclude that gender from being - picked randomly. Cannot be set with the ‘O’ command. - - help - If more information is available for an object looked at with - the ‘/’ command, ask if you want to see it (default on). Turn‐ - ing help off makes just looking at things faster, since you - aren’t interrupted with the ‘‘More info?’’ prompt, but it also - means that you might miss some interesting and/or important in‐ - formation. - - horsename - Name your starting horse (ex. ‘‘horsename:Trigger’’). Cannot - be set with the ‘O’ command. - - ignintr - Ignore interrupt signals, including breaks (default off). + ‘‘gender’’ option will take precedence. The default is to - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 40 - - - - legacy - Display an introductory message when starting the game (default - on). - - lit_corridor - Show corridor squares seen by night vision or a light source - held by your character as lit (default off). - - lootabc - Use the old ‘a’, ‘b’, and ‘c’ keyboard shortcuts when looting, - rather than the mnemonics ‘o’, ‘i’, and ‘b’ (default off). - - mail - Enable mail delivery during the game (default on). - - male - An obsolete synonym for ‘‘gender:male’’. Cannot be set with - the ‘O’ command. - - mention_walls - Give feedback when walking against a wall (default off). - - menustyle - Controls the interface used when you need to choose various ob‐ - jects (in response to the Drop command, for instance). The - value specified should be the first letter of one of the fol‐ - lowing: traditional, combination, partial, or full. Tradi‐ - tional was the only interface available for earlier versions; - it consists of a prompt for object class characters, followed - by an object‐by‐object prompt for all items matching the se‐ - lected object class(es). Combination starts with a prompt for - object class(es) of interest, but then displays a menu of - matching objects rather than prompting one‐by‐one. Partial - skips the object class filtering and immediately displays a - menu of all objects. Full displays a menu of object classes - rather than a character prompt, and then a menu of matching ob‐ - jects for selection. - - menu_deselect_all - Menu character accelerator to deselect all items in a menu. - Implemented by the Amiga, Gem, X11 and tty ports. Default ’‐’. - - menu_deselect_page - Menu character accelerator to deselect all items on this page - of a menu. Implemented by the Amiga, Gem and tty ports. De‐ - fault ’\’. - - menu_first_page - Menu character accelerator to jump to the first page in a menu. - Implemented by the Amiga, Gem and tty ports. Default ’^’. - - menu_headings - Controls how the headings in a menu are highlighted. Values - are ’bold’, ’inverse’, or ’underline’. Not all ports can - - - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -2644,63 +2644,63 @@ - actually display all three types. + randomly pick an appropriate gender. If you prefix a ‘!’ or + ‘‘no’’ to the value, you can exclude that gender from being + picked randomly. Cannot be set with the ‘O’ command. Persis‐ + tent. - menu_invert_all - Menu character accelerator to invert all items in a menu. Im‐ - plemented by the Amiga, Gem, X11 and tty ports. Default ’@’. + help + If more information is available for an object looked at with + the ‘/’ command, ask if you want to see it (default on). Turn‐ + ing help off makes just looking at things faster, since you + aren’t interrupted with the ‘‘More info?’’ prompt, but it also + means that you might miss some interesting and/or important in‐ + formation. Persistent. - menu_invert_page - Menu character accelerator to invert all items on this page of - a menu. Implemented by the Amiga, Gem and tty ports. Default - ’~’. + hilite_pet + Visually distinguish pets from similar animals (default off). + The behavior of this option depends on the type of windowing + you use. In text windowing, text highlighting or inverse video + is often used; with tiles, generally displays a heart symbol + near pets. - menu_last_page - Menu character accelerator to jump to the last page in a menu. - Implemented by the Amiga, Gem and tty ports. Default ’|’. + hilite_pile + Visually distinguish piles of objects from individual objects + (default off). The behavior of this option depends on the type + of windowing you use. In text windowing, text highlighting or + inverse video is often used; with tiles, generally displays a + small plus‐symbol beside the object on the top of the pile. - menu_next_page - Menu character accelerator to goto the next menu page. Imple‐ - mented by the Amiga, Gem and tty ports. Default ’>’. + horsename + Name your starting horse (ex. ‘‘horsename:Trigger’’). Cannot + be set with the ‘O’ command. - menu_objsyms - Show object symbols in menu headings in menus where the object - symbols act as menu accelerators (default off). + ignintr + Ignore interrupt signals, including breaks (default off). Per‐ + sistent. - menu_previous_page - Menu character accelerator to goto the previous menu page. Im‐ - plemented by the Amiga, Gem and tty ports. Default ’<’. + implicit_uncursed + Omit "uncursed" from inventory lists, if possible (default on). - menu_search - Menu character accelerator to search for a menu item. Imple‐ - mented by the Amiga, Gem, X11 and tty ports. Default ’:’. + legacy + Display an introductory message when starting the game (default + on). Persistent. - menu_select_all - Menu character accelerator to select all items in a menu. Im‐ - plemented by the Amiga, Gem, X11 and tty ports. Default ’.’. + lit_corridor + Show corridor squares seen by night vision or a light source + held by your character as lit (default off). Persistent. - menu_select_page - Menu character accelerator to select all items on this page of - a menu. Implemented by the Amiga, Gem and tty ports. Default - ’,’. + lootabc + Use the old ‘a’, ‘b’, and ‘c’ keyboard shortcuts when looting, + rather than the mnemonics ‘o’, ‘i’, and ‘b’ (default off). + Persistent. - msghistory - The number of top line messages to save (and recall with ^P) - (default 20). Cannot be set with the ‘O’ command. - - msg_window - Allows you to change the way recalled messages are displayed. - (It is currently implemented for tty only.) The possible val‐ - ues are: - - s ‐ single message (default; only choice prior to 3.4.0); - c ‐ combination, two messages as ‘single’, then as ‘full’; - f ‐ full window, oldest message first; - r ‐ full window reversed, newest message first. + mail + Enable mail delivery during the game (default on). Persistent. - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -2710,63 +2710,63 @@ - For backward compatibility, no value needs to be specified - (which defaults to ‘full’), or it can be negated (which de‐ - faults to ‘single’). + male + An obsolete synonym for ‘‘gender:male’’. Cannot be set with + the ‘O’ command. - name - Set your character’s name (defaults to your user name). You - can also set your character’s role by appending a dash and one - or more letters of the role (that is, by suffixing one of ‐A ‐B - ‐C ‐H ‐K ‐M ‐P ‐Ra ‐Ro ‐S ‐T ‐V ‐W). If ‐@ is used for the - role, then a random one will be automatically chosen. Cannot - be set with the ‘O’ command. + mention_walls + Give feedback when walking against a wall (default off). - news - Read the NetHack news file, if present (default on). Since the - news is shown at the beginning of the game, there’s no point in - setting this with the ‘O’ command. + menucolors + Enable coloring menu lines (default off). See ‘‘Configuring + Menu Colors’’ on how to configure the colors. - null - Send padding nulls to the terminal (default on). + menustyle + Controls the interface used when you need to choose various ob‐ + jects (in response to the Drop command, for instance). The + value specified should be the first letter of one of the fol‐ + lowing: traditional, combination, full, or partial. Tradi‐ + tional was the only interface available for early versions; it + consists of a prompt for object class characters, followed by + an object‐by‐object prompt for all items matching the selected + object class(es). Combination starts with a prompt for object + class(es) of interest, but then displays a menu of matching ob‐ + jects rather than prompting one‐by‐one. Full displays a menu + of object classes rather than a character prompt, and then a + menu of matching objects for selection. Partial skips the ob‐ + ject class filtering and immediately displays a menu of all ob‐ + jects. Persistent. - number_pad - Use digit keys instead of letters to move (default 0 or off). - Valid settings are: + menu_deselect_all + Menu character accelerator to deselect all items in a menu. + Implemented by the Amiga, Gem, X11 and tty ports. Default ’‐’. - 0 ‐ move by letters; ‘yuhjklbn’ - 1 ‐ move by numbers; digit ‘5’ acts as ‘G’ movement prefix - 2 ‐ like 1 but ‘5’ works as ‘g’ prefix instead of as ‘G’ - 3 ‐ by numbers using phone key layout; 123 above, 789 below - 4 ‐ combines 3 with 2; phone layout plus MSDOS compatibility - ‐1 ‐ by letters but use ‘z’ to go northwest, ‘y’ to zap wands + menu_deselect_page + Menu character accelerator to deselect all items on this page + of a menu. Implemented by the Amiga, Gem and tty ports. De‐ + fault ’\’. - For backward compatibility, omitting a value is the same as - specifying 1 and negating number_pad is the same as specifying - 0. (Settings 2 and 4 are for compatibility with MSDOS or old - PC Hack; in addition to the different behavior for ‘5’, ‘Alt‐5’ - acts as ‘G’ and ‘Alt‐0’ acts as ‘I’. Setting ‐1 is to accommo‐ - date some German keyboards which have the location of the ‘y’ - and ‘z’ keys swapped.) When moving by numbers, to enter a - count prefix for those commands which accept one (such as - ‘‘12s’’ to search twelve times), precede it with the letter ‘n’ - (‘‘n12s’’). + menu_first_page + Menu character accelerator to jump to the first page in a menu. + Implemented by the Amiga, Gem and tty ports. Default ’^’. - packorder - Specify the order to list object types in (default - ‘‘")[%?+!=/(*‘0_’’). The value of this option should be a - string containing the symbols for the various object types. - Any omitted types are filled in at the end from the previous - order. + menu_headings + Controls how the headings in a menu are highlighted. Values + are ’none’, ’bold’, ’dim’, ’underline’, ’blink’, or ’inverse’. + Not all ports can actually display all types. - paranoid_confirmation - A space separated list of specific situations where alternate - prompting is desired. The default is paranoid_confirma‐ - tion:pray. + menu_invert_all + Menu character accelerator to invert all items in a menu. Im‐ + plemented by the Amiga, Gem, X11 and tty ports. Default ’@’. + + menu_invert_page + Menu character accelerator to invert all items on this page of + a menu. Implemented by the Amiga, Gem and tty ports. Default + ’~’. - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 @@ -2776,19 +2776,144 @@ + menu_last_page + Menu character accelerator to jump to the last page in a menu. + Implemented by the Amiga, Gem and tty ports. Default ’|’. + + menu_next_page + Menu character accelerator to goto the next menu page. Imple‐ + mented by the Amiga, Gem and tty ports. Default ’>’. + + menu_objsyms + Show object symbols in menu headings in menus where the object + symbols act as menu accelerators (default off). + + menu_previous_page + Menu character accelerator to goto the previous menu page. Im‐ + plemented by the Amiga, Gem and tty ports. Default ’<’. + + menu_search + Menu character accelerator to search for a menu item. Imple‐ + mented by the Amiga, Gem, X11 and tty ports. Default ’:’. + + menu_select_all + Menu character accelerator to select all items in a menu. Im‐ + plemented by the Amiga, Gem, X11 and tty ports. Default ’.’. + + menu_select_page + Menu character accelerator to select all items on this page of + a menu. Implemented by the Amiga, Gem and tty ports. Default + ’,’. + + msghistory + The number of top line messages to save (and recall with ^P) + (default 20). Cannot be set with the ‘O’ command. + + msg_window + Allows you to change the way recalled messages are displayed. + (It is currently implemented for tty only.) The possible val‐ + ues are: + + s ‐ single message (default; only choice prior to 3.4.0); + c ‐ combination, two messages as ‘single’, then as ‘full’; + f ‐ full window, oldest message first; + r ‐ full window reversed, newest message first. + + For backward compatibility, no value needs to be specified + (which defaults to ‘full’), or it can be negated (which de‐ + faults to ‘single’). + + name + Set your character’s name (defaults to your user name). You + can also set your character’s role by appending a dash and one + or more letters of the role (that is, by suffixing one of ‐A ‐B + ‐C ‐H ‐K ‐M ‐P ‐Ra ‐Ro ‐S ‐T ‐V ‐W). If ‐@ is used for the + role, then a random one will be automatically chosen. Cannot + be set with the ‘O’ command. + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 44 + + + + news + Read the NetHack news file, if present (default on). Since the + news is shown at the beginning of the game, there’s no point in + setting this with the ‘O’ command. + + nudist + Start the character with no armor (default false). Persistent. + + null + Send padding nulls to the terminal (default on). Persistent. + + number_pad + Use digit keys instead of letters to move (default 0 or off). + Valid settings are: + + 0 ‐ move by letters; ‘yuhjklbn’ + 1 ‐ move by numbers; digit ‘5’ acts as ‘G’ movement prefix + 2 ‐ like 1 but ‘5’ works as ‘g’ prefix instead of as ‘G’ + 3 ‐ by numbers using phone key layout; 123 above, 789 below + 4 ‐ combines 3 with 2; phone layout plus MSDOS compatibility + ‐1 ‐ by letters but use ‘z’ to go northwest, ‘y’ to zap wands + + For backward compatibility, omitting a value is the same as + specifying 1 and negating number_pad is the same as specifying + 0. (Settings 2 and 4 are for compatibility with MSDOS or old + PC Hack; in addition to the different behavior for ‘5’, ‘Alt‐5’ + acts as ‘G’ and ‘Alt‐0’ acts as ‘I’. Setting ‐1 is to accommo‐ + date some German keyboards which have the location of the ‘y’ + and ‘z’ keys swapped.) When moving by numbers, to enter a + count prefix for those commands which accept one (such as + ‘‘12s’’ to search twelve times), precede it with the letter ‘n’ + (‘‘n12s’’). + + packorder + Specify the order to list object types in (default + ‘‘")[%?+!=/(*‘0_’’). The value of this option should be a + string containing the symbols for the various object types. + Any omitted types are filled in at the end from the previous + order. + + paranoid_confirmation + A space separated list of specific situations where alternate + prompting is desired. The default is paranoid_confirma‐ + tion:pray. + Confirm ‐ for any prompts which are set to require "yes" rather - than ’y’, also require "no" to reject instead of ac‐ + than ’y’, also require "no" to reject instead of ac‐ cepting any non‐yes response as no quit ‐ require "yes" rather than ’y’ to confirm quitting the game or switching into non‐scoring explore mode; - die ‐ require "yes" rather than ’y’ to confirm dying (not + die ‐ require "yes" rather than ’y’ to confirm dying (not useful in normal play; applies to explore mode); bones ‐ require "yes" rather than ’y’ to confirm saving bones data when dying in debug mode; - attack ‐ require "yes" rather than ’y’ to confirm attacking a + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 45 + + + + attack ‐ require "yes" rather than ’y’ to confirm attacking a peaceful monster; pray ‐ require ’y’ to confirm an attempt to pray rather than immediately praying; on by default; + wand ‐ require "yes" rather than ’y’ to confirm breaking a + wand; Remove ‐ require selection from inventory for ’R’ and ’T’ com‐ mands even when wearing just one applicable item. @@ -2801,7 +2926,7 @@ perm_invent If true, always display your current inventory in a window. This only makes sense for windowing system interfaces that im‐ - plement this feature. + plement this feature. Persistent. pettype Specify the type of your initial pet, if you are playing a @@ -2816,38 +2941,39 @@ When you pick up an item that would exceed this encumbrance level (Unencumbered, Burdened, streSsed, straiNed, overTaxed, or overLoaded), you will be asked if you want to continue. - (Default ‘S’). + (Default ‘S’). Persistent. pickup_thrown If this option is on and autopickup is also on, try to pick up things that you threw, even if they aren’t in pickup_types or - match an autopickup exception. Default is on. + match an autopickup exception. Default is on. Persistent. pickup_types Specify the object types to be picked up when autopickup is on. Default is all types. You can use autopickup_exception config‐ - uration file lines to further refine autopickup behavior. + uration file lines to further refine autopickup behavior. Per‐ + sistent. pile_limit - When walking across a pile of objects on the floor, threshold + When walking across a pile of objects on the floor, threshold + at which the message "there are few/several/many objects here" + is given instead of showing a popup list of those objects. A + value of 0 means "no limit" (always list the objects); a value + of 1 effectively means "never show the objects" since the pile + size will always be at least that big; default value is 5. + Persistent. - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 - NetHack Guidebook 44 + NetHack Guidebook 46 - at which the message "there are few/several/many objects here" - is given instead of showing a popup list of those objects. A - value of 0 means "no limit" (always list the objects); a value - of 1 effectively means "never show the objects" since the pile - size will always be at least that big; default value is 5. - playmode Values are ‘normal’, ‘explore’, or ‘debug’. Allows selection of explore mode (also known as discovery mode) or debug mode @@ -2862,17 +2988,17 @@ Using the ‘w’ (wield) command when already wielding something pushes the old item into your alternate weapon slot (default off). Likewise for the ‘a’ (apply) command if it causes the - applied item to become wielded. + applied item to become wielded. Persistent. race Selects your race (for example, ‘‘race:human’’). Default is random. If you prefix a ‘!’ or ‘‘no’’ to the value, you can exclude that race from being picked randomly. Cannot be set - with the ‘O’ command. + with the ‘O’ command. Persistent. rest_on_space Make the space bar a synonym for the ‘.’ (rest) command (de‐ - fault off). + fault off). Persistent. role Pick your type of character (ex. ‘‘role:Samurai’’); synonym for @@ -2880,100 +3006,118 @@ fying your role. Normally only the first letter of the value is examined; ‘r’ is an exception with ‘‘Rogue’’, ‘‘Ranger’’, and ‘‘random’’ values. If you prefix a ‘!’ or ‘‘no’’ to the - value, you can exclude that role from being picked randomly. + value, you can exclude that role from being picked randomly. + Persistent. roguesymset - This option may be used to select one of the named symbol sets - found within ‘‘symbols’’ to alter the symbols displayed on the + This option may be used to select one of the named symbol sets + found within ‘‘symbols’’ to alter the symbols displayed on the screen on the rogue level. rlecomp When writing out a save file, perform run length compression of - the map. Not all ports support run length compression. It has + the map. Not all ports support run length compression. It has no effect on reading an existing save file. runmode - Controls the amount of screen updating for the map window when - engaged in multi‐turn movement (running via shift+direction or - control+direction and so forth, or via the travel command or - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 45 - - - + Controls the amount of screen updating for the map window when + engaged in multi‐turn movement (running via shift+direction or + control+direction and so forth, or via the travel command or mouse click). The possible values are: teleport ‐ update the map after movement has finished; run ‐ update the map after every seven or so steps; walk ‐ update the map after each step; + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 47 + + + crawl ‐ like walk, but pause briefly after each step. This option only affects the game’s screen display, not the ac‐ - tual results of moving. The default is ‘run’; versions prior - to 3.4.1 used ‘teleport’ only. Whether or not the effect is + tual results of moving. The default is ‘run’; versions prior + to 3.4.1 used ‘teleport’ only. Whether or not the effect is noticeable will depend upon the window port used or on the type - of terminal. + of terminal. Persistent. safe_pet - Prevent you from (knowingly) attacking your pets (default on). + Prevent you from (knowingly) attacking your pets (default on). + Persistent. scores - Control what parts of the score list you are shown at the end - (ex. ‘‘scores:5 top scores/4 around my score/own scores’’). - Only the first letter of each category (‘t’, ‘a’, or ‘o’) is - necessary. + Control what parts of the score list you are shown at the end + (ex. ‘‘scores:5 top scores/4 around my score/own scores’’). + Only the first letter of each category (‘t’, ‘a’, or ‘o’) is + necessary. Persistent. showexp Show your accumulated experience points on bottom line (default - off). + off). Persistent. showrace - Display yourself as the glyph for your race, rather than the - glyph for your role (default off). Note that this setting af‐ - fects only the appearance of the display, not the way the game - treats you. + Display yourself as the glyph for your race, rather than the + glyph for your role (default off). Note that this setting af‐ + fects only the appearance of the display, not the way the game + treats you. Persistent. showscore Show your approximate accumulated score on bottom line (default - off). + off). Persistent. silent - Suppress terminal beeps (default on). + Suppress terminal beeps (default on). Persistent. + + sortloot + Controls the sorting behavior of the pickup lists for inventory + and #loot commands and some others. Persistent. The possible + values are: + + full ‐ always sort the lists; + loot ‐ only sort the lists that don’t use inventory letters, + like with the #loot and pickup commands; + none ‐ show lists the traditional way without sorting. sortpack Sort the pack contents by type when displaying inventory (de‐ - fault on). + fault on). Persistent. sparkle Display a sparkly effect when a monster (including yourself) is - hit by an attack to which it is resistant (default on). + hit by an attack to which it is resistant (default on). Per‐ + sistent. + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 48 + + standout - Boldface monsters and ‘‘‐‐More‐‐’’ (default off). + Boldface monsters and ‘‘‐‐More‐‐’’ (default off). Persistent. + + statushilites + Enable coloring of status fields (default off). See ‘‘Config‐ + uring Status Hilites’’ for futher information. suppress_alert This option may be set to a NetHack version level to suppress alert notification messages about feature changes for that and prior versions (ex. ‘‘suppress_alert:3.3.1’’). - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 46 - - - symset This option may be used to select one of the named symbol sets found within ‘‘symbols’’ to alter the symbols displayed on the @@ -2981,38 +3125,53 @@ time Show the elapsed game time in turns on bottom line (default - off). + off). Persistent. timed_delay When pausing momentarily for display effect, such as with ex‐ plosions and moving objects, use a timer rather than sending extra characters to the screen. (Applies to ‘‘tty’’ interface only; ‘‘X11’’ interface always uses a timer based delay. The - default is on if configured into the program.) + default is on if configured into the program.) Persistent. tombstone - Draw a tombstone graphic upon your death (default on). + Draw a tombstone graphic upon your death (default on). Persis‐ + tent. toptenwin Put the ending display in a NetHack window instead of on stdout - (default off). Setting this option makes the score list visi‐ - ble when a windowing version of NetHack is started without a - parent window, but it no longer leaves the score list around + (default off). Setting this option makes the score list visi‐ + ble when a windowing version of NetHack is started without a + parent window, but it no longer leaves the score list around after game end on a terminal or emulating window. travel Allow the travel command (default on). Turning this option off - will prevent the game from attempting unintended moves if you - make inadvertent mouse clicks on the map window. + will prevent the game from attempting unintended moves if you + make inadvertent mouse clicks on the map window. Persistent. verbose - Provide more commentary during the game (default on). + Provide more commentary during the game (default on). Persis‐ + tent. windowtype Select which windowing system to use, such as ‘‘tty’’ or ‘‘X11’’ (default depends on version). Cannot be set with the ‘O’ command. + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 49 + + + zerocomp When writing out a save file, perform zero‐comp compression of the contents. Not all ports support zero‐comp compression. It @@ -3027,23 +3186,11 @@ listed here. You can safely add any of these options to your config file, and if the window port is capable of adjusting to suit your preferences, it will attempt to do so. If it can’t it - will silently ignore it. You can find out if an option is - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 47 - - - - supported by the window port that you are currently using by - checking to see if it shows up in the Options list. Some options - are dynamic and can be specified during the game with the ‘O’ - command. + will silently ignore it. You can find out if an option is sup‐ + ported by the window port that you are currently using by check‐ + ing to see if it shows up in the Options list. Some options are + dynamic and can be specified during the game with the ‘O’ com‐ + mand. align_message Where to align or place the message window (top, bottom, left, @@ -3070,18 +3217,29 @@ dow. font_menu - NetHack should use a font by the chosen name for menu windows. + NetHack should use a font by the chosen name for menu windows. font_message - NetHack should use a font by the chosen name for the message + NetHack should use a font by the chosen name for the message window. font_status - NetHack should use a font by the chosen name for the status + NetHack should use a font by the chosen name for the status window. + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 50 + + + font_text - NetHack should use a font by the chosen name for text windows. + NetHack should use a font by the chosen name for text windows. font_size_map NetHack should use this size font for the map window. @@ -3095,17 +3253,6 @@ font_size_status NetHack should use this size font for the status window. - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 48 - - - font_size_text NetHack should use this size font for text windows. @@ -3113,13 +3260,6 @@ NetHack should try and display on the entire screen rather than in a window. - hilite_pet - Visually distinguish pets from similar animals (default off). - The behavior of this option depends on the type of windowing - you use. In text windowing, text highlighting or inverse video - is often used; with tiles, generally displays a heart symbol - near pets. - large_font NetHack should use a large font. @@ -3151,6 +3291,19 @@ NetHack should scroll the display when the hero or cursor is this number of cells away from the edge of the window. + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 51 + + + selectsaved NetHack should display a menu of existing saved games for the player to choose from at game startup, if it can. Not all ports @@ -3160,18 +3313,6 @@ Display an onscreen keyboard. Handhelds are most likely to support this option. - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 49 - - - splash_screen NetHack should display an opening splash screen when it starts up (default yes). @@ -3190,6 +3331,9 @@ tile_width Specify the preferred width of each tile in a tile capable port + use_darkgray + Use bold black instead of blue for black glyphs (TTY only). + use_inverse NetHack should display inverse when the game specifies it. @@ -3198,22 +3342,34 @@ message window. windowcolors - NetHack should display windows with the specified fore‐ + NetHack should display windows with the specified fore‐ ground/background colors if it can. wraptext - NetHack port should wrap long lines of text if they don’t fit + NetHack port should wrap long lines of text if they don’t fit in the visible area of the window. 9.6. Platform‐specific Customization options - Here are explanations of options that are used by specific + Here are explanations of options that are used by specific platforms or ports to customize and change the port behavior. altkeyhandler - Select an alternate keystroke handler dll to load (Win32 tty - NetHack only). The name of the handler is specified without + Select an alternate keystroke handler dll to load (Win32 tty + NetHack only). The name of the handler is specified without the .dll extension and without any path information. Cannot be + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 52 + + + set with the ‘O’ command. altmeta @@ -3222,35 +3378,23 @@ altmeta On other (non‐Amiga) systems where this option is available, it - can be set to tell nethack to convert a two character sequence - beginning with ESC into a meta‐shifted version of the second + can be set to tell nethack to convert a two character sequence + beginning with ESC into a meta‐shifted version of the second character (default off). - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 50 - - - - This conversion is only done for commands, not for other input + This conversion is only done for commands, not for other input prompts. Note that typing one or more digits as a count prefix - prior to a command‐‐preceded by n if the number_pad option is + prior to a command‐‐preceded by n if the number_pad option is set‐‐is also subject to this conversion, so attempting to abort - the count by typing ESC will leave nethack waiting for another - character to complete the two character sequence. Type a sec‐ - ond ESC to finish cancelling such a count. At other prompts a + the count by typing ESC will leave nethack waiting for another + character to complete the two character sequence. Type a sec‐ + ond ESC to finish cancelling such a count. At other prompts a single ESC suffices. BIOS Use BIOS calls to update the screen display quickly and to read - the keyboard (allowing the use of arrow keys to move) on ma‐ - chines with an IBM PC compatible BIOS ROM (default off, OS/2, + the keyboard (allowing the use of arrow keys to move) on ma‐ + chines with an IBM PC compatible BIOS ROM (default off, OS/2, PC, and ST NetHack only). flush @@ -3263,10 +3407,10 @@ (default on, Mac NetHack only). rawio - Force raw (non‐cbreak) mode for faster output and more bullet‐ - proof input (MS‐DOS sometimes treats ‘^P’ as a printer toggle - without it) (default off, OS/2, PC, and ST NetHack only). - Note: DEC Rainbows hang if this is turned on. Cannot be set + Force raw (non‐cbreak) mode for faster output and more bullet‐ + proof input (MS‐DOS sometimes treats ‘^P’ as a printer toggle + without it) (default off, OS/2, PC, and ST NetHack only). + Note: DEC Rainbows hang if this is turned on. Cannot be set with the ‘O’ command. soundcard @@ -3274,48 +3418,57 @@ mand. subkeyvalue - (Win32 tty NetHack only). May be used to alter the value of + (Win32 tty NetHack only). May be used to alter the value of keystrokes that the operating system returns to NetHack to help - compensate for international keyboard issues. OPTIONS=subkey‐ - value:171/92 will return 92 to NetHack, if 171 was originally - going to be returned. You can use multiple subkeyvalue state‐ + compensate for international keyboard issues. OPTIONS=subkey‐ + value:171/92 will return 92 to NetHack, if 171 was originally + going to be returned. You can use multiple subkeyvalue state‐ ments in the config file if needed. Cannot be set with the ‘O’ + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 53 + + + command. video Set the video mode used (PC NetHack only). Values are ‘autode‐ - tect’, ‘default’, or ‘vga’. Setting ‘vga’ (or ‘autodetect’ - with vga hardware present) will cause the game to display + tect’, ‘default’, or ‘vga’. Setting ‘vga’ (or ‘autodetect’ + with vga hardware present) will cause the game to display tiles. Cannot be set with the ‘O’ command. videocolors - Set the color palette for PC systems using NO_TERMS (default - 4‐2‐6‐1‐5‐3‐15‐12‐10‐14‐9‐13‐11, (PC NetHack only). The order - of colors is red, green, brown, blue, magenta, cyan, - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 51 - - - - bright.white, bright.red, bright.green, yellow, bright.blue, - bright.magenta, and bright.cyan. Cannot be set with the ‘O’ + Set the color palette for PC systems using NO_TERMS (default + 4‐2‐6‐1‐5‐3‐15‐12‐10‐14‐9‐13‐11, (PC NetHack only). The order + of colors is red, green, brown, blue, magenta, cyan, + bright.white, bright.red, bright.green, yellow, bright.blue, + bright.magenta, and bright.cyan. Cannot be set with the ‘O’ command. videoshades Set the intensity level of the three gray scales available (de‐ fault dark normal light, PC NetHack only). If the game display - is difficult to read, try adjusting these scales; if this does - not correct the problem, try !color. Cannot be set with the + is difficult to read, try adjusting these scales; if this does + not correct the problem, try !color. Cannot be set with the ‘O’ command. - 9.7. Configuring autopickup exceptions + 9.7. Regular Expressions + + Regular expressions are normally POSIX extended regular ex‐ + pressions. It is possible to compile NetHack without regular ex‐ + pression support on a platform where there is no regular expres‐ + sion library. While this is not true of any modern platform, if + your NetHack was built this way, patterns are instead glob pat‐ + terns. + + 9.8. Configuring Autopickup Exceptions You can further refine the behavior of the autopickup option beyond what is available through the pickup_types option. @@ -3326,14 +3479,9 @@ autopickup_exception Sets an exception to the pickup_types option. The autopick‐ - up_exception option should be followed by a string of 1‐80 - characters to be used as a pattern to match against the singu‐ - lar form of the description of an object at your location. - - You may use the following special characters in a pattern: - - * ‐ matches zero or more characters; - ? ‐ matches any single character. + up_exception option should be followed by a regular expression + to be used as a pattern to match against the singular form of + the description of an object at your location. In addition, some characters are treated specially if they oc‐ cur as the first character in the pattern, specifically: @@ -3342,6 +3490,18 @@ > ‐ never pickup an object that matches rest of pattern. A ‘never pickup’ rule takes precedence over an ‘always pickup’ + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 54 + + + rule if both match. Exceptions can be set with the ‘O’ command, but ones set that @@ -3358,19 +3518,98 @@ any corpse from autopickup. The last example results in the ex‐ clusion of items known to be cursed from autopickup. + 9.9. Configuring Message Types + + You can change the way the messages are shown in the message + area, when the message matches a user‐defined pattern. + + In general, the config file entries to configure the message + types look like this: MSGTYPE=type "pattern" + + type ‐ how the message should be shown; + pattern ‐ the pattern to match. + + The pattern should be a regular expression. + + Allowed types are: + + show ‐ show message normally. + hide ‐ never show the message. + stop ‐ wait for user with more‐prompt. + norep ‐ show the message once, but not again if no other message is shown in between. + + Here’s an example of message types using NetHack’s internal + pattern matching facility: + + MSGTYPE=stop "You feel hungry." + MSGTYPE=hide "You displaced *." + + specifies that whenever a message "You feel hungry" is shown, + the user is prompted with more‐prompt, and a message matching + "You displaced ." is not shown at all. + + The order of the defined MSGTYPE‐lines is important; the last + matching rule is used. Put the general case first, exceptions + below them. + + 9.10. Configuring Menu Colors + + Some platforms allow you to define colors used in menu lines + when the line matches a user‐defined pattern. At this time the - NetHack 3.6 March 27, 2015 + NetHack 3.6 June 22, 2015 - NetHack Guidebook 52 + NetHack Guidebook 55 - 9.8. Configuring User Sounds + tty, win32tty and win32gui support this. + + In general, the config file entries to configure the menu + color mappings look like this: + + MENUCOLOR="pattern"=color&attribute + + pattern ‐ the pattern to match; + color ‐ the color to use for lines matching the pat‐ + tern; + attribute ‐ the attribute to use for lines matching the + pattern. The attribute is optional, and if + left out, you must also leave out the preced‐ + ing ampersand. If no attribute is defined, + no attribute is used. + + The pattern should be a regular expression. + + Allowed colors are black, red, green, brown, blue, magenta, + cyan, gray, orange, lightgreen, yellow, lightblue, lightmagen‐ + ta, lightcyan, and white. + + Allowed attributes are none, bold, dim, underline, blink, and + inverse. Note that the platform used may interpret the at‐ + tributes any way it wants. + + Here’s an example of menu colors using NetHack’s internal pat‐ + tern matching facility: + + MENUCOLOR="* blessed *"=green + MENUCOLOR="* cursed *"=red + MENUCOLOR="* cursed *(being worn)"=red&underline + + specifies that any menu line with " blessed " contained in it + will be shown in green color, lines with " cursed " will be + shown in red, and lines with " cursed " followed by "(being + worn)" on the same line will be shown in red color and under‐ + lined. You can have multiple MENUCOLOR entries in your config + file, and the last MENUCOLOR‐line in your config file that + matches a menu line will be used for the line. + + 9.11. Configuring User Sounds Some platforms allow you to define sound files to be played when a message that matches a user‐defined pattern is delivered @@ -3383,59 +3622,91 @@ SOUNDDIR The directory that houses the sound files to be played. + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 56 + + + SOUND An entry that maps a sound file to a user‐specified message pattern. Each SOUND entry is broken down into the following parts: MESG ‐ message window mapping (the only one supported in - 3.5); + 3.6); pattern ‐ the pattern to match; sound file ‐ the sound file to play; volume ‐ the volume to be set while playing the sound file. - The exact format for the pattern depends on whether the plat‐ - form is built to use ‘‘regular expressions’’ or NetHack’s own - internal pattern matching facility. The ‘‘regular expressions’’ - matching can be much more sophisticated than the internal - NetHack pattern matching, but requires 3rd party libraries on - some platforms. There are plenty of references available else‐ - where for explaining ‘‘regular expressions’’. You can verify - which pattern matching is used by your port with the #version - command. + The pattern should be a POSIX extended regular expression. - NetHack’s internal pattern matching routine uses the following - special characters in its pattern matching: + 9.12. Configuring Status Hilites - * ‐ matches 0 or more characters; - ? ‐ matches any single character. + Your copy of NetHack may have been compiled with support for + ‘‘Status Hilites’’. If so, you can customize your game display + by setting thresholds to change the color or appearance of fields + in the status display. - Here’s an example of a sound mapping using NetHack’s internal - pattern matching facility: + For example, the following line in your config file will + cause the hitpoints field to display in the color red if your + hitpoints drop to or below a threshold of 30%: - SOUND=MESG "*chime of a cash register*" "gong.wav" 50 + OPTION=hilite_status: hitpoints/30%/red/normal - specifies that any message with "chime of a cash register" con‐ - tained in it will trigger the playing of file gong.wav. You - can have multiple SOUND entries in your config file. + For another example, the following line in your config file + will cause wisdom to be displayed red if it drops and green if it + rises. - 9.9. Modifying NetHack Symbols + OPTION=hilite_status: wisdom/updown/red/green + + You can adjust the display of the following status fields: + title strength dexterity + constitution intelligence wisdom + charisma alignment score + carrying‐capacity gold power + power‐max experience‐level armor‐class + HD time hunger + hitpoints hitpoints‐max dungeon‐level + experience condition + + Allowed colors are black, red, green, brown, blue, magenta, + cyan, gray, orange, lightgreen, yellow, lightblue, lightmagen‐ + ta, lightcyan, and white. + + Allowed attributes are bold, inverse, normal. Note that the + platform used may interpret the attributes any way it wants. + + Behaviours can occur based on percentage thresholds, updown, or + absolute values. The in‐game options menu can help you deter‐ + mine the correct syntax for a config file. + + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 57 + + + + The whole feature can be disabled by setting option sta‐ + tushilites off. + + 9.13. Modifying NetHack Symbols NetHack can load entire symbol sets from the symbol file. - - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 53 - - - The options that are used to select a particular symbol set from the symbol file are: @@ -3482,6 +3753,19 @@ _ S_chain (iron chain) # S_cloud (cloud) c S_cockatrice (cockatrice) + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 58 + + + $ S_coin (pile of coins) # S_corr (corridor) ‐ S_crwall (wall) @@ -3489,19 +3773,6 @@ & S_demon (major demon) * S_digbeam (dig beam) > S_dnladder (ladder down) - - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 54 - - - > S_dnstair (staircase down) d S_dog (dog or other canine) D S_dragon (dragon) @@ -3548,6 +3819,19 @@ } S_lava (molten lava) l S_leprechaun (leprechaun) ^ S_level_teleporter (level teleporter) + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 59 + + + L S_lich (lich) y S_light (light) # S_litcorr (lit corridor) @@ -3555,19 +3839,6 @@ ‘\’ S_lslant (wall) ^ S_magic_portal (magic portal) ^ S_magic_trap (magic trap) - - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 55 - - - m S_mimic (mimic) ] S_mimic_def (mimic) M S_mummy (mummy) @@ -3577,6 +3848,7 @@ o S_orc (orc) p S_piercer (piercer) ^ S_pit (pit) + # S_poisoncloud (poison cloud) ^ S_polymorph_trap (polymorph trap) } S_pool (water) ! S_potion (potion) @@ -3613,6 +3885,19 @@ ‘\’ S_sw_tr (swallow top right) ‐ S_tdwall (wall) ^ S_teleportation_trap (teleportation trap) + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 60 + + + S_throne (opulent throne) ‐ S_tlcorn (top left corner) | S_tlwall (wall) @@ -3621,19 +3906,6 @@ t S_trapper (trapper or lurker above) ‐ S_trcorn (top right corner) # S_tree (tree) - - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 56 - - - T S_troll (troll) | S_trwall (wall) ‐ S_tuwall (wall) @@ -3645,6 +3917,7 @@ | S_vbeam (wall) # S_vcdbridge (vertical raised drawbridge) + S_vcdoor (closed door) + ^ S_vibrating_square (vibrating square) ‐ S_vodoor (open door) v S_vortex (vortex) | S_vwall (vertical wall) @@ -3661,7 +3934,7 @@ Z S_zombie (zombie) z S_zruty (zruty) - 9.10. Configuring NetHack for Play by the Blind + 9.14. Configuring NetHack for Play by the Blind NetHack can be set up to use only standard ASCII characters for making maps of the dungeons. This makes the MS‐DOS versions @@ -3679,6 +3952,18 @@ Your screen‐reader should also have a function which gives you the row and column of your review cursor and the PC cursor. These co‐ordinates are often useful in giving players a better + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 61 + + + sense of the overall location of items on the screen. While it is not difficult for experienced users to edit the @@ -3688,18 +3973,6 @@ Selecting that symset in your configuration file will cause the game to run in a manner accessible to the blind. After you have gained some experience with the game and with editing files, you - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 57 - - - may want to alter settings via SYMBOLS= in your configuration file to better suit your preferences. The most crucial settings to make the game accessible are: @@ -3719,7 +3992,7 @@ the screen. If this is the case, disable the number_pad option and use the traditional Rogue‐like commands. - 9.11. Global Configuration for System Administrators + 9.15. Global Configuration for System Administrators If NetHack is compiled with the SYSCF option, a system ad‐ ministrator should set up a global configuration; this is a file @@ -3738,34 +4011,41 @@ SHELLERS A list of users who are allowed to use the shell es‐ cape command (!). The syntax is the same as WIZARDS. - MAXPLAYERS Limit the maximum number of games that can be run‐ + EXPLORERS A list of users who are allowed to use the explore + mode. The syntax is the same as WIZARDS. + + MAXPLAYERS Limit the maximum number of games that can be run‐ ning at the same time. - SUPPORT A string explaining how to get local support (no de‐ + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 62 + + + + SUPPORT A string explaining how to get local support (no de‐ fault value). - RECOVER A string explaining how to recover a game on this sys‐ + RECOVER A string explaining how to recover a game on this sys‐ tem (no default value). - SEDUCE 0 or 1 to disable or enable, respectively, the SEDUCE + SEDUCE 0 or 1 to disable or enable, respectively, the SEDUCE option (see the source for details on this function). + CHECK_SAVE_UID 0 or 1 to disable or enable, respectively, the + UID checking for savefiles. + The following options affect the score file: PERSMAX Maximum number of entries for one person. - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 58 - - - ENTRYMAX Maximum number of entries in the score file. POINTSMIN Minimum number of points to get an entry in the score @@ -3802,6 +4082,20 @@ list is, you can type nethack ‐s all on most versions. + + + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 63 + + + 11. Explore mode NetHack is an intricate and difficult game. Novices might @@ -3820,18 +4114,6 @@ other benefits of explore mode are left for the trepid reader to discover. - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 59 - - - 11.1. Debug mode Debug mode, also known as wizard mode, is undocumented aside @@ -3868,6 +4150,18 @@ Jay Fenlason wrote the original Hack, with help from Kenny Woodland, Mike Thome and Jon Payne. + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 64 + + + Andries Brouwer did a major re‐write, transforming Hack into a very different game, and published (at least) three versions (1.0.1, 1.0.2, and 1.0.3) for UNIX machines to the Usenet. @@ -3883,334 +4177,324 @@ Mike Stephenson merged these various versions back together, incorporating many of the added features, and produced NetHack 1.4. He then coordinated a cast of thousands in enhancing and - debugging NetHack 1.4 and released NetHack versions 2.2 and 2.3. - - - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 60 - - + debugging NetHack 1.4 and released NetHack versions 2.2 and 2.3. Later, Mike coordinated a major rewrite of the game, heading a team which included Ken Arromdee, Jean‐Christophe Collet, Steve Creps, Eric Hendrickson, Izchak Miller, John Rupley, Mike Threep‐ oint, and Janet Walz, to produce NetHack 3.0c. - NetHack 3.0 was ported to the Atari by Eric R. Smith, to - OS/2 by Timo Hakulinen, and to VMS by David Gentzel. The three + NetHack 3.0 was ported to the Atari by Eric R. Smith, to + OS/2 by Timo Hakulinen, and to VMS by David Gentzel. The three of them and Kevin Darcy later joined the main development team to produce subsequent revisions of 3.0. - Olaf Seibert ported NetHack 2.3 and 3.0 to the Amiga. Norm - Meluch, Stephen Spackman and Pierre Martineau designed overlay - code for PC NetHack 3.0. Johnny Lee ported NetHack 3.0 to the - Macintosh. Along with various other Dungeoneers, they continued - to enhance the PC, Macintosh, and Amiga ports through the later + Olaf Seibert ported NetHack 2.3 and 3.0 to the Amiga. Norm + Meluch, Stephen Spackman and Pierre Martineau designed overlay + code for PC NetHack 3.0. Johnny Lee ported NetHack 3.0 to the + Macintosh. Along with various other Dungeoneers, they continued + to enhance the PC, Macintosh, and Amiga ports through the later revisions of 3.0. - Headed by Mike Stephenson and coordinated by Izchak Miller - and Janet Walz, the development team which now included Ken Ar‐ - romdee, David Cohrs, Jean‐Christophe Collet, Kevin Darcy, Matt - Day, Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric - Raymond, and Eric Smith undertook a radical revision of 3.0. + Headed by Mike Stephenson and coordinated by Izchak Miller + and Janet Walz, the development team which now included Ken Ar‐ + romdee, David Cohrs, Jean‐Christophe Collet, Kevin Darcy, Matt + Day, Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric + Raymond, and Eric Smith undertook a radical revision of 3.0. They re‐structured the game’s design, and re‐wrote major parts of - the code. They added multiple dungeons, a new display, special - individual character quests, a new endgame and many other new + the code. They added multiple dungeons, a new display, special + individual character quests, a new endgame and many other new features, and produced NetHack 3.1. - Ken Lorber, Gregg Wonderly and Greg Olson, with help from - Richard Addison, Mike Passaretti, and Olaf Seibert, developed + Ken Lorber, Gregg Wonderly and Greg Olson, with help from + Richard Addison, Mike Passaretti, and Olaf Seibert, developed NetHack 3.1 for the Amiga. - Norm Meluch and Kevin Smolkowski, with help from Carl Sche‐ + Norm Meluch and Kevin Smolkowski, with help from Carl Sche‐ lin, Stephen Spackman, Steve VanDevender, and Paul Winner, ported NetHack 3.1 to the PC. Jon W{tte and Hao‐yang Wang, with help from Ross Brown, Mike - Engber, David Hairston, Michael Hamel, Jonathan Handler, Johnny - Lee, Tim Lennan, Rob Menke, and Andy Swanson, developed NetHack + Engber, David Hairston, Michael Hamel, Jonathan Handler, Johnny + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 65 + + + + Lee, Tim Lennan, Rob Menke, and Andy Swanson, developed NetHack 3.1 for the Macintosh, porting it for MPW. Building on their de‐ velopment, Barton House added a Think C port. Timo Hakulinen ported NetHack 3.1 to OS/2. Eric Smith port‐ - ed NetHack 3.1 to the Atari. Pat Rankin, with help from Joshua - Delahunty, was responsible for the VMS version of NetHack 3.1. + ed NetHack 3.1 to the Atari. Pat Rankin, with help from Joshua + Delahunty, was responsible for the VMS version of NetHack 3.1. Michael Allison ported NetHack 3.1 to Windows NT. - Dean Luick, with help from David Cohrs, developed NetHack - 3.1 for X11. Warwick Allison wrote a tiled version of NetHack - for the Atari; he later contributed the tiles to the DevTeam and + Dean Luick, with help from David Cohrs, developed NetHack + 3.1 for X11. Warwick Allison wrote a tiled version of NetHack + for the Atari; he later contributed the tiles to the DevTeam and tile support was then added to other platforms. - The 3.2 development team, comprised of Michael Allison, Ken - Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, - Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 61 - - - - Smith, Mike Stephenson, Janet Walz, and Paul Winner, released + The 3.2 development team, comprised of Michael Allison, Ken + Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, + Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric + Smith, Mike Stephenson, Janet Walz, and Paul Winner, released version 3.2 in April of 1996. Version 3.2 marked the tenth anniversary of the formation of - the development team. In a testament to their dedication to the - game, all thirteen members of the original development team re‐ - mained on the team at the start of work on that release. During - the interval between the release of 3.1.3 and 3.2, one of the - founding members of the development team, Dr. Izchak Miller, was - diagnosed with cancer and passed away. That release of the game + the development team. In a testament to their dedication to the + game, all thirteen members of the original development team re‐ + mained on the team at the start of work on that release. During + the interval between the release of 3.1.3 and 3.2, one of the + founding members of the development team, Dr. Izchak Miller, was + diagnosed with cancer and passed away. That release of the game was dedicated to him by the development and porting teams. During the lifespan of NetHack 3.1 and 3.2, several enthusi‐ - asts of the game added their own modifications to the game and + asts of the game added their own modifications to the game and made these ‘‘variants’’ publicly available: - Tom Proudfoot and Yuval Oren created NetHack++, which was - quickly renamed NetHack‐‐. Working independently, Stephen White - wrote NetHack Plus. Tom Proudfoot later merged NetHack Plus and + Tom Proudfoot and Yuval Oren created NetHack++, which was + quickly renamed NetHack‐‐. Working independently, Stephen White + wrote NetHack Plus. Tom Proudfoot later merged NetHack Plus and his own NetHack‐‐ to produce SLASH. Larry Stewart‐Zerba and War‐ - wick Allison improved the spell casting system with the Wizard - Patch. Warwick Allison also ported NetHack to use the Qt inter‐ + wick Allison improved the spell casting system with the Wizard + Patch. Warwick Allison also ported NetHack to use the Qt inter‐ face. - Warren Cheung combined SLASH with the Wizard Patch to pro‐ - duce Slash’em, and with the help of Kevin Hugo, added more fea‐ - tures. Kevin later joined the DevTeam and incorporated the best + Warren Cheung combined SLASH with the Wizard Patch to pro‐ + duce Slash’em, and with the help of Kevin Hugo, added more fea‐ + tures. Kevin later joined the DevTeam and incorporated the best of these ideas in NetHack 3.3. The final update to 3.2 was the bug fix release 3.2.3, which - was released simultaneously with 3.3.0 in December 1999 just in + was released simultaneously with 3.3.0 in December 1999 just in time for the Year 2000. The 3.3 development team, consisting of Michael Allison, Ken - Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, - Timo Hakulinen, Kevin Hugo, Steve Linhart, Ken Lorber, Dean - Luick, Pat Rankin, Eric Smith, Mike Stephenson, Janet Walz, and - Paul Winner, released 3.3.0 in December 1999 and 3.3.1 in August + Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, + Timo Hakulinen, Kevin Hugo, Steve Linhart, Ken Lorber, Dean + Luick, Pat Rankin, Eric Smith, Mike Stephenson, Janet Walz, and + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 66 + + + + Paul Winner, released 3.3.0 in December 1999 and 3.3.1 in August of 2000. Version 3.3 offered many firsts. It was the first version to - separate race and profession. The Elf class was removed in pref‐ + separate race and profession. The Elf class was removed in pref‐ erence to an elf race, and the races of dwarves, gnomes, and orcs - made their first appearance in the game alongside the familiar - human race. Monk and Ranger roles joined Archeologists, Barbar‐ - ians, Cavemen, Healers, Knights, Priests, Rogues, Samurai, - Tourists, Valkyries and of course, Wizards. It was also the - first version to allow you to ride a steed, and was the first - version to have a publicly available web‐site listing all the - bugs that had been discovered. Despite that constantly growing - bug list, 3.3 proved stable enough to last for more than a year + made their first appearance in the game alongside the familiar + human race. Monk and Ranger roles joined Archeologists, Barbar‐ + ians, Cavemen, Healers, Knights, Priests, Rogues, Samurai, + Tourists, Valkyries and of course, Wizards. It was also the + first version to allow you to ride a steed, and was the first + version to have a publicly available web‐site listing all the + bugs that had been discovered. Despite that constantly growing + bug list, 3.3 proved stable enough to last for more than a year and a half. - - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 62 - - - - The 3.4 development team initially consisted of Michael Al‐ - lison, Ken Arromdee, David Cohrs, Jessie Collet, Kevin Hugo, Ken - Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet Walz, and - Paul Winner, with Warwick Allison joining just before the re‐ + The 3.4 development team initially consisted of Michael Al‐ + lison, Ken Arromdee, David Cohrs, Jessie Collet, Kevin Hugo, Ken + Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet Walz, and + Paul Winner, with Warwick Allison joining just before the re‐ lease of NetHack 3.4.0 in March 2002. - As with version 3.3, various people contributed to the game + As with version 3.3, various people contributed to the game as a whole as well as supporting ports on the different platforms that NetHack runs on: Pat Rankin maintained 3.4 for VMS. - Michael Allison maintained NetHack 3.4 for the MS‐DOS plat‐ + Michael Allison maintained NetHack 3.4 for the MS‐DOS plat‐ form. Paul Winner and Yitzhak Sapir provided encouragement. - Dean Luick, Mark Modrall, and Kevin Hugo maintained and en‐ + Dean Luick, Mark Modrall, and Kevin Hugo maintained and en‐ hanced the Macintosh port of 3.4. - Michael Allison, David Cohrs, Alex Kompel, Dion Nicolaas, - and Yitzhak Sapir maintained and enhanced 3.4 for the Microsoft + Michael Allison, David Cohrs, Alex Kompel, Dion Nicolaas, + and Yitzhak Sapir maintained and enhanced 3.4 for the Microsoft Windows platform. Alex Kompel contributed a new graphical inter‐ - face for the Windows port. Alex Kompel also contributed a Win‐ + face for the Windows port. Alex Kompel also contributed a Win‐ dows CE port for 3.4.1. Ron Van Iwaarden was the sole maintainer of NetHack for OS/2 - the past several releases. Unfortunately Ron’s last OS/2 machine - stopped working in early 2006. A great many thanks to Ron for + the past several releases. Unfortunately Ron’s last OS/2 machine + stopped working in early 2006. A great many thanks to Ron for keeping NetHack alive on OS/2 all these years. - Janne Salmijarvi and Teemu Suikki maintained and enhanced - the Amiga port of 3.4 after Janne Salmijarvi resurrected it for + Janne Salmijarvi and Teemu Suikki maintained and enhanced + the Amiga port of 3.4 after Janne Salmijarvi resurrected it for 3.3.1. - Christian ‘‘Marvin’’ Bressler maintained 3.4 for the Atari + Christian ‘‘Marvin’’ Bressler maintained 3.4 for the Atari after he resurrected it for 3.3.1. The release of NetHack 3.4.3 in December 2003 marked the be‐ ginning of a long release hiatus. 3.4.3 proved to be a remarkably + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 67 + + + stable version that provided continued enjoyment by the community - for more than a decade. The devteam slowly and quietly continued + for more than a decade. The devteam slowly and quietly continued to work on the game behind the scenes during the tenure of 3.4.3. - It was during that same period that several new variants emerged - within the NetHack community. Notably sporkhack by Derek S. Ray, - unnethack by Patric Mueller, nitrohack and its successors origi‐ - nally by Daniel Thaler and then by Alex Smith, and Dynahack by - Tung Nguyen. Some of those variants continue to be developed, + It was during that same period that several new variants emerged + within the NetHack community. Notably sporkhack by Derek S. Ray, + unnethack by Patric Mueller, nitrohack and its successors origi‐ + nally by Daniel Thaler and then by Alex Smith, and Dynahack by + Tung Nguyen. Some of those variants continue to be developed, maintained, and enjoyed by the community to this day. + At the beginning of development for what would eventually + get released as 3.6.0, the development team consisted of Warwick + Allison, Michael Allison, Ken Arromdee, David Cohrs, Jessie Col‐ + let, Ken Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet + Walz, and Paul Winner. Leading up to the release of 3.6.0 in + early 2015, new members Sean Hunt, Pasi Kallinen, and Derek S. + Ray joined the NetHack development team. + In September 2014, an interim snapshot of the code under de‐ velopment was released publicly by other parties. Since that code - was a work‐in‐progress and had not gone through a period of de‐ - bugging, it was decided that the version numbers present on that - code snapshot would be retired and never used in an official - NetHack release. An announcement was posted on the devteam’s + was a work‐in‐progress and had not gone through the process of + debugging it as a suitable release, it was decided that the ver‐ + sion numbers present on that code snapshot would be retired and + never used in an official NetHack release. An announcement was + posted on the devteam’s official nethack.org website to that ef‐ + fect, stating that there would never be a 3.4.4, 3.5, or 3.5.0 + official release version. - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 63 - - - - official nethack.org website to that effect, stating that there - would never be a 3.4.4, 3.5, or 3.5.0 official release version. - - In January 2015, preparation began for the release of - NetHack 3.6 - - At the beginning of development for what would eventually - get released as 3.6.0, the development team consisted of Warwick - Allison, Michael Allison, Ken Arromdee, David Cohrs, Jessie Col‐ - let, Ken Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet - Walz, and Paul Winner. Leading up to the release of 3.6.0 in - early 2015, new members Sean Hunt, Pasi Kallinen, and Derek S. - Ray joined the NetHack development team, - - 3.6.0 TODO insert apprpriate description of 3.6.0 here + In November 2014, preparation began for the release of + NetHack 3.6. The 3.6 version merges work done by the development + team since the previous release with some of the beloved communi‐ + ty patches. Many bugs were fixed and a large amount of code was + restructured. The development team, as well as Steve VanDevender and Kevin - Smolkowski ensured that NetHack 3.6.0 continued to operate on - various Unix flavors as well as maintaining the X11 interface. + Smolkowski ensured that NetHack 3.6.0 continued to operate on + various Unix flavors and maintained the X11 interface. - Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick main‐ + Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick main‐ tained the port of NetHack 3.6.0 for Mac. - Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, - and David Cohrs maintained the port of NetHack 3.6.0 for Mi‐ - crosoft Windows. - - Jeff Bailey created and maintained a port of NetHack 3.6.0 - for Chrome. - - TODO Alex Kompel maintained a port of NetHack 3.6.0 to Win‐ - dows Phone. - - This version of the game is special in a particular way. - Near the end of the development of 3.6, one of the significant - inspirations for many of the humorous and fun features found in - the game, author Terry Pratchett, passed away. This version of - the game is dedicated to him. + Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, + and Dion Nicolaas maintained the port of NetHack 3.6.0 for Micro‐ + soft Windows. The official NetHack web site is maintained by Ken Lorber at http://www.nethack.org/. SHOUT‐OUTS - The devteam would like to give a special "shout‐out" to - thank the generous people primarily responsible for the public + The devteam would like to give a special "shout‐out" to + thank the generous people primarily responsible for the public NetHack servers available for playing the game at nethack.alt.org and devnull.net. In addition to providing a way for the public to + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 68 + + + play a game of NetHack from almost anywhere, they have hosted an‐ nual NetHack tournaments for many, many years. - On behalf of the NetHack community, thank you very much to + On behalf of the NetHack community, thank you very much to M. Drew Streib, Pasi Kallinen and Robin Bandy. - - - NetHack 3.6 March 27, 2015 - - - - - - NetHack Guidebook 64 - - - ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ - From time to time, some depraved individual out there in - netland sends a particularly intriguing modification to help out - with the game. The Gods of the Dungeon sometimes make note of - the names of the worst of these miscreants in this, the list of + From time to time, some depraved individual out there in + netland sends a particularly intriguing modification to help out + with the game. The Gods of the Dungeon sometimes make note of + the names of the worst of these miscreants in this, the list of Dungeoneers: - Adam Aronow J. Ali Harlow Mike Stephenson - Alex Kompel Janet Walz Norm Meluch - Andreas Dorn Janne Salmijarvi Olaf Seibert - Andy Church Jean‐Christophe Collet Pasi Kallinen - Andy Swanson Jeff Bailey Pat Rankin - Ari Huttunen Jochen Erwied Paul Winner - Barton House John Kallen Pierre Martineau - Benson I. Margulies John Rupley Ralf Brown - Bill Dyer John S. Bien Ray Chason - Boudewijn Waijers Johnny Lee Richard Addison - Bruce Cox Jon W{tte Richard Beigel - Bruce Holloway Jonathan Handler Richard P. Hughey - Bruce Mewborne Joshua Delahunty Rob Menke - Carl Schelin Keizo Yamamoto Robin Bandy - Chris Russo Ken Arnold Robin Johnson - David Cohrs Ken Arromdee Roderick Schertler - David Damerell Ken Lorber Roland McGrath - David Gentzel Ken Washikita Ron Van Iwaarden - David Hairston Kevin Darcy Ronnen Miller - Dean Luick Kevin Hugo Ross Brown - Del Lamb Kevin Sitze Sascha Wostmann - Derek S. Ray Kevin Smolkowski Scott Bigham - Deron Meranda Kevin Sweet Scott R. Turner - Dion Nicolaas Lars Huttar Sean Hunt - Dylan O’Donnell Leon Arnott Stephen Spackman - Eric Backus M. Drew Streib Stephen White - Eric Hendrickson Malcolm Ryan Steve Creps - Eric R. Smith Mark Gooderum Steve Linhart - Eric S. Raymond Mark Modrall Steve VanDevender - Erik Andersen Marvin Bressler Teemu Suikki - Frederick Roeber Matthew Day Tim Lennan - Gil Neiger Merlyn LeRoy Timo Hakulinen - Greg Laskin Michael Allison Tom Almy - Greg Olson Michael Feir Tom West - Gregg Wonderly Michael Hamel Warren Cheung - Hao‐yang Wang Michael Sokolov Warwick Allison - Helge Hafting Mike Engber Yitzhak Sapir - Irina Rempt‐Drijfhout Mike Gallop - Izchak Miller Mike Passaretti + Adam Aronow Janet Walz Nathan Eady + Alex Kompel Janne Salmijarvi Norm Meluch + Andreas Dorn Jean‐Christophe Collet Olaf Seibert + Andy Church Jeff Bailey Pasi Kallinen + Andy Swanson Jochen Erwied Pat Rankin + Ari Huttunen John Kallen Paul Winner + Barton House John Rupley Pierre Martineau + Benson I. Margulies John S. Bien Ralf Brown + Bill Dyer Johnny Lee Ray Chason + Boudewijn Waijers Jon W{tte Richard Addison + Bruce Cox Jonathan Handler Richard Beigel + Bruce Holloway Joshua Delahunty Richard P. Hughey + Bruce Mewborne Keizo Yamamoto Rob Menke + Carl Schelin Ken Arnold Robin Bandy + Chris Russo Ken Arromdee Robin Johnson + David Cohrs Ken Lorber Roderick Schertler + David Damerell Ken Washikita Roland McGrath + David Gentzel Kevin Darcy Ron Van Iwaarden + David Hairston Kevin Hugo Ronnen Miller + Dean Luick Kevin Sitze Ross Brown + Del Lamb Kevin Smolkowski Sascha Wostmann + Derek S. Ray Kevin Sweet Scott Bigham + Deron Meranda Lars Huttar Scott R. Turner + Dion Nicolaas Leon Arnott Sean Hunt + Dylan O’Donnell M. Drew Streib Stephen Spackman + Eric Backus Malcolm Ryan Stefan Thielscher + Eric Hendrickson Mark Gooderum Stephen White + Eric R. Smith Mark Modrall Steve Creps + Eric S. Raymond Marvin Bressler Steve Linhart + Erik Andersen Matthew Day Steve VanDevender + Frederick Roeber Merlyn LeRoy Teemu Suikki + Gil Neiger Michael Allison Tim Lennan + Greg Laskin Michael Feir Timo Hakulinen + Greg Olson Michael Hamel Tom Almy + Gregg Wonderly Michael Sokolov Tom West + Hao‐yang Wang Mike Engber Warren Cheung + Helge Hafting Mike Gallop Warwick Allison + Irina Rempt‐Drijfhout Mike Passaretti Yitzhak Sapir + Izchak Miller Mike Stephenson - Brand and product names are trademarks or registered trademarks + + + NetHack 3.6 June 22, 2015 + + + + + + NetHack Guidebook 69 + + + + J. Ali Harlow Mikko Juola + + Brand and product names are trademarks or registered trademarks of their respective holders. @@ -4218,7 +4502,53 @@ - NetHack 3.6 March 27, 2015 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NetHack 3.6 June 22, 2015 From acc883f122b649d5a83d3ddc5776dc3c4c0afa02 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 16 Nov 2015 11:46:45 +0200 Subject: [PATCH 43/51] Comment typofix --- src/makemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/makemon.c b/src/makemon.c index 89b36dc62..edd0b6be7 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -2089,7 +2089,7 @@ register struct monst *mtmp; } } -/* release monster frome bag of tricks; return number of monsters created */ +/* release monster from bag of tricks; return number of monsters created */ int bagotricks(bag, tipping, seencount) struct obj *bag; From fa8ac8a2cebe25fcd6d9d68b187fecc55713cd09 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 16 Nov 2015 18:55:15 -0800 Subject: [PATCH 44/51] update config.h Some reformatting (replacing tabs with spaces), but mostly updating some of the comments, particularly about SYSCF. Shouldn't GENERIC_USERNAMES be controllable via SYSCF? --- include/config.h | 247 ++++++++++++++++++++++++++--------------------- 1 file changed, 137 insertions(+), 110 deletions(-) diff --git a/include/config.h b/include/config.h index fc389f72d..141a6845a 100644 --- a/include/config.h +++ b/include/config.h @@ -1,17 +1,16 @@ -/* NetHack 3.6 config.h $NHDT-Date: 1433279371 2015/06/02 21:09:31 $ $NHDT-Branch: status_hilite $:$NHDT-Revision: 1.89 $ */ +/* NetHack 3.6 config.h $NHDT-Date: 1447728911 2015/11/17 02:55:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.91 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ -#ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice \ - */ +#ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */ #define CONFIG_H /* - * Section 1: Operating and window systems selection. - * Select the version of the OS you are using. - * For "UNIX" select BSD, ULTRIX, SYSV, or HPUX in unixconf.h. - * A "VMS" option is not needed since the VMS C-compilers - * provide it (no need to change sec#1, vmsconf.h handles it). + * Section 1: Operating and window systems selection. + * Select the version of the OS you are using. + * For "UNIX" select BSD, ULTRIX, SYSV, or HPUX in unixconf.h. + * A "VMS" option is not needed since the VMS C-compilers + * provide it (no need to change sec#1, vmsconf.h handles it). */ #define UNIX /* delete if no fork(), exec() available */ @@ -53,7 +52,7 @@ * Define the default window system. This should be one that is compiled * into your system (see defines above). Known window systems are: * - * tty, X11, mac, amii, BeOS, Qt, Gem, Gnome + * tty, X11, mac, amii, BeOS, Qt, Gem, Gnome */ /* MAC also means MAC windows */ @@ -136,40 +135,56 @@ #endif /* - * Section 2: Some global parameters and filenames. - * Commenting out WIZARD, LOGFILE, NEWS or PANICLOG removes that - * feature from the game; otherwise set the appropriate wizard - * name. LOGFILE, NEWS and PANICLOG refer to files in the - * playground. + * Section 2: Some global parameters and filenames. * - * If SYSCF is defined, the following configuration info is - * available in a global config space, with the compiled-in - * entries as defaults: - * WIZARDS (a value of * allows anyone to be wizard) - * (this does NOT default to compiled-in value) - * MAXPLAYERS (see MAX_NR_OF_PLAYERS above and nethack.sh) - * SUPPORT (how to get local support)(no default) - * RECOVER (how to recover a game at your site)(no - *default) - * SHELLERS (who can use !, syntax as WIZARDS) - * for the record file (see topten.c): - * PERSMAX (max entries for one person) - * ENTRYMAX (max entries in the record file) - * POINTSMIN (min points to get an entry) - * PERS_IS_UID (0 or 1 - person is name or (numeric) userid) - * SEDUCE (0 or 1 - runtime disable/enable SEDUCE - *option) + * LOGFILE, XLOGFILE, NEWS and PANICLOG refer to files in + * the playground directory. Commenting out LOGFILE, XLOGFILE, + * NEWS or PANICLOG removes that feature from the game. * - * The following options select how the config space is stored: - * SYSCF_FILE in the named file + * Building with debugging features enabled is now unconditional; + * the old WIZARD setting for that has been eliminated. + * If SYSCF is enabled, WIZARD_NAME will be overridden at + * runtime by the SYSCF WIZARDS value. * - * The following options pertain to crash reporting: - * GREPPATH (the path to the system grep(1) utility) - * GDBPATH (the path to the system gdb(1) program) + * SYSCF: (not supported by all ports) + * If SYSCF is defined, the following configuration info is + * available in a global config space, with the compiled-in + * entries as defaults: + * WIZARDS (a space-separated list of usernames of users who + * can run the game in debug mode, aka wizard mode; + * a value of * allows anyone to debug; + * this does NOT default to compiled-in value) + * EXPLORERS (who can use explore mode, aka discover mode) + * SHELLERS (who can use ! to execute a shell subprocess) + * MAXPLAYERS (see MAX_NR_OF_PLAYERS below and nethack.sh) + * SUPPORT (how to get local support) [no default] + * RECOVER (how to recover a game at your site) [no default] + * For the record file (see topten.c): + * PERSMAX (max entries for one person) + * ENTRYMAX (max entries in the record file) + * POINTSMIN (min points to get an entry) + * PERS_IS_UID (0 or 1 - person is name or (numeric) userid) + * Can force incubi/succubi behavior to be toned down to nymph-like: + * SEDUCE (0 or 1 - runtime disable/enable SEDUCE option) + * The following options pertain to crash reporting: + * GREPPATH (the path to the system grep(1) utility) + * GDBPATH (the path to the system gdb(1) program) + * Regular nethack options can also be specified in order to + * provide system-wide default values local to your system: + * OPTIONS (same as in users' .nethackrc or defaults.nh) + * + * In the future there may be other ways to supply SYSCF + * information (Windows registry, Apple resource forks, etc) + * but at present the only supported method is via a text file. + * If the program is built with SYSCF enabled, the file *must* + * exist and be readable, otherwise the game will complain and + * refuse to start. + * SYSCF_FILE: file containing the SYSCF options shown above; + * default is 'sysconf' in nethack's playground. */ #ifndef WIZARD_NAME /* allow for compile-time or Makefile changes */ -#define WIZARD_NAME "wizard" +#define WIZARD_NAME "wizard" /* value is ignored if SYSCF is enabled */ #endif #ifndef SYSCF @@ -184,11 +199,20 @@ #define GREPPATH "/bin/grep" #endif -#define LOGFILE "logfile" /* larger file for debugging purposes */ +/* note: "larger" is in comparison with 'record', the high-scores file + (whose name can be overridden via #define in global.h if desired) */ +#define LOGFILE "logfile" /* larger file for debugging purposes */ #define XLOGFILE "xlogfile" /* even larger logfile */ -#define NEWS "news" /* the file containing the latest hack news */ +#define NEWS "news" /* the file containing the latest hack news */ #define PANICLOG "paniclog" /* log of panic and impossible events */ +/* + * PERSMAX, POINTSMIN, ENTRYMAX, PERS_IS_UID: + * These control the contents of 'record', the high-scores file. + * They used to be located in topten.c rather than config.h, and + * their values can be overridden at runtime (to increase ENTRYMAX, the + * maximum number of scores to keep, for example) if SYSCF is enabled. + */ #ifndef PERSMAX #define PERSMAX 3 /* entries per name/uid per char. allowed */ #endif @@ -207,20 +231,20 @@ #endif /* - * If COMPRESS is defined, it should contain the full path name of your - * 'compress' program. + * If COMPRESS is defined, it should contain the full path name of your + * 'compress' program. * - * If you define COMPRESS, you must also define COMPRESS_EXTENSION - * as the extension your compressor appends to filenames after - * compression. Currently, only UNIX fully implements - * COMPRESS; other ports should be able to uncompress save files a - * la unixmain.c if so inclined. + * If you define COMPRESS, you must also define COMPRESS_EXTENSION + * as the extension your compressor appends to filenames after + * compression. Currently, only UNIX fully implements + * COMPRESS; other ports should be able to uncompress save files a + * la unixmain.c if so inclined. * - * Defining ZLIB_COMP builds in support for zlib compression. If you - * define ZLIB_COMP, you must link with a zlib library. Not all ports - * support ZLIB_COMP. + * Defining ZLIB_COMP builds in support for zlib compression. If you + * define ZLIB_COMP, you must link with a zlib library. Not all ports + * support ZLIB_COMP. * - * COMPRESS and ZLIB_COMP are mutually exclusive. + * COMPRESS and ZLIB_COMP are mutually exclusive. * */ @@ -234,52 +258,52 @@ #endif #ifndef COMPRESS -/* # define ZLIB_COMP */ /* ZLIB for compression */ +/* # define ZLIB_COMP */ /* ZLIB for compression */ #endif /* - * Internal Compression Options + * Internal Compression Options * - * Internal compression options RLECOMP and ZEROCOMP alter the data - * that gets written to the save file by NetHack, in contrast - * to COMPRESS or ZLIB_COMP which compress the entire file after - * the NetHack data is written out. + * Internal compression options RLECOMP and ZEROCOMP alter the data + * that gets written to the save file by NetHack, in contrast + * to COMPRESS or ZLIB_COMP which compress the entire file after + * the NetHack data is written out. * - * Defining RLECOMP builds in support for internal run-length - * compression of level structures. If RLECOMP support is included - * it can be toggled on/off at runtime via the config file option - * rlecomp. + * Defining RLECOMP builds in support for internal run-length + * compression of level structures. If RLECOMP support is included + * it can be toggled on/off at runtime via the config file option + * rlecomp. * - * Defining ZEROCOMP builds in support for internal zero-comp - * compression of data. If ZEROCOMP support is included it can still - * be toggled on/off at runtime via the config file option zerocomp. + * Defining ZEROCOMP builds in support for internal zero-comp + * compression of data. If ZEROCOMP support is included it can still + * be toggled on/off at runtime via the config file option zerocomp. * - * RLECOMP and ZEROCOMP support can be included even if - * COMPRESS or ZLIB_COMP support is included. One reason for doing - * so would be to provide savefile read compatibility with a savefile - * where those options were in effect. With RLECOMP and/or ZEROCOMP - * defined, NetHack can read an rlecomp or zerocomp savefile in, yet - * re-save without them. + * RLECOMP and ZEROCOMP support can be included even if + * COMPRESS or ZLIB_COMP support is included. One reason for doing + * so would be to provide savefile read compatibility with a savefile + * where those options were in effect. With RLECOMP and/or ZEROCOMP + * defined, NetHack can read an rlecomp or zerocomp savefile in, yet + * re-save without them. * - * Using any compression option will create smaller bones/level/save - * files at the cost of additional code and time. + * Using any compression option will create smaller bones/level/save + * files at the cost of additional code and time. */ -/* # define INTERNAL_COMP */ /* defines both ZEROCOMP and RLECOMP */ -/* # define ZEROCOMP */ /* Support ZEROCOMP compression */ -/* # define RLECOMP */ /* Support RLECOMP compression */ +/* # define INTERNAL_COMP */ /* defines both ZEROCOMP and RLECOMP */ +/* # define ZEROCOMP */ /* Support ZEROCOMP compression */ +/* # define RLECOMP */ /* Support RLECOMP compression */ /* - * Data librarian. Defining DLB places most of the support files into - * a tar-like file, thus making a neater installation. See *conf.h - * for detailed configuration. + * Data librarian. Defining DLB places most of the support files into + * a tar-like file, thus making a neater installation. See *conf.h + * for detailed configuration. */ /* #define DLB */ /* not supported on all platforms */ /* - * Defining INSURANCE slows down level changes, but allows games that - * died due to program or system crashes to be resumed from the point - * of the last level change, after running a utility program. + * Defining INSURANCE slows down level changes, but allows games that + * died due to program or system crashes to be resumed from the point + * of the last level change, after running a utility program. */ #define INSURANCE /* allow crashed game recovery */ @@ -299,7 +323,7 @@ /* * Some system administrators are stupid enough to make Hack suid root * or suid daemon, where daemon has other powers besides that of reading or - * writing Hack files. In such cases one should be careful with chdir's + * writing Hack files. In such cases one should be careful with chdir's * since the user might create files in a directory of his choice. * Of course SECURE is meaningful only if HACKDIR is defined. */ @@ -313,15 +337,15 @@ */ #endif /* CHDIR */ -/* If GENERIC_USERNAMES is defined, and the user name is found - * in that list, prompt for username instead. +/* If GENERIC_USERNAMES is defined, and the player's username is found + * in the list, prompt for character name instead of using username. * A public server should probably disable this. */ #define GENERIC_USERNAMES "play player game games nethack nethacker" /* - * Section 3: Definitions that may vary with system type. - * For example, both schar and uchar should be short ints on - * the AT&T 3B2/3B5/etc. family. + * Section 3: Definitions that may vary with system type. + * For example, both schar and uchar should be short ints on + * the AT&T 3B2/3B5/etc. family. */ /* @@ -341,13 +365,11 @@ #include "tradstdc.h" /* - * type schar: small signed integers (8 bits suffice) (eg. TOS) - * - * typedef char schar; - * - * will do when you have signed characters; otherwise use - * - * typedef short int schar; + * type schar: + * small signed integers (8 bits suffice) (eg. TOS) + * typedef char schar; + * will do when you have signed characters; otherwise use + * typedef short int schar; */ #ifdef AZTEC #define schar char @@ -356,14 +378,11 @@ typedef signed char schar; #endif /* - * type uchar: small unsigned integers (8 bits suffice - but 7 bits do not) - * - * typedef unsigned char uchar; - * - * will be satisfactory if you have an "unsigned char" type; - * otherwise use - * - * typedef unsigned short int uchar; + * type uchar: + * small unsigned integers (8 bits suffice - but 7 bits do not) + * typedef unsigned char uchar; + * will be satisfactory if you have an "unsigned char" type; otherwise use + * typedef unsigned short int uchar; */ #ifndef _AIX32 /* identical typedef in system file causes trouble */ typedef unsigned char uchar; @@ -400,7 +419,6 @@ typedef unsigned char uchar; #endif #endif - #if !defined(MAC) #if !defined(NOCLIPPING) #define CLIPPING /* allow smaller screens -- ERS */ @@ -409,7 +427,6 @@ typedef unsigned char uchar; #define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ - /* * Section 4: EXPERIMENTAL STUFF * @@ -418,13 +435,23 @@ typedef unsigned char uchar; * bugs left here. */ -/* #define STATUS_VIA_WINDOWPORT */ /* re-work of the status line updating process */ -/* #define STATUS_HILITES */ /* support hilites of status fields */ -/* #define WINCHAIN*/ /* stacked window systems */ -/* #define SCORE_ON_BOTL */ /* show estimated score on status line */ -#define FREE_ALL_MEMORY /* free all memory at exit */ -/* #define DEBUG_MIGRATING_MONS */ /* add a wizard-mode command to help debug - migrating monsters */ +/* #define STATUS_VIA_WINDOWPORT */ /* re-work of the status line + updating process */ +/* #define STATUS_HILITES */ /* support hilites of status fields */ + +/* #define WINCHAIN */ /* stacked window systems */ + +/* #define DEBUG_MIGRATING_MONS */ /* add a wizard-mode command to help debug + migrating monsters */ + +/* SCORE_ON_BOTL is neither experimental nor inadequately tested, + but doesn't seem to fit in any other section... */ +/* #define SCORE_ON_BOTL */ /* enable the 'showscore' option to + show estimated score on status line */ + +/* FREE_ALL_MEMORY is neither experimental nor inadequately tested, + but it isn't necessary for successful operation of the program */ +#define FREE_ALL_MEMORY /* free all memory at exit */ /* End of Section 4 */ From 1f3253541ad0cc3c8bc7fef187d65aeec318ce16 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 16 Nov 2015 18:57:11 -0800 Subject: [PATCH 45/51] display.h reformatting A couple of macros with comments in the midst of their expansions got badly mangled by the automated reformat and one ended up with a line that was over 150 characters wide. --- include/display.h | 223 +++++++++++++++++++++++----------------------- 1 file changed, 112 insertions(+), 111 deletions(-) diff --git a/include/display.h b/include/display.h index 58c995b4c..fe3c5e62b 100644 --- a/include/display.h +++ b/include/display.h @@ -1,6 +1,6 @@ -/* NetHack 3.6 display.h $NHDT-Date: 1432512777 2015/05/25 00:12:57 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ +/* NetHack 3.6 display.h $NHDT-Date: 1447729027 2015/11/17 02:57:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ */ /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */ -/* and Dave Cohrs, 1990. */ +/* and Dave Cohrs, 1990. */ /* NetHack may be freely redistributed. See license for details. */ #ifndef DISPLAY_H @@ -27,14 +27,16 @@ * Returns true if the hero can sense the given monster. This includes * monsters that are hiding or mimicing other monsters. */ -#define tp_sensemon(mon) \ - (/* The hero can always sense a monster IF: */ \ - (!mindless(mon->data)) && /* 1. the monster has a brain to sense AND */ \ - ((Blind && Blind_telepat) \ - || /* 2a. hero is blind and telepathic OR */ /* 2b. hero is using a \ - telepathy inducing */ /* object and in range */ \ - (Unblind_telepat \ - && (distu(mon->mx, mon->my) <= (BOLT_LIM * BOLT_LIM))))) +#define tp_sensemon(mon) \ + (/* The hero can always sense a monster IF: */ \ + /* 1. the monster has a brain to sense */ \ + (!mindless(mon->data)) \ + /* AND 2a. hero is blind and telepathic */ \ + && ((Blind && Blind_telepat) \ + /* OR 2b. hero is using a telepathy inducing */ \ + /* object and in range */ \ + || (Unblind_telepat \ + && (distu(mon->mx, mon->my) <= (BOLT_LIM * BOLT_LIM))))) #define sensemon(mon) \ (tp_sensemon(mon) || Detect_monsters || MATCH_WARN_OF_MON(mon)) @@ -56,12 +58,11 @@ * vobj_at() returns a pointer to an object that the hero can see there. * Infravision is not taken into account. */ -#define mon_visible(mon) \ - (/* The hero can see the monster */ /* IF the monster */ \ - (!mon->minvis || See_invisible) && /* 1. is not invisible AND */ \ - (!mon->mundetected) && /* 2. not an undetected hider */ \ - (!(mon->mburied || u.uburied)) /* 3. neither you or it is buried */ \ - ) +#define mon_visible(mon) \ + (/* The hero can see the monster IF the monster */ \ + (!mon->minvis || See_invisible) /* 1. is not invisible */ \ + && !mon->mundetected /* AND 2. not an undetected hider */ \ + && !(mon->mburied || u.uburied)) /* AND 3. neither you nor it is buried */ /* * see_with_infrared() @@ -99,7 +100,7 @@ /* knowninvisible(mon) * This one checks to see if you know a monster is both there and invisible. * 1) If you can see the monster and have see invisible, it is assumed the - * monster is transparent, but visible in some manner. (Earlier versions of + * monster is transparent, but visible in some manner. (Earlier versions of * Nethack were really inconsistent on this.) * 2) If you can't see the monster, but can see its location and you have * telepathy that works when you can see, you can tell that there is a @@ -116,7 +117,7 @@ /* * is_safepet(mon) * - * A special case check used in attack() and domove(). Placing the + * A special case check used in attack() and domove(). Placing the * definition here is convenient. */ #define is_safepet(mon) \ @@ -176,13 +177,12 @@ /* * tmp_at() control calls. */ -#define DISP_BEAM (-1) /* Keep all glyphs showing & clean up at end. */ -#define DISP_ALL (-2) /* Like beam, but still displayed if not visible. */ -#define DISP_FLASH (-3) /* Clean up each glyph before displaying new one. */ -#define DISP_ALWAYS (-4) /* Like flash, but still displayed if not visible. \ - */ -#define DISP_CHANGE (-5) /* Change glyph. */ -#define DISP_END (-6) /* Clean up. */ +#define DISP_BEAM (-1) /* Keep all glyphs showing & clean up at end. */ +#define DISP_ALL (-2) /* Like beam, but still displayed if not visible. */ +#define DISP_FLASH (-3) /* Clean up each glyph before displaying new one. */ +#define DISP_ALWAYS (-4) /* Like flash, but still displayed if not visible. */ +#define DISP_CHANGE (-5) /* Change glyph. */ +#define DISP_END (-6) /* Clean up. */ #define DISP_FREEMEM (-7) /* Free all memory during exit only. */ /* Total number of cmap indices in the shield_static[] array. */ @@ -198,17 +198,16 @@ ((u.usteed && mon_visible(u.usteed)) ? ridden_mon_to_glyph(u.usteed) \ : (otherwise_self)) -#define display_self() \ - show_glyph(u.ux, u.uy, \ - maybe_display_usteed( \ - youmonst.m_ap_type == M_AP_NOTHING \ - ? hero_glyph \ - : youmonst.m_ap_type == M_AP_FURNITURE \ - ? cmap_to_glyph(youmonst.mappearance) \ - : youmonst.m_ap_type == M_AP_OBJECT \ - ? objnum_to_glyph(youmonst.mappearance) \ - : /* else M_AP_MONSTER */ \ - monnum_to_glyph(youmonst.mappearance))) +#define display_self() \ + show_glyph(u.ux, u.uy, \ + maybe_display_usteed((youmonst.m_ap_type == M_AP_NOTHING) \ + ? hero_glyph \ + : (youmonst.m_ap_type == M_AP_FURNITURE) \ + ? cmap_to_glyph(youmonst.mappearance) \ + : (youmonst.m_ap_type == M_AP_OBJECT) \ + ? objnum_to_glyph(youmonst.mappearance) \ + /* else M_AP_MONSTER */ \ + : monnum_to_glyph(youmonst.mappearance))) /* * A glyph is an abstraction that represents a _unique_ monster, object, @@ -222,62 +221,61 @@ * * Glyphs are grouped for easy accessibility: * - * monster Represents all the wild (not tame) monsters. Count: NUMMONS. + * monster Represents all the wild (not tame) monsters. Count: NUMMONS. * - * pet Represents all of the tame monsters. Count: NUMMONS + * pet Represents all of the tame monsters. Count: NUMMONS * - * invisible Invisible monster placeholder. Count: 1 + * invisible Invisible monster placeholder. Count: 1 * - * detect Represents all detected monsters. Count: NUMMONS + * detect Represents all detected monsters. Count: NUMMONS * - * corpse One for each monster. Count: NUMMONS + * corpse One for each monster. Count: NUMMONS * - * ridden Represents all monsters being ridden. Count: NUMMONS + * ridden Represents all monsters being ridden. Count: NUMMONS * - * object One for each object. Count: NUM_OBJECTS + * object One for each object. Count: NUM_OBJECTS * - * cmap One for each entry in the character map. The character map - * is the dungeon features and other miscellaneous things. - * Count: MAXPCHARS + * cmap One for each entry in the character map. The character map + * is the dungeon features and other miscellaneous things. + * Count: MAXPCHARS * - * explosions A set of nine for each of the following seven explosion types: + * explosions A set of nine for each of the following seven explosion types: * dark, noxious, muddy, wet, magical, fiery, frosty. * The nine positions represent those surrounding the hero. - * Count: MAXEXPCHARS * EXPL_MAX (EXPL_MAX is defined in hack.h) + * Count: MAXEXPCHARS * EXPL_MAX (EXPL_MAX is defined in hack.h) * - * zap beam A set of four (there are four directions) for each beam type. - * The beam type is shifted over 2 positions and the direction - * is stored in the lower 2 bits. Count: NUM_ZAP << 2 + * zap beam A set of four (there are four directions) for each beam type. + * The beam type is shifted over 2 positions and the direction + * is stored in the lower 2 bits. Count: NUM_ZAP << 2 * - * swallow A set of eight for each monster. The eight positions rep- - * resent those surrounding the hero. The monster number is - * shifted over 3 positions and the swallow position is stored - * in the lower three bits. Count: NUMMONS << 3 + * swallow A set of eight for each monster. The eight positions rep- + * resent those surrounding the hero. The monster number is + * shifted over 3 positions and the swallow position is stored + * in the lower three bits. Count: NUMMONS << 3 * - * warning A set of six representing the different warning levels. + * warning A set of six representing the different warning levels. * * The following are offsets used to convert to and from a glyph. */ #define NUM_ZAP 8 /* number of zap beam types */ -#define GLYPH_MON_OFF 0 -#define GLYPH_PET_OFF (NUMMONS + GLYPH_MON_OFF) -#define GLYPH_INVIS_OFF (NUMMONS + GLYPH_PET_OFF) -#define GLYPH_DETECT_OFF (1 + GLYPH_INVIS_OFF) -#define GLYPH_BODY_OFF (NUMMONS + GLYPH_DETECT_OFF) -#define GLYPH_RIDDEN_OFF (NUMMONS + GLYPH_BODY_OFF) -#define GLYPH_OBJ_OFF (NUMMONS + GLYPH_RIDDEN_OFF) -#define GLYPH_CMAP_OFF (NUM_OBJECTS + GLYPH_OBJ_OFF) +#define GLYPH_MON_OFF 0 +#define GLYPH_PET_OFF (NUMMONS + GLYPH_MON_OFF) +#define GLYPH_INVIS_OFF (NUMMONS + GLYPH_PET_OFF) +#define GLYPH_DETECT_OFF (1 + GLYPH_INVIS_OFF) +#define GLYPH_BODY_OFF (NUMMONS + GLYPH_DETECT_OFF) +#define GLYPH_RIDDEN_OFF (NUMMONS + GLYPH_BODY_OFF) +#define GLYPH_OBJ_OFF (NUMMONS + GLYPH_RIDDEN_OFF) +#define GLYPH_CMAP_OFF (NUM_OBJECTS + GLYPH_OBJ_OFF) #define GLYPH_EXPLODE_OFF ((MAXPCHARS - MAXEXPCHARS) + GLYPH_CMAP_OFF) -#define GLYPH_ZAP_OFF ((MAXEXPCHARS * EXPL_MAX) + GLYPH_EXPLODE_OFF) +#define GLYPH_ZAP_OFF ((MAXEXPCHARS * EXPL_MAX) + GLYPH_EXPLODE_OFF) #define GLYPH_SWALLOW_OFF ((NUM_ZAP << 2) + GLYPH_ZAP_OFF) #define GLYPH_WARNING_OFF ((NUMMONS << 3) + GLYPH_SWALLOW_OFF) -#define GLYPH_STATUE_OFF (WARNCOUNT + GLYPH_WARNING_OFF) -#define MAX_GLYPH (NUMMONS + GLYPH_STATUE_OFF) +#define GLYPH_STATUE_OFF (WARNCOUNT + GLYPH_WARNING_OFF) +#define MAX_GLYPH (NUMMONS + GLYPH_STATUE_OFF) -#define NO_GLYPH MAX_GLYPH - -#define GLYPH_INVISIBLE GLYPH_INVIS_OFF +#define NO_GLYPH MAX_GLYPH +#define GLYPH_INVISIBLE GLYPH_INVIS_OFF #define warning_to_glyph(mwarnlev) ((mwarnlev) + GLYPH_WARNING_OFF) #define mon_to_glyph(mon) \ @@ -289,23 +287,24 @@ #define pet_to_glyph(mon) \ ((int) what_mon(monsndx((mon)->data)) + GLYPH_PET_OFF) -/* This has the unfortunate side effect of needing a global variable */ -/* to store a result. 'otg_temp' is defined and declared in decl.{ch}. */ +/* This has the unfortunate side effect of needing a global variable */ +/* to store a result. 'otg_temp' is defined and declared in decl.{ch}. */ #define random_obj_to_glyph() \ ((otg_temp = random_object()) == CORPSE \ ? random_monster() + GLYPH_BODY_OFF \ : otg_temp + GLYPH_OBJ_OFF) -#define obj_to_glyph(obj) \ - ((obj)->otyp == STATUE \ +#define obj_to_glyph(obj) \ + (((obj)->otyp == STATUE) \ ? statue_to_glyph(obj) \ - : Hallucination ? random_obj_to_glyph() \ - : (obj)->otyp == CORPSE \ - ? (int) (obj)->corpsenm + GLYPH_BODY_OFF \ - : (int) (obj)->otyp + GLYPH_OBJ_OFF) + : Hallucination \ + ? random_obj_to_glyph() \ + : ((obj)->otyp == CORPSE) \ + ? (int) (obj)->corpsenm + GLYPH_BODY_OFF \ + : (int) (obj)->otyp + GLYPH_OBJ_OFF) /* MRKR: Statues now have glyphs corresponding to the monster they */ -/* brepresent and look like monsters when you are hallucinating. */ +/* represent and look like monsters when you are hallucinating. */ #define statue_to_glyph(obj) \ (Hallucination ? random_monster() + GLYPH_MON_OFF \ @@ -313,7 +312,7 @@ #define cmap_to_glyph(cmap_idx) ((int) (cmap_idx) + GLYPH_CMAP_OFF) #define explosion_to_glyph(expltype, idx) \ - ((((expltype) *MAXEXPCHARS) + ((idx) -S_explode1)) + GLYPH_EXPLODE_OFF) + ((((expltype) * MAXEXPCHARS) + ((idx) - S_explode1)) + GLYPH_EXPLODE_OFF) #define trap_to_glyph(trap) \ cmap_to_glyph(trap_to_defsym(what_trap((trap)->ttyp))) @@ -337,43 +336,45 @@ /* * Change the given glyph into it's given type. Note: - * 1) Pets, detected, and ridden monsters are animals and are converted - * to the proper monster number. - * 2) Bodies are all mapped into the generic CORPSE object - * 3) If handed a glyph out of range for the type, these functions - * will return NO_GLYPH (see exception below) - * 4) glyph_to_swallow() does not return a showsyms[] index, but an - * offset from the first swallow symbol. If handed something - * out of range, it will return zero (for lack of anything better - * to return). + * 1) Pets, detected, and ridden monsters are animals and are converted + * to the proper monster number. + * 2) Bodies are all mapped into the generic CORPSE object + * 3) If handed a glyph out of range for the type, these functions + * will return NO_GLYPH (see exception below) + * 4) glyph_to_swallow() does not return a showsyms[] index, but an + * offset from the first swallow symbol. If handed something + * out of range, it will return zero (for lack of anything better + * to return). */ -#define glyph_to_mon(glyph) \ - (glyph_is_normal_monster(glyph) \ - ? ((glyph) -GLYPH_MON_OFF) \ - : glyph_is_pet(glyph) \ - ? ((glyph) -GLYPH_PET_OFF) \ - : glyph_is_detected_monster(glyph) \ - ? ((glyph) -GLYPH_DETECT_OFF) \ - : glyph_is_ridden_monster(glyph) \ - ? ((glyph) -GLYPH_RIDDEN_OFF) \ - : glyph_is_statue(glyph) \ - ? ((glyph) -GLYPH_STATUE_OFF) \ +#define glyph_to_mon(glyph) \ + (glyph_is_normal_monster(glyph) \ + ? ((glyph) - GLYPH_MON_OFF) \ + : glyph_is_pet(glyph) \ + ? ((glyph) - GLYPH_PET_OFF) \ + : glyph_is_detected_monster(glyph) \ + ? ((glyph) - GLYPH_DETECT_OFF) \ + : glyph_is_ridden_monster(glyph) \ + ? ((glyph) - GLYPH_RIDDEN_OFF) \ + : glyph_is_statue(glyph) \ + ? ((glyph) - GLYPH_STATUE_OFF) \ : NO_GLYPH) -#define glyph_to_obj(glyph) \ - (glyph_is_body(glyph) ? CORPSE : glyph_is_statue(glyph) \ - ? STATUE \ - : glyph_is_normal_object(glyph) \ - ? ((glyph) -GLYPH_OBJ_OFF) \ - : NO_GLYPH) -#define glyph_to_trap(glyph) \ - (glyph_is_trap(glyph) ? ((int) defsym_to_trap((glyph) -GLYPH_CMAP_OFF)) \ +#define glyph_to_obj(glyph) \ + (glyph_is_body(glyph) \ + ? CORPSE \ + : glyph_is_statue(glyph) \ + ? STATUE \ + : glyph_is_normal_object(glyph) \ + ? ((glyph) - GLYPH_OBJ_OFF) \ + : NO_GLYPH) +#define glyph_to_trap(glyph) \ + (glyph_is_trap(glyph) ? ((int) defsym_to_trap((glyph) - GLYPH_CMAP_OFF)) \ : NO_GLYPH) #define glyph_to_cmap(glyph) \ - (glyph_is_cmap(glyph) ? ((glyph) -GLYPH_CMAP_OFF) : NO_GLYPH) + (glyph_is_cmap(glyph) ? ((glyph) - GLYPH_CMAP_OFF) : NO_GLYPH) #define glyph_to_swallow(glyph) \ - (glyph_is_swallow(glyph) ? (((glyph) -GLYPH_SWALLOW_OFF) & 0x7) : 0) + (glyph_is_swallow(glyph) ? (((glyph) - GLYPH_SWALLOW_OFF) & 0x7) : 0) #define glyph_to_warning(glyph) \ - (glyph_is_warning(glyph) ? ((glyph) -GLYPH_WARNING_OFF) : NO_GLYPH); + (glyph_is_warning(glyph) ? ((glyph) - GLYPH_WARNING_OFF) : NO_GLYPH); /* * Return true if the given glyph is what we want. Note that bodies are From 2d284b09075d394be2578d75e84fa6a21c71061c Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 17 Nov 2015 02:26:17 -0800 Subject: [PATCH 46/51] include/*.h formatting I tracked down the widest lines, which sometimes occur due to mis-indent of block comments (see tradstdc.h for an example), and fixed those up. For the files affected, I also converted tabs to spaces. --- include/dungeon.h | 31 +++++-------- include/mactty.h | 25 +++++----- include/macwin.h | 5 +- include/objclass.h | 22 ++++----- include/patchlevel.h | 106 +++++++++++++++++++++++-------------------- include/qt_win.h | 5 +- include/tradstdc.h | 52 ++++++++++++--------- include/unixconf.h | 47 +++++++++---------- 8 files changed, 149 insertions(+), 144 deletions(-) diff --git a/include/dungeon.h b/include/dungeon.h index 4daa20dec..23965e6ce 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 dungeon.h $NHDT-Date: 1436065581 2015/07/05 03:06:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.21 $ */ +/* NetHack 3.6 dungeon.h $NHDT-Date: 1447755969 2015/11/17 10:26:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -79,12 +79,10 @@ typedef struct branch { /* branch types */ #define BR_STAIR 0 /* "Regular" connection, 2 staircases. */ -#define BR_NO_END1 1 /* "Regular" connection. However, no stair from */ - /* end1 to end2. There is a stair from end2 */ - /* to end1. */ -#define BR_NO_END2 2 /* "Regular" connection. However, no stair from */ - /* end2 to end1. There is a stair from end1 */ - /* to end2. */ +#define BR_NO_END1 1 /* "Regular" connection. However, no stair from + end1 to end2. There is a stair from end2 to end1. */ +#define BR_NO_END2 2 /* "Regular" connection. However, no stair from + end2 to end1. There is a stair from end1 to end2. */ #define BR_PORTAL 3 /* Connection by magic portals (traps) */ /* A particular dungeon contains num_dunlevs d_levels with dlevel 1.. @@ -153,11 +151,9 @@ struct linfo { #define VISITED 0x01 /* hero has visited this level */ #define FORGOTTEN 0x02 /* hero will forget this level when reached */ #define LFILE_EXISTS 0x04 /* a level file exists for this level */ - /* - * Note: VISITED and LFILE_EXISTS are currently almost always set at the - * same time. However they _mean_ different things. - */ - + /* Note: VISITED and LFILE_EXISTS are currently almost always + * set at the same time. However they _mean_ different things. + */ #ifdef MFLOPPY #define FROMPERM 1 /* for ramdisk use */ #define TOPERM 2 /* for ramdisk use */ @@ -171,18 +167,15 @@ struct linfo { /* types and structures for dungeon map recording * - * It is designed to eliminate the need for an external notes file for some of - * the more mundane dungeon elements. "Where was the last altar I passed?" - * etc... + * It is designed to eliminate the need for an external notes file for some + * mundane dungeon elements. "Where was the last altar I passed?" etc... * Presumably the character can remember this sort of thing even if, months * later in real time picking up an old save game, I can't. * * To be consistent, one can assume that this map is in the player's mind and * has no physical correspondence (eliminating illiteracy/blind/hands/hands - * free - * concerns.) Therefore, this map is not exhaustive nor detailed ("some - * fountains"). - * This makes it also subject to player conditions (amnesia). + * free concerns). Therefore, this map is not exhaustive nor detailed ("some + * fountains"). This makes it also subject to player conditions (amnesia). */ /* Because clearly Nethack needs more ways to specify alignment */ diff --git a/include/mactty.h b/include/mactty.h index ba717c932..733a548ce 100644 --- a/include/mactty.h +++ b/include/mactty.h @@ -1,6 +1,6 @@ -/* NetHack 3.6 mactty.h $NHDT-Date: 1432512775 2015/05/25 00:12:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */ -/* Copyright (c) Jon W{tte 1993. */ -/* NetHack may be freely redistributed. See license for details. */ +/* NetHack 3.6 mactty.h $NHDT-Date: 1447755970 2015/11/17 10:26:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */ +/* Copyright (c) Jon W{tte 1993. */ +/* NetHack may be freely redistributed. See license for details. */ /* * This header is the supported external interface for the "tty" window @@ -72,14 +72,14 @@ #define CHAR_BLANK ((char) 32) #define CHAR_DELETE ((char) 127) -extern char - game_active; /* flag to window rendering routines not to use ppat */ - /* - * If you want some fancy operations that not a normal TTY device normally - * supports, use EXTENDED_SUPPORT. For frames, area erases and area scrolls, - * plus bitmap graphics - RESOLUTION DEPENDENT, be sure to call - * get_tty_metrics and use those limits. - */ +extern char game_active; /* flag to window rendering routines + not to use ppat */ +/* + * If you want some fancy operations that not a normal TTY device normally + * supports, use EXTENDED_SUPPORT. For frames, area erases and area scrolls, + * plus bitmap graphics - RESOLUTION DEPENDENT, be sure to call + * get_tty_metrics and use those limits. + */ #define EXTENDED_SUPPORT 0 /* * if you print a lot of single characters, accumulating each one in a @@ -174,8 +174,7 @@ typedef enum tty_attrib { /* * Use this macro to cast a function pointer to a tty attribute; this will - * help - * portability to systems where a function pointer doesn't fit in a long + * help portability to systems where a function pointer doesn't fit in a long */ #define TA_ATTRIB_FUNC(x) ((long) (x)) diff --git a/include/macwin.h b/include/macwin.h index edeb1e60d..a8a3cd85b 100644 --- a/include/macwin.h +++ b/include/macwin.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 macwin.h $NHDT-Date: 1432512779 2015/05/25 00:12:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */ +/* NetHack 3.6 macwin.h $NHDT-Date: 1447755970 2015/11/17 10:26:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -27,7 +27,8 @@ typedef pascal void (*UserItemProcPtr)(WindowPtr theWindow, short itemNo); typedef UserItemProcPtr UserItemUPP; #define NewUserItemProc(p) (UserItemUPP)(p) -typedef pascal void (*ControlActionProcPtr)(ControlHandle theControl, short partCode); +typedef pascal void (*ControlActionProcPtr)(ControlHandle theControl, + short partCode); typedef ControlActionProcPtr ControlActionUPP; #define NewControlActionProc(p) (ControlActionUPP)(p) diff --git a/include/objclass.h b/include/objclass.h index f2db33c99..6e5e6eaf0 100644 --- a/include/objclass.h +++ b/include/objclass.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 objclass.h $NHDT-Date: 1432512779 2015/05/25 00:12:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ */ +/* NetHack 3.6 objclass.h $NHDT-Date: 1447755971 2015/11/17 10:26:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.15 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -31,8 +31,8 @@ struct objclass { Bitfield(oc_dir, 2); #define NODIR 1 /* for wands/spells: non-directional */ -#define IMMEDIATE 2 /* directional */ -#define RAY 3 /* zap beams */ +#define IMMEDIATE 2 /* directional */ +#define RAY 3 /* zap beams */ #define PIERCE 1 /* for weapons & tools used as weapons */ #define SLASH 2 /* (latter includes iron ball & chain) */ @@ -151,17 +151,17 @@ extern NEARDATA struct objdescr obj_descr[]; #define VENOM_CLASS 17 #define MAXOCLASSES 18 -#define ALLOW_COUNT (MAXOCLASSES + 1) /* Can be used in the object class */ -#define ALL_CLASSES (MAXOCLASSES + 2) /* input to getobj(). */ -#define ALLOW_NONE (MAXOCLASSES + 3) /* */ +#define ALLOW_COUNT (MAXOCLASSES + 1) /* Can be used in the object class */ +#define ALL_CLASSES (MAXOCLASSES + 2) /* input to getobj(). */ +#define ALLOW_NONE (MAXOCLASSES + 3) -#define BURNING_OIL (MAXOCLASSES + 1) /* Can be used as input to explode. */ -#define MON_EXPLODE (MAXOCLASSES + 2) /* Exploding monster (e.g. gas spore) \ - */ +#define BURNING_OIL (MAXOCLASSES + 1) /* Can be used as input to explode. */ +#define MON_EXPLODE (MAXOCLASSES + 2) /* Exploding monster (e.g. gas spore) */ #if 0 /* moved to decl.h so that makedefs.c won't see them */ -extern const struct class_sym def_oc_syms[MAXOCLASSES]; /* default class symbols */ -extern uchar oc_syms[MAXOCLASSES]; /* current class symbols */ +extern const struct class_sym + def_oc_syms[MAXOCLASSES]; /* default class symbols */ +extern uchar oc_syms[MAXOCLASSES]; /* current class symbols */ #endif /* Default definitions of all object-symbols (must match classes above). */ diff --git a/include/patchlevel.h b/include/patchlevel.h index 2beb4bf15..33fc0f606 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 patchlevel.h $NHDT-Date: 1447653420 2015/11/16 05:57:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.111 $ */ +/* NetHack 3.6 patchlevel.h $NHDT-Date: 1447755971 2015/11/17 10:26:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.112 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -25,14 +25,14 @@ * If two or more successive releases have compatible data files, define * this with the version number of the oldest such release so that the * new release will accept old save and bones files. The format is - * 0xMMmmPPeeL + * 0xMMmmPPeeL * 0x = literal prefix "0x", MM = major version, mm = minor version, * PP = patch level, ee = edit level, L = literal suffix "L", * with all four numbers specified as two hexadecimal digits. */ /* #define VERSION_COMPATIBILITY 0x03050000L */ -/*****************************************************************************/ +/****************************************************************************/ /* Version 3.6.x */ /* @@ -40,7 +40,13 @@ * */ -/*****************************************************************************/ +/****************************************************************************/ +/* Version 3.5.x */ + +/* Version 3.5 was never officially released. + */ + +/****************************************************************************/ /* Version 3.4.x */ /* Patch 3, December 7, 2003 @@ -86,11 +92,11 @@ * * Hundreds of general bug fixes including some for sliming, zapping, *conduct, - * and several more for riding + * and several more for riding * Eliminated a few potentially fatal bugs including one for stone-to-flesh, - * trouble-fixing during prayer, riding down stairs while punished, - * polyd player demon summoning, throwing digging tools into shops, and - * a couple from having the vision system enabled at inappropriate times + * trouble-fixing during prayer, riding down stairs while punished, + * polyd player demon summoning, throwing digging tools into shops, and + * a couple from having the vision system enabled at inappropriate times * Corrected some incorrect calculations in final scoring * Enhanced config file processing and alert to duplication of entries * Player selection prompt enhancements for TTY and X11 @@ -109,25 +115,25 @@ /* Version 3.4 */ -/*****************************************************************************/ +/****************************************************************************/ /* Version 3.3.x */ /* Patch 1, August 9, 2000 * Many, many general fixes, including a number for riding, twoweapon, - * and invisible monsters + * and invisible monsters * A security fix for a couple of potentially exploitable buffer overflows - * in previous versions + * in previous versions * Redo Ranger quest * Introduction of differentiation between different causes of blindness * Overhaul of warning * Functionality restored to Amiga (courtesy Janne Salmijarvi) and Atari - * (courtesy Christian "Marvin" Bressler) ports + * (courtesy Christian "Marvin" Bressler) ports * Mac: multiple interface fixes * win32: fixed bug that caused messages to stop displaying after escape * tty: use ANSI color (AF) over standard color (Sf) when given the choice * several ports: offer for player selection only choices consistent with - * those already made by config file/command line (e.g., only offer roles - * that are compatible with specified race) + * those already made by config file/command line (e.g., only offer roles + * that are compatible with specified race) */ /* @@ -150,7 +156,7 @@ /* Version 3.3 */ -/*****************************************************************************/ +/****************************************************************************/ /* Version 3.2.x */ /* Patch 3, December 10, 1999 @@ -171,7 +177,7 @@ * fix the `recover' utility * fix priest/minion name overflow which could cause Astral Plane crashes * avoid crash when hit by own thrown boomerang - * " " " worn blindfold pushed off by applying cursed towel + * " " " worn blindfold pushed off by applying cursed towel * handle returning live Wizard correctly in deep dungeon levels * don't occasionally display unseen areas of new levels during level change * other minor display fixes @@ -184,13 +190,13 @@ * tty: support object class characters for 'I' command in menu mode * Unix: work around several compilation problems * X11: as tty above, plus implement tty-style count handling in menus; - * better window placement support for old window managers + * better window placement support for old window managers */ /* Patch 1, May 28, 1996 * eliminate `#qualifications'; fix weapon proficiency handling for missiles * keep Medusa from continuing to move after she's been killed by reflection - * of her own gaze (fixes relmon panic) + * of her own gaze (fixes relmon panic) * make monsters a little smarter; assorted eating and chatting changes * fix object amnesia for spellbooks; fix Nazgul's sleep gas attack * fix bullwhip usage for case of having recently been in a trap @@ -205,11 +211,11 @@ * DLB: avoid excessive fseek calls (major performance hit for MSDOS) * HPUX: workaround for gcc-2.6.3 bug adversely affecting monster generation * Mac: avoid MW 68K struct copy optimization bug which caused crashes; - * fix dragging of scrollbar; boost partitions to 2MB minimum + * fix dragging of scrollbar; boost partitions to 2MB minimum * MSDOS: wasn't safe to enter endgame for MFLOPPY configuration; - * fix re-entry into game after "!" (shell escape) + chdir + EXIT; - * F3/F4/F5 display interface swapping improvements; - * add support for preloading all tiles in protected mode environment + * fix re-entry into game after "!" (shell escape) + chdir + EXIT; + * F3/F4/F5 display interface swapping improvements; + * add support for preloading all tiles in protected mode environment * TERMINFO: colors were wrong for some systems, such as Linux * X11: display help files properly */ @@ -217,41 +223,41 @@ /* * NetHack 3.2.0, April 11, 1996 * enhancements to the windowing systems including "tiles" or icons to - * visually represent monsters and objects (courtesy Warwick Allison) + * visually represent monsters and objects (courtesy Warwick Allison) * window based menu system introduced for inventory and selection * moving light sources besides the player * improved #untrap (courtesy Helge Hafting) * spellcasting logic changes to balance spellcasting towards magic-using - * classes (courtesy Stephen White) + * classes (courtesy Stephen White) * many, many bug fixes and abuse eliminations */ /* Version 3.2 */ -/*****************************************************************************/ +/****************************************************************************/ /* Version 3.1.x */ /* * Patch 3, July 12, 1993 * further revise Mac windowing and extend to Think C (courtesy - * Barton House) + * Barton House) * fix confusing black/gray/white display on some MSDOS hardware * remove fatal bugs dealing with horns of plenty and VMS bones levels, - * as well as more minor ones + * as well as more minor ones */ /* * Patch 2, June 1, 1993 * add tty windowing to Mac and Amiga ports and revise native windowing * allow direct screen I/O for MS-DOS versions instead of going through - * termcap routines (courtesy Michael Allison and Kevin Smolkowski) + * termcap routines (courtesy Michael Allison and Kevin Smolkowski) * changes for NEC PC-9800 and various termcap.zip fixes by Yamamoto Keizo * SYSV 386 music driver ported to 386BSD (courtesy Andrew Chernov) and - * SCO UNIX (courtesy Andreas Arens) + * SCO UNIX (courtesy Andreas Arens) * enhanced pickup and disclosure options * removed fatal bugs dealing with cursed bags of holding, renaming - * shopkeepers, objects falling through trapdoors on deep levels, - * and kicking embedded objects loose, and many more minor ones + * shopkeepers, objects falling through trapdoors on deep levels, + * and kicking embedded objects loose, and many more minor ones */ /* @@ -266,11 +272,11 @@ * many, many changes and bugfixes -- some of the highlights include: * display rewrite using line-of-sight vision * general window interface, with the ability to use multiple interfaces - * in the same executable + * in the same executable * intelligent monsters * enhanced dungeon mythology * branching dungeons with more special levels, quest dungeons, and - * multi-level endgame + * multi-level endgame * more artifacts and more uses for artifacts * generalization to multiple shops with damage repair * X11 interface @@ -282,7 +288,7 @@ /* Version 3.1 */ -/*****************************************************************************/ +/****************************************************************************/ /* Version 3.0 */ /* @@ -303,8 +309,8 @@ * Patch 8, June 3, 1990 * further debug and refine Macintosh port * refine the overlay manager, rearrange the OVLx breakdown for better - * efficiency, rename the overlay macros, and split off the overlay - * instructions to Install.ovl + * efficiency, rename the overlay macros, and split off the overlay + * instructions to Install.ovl * introduce NEARDATA for better Amiga efficiency * support for more VMS versions (courtesy Joshua Delahunty and Pat Rankin) * more const fixes @@ -315,17 +321,17 @@ /* * Patch 7, February 19, 1990 * refine overlay support to handle portions of .c files through OVLx - * (courtesy above plus Kevin Smolkowski) + * (courtesy above plus Kevin Smolkowski) * update and extend Amiga port and documentation (courtesy Richard Addison, - * Jochen Erwied, Mark Gooderum, Ken Lorber, Greg Olson, Mike Passaretti, - * and Gregg Wonderly) + * Jochen Erwied, Mark Gooderum, Ken Lorber, Greg Olson, Mike Passaretti, + * and Gregg Wonderly) * refine and extend Macintosh port and documentation (courtesy Johnny Lee, - * Kevin Sitze, Michael Sokolov, Andy Swanson, Jon Watte, and Tom West) + * Kevin Sitze, Michael Sokolov, Andy Swanson, Jon Watte, and Tom West) * refine VMS documentation * continuing ANSIfication, this time of const usage * teach '/' about differences within monster classes * smarter eating code (yet again), death messages, and treatment of - * non-animal monsters, monster unconsciousness, and naming + * non-animal monsters, monster unconsciousness, and naming * extended version command to give compilation options * and the usual bug fixes and hole plugs */ @@ -333,14 +339,14 @@ /* * Patch 6, November 19, 1989 * add overlay support for MS-DOS (courtesy Pierre Martineau, Stephen - * Spackman, and Norm Meluch) + * Spackman, and Norm Meluch) * refine Macintosh port * different door states show as different symbols (courtesy Ari Huttunen) * smarter drawbridges (courtesy Kevin Darcy) * add CLIPPING and split INFERNO off HARD * further refine eating code wrt picking up and resumption * make first few levels easier, by adding :x monsters and increasing initial - * attribute points and hitting probability + * attribute points and hitting probability * teach '/' about configurable symbols */ @@ -358,9 +364,9 @@ * Patch 4, September 27, 1989 * add support for VMS (courtesy David Gentzel) * move monster-on-floor references into functions and implement the new - * lookup structure for both objects and monsters + * lookup structure for both objects and monsters * extend the definitions of objects and monsters to provide "living color" - * in the dungeon, instead of a single monster color + * in the dungeon, instead of a single monster color * ifdef varargs usage to satisfy ANSI compilers * standardize on the color 'gray' * assorted bug fixes @@ -371,9 +377,9 @@ * add war hammers and revise object prices * extend prototypes to ANSI compilers in addition to the previous MSDOS ones * move object-on-floor references into functions in preparation for planned - * data structures to allow faster access and better colors + * data structures to allow faster access and better colors * fix some more bugs, and extend the portability of things added in earlier - * patches + * patches */ /* @@ -391,9 +397,9 @@ /* * Patch 1, July 31, 1989 * add support for Atari TOS (courtesy Eric Smith) and Andrew File System - * (courtesy Ralf Brown) + * (courtesy Ralf Brown) * include the uuencoded version of termcap.arc for the MSDOS versions that - * was included with 2.2 and 2.3 + * was included with 2.2 and 2.3 * make a number of simple changes to accommodate various compilers * fix a handful of bugs, and do some code cleaning elsewhere * add more instructions for new environments and things commonly done wrong @@ -405,6 +411,6 @@ /* Version 3.0 */ -/*****************************************************************************/ +/****************************************************************************/ /*patchlevel.h*/ diff --git a/include/qt_win.h b/include/qt_win.h index ddb72d5cd..136e8a6ef 100644 --- a/include/qt_win.h +++ b/include/qt_win.h @@ -1,4 +1,4 @@ -// NetHack 3.6 qt_win.h $NHDT-Date: 1433806580 2015/06/08 23:36:20 $ $NHDT-Branch: master $:$NHDT-Revision: 1.16 $ +// NetHack 3.6 qt_win.h $NHDT-Date: 1447755972 2015/11/17 10:26:12 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $ // Copyright (c) Warwick Allison, 1999. // NetHack may be freely redistributed. See license for details. // @@ -863,7 +863,8 @@ class NetHackQtBind : NetHackQtBindBase static void qt_cliparound(int x, int y); static void qt_cliparound_window(winid wid, int x, int y); - static void qt_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph, int bkglyph); + static void qt_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, + int glyph, int bkglyph); static void qt_raw_print(const char *str); static void qt_raw_print_bold(const char *str); static int qt_nhgetch(); diff --git a/include/tradstdc.h b/include/tradstdc.h index 36ce4b9de..697982411 100644 --- a/include/tradstdc.h +++ b/include/tradstdc.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 tradstdc.h $NHDT-Date: 1432512778 2015/05/25 00:12:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ +/* NetHack 3.6 tradstdc.h $NHDT-Date: 1447755973 2015/11/17 10:26:13 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -44,7 +44,7 @@ * USE_STDARG means use the ANSI facilities (only ANSI compilers * should do this, and only if the library supports it). * USE_VARARGS means use the facilities. Again, this should only - * be done if the library supports it. ANSI is *not* required for this. + * be done if the library supports it. ANSI is *not* required for this. * Otherwise, the kludgy old methods are used. * The defaults are USE_STDARG for ANSI compilers, and USE_OLDARGS for * others. @@ -64,24 +64,24 @@ #endif #ifdef NEED_VARARGS /* only define these if necessary */ - /* - * These have changed since 3.4.3. VA_END() now provides an explicit - * closing brace to complement VA_DECL()'s hidden opening brace, so code - * started with VA_DECL() needs an extra opening brace to complement - * the explicit final closing brace. This was done so that the source - * would look less strange, where VA_DECL() appeared to introduce a - * function whose opening brace was missing; there are now visible and - * invisible braces at beginning and end. Sample usage: - void foo VA_DECL(int, arg) --macro expansion has a hidden opening brace - { --new, explicit opening brace (actually introduces a nested block) - VA_START(bar); - ...code for foo... - VA_END(); --expansion now provides a closing brace for the nested block - } --existing closing brace, still pairs with the hidden one in VA_DECL() - * Reading the code--or using source browsing tools which match braces-- - * results in seeing a matched set of braces. Usage of VA_END() is - * potentially trickier, but nethack uses it in a straightforward manner. - */ +/* + * These have changed since 3.4.3. VA_END() now provides an explicit + * closing brace to complement VA_DECL()'s hidden opening brace, so code + * started with VA_DECL() needs an extra opening brace to complement + * the explicit final closing brace. This was done so that the source + * would look less strange, where VA_DECL() appeared to introduce a + * function whose opening brace was missing; there are now visible and + * invisible braces at beginning and end. Sample usage: + void foo VA_DECL(int, arg) --macro expansion has a hidden opening brace + { --new, explicit opening brace (actually introduces a nested block) + VA_START(bar); + ...code for foo... + VA_END(); --expansion now provides a closing brace for the nested block + } --existing closing brace, still pairs with the hidden one in VA_DECL() + * Reading the code--or using source browsing tools which match braces-- + * results in seeing a matched set of braces. Usage of VA_END() is + * potentially trickier, but nethack uses it in a straightforward manner. + */ #ifdef USE_STDARG #include @@ -104,6 +104,7 @@ #define _VA_LIST_ /* prevents multiple def in stdio.h */ #endif #else + #ifdef USE_VARARGS #include #define VA_DECL(typ1, var1) \ @@ -125,6 +126,8 @@ va_end(the_args); \ } #else + +/*USE_OLDARGS*/ #define VA_ARGS arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 #define VA_DECL(typ1, var1) \ (var1, VA_ARGS) typ1 var1; \ @@ -137,10 +140,15 @@ { #define VA_START(x) #define VA_INIT(var1, typ1) -/* this is inherently risky, and should only be attempted as a +/* This is inherently risky, and should only be attempted as a very last resort; manipulating arguments which haven't actually been passed may or may not cause severe trouble depending on - the function-calling/argument-passing mechanism being used */ + the function-calling/argument-passing mechanism being used. + + [nethack's core doesn't use VA_NEXT() so doesn't use VA_SHIFT() + either, and this definition is just retained for completeness. + lev_comp does use VA_NEXT(), but it passes all 'argX' arguments.] + */ #define VA_SHIFT() \ (arg1 = arg2, arg2 = arg3, arg3 = arg4, arg4 = arg5, arg5 = arg6, \ arg6 = arg7, arg7 = arg8, arg8 = arg9) diff --git a/include/unixconf.h b/include/unixconf.h index 7893fd413..0447b8295 100644 --- a/include/unixconf.h +++ b/include/unixconf.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 unixconf.h $NHDT-Date: 1432512778 2015/05/25 00:12:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.23 $ */ +/* NetHack 3.6 unixconf.h $NHDT-Date: 1447755973 2015/11/17 10:26:13 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -8,13 +8,13 @@ /* * Some include files are in a different place under SYSV - * BSD SYSV - * - * + * BSD SYSV + * + * * * Some routines are called differently - * index strchr - * rindex strrchr + * index strchr + * rindex strrchr * */ @@ -46,18 +46,17 @@ * job control (note that AIX is SYSV otherwise) * Also define this for AIX 3.2 */ -#define TERMINFO /* uses terminfo rather than termcap */ - /* Should be defined for most SYSV, SVR4 (including - * Solaris 2+), HPUX, and Linux systems. In - * particular, it should NOT be defined for the UNIXPC - * unless you remove the use of the shared library in - * the Makefile */ -#define TEXTCOLOR /* Use System V r3.2 terminfo color support */ - /* and/or ANSI color support on termcap systems */ - /* and/or X11 color */ -#define POSIX_JOB_CONTROL /* use System V / Solaris 2.x / POSIX job control \ - */ -/* (e.g., VSUSP) */ +#define TERMINFO /* uses terminfo rather than termcap */ + /* Should be defined for most SYSV, SVR4 (including + * Solaris 2+), HPUX, and Linux systems. In + * particular, it should NOT be defined for the UNIXPC + * unless you remove the use of the shared library in + * the Makefile */ +#define TEXTCOLOR /* Use System V r3.2 terminfo color support + * and/or ANSI color support on termcap systems + * and/or X11 color */ +#define POSIX_JOB_CONTROL /* use System V / Solaris 2.x / POSIX job control + * (e.g., VSUSP) */ #define POSIX_TYPES /* use POSIX types for system calls and termios */ /* Define for many recent OS releases, including * those with specific defines (since types are @@ -92,7 +91,7 @@ * which does not allow hard links. If NO_FILE_LINKS is defined, lock files * will be created in LOCKDIR using open() instead of in the playground using * link(). - * Ralf Brown, 7/26/89 (from v2.3 hack of 10/10/88) + * Ralf Brown, 7/26/89 (from v2.3 hack of 10/10/88) */ /* #define NO_FILE_LINKS */ /* if no hard links */ @@ -109,8 +108,8 @@ * If defined, it can be overridden by the environment variable PAGER. * Hack will use its internal pager if DEF_PAGER is not defined. * (This might be preferable for security reasons.) - * #define DEF_PAGER ".../mydir/mypager" */ +/* #define DEF_PAGER ".../mydir/mypager" */ /* * Define PORT_HELP to be the name of the port-specfic help file. @@ -148,9 +147,8 @@ * (another directory). MAILBOX is the element that will be added on to * the user's home directory path to generate the Mailbox path - just in * case other Andrew sites do it differently from CMU. - * - * dan lovinger - * dl2n+@andrew.cmu.edu (dec 19 1989) + * dan lovinger + * dl2n+@andrew.cmu.edu (dec 19 1989) */ /* #define AMS */ /* use Andrew message system for mail */ @@ -158,8 +156,7 @@ /* NO_MAILREADER is for kerberos authenticating filesystems where it is * essentially impossible to securely exec child processes, like mail * readers, when the game is running under a special token. - * - * dan + * dan */ /* #define NO_MAILREADER */ /* have mail daemon just tell player of mail */ From 9645eeef827e7a4bf3f8cbbb69808d4645376727 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 17 Nov 2015 02:47:05 -0800 Subject: [PATCH 47/51] tribute: Wintersmith --- dat/tribute | 270 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 262 insertions(+), 8 deletions(-) diff --git a/dat/tribute b/dat/tribute index d859375d6..a4e90cb26 100644 --- a/dat/tribute +++ b/dat/tribute @@ -4264,18 +4264,265 @@ enough, yes? A sheep can look like a cow, right? Ha! # # # -%title Wintersmith (2) +%title Wintersmith (16) +# p. 82 (HarperTeen edition--presumably HarperTempest suffered a name change) %passage 1 -That's Third Thoughts for you. -When a huge rock is going to land on your head, -they're the thoughts that think: -Is that an igneous rock, such as granite, or is it sandstone? +That's Third Thoughts for you. When a huge rock is going to land on your +head, they're the thoughts that think: Is that an igneous rock, such as +granite, or is it sandstone? [Wintersmith, by Terry Pratchett] %e passage +p. 113 %passage 2 They say that there can never be two snowflakes that are exactly alike, but -has anyone checked lately? +has anyone checked lately? + + [Wintersmith, by Terry Pratchett] +%e passage +# pp. 32-33 +%passage 3 +All witches are a bit odd. Tiffany had got used to odd, so that odd seemed +quite normal. There was Miss Level, for example, who had two bodies, +although one of them was imaginery. Mistress Pullunder, who bred pedigreed +earthworms and gave them all names... well, she was hardly odd at all, just +a bit peculiar, and anyway earthworms were quite interesting in a basically +uninterestng kind of way. And there had been Old Mother Dismass, who +suffered from bouts of temporal confusion, which can be quite strange when +it happens to a witch; her mouth never moved in time with her words, and +sometimes her footsteps came down the stairs ten minutes before she did. + +But when it came to odd, Miss Treason didn't just take the cake, but a +packet of biscuits too, with sprinkles on the top, and also a candle. + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 34 ('villages': plural is accurate; 'clonk-clank' is rendered bold) +%passage 4 +Then there was her clock. It was heavy and made of rusty iron by someone +who was more blacksmith than watchmaker, which was why it went +*clonk-clank* instead of /tick-tock/. She wore it on her belt and could +tell the time by feeling the stubby little hands. + +There was a story in the villages that the clock was Miss Treason's heart, +which she'd used ever since her first heart died. But there were lots of +stories about Miss Treason. + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 40 (Boffo) +%passage 5 +First Sight and Second Thoughts, that's what a witch had to rely on: First +Sight to see what's really there, and Second Thoughts to watch the First +Thoughts to check that they were thinking right. Then there were the +Third Thoughts, which Tiffany had never heard discussed and therefore kept +quiet about; they were odd, seemed to think for themselves, and didn't +turn up very often. And they were telling her that there was more to Miss +Treason than met the eye. + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 53-54 (in Carpe Jugulum, most of the lore [for humans] about how to kill +# vampires had been written by long-lived/long-not-defunct vampires +# [meaning that it was deliberately full of inaccuracies...]) +%passage 6 +It was in fact Miss Tick who had written /Witch Hunting for Dumb People/, +and she made sure that copies of it found their way into those areas where +people still believed that witches should be burned or drowned. + +Since the only witch ever likely to pass through these days was Miss Tick +herself, it meant that if things did go wrong, she'd get a good night's +sleep and a decent meal before being thrown into the water. The water was +no problem at all for Miss Tick, who had been to the Quirm College for +Young Ladies, where you had to have an icy dip every morning to build Moral +Fiber. And a No. 1 Bosun's knot was very easy to undo with your teeth, +even underwater. + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 55-56 +%passage 7 +Working quickly, she emptied her pockets and started a shamble. + +Shambles worked. That was about all you could say about them for certain. +You made them out of some string and a couple of sticks and anything you +had in your pocket at the time. They were a witch's equivalent of those +knives with fifteen blades and three screwdrivers and a tiny magnifying +glass and a thing for extracting earwax from chickens. + +You couldn't even say precisely what they did, although Miss Tick thought +that they were a way of finding out what things the hidden bits of your +own mind already knew. You had to make a shamble from scratch every time, +and only from things in your pockets. There was no harm in having +interesting things in your pockets, though, just in case. + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 69 +%passage 8 +A witch didn't do things because they seemed like a good idea at the time! +That was practically cackling! You had to deal every day with people who +were foolish and lazy and untruthful and downright unpleasant, and you +could certainly end up thinking that the world would be considerably +improved if you gave them a slap. But you didn't because, as Miss Tick +had once explained: a) it would make the world a better place for only a +very short period of time; b) it would then make the world a slightly +worse place; and c) you're not supposed to be as stupid as they are. + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 106 (Rob Anybody is married to their kelda, ruler of the clan; +# passage continues with three or so pages about Explaining +# [focusing on the reactions of the recipient of the explanation: +# Pursin' o' the Lips; Foldin' o' the Arms; Tappin' o' the Feets; +# and also the reactions of the listening Feegles as they hear +# about them] but would end up on the long side if included here) +%passage 9 +"Aye, but the boy willna be interested in marryin'," said Slightly Mad +Angus. + +"He might be one day," said Billy Bigchin, who'd made a hobby of watching +humans. "Most bigjob men get married." + +"They do?" said a Feegle in astonishment. + +"Oh, aye." + +"They want tae get married?" + +"A lot o' them do, aye," said Billy. + +"So there's nae more drinkin', and stealin', and fightin'?" + +"Hey, ah'm still allowed some drinkin' and stealin' and fightin'!" said +Rob Anybody. + +"Aye, Rob, but we canna help noticin' ye also have tae do the Explainin', +too." said Daft Wullie. + +There was a general nodding from the crowd. To Feegles, Explaining was a +dark art. It was just so /hard/. + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 126-127 (passage starts mid-paragraph; +# witches know in advance when they're going to die) +%passage 10 +"[...] We shall hold the funeral tomorrow afternoon." + +"Sorry? You mean /before/ you die?" said Tiffany. + +"Why, of course! I don't see why I shouldn't have some fun!" + +"Good thinkin'!" said Rob Anybody. "That's the kind o' sensible detail +people usually fails tae consider." + +"We call it a going-away party," said Miss Treason. "Just for witches, of +course. Other people tend to get a bit nervous--I can't think why. And +on the bright side, we've got that splendid ham that Mr. Armbinder gave us +last week for settling the ownership of the chestnut tree, and I'd love to +try it." + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 129 +%passage 11 +Some people think that "coven" is a word for a group of witches, and it's +true that's what the dictionary says. But the real word for a group of +witches is an "argument." + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 174-175 (passage starts mid-paragraph; last paragraph continues, but +# changes topic so abruptly Tiffany gasps; 'rumbustious' is accurate) +%passage 12 +"[...] And now I shall tell you something vitally important. It is the +secret of my long life." + +Ah, thought Tiffany, and she leaned forward. + +"The important thing," said Miss Treason, "is to stay the passage of the +wind. You should avoid rumbustious fruits and vegetables. Beans are the +worst, take it from me." + +"I don't think I understand--" Tiffany began. + +"Try not to fart, in a nutshell." + +"In a nutshell, I imagine it would be pretty unpleasant!" said Tiffany +nervously. She couldn't believe she was being told this. + +"This is no joking matter," said Miss Treason. "The human body has only +so much air in it. You have to make it last. One plate of beans can take +a year off your life. I have avoided rumbustiousness all my days. I am +an old person and that means what I say is wisdom!" She gave the +bewildered Tiffany a stern look. "Do you understand, child?" + +Tiffany's mind raced. Everything is a test! "No," she said. "I'm not a +child and that's nonsense, not wisdom!" + +The stern look cracked into a smile. "Yes," said Miss Treason. "Total +gibberish. But you've got to admit it's a corker, all the same, right? +You definitely believed it, just for a moment? The villagers did last +year. You should have seen the way they walked about for a few weeks! +The strained looks on their faces quite cheered me up! [...]" + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 185 (Miss Treason tells people she's 113, but she's actually /only/ 111) +%passage 13 +MISS EUMENIDES TREASON, AGED ONE HUNDRED AND ELEVEN? + +Tiffany heard the voice inside her head. It didn't seem to have come +through her ears. And she'd heard it before, making her quite unusual. +Most people hear the voice of Death only once. + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 229 +%passage 14 +Tiffany had looked up "strumpet" in the Unexpurgated Dictionary, and found +it meant "a woman who is no better than she should be" and "a lady of easy +virtue." This, she decided after some working out, meant that Mrs. Gytha +Ogg, known as Nanny, was a very respectable person. She found virtue easy, +for one thing. And if she was no better than she should be, she was just +as good as she ought to be. + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 360-361 ('wurds' is accurate) +%passage 15 +"An heroic effect, Mr. Anybody," said Granny. "The first thing a hero must +conquer is his fear, and when it comes to fightin', the Nac Mac Feegle +don't know the meanin' of the word." + +"Aye, true enough," Rob grunted. "We dinna ken the meanin' o' thousands +o' wurds!" + + [Wintersmith, by Terry Pratchett] +%e passage +# p. 398-399 ("Chumsfanleigh" is pronounced "Chuffley") +%passage 16 +At the back of the Feegles' chalk pit, more chalk had been carved out of +the wall to make a tunnel about five feet high and perhaps as long. + +In front of it stood Roland de Chumsfanleigh (it wasn't his fault). His +ancestors had been knights, and they had come to own the Chalk by killing +the kings who thought they did. Swords, that's what it had all been about. +Swords and cutting off heads. That was how you got land in the old days, +and then the rules were changed so that you didn't need a sword to own +land anymore, you just needed the right piece of paper. But his ancestors +had still hung on to their swords, just in case people thought that the +whole thing with the bits of paper had been unfair, it being a fact that +you can't please everybody. + +He'd always wanted to be good with a sword, and it had come as a shock to +find that they were so /heavy/. He was great at air sword. In front of a +mirror he could fence against his reflection and win nearly all the time. +Real swords didn't allow that. You tried to swing them and they ended up +swinging you. He'd realized that maybe he was more cut out for bits of +paper. Besides, he needed glasses, which could be a bit tricky under a +helmet, especially if someone was hitting /you/ with a sword. [Wintersmith, by Terry Pratchett] %e passage @@ -4291,7 +4538,7 @@ Making Money, by Terry Pratchett 'I don't know, thur. I didn't athk.' [Making Money, by Terry Pratchett] -%e pasasge +%e passage %passage 2 The Watch armour fitted like a glove. He'd have preferred it to fit like a helmet and breastplate. It was common knowledge that the Watch's approach @@ -4500,7 +4747,7 @@ IF YOU ASK ME, said Death, NOBODY COULD DO ANY BETTER THAN THAT. . . # Used for interaction with Death. # %section Death -%title Death Quotes (8) +%title Death Quotes (10) %passage 1 WHERE THE FIRST PRIMAL CELL WAS, THERE WAS I ALSO. WHERE MAN IS, THERE AM I. WHEN THE LAST LIFE CRAWLS UNDER FREEZING STARS, THERE WILL I BE. %e passage @@ -4533,5 +4780,12 @@ THERE IS A LITTLE CONFUSION AT FIRST. IT IS ONLY TO BE EXPECTED. # time and space) %passage 8 THERE IS ALWAYS TIME FOR ANOTHER LAST MINUTE. +# Wintersmith, p. 187 (HarperTeen edition; dying Miss Treason takes a ham +# [too silly?] sandwich with her to the grave, and it accompanies +# her to the afterlife, but its condiments don't) +%passage 9 +MUSTARD IS ALWAYS TRICKY. +%passage 10 +PICKLES OF ALL SORTS DON'T SEEM TO MAKE IT. I'M SORRY. %e title %e section From 1fb9de1375dd6053edc5a20926be215019143180 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 17 Nov 2015 03:09:20 -0800 Subject: [PATCH 48/51] unix/Makefile.utl typo Confusing build failure, explained by a typo in sys/unix/Makefile.utl. dgn_lex.o didn't get rebuilt after modifying unixconf.h to take out the #define MONITOR_HEAP I had in place, resulting in link failure for dgn_comp because the old object file was referencing 'nhalloc' rather than 'alloc'. dgn_lex.o accidentally didn't care about modifications to config.h and the other headers that pulls in, such as unixconf.h. This typo was already present when the last cvs repository was initialized nearly 14 years ago. --- sys/unix/Makefile.utl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl index d2ecf09e8..554e08c7a 100644 --- a/sys/unix/Makefile.utl +++ b/sys/unix/Makefile.utl @@ -1,5 +1,5 @@ # Makefile for NetHack's utility programs. -# NetHack 3.6 Makefile.utl $NHDT-Date: 1432512789 2015/05/25 00:13:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.22 $ +# NetHack 3.6 Makefile.utl $NHDT-Date: 1447758555 2015/11/17 11:09:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ # Root of source tree: NHSROOT=.. @@ -23,7 +23,7 @@ NHSROOT=.. # For Bull DPX/2 systems at B.O.S. 2.0 or higher use the following: # # CC = gcc -ansi -D_BULL_SOURCE -D_XOPEN_SOURCE -D_POSIX_SOURCE -# +# # If you are using GCC 2.2.2 or higher on a DPX/2, just use: # # CC = gcc -ansi @@ -96,7 +96,7 @@ NHSROOT=.. #LFLAGS = LIBS = - + # If you are cross-compiling, you must use this: #OBJDIR = . # otherwise, you can save a little bit of disk space with this: @@ -109,7 +109,7 @@ LEX = lex # YACC = bison -y # YACC = byacc # LEX = flex - + # these are the names of the output files from YACC/LEX. Under MS-DOS # and similar systems, they may differ YTABC = y.tab.c @@ -256,7 +256,7 @@ dgn_yacc.o: dgn_yacc.c $(CONFIG_H) ../include/dgn_file.h ../include/date.h dgn_main.o: dgn_main.c $(CONFIG_H) ../include/dlb.h # see dgn_comp.l for WEIRD_LEX discussion -dgn_lex.o: dgn_lex.c $(CONFIG.H) ../include/dgn_comp.h ../include/dgn_file.h +dgn_lex.o: dgn_lex.c $(CONFIG_H) ../include/dgn_comp.h ../include/dgn_file.h @echo $(CC) -c $(CFLAGS) dgn_lex.c @$(CC) -c $(CFLAGS) -DWEIRD_LEX=`egrep -c _cplusplus dgn_lex.c` dgn_lex.c From 3583587f1cdc0d76e62eb7283e0910f417c854bf Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 18 Nov 2015 00:45:03 -0800 Subject: [PATCH 49/51] fix for pre-ANSI compilers Declare a function pointer without requiring support for prototypes. Plus a couple of formatting tidbits. --- src/sp_lev.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/sp_lev.c b/src/sp_lev.c index c2350f9dc..6b555b66b 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 sp_lev.c $NHDT-Date: 1446887534 2015/11/07 09:12:14 $ $NHDT-Branch: master $:$NHDT-Revision: 1.70 $ */ +/* NetHack 3.6 sp_lev.c $NHDT-Date: 1447836300 2015/11/18 08:45:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.73 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -18,7 +18,7 @@ #pragma warning(disable : 4244) #endif -typedef void (*select_iter_func)(int, int, genericptr_t); +typedef void FDECL((*select_iter_func), (int, int, genericptr_t)); extern void FDECL(mkmap, (lev_init *)); @@ -484,7 +484,8 @@ struct opvar *ov; while (tmp) { if (!strcmp(tmp->name, OV_s(ov))) { if ((tmp->svtyp & SPOVAR_ARRAY)) { - array_idx = opvar_var_conversion(coder, splev_stack_pop(coder->stack)); + array_idx = opvar_var_conversion(coder, + splev_stack_pop(coder->stack)); if (!array_idx || OV_typ(array_idx) != SPOVAR_INT) panic("array idx not an int"); if (tmp->array_len < 1) @@ -3797,7 +3798,7 @@ boolean diagonals; } while (0) #define SEL_FLOOD_CHKDIR(mx,my,sel) \ if (isok((mx), (my)) \ - && (*selection_flood_check_func)((mx),(my)) \ + && (*selection_flood_check_func)((mx), (my)) \ && !selection_getpoint((mx), (my), (sel))) \ SEL_FLOOD((mx), (my)) static const char floodfill_stack_overrun[] = "floodfill stack overrun"; From 5e5a78fdb2f61c8014d5e7e60ffbc8450651a357 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 18 Nov 2015 03:04:35 -0800 Subject: [PATCH 50/51] X11 pilemark.xbm Update the unix Makefiles and the older OSX hints files to handle the pile marker tile overlay. I didn't touch hints/macosx10.10 and .11 since I think there's still a merge for them pending. A couple of formatting tweaks for bemain.c are included, for no compelling reason. What are the odds that anyone will every build that again? --- dat/.gitignore | 1 + sys/be/bemain.c | 12 +-- sys/unix/Makefile.dat | 11 ++- sys/unix/Makefile.top | 8 +- sys/unix/Makefile.utl | 14 ++-- sys/unix/hints/macosx | 4 +- sys/unix/hints/macosx10.5 | 4 +- sys/unix/hints/macosx10.7 | 4 +- win/X11/winmap.c | 163 ++++++++++++++++++++------------------ 9 files changed, 118 insertions(+), 103 deletions(-) diff --git a/dat/.gitignore b/dat/.gitignore index c2fecbb7c..6cdbe532d 100644 --- a/dat/.gitignore +++ b/dat/.gitignore @@ -3,6 +3,7 @@ oracles data rip.xpm pet_mark.xbm +pilemark.xbm quest.dat rumors bogusmon diff --git a/sys/be/bemain.c b/sys/be/bemain.c index 5a5e34b5e..b5a26bded 100644 --- a/sys/be/bemain.c +++ b/sys/be/bemain.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 bemain.c $NHDT-Date: 1432512791 2015/05/25 00:13:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $ */ +/* NetHack 3.6 bemain.c $NHDT-Date: 1447844549 2015/11/18 11:02:29 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ */ /* Copyright (c) Dean Luick, 1996. */ /* NetHack may be freely redistributed. See license for details. */ @@ -66,10 +66,10 @@ MAIN(int argc, char **argv) display_gamewindows(); -/* - * First, try to find and restore a save file for specified character. - * We'll return here if new game player_selection() renames the hero. - */ + /* + * First, try to find and restore a save file for specified character. + * We'll return here if new game player_selection() renames the hero. + */ attempt_restore: if ((fd = restore_saved_game()) >= 0) { #ifdef NEWS @@ -167,7 +167,6 @@ process_options(int argc, char **argv) case 'D': wizard = TRUE, discover = FALSE; break; - /* otherwise fall thru to discover */ case 'X': discover = TRUE, wizard = FALSE; break; @@ -268,6 +267,7 @@ authorize_wizard_mode() * do anything extra. */ void nethack_exit(int status); + void nethack_exit(int status) { diff --git a/sys/unix/Makefile.dat b/sys/unix/Makefile.dat index 6e65bcfef..f0566650c 100644 --- a/sys/unix/Makefile.dat +++ b/sys/unix/Makefile.dat @@ -1,5 +1,5 @@ # NetHack Makefile. -# NetHack 3.6 Makefile.dat $NHDT-Date: 1432512788 2015/05/25 00:13:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.15 $ +# NetHack 3.6 Makefile.dat $NHDT-Date: 1447844574 2015/11/18 11:02:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ # Root of source tree: NHSROOT=.. @@ -35,12 +35,15 @@ x11tiles: ../util/tile2x11 ../win/share/monsters.txt ../win/share/objects.txt \ ../util/tile2x11 ../win/share/monsters.txt ../win/share/objects.txt \ ../win/share/other.txt -beostiles: ../util/tile2beos ../win/share/monsters.txt ../win/share/objects.txt \ +beostiles: ../util/tile2beos ../win/share/monsters.txt \ + ../win/share/objects.txt \ ../win/share/other.txt - ../util/tile2beos ../win/share/monsters.txt ../win/share/objects.txt \ + ../util/tile2beos ../win/share/monsters.txt \ + ../win/share/objects.txt \ ../win/share/other.txt -nhtiles.bmp: ../util/tile2bmp ../win/share/monsters.txt ../win/share/objects.txt \ +nhtiles.bmp: ../util/tile2bmp ../win/share/monsters.txt \ + ../win/share/objects.txt \ ../win/share/other.txt ../util/tile2bmp $@ diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top index f5def29f2..72e934452 100644 --- a/sys/unix/Makefile.top +++ b/sys/unix/Makefile.top @@ -1,5 +1,5 @@ # NetHack Makefile. -# NetHack 3.6 Makefile.top $NHDT-Date: 1432512789 2015/05/25 00:13:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.29 $ +# NetHack 3.6 Makefile.top $NHDT-Date: 1447844578 2015/11/18 11:02:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.32 $ # Root of source tree: NHSROOT=. @@ -46,14 +46,14 @@ DIRPERM = 0755 # per discussion in Install.X11 and Install.Qt #VARDATND = -# VARDATND = x11tiles NetHack.ad pet_mark.xbm -# VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm +# VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xpm +# VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xpm rip.xpm # for Atari/Gem # VARDATND = nh16.img title.img GEM_RSC.RSC rip.img # for BeOS # VARDATND = beostiles # for Gnome -# VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm +# VARDATND = x11tiles pet_mark.xbm pilemark.xpm rip.xpm mapbg.xpm VARDATD = bogusmon data engrave epitaph oracles options quest.dat rumors VARDAT = $(VARDATD) $(VARDATND) diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl index 554e08c7a..ab171a381 100644 --- a/sys/unix/Makefile.utl +++ b/sys/unix/Makefile.utl @@ -1,5 +1,5 @@ # Makefile for NetHack's utility programs. -# NetHack 3.6 Makefile.utl $NHDT-Date: 1447758555 2015/11/17 11:09:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ +# NetHack 3.6 Makefile.utl $NHDT-Date: 1447844579 2015/11/18 11:02:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ # Root of source tree: NHSROOT=.. @@ -373,6 +373,11 @@ bitmfile.o: ../win/gem/bitmfile.c ../include/bitmfile.h tile2beos.o: ../win/BeOS/tile2beos.cpp $(HACK_H) ../include/tile.h $(CXX) $(CFLAGS) -c ../win/BeOS/tile2beos.cpp +tileedit: tileedit.cpp $(TEXT_IO) + $(QTDIR)/bin/moc -o tileedit.moc tileedit.h + $(CC) -o tileedit -I../include -I$(QTDIR)/include -L$(QTDIR)/lib \ + tileedit.cpp $(TEXT_IO) -lqt + # using dependencies like # ../src/foo:: # @( cd ../src ; $(MAKE) foo ) @@ -416,8 +421,5 @@ spotless: clean -rm -f ../include/lev_comp.h ../include/dgn_comp.h -rm -f ../include/tile.h tiletxt.c -rm -f makedefs lev_comp dgn_comp recover dlb - -rm -f gif2txt txt2ppm tile2x11 tile2img.ttp xpm2img.ttp tilemap - -tileedit: tileedit.cpp $(TEXT_IO) - $(QTDIR)/bin/moc -o tileedit.moc tileedit.h - $(CC) -o tileedit -I../include -I$(QTDIR)/include -L$(QTDIR)/lib tileedit.cpp $(TEXT_IO) -lqt + -rm -f gif2txt txt2ppm tile2x11 tile2img.ttp xpm2img.ttp \ + tilemap tileedit diff --git a/sys/unix/hints/macosx b/sys/unix/hints/macosx index cb5a1643f..0cd98b3fa 100644 --- a/sys/unix/hints/macosx +++ b/sys/unix/hints/macosx @@ -1,5 +1,5 @@ # -# NetHack 3.6 macosx $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ +# NetHack 3.6 macosx $NHDT-Date: 1447844580 2015/11/18 11:03:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # @@ -71,7 +71,7 @@ WINSRC += $(WINX11SRC) WINOBJ += $(WINX11OBJ) WINLIB += $(WINX11LIB) LFLAGS=-L/usr/X11R6/lib -VARDATND = x11tiles NetHack.ad pet_mark.xbm +VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm POSTINSTALL= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir) CFLAGS += -DX11_GRAPHICS endif diff --git a/sys/unix/hints/macosx10.5 b/sys/unix/hints/macosx10.5 index df9a84980..0ee5d7bdb 100644 --- a/sys/unix/hints/macosx10.5 +++ b/sys/unix/hints/macosx10.5 @@ -1,5 +1,5 @@ # -# NetHack 3.6 macosx10.5 $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.21 $ +# NetHack 3.6 macosx10.5 $NHDT-Date: 1447844587 2015/11/18 11:03:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.27 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009. # NetHack may be freely redistributed. See license for details. # @@ -80,7 +80,7 @@ WINSRC += $(WINX11SRC) WINOBJ += $(WINX11OBJ) WINLIB += $(WINX11LIB) LFLAGS=-L/usr/X11R6/lib -VARDATND = x11tiles NetHack.ad pet_mark.xbm +VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir); CFLAGS += -DX11_GRAPHICS endif # WANT_WIN_X11 diff --git a/sys/unix/hints/macosx10.7 b/sys/unix/hints/macosx10.7 index 7126eef1e..f314c9a3c 100644 --- a/sys/unix/hints/macosx10.7 +++ b/sys/unix/hints/macosx10.7 @@ -1,5 +1,5 @@ # -# NetHack 3.6 macosx10.7 $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ +# NetHack 3.6 macosx10.7 $NHDT-Date: 1447844589 2015/11/18 11:03:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.31 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009. # NetHack may be freely redistributed. See license for details. # @@ -97,7 +97,7 @@ WINSRC += $(WINX11SRC) WINOBJ += $(WINX11OBJ) WINLIB += $(WINX11LIB) LFLAGS=-L/usr/X11R6/lib -VARDATND = x11tiles NetHack.ad pet_mark.xbm +VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir); CFLAGS += -DX11_GRAPHICS endif # WANT_WIN_X11 diff --git a/win/X11/winmap.c b/win/X11/winmap.c index 01058778a..28d973e0b 100644 --- a/win/X11/winmap.c +++ b/win/X11/winmap.c @@ -1,18 +1,18 @@ -/* NetHack 3.6 winmap.c $NHDT-Date: 1435002689 2015/06/22 19:51:29 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ -/* Copyright (c) Dean Luick, 1992 */ +/* NetHack 3.6 winmap.c $NHDT-Date: 1447844616 2015/11/18 11:03:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ */ +/* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ /* * This file contains: - * + global functions print_glyph() and cliparound() - * + the map window routines - * + the char and pointer input routines + * + global functions print_glyph() and cliparound() + * + the map window routines + * + the char and pointer input routines * * Notes: - * + We don't really have a good way to get the compiled ROWNO and - * COLNO as defaults. They are hardwired to the current "correct" - * values in the Window widget. I am _not_ in favor of including - * some nethack include file for Window.c. + * + We don't really have a good way to get the compiled ROWNO and + * COLNO as defaults. They are hardwired to the current "correct" + * values in the Window widget. I am _not_ in favor of including + * some nethack include file for Window.c. */ #ifndef SYSV @@ -58,8 +58,8 @@ extern int total_tiles_used; static boolean FDECL(init_tiles, (struct xwindow *)); static void FDECL(set_button_values, (Widget, int, int, unsigned)); static void FDECL(map_check_size_change, (struct xwindow *)); -static void FDECL(map_update, - (struct xwindow *, int, int, int, int, BOOLEAN_P)); +static void FDECL(map_update, (struct xwindow *, int, int, int, int, + BOOLEAN_P)); static void FDECL(init_text, (struct xwindow *)); static void FDECL(map_exposed, (Widget, XtPointer, XtPointer)); static void FDECL(set_gc, (Widget, Font, const char *, Pixel, GC *, GC *)); @@ -67,14 +67,14 @@ static void FDECL(get_text_gc, (struct xwindow *, Font)); static void FDECL(get_char_info, (struct xwindow *)); static void FDECL(display_cursor, (struct xwindow *)); -/* Global functions ======================================================== - */ +/* Global functions ======================================================= */ void X11_print_glyph(window, x, y, glyph, bkglyph) winid window; xchar x, y; -int glyph, bkglyph; +int glyph; +int bkglyph UNUSED; { struct map_info_t *map_info; boolean update_bbox = FALSE; @@ -104,6 +104,7 @@ int glyph, bkglyph; #ifdef TEXTCOLOR register unsigned char *co_ptr; #endif + /* map glyph to character and color */ (void) mapglyph(glyph, &och, &color, &special, x, y); ch = (uchar) och; @@ -156,8 +157,7 @@ int x, y; } #endif /* CLIPPING */ -/* End global functions ==================================================== - */ +/* End global functions =================================================== */ #include "tile2x11.h" @@ -199,6 +199,7 @@ Pixel colorpixel; &annotation->bitmap, &annotation->hotx, &annotation->hoty)) { char buf[BUFSZ]; + Sprintf(buf, "Failed to load %s", filename); X11_raw_print(buf); } @@ -327,10 +328,9 @@ struct xwindow *wp; /* assume a fixed number of tiles per row */ if (tile_image->width % TILES_PER_ROW != 0 || tile_image->width <= TILES_PER_ROW) { - Sprintf( - buf, - "%s is not a multiple of %d (number of tiles/row) pixels wide", - appResources.tile_file, TILES_PER_ROW); + Sprintf(buf, + "%s is not a multiple of %d (number of tiles/row) pixels wide", + appResources.tile_file, TILES_PER_ROW); X11_raw_print(buf); XDestroyImage(tile_image); tile_image = 0; @@ -348,7 +348,7 @@ struct xwindow *wp; } tile_width = image_width / TILES_PER_ROW; tile_height = image_height / (tile_count / TILES_PER_ROW); -#else +#else /* !USE_XPM */ /* any less than 16 colours makes tiles useless */ ddepth = DefaultDepthOfScreen(screen); if (ddepth < 4) { @@ -377,11 +377,11 @@ struct xwindow *wp; result = FALSE; goto tiledone; } - #ifdef VERBOSE - fprintf(stderr, "X11 tile file:\n version %ld\n ncolors %ld\n " - "tile width %ld\n tile height %ld\n per row %ld\n " - " ntiles %ld\n", + fprintf(stderr, "\ +X11 tile file:\n version %ld\n ncolors %ld\n \ +tile width %ld\n tile height %ld\n per row %ld\n \ +ntiles %ld\n", header.version, header.ncolors, header.tile_width, header.tile_height, header.per_row, header.ntiles); #endif @@ -458,15 +458,15 @@ struct xwindow *wp; else bitmap_pad = 8; - tile_image = - XCreateImage(dpy, DefaultVisualOfScreen(screen), ddepth, /* depth */ - ZPixmap, /* format */ - 0, /* offset */ - 0, /* data */ - image_width, /* width */ - image_height, /* height */ - bitmap_pad, /* bit pad */ - 0); /* bytes_per_line */ + tile_image = XCreateImage(dpy, DefaultVisualOfScreen(screen), + ddepth, /* depth */ + ZPixmap, /* format */ + 0, /* offset */ + (char *) 0, /* data */ + image_width, /* width */ + image_height, /* height */ + bitmap_pad, /* bit pad */ + 0); /* bytes_per_line */ if (!tile_image) impossible("init_tiles: insufficient memory to create image"); @@ -499,9 +499,9 @@ struct xwindow *wp; for (x = 0; x < (int) image_width; x++, tb++) XPutPixel(tile_image, x, y, colors[*tb].pixel); } -#endif /* USE_XPM */ +#endif /* ?USE_XPM */ -/* fake an inverted tile by drawing a border around the edges */ + /* fake an inverted tile by drawing a border around the edges */ #ifdef USE_WHITE /* use white or black as the border */ mask = GCFunction | GCForeground | GCGraphicsExposures; @@ -872,7 +872,7 @@ struct xwindow *wp; /* changed map display mode, re-display the full map */ (void) memset((genericptr_t) map_info->t_start, (char) 0, sizeof(map_info->t_start)); - (void) memset((genericptr_t) map_info->t_stop, (char) COLNO - 1, + (void) memset((genericptr_t) map_info->t_stop, (char) (COLNO - 1), sizeof(map_info->t_stop)); map_info->is_tile = iflags.wc_tiled_map && !Is_rogue_level(&u.uz); XClearWindow(XtDisplay(wp->w), XtWindow(wp->w)); @@ -911,9 +911,8 @@ static void map_all_stone(map_info) struct map_info_t *map_info; { - int x,y; - unsigned short *sp, stone; - stone = cmap_to_glyph(S_stone); + int x, y; + unsigned short stone = cmap_to_glyph(S_stone); for (x = 0; x < COLNO; x++) for (y = 0; y < ROWNO; y++) { @@ -1122,8 +1121,8 @@ unsigned int button; click_y = y / map_info->text_map.square_height; } - /* The values can be out of range if the map window has been resized */ - /* to be larger than the max size. */ + /* The values can be out of range if the map window has been resized + to be larger than the max size. */ if (click_x >= COLNO) click_x = COLNO - 1; if (click_y >= ROWNO) @@ -1202,8 +1201,8 @@ XtPointer widget_data; /* expose event from Window widget */ t_width, start_row, stop_row, start_col, stop_col); #endif - /* Out of range values are possible if the map window is resized to be */ - /* bigger than the largest expected value. */ + /* Out of range values are possible if the map window is resized to be + bigger than the largest expected value. */ if (stop_row >= ROWNO) stop_row = ROWNO - 1; if (stop_col >= COLNO) @@ -1294,8 +1293,9 @@ boolean inverted; XSetClipMask(dpy, tile_map->black_gc, pile_annotation.bitmap); XCopyPlane(dpy, pile_annotation.bitmap, XtWindow(wp->w), - tile_map->black_gc, 0, 0, pile_annotation.width, - pile_annotation.height, dest_x, dest_y, 1); + tile_map->black_gc, 0, 0, + pile_annotation.width, pile_annotation.height, + dest_x, dest_y, 1); XSetClipOrigin(dpy, tile_map->black_gc, 0, 0); XSetClipMask(dpy, tile_map->black_gc, None); XSetForeground(dpy, tile_map->black_gc, @@ -1305,19 +1305,20 @@ boolean inverted; } if (inverted) { - XDrawRectangle( - XtDisplay(wp->w), XtWindow(wp->w), + XDrawRectangle(XtDisplay(wp->w), XtWindow(wp->w), #ifdef USE_WHITE - /* kludge for white square... */ - tile_map->glyphs[start_row][start_col].glyph == cmap_to_glyph(S_ice) - ? tile_map->black_gc - : tile_map->white_gc, + /* kludge for white square... */ + (tile_map->glyphs[start_row][start_col].glyph + == cmap_to_glyph(S_ice)) + ? tile_map->black_gc + : tile_map->white_gc, #else - tile_map->white_gc, + tile_map->white_gc, #endif - start_col * tile_map->square_width, - start_row * tile_map->square_height, - tile_map->square_width - 1, tile_map->square_height - 1); + start_col * tile_map->square_width, + start_row * tile_map->square_height, + tile_map->square_width - 1, + tile_map->square_height - 1); } } else { struct text_map_info_t *text_map = &map_info->text_map; @@ -1366,20 +1367,22 @@ boolean inverted; { int win_row, win_xstart; - /* We always start at the same x window position and have */ - /* the same character count. */ + /* We always start at the same x window position and have + the same character count. */ win_xstart = text_map->square_lbearing + (win_start_col * text_map->square_width); count = stop_col - start_col + 1; for (row = start_row, win_row = win_start_row; row <= stop_row; row++, win_row++) { - XDrawImageString( - XtDisplay(wp->w), XtWindow(wp->w), - inverted ? text_map->inv_copy_gc : text_map->copy_gc, - win_xstart, text_map->square_ascent + XDrawImageString(XtDisplay(wp->w), XtWindow(wp->w), + inverted ? text_map->inv_copy_gc + : text_map->copy_gc, + win_xstart, + text_map->square_ascent + (win_row * text_map->square_height), - (char *) &(text_map->text[row][start_col]), count); + (char *) &(text_map->text[row][start_col]), + count); } } } @@ -1432,7 +1435,7 @@ static char map_translations[] = "#override\n\ Right: scroll(6)\n\ Up: scroll(8)\n\ Down: scroll(2)\n\ - : input() \ + : input() \ "; /* @@ -1463,8 +1466,9 @@ Widget parent; XtSetArg(args[num_args], XtNinput, False); num_args++; - wp->popup = parent = XtCreatePopupShell( - "nethack", topLevelShellWidgetClass, toplevel, args, num_args); + wp->popup = parent = XtCreatePopupShell("nethack", + topLevelShellWidgetClass, + toplevel, args, num_args); /* * If we're here, then this is an auxiliary map window. If we're * cancelled via a delete window message, we should just pop down. @@ -1476,18 +1480,20 @@ Widget parent; num_args++; XtSetArg(args[num_args], XtNallowVert, True); num_args++; - /* XtSetArg(args[num_args], XtNforceBars, True); num_args++; */ +#if 0 + XtSetArg(args[num_args], XtNforceBars, True); + num_args++; +#endif XtSetArg(args[num_args], XtNuseBottom, True); num_args++; XtSetArg(args[num_args], XtNtranslations, XtParseTranslationTable(map_translations)); num_args++; - viewport = XtCreateManagedWidget( - "map_viewport", /* name */ - viewportWidgetClass, /* widget class from Window.h */ - parent, /* parent widget */ - args, /* set some values */ - num_args); /* number of values to set */ + viewport = XtCreateManagedWidget("map_viewport", /* name */ + viewportWidgetClass, /* from Window.h */ + parent, /* parent widget */ + args, /* set some values */ + num_args); /* number of values to set */ /* * Create a map window. We need to set the width and height to some @@ -1607,13 +1613,15 @@ struct xwindow *wp; } boolean exit_x_event; /* exit condition for the event loop */ -/******* + +#if 0 /*******/ +void pkey(k) - int k; +int k; { - printf("key = '%s%c'\n", (k<32) ? "^":"", (k<32) ? '@'+k : k); + printf("key = '%s%c'\n", (k < 32) ? "^" : "", (k < 32) ? '@' + k : k); } -******/ +#endif /***0***/ /* * Main X event loop. Here we accept and dispatch X events. We only exit @@ -1650,6 +1658,7 @@ int exit_condition; switch (exit_condition) { case EXIT_ON_SENT_EVENT: { XAnyEvent *any = (XAnyEvent *) &event; + if (any->send_event) { retval = 0; keep_going = FALSE; From dc09a991fec03c252889a9d8e3577c2942133ecf Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 18 Nov 2015 22:54:28 +0200 Subject: [PATCH 51/51] Fix some warnings from clang's static code analyzer --- include/display.h | 2 +- src/apply.c | 4 ++-- src/artifact.c | 5 ++++- src/cmd.c | 5 ++--- src/dbridge.c | 2 +- src/do_wear.c | 4 ++++ src/eat.c | 5 ++++- src/end.c | 2 +- src/lock.c | 4 +++- src/mon.c | 2 ++ src/pray.c | 4 ++-- src/sp_lev.c | 3 +++ src/trap.c | 2 +- src/u_init.c | 2 +- 14 files changed, 31 insertions(+), 15 deletions(-) diff --git a/include/display.h b/include/display.h index fe3c5e62b..4bd8cf924 100644 --- a/include/display.h +++ b/include/display.h @@ -73,7 +73,7 @@ * canseemon() or canspotmon() which already check that. */ #define see_with_infrared(mon) \ - (!Blind && Infravision && infravisible(mon->data) \ + (!Blind && Infravision && mon && infravisible(mon->data) \ && couldsee(mon->mx, mon->my)) /* diff --git a/src/apply.c b/src/apply.c index 952e5fa7b..4f0bf0391 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2036,8 +2036,8 @@ boolean quietly; You("don't have enough room in here."); return FALSE; } - x = cc->x; - y = cc->y; + x = cc ? cc->x : u.ux; + y = cc ? cc->y : u.uy; if (!isok(x, y)) { if (!quietly) You("cannot put the figurine there."); diff --git a/src/artifact.c b/src/artifact.c index 789057932..23c7c49c2 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1404,7 +1404,10 @@ arti_invoke(obj) struct obj *obj; { register const struct artifact *oart = get_artifact(obj); - + if (!obj) { + impossible("arti_invoke without obj"); + return 0; + } if (!oart || !oart->inv_prop) { if (obj->otyp == CRYSTAL_BALL) use_crystal_ball(&obj); diff --git a/src/cmd.c b/src/cmd.c index 17500699c..8fd20ef0c 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -385,7 +385,6 @@ extcmd_via_menu() biggest = 0; while (!ret) { i = n = 0; - accelerator = 0; any = zeroany; /* populate choices */ for (efp = extcmdlist; efp->ef_txt; efp++) { @@ -421,7 +420,7 @@ extcmd_via_menu() /* otherwise... */ win = create_nhwindow(NHW_MENU); start_menu(win); - prevaccelerator = 0; + accelerator = prevaccelerator = 0; acount = 0; for (i = 0; choices[i]; ++i) { accelerator = choices[i]->ef_txt[matchlevel]; @@ -1769,7 +1768,7 @@ int final; /* when mounted, Wounded_legs applies to steed rather than to hero; we only report steed's wounded legs in wizard mode */ if (u.usteed) { /* not `Riding' here */ - if (wizard) { + if (wizard && steedname) { Strcpy(buf, steedname); *buf = highc(*buf); enl_msg(buf, " has", " had", " wounded legs", ""); diff --git a/src/dbridge.c b/src/dbridge.c index 393831241..1dc43ad4b 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -388,7 +388,7 @@ const char *verb; static char wholebuf[80]; Strcpy(wholebuf, is_u(etmp) ? "You" : Monnam(etmp->emon)); - if (!*verb) + if (!verb || !*verb) return wholebuf; Strcat(wholebuf, " "); if (is_u(etmp)) diff --git a/src/do_wear.c b/src/do_wear.c index 83926a836..ea73cace8 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -1123,6 +1123,10 @@ register struct obj *otmp; { boolean was_blind = Blind, changed = FALSE; + if (!otmp) { + impossible("Blindf_off without otmp"); + return; + } context.takeoff.mask &= ~W_TOOL; setworn((struct obj *) 0, otmp->owornmask); off_msg(otmp); diff --git a/src/eat.c b/src/eat.c index 1cf9c3166..8056cc190 100644 --- a/src/eat.c +++ b/src/eat.c @@ -271,7 +271,10 @@ STATIC_OVL void recalc_wt() { struct obj *piece = context.victual.piece; - + if (!piece) { + impossible("recalc_wt without piece"); + return; + } debugpline1("Old weight = %d", piece->owt); debugpline2("Used time = %d, Req'd time = %d", context.victual.usedtime, context.victual.reqtime); diff --git a/src/end.c b/src/end.c index e7c9da20a..5e1fd0b01 100644 --- a/src/end.c +++ b/src/end.c @@ -627,7 +627,7 @@ boolean taken; { char c = 0, defquery; char qbuf[QBUFSZ]; - boolean ask; + boolean ask = FALSE; if (invent && !done_stopprint) { if (taken) diff --git a/src/lock.c b/src/lock.c index 0f6ab0f71..16f1c63b1 100644 --- a/src/lock.c +++ b/src/lock.c @@ -64,8 +64,10 @@ lock_action() return actions[3]; /* same as lock_pick */ else if (xlock.door) return actions[0]; /* "unlocking the door" */ - else + else if (xlock.box) return xlock.box->otyp == CHEST ? actions[1] : actions[2]; + else + return actions[3]; } /* try to open/close a lock */ diff --git a/src/mon.c b/src/mon.c index 8e251092c..5d476118f 100644 --- a/src/mon.c +++ b/src/mon.c @@ -391,6 +391,8 @@ unsigned corpseflags; } /* All special cases should precede the G_NOCORPSE check */ + if (!obj) return NULL; + /* if polymorph or undead turning has killed this monster, prevent the same attack beam from hitting its corpse */ if (context.bypasses) diff --git a/src/pray.c b/src/pray.c index d6230e708..e3da3e37d 100644 --- a/src/pray.c +++ b/src/pray.c @@ -797,7 +797,7 @@ gcrownu() case A_NEUTRAL: if (class_gift != STRANGE_OBJECT) { ; /* already got bonus above */ - } else if (in_hand) { + } else if (obj && in_hand) { Your("%s goes snicker-snack!", xname(obj)); obj->dknown = TRUE; } else if (!already_exists) { @@ -819,7 +819,7 @@ gcrownu() Sprintf(swordbuf, "%s sword", hcolor(NH_BLACK)); if (class_gift != STRANGE_OBJECT) { ; /* already got bonus above */ - } else if (in_hand) { + } else if (obj && in_hand) { Your("%s hums ominously!", swordbuf); obj->dknown = TRUE; } else if (!already_exists) { diff --git a/src/sp_lev.c b/src/sp_lev.c index 6b555b66b..3388c4c5f 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -976,6 +976,9 @@ packed_coord pos; schar try_x, try_y; register int trycnt = 0; + if (!x || !y) + panic("get_free_room_loc: x or y is null"); + get_location_coord(&try_x, &try_y, DRY, croom, pos); if (levl[try_x][try_y].typ != ROOM) { do { diff --git a/src/trap.c b/src/trap.c index 3bef3ccae..5832eee4c 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3764,7 +3764,7 @@ STATIC_OVL void move_into_trap(ttmp) struct trap *ttmp; { - int bc; + int bc = 0; xchar x = ttmp->tx, y = ttmp->ty, bx, by, cx, cy; boolean unused; diff --git a/src/u_init.c b/src/u_init.c index beca86829..f0c1e3756 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -959,7 +959,7 @@ int otyp; break; } - while (skills->skill != P_NONE) { + while (skills && skills->skill != P_NONE) { if (skills->skill == this_skill) return FALSE; ++skills;