]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/edit.c
Make struct sctstr member sct_effic signed
[empserver] / src / lib / commands / edit.c
index 2ad13dac0487ada20f10afd4618644f4af9bef26..5d9c767ac5ba40d5879b54ba64062d11e0af4b57 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -31,8 +31,8 @@
  *     David Muir Sharnoff
  *     Chad Zabel, 1994
  *     Steve McClure, 1998-2000
- *     Ron Koenderink, 2003-2004
- *     Markus Armbruster, 2003-2008
+ *     Ron Koenderink, 2003-2009
+ *     Markus Armbruster, 2003-2009
  */
 
 #include <config.h>
@@ -85,9 +85,10 @@ edit(void)
     char buf[1024];
     char ewhat;
 
-    if ((what = getstarg(player->argp[1],
-                        "Edit What (country, land, ship, plane, nuke, unit)? ",
-                        buf)) == 0)
+    what = getstarg(player->argp[1],
+                   "Edit What (country, land, ship, plane, nuke, unit)? ",
+                   buf);
+    if (!what)
        return RET_SYN;
     ewhat = what[0];
     switch (ewhat) {
@@ -129,7 +130,7 @@ edit(void)
        pr("huh?\n");
        return RET_SYN;
     }
-    if (player->argp[3] == 0) {
+    if (!player->argp[3]) {
        switch (ewhat) {
        case 'l':
            prsect(&sect);
@@ -149,8 +150,8 @@ edit(void)
        }
     }
     for (;;) {
-       if (player->argp[arg_index] != 0) {
-           if (player->argp[arg_index+1] != 0) {
+       if (player->argp[arg_index]) {
+           if (player->argp[arg_index+1]) {
                thing = player->argp[arg_index++][0];
                ptr = player->argp[arg_index++];
                arg = atoi(ptr);
@@ -373,7 +374,7 @@ pr_ship(struct shpstr *ship)
 {
     struct natstr *natp;
 
-    if ((natp = getnatp(ship->shp_own)) == 0)
+    if (!(natp = getnatp(ship->shp_own)))
        return;
     pr("%s (#%d) %s\n", natp->nat_cnam, ship->shp_own, prship(ship));
     pr("UID <U>: %d\n", ship->shp_uid);
@@ -486,7 +487,7 @@ doland(char op, int arg, char *p, struct sctstr *sect)
     case 'e':
        new = errcheck(arg, 0, 100);
        noise(sect, "Efficiency", sect->sct_effic, new);
-       sect->sct_effic = (unsigned char)new;
+       sect->sct_effic = new;
        break;
     case 'm':
        new = errcheck(arg, -127, 255);
@@ -974,7 +975,7 @@ dounit(char op, int arg, char *p, struct lndstr *land)
 }
 
 
-int
+static int
 doplane(char op, int arg, char *p, struct plnstr *plane)
 {
     coord newx, newy;