]> git.pond.sub.org Git - empserver/commitdiff
(u_char, u_short, u_int): BSDisms. Figuring out whether sys/types.h
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 25 Mar 2006 07:05:34 +0000 (07:05 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 25 Mar 2006 07:05:34 +0000 (07:05 +0000)
defines them would be possible, but isn't worth the trouble.  Replace
by unabbreviated types.

22 files changed:
include/land.h
include/misc.h
include/nat.h
include/plane.h
include/product.h
include/prototypes.h
include/sect.h
include/ship.h
src/lib/commands/edit.c
src/lib/commands/look.c
src/lib/commands/mfir.c
src/lib/commands/navi.c
src/lib/commands/prod.c
src/lib/commands/setres.c
src/lib/commands/setsect.c
src/lib/common/maps.c
src/lib/global/nsc.c
src/lib/subs/getbit.c
src/lib/update/produce.c
src/lib/update/sect.c
src/lib/update/ship.c
src/scripts/indent-emp

index b3d38dc579686a660bdc46aa100cca2965fbb672..c66d48df4746c3738515f37d14a37c776e814ee0 100644 (file)
@@ -67,17 +67,17 @@ struct lndstr {
     short lnd_ship;            /* pointer to transporting ship */
     s_char lnd_harden;         /* for missiles */
     short lnd_retreat;         /* retreat percentage */
-    u_char lnd_fuel;           /* How much fuel do we have */
-    u_char lnd_nxlight;                /* How many xlight planes on board? */
+    unsigned char lnd_fuel;    /* How much fuel do we have */
+    unsigned char lnd_nxlight; /* How many xlight planes on board? */
     int lnd_rflags;            /* When do I retreat? */
     char lnd_rpath[RET_LEN];   /* retreat path */
-    u_char lnd_rad_max;                /* max radius for this unit */
-    u_char lnd_scar;           /* how experienced the unit is (not used) */
+    unsigned char lnd_rad_max; /* max radius for this unit */
+    unsigned char lnd_scar;    /* how experienced the unit is (not used) */
     short lnd_item[I_MAX+1];   /* amount of items on board */
     short lnd_pstage;          /* plague stage */
     short lnd_ptime;           /* how many etus remain in this stage */
     short lnd_land;            /* pointer to transporting unit */
-    u_char lnd_nland;
+    unsigned char lnd_nland;
     time_t lnd_access;         /* Last time mob was updated (MOB_ACCESS) */
     float lnd_att;             /* attack multiplier */
     float lnd_def;             /* defense multiplier */
@@ -91,10 +91,10 @@ struct lndstr {
     int lnd_dam;               /* # of guns firing */
     int lnd_ammo;              /* firing ammu used per shot */
     int lnd_aaf;               /* aa fire */
-    u_char lnd_fuelc;          /* fuel capacity */
-    u_char lnd_fuelu;          /* fuel used per 10 mob */
-    u_char lnd_maxlight;       /* maximum number of xlight planes */
-    u_char lnd_maxland;                /* maximum number of units */
+    unsigned char lnd_fuelc;   /* fuel capacity */
+    unsigned char lnd_fuelu;   /* fuel used per 10 mob */
+    unsigned char lnd_maxlight;        /* maximum number of xlight planes */
+    unsigned char lnd_maxland; /* maximum number of units */
     time_t lnd_timestamp;      /* Last time this unit was touched */
 };
 
@@ -120,10 +120,10 @@ struct lchrstr {
     int l_dam;                 /* # of guns firing */
     int l_ammo;                        /* firing ammu used per shot */
     int l_aaf;                 /* aa fire */
-    u_char l_fuelc;            /* fuel capacity */
-    u_char l_fuelu;            /* fuel used per 10 mob */
-    u_char l_nxlight;          /* maximum number of xlight planes */
-    u_char l_nland;            /* maximum number of units */
+    unsigned char l_fuelc;     /* fuel capacity */
+    unsigned char l_fuelu;     /* fuel used per 10 mob */
+    unsigned char l_nxlight;   /* maximum number of xlight planes */
+    unsigned char l_nland;     /* maximum number of units */
     signed char l_type;                /* index in lchr[] */
     long l_flags;              /* what special things can this unit do */
 };
index a9d1b8fe1868878148a19c87852ed6d193f56267..8208c258bbbad553a7845e899cfc08354b4014ee 100644 (file)
@@ -43,9 +43,6 @@
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 
 #if defined(_WIN32)
-typedef unsigned char u_char;
-typedef unsigned short u_short;
-typedef unsigned int u_int;
 typedef long ssize_t;
 
 /* integral mismatch, due to misuse of sector short */
@@ -88,7 +85,7 @@ struct mob_acc_globals {
 #define RESOLVE_IPADDRESS      /* resolve ip addresses into hostnames */
 #endif
 
-typedef u_char natid;          /* NSC_NATID must match this */
+typedef unsigned char natid;   /* NSC_NATID must match this */
 
 /*
  * TODO s_char has to go.  Use plain char for characters and strings,
index 35119dec6b47b2d6dd06ce40188c3a4a3006bacb..ea65cb77b7e8a7d0ce2aab8df48eda0727f41d7d 100644 (file)
@@ -100,10 +100,10 @@ struct natstr {
     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. */
-    u_char nat_missed;         /* How many updates missed */
-    u_short nat_tgms;          /* # of telegrams to be announced */
-    u_short nat_ann;           /* # of annos pending */
-    u_short nat_minused;       /* number of minutes used today */
+    unsigned char nat_missed;  /* How many updates missed */
+    unsigned short nat_tgms;   /* # of telegrams to be announced */
+    unsigned short nat_ann;    /* # of annos pending */
+    unsigned short nat_minused;        /* number of minutes used today */
     short nat_btu;             /* bureaucratic time units */
     long nat_reserve;          /* military reserves */
     long nat_money;            /* moola */
index 0d40d6eb485efc402ac4e740fa319c063c5d3c8c..6035bf1e32872730f1518ffaef14f0631a11d899 100644 (file)
@@ -63,8 +63,8 @@ struct plnstr {
     short pln_mission;         /* mission code */
     short pln_radius;          /* mission radius */
     /* end of part matching struct genitem */
-    u_char pln_range;          /* total distance, not radius */
-    u_char pln_range_max;      /* max range for this plane */
+    unsigned char pln_range;   /* total distance, not radius */
+    unsigned char pln_range_max; /* max range for this plane */
     short pln_ship;            /* pointer to carrier */
     short pln_land;            /* pointer to carrier */
     int pln_att;               /* plane air-air attack/defense values */
index fb299d88276f215cd4b4b5d3503a21ddc1475ccd..967498524cfc306ce1e986c51b4c1588e1f13993 100644 (file)
@@ -45,7 +45,7 @@ enum { MAXPRCON = 3 };
 struct pchrstr {
     int p_uid;
     i_type p_ctype[MAXPRCON];  /* constituent types */
-    u_short p_camt[MAXPRCON];  /* constituent amounts */
+    unsigned short p_camt[MAXPRCON]; /* constituent amounts */
     i_type p_type;             /* product item type, or I_NONE if level */
     int p_level;               /* level index (NAT_?LEV), or -1 if item */
     int p_cost;                        /* dollars / product unit */
index d9da0bbfe0b1440294fc2a770f9d04afe49cd0ca..47bae77631bd955c99b4cc53103733bae08cab1f 100644 (file)
@@ -390,8 +390,8 @@ extern int ldround(double, int);
 extern int roundintby(int, int);
 extern int scthash(register int, register int, int);
 extern int tcp_listen(char *, char *, size_t *);
-/* plur.c */
 extern s_char *numstr(s_char buf[], int n);
+/* plur.c */
 extern s_char *esplur(int n);
 extern s_char *splur(int n);
 extern s_char *iesplur(int n);
@@ -482,10 +482,10 @@ extern int dd(natid, natid, coord, coord, int, int);
 extern int sb(natid, natid, struct sctstr *, coord, coord, int, int);
 extern int shipdef(natid, natid, coord, coord);
 /* getbit.c */
-extern int emp_getbit(int, int, u_char *);
-extern void emp_setbit(int, int, u_char *);
-extern void emp_setbitmap(int, int, u_char *, int *);
-extern void bitinit2(struct nstr_sect *, u_char *, int);
+extern int emp_getbit(int, int, unsigned char *);
+extern void emp_setbit(int, int, unsigned char *);
+extern void emp_setbitmap(int, int, unsigned char *, int *);
+extern void bitinit2(struct nstr_sect *, unsigned char *, int);
 /* getele.c */
 extern int getele(char *, char *);
 /* land.c */
index ad5613ed436e788b08c82771b3136cd0ba2acccc..34394aa2d87204c15ef87ae8d3e4e6f9b302b8c6 100644 (file)
@@ -49,43 +49,43 @@ struct sctstr {
     coord sct_x;               /* x coord of sector */
     coord sct_y;               /* y coord of sector */
     /* end of part matching struct genitem */
-    u_char sct_type;           /* sector type */
-    u_char sct_effic;          /* 0% to 100% */
+    unsigned char sct_type;    /* sector type */
+    unsigned char sct_effic;   /* 0% to 100% */
     short sct_mobil;           /* mobility units */
-    u_char sct_loyal;          /* updates until civilans "converted" */
-    u_char sct_terr;           /* territory 0 id # of sector */
-    u_char sct_terr1;          /* territory 1 id # of sector */
-    u_char sct_terr2;          /* territory 2 id # of sector */
-    u_char sct_terr3;          /* territory 3 id # of sector */
+    unsigned char sct_loyal;   /* updates until civilans "converted" */
+    unsigned char sct_terr;    /* territory 0 id # of sector */
+    unsigned char sct_terr1;   /* territory 1 id # of sector */
+    unsigned char sct_terr2;   /* territory 2 id # of sector */
+    unsigned char sct_terr3;   /* territory 3 id # of sector */
     coord sct_dist_x;          /* Dist sector */
     coord sct_dist_y;
     short sct_avail;           /* available workforce for "other things" */
     short sct_flags;           /* temporary flags */
     short sct_fill;            /* gunk */
-    u_char sct_work;           /* pct of civ actually working */
-    u_char sct_coastal;                /* is this a coastal sector? */
-    u_char sct_newtype;                /* for changing designations */
-    u_char sct_min;            /* ease of mining ore */
-    u_char sct_gmin;           /* amount of gold ore */
-    u_char sct_fertil;         /* fertility of soil */
-    u_char sct_oil;            /* oil content */
-    u_char sct_uran;           /* uranium ore content */
+    unsigned char sct_work;    /* pct of civ actually working */
+    unsigned char sct_coastal; /* is this a coastal sector? */
+    unsigned char sct_newtype; /* for changing designations */
+    unsigned char sct_min;     /* ease of mining ore */
+    unsigned char sct_gmin;    /* amount of gold ore */
+    unsigned char sct_fertil;  /* fertility of soil */
+    unsigned char sct_oil;     /* oil content */
+    unsigned char sct_uran;    /* uranium ore content */
     natid sct_oldown;          /* old owner of sector (for liberation) */
-    u_char sct_updated;                /* Has this sect been updated? */
-    u_char sct_off;            /* Should this sector produce? */
+    unsigned char sct_updated; /* Has this sect been updated? */
+    unsigned char sct_off;     /* Should this sector produce? */
     short sct_item[I_MAX+1];   /* amount of items stored here */
     short sct_del[I_MAX+1];    /* delivieries */
     short sct_dist[I_MAX+1];   /* distribution thresholds */
     short sct_mines;           /* number of mines */
     short sct_pstage;          /* plague stage */
     short sct_ptime;           /* how many etus remain in this stage */
-    u_char sct_che;            /* number of guerrillas */
+    unsigned char sct_che;     /* number of guerrillas */
     natid sct_che_target;      /* nation targeted by che */
-    u_short sct_fallout;
+    unsigned short sct_fallout;
     time_t sct_access;         /* Last time mob was updated (MOB_ACCESS) */
-    u_char sct_road;           /* Road value of a sector */
-    u_char sct_rail;           /* Rail value of a sector */
-    u_char sct_defense;                /* Defensive value of a sector */
+    unsigned char sct_road;    /* Road value of a sector */
+    unsigned char sct_rail;    /* Rail value of a sector */
+    unsigned char sct_defense; /* Defensive value of a sector */
     time_t sct_timestamp;      /* Last time this sector was written to */
 };
 
@@ -102,7 +102,7 @@ struct dchrstr {
     char d_mnem;               /* map symbol */
     int d_prd;                 /* product type */
     int d_mcst;                        /* movement cost */
-    d_navigation d_nav;                        /* navigation capability */
+    d_navigation d_nav;                /* navigation capability */
     i_packing d_pkg;           /* type of packaging in these sects */
     float d_ostr;              /* offensive strength */
     float d_dstr;              /* defensive strength */
@@ -203,10 +203,10 @@ extern struct dchrstr bigcity_dchr;
 /* Each cost is per point of efficency */
 struct sctintrins {
     char *in_name;
-    u_char in_lcms;
-    u_char in_hcms;
-    u_char in_dcost;
-    u_char in_mcost;
+    unsigned char in_lcms;
+    unsigned char in_hcms;
+    unsigned char in_dcost;
+    unsigned char in_mcost;
 };
 
 extern struct sctintrins intrchr[INT_DEF + 2];
index 9886fe4ed2f587d8a45c12235ca93ed4aacbd976..41ba7cd5948b5e13ddbe8aaea008f2e53d1e120e 100644 (file)
@@ -75,8 +75,8 @@ struct shpstr {
     short shp_mission;         /* mission code */
     short shp_radius;          /* mission radius */
     /* end of part matching struct genitem */
-    u_char shp_nplane;         /* number of planes on board */
-    u_char shp_nland;          /* number of land units on board */
+    unsigned char shp_nplane;  /* number of planes on board */
+    unsigned char shp_nland;   /* number of land units on board */
     short shp_armor;
     short shp_speed;
     short shp_visib;
@@ -88,19 +88,19 @@ struct shpstr {
     i_type shp_tend[TMAX];     /* what goods to pick up at end point   */
     short shp_lstart[TMAX];    /* How much do we pick up at the start  */
     short shp_lend[TMAX];      /* How much do we pick up at the end    */
-    u_char shp_autonav;                /* autonavigation flags */
+    unsigned char shp_autonav; /* autonavigation flags */
     short shp_item[I_MAX+1];   /* amount of items on board */
     short shp_pstage;          /* plague stage */
     short shp_ptime;           /* how many etus remain in this stage */
     time_t shp_access;         /* Last time mob was updated (MOB_ACCESS) */
     time_t shp_timestamp;      /* Last time this ship was touched. */
-    u_char shp_mobquota;       /* mobility quota */
+    unsigned char shp_mobquota;        /* mobility quota */
     char shp_path[MAXSHPPATH];
     short shp_follow;
     char shp_name[MAXSHPNAMLEN]; /* name set with the "name" command */
-    u_char shp_fuel;           /* How much fuel do we have */
-    u_char shp_nchoppers;      /* How many choppers on board? */
-    u_char shp_nxlight;                /* How many xlight planes on board? */
+    unsigned char shp_fuel;    /* How much fuel do we have */
+    unsigned char shp_nchoppers; /* How many choppers on board? */
+    unsigned char shp_nxlight; /* How many xlight planes on board? */
     coord shp_orig_x;
     coord shp_orig_y;          /* Where we were built */
     natid shp_orig_own;                /* Who built us */
@@ -139,16 +139,16 @@ struct mchrstr {
     int m_vrnge;               /* how well it can see */
     int m_frnge;               /* how far it can fire */
     int m_glim;                        /* how many guns it can fire */
-    u_char m_nxlight;          /* maximum number of xlight planes */
-    u_char m_nchoppers;                /* maximum number of choppers */
-    u_char m_fuelc;            /* fuel capacity */
-    u_char m_fuelu;            /* fuel used per 10 mob */
+    unsigned char m_nxlight;   /* maximum number of xlight planes */
+    unsigned char m_nchoppers; /* maximum number of choppers */
+    unsigned char m_fuelc;     /* fuel capacity */
+    unsigned char m_fuelu;     /* fuel used per 10 mob */
     char *m_name;              /* full name of type of ship */
     int m_tech;                        /* tech required to build */
     int m_cost;                        /* how much it costs to build */
     long m_flags;              /* what special things can this ship do */
-    u_char m_nplanes;          /* maximum number of planes this ship holds */
-    u_char m_nland;            /* maximum number of units this ship holds */
+    unsigned char m_nplanes;   /* maximum number of planes this ship holds */
+    unsigned char m_nland;     /* maximum number of units this ship holds */
     signed char m_type;                /* index in mchr[] */
 };
 
index 2766c13af5e761c40ada67effc4c817315308a6d..96198e105e621cd6bc858a44c8ab72e9f3f4c63d 100644 (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;
index 2036e7959dd71a5e00ac51ee8758871eced56098..9ffb45779f61fedec63fd372e39b1cb13724aaf9 100644 (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]))
index b5817da48a6d20a7cc9846dfa1ad1503163aeb3f..9ab80192324d1f842004b459390dc32d04565ec1 100644 (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;
            }
index 38d9a61488bea9c48fa0d1d0ee69c36f0b49bf66..56a9079a6b5f6f3d6fbfa1e714a1d79f1a6d04bd 100644 (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];
index 3f8c4f34220c80fc9dc871def484070cb3c1b6cb..ed52fc51451d3cdff5e27a86cac86ebb15fe14ca 100644 (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;
        }
        /*
index 7a5f6e1cc6858caf5d259abf94caffce79ba957a..073b3bdab9e838a6f341d1b006d4762006714566 100644 (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;
index 1e5327b5d1870ac74efc074286d7c127e860667a..777847fbef8862fb2c2f3b944886b453f01560fc 100644 (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;
index 169fdefce21bab46434858bc9babd140854d2052..558b6b161d75a5bf3f030957d9a43eb7c3e72751 100644 (file)
@@ -51,7 +51,7 @@
 #include "optlist.h"
 
 static int bmnxtsct(struct nstr_sect *);
-static s_char map_char(u_char type, natid own, int owner_or_god);
+static s_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)
@@ -66,7 +66,7 @@ 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 = NULL;
+    static unsigned char *bitmap = NULL;
     static s_char *wmapbuf = NULL;
     static s_char **wmap = NULL;
 
@@ -288,7 +288,7 @@ bmnxtsct(struct nstr_sect *np)
  * If OWNER_OR_GOD, the map is for the sector's owner or a deity.
  */
 static s_char
-map_char(u_char type, natid own, int owner_or_god)
+map_char(unsigned char type, natid own, int owner_or_god)
 {
     if (type > SCT_MAXDEF) {
        logerror("bad sector type %d\n", type);
index 26b2a9aac49f31652a03ba72fb49231d678964e6..e8f45a4f26e1630077dcc0c5d072c999faef2a92 100644 (file)
@@ -61,8 +61,8 @@
 
 #define fldoff(str, fld) offsetof(struct str, fld)
 
-#define NSC_IELT(name, pfx, sfx, base, itype)          \
-{NSC_SHORT, 0, 0, ((base) + (itype)*sizeof(u_short)),  \
+#define NSC_IELT(name, pfx, sfx, base, itype)                  \
+{NSC_SHORT, 0, 0, ((base) + (itype)*sizeof(unsigned short)),   \
 sizeof(sfx) == 1 ? name : pfx sfx, EF_BAD}
 
 #define NSC_IVEC(base, sfx)            \
index 5a47d33060f6640c1d59547e652308a4ce614bac..afa40eb7ea0ba0756115345bbaefcefd4b944164 100644 (file)
@@ -125,7 +125,7 @@ static int *bitmaps[5] = {
 #define GCFy(y) ((y + WORLD_Y) % WORLD_Y)
 
 int
-emp_getbit(int x, int y, u_char *bitmap)
+emp_getbit(int x, int y, unsigned char *bitmap)
 {
     int id;
 
@@ -134,7 +134,7 @@ emp_getbit(int x, int y, u_char *bitmap)
 }
 
 void
-emp_setbit(int x, int y, u_char *bitmap)
+emp_setbit(int x, int y, unsigned char *bitmap)
 {
     register int id;
 
@@ -143,8 +143,7 @@ emp_setbit(int x, int y, u_char *bitmap)
 }
 
 void
-emp_setbitmap(register int x, register int y, register u_char *bitmap,
-             int *bitmaps)
+emp_setbitmap(int x, int y, unsigned char *bitmap, int *bitmaps)
 {
     register int *mp;
     register int id;
@@ -159,7 +158,7 @@ emp_setbitmap(register int x, register int y, register u_char *bitmap,
 }
 
 void
-bitinit2(struct nstr_sect *np, u_char *bitmap, int country)
+bitinit2(struct nstr_sect *np, unsigned char *bitmap, int country)
 {
     struct sctstr sect;
     int eff;
index f0bb792ad710bdc3398a663256bcfd7f9e5fd896..2c87e513cfb7f81dcdb2539097ef5ee45bb46ec5 100644 (file)
@@ -60,7 +60,7 @@ produce(struct natstr *np, struct sctstr *sp, short *vec, int work,
     struct pchrstr *product;
     double p_e;
     double prodeff;
-    u_char *resource;
+    unsigned char *resource;
     double output;
     int actual;
     int unit_work;
@@ -85,7 +85,7 @@ produce(struct natstr *np, struct sctstr *sp, short *vec, int work,
     p_e = neweff / 100.0;
     if (product->p_nrndx != 0) {
        unit_work++;
-       resource = (u_char *)sp + product->p_nrndx;
+       resource = (unsigned char *)sp + product->p_nrndx;
        p_e = (*resource * p_e) / 100.0;
     }
     /*
index e4e8b43b92aa3640cfcbeb46ccfd0579857c87ef..ba05b332a0834f8684075583a8e2bc5e362d9d85 100644 (file)
@@ -65,7 +65,7 @@ upd_buildeff(struct natstr *np, struct sctstr *sp, int *workp,
     int work_cost = 0;
     int buildeff_work = *workp / 2;
     int n, hcms, lcms, neweff;
-    u_char old_type = *desig;
+    unsigned char old_type = *desig;
 
     *cost = 0;
     neweff = sp->sct_effic;
index a4efdee78ad8929f05eff57a7dd8285b1726fba5..4737077da622560cd82a91e58020b7ef3cd8de65 100644 (file)
@@ -119,7 +119,7 @@ upd_ship(struct shpstr *sp, int etus,
     int max_oil;
     int max_food;
     struct pchrstr *product;
-    u_char *resource;
+    unsigned char *resource;
     int dep;
     int n;
     int mult;
@@ -180,7 +180,7 @@ upd_ship(struct shpstr *sp, int etus,
                if (sp->shp_item[I_OIL] + oil_gained > max_oil)
                    oil_gained = max_oil - sp->shp_item[I_OIL];
                if (product->p_nrdep != 0 && oil_gained > 0) {
-                   resource = (u_char *)sectp + product->p_nrndx;
+                   resource = (unsigned char *)sectp + product->p_nrndx;
                    if (*resource * 100 < product->p_nrdep * oil_gained)
                        oil_gained = *resource * 100 / product->p_nrdep;
                    dep = roundavg(oil_gained * product->p_nrdep / 100.0);
index 61586774d582bdcf3e90e590ba3cc8056e08ac3d..0b3b5302027ffc94ddb4e2b4b6c8bdceba8841e6 100755 (executable)
@@ -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 u_char u_int u_short"
+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"
 
 opts="-kr -cdw -cp8 -ncs -psl -ss"
 for t in $types