]> git.pond.sub.org Git - empserver/commitdiff
Use NULL instead of (FOO *)0, it's easier to read.
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 23 Mar 2006 20:48:49 +0000 (20:48 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 23 Mar 2006 20:48:49 +0000 (20:48 +0000)
23 files changed:
src/lib/as/as_cache.c
src/lib/commands/best.c
src/lib/commands/bomb.c
src/lib/commands/dist.c
src/lib/commands/navi.c
src/lib/commands/path.c
src/lib/commands/retr.c
src/lib/commands/rout.c
src/lib/commands/sect.c
src/lib/commands/surv.c
src/lib/commands/terr.c
src/lib/common/bestpath.c
src/lib/common/maps.c
src/lib/common/path.c
src/lib/gen/queue.c
src/lib/subs/attsub.c
src/lib/subs/move.c
src/lib/subs/supply.c
src/lib/update/distribute.c
src/lib/update/finish.c
src/lib/update/main.c
src/lib/update/nxtitemp.c
src/lib/update/plane.c

index e5c46700fb662f3228451ade03d45456315fef75..1d15c5f9c551b7cafac486cfc44bfc0b87c0e12c 100644 (file)
@@ -85,9 +85,9 @@ as_add_cachepath(struct as_data *adp)
     /* Note we will only allocate this once.  Afterwards, we just keep
      * zeroing it since it's rather small and we don't need to re-allocate
      * each time. */
-    if (fromhead == (struct as_frompath **)0) {
+    if (fromhead == NULL) {
        fromhead = calloc(1, sizeof(struct as_frompath *) * WORLD_Y);
-       if (fromhead == (struct as_frompath **)0)
+       if (fromhead == NULL)
            return;
     }
 
@@ -143,7 +143,7 @@ as_clear_cachepath(void)
     int i, j;
 
     /* Cache not used yet :) */
-    if (fromhead == (struct as_frompath **)0)
+    if (fromhead == NULL)
        return;
 
     for (j = 0; j < WORLD_Y; j++) {
@@ -181,7 +181,7 @@ as_find_cachepath(coord fx, coord fy, coord tx, coord ty)
        return NULL;
 
     /* Do we have any cached? */
-    if (fromhead == (struct as_frompath **)0)
+    if (fromhead == NULL)
        return NULL;
 
     /* Yes! */
index 7297fbb13116a1975922096729b61ba9743ae656..0b4212f4a1083f727035054ba1daf0691bb8c165 100644 (file)
@@ -65,7 +65,7 @@ best(void)
            if (s2.sct_own != player->cnum)
                continue;
            s = BestLandPath(buf, &s1, &s2, &cost, MOB_ROAD);
-           if (s != (s_char *)0)
+           if (s)
                pr("Best path from %s to %s is %s (cost %1.3f)\n",
                   xyas(s1.sct_x, s1.sct_y, player->cnum),
                   xyas(s2.sct_x, s2.sct_y, player->cnum), s, cost);
index 92799b95185969fa374e684145e2883b546cf9d8..9b3f5e970f4c46d1caf0bdbe46b0c6297fdfde75 100644 (file)
@@ -413,7 +413,7 @@ comm_bomb(struct emp_qelem *list, struct sctstr *target)
        pr("some %s\n", ip->i_name);
     }
     for (;;) {
-       ip = whatitem((s_char *)0, "commodity to bomb? ");
+       ip = whatitem(NULL, "commodity to bomb? ");
        if (player->aborted)
            return;
        if (!ip)
index 656fd238c1874857181785d8dd8f550e02e0614c..c4c68131152493e6887b3e76e57ceafcfbf8397d 100644 (file)
@@ -102,7 +102,7 @@ dist(void)
 
        path = BestDistPath(buf, &sect, &dsect, &move_cost, MOB_ROAD);
 
-       if (path == (s_char *)0) {
+       if (!path) {
            pr("No owned path from %s to %s.\n",
               xyas(dsect.sct_x, dsect.sct_y, player->cnum),
               xyas(sect.sct_x, sect.sct_y, player->cnum));
index 9eaad1361db460cb833cb4b3877f7451c7306cf8..38d9a61488bea9c48fa0d1d0ee69c36f0b49bf66 100644 (file)
@@ -224,9 +224,9 @@ nav_map(int x, int y, int show_designations)
     int i;
     /* Note this is not re-entrant anyway, so we keep the buffers
        around */
-    static u_char *bitmap = (u_char *)0;
-    static s_char *wmapbuf = (s_char *)0;
-    static s_char **wmap = (s_char **)0;
+    static u_char *bitmap = NULL;
+    static s_char *wmapbuf = NULL;
+    static s_char **wmap = NULL;
     s_char what[64];
     int changed = 0;
 
@@ -244,7 +244,7 @@ nav_map(int x, int y, int show_designations)
                wmap[i] = &wmapbuf[MAPWIDTH(1) * i];
        } else if (wmap) {
            free(wmap);
-           wmap = (s_char **)0;
+           wmap = NULL;
        }
     }
     if (!bitmap)
index abe1b009eb4029989a3351486562c787e2270541..12ca7756613cdda555fc70536a4eac6768ffbf12 100644 (file)
@@ -61,8 +61,8 @@ path(void)
     s_char *pp, *p;
     /* Note this is not re-entrant anyway, so we keep the buffers
        around */
-    static s_char *mapbuf = (s_char *)0;
-    static s_char **map = (s_char **)0;
+    static s_char *mapbuf = NULL;
+    static s_char **map = NULL;
     double move_cost;
     s_char buf[1024];
 
@@ -75,7 +75,7 @@ path(void)
     }
     getsect(sect.sct_dist_x, sect.sct_dist_y, &dsect);
     pp = BestDistPath(buf, &sect, &dsect, &move_cost, MOB_ROAD);
-    if (pp == (s_char *)0) {
+    if (!pp) {
        pr("No path possible from %s to distribution sector %s\n",
           xyas(sect.sct_x, sect.sct_y, player->cnum),
           xyas(dsect.sct_x, dsect.sct_y, player->cnum));
@@ -90,7 +90,7 @@ path(void)
                map[i] = &mapbuf[MAPWIDTH(3) * i];
        } else if (map) {
            free(map);
-           map = (s_char **)0;
+           map = NULL;
        }
     }
     if (!mapbuf || !map) {
index 5e5086a9afba551df94db75ad1a496d93445f9a4..1876a88babd63bbe5f3e3df1d202200fdb7f75a1 100644 (file)
@@ -67,9 +67,9 @@ retr(void)
     if (player->argp[2] != NULL)
        pq = getstarg(player->argp[2], "Retreat path? ", buf1);
     else
-       pq = (s_char *)0;
+       pq = NULL;
 
-    if (pq != (s_char *)0) {
+    if (pq != NULL) {
        fl = getstarg(player->argp[3],
                      "Retreat conditions [i|t|s|h|b|d|u|c]? ", buf2);
        if (!fl)
@@ -129,7 +129,7 @@ retr(void)
     }
 
     if (rflags == -1)
-       pq = (s_char *)0;
+       pq = NULL;
 
     zero = (rflags == -1);
     if (zero)
@@ -141,7 +141,7 @@ retr(void)
        if (zero)
            memset(ship.shp_rpath, 0, sizeof(ship.shp_rpath));
 
-       if (pq != (s_char *)0) {
+       if (pq != NULL) {
            strncpy(ship.shp_rpath, pq, sizeof(ship.shp_rpath));
            putship(ship.shp_uid, &ship);
        }
@@ -215,8 +215,8 @@ lretr(void)
     if (player->argp[2] != NULL)
        pq = getstarg(player->argp[2], "Retreat path? ", buf1);
     else
-       pq = (s_char *)0;
-    if (pq != (s_char *)0) {
+       pq = NULL;
+    if (pq != NULL) {
        fl = getstarg(player->argp[3], "Retreat conditions [i|h|b|c]? ",
                      buf2);
        if (!fl)
@@ -256,7 +256,7 @@ lretr(void)
     }
 
     if (rflags == -1)
-       pq = (s_char *)0;
+       pq = NULL;
 
     zero = (rflags == -1);
     if (zero)
@@ -268,7 +268,7 @@ lretr(void)
        if (zero)
            memset(land.lnd_rpath, 0, sizeof(land.lnd_rpath));
 
-       if (pq != (s_char *)0) {
+       if (pq != NULL) {
            strncpy(land.lnd_rpath, pq, sizeof(land.lnd_rpath));
            putland(land.lnd_uid, &land);
        }
index 7295226ef6ecc156319fdbb01d79df6fa4ba8762..4db03efb30cc01c5d452414da67ec1115d26127f 100644 (file)
@@ -67,9 +67,9 @@ rout(void)
     s_char buf1[1024];
     /* Note this is not re-entrant anyway, so we keep the buffers
        around */
-    static s_char *mapbuf = (s_char *)0;
-    static s_char **map = (s_char **)0;
-    static s_char *buf = (s_char *)0;
+    static s_char *mapbuf = NULL;
+    static s_char **map = NULL;
+    static s_char *buf = NULL;
     int i;
 
     if ((ip = whatitem(player->argp[1], "What item? ")) == 0)
@@ -98,7 +98,7 @@ rout(void)
                map[i] = &mapbuf[MAPWIDTH(3) * i];
        } else if (map) {
            free(map);
-           map = (s_char **)0;
+           map = NULL;
        }
     }
     if (!buf)
index b86343b5a8c47c33efa240b4047473bbb0850566..4058d43b422c5bb9733e1ecb16629cdb94382204 100644 (file)
@@ -62,8 +62,8 @@ sct(void)
     s_char buf[1024];
     /* Note this is not re-entrant anyway, so we keep the buffers
        around */
-    static s_char *mapbuf = (s_char *)0;
-    static s_char **map = (s_char **)0;
+    static s_char *mapbuf = NULL;
+    static s_char **map = NULL;
 
     nsect = 0;
     if (player->argp[1] == NULL) {
@@ -90,7 +90,7 @@ sct(void)
                map[i] = &mapbuf[MAPWIDTH(1) * i];
        } else if (map) {
            free(map);
-           map = (s_char **)0;
+           map = NULL;
        }
     }
     if (!mapbuf || !map) {
index d86e867398cb2bb5f1b98f6ab7cc479ef2604dbc..214c86e6aaf50cdf9f3c4385aa91f7b2c47d3287 100644 (file)
@@ -70,8 +70,8 @@ surv(void)
     s_char *str;
     /* Note this is not re-entrant anyway, so we keep the buffers
        around */
-    static s_char *mapbuf = (s_char *)0;
-    static s_char **map = (s_char **)0;
+    static s_char *mapbuf = NULL;
+    static s_char **map = NULL;
 
     nsect = 0;
     if ((ptr = getstarg(player->argp[1], "commodity or variable? ", buf)) == 0)
@@ -109,7 +109,7 @@ surv(void)
                map[i] = &mapbuf[MAPWIDTH(1) * i];
        } else if (map) {
            free(map);
-           map = (s_char **)0;
+           map = NULL;
        }
     }
     if (!mapbuf || !map) {
index 23d7c9e4233bd3845ee320e4b58209abd25ab1b0..cd3fb95df117bc6848129ddd2717b089350d874d 100644 (file)
@@ -78,7 +78,7 @@ terr(void)
            sprintf(prompt, "%s %d%% %s  territory? ",
                    xyas(nstr.x, nstr.y, player->cnum),
                    sect.sct_effic, dchr[sect.sct_type].d_name);
-           if ((p = getstarg((s_char *)0, prompt, buf)) == 0)
+           if ((p = getstarg(NULL, prompt, buf)) == 0)
                return RET_FAIL;
            if (!check_sect_ok(&sect))
                return RET_FAIL;
index 4f2c4fb780e1ac9bafc1b7003812f9c129a96a4a..62b5158f5c9be252f451a45eddd29cda73f2fcfc 100644 (file)
@@ -117,8 +117,8 @@ int dy[6] = { 0, -1, -1, 0, 1, 1 };
  * would be slow.  And, since world size only changes at init
  * time, we can do this safely.
  */
-static unsigned int *mapbuf = (unsigned int *)0;
-static unsigned int **mapindex = (unsigned int **)0;
+static unsigned int *mapbuf;
+static unsigned int **mapindex;
 
 s_char *
 bestownedpath(s_char *bpath,
index 26af05b470aea12090d592acfaaae668e8d36d21..169fdefce21bab46434858bc9babd140854d2052 100644 (file)
@@ -66,9 +66,9 @@ draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp)
     int i;
     /* Note this is not re-entrant anyway, so we keep the buffers
        around */
-    static u_char *bitmap = (u_char *)0;
-    static s_char *wmapbuf = (s_char *)0;
-    static s_char **wmap = (s_char **)0;
+    static u_char *bitmap = NULL;
+    static s_char *wmapbuf = NULL;
+    static s_char **wmap = NULL;
 
     if (!wmapbuf)
        wmapbuf = malloc((WORLD_Y * MAPWIDTH(1)) * sizeof(s_char));
@@ -79,7 +79,7 @@ draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp)
                wmap[i] = &wmapbuf[MAPWIDTH(1) * i];
        } else if (wmap) {
            free(wmap);
-           wmap = (s_char **)0;
+           wmap = NULL;
        }
     }
     if (!bitmap)
index 3acf7222fbab255320feb3b992c32dd62836919e..925377957b5549646bd3cda9af8f66726e2f37b1 100644 (file)
@@ -88,7 +88,7 @@ bp_init(void)
     if (bp->adp == NULL)
        return NULL;
 
-    if (neighsects == (struct sctstr **)0)
+    if (neighsects == NULL)
        neighsects = calloc(((WORLD_X * WORLD_Y) / 2) * 6,
                            sizeof(struct sctstr *));
 
@@ -201,12 +201,12 @@ bp_neighbors(struct as_coord c, struct as_coord *cp, s_char *pp)
     offset = (sy * WORLD_X + sx) / 2;
     from = &sectp[offset];
 
-    if (neighsects == (struct sctstr **)0)
+    if (neighsects == NULL)
        ssp = (struct sctstr **)&tsp[0];
     else
        ssp = (struct sctstr **)&neighsects[offset * 6];
     for (q = 1; q <= 6; q++, ssp++) {
-       if (*ssp == (struct sctstr *)0) {
+       if (*ssp == NULL) {
            /* We haven't cached this neighbor yet */
            nx = x + diroff[q][0];
            ny = y + diroff[q][1];
@@ -360,7 +360,7 @@ BestLandPath(s_char *path,
     *path = 0;
     *cost = 0.0;
     if (best_path(from, to, path, mob_type) < 0)
-       return (s_char *)0;
+       return NULL;
     *cost = pathcost(from, path, mob_type);
     length = strlen(path);
     path[length] = 'h';
index bfd36004b1b20339eabc7733b60e1c8bc711f2a5..6bd9fadd6363610947f438a03d978bd469d86926 100644 (file)
@@ -50,11 +50,11 @@ emp_insque(struct emp_qelem *elem, struct emp_qelem *queue)
 void
 emp_remque(struct emp_qelem *elem)
 {
-    if (elem == (struct emp_qelem *)0)
+    if (!elem)
        return;
-    if (elem->q_forw != (struct emp_qelem *)0)
+    if (elem->q_forw)
        elem->q_forw->q_back = elem->q_back;
-    if (elem->q_back != (struct emp_qelem *)0)
+    if (elem->q_back)
        elem->q_back->q_forw = elem->q_forw;
 }
 
index 83c2dc15196aeb3f32532b73b263e318dfdd894e..516e9fee3e2b4c0ecd668bf44c69f2303b9da506 100644 (file)
@@ -2123,7 +2123,7 @@ take_casualty(int combat_mode, struct combat *off, struct emp_qelem *olist)
      *  Procedure: find the biggest unit remaining (in
      *  terms of mil) and give it the casualties.
      */
-    biggest = (struct emp_qelem *)0;
+    biggest = NULL;
     biggest_mil = -1;
     for (qp = olist->q_forw; qp != olist; qp = qp->q_forw) {
        llp = (struct llist *)qp;
@@ -2133,7 +2133,7 @@ take_casualty(int combat_mode, struct combat *off, struct emp_qelem *olist)
            biggest = qp;
        }
     }
-    if (biggest == (struct emp_qelem *)0)
+    if (biggest == NULL)
        return CASUALTY_LUMP - to_take;
 
     llp = (struct llist *)biggest;
index 7b83f21fb0c27ac8b2c565bc76ed3c59df3cd7d6..940f676bace650368f5ab53d8e2f3e538b2ebc48 100644 (file)
@@ -85,9 +85,9 @@ move_ground(s_char *what, struct sctstr *start, struct sctstr *end,
        pr("Looking for best path to %s\n", path);
        path = BestLandPath(buf2, start, &ending_sect, &total_mcost,
                            MOB_ROAD);
-       if (exploring && (path != (s_char *)0)) /* take off the 'h' */
-           *(path + strlen(path) - 1) = '\0';
-       if (path == (s_char *)0)
+       if (exploring && path)  /* take off the 'h' */
+           path[strlen(path) - 1] = '\0';
+       if (!path)
            pr("No owned path exists!\n");
        else {
            pr("Using best path '%s', movement cost %1.3f\n",
@@ -111,11 +111,11 @@ move_ground(s_char *what, struct sctstr *start, struct sctstr *end,
     for (;;) {
        oldx = curx;
        oldy = cury;
-       if (movstr == 0 || *movstr == 0) {
+       if (!movstr || *movstr == 0) {
            if (exploring) {
-               map(what, curx, cury, (s_char *)0);
+               map(what, curx, cury, NULL);
            } else {
-               move_map(what, curx, cury, (s_char *)0);
+               move_map(what, curx, cury, NULL);
            }
            sprintf(prompt, "<%.1f: %c %s> ", mobility,
                    dchr[sect.sct_type].d_mnem,
@@ -128,17 +128,16 @@ move_ground(s_char *what, struct sctstr *start, struct sctstr *end,
                                      MOB_ROAD);
            } else {
                pr("Invalid destination sector!\n");
-               movstr = (s_char *)0;
+               movstr = NULL;
            }
 
-           if (movstr == (s_char *)0) {
+           if (movstr == NULL) {
                pr("Can't get to %s from here!\n",
                   xyas(dx, dy, player->cnum));
-               movstr = (s_char *)0;
            } else {
                if ((mv_cost * weight) > mobility) {
                    pr("Not enough mobility to go all the way. Nothing moved.\n");
-                   movstr = (s_char *)0;
+                   movstr = NULL;
                } else {
                    pr("Using best path '%s', movement cost %1.3f\n",
                       movstr, mv_cost);
@@ -147,7 +146,7 @@ move_ground(s_char *what, struct sctstr *start, struct sctstr *end,
                }
            }
        }
-       if (movstr == 0 || *movstr == 0) {
+       if (!movstr || *movstr == 0) {
            buf2[0] = dirch[DIR_STOP];
            buf2[1] = 0;
            movstr = buf2;
index 7f0e805a64cf46b8d00bcddfaa35abf8fc429a3d..86915d953009fbb0136ee40b8dc2aafb5a56dcd7 100644 (file)
@@ -199,8 +199,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted,
            continue;
        if (sect.sct_effic < 60)
            continue;
-       if (BestLandPath(buf, &dest, &sect, &move_cost, MOB_ROAD) ==
-           (s_char *)0)
+       if (!BestLandPath(buf, &dest, &sect, &move_cost, MOB_ROAD))
            continue;
        if (!opt_NOFOOD && type == I_FOOD) {
            minimum = 2 + ((etu_per_update * eatrate)
@@ -275,8 +274,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted,
            continue;
        if (sect.sct_effic < 2)
            continue;
-       if (BestLandPath(buf, &dest, &sect, &move_cost, MOB_ROAD) ==
-           (s_char *)0)
+       if (!BestLandPath(buf, &dest, &sect, &move_cost, MOB_ROAD))
            continue;
        if (!opt_NOFOOD && type == I_FOOD)
            minimum = 2 + ((etu_per_update * eatrate)
@@ -351,8 +349,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted,
            continue;
 
        getsect(land.lnd_x, land.lnd_y, &sect);
-       if (BestLandPath(buf, &dest, &sect, &move_cost, MOB_ROAD) ==
-           (s_char *)0)
+       if (!BestLandPath(buf, &dest, &sect, &move_cost, MOB_ROAD))
            continue;
 
        if ((land.lnd_ship >= 0) && (sect.sct_type != SCT_HARBR))
index aabe4f011a212a6e8c609952b206d977aba4780e..2bec6e5b171d8707f2136692719cea26e0a82500 100644 (file)
@@ -79,7 +79,7 @@ dodistribute(struct sctstr *sp, int imex, s_char *path, double dist_i_cost,
     if ((sp->sct_dist_x == sp->sct_x) && (sp->sct_dist_y == sp->sct_y))
        return 0;
 
-    if (path == (s_char *)0) {
+    if (!path) {
        if (sp->sct_own != 0) {
            if (imex == EXPORT) /* only want this once */
                wu(0, sp->sct_own, "No path to dist sector for %s\n",
index 799f795e6196ad658a4ff85adafd9edd4d9e98c1..4c512ef1d8372dfaf41d266046278703e26d95c3 100644 (file)
@@ -80,12 +80,12 @@ finish_sects(int etu)
     int n;
     struct distinfo *infptr;
 
-    if (g_distptrs == (struct distinfo *)0) {
+    if (g_distptrs == NULL) {
        logerror("First update since reboot, allocating buffer\n");
        /* Allocate the information buffer */
        g_distptrs = (struct distinfo *)(malloc((WORLD_X * WORLD_Y) *
                                                sizeof(struct distinfo)));
-       if (g_distptrs == (struct distinfo *)0) {
+       if (g_distptrs == NULL) {
            logerror("malloc failed in finish_sects.\n");
            return;
        }
@@ -191,7 +191,7 @@ assemble_dist_paths(struct distinfo *distptrs)
        infptr = &distptrs[XYOFFSET(sp->sct_x, sp->sct_y)];
        /* now, get the dist sector */
        dist = getsectp(sp->sct_dist_x, sp->sct_dist_y);
-       if (dist == (struct sctstr *)0) {
+       if (dist == NULL) {
            logerror("Bad dist sect %d,%d for %d,%d !\n", sp->sct_dist_x,
                     sp->sct_dist_y, sp->sct_x, sp->sct_y);
            continue;
@@ -202,13 +202,13 @@ assemble_dist_paths(struct distinfo *distptrs)
        path = BestDistPath(buf, dist, sp, &d, MOB_ROAD);
 
        /* Now, we have a path */
-       if (path != (s_char *)0) {
+       if (path != NULL) {
 #ifdef SAVE_FINISH_PATHS
            int len;
            /* Here we malloc a buffer and save it */
            len = strlen(path);
            infptr->path = malloc(len);
-           if (infptr->path == (s_char *)0) {
+           if (infptr->path == NULL) {
                logerror("malloc failed in assemble_dist_path!\n");
                return;
            }
@@ -236,12 +236,12 @@ ReversePath(s_char *path)
     static s_char new_path[512];
     int ind;
 
-    if (path == (s_char *)0)
-       return (s_char *)0;
+    if (path == NULL)
+       return NULL;
 
     ind = strlen(path);
     if (ind == 0)
-       return (s_char *)0;
+       return NULL;
 
     if (path[ind - 1] == 'h')
        ind--;
index 9e90de9fab61ed6ab38842db61955c301b19f7cd..8c88b808a73b2df741fc24b300c2b25cb17feaa4 100644 (file)
@@ -102,7 +102,7 @@ update_main(void *unused)
     bp = calloc(WORLD_X * WORLD_Y * 7, sizeof(int));
     for (n = 0; n < MAXNOC; n++) {
        money[n] = 0;
-       if ((np = getnatp(n)) == (struct natstr *)0)
+       if (!(np = getnatp(n)))
            continue;
        money[n] = np->nat_money;
        tpops[n] = count_pop(n);
@@ -118,7 +118,7 @@ update_main(void *unused)
 
        memset(p_sect, 0, sizeof(p_sect));
        mil_dbl_pay = 0;
-       if ((np = getnatp(x)) == (struct natstr *)0)
+       if (!(np = getnatp(x)))
            continue;
        if (np->nat_stat == STAT_SANCT) {
 #ifdef DEBUG
index e24c3d08a4e39d4aa9ec1d4e360ed6c26490ac90..af2c5fd19b7642a9aa4ed0d5274799f02c58eca5 100644 (file)
@@ -63,7 +63,7 @@ nxtitemp(struct nstr_item *np)
            np->cur++;
        }
        gp = ef_ptr(np->type, np->cur);
-       if (gp == (struct genitem *)0)
+       if (!gp)
            return 0;
 
        selected = 1;
index ed59081d851933cf6a01527de97c24403f189296..ae414833aec567acd2feb62acdfe0d1916d333fe 100644 (file)
@@ -103,7 +103,7 @@ prod_plane(int etus, int natnum, int *bp, int buildem)
        }
 
        onship = 0;
-       shp = (struct shpstr *)0;
+       shp = NULL;
        if (pp->pln_ship >= 0 && (buildem == 1)) {
            if (pp->pln_effic >= 80)
                continue;