]> granicus.if.org Git - nethack/commitdiff
misc core formatting
authorPatR <rankin@nethack.org>
Sun, 15 May 2016 01:26:48 +0000 (18:26 -0700)
committerPatR <rankin@nethack.org>
Sun, 15 May 2016 01:26:48 +0000 (18:26 -0700)
Some of these are post-3.6.0, some just got overlooked before the
3.6.0 release.

src/end.c
src/mon.c
src/pager.c
src/pickup.c
src/vault.c
src/zap.c

index f41890dc68a74f34b4d6d19ce17a883debdb8288..437b9072d55eca3e49b82b8f8cc3b6df60ec544b 100644 (file)
--- a/src/end.c
+++ b/src/end.c
@@ -952,8 +952,8 @@ int how;
             return;
         }
     }
-    if ((wizard || discover) && (how <= GENOCIDED) &&
-        !paranoid_query(ParanoidDie, "Die?")) {
+    if ((wizard || discover) && (how <= GENOCIDED)
+        && !paranoid_query(ParanoidDie, "Die?")) {
         pline("OK, so you don't %s.", (how == CHOKING) ? "choke" : "die");
         savelife(how);
         killer.name[0] = 0;
index 0e7a5501cbbbd28f316aa190f0eecd7cb6d55126..90cb8a14ed2ccda585954c7ae0df91672271e9a1 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -2383,8 +2383,9 @@ struct monst *mtmp;
                              SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION
                                  | SUPPRESS_INVISIBLE | SUPPRESS_IT,
                              FALSE),
-                    amorphous(mtmp->data) ? "coalesces on the" :
-                     is_flyer(mtmp->data) ? "drops to the" : "writhes on the",
+                    amorphous(mtmp->data) ? "coalesces on the"
+                       : is_flyer(mtmp->data) ? "drops to the"
+                          : "writhes on the",
                     surface(x,y));
             mtmp->mcanmove = 1;
             mtmp->mfrozen = 0;
index 7e7cea2bca6f959435389a5ca67615b9a420f758..183b73f56d70d664b2e641fe8238c9a281932949 100644 (file)
@@ -526,10 +526,9 @@ boolean user_typed_name, without_asking;
         /*
          * If the object is named, then the name is the alternate description;
          * otherwise, the result of makesingular() applied to the name is.
-         * This
-         * isn't strictly optimal, but named objects of interest to the user
-         * will usually be found under their name, rather than under their
-         * object type, so looking for a singular form is pointless.
+         * This isn't strictly optimal, but named objects of interest to the
+         * user will usually be found under their name, rather than under
+         * their object type, so looking for a singular form is pointless.
          */
         if (!alt)
             alt = makesingular(dbase_str);
@@ -565,10 +564,11 @@ boolean user_typed_name, without_asking;
                     if (!(ep = index(buf, '\n')))
                         goto bad_data_file;
                     (void) strip_newline((ep > buf) ? ep - 1 : ep);
-                    /* if we match a key that begins with "~", skip this entry */
+                    /* if we match a key that begins with "~", skip
+                       this entry */
                     chk_skip = (*buf == '~') ? 1 : 0;
-                    if ((pass == 0 && pmatch(&buf[chk_skip], dbase_str)) ||
-                        (pass == 1 && alt && pmatch(&buf[chk_skip], alt))) {
+                    if ((pass == 0 && pmatch(&buf[chk_skip], dbase_str))
+                        || (pass == 1 && alt && pmatch(&buf[chk_skip], alt))) {
                         if (chk_skip) {
                             skipping_entry = TRUE;
                             continue;
@@ -592,7 +592,7 @@ boolean user_typed_name, without_asking;
                 if (sscanf(buf, "%ld,%d\n", &entry_offset, &entry_count) < 2) {
                 bad_data_file:
                     impossible("'data' file in wrong format or corrupted");
-                    /* window will exist if we came here from below via 'goto' */
+                    /* window will exist if came here from below via 'goto' */
                     if (datawin != WIN_ERR)
                         destroy_nhwindow(datawin);
                     (void) dlb_fclose(fp);
@@ -604,6 +604,7 @@ boolean user_typed_name, without_asking;
                     unsigned maxt = strlen("More info about \"\"?");
                     char *entrytext = pass ? alt : dbase_str;
                     char question[BUFSZ];
+
                     if (strlen(entrytext) < BUFSZ - maxt) {
                         Strcpy(question, "More info about \"");
                         Strcat(question, entrytext);
@@ -614,8 +615,8 @@ boolean user_typed_name, without_asking;
                }
 
                 if (user_typed_name || without_asking || yes_to_moreinfo) {
-                    if (dlb_fseek(fp,
-                        (long) txt_offset + entry_offset, SEEK_SET) < 0) {
+                    if (dlb_fseek(fp, (long) txt_offset + entry_offset,
+                                  SEEK_SET) < 0) {
                         pline("? Seek error on 'data' file!");
                         (void) dlb_fclose(fp);
                         return;
index 5f484622fa2feaf31245a731dcef93308b296d11..c83bb8deb68c89096d680c18f393f240e76b3a87 100644 (file)
@@ -1839,8 +1839,8 @@ reverse_loot()
                 boxdummy = zeroobj, boxdummy.otyp = SPE_WIZARD_LOCK;
                 (void) boxlock(coffers, &boxdummy);
             }
-        } else if (levl[x][y].looted != T_LOOTED &&
-                   (mon = makemon(courtmon(), x, y, NO_MM_FLAGS)) != 0) {
+        } else if (levl[x][y].looted != T_LOOTED
+                   && (mon = makemon(courtmon(), x, y, NO_MM_FLAGS)) != 0) {
             freeinv(goldob);
             add_to_minv(mon, goldob);
             pline("The exchequer accepts your contribution.");
index 18c1d9a1653b2d79166665c81190a4c639066290..922e571b45161fe2594190f70a6b423cfb079da5 100644 (file)
@@ -377,8 +377,8 @@ invault()
         }
         trycount = 5;
         do {
-            getlin(Deaf ? "You are required to supply your name. -" :
-                    "\"Hello stranger, who are you?\" -", buf);
+            getlin(Deaf ? "You are required to supply your name. -"
+                        : "\"Hello stranger, who are you?\" -", buf);
             (void) mungspaces(buf);
         } while (!buf[0] && --trycount > 0);
 
index 8631483e45a01814663b33355ce34488e1a8be0a..3ccb8059da4d2dcfec358307bf735b66722eb04a 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -577,9 +577,9 @@ coord *cc;
         if (mtmp->m_id) {
             mtmp2->m_id = mtmp->m_id;
             /* might be bringing quest leader back to life */
-            if (quest_status.leader_is_dead &&
+            if (quest_status.leader_is_dead
                 /* leader_is_dead implies leader_m_id is valid */
-                mtmp2->m_id == quest_status.leader_m_id)
+                && mtmp2->m_id == quest_status.leader_m_id)
                 quest_status.leader_is_dead = FALSE;
         }
         mtmp2->mx = mtmp->mx;
@@ -708,16 +708,16 @@ boolean by_hero;
             break; /* x,y are 0 */
         }
     }
-    if (!x || !y ||
+    if (!x || !y
         /* Rules for revival from containers:
-           - the container cannot be locked
-           - the container cannot be heavily nested (>2 is arbitrary)
-           - the container cannot be a statue or bag of holding
-           (except in very rare cases for the latter)
-        */
-        (container && (container->olocked || container_nesting > 2
-                       || container->otyp == STATUE
-                       || (container->otyp == BAG_OF_HOLDING && rn2(40)))))
+         *  - the container cannot be locked
+         *  - the container cannot be heavily nested (>2 is arbitrary)
+         *  - the container cannot be a statue or bag of holding
+         *    (except in very rare cases for the latter)
+         */
+        || (container && (container->olocked || container_nesting > 2
+                          || container->otyp == STATUE
+                          || (container->otyp == BAG_OF_HOLDING && rn2(40)))))
         return (struct monst *) 0;
 
     /* record the object's location now that we're sure where it is */
@@ -2695,10 +2695,10 @@ struct obj *obj; /* wand or spell */
         if (is_db_wall(x, y) && find_drawbridge(&xx, &yy)) {
             open_drawbridge(xx, yy);
             disclose = TRUE;
-        } else if (u.dz > 0 && (x == xdnstair && y == ydnstair) &&
+        } else if (u.dz > 0 && (x == xdnstair && y == ydnstair)
                    /* can't use the stairs down to quest level 2 until
                       leader "unlocks" them; give feedback if you try */
-                   on_level(&u.uz, &qstart_level) && !ok_to_quest()) {
+                   && on_level(&u.uz, &qstart_level) && !ok_to_quest()) {
             pline_The("stairs seem to ripple momentarily.");
             disclose = TRUE;
         }