diff --git a/doc/coding b/doc/coding index cbf1a630..179a96c2 100644 --- a/doc/coding +++ b/doc/coding @@ -334,8 +334,6 @@ FIXME reserved names FIXME conditional compilation is a last resort -FIXME s_char - Robustness ---------- diff --git a/include/common.h b/include/common.h index 1e58c910..d4d42f50 100644 --- a/include/common.h +++ b/include/common.h @@ -35,7 +35,7 @@ #define COMMON_H #include /* FILE */ -#include "misc.h" /* s_char coord natid */ +#include "misc.h" #include "sect.h" /* struct sctstr */ #include "ship.h" /* struct shpstr */ #include "land.h" /* struct lndstr */ diff --git a/include/gen.h b/include/gen.h index 3faef5bb..e8d2ede0 100644 --- a/include/gen.h +++ b/include/gen.h @@ -35,7 +35,7 @@ #define GEN_H #include /* atoi etc. */ -#include "misc.h" /* s_char etc */ +#include "misc.h" #include "xy.h" /* struct range */ #include "prototypes.h" /* must come at end, after defines and typedefs */ diff --git a/include/genitem.h b/include/genitem.h index 8022959e..7e14d960 100644 --- a/include/genitem.h +++ b/include/genitem.h @@ -47,11 +47,11 @@ struct genitem { short uid; coord x; coord y; - s_char type; - s_char effic; - s_char mobil; + signed char type; + signed char effic; + signed char mobil; short tech; - s_char group; + char group; coord opx, opy; short mission; short radius; diff --git a/include/ioqueue.h b/include/ioqueue.h index d8b78bbf..515db71a 100644 --- a/include/ioqueue.h +++ b/include/ioqueue.h @@ -39,7 +39,7 @@ struct io { int size; int nbytes; int offset; - s_char *data; + char *data; }; struct ioqueue { diff --git a/include/land.h b/include/land.h index beb5d4df..02cd94b4 100644 --- a/include/land.h +++ b/include/land.h @@ -54,18 +54,18 @@ struct lndstr { short lnd_uid; /* unit id (land unit) */ coord lnd_x; /* x location in abs coords */ coord lnd_y; /* y location in abs coords */ - s_char lnd_type; /* index in lchr[] */ - s_char lnd_effic; /* 0% to 100% */ - s_char lnd_mobil; /* mobility units made int for RS/6000 */ + signed char lnd_type; /* index in lchr[] */ + signed char lnd_effic; /* 0% to 100% */ + signed char lnd_mobil; /* mobility units */ short lnd_tech; /* tech level ship was built at */ - s_char lnd_army; /* group membership */ + char lnd_army; /* group membership */ coord lnd_opx, lnd_opy; /* Op sector coords */ short lnd_mission; /* mission code */ short lnd_radius; /* mission radius */ /* end of part matching struct genitem */ - s_char lnd_flags; /* unit flags (unused) */ + signed char lnd_flags; /* unit flags (unused) */ short lnd_ship; /* pointer to transporting ship */ - s_char lnd_harden; /* for missiles */ + signed char lnd_harden; /* fortification */ short lnd_retreat; /* retreat percentage */ unsigned char lnd_fuel; /* How much fuel do we have */ unsigned char lnd_nxlight; /* How many xlight planes on board? */ diff --git a/include/loan.h b/include/loan.h index f2e2ff01..60949b4f 100644 --- a/include/loan.h +++ b/include/loan.h @@ -42,7 +42,7 @@ struct lonstr { natid l_loner; /* loan shark */ short l_uid; natid l_lonee; /* sucker */ - s_char l_status; /* loan status */ + signed char l_status; /* loan status */ short l_sell; /* pointer to trade file (unused) */ int l_irate; /* interest rate */ int l_ldur; /* intended duration */ diff --git a/include/map.h b/include/map.h index 249b8339..386eee12 100644 --- a/include/map.h +++ b/include/map.h @@ -41,7 +41,7 @@ extern void blankfill(char *, struct range *, int); /* src/lib/subs/border.c */ -extern int map_set(natid, coord, coord, s_char, int); +extern int map_set(natid, coord, coord, char, int); extern void writebmap(natid); extern void writemap(natid); /* src/lib/subs/border.c */ diff --git a/include/misc.h b/include/misc.h index d476f4d1..f3603ce6 100644 --- a/include/misc.h +++ b/include/misc.h @@ -87,16 +87,6 @@ struct mob_acc_globals { typedef unsigned char natid; /* NSC_NATID must match this */ -/* - * TODO s_char has to go. Use plain char for characters and strings, - * signed char for small integers. - */ -#ifdef __CHAR_UNSIGNED__ -typedef signed char s_char; -#else -typedef char s_char; -#endif - typedef short coord; #ifndef bit diff --git a/include/nat.h b/include/nat.h index ea65cb77..7e6367ac 100644 --- a/include/nat.h +++ b/include/nat.h @@ -98,8 +98,8 @@ struct natstr { char nat_userid[32]; /* userid of last user, may be empty */ coord nat_xcap, nat_ycap; /* cap location in abs coords */ coord nat_xorg, nat_yorg; /* origin location in abs coords */ - s_char nat_dayno; /* day of the year mod 128 */ - s_char nat_update; /* Want an update or not. */ + signed char nat_dayno; /* day of the year mod 128 */ + signed char nat_update; /* Want an update or not. */ unsigned char nat_missed; /* How many updates missed */ unsigned short nat_tgms; /* # of telegrams to be announced */ unsigned short nat_ann; /* # of annos pending */ @@ -115,7 +115,7 @@ struct natstr { short nat_relate[MAXNOC]; unsigned char nat_contact[MAXNOC]; short nat_rejects[(MAXNOC + 3) / 4]; /* four bits for each country */ - s_char nat_priorities[PRI_MAX+1]; /* budget priority */ + signed char nat_priorities[PRI_MAX+1]; /* budget priority */ long nat_flags; /* nation flags */ char nat_spare[15]; }; diff --git a/include/news.h b/include/news.h index 313290d5..2ad1df3b 100644 --- a/include/news.h +++ b/include/news.h @@ -47,9 +47,9 @@ struct nwsstr { short ef_type; natid nws_ano; /* "actor" country # */ short nws_uid; /* unused */ - s_char nws_vrb; /* action (verb) */ + signed char nws_vrb; /* action (verb) */ natid nws_vno; /* "victim" country # */ - s_char nws_ntm; /* number of times */ + signed char nws_ntm; /* number of times */ time_t nws_when; /* time of action */ }; diff --git a/include/nuke.h b/include/nuke.h index 6115e9f2..054c3480 100644 --- a/include/nuke.h +++ b/include/nuke.h @@ -45,7 +45,7 @@ struct nukstr { coord nuk_x; /* current loc of device */ coord nuk_y; /* end of part matching struct genitem */ - s_char nuk_n; /* number of nukes in list */ + signed char nuk_n; /* number of nukes in list */ short nuk_ship; /* currently aboard ship (unused) */ short nuk_trade; /* index into trade file (unused) */ short nuk_types[N_MAXNUKE]; /* # of nukes in sector of given type */ diff --git a/include/plane.h b/include/plane.h index 3f556c33..5b573afa 100644 --- a/include/plane.h +++ b/include/plane.h @@ -53,11 +53,11 @@ struct plnstr { short pln_uid; /* plane unit id */ coord pln_x; /* plane x-y */ coord pln_y; - s_char pln_type; /* index in plchr[] */ - s_char pln_effic; /* actually "training" */ - s_char pln_mobil; /* plane mobility */ + signed char pln_type; /* index in plchr[] */ + signed char pln_effic; /* actually "training" */ + signed char pln_mobil; /* plane mobility */ short pln_tech; /* plane's tech level */ - s_char pln_wing; /* like fleet */ + char pln_wing; /* like fleet */ coord pln_opx; /* Op sector coords */ coord pln_opy; /* Op sector coords */ short pln_mission; /* mission code */ @@ -72,9 +72,9 @@ struct plnstr { int pln_acc; int pln_load; int pln_fuel; /* (unused) */ - s_char pln_harden; /* for missiles */ - s_char pln_nuketype; /* type of nuclear armament (if any) */ - s_char pln_flags; /* State of the plane */ + signed char pln_harden; /* for missiles */ + signed char pln_nuketype; /* type of nuclear armament (if any) */ + signed char pln_flags; /* State of the plane */ time_t pln_access; /* Last time mob was updated (MOB_ACCESS) */ time_t pln_timestamp; /* Last time this plane was touched */ float pln_theta; /* position in orbital sine wave */ diff --git a/include/prototypes.h b/include/prototypes.h index 97559e7e..f78a3b81 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -309,8 +309,8 @@ extern void loginit(char *); extern void logerror(char *, ...) ATTRIBUTE((format (printf, 1, 2))); /* more in misc.h */ /* maps.c */ -extern int draw_map(int, s_char, int, struct nstr_sect *); -extern int unit_map(int, int, struct nstr_sect *, s_char *); +extern int draw_map(int, char, int, struct nstr_sect *); +extern int unit_map(int, int, struct nstr_sect *, char *); extern int bmaps_intersect(natid, natid); extern int share_bmap(natid, natid, struct nstr_sect *, char, char *); /* move.c */ @@ -340,7 +340,7 @@ extern void snxtitem_area(struct nstr_item *, int, extern void snxtitem_dist(struct nstr_item *, int, int, int, int); extern void snxtitem_xy(struct nstr_item *, int, coord, coord); extern void snxtitem_all(struct nstr_item *, int); -extern void snxtitem_group(struct nstr_item *, int, s_char); +extern void snxtitem_group(struct nstr_item *, int, char); extern void snxtitem_rewind(struct nstr_item *); extern int snxtitem_list(struct nstr_item *, int, int *, int); /* snxtsect_subs.c */ @@ -510,8 +510,7 @@ extern int islist(char *); extern char *mission_name(short); extern char *nameofitem(struct genitem *, int); extern int collateral_damage(coord, coord, int, struct emp_qelem *); -extern int mission_pln_equip(struct plist *, struct ichrstr *, int, - s_char); +extern int mission_pln_equip(struct plist *, struct ichrstr *, int, char); extern int ground_interdict(coord, coord, natid, char *); extern int unit_interdict(coord, coord, natid, char *, int, int); extern int off_support(coord, coord, natid, natid); @@ -589,7 +588,7 @@ extern void count_land_planes(struct lndstr *); extern int count_sect_planes(struct sctstr *); extern int put_plane_on_land(struct plnstr *, struct lndstr *); extern int pln_hitchance(struct plnstr *, int, int); -extern int pln_damage(struct plnstr *, coord, coord, s_char, int *, int); +extern int pln_damage(struct plnstr *, coord, coord, char, int *, int); extern int pln_identchance(struct plnstr *, int, int); extern void pln_set_tech(struct plnstr *, int); /* pr.c */ diff --git a/include/ship.h b/include/ship.h index 41ba7cd5..feb6526a 100644 --- a/include/ship.h +++ b/include/ship.h @@ -66,11 +66,11 @@ struct shpstr { short shp_uid; /* unit id (ship #) */ coord shp_x; /* x location in abs coords */ coord shp_y; /* y location in abs coords */ - s_char shp_type; /* index in mchr[] */ - s_char shp_effic; /* 0% to 100% */ - s_char shp_mobil; /* mobility units */ + signed char shp_type; /* index in mchr[] */ + signed char shp_effic; /* 0% to 100% */ + signed char shp_mobil; /* mobility units */ short shp_tech; /* tech level ship was built at */ - s_char shp_fleet; /* group membership */ + char shp_fleet; /* group membership */ coord shp_opx, shp_opy; /* Op sector coords */ short shp_mission; /* mission code */ short shp_radius; /* mission radius */ @@ -117,7 +117,7 @@ struct fltelemstr { struct fltheadstr { int leader; - s_char real_q; + signed char real_q; /* defines for the real_q member */ #define LEADER_VIRTUAL 0 #define LEADER_REAL 1 diff --git a/include/tel.h b/include/tel.h index 4b090603..130210d8 100644 --- a/include/tel.h +++ b/include/tel.h @@ -46,7 +46,7 @@ struct telstr { natid tel_from; /* sender */ - s_char tel_type; + signed char tel_type; long tel_length; /* how long */ time_t tel_date; /* when sent */ }; diff --git a/include/treaty.h b/include/treaty.h index da5be58e..d5fc5997 100644 --- a/include/treaty.h +++ b/include/treaty.h @@ -39,8 +39,8 @@ struct trtstr { natid trt_cna; /* proposer */ short trt_uid; natid trt_cnb; /* acceptor */ - s_char trt_status; /* treaty status */ - s_char trt_fill; + signed char trt_status; /* treaty status */ + char trt_fill; short trt_acond; /* conditions for proposer */ short trt_bcond; /* conditions for accepter */ float trt_bond; /* amount of bond involved (unused) */ diff --git a/src/lib/commands/cens.c b/src/lib/commands/cens.c index b0f61b31..5366f6cc 100644 --- a/src/lib/commands/cens.c +++ b/src/lib/commands/cens.c @@ -47,7 +47,7 @@ cens(void) int nsect; int n; struct nstr_sect nstr; - s_char dirstr[20]; + char dirstr[20]; if (!snxtsct(&nstr, player->argp[1])) return RET_SYN; diff --git a/src/lib/commands/cons.c b/src/lib/commands/cons.c index f20e8e89..7ed3ae73 100644 --- a/src/lib/commands/cons.c +++ b/src/lib/commands/cons.c @@ -56,7 +56,7 @@ struct ltcomstr { natid proposer; /* country offering */ natid proposee; /* country offered to */ natid mailee; /* who gets mail about it */ - s_char op; /* 'a', 'd', or 'p' */ + char op; /* 'a', 'd', or 'p' */ union { struct lonstr l; /* the loan */ struct trtstr t; /* the treaty */ diff --git a/src/lib/commands/map.c b/src/lib/commands/map.c index 7f0505b4..71977fe1 100644 --- a/src/lib/commands/map.c +++ b/src/lib/commands/map.c @@ -53,7 +53,7 @@ map(void) int unit_type = 0; int bmap = 0; struct nstr_sect ns; - s_char origin = '\0'; + char origin = '\0'; int map_flags = 0; if (**player->argp != 'm') { diff --git a/src/lib/commands/marc.c b/src/lib/commands/marc.c index 41bc9fc8..25934c66 100644 --- a/src/lib/commands/marc.c +++ b/src/lib/commands/marc.c @@ -57,7 +57,7 @@ march(void) char *cp = 0; struct lndstr *lnd = 0; /* leader */ struct nstr_sect ns; - s_char origin; + char origin; int dir; int stopping = 0; int skip = 0; diff --git a/src/lib/commands/navi.c b/src/lib/commands/navi.c index ad7de063..68785283 100644 --- a/src/lib/commands/navi.c +++ b/src/lib/commands/navi.c @@ -59,7 +59,7 @@ navi(void) char *cp = 0; struct shpstr *shp = 0; /* flagship */ struct nstr_sect ns; - s_char origin; + char origin; int dir; int stopping = 0; int skip = 0; diff --git a/src/lib/commands/shar.c b/src/lib/commands/shar.c index 9cabbaa8..89845484 100644 --- a/src/lib/commands/shar.c +++ b/src/lib/commands/shar.c @@ -45,7 +45,7 @@ shar(void) { int to; struct nstr_sect ns; - s_char des = 0; + char des = 0; int n; to = natarg(player->argp[1], "Share bmap with which country? "); diff --git a/src/lib/common/maps.c b/src/lib/common/maps.c index b19640dc..796c642f 100644 --- a/src/lib/common/maps.c +++ b/src/lib/common/maps.c @@ -54,7 +54,7 @@ static int bmnxtsct(struct nstr_sect *); static char map_char(unsigned char type, natid own, int owner_or_god); int -draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp) +draw_map(int bmap, char origin, int map_flags, struct nstr_sect *nsp) { struct natstr *np; struct range range; @@ -302,7 +302,7 @@ map_char(unsigned char type, natid own, int owner_or_god) } int -unit_map(int unit_type, int uid, struct nstr_sect *nsp, s_char *originp) +unit_map(int unit_type, int uid, struct nstr_sect *nsp, char *originp) { struct shpstr origs; struct lndstr origl; @@ -339,8 +339,8 @@ unit_map(int unit_type, int uid, struct nstr_sect *nsp, s_char *originp) int bmaps_intersect(natid a, natid b) { - s_char *mapa = ef_ptr(EF_MAP, a); - s_char *mapb = ef_ptr(EF_MAP, b); + char *mapa = ef_ptr(EF_MAP, a); + char *mapb = ef_ptr(EF_MAP, b); int i; for (i = 0; i < WORLD_X * WORLD_Y / 2; ++i, ++mapa, ++mapb) diff --git a/src/lib/gen/io.c b/src/lib/gen/io.c index fabeb997..76fd1025 100644 --- a/src/lib/gen/io.c +++ b/src/lib/gen/io.c @@ -194,7 +194,7 @@ io_output(struct iop *iop, int waitforoutput) #if !defined(_WIN32) struct iovec iov[16]; #else - s_char buf[IO_BUFSIZE]; + char buf[IO_BUFSIZE]; #endif int cc; int n; diff --git a/src/lib/gen/ioqueue.c b/src/lib/gen/ioqueue.c index 78d02393..adb96010 100644 --- a/src/lib/gen/ioqueue.c +++ b/src/lib/gen/ioqueue.c @@ -225,9 +225,9 @@ ioqtobuf(struct ioqueue *ioq, char *buf, int cc) static int ioqtocbuf(struct ioqueue *ioq, char *buf, int cc, register int stopc) { - register int nbytes; - register s_char *p; - register int n; + int nbytes; + char *p; + int n; struct io *io; struct emp_qelem *qp; struct emp_qelem *head; @@ -298,7 +298,7 @@ appendcc(struct ioqueue *ioq, char *buf, int cc) { struct io *io; int len; - s_char *ptr; + char *ptr; int avail; /* determine if any space is left */ @@ -389,7 +389,7 @@ ioq_makebuf(struct ioqueue *ioq, char *pBuf, int nBufLen) int nbytes; int nleft; int ncopied; - s_char *offset; + char *offset; ncopied = 0; nleft = nBufLen; diff --git a/src/lib/subs/aircombat.c b/src/lib/subs/aircombat.c index aeff1584..c47fd354 100644 --- a/src/lib/subs/aircombat.c +++ b/src/lib/subs/aircombat.c @@ -702,7 +702,6 @@ ac_planedamage(struct plist *plp, natid from, int dam, natid other, int eff; struct shpstr ship; struct lndstr land; - /* s_char *sprintf(); already in misc.h [JFW] */ natid plane_owner; disp = 0; diff --git a/src/lib/subs/attsub.c b/src/lib/subs/attsub.c index 29f39059..5ef75ca5 100644 --- a/src/lib/subs/attsub.c +++ b/src/lib/subs/attsub.c @@ -58,7 +58,7 @@ static void ask_olist(int combat_mode, struct combat *off, struct combat *def, struct emp_qelem *olist, - s_char *land_answer, int *a_spyp, int *a_engineerp); + char *land_answer, int *a_spyp, int *a_engineerp); static void take_move_in_mob(int combat_mode, struct llist *llp, struct combat *off, struct combat *def); static void move_in_land(int combat_mode, struct combat *off, @@ -382,7 +382,7 @@ put_combat(struct combat *com) if (com->mob - com->mobcost < -127) land.lnd_mobil = -127; else - land.lnd_mobil = (s_char)(com->mob - com->mobcost); + land.lnd_mobil = (signed char)(com->mob - com->mobcost); } makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x, land.lnd_y); @@ -410,7 +410,7 @@ put_combat(struct combat *com) if (com->mob - com->mobcost < -127) ship.shp_mobil = -127; else - ship.shp_mobil = (s_char)(com->mob - com->mobcost); + ship.shp_mobil = (signed char)(com->mob - com->mobcost); } makelost(EF_SHIP, ship.shp_own, ship.shp_uid, ship.shp_x, ship.shp_y); @@ -766,7 +766,7 @@ att_ask_offense(int combat_mode, struct combat *off, struct combat *def, struct emp_qelem *olist, int *a_spyp, int *a_engineerp) { int n; - s_char land_answer[1024]; + char land_answer[1024]; emp_initque(olist); if (att_abort(combat_mode, off, def)) @@ -947,7 +947,7 @@ att_prompt(char *prompt, char army) static void ask_olist(int combat_mode, struct combat *off, struct combat *def, - struct emp_qelem *olist, s_char *land_answer, int *a_spyp, + struct emp_qelem *olist, char *land_answer, int *a_spyp, int *a_engineerp) { struct nstr_item ni; @@ -2283,8 +2283,8 @@ ask_move_in(struct combat *off, struct emp_qelem *olist, struct llist *llp; char buf[512]; char prompt[512]; - s_char land_answer[1024]; - s_char *answerp; + char land_answer[1024]; + char *answerp; for (n = 0; n <= off->last; ++n) if (off[n].type != EF_BAD && off[n].troops > 0) diff --git a/src/lib/subs/bigmap.c b/src/lib/subs/bigmap.c index 53160972..4c521186 100644 --- a/src/lib/subs/bigmap.c +++ b/src/lib/subs/bigmap.c @@ -45,10 +45,10 @@ * 2 = update only bmap with force */ -static int do_map_set(s_char *map, coord x, coord y, s_char t, int force); +static int do_map_set(char *map, coord x, coord y, char t, int force); int -map_set(natid cnum, coord x, coord y, s_char t, int only_bmap) +map_set(natid cnum, coord x, coord y, char t, int only_bmap) { int set = 0; @@ -63,10 +63,10 @@ map_set(natid cnum, coord x, coord y, s_char t, int only_bmap) static int -do_map_set(s_char *map, coord x, coord y, s_char t, int force) +do_map_set(char *map, coord x, coord y, char t, int force) { int id; - s_char ot; + char ot; if ((id = sctoff(x, y)) < 0) return 0; diff --git a/src/lib/subs/lndsub.c b/src/lib/subs/lndsub.c index 12d8c07b..b2c3c3a5 100644 --- a/src/lib/subs/lndsub.c +++ b/src/lib/subs/lndsub.c @@ -187,7 +187,7 @@ lnd_take_casualty(int combat_mode, struct llist *llp, int cas) int nowhere_to_go = 0; struct sctstr rsect; double mobcost; - s_char orig; + signed char orig; int mob; taken = lnd_getmil(&llp->land); @@ -272,7 +272,7 @@ lnd_take_casualty(int combat_mode, struct llist *llp, int cas) if (mob < -127) mob = -127; orig = llp->land.lnd_mobil; - llp->land.lnd_mobil = (s_char)mob; + llp->land.lnd_mobil = (signed char)mob; if (llp->land.lnd_mobil > orig) llp->land.lnd_mobil = -127; sprintf(buf, "retreats at %d%% efficiency to %s!", @@ -326,7 +326,7 @@ lnd_takemob(struct emp_qelem *list, double loss) new = llp->land.lnd_mobil - mcost; if (new < -127) new = -127; - llp->land.lnd_mobil = (s_char)new; + llp->land.lnd_mobil = (signed char)new; } } int diff --git a/src/lib/subs/mission.c b/src/lib/subs/mission.c index 4555f257..a792415b 100644 --- a/src/lib/subs/mission.c +++ b/src/lib/subs/mission.c @@ -1219,7 +1219,7 @@ mission_pln_arm(struct emp_qelem *list, coord x, coord y, int dist, int mission_pln_equip(struct plist *plp, struct ichrstr *ip, int flags, - s_char mission) + char mission) { struct plchrstr *pcp; struct plnstr *pp; diff --git a/src/lib/subs/plnsub.c b/src/lib/subs/plnsub.c index 0248f032..1f68ac78 100644 --- a/src/lib/subs/plnsub.c +++ b/src/lib/subs/plnsub.c @@ -52,7 +52,7 @@ #include "prototypes.h" #include "optlist.h" -static int pln_equip(struct plist *, struct ichrstr *, int, s_char); +static int pln_equip(struct plist *, struct ichrstr *, int, char); /* * Get assembly point argument. @@ -605,7 +605,7 @@ pln_arm(struct emp_qelem *list, int dist, int mission, struct ichrstr *ip, } static int -pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission) +pln_equip(struct plist *plp, struct ichrstr *ip, int flags, char mission) { struct plchrstr *pcp; struct plnstr *pp; @@ -1159,7 +1159,7 @@ pln_hitchance(struct plnstr *pp, int hardtarget, int type) /* return 0 if there was a nuclear detonation */ int -pln_damage(struct plnstr *pp, coord x, coord y, s_char type, int *nukedamp, +pln_damage(struct plnstr *pp, coord x, coord y, char type, int *nukedamp, int noisy) { struct plchrstr *pcp = plchr + pp->pln_type; diff --git a/src/lib/subs/radmap.c b/src/lib/subs/radmap.c index d353f17b..516c2386 100644 --- a/src/lib/subs/radmap.c +++ b/src/lib/subs/radmap.c @@ -70,8 +70,8 @@ radmapupd(int own, int cx, int cy, int eff, int range, double seesub) * want to do this in other places too where it doesn't matter. */ static char **rad; static char *radbuf; -static s_char **vis; -static s_char *visbuf; +static signed char **vis; +static signed char *visbuf; static void radmap2(int owner, @@ -100,7 +100,7 @@ radmap2(int owner, } } if (!vis) { - vis = malloc(WORLD_Y * sizeof(s_char *)); + vis = malloc(WORLD_Y * sizeof(signed char *)); if (vis && visbuf) { for (x = 0; x < WORLD_Y; x++) vis[x] = &visbuf[(WORLD_X + 1) * x]; diff --git a/src/lib/subs/satmap.c b/src/lib/subs/satmap.c index 1191c0f5..06bfde29 100644 --- a/src/lib/subs/satmap.c +++ b/src/lib/subs/satmap.c @@ -64,7 +64,7 @@ satmap(int x, int y, int eff, int range, int flags, int type) int n; int changed = 0; long crackle; - s_char noise[100]; + signed char noise[100]; char selection[1024]; if (!eff) diff --git a/src/lib/subs/shpsub.c b/src/lib/subs/shpsub.c index 710e482d..698ef848 100644 --- a/src/lib/subs/shpsub.c +++ b/src/lib/subs/shpsub.c @@ -636,7 +636,7 @@ shp_fort_interdiction(struct emp_qelem *list, coord newx, coord newy, int shell, gun; int dam; int totdam = 0; - s_char notified[MAXNOC]; + signed char notified[MAXNOC]; int i; /* Inform neutral and worse */ diff --git a/src/lib/subs/snxtitem.c b/src/lib/subs/snxtitem.c index e88ff773..992a01ce 100644 --- a/src/lib/subs/snxtitem.c +++ b/src/lib/subs/snxtitem.c @@ -192,7 +192,7 @@ snxtitem_all(struct nstr_item *np, int type) } void -snxtitem_group(struct nstr_item *np, int type, s_char group) +snxtitem_group(struct nstr_item *np, int type, char group) { if (group == '~') group = ' '; diff --git a/src/lib/update/land.c b/src/lib/update/land.c index 64af50b7..ff328c41 100644 --- a/src/lib/update/land.c +++ b/src/lib/update/land.c @@ -340,7 +340,7 @@ landrepair(struct lndstr *land, struct natstr *np, logerror("land unit %d building %d ! \n", land->lnd_uid, build); np->nat_money -= mult * lp->l_cost * build / 100.0; if (!player->simulation) { - land->lnd_effic += (s_char)build; + land->lnd_effic += (signed char)build; putsect(sp); } diff --git a/src/lib/update/mobility.c b/src/lib/update/mobility.c index bdeed553..62c52605 100644 --- a/src/lib/update/mobility.c +++ b/src/lib/update/mobility.c @@ -310,7 +310,7 @@ do_mob_ship(struct shpstr *sp, int etus) value = sp->shp_mobil + ((float)etus * ship_mob_scale); if (value > ship_mob_max) value = ship_mob_max; - sp->shp_mobil = (s_char)value; + sp->shp_mobil = (signed char)value; } else { can_add = ship_mob_max - sp->shp_mobil; if (can_add > ((float)etus * ship_mob_scale)) diff --git a/src/lib/update/plane.c b/src/lib/update/plane.c index ae414833..520256b6 100644 --- a/src/lib/update/plane.c +++ b/src/lib/update/plane.c @@ -257,7 +257,7 @@ prod_plane(int etus, int natnum, int *bp, int buildem) air_money[pp->pln_own] += np->nat_money - start_money; if (!player->simulation) - pp->pln_effic += (s_char)build; + pp->pln_effic += (signed char)build; else np->nat_money = start_money; k++; diff --git a/src/scripts/indent-emp b/src/scripts/indent-emp index 0b3b5302..6ee55730 100755 --- a/src/scripts/indent-emp +++ b/src/scripts/indent-emp @@ -2,7 +2,7 @@ # indent needs to know type names do to a proper job. # Type names located with grep typedef, then extracted by hand: -types="coord empth_sem_t empth_t i_packing i_type loc_Sem_t loc_Thread_t natid ns_seltype nsc_cat nsc_flags nsc_type packed_nsc_cat packed_nsc_type s_char stkalign_t" +types="coord empth_sem_t empth_t i_packing i_type loc_Sem_t loc_Thread_t natid ns_seltype nsc_cat nsc_flags nsc_type packed_nsc_cat packed_nsc_type stkalign_t" opts="-kr -cdw -cp8 -ncs -psl -ss" for t in $types diff --git a/src/server/update.c b/src/server/update.c index d82bbc30..e6b12467 100644 --- a/src/server/update.c +++ b/src/server/update.c @@ -159,7 +159,7 @@ update_wait(void *unused) } stacksize = 100000 + /* finish_sects */ WORLD_X * WORLD_Y * (2 * sizeof(double) + - sizeof(s_char *)); + sizeof(char *)); empth_create(PP_UPDATE, update_main, stacksize, 0, "UpdateRun", "Updates the world", dp);