From: Markus Armbruster Date: Sun, 5 Aug 2007 18:58:36 +0000 (+0000) Subject: (xufooter, xubody): Rename some variables. No functional change. X-Git-Tag: v4.3.10~86 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=4b2afc1e95637965fd7925e8a224648411cba229 (xufooter, xubody): Rename some variables. No functional change. --- diff --git a/src/lib/common/xundump.c b/src/lib/common/xundump.c index 7200e354d..28834c2f1 100644 --- a/src/lib/common/xundump.c +++ b/src/lib/common/xundump.c @@ -722,20 +722,20 @@ xufldhdr(FILE *fp, struct castr ca[]) } static int -xufooter(FILE *fp, struct castr ca[], int row) +xufooter(FILE *fp, struct castr ca[], int recs) { - int res, rows, i; + int res, n, i; res = -1; if (human) { if (fscanf(fp, "config%n", &res) != 0 || res < 0) return gripe("Malformed table footer"); } else { - if (fscanf(fp, "%d", &rows) != 1) + if (fscanf(fp, "%d", &n) != 1) return gripe("Malformed table footer"); - if (row != rows) + if (recs != n) return gripe("Read %d rows, which doesn't match footer " - "%d rows", row, rows); + "%d rows", recs, n); } if (skipfs(fp) != '\n') return gripe("Junk after table footer"); @@ -819,41 +819,41 @@ xubody(FILE *fp) { struct empfile *ep = &empfile[cur_type]; int need_sentinel = !EF_IS_GAME_STATE(cur_type); - int row, n, ch; + int i, maxid, ch; - n = 0; - for (row = 0;; ++row) { + maxid = 0; + for (i = 0;; ++i) { while ((ch = skipfs(fp)) == '\n') lineno++; if (ch == '/') break; ungetc(ch, fp); cur_obj = NULL; - cur_id = row; + cur_id = i; if (xuflds(fp, xufld) < 0) return -1; - n = MAX(n, cur_id + 1); + maxid = MAX(maxid, cur_id + 1); } - if (CANT_HAPPEN(n > ep->fids)) - n = ep->fids; - if (n < ep->fids) { - if (EF_IS_GAME_STATE(cur_type) && n != ep->csize) + if (CANT_HAPPEN(maxid > ep->fids)) + maxid = ep->fids; + if (maxid < ep->fids) { + if (EF_IS_GAME_STATE(cur_type) && maxid != ep->csize) /* TODO truncate file */ gripe("Warning: should resize table %s from %d to %d, not implemented", - ef_nameof(cur_type), ep->csize, n); + ef_nameof(cur_type), ep->csize, maxid); else if (cur_type >= EF_SHIP_CHR && cur_type <= EF_NUKE_CHR) - ep->cids = ep->fids = n; + ep->cids = ep->fids = maxid; else return gripe("Table %s requires %d rows, got %d", - ef_nameof(cur_type), ep->fids, n); + ef_nameof(cur_type), ep->fids, maxid); } if (need_sentinel) { - if (CANT_HAPPEN(n >= ep->csize)) + if (CANT_HAPPEN(maxid >= ep->csize)) return gripe("No space for sentinel"); - memset(ep->cache + ep->size * n, 0, ep->size); + memset(ep->cache + ep->size * maxid, 0, ep->size); } - return row; + return i; }