(u_char, u_short, u_int): BSDisms. Figuring out whether sys/types.h

defines them would be possible, but isn't worth the trouble.  Replace
by unabbreviated types.
This commit is contained in:
Markus Armbruster 2006-03-25 07:05:34 +00:00
parent 21bf6b41d4
commit 8054aafb9a
22 changed files with 109 additions and 113 deletions

View file

@ -538,7 +538,7 @@ doland(s_char op, int arg, s_char *p, struct sctstr *sect)
case 'e':
new = errcheck(arg, 0, 100);
noise(sect, 1, "Efficiency", (int)sect->sct_effic, new);
sect->sct_effic = (u_char)new;
sect->sct_effic = (unsigned char)new;
break;
case 'm':
new = errcheck(arg, -127, 255);
@ -548,39 +548,39 @@ doland(s_char op, int arg, s_char *p, struct sctstr *sect)
case 'i':
new = errcheck(arg, 0, 127);
noise(sect, 1, "Iron ore content", (int)sect->sct_min, new);
sect->sct_min = (u_char)new;
sect->sct_min = (unsigned char)new;
break;
case 'g':
new = errcheck(arg, 0, 127);
noise(sect, 1, "Gold content", (int)sect->sct_gmin, new);
sect->sct_gmin = (u_char)new;
sect->sct_gmin = (unsigned char)new;
break;
case 'f':
new = errcheck(arg, 0, 127);
noise(sect, 1, "Fertility", (int)sect->sct_fertil, new);
sect->sct_fertil = (u_char)new;
sect->sct_fertil = (unsigned char)new;
break;
case 'c':
new = errcheck(arg, 0, 127);
noise(sect, 1, "Oil content", (int)sect->sct_oil, new);
sect->sct_oil = (u_char)new;
sect->sct_oil = (unsigned char)new;
break;
case 'u':
new = errcheck(arg, 0, 127);
noise(sect, 1, "Uranium content", (int)sect->sct_uran, new);
sect->sct_uran = (u_char)new;
sect->sct_uran = (unsigned char)new;
break;
case 'w':
new = errcheck(arg, 0, 100);
noise(sect, 1, "Workforce percentage", (int)sect->sct_work, new);
sect->sct_work = (u_char)new;
sect->sct_work = (unsigned char)new;
break;
case 'l':
new = errcheck(arg, 0, 127);
pr("Loyalty of %s changed from %d to %d%%\n",
xyas(sect->sct_x, sect->sct_y, player->cnum),
sect->sct_loyal, new);
sect->sct_loyal = (u_char)new;
sect->sct_loyal = (unsigned char)new;
break;
case 'x':
old = sect->sct_che;
@ -1136,7 +1136,7 @@ doplane(s_char op, int arg, s_char *p, struct plnstr *plane)
plane->pln_def = (s_char)arg;
break;
case 'r':
plane->pln_range = (u_char)arg;
plane->pln_range = (unsigned char)arg;
break;
case 's':
plane->pln_ship = arg;

View file

@ -61,7 +61,7 @@ look(void)
int x, y;
int civ;
int mil;
u_char *bitmap;
unsigned char *bitmap;
int changed = 0;
if (!snxtitem(&ni, EF_SHIP, player->argp[1]))
@ -186,7 +186,7 @@ llook(void)
int x, y;
int civ;
int mil;
u_char *bitmap;
unsigned char *bitmap;
int changed = 0;
if (!snxtitem(&ni, EF_LAND, player->argp[1]))

View file

@ -232,7 +232,7 @@ multifire(void)
continue;
if (item.sect.sct_type != SCT_FORTR)
continue;
if (item.sect.sct_effic < ((u_char)FORTEFF)) {
if (item.sect.sct_effic < FORTEFF) {
pr("Fort not efficient enough to fire!\n");
continue;
}

View file

@ -224,7 +224,7 @@ 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 = NULL;
static unsigned char *bitmap = NULL;
static s_char *wmapbuf = NULL;
static s_char **wmap = NULL;
s_char what[64];

View file

@ -89,7 +89,7 @@ prod(void)
int used; /* production w/infinite workforce */
i_type it;
i_type vtype;
u_char *resource;
unsigned char *resource;
s_char maxc[MAXPRCON][10];
s_char use[MAXPRCON][10];
int lcms, hcms;
@ -100,7 +100,7 @@ prod(void)
int type;
int eff;
int maxpop;
u_char otype;
int otype;
if (!snxtsct(&nstr, player->argp[1]))
return RET_SYN;
@ -199,7 +199,7 @@ prod(void)
goto is_enlist;
if (pp->p_nrndx != 0) {
unit_work++;
resource = (u_char *)&sect + pp->p_nrndx;
resource = (unsigned char *)&sect + pp->p_nrndx;
p_e = (*resource * p_e) / 100.0;
}
/*

View file

@ -79,7 +79,7 @@ setres(void)
if (sect.sct_own != 0)
resnoise(&sect, 1, "Iron ore content",
(int)sect.sct_min, amt);
sect.sct_min = (u_char)amt;
sect.sct_min = (unsigned char)amt;
putsect(&sect);
}
break;
@ -98,7 +98,7 @@ setres(void)
if (sect.sct_own != 0)
resnoise(&sect, 1, "Gold content",
(int)sect.sct_gmin, amt);
sect.sct_gmin = (u_char)amt;
sect.sct_gmin = (unsigned char)amt;
putsect(&sect);
}
break;
@ -116,7 +116,7 @@ setres(void)
amt = 0;
if (sect.sct_own != 0)
resnoise(&sect, 1, "Oil content", (int)sect.sct_oil, amt);
sect.sct_oil = (u_char)amt;
sect.sct_oil = (unsigned char)amt;
putsect(&sect);
}
break;
@ -135,7 +135,7 @@ setres(void)
if (sect.sct_own != 0)
resnoise(&sect, 1, "Fertility content",
(int)sect.sct_fertil, amt);
sect.sct_fertil = (u_char)amt;
sect.sct_fertil = (unsigned char)amt;
putsect(&sect);
}
break;
@ -154,7 +154,7 @@ setres(void)
if (sect.sct_own != 0)
resnoise(&sect, 1, "Uranium content",
(int)sect.sct_uran, amt);
sect.sct_uran = (u_char)amt;
sect.sct_uran = (unsigned char)amt;
putsect(&sect);
}
break;

View file

@ -87,7 +87,7 @@ setsector(void)
if (sect.sct_own != 0)
resnoise(&sect, 1, "Iron ore content",
(int)sect.sct_min, current);
sect.sct_min = (u_char)current;
sect.sct_min = (unsigned char)current;
putsect(&sect);
}
break;
@ -108,7 +108,7 @@ setsector(void)
if (sect.sct_own != 0)
resnoise(&sect, 1, "Gold content",
(int)sect.sct_gmin, current);
sect.sct_gmin = (u_char)current;
sect.sct_gmin = (unsigned char)current;
putsect(&sect);
}
break;
@ -131,7 +131,7 @@ setsector(void)
if (sect.sct_own != 0)
resnoise(&sect, 1, "Oil content",
(int)sect.sct_oil, current);
sect.sct_oil = (u_char)current;
sect.sct_oil = (unsigned char)current;
putsect(&sect);
}
break;
@ -204,7 +204,7 @@ setsector(void)
current = 100;
pr("Efficiency in %s changed to %d.\n",
xyas(sect.sct_x, sect.sct_y, player->cnum), current);
sect.sct_effic = (u_char)current;
sect.sct_effic = (unsigned char)current;
putsect(&sect);
}
break;
@ -291,7 +291,7 @@ setsector(void)
current = 100;
pr("Work in %s changed to %d.\n",
xyas(sect.sct_x, sect.sct_y, player->cnum), current);
sect.sct_work = (u_char)current;
sect.sct_work = (unsigned char)current;
putsect(&sect);
}
break;
@ -312,7 +312,7 @@ setsector(void)
if (sect.sct_own != 0)
resnoise(&sect, 1, "Fertility content",
(int)sect.sct_fertil, current);
sect.sct_fertil = (u_char)current;
sect.sct_fertil = (unsigned char)current;
putsect(&sect);
}
break;
@ -333,7 +333,7 @@ setsector(void)
if (sect.sct_own != 0)
resnoise(&sect, 1, "Uranium content",
(int)sect.sct_uran, current);
sect.sct_uran = (u_char)current;
sect.sct_uran = (unsigned char)current;
putsect(&sect);
}
break;