Coding style fixes, mostly indentation and whitespace
This commit is contained in:
parent
8a0d117d45
commit
373651359e
47 changed files with 131 additions and 130 deletions
|
@ -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 *);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -255,4 +255,3 @@ tran_nmap(coord curx, coord cury, char *arg)
|
|||
{
|
||||
return display_region_map(0, EF_NUKE, curx, cury, arg);
|
||||
}
|
||||
|
||||
|
|
|
@ -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) ;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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++;
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -85,8 +85,7 @@ w32_set_winsock_errno(void)
|
|||
WSASetLastError(0);
|
||||
|
||||
/* Map some WSAE* errors to the runtime library's error codes. */
|
||||
switch (err)
|
||||
{
|
||||
switch (err) {
|
||||
case WSA_INVALID_HANDLE:
|
||||
errno = EBADF;
|
||||
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue