]> git.pond.sub.org Git - empserver/commitdiff
Coding style fixes, mostly indentation and whitespace
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 18 May 2010 20:09:01 +0000 (22:09 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 20 Jun 2010 16:36:38 +0000 (18:36 +0200)
47 files changed:
include/item.h
include/land.h
include/lost.h
include/lwp.h
include/nat.h
include/nsc.h
src/client/servcmd.c
src/lib/commands/cens.c
src/lib/commands/edit.c
src/lib/commands/fort.c
src/lib/commands/info.c
src/lib/commands/mine.c
src/lib/commands/navi.c
src/lib/commands/para.c
src/lib/commands/pdump.c
src/lib/commands/rada.c
src/lib/commands/swap.c
src/lib/commands/trad.c
src/lib/commands/tran.c
src/lib/commands/upgr.c
src/lib/commands/vers.c
src/lib/commands/zdon.c
src/lib/common/hours.c
src/lib/common/nsc.c
src/lib/common/stmtch.c
src/lib/common/xdump.c
src/lib/common/xundump.c
src/lib/empthread/pthread.c
src/lib/global/dir.c
src/lib/global/symbol.c
src/lib/player/accept.c
src/lib/player/empdis.c
src/lib/player/empmod.c
src/lib/subs/mission.c
src/lib/subs/nstr.c
src/lib/subs/paths.c
src/lib/subs/pr.c
src/lib/subs/sarg.c
src/lib/subs/show.c
src/lib/subs/shpsub.c
src/lib/subs/unitsub.c
src/lib/update/deliver.c
src/lib/update/plane.c
src/lib/update/revolt.c
src/lib/w32/sys/uio.h
src/lib/w32/w32sockets.c
src/util/fairland.c

index acace6dd61d055bb398d55fb0ea570c762460102..fc666fcf121017ef56998d194d6dd8147a0bc725 100644 (file)
@@ -49,22 +49,22 @@ enum {
 };
 
 typedef enum {
-       I_NONE = -1,
-       I_CIVIL,
-       I_MILIT,
-       I_SHELL,
-       I_GUN,
-       I_PETROL,
-       I_IRON,
-       I_DUST,
-       I_BAR,
-       I_FOOD,
-       I_OIL,
-       I_LCM,
-       I_HCM,
-       I_UW,
-       I_RAD,
-       I_MAX = I_RAD
+    I_NONE = -1,
+    I_CIVIL,
+    I_MILIT,
+    I_SHELL,
+    I_GUN,
+    I_PETROL,
+    I_IRON,
+    I_DUST,
+    I_BAR,
+    I_FOOD,
+    I_OIL,
+    I_LCM,
+    I_HCM,
+    I_UW,
+    I_RAD,
+    I_MAX = I_RAD
 } ATTRIBUTE((packed)) i_type;
 
 struct ichrstr {
index 289af2a50d402170053d236279658b4857017d06..3a6255618d6169d27b2b42823217a62bb7fd061d 100644 (file)
@@ -192,7 +192,7 @@ extern int lnd_hardtarget(struct lndstr *);
 extern int lnd_mar_one_sector(struct emp_qelem *, int, natid, int);
 extern int lnd_support(natid, natid, coord, coord, int);
 extern int lnd_can_attack(struct lndstr *);
-extern int lnd_fortify (struct lndstr *lp, int hard_amt);
+extern int lnd_fortify(struct lndstr *lp, int hard_amt);
 extern void lnd_set_tech(struct lndstr *, int);
 
 #endif
index 6ce8f05d2707d2d46217c33f707e49a8d218df11..07f2271d4053809c362bba2a520f7ba78bbab7da 100644 (file)
@@ -47,7 +47,7 @@ struct loststr {
     natid lost_owner;          /* Who lost it */
     /* end of part matching struct empobj */
     short lost_type;           /* Type of thing (ship, plane, nuke, land, sector) */
-    int lost_id;               /* uid of lost thing (0 for sector)*/
+    int lost_id;               /* uid of lost thing (0 for sector) */
     coord lost_x;
     coord lost_y;
 };
index 64c70a9ee0971f5faa7569588d949a1675340123..02ccee06f8c322886a4d9a474f0ab1b41796119d 100644 (file)
@@ -61,17 +61,17 @@ struct lwpProc *lwpCreate(int prio, void (*)(void *), int size,
                          int flags, char *name,
                          int argc, char **argv, void *ud);
 void lwpExit(void);
-void lwpTerminate(struct lwpProc * p);
+void lwpTerminate(struct lwpProc *);
 void lwpYield(void);
 int lwpSleepFd(int fd, int flags, struct timeval *timeout);
 int lwpSleepUntil(time_t until);
 void lwpWakeup(struct lwpProc *);
 int lwpSigWait(sigset_t *set, int *sig);
-void *lwpGetUD(struct lwpProc * p);
-void lwpSetUD(struct lwpProc * p, char *ud);
+void *lwpGetUD(struct lwpProc *);
+void lwpSetUD(struct lwpProc *, char *ud);
 int lwpSetPriority(int prio);
-char *lwpName(struct lwpProc * p);
-void lwpSetName(struct lwpProc * p, char *name);
+char *lwpName(struct lwpProc *);
+void lwpSetName(struct lwpProc *, char *name);
 
 struct lwp_rwlock *lwp_rwlock_create(char *);
 void lwp_rwlock_destroy(struct lwp_rwlock *);
index 926740bc7c9b4e2fd5a7c3cf247f7a77c12ea0e6..750d3211f9188c3e058b26ab57f3a04c0716001b 100644 (file)
@@ -183,7 +183,7 @@ extern int influx(struct natstr *np);
 extern struct natstr *nat_reset(struct natstr *, enum nat_status, coord, coord);
 extern int check_nat_name(char *cname);
 
-extern int grant_btus(struct natstr *, int );
+extern int grant_btus(struct natstr *, int);
 
 /* nation flags */
 #define NF_INFORM      bit(0)  /* Inform me of telegrams right away */
index 4f2afd6b8dca943199c257a4479160d8e1e87d80..61d0e467987e0c04099495e7ad14b9170f790ca2 100644 (file)
@@ -286,7 +286,7 @@ extern struct symbol sector_navigation[];
 
 /* src/lib/subs/nstr.c */
 extern int nstr_comp(struct nscstr *np, int len, int type, char *str);
-extern char *nstr_comp_val(char *, struct valstr*, int);
+extern char *nstr_comp_val(char *, struct valstr *, int);
 extern int nstr_exec(struct nscstr *, int, void *);
 /* src/lib/common/nstreval.c */
 extern struct valstr *nstr_mksymval(struct valstr *, struct castr *, int);
index 723c38b3a4a9fa9d5062a21bc78903437081cd9f..13a00d7e971db2024bcde2b4c9f63869412cf947 100644 (file)
@@ -112,7 +112,7 @@ servercmd(int code, char *arg, int len)
        break;
     case C_INFORM:
        if (arg[0] != '\n') {
-           snprintf(teles, sizeof(teles), "(%.*s) ", len -1, arg);
+           snprintf(teles, sizeof(teles), "(%.*s) ", len - 1, arg);
            if (!redir_fp) {
                putchar('\07');
                prompt(code, the_prompt, teles);
index 5ec65006e7702f2719d5a58adb8f6cdacd03ffef..df79e0f357f056d815a66d76accbb1775ff3dae5 100644 (file)
@@ -85,9 +85,9 @@ cens(void)
        n = sect.sct_dist[I_FOOD] % 1000;
        pr("%c ", n == 0 ? '.' : '0' + (n / 100));
        if (sect.sct_own != sect.sct_oldown)
-         pr("%3d",  sect.sct_oldown);
+           pr("%3d",  sect.sct_oldown);
        else
-         pr("   ");
+           pr("   ");
 
        pr("%5d", sect.sct_item[I_CIVIL]);
        pr("%5d", sect.sct_item[I_MILIT]);
index 319372a734d9ff830a539230f01f623540ccd323..4d7ebc6fc5f0896aa7e9283ca99f79c0a95f4397 100644 (file)
@@ -386,7 +386,7 @@ pr_ship(struct shpstr *ship)
     pr("Fleet <F>: %.1s\n", &ship->shp_fleet);
     pr("Retreat path <R>: '%s'\t\tRetreat Flags <W>: %d\n",
        ship->shp_rpath, ship->shp_rflags);
-    pr("Plague Stage <a>: %d\t\t",ship->shp_pstage);
+    pr("Plague Stage <a>: %d\t\t", ship->shp_pstage);
     pr("Plague Time <b>: %d\n", ship->shp_ptime);
     pr("civ mil  uw food shl gun  pet  irn  dst  oil  lcm  hcm rad\n");
     pr("  c   m   u    f   s   g    p    i    d    o    l    h   r\n");
index a147da1bea83c24c91c2849c6950a5b2bb64cd58..6606bcbcf30575cdc5cad5caaa79ae82856328b3 100644 (file)
@@ -82,7 +82,7 @@ fort(void)
        if (hard_amt <= 0)
            continue;
 
-       if (lnd_fortify (&land, hard_amt) <= 0) {
+       if (lnd_fortify(&land, hard_amt) <= 0) {
            pr("%s can't be fortified%s\n", prland(&land),
               land.lnd_harden >= land_mob_max ? " any further" : "");
            continue;
index 38e5419677085943e5708ca41a8484a779f9c810..dab5663b3a305ace077f40f0833e3032f88194df 100644 (file)
@@ -320,7 +320,7 @@ info(void)
            default:
                pr("Error reading info dir\n");
                logerror("Error (%lu) reading info dir(%s)\\file(%s)",
-                   GetLastError(), infodir, filename);
+                        GetLastError(), infodir, filename);
            }
            return RET_FAIL;
        }
@@ -412,7 +412,7 @@ apro(void)
            lhitlim = 100;
     }
 
-    snprintf(filename, sizeof(filename), "%s\\*",infodir);
+    snprintf(filename, sizeof(filename), "%s\\*", infodir);
     hDir = FindFirstFile(filename, &fData);
     if (hDir == INVALID_HANDLE_VALUE) {
        if (GetLastError() == ERROR_PATH_NOT_FOUND) {
@@ -421,7 +421,7 @@ apro(void)
        } else {
            pr("Error reading info dir\n");
            logerror("Error (%lu) reading info dir(%s)\\file(%s)",
-               GetLastError(), infodir, filename);
+                    GetLastError(), infodir, filename);
        }
        return RET_FAIL;
     }
@@ -446,7 +446,7 @@ apro(void)
             (fData.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE) ||
             (fData.dwFileAttributes == FILE_ATTRIBUTE_READONLY))) {
            snprintf(filename, sizeof(filename), "%s\\%s", infodir,
-                     fData.cFileName);
+                    fData.cFileName);
            fp = fopen(filename, "rb");
            alreadyhit = 0;
            nll = nlhl = 0;
index bef2f4ffbf6a350fcdee45dd959edf2eae0d4254..02c617739dcfdb41265f7fde630f036004aaf970 100644 (file)
@@ -109,7 +109,7 @@ landmine(void)
            continue;
        if (land.lnd_ship >= 0 || land.lnd_land >= 0) {
            pr("%s is on a %s\n", prland(&land),
-              land. lnd_ship >= 0 ? "ship" : "land unit");
+              land.lnd_ship >= 0 ? "ship" : "land unit");
            continue;
        }
        if (land.lnd_mobil < 1) {
index 745208e697e2a066b86732014ab23525b24471b8..3740b7a1ead6d3b6dd3a2f25a0167f7baaf2ce82 100644 (file)
@@ -125,8 +125,8 @@ do_unit_move(struct emp_qelem *ulist, int *together,
            }
            if (!skip)
                nav_map(leader->x, leader->y,
-                       type == EF_SHIP ?
-                           !(mchr[(int)leader->type].m_flags & M_SUB) : 1);
+                       type == EF_SHIP
+                       ? !(mchr[(int)leader->type].m_flags & M_SUB) : 1);
            else
                skip = 0;
            sprintf(prompt, "<%.1f:%.1f: %s> ", *maxmob,
@@ -171,7 +171,7 @@ do_unit_move(struct emp_qelem *ulist, int *together,
        if (dir >= 0) {
            if (type == EF_SHIP) {
                stopping |= shp_nav_one_sector(ulist, dir,
-                   player->cnum, *together);
+                                              player->cnum, *together);
                if (stopping != 2) {
                    *pt++ = dirch[dir];
                    *pt = '\0';
@@ -179,7 +179,7 @@ do_unit_move(struct emp_qelem *ulist, int *together,
            } else
                stopping |=
                    lnd_mar_one_sector(ulist, dir, player->cnum,
-                       *together);
+                                      *together);
            cp++;
            continue;
        }
index deda7f1916b4740913635c3aaba4e7c9a6d206ca..db6feb8006d2b50ae87c81cdbb29e37bb485835f 100644 (file)
@@ -81,8 +81,8 @@ para(void)
     pr("range to target is %d\n", ap_to_target);
     if (target.sct_own == player->cnum) {
        pr("You can't air-assault your own sector!\n");
-           return RET_FAIL;
-       }
+       return RET_FAIL;
+    }
     /*
      * select planes within range
      */
index 530b538667fdb0853e4b16247a30a6d1b3f1e513..58ba76c51f784b1c709fa5ab01714cbdbfc74b17 100644 (file)
@@ -264,7 +264,7 @@ pdump(void)
            case 19:
                pr(pln_is_in_orbit(&plane)
                   && (plane.pln_flags & PLN_SYNCHRONOUS)
-                   ? " Y" : " N");
+                  ? " Y" : " N");
                break;
            case 20:
                if (getnuke(nuk_on_plane(&plane), &nuke)) {
index c1479a5af661de0501e976cb5079f17f5b971268..6563abe080c889f4552c1ae8f318242da076cff4 100644 (file)
@@ -102,7 +102,7 @@ radar(int type)
                if (mchr[(int)item.ship.shp_type].m_flags & M_SONAR)
                    tf = techfact(item.ship.shp_tech, 1.0);
                tech = techfact(item.ship.shp_tech,
-                   mchr[(int)item.ship.shp_type].m_vrnge);
+                               mchr[(int)item.ship.shp_type].m_vrnge);
            } else {
                if (!(lchr[(int)item.land.lnd_type].l_flags & L_RADAR)) {
                    pr("%s can't use radar!\n", prland(&item.land));
index 9a70dc68a2611c056ca4d2ae15aeac006612f762..97eeca617efcd780bdaf4f4846a837860cff602e 100644 (file)
@@ -58,7 +58,7 @@ swaps(void)
        !getsect(sectb.sct_x, sectb.sct_y, &sectb))
        return RET_SYN;
     print_res(&sectb);
-    if (!confirm ("Are you sure these are the two sectors you wish to swap? "))
+    if (!confirm("Are you sure these are the two sectors you wish to swap? "))
        return RET_FAIL;
     if (!check_sect_ok(&secta) || !check_sect_ok(&sectb))
        return RET_FAIL;
index 9b066f53fa735f16f8496e2066c2b2808958e4c5..64d0aed8b1f280d034f6b7f89f061bc9edecec56 100644 (file)
@@ -403,7 +403,7 @@ check_trade(void)
           "The bidding is over & you bought %s #%d from %s for $%.2f\n",
           trade_nameof(&trade, &tg), saveid, cname(trade.trd_owner),
           price);
-   }
+    }
     return RET_OK;
 }
 
index b6ee355287f57a70cb14155b031cbbd704d1df1e..059f07cb038fc0fad4efb0ec7ba287ea2d3d5e55 100644 (file)
@@ -255,4 +255,3 @@ tran_nmap(coord curx, coord cury, char *arg)
 {
     return display_region_map(0, EF_NUKE, curx, cury, arg);
 }
-
index f1aac4ee2825899e126c924d365d50dc8324d368..33b4add4c3491fe7f602b4e2af057b651ac09e69 100644 (file)
@@ -40,8 +40,8 @@
 #include "ship.h"
 
 enum {
-  UPGR_COST = 15,              /* how much avail and money to charge */
-  UPGR_EFF = 35                        /* efficiency reduction */
+    UPGR_COST = 15,            /* how much avail and money to charge */
+    UPGR_EFF = 35              /* efficiency reduction */
 };
 
 static int lupgr(void);
index bdb9124eed76b425f057162cb9f781e662179625..27b1b4a03cb54bca721953b4f3c8aebd0baebc76 100644 (file)
@@ -201,7 +201,7 @@ vers(void)
     pr("Fallout decays by %.0f%% per update\n",
        100.0 - (decay_per_etu + 6.0) * fallout_spread * MIN(24, etu_per_update) * 100.0);
     pr("\n");
-    pr ("Damage to\t\t\tSpills to\n");
+    pr("Damage to\t\t\tSpills to\n");
     pr("\t      Sector  People  Mater.   Ships  Planes  LandU.\n");
     pr("Sector\t\t --\t%3.0f%%\t100%%\t  0%%\t%3.0f%%\t%3.0f%%\n",
        people_damage * 100.0, unit_damage / 0.07, unit_damage * 100.0);
index d9655bc410afb602eb2a6b838b2b320af486d247..c2aa60050fb6f47a799793b89456118d08af8477 100644 (file)
@@ -81,7 +81,7 @@ zdon(void)
     if (*p == 'y' || *p == 'Y') {
        checking = 0;
        wantupd = 1;
-    } else if  (*p == 'n' || *p == 'N') {
+    } else if (*p == 'n' || *p == 'N') {
        checking = 0;
        wantupd = 0;
     } else {
index 07696ed15be5591ea731ed906fb4df7563685847..e548f2a8ed744895beeacb511b9f0bf1fd430ff8 100644 (file)
@@ -117,7 +117,8 @@ weekday(char *str, int *wday)
      */
     static char *day_name[7] = {
        "sunday", "monday", "tuesday", "wednesday",
-       "thursday", "friday", "saturday" };
+       "thursday", "friday", "saturday"
+    };
     int i, j;
 
     for (; isspace(*str); ++str) ;
index b3b7907964ac7f7c55f8d411f93b09645b5d513b..606d2f3a9d197a57bd3d47b3f2bb25759a3521c1 100644 (file)
@@ -211,21 +211,21 @@ struct castr dchr_ca[] = {
 };
 
 #define NSC_GENITEM(ef_type, ef_chr)                                   \
-    {"uid", empobjoff(uid),  NSC_INT, 0, NULL, ef_type, 0},            \
+    {"uid", empobjoff(uid), NSC_INT, 0, NULL, ef_type, 0},             \
     {"timestamp", empobjoff(timestamp), NSC_TIME, 0, NULL, EF_BAD, NSC_EXTRA}, \
-    {"owner", empobjoff(own),  NSC_NATID, 0, NULL, EF_NATION, 0},      \
-    {"xloc", empobjoff(x),  NSC_XCOORD, 0, NULL, EF_BAD, 0},           \
-    {"yloc", empobjoff(y),  NSC_YCOORD, 0, NULL, EF_BAD, 0},           \
-    {"type", empobjoff(type),  NSC_CHAR, 0, NULL, ef_chr, 0},          \
-    {"effic", empobjoff(effic),  NSC_CHAR, 0, NULL, EF_BAD, 0},                \
-    {"mobil", empobjoff(mobil),  NSC_CHAR , 0, NULL, EF_BAD, 0},       \
-    {"off", empobjoff(off),  NSC_UCHAR , 0, NULL, EF_BAD, 0},          \
-    {"tech", empobjoff(tech),  NSC_SHORT, 0, NULL, EF_BAD, 0},         \
-    {"group", empobjoff(group),  NSC_STRINGY, 1, NULL, EF_BAD, NSC_EXTRA}, \
-    {"opx", empobjoff(opx),  NSC_XCOORD, 0, NULL, EF_BAD, 0},          \
-    {"opy", empobjoff(opy),  NSC_YCOORD, 0, NULL, EF_BAD, 0},          \
-    {"mission", empobjoff(mission),  NSC_SHORT, 0, NULL, EF_MISSIONS, 0}, \
-    {"radius", empobjoff(radius),  NSC_SHORT, 0, NULL, EF_BAD, 0}
+    {"owner", empobjoff(own), NSC_NATID, 0, NULL, EF_NATION, 0},       \
+    {"xloc", empobjoff(x), NSC_XCOORD, 0, NULL, EF_BAD, 0},            \
+    {"yloc", empobjoff(y), NSC_YCOORD, 0, NULL, EF_BAD, 0},            \
+    {"type", empobjoff(type), NSC_CHAR, 0, NULL, ef_chr, 0},           \
+    {"effic", empobjoff(effic), NSC_CHAR, 0, NULL, EF_BAD, 0},         \
+    {"mobil", empobjoff(mobil), NSC_CHAR , 0, NULL, EF_BAD, 0},                \
+    {"off", empobjoff(off), NSC_UCHAR , 0, NULL, EF_BAD, 0},           \
+    {"tech", empobjoff(tech), NSC_SHORT, 0, NULL, EF_BAD, 0},          \
+    {"group", empobjoff(group), NSC_STRINGY, 1, NULL, EF_BAD, NSC_EXTRA}, \
+    {"opx", empobjoff(opx), NSC_XCOORD, 0, NULL, EF_BAD, 0},           \
+    {"opy", empobjoff(opy), NSC_YCOORD, 0, NULL, EF_BAD, 0},           \
+    {"mission", empobjoff(mission), NSC_SHORT, 0, NULL, EF_MISSIONS, 0}, \
+    {"radius", empobjoff(radius), NSC_SHORT, 0, NULL, EF_BAD, 0}
 
 struct castr ship_ca[] = {
 #define CURSTR struct shpstr
@@ -482,7 +482,7 @@ struct castr news_ca[] = {
 
 struct castr lost_ca[] = {
 #define CURSTR struct loststr
-   /* no need for uid as long as it's not referenced from other tables */
+    /* no need for uid as long as it's not referenced from other tables */
     {"timestamp", fldoff(lost_timestamp), NSC_TIME, 0, NULL,
      EF_BAD, 0},
     {"owner", fldoff(lost_owner), NSC_NATID, 0, NULL, EF_NATION, 0},
index adb80e4fd3cde6b2b7cc71a108fcbbabf7d5ea20..fd2cde04e453ca92bea6c9200ab2e83d805deae6 100644 (file)
@@ -84,7 +84,9 @@ mineq(char *a, char *b)
     /* find common prefix: */
     for (i = 0; a[i] != 0 && a[i] == b[i]; i++) ;
 
-    if (a[i] != 0) return ME_MISMATCH;
-    if (b[i] == 0 || b[i] == ' ') return ME_EXACT;
+    if (a[i] != 0)
+       return ME_MISMATCH;
+    if (b[i] == 0 || b[i] == ' ')
+       return ME_EXACT;
     return ME_PARTIAL;
 }
index ea7128c8d24f768a4e68f726ce8a64eb4aaeb102..43a3d83a6ea6b5a830b7f864af2823cd82cc3038 100644 (file)
@@ -288,7 +288,7 @@ xdcolhdr(struct xdstr *xd, struct castr ca[])
        n = ca[i].ca_type != NSC_STRINGY ? ca[i].ca_len : 0;
        if (n) {
            for (j = 0; j < n; j++) {
-               xd->pr("%s%s(%d)",sep, ca[i].ca_name, j);
+               xd->pr("%s%s(%d)", sep, ca[i].ca_name, j);
                sep = " ";
            }
        } else {
index 022c0ee227e9b6172af1c1b4e0968bc47b9f65ca..b3d5af89ea4082956a1b3d64be3fd082196c0ceb 100644 (file)
@@ -349,7 +349,7 @@ deffld(int fldno, char *name, int idx)
     int res;
 
     res = stmtch(name, ca, offsetof(struct castr, ca_name),
-                    sizeof(struct castr));
+                sizeof(struct castr));
     if (res < 0)
        return gripe("Header %s of field %d is %s", name, fldno + 1,
                     res == M_NOTUNIQUE ? "ambiguous" : "unknown");
@@ -851,7 +851,7 @@ xufooter(FILE *fp, struct castr ca[], int recs)
 
     res = -1;
     if (human) {
-       if (fscanf(fp, "config%n",  &res) != 0 || res < 0)
+       if (fscanf(fp, "config%n", &res) != 0 || res < 0)
            return gripe("Malformed table footer");
     } else {
        if (fscanf(fp, "%d", &n) != 1)
index 7ce03f5e54d7e8e2e3b295bee362ece8bb3ae534..4b01694ec77fb16f6cf136cfd0d4efa296d2ef87 100644 (file)
@@ -439,7 +439,7 @@ empth_rwlock_wrlock(empth_rwlock_t *rwlock)
        empth_status("waiting for wrlock %s", rwlock->name);
        pthread_cond_wait(&rwlock->can_write, &mtx_ctxsw);
        empth_status("got wrlock %s %d %d",
-                rwlock->name, rwlock->nread, rwlock->nwrite);
+                    rwlock->name, rwlock->nread, rwlock->nwrite);
        empth_restorectx();
     }
 }
index 337fa2cf65bab1a5203cafcc7807575d3ecd26e3..bfb6567139717434c78a5fabca203ae1a590e996 100644 (file)
@@ -64,5 +64,5 @@ signed char dirindex[] = {
 
 /* must agree with dirch[] and DIR_ defines */
 char *routech[] = {
-    "   ", "  /", "  >","  \\","/  ","<  ","\\  "
+    "   ", "  /", "  >", "  \\", "/  ", "<  ", "\\  "
 };
index a00457db1f79d834fe60937c9cb57562aa8127dd..f27312fce746d572202d8c0f2e4d429814609661 100644 (file)
@@ -87,7 +87,7 @@ struct symbol meta_flags[] = {
     {0, NULL}
 };
 
-struct symbol meta_type[]  = {
+struct symbol meta_type[] = {
     {NSC_LONG, "d"},
     {NSC_DOUBLE, "g"},
     {NSC_STRING, "s"},
@@ -101,7 +101,7 @@ struct symbol meta_type[]  = {
     {NSC_HIDDEN, "d"},
     {NSC_TIME, "d"},
     {NSC_FLOAT, "g"},
-    {NSC_STRINGY,"c"},
+    {NSC_STRINGY, "c"},
     {NSC_NOTYPE, NULL}
 };
 
@@ -150,7 +150,7 @@ struct symbol nation_relations[] = {
 
 struct symbol nation_status[] = {
     {STAT_UNUSED, "unused"},
-    {STAT_NEW, "new"},
+    {STAT_NEW, "new"},
     {STAT_VIS, "visitor"},
     {STAT_SANCT, "sanctuary"},
     {STAT_ACTIVE, "active"},
index 2a410642ac8771ff96ffa9fbf1fbc353f78d1803..9c87d23a8f238262ef72d127fa0feb5b94afc694 100644 (file)
@@ -76,10 +76,10 @@ player_new(int s)
 
     lp = malloc(sizeof(struct player));
     if (!lp)
-      return NULL;
+       return NULL;
     memset(lp, 0, sizeof(struct player));
     idle_timeout.tv_sec = max_idle * 60;
-    idle_timeout.tv_usec = 0 ;
+    idle_timeout.tv_usec = 0;
     if (s >= 0) {
        /* real player, not dummy created by update and market update */
        lp->iop = io_open(s, IO_READ | IO_WRITE, IO_BUFSIZE, idle_timeout);
index 51ceb53bf42ccfc86f49ac526cb713656245c5c2..238812c1b2bf531bc8cfefeb5d8f9f0b28088c90 100644 (file)
@@ -167,7 +167,7 @@ disable_coms(void)
        cmd = comtch(name, player_coms, -1);
        if (cmd < 0) {
            logerror("Warning: not disabling %s command %s\n",
-                   cmd == M_NOTUNIQUE ? "ambiguous" : "unknown", name);
+                    cmd == M_NOTUNIQUE ? "ambiguous" : "unknown", name);
            continue;
        }
        player_coms[cmd].c_permit |= GOD;
@@ -219,7 +219,7 @@ update_timeused(time_t now)
 void
 enforce_minimum_session_time(void)
 {
-   struct natstr *natp = getnatp(player->cnum);
+    struct natstr *natp = getnatp(player->cnum);
 
     time_t dt = natp->nat_last_logout - natp->nat_last_login;
     if (dt > seconds_since_midnight(natp->nat_last_logout))
index b9ec9d6a51dc8557e04e93bd29dea18129f5c95a..38641b3e70568193a1bb4f19c056062a0883671e 100644 (file)
@@ -101,7 +101,7 @@ struct cmndstr player_coms[] = {
      0, edit, C_MOD, GOD},
     {"enable", 0, enab, C_MOD, GOD},
     {"enlist <SECTS> <NUM>", 2, enli, C_MOD, NORM + MONEY + CAP},
-    {"execute <INPUT FILE>", 0, execute, 0, VIS + EXEC },
+    {"execute <INPUT FILE>", 0, execute, 0, VIS + EXEC},
     {"explore <c|m> <SECT> <NUM> <PATH|DESTINATION>",
      1, explore, C_MOD, NORM + MONEY + CAP},
     {"financial", 0, fina, 0, NORM},
index c13f5b53e928bd90f21818bbf097c1a56ae61a91..2bff3f38ec0ff2463dd470f062b983c01d1f9cb3 100644 (file)
@@ -508,7 +508,7 @@ perform_mission_ship(int dam, struct shpstr *sp, coord x, coord y,
     }
     if (mcp->m_flags & M_SUB) {
        if (!targeting_ships)
-           return dam; /* subs interdict only ships */
+           return dam;         /* subs interdict only ships */
        range = roundrange(torprange(sp));
        if (md > range)
            return dam;
index 5a60fcd1e79b55567af5719e8e63af3edc606c98..6d9e8e422191481de39489ca520b568e01745115 100644 (file)
@@ -199,8 +199,10 @@ static int
 strnncmp(char *s1, size_t sz1, char *s2, size_t sz2)
 {
     int res;
-    if (sz1 == sz2) return strncmp(s1, s2, sz2);
-    if (sz1 < sz2) return -strnncmp(s2, sz2, s1, sz1);
+    if (sz1 == sz2)
+       return strncmp(s1, s2, sz2);
+    if (sz1 < sz2)
+       return -strnncmp(s2, sz2, s1, sz1);
     res = strncmp(s1, s2, sz2);
     return res ? res : s1[sz2];
 }
@@ -278,7 +280,8 @@ nstr_parse_val(char *str, struct valstr *val)
        val->val_cat = NSC_VAL;
        val->val_as.str.base = str + 1;
        val->val_as.str.maxsz = tail - (str + 1);
-       if (*tail) ++tail;
+       if (*tail)
+           ++tail;
        /* FIXME else unclosed string */
        return tail;
     }
@@ -353,7 +356,7 @@ static int
 nstr_is_name_of_ca(struct valstr *val, struct castr *ca, int idx)
 {
     if (CANT_HAPPEN(val->val_cat != NSC_ID && idx >= 0))
-       return 0;
+       return 0;
     return idx >= 0 && strlen(ca[idx].ca_name) == val->val_as.str.maxsz;
 }
 
@@ -487,11 +490,11 @@ nstr_optype(enum nsc_type lft, enum nsc_type rgt)
     lft = nstr_promote(lft);
     rgt = nstr_promote(rgt);
     if (lft == rgt)
-       return lft;
+       return lft;
     if (lft == NSC_DOUBLE && rgt == NSC_LONG)
-       return NSC_DOUBLE;
+       return NSC_DOUBLE;
     if (rgt == NSC_DOUBLE && lft == NSC_LONG)
-       return NSC_DOUBLE;
+       return NSC_DOUBLE;
     return NSC_NOTYPE;
 }
 
index 4a95ed38739e98cdb4e6dfe3609393783e98588a..ac621540e5d8c8bb9bf9ad4831b182b2f7c0fc82 100644 (file)
@@ -110,7 +110,7 @@ getpath(char *buf, char *arg, coord x, coord y, int onlyown,
 
     getsect(x, y, &sect);
 
-  more:
+more:
     while (*p) {
        if (sarg_xy(p, &dx, &dy)) {
            bp = NULL;
index 1698d4c454ae8e7b4e289cfe184f2924af5bb41f..215e46ca799cb01cfa3e641d9cd0a92b04b417d6 100644 (file)
@@ -544,7 +544,7 @@ copy_ascii_no_funny(char *dst, char *src)
        if ((ch < 0x20 && ch != '\t' && ch != '\n') || ch == 0x7f)
            ;                   /* ignore funny control */
        else if (ch > 0x7f)
-           *p++ = '?'; /* replace non-ASCII */
+           *p++ = '?';         /* replace non-ASCII */
        else
            *p++ = ch;
     }
@@ -619,8 +619,7 @@ ufindpfx(char *s, int n)
 {
     int i = 0;
 
-    while (n && s[i])
-    {
+    while (n && s[i]) {
        if ((s[i++] & 0xc0) == 0xc0)
             while ((s[i] & 0xc0) == 0x80)
                i++;
index e75fb2129abf7b9e5ae751ed63bd4f7deaf11f75..3cc4c4b7f4cec51e13d3708f065b2c5bcf5ae4d8 100644 (file)
@@ -85,7 +85,7 @@ sarg_xy(char *str, coord *xp, coord *yp)
        return 0;
     y = strtoy(str, &str);
     if (y < 0 || (*str != 0 && !isspace(*str)))
-      return 0;
+       return 0;
     if ((x ^ y) & 1)
        return 0;
     np = getnatp(player->cnum);
index 99703eae51457815dee2eb10e42b82fa9dff5a90..c2b065f88b5d95012a39b14e2f19b1a9b08dff9e 100644 (file)
@@ -605,7 +605,7 @@ show_news(int tlev)
        if (rpt[i].r_newspage == N_NOTUSED)
            continue;
        pr("%-2d %-20.20s %4d\n", rpt[i].r_uid,
-           page_headings[rpt[i].r_newspage].name, rpt[i].r_good_will);
+          page_headings[rpt[i].r_newspage].name, rpt[i].r_good_will);
        for (j = 0; j < NUM_RPTS; j++)
            pr("    %s\n", rpt[i].r_newstory[j]);
     }
@@ -686,12 +686,12 @@ fmttime2822(time_t t)
        (time->tm_isdst ? tzi.DaylightBias : tzi.StandardBias));
 
     nn = _snprintf(buf + n, sizeof(buf) - n, " %+03d%02d",
-       time_offset/60, abs(time_offset) % 60);
+                  time_offset / 60, abs(time_offset) % 60);
     if (CANT_HAPPEN(nn <= 0 || nn + n >= sizeof(buf)))
        buf[0] = 0;
 #else
     size_t n = strftime(buf, sizeof(buf), "%a, %d %b %Y %T %z",
-                    localtime(&t));
+                       localtime(&t));
     if (CANT_HAPPEN(n == 0))
        buf[0] = 0;
 #endif
index 35ef15466b5cbb03b924abe1c3caecda3145394a..1bacf515934a99c6c0e4ea83161fb19973f4b55a 100644 (file)
@@ -627,8 +627,7 @@ shp_fort_interdiction(struct emp_qelem *list, coord newx, coord newy,
        mpr(victim, "Incoming fire does %d damage!\n", dam);
 #if 0
        mpr(victim, "%s fires at you for %d!\n",
-           xyas(fsect.sct_x,fsect.sct_y,victim),
-           dam);
+           xyas(fsect.sct_x, fsect.sct_y, victim), dam);
 #endif
        wu(0, fsect.sct_own,
           "%s fires at %s ships in %s for %d!\n",
index ea5756821951251644e315f100cada95df8a1380..4563b294982ed9528b4fe0b9a7ef4e9f15b06cf0 100644 (file)
@@ -161,7 +161,7 @@ unit_path(int together, struct empobj *unit, char *buf)
                          d_sect.sct_x, d_sect.sct_y, player->cnum);
        if (!cp || unit->mobil <= 0) {
            pr("Can't get to '%s' right now.\n",
-               xyas(d_sect.sct_x, d_sect.sct_y, player->cnum));
+              xyas(d_sect.sct_x, d_sect.sct_y, player->cnum));
            return NULL;
        }
     } else {
@@ -201,8 +201,8 @@ unit_view(struct emp_qelem *list)
                pr("[oil:%d] ", sect.sct_oil);
        }
        pr("%s @ %s %d%% %s\n", obj_nameof(&ulp->unit.gen),
-           xyas(ulp->unit.gen.x, ulp->unit.gen.y, player->cnum),
-           sect.sct_effic, dchr[sect.sct_type].d_name);
+          xyas(ulp->unit.gen.x, ulp->unit.gen.y, player->cnum),
+          sect.sct_effic, dchr[sect.sct_type].d_name);
     }
 }
 
index 908cd29a95fd2735438a1cd21a23913ef087d4b2..b6dd7844a872a38c567bd05ea4baaa26f21d7e77 100644 (file)
@@ -45,7 +45,7 @@ deliver(struct sctstr *from, struct ichrstr *ip, int dir,
        int thresh, int amt_src, int plague, enum i_packing packing)
 {
     struct sctstr *to;
-    i_type vtype;                      /* item vartype */
+    i_type vtype;              /* item vartype */
     int amt_moved;
     int amt_dst;
     int mobility;
index 752271e6158b6d120832f62509d85a2890770145..1269447f4e650f9b9550332010812ab14ef786b8 100644 (file)
@@ -183,8 +183,8 @@ planerepair(struct plnstr *pp, struct natstr *np, struct bp *bp, int etus)
        delta = 100 - pp->pln_effic;
 
     memset(mvec, 0, sizeof(mvec));
-    mvec[I_MILIT] =  pcp->pl_crew;
-    mvec[I_LCM] =  pcp->pl_lcm;
+    mvec[I_MILIT] = pcp->pl_crew;
+    mvec[I_LCM] = pcp->pl_lcm;
     mvec[I_HCM] = pcp->pl_hcm;
     build = get_materials(sp, bp, mvec, delta);
 
index 747333138687a7b497ba717701378ec5ff491bfd..7a01b35dd2a3820f7ba5c7eb62fa27cafffc5fd7 100644 (file)
@@ -346,7 +346,7 @@ guerrilla(struct sctstr *sp)
        uw -= n;
        sp->sct_item[I_UW] = uw;
     }
-  domove:
+domove:
     if (move && che > 0) {
        struct sctstr *nicest_sp = NULL;
        if (convert)
index 27ec5f03073d29e61fb7ae2a10ae195bcb25b062..00281f8239021eb2d5418987651c698f6a6107af 100644 (file)
@@ -39,9 +39,9 @@
 
 struct iovec {
     /* Base address of a memory region for input or output. */
-    void   *iov_base;
+    void *iov_base;
     /* The size of the memory pointed to by iov_base. */
-    size_t  iov_len;
+    size_t iov_len;
 };
 
 extern ssize_t readv(int fd, const struct iovec *iov, int iovcnt);
index 7df1427ce38ecd7c34b437e11cb0e2d7598818cd..c91bc6d026501fcf39b848a5c4bd37e1a330f9c3 100644 (file)
@@ -81,33 +81,32 @@ fd_is_socket(int fd, SOCKET *sockp)
 void
 w32_set_winsock_errno(void)
 {
-  int err = WSAGetLastError();
-  WSASetLastError(0);
+    int err = WSAGetLastError();
+    WSASetLastError(0);
 
-  /* Map some WSAE* errors to the runtime library's error codes.  */
-  switch (err)
-    {
+    /* Map some WSAE* errors to the runtime library's error codes.  */
+    switch (err) {
     case WSA_INVALID_HANDLE:
-      errno = EBADF;
-      break;
+       errno = EBADF;
+       break;
     case WSA_NOT_ENOUGH_MEMORY:
-      errno = ENOMEM;
-      break;
+       errno = ENOMEM;
+       break;
     case WSA_INVALID_PARAMETER:
-      errno = EINVAL;
-      break;
+       errno = EINVAL;
+       break;
     case WSAEWOULDBLOCK:
-      errno = EAGAIN;
-      break;
+       errno = EAGAIN;
+       break;
     case WSAENAMETOOLONG:
-      errno = ENAMETOOLONG;
-      break;
+       errno = ENAMETOOLONG;
+       break;
     case WSAENOTEMPTY:
-      errno = ENOTEMPTY;
-      break;
+       errno = ENOTEMPTY;
+       break;
     default:
-      errno = (err > 10000 && err < 10025) ? err - 10000 : err;
-      break;
+       errno = (err > 10000 && err < 10025) ? err - 10000 : err;
+       break;
     }
 }
 
@@ -284,8 +283,7 @@ fcntl(int fd, int cmd, ...)
     unsigned long nonblocking;
     SOCKET sock;
 
-    switch (cmd)
-    {
+    switch (cmd) {
     case F_GETFL:
        return 0;
     case F_SETFL:
index 83ee883a113a2dec86e7dc9e4fd8888b96d460a4..d4120cac9a919a7e56dcdfba3129419710b10c21 100644 (file)
@@ -1167,7 +1167,7 @@ write_newcap_script(void)
 }
 
 static void
-qprint(const char * const fmt, ...)
+qprint(const char *const fmt, ...)
 {
     va_list ap;