]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - trek/shield.c
Null for pointers, not 0.
[bsdgames-darwin.git] / trek / shield.c
index c74444b00c9ba935c0afd0cc7b4ce25f67718426..ed4843003e0e2d3b4d7fe8d46463f87acb971399 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: shield.c,v 1.9 2009/05/24 19:18:44 dholland Exp $      */
+/*     $NetBSD: shield.c,v 1.11 2009/05/24 22:55:03 dholland Exp $     */
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)shield.c   8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: shield.c,v 1.9 2009/05/24 19:18:44 dholland Exp $");
+__RCSID("$NetBSD: shield.c,v 1.11 2009/05/24 22:55:03 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -59,8 +59,7 @@ __RCSID("$NetBSD: shield.c,v 1.9 2009/05/24 19:18:44 dholland Exp $");
 **     so you get partial hits.
 */
 
-const struct cvntab Udtab[] =
-{
+const struct cvntab Udtab[] = {
        { "u",          "p",            (cmdfun)1,      0 },
        { "d",          "own",          (cmdfun)0,      0 },
        { NULL,         NULL,           NULL,           0 }
@@ -78,11 +77,11 @@ shield(int f)
 
        if (f > 0 && (Ship.shldup || damaged(SRSCAN)))
                return;
-       if (f < 0)
-       {
+       if (f < 0) {
                /* cloaking device */
                if (Ship.ship == QUEENE) {
-                       printf("Ye Faire Queene does not have the cloaking device.\n");
+                       printf("Ye Faire Queene does not have the "
+                              "cloaking device.\n");
                        return;
                }
                device = "Cloaking device";
@@ -90,9 +89,7 @@ shield(int f)
                ind = CLOAK;
                dev3 = "it";
                stat = &Ship.cloaked;
-       }
-       else
-       {
+       } else {
                /* shields */
                device = "Shields";
                dev2 = "are";
@@ -100,34 +97,30 @@ shield(int f)
                ind = SHIELD;
                stat = &Ship.shldup;
        }
-       if (damaged(ind))
-       {
+       if (damaged(ind)) {
                if (f <= 0)
                        out(ind);
                return;
        }
-       if (Ship.cond == DOCKED)
-       {
+       if (Ship.cond == DOCKED) {
                printf("%s %s down while docked\n", device, dev2);
                return;
        }
-       if (f <= 0 && !testnl())
-       {
+       if (f <= 0 && !testnl()) {
                r = getcodpar("Up or down", Udtab);
                i = (long) r->value;
-       }
-       else
-       {
+       } else {
                if (*stat)
-                       (void)sprintf(s, "%s %s up.  Do you want %s down", device, dev2, dev3);
+                       (void)sprintf(s, "%s %s up.  Do you want %s down",
+                               device, dev2, dev3);
                else
-                       (void)sprintf(s, "%s %s down.  Do you want %s up", device, dev2, dev3);
+                       (void)sprintf(s, "%s %s down.  Do you want %s up",
+                               device, dev2, dev3);
                if (!getynpar(s))
                        return;
                i = !*stat;
        }
-       if (*stat == i)
-       {
+       if (*stat == i) {
                printf("%s already ", device);
                if (i)
                        printf("up\n");