Permalink
Browse files

Run make indent

  • Loading branch information...
Shawn
Shawn committed Nov 23, 2017
1 parent b89c84d commit ccca9a70a710158b328db8f16ae2d5d84dfaa192
Showing with 197 additions and 177 deletions.
  1. +1 −1 hdrs/conf.h
  2. +1 −1 hdrs/externs.h
  3. +2 −2 hdrs/mushtype.h
  4. +2 −1 hdrs/myssl.h
  5. +11 −9 hdrs/pcg_basic.h
  6. +14 −12 src/bsd.c
  7. +9 −8 src/charconv.c
  8. +8 −6 src/chunk.c
  9. +2 −3 src/conf.c
  10. +4 −3 src/cque.c
  11. +1 −1 src/funlist.c
  12. +2 −2 src/funstr.c
  13. +3 −4 src/game.c
  14. +5 −5 src/help.c
  15. +4 −2 src/info_master.c
  16. +1 −1 src/log.c
  17. +1 −1 src/look.c
  18. +0 −1 src/memcheck.c
  19. +4 −3 src/mymalloc.c
  20. +29 −27 src/myssl.c
  21. +2 −2 src/parse.c
  22. +53 −50 src/pcg_basic.c
  23. +1 −1 src/predicat.c
  24. +5 −3 src/sig.c
  25. +1 −1 src/ssl_master.c
  26. +8 −5 src/ssl_slave.c
  27. +1 −1 src/strutil.c
  28. +5 −4 src/timer.c
  29. +15 −16 src/utils.c
  30. +2 −1 src/wait.c
View
@@ -332,7 +332,7 @@ struct options_table {
char ssl_private_key_file
[FILE_PATH_LEN]; /**< File to load the server's cert from */
char ssl_ca_file[FILE_PATH_LEN]; /**< File to load the CA certs from */
char ssl_ca_dir[FILE_PATH_LEN]; /**< Directory to load the CA certs from */
char ssl_ca_dir[FILE_PATH_LEN]; /**< Directory to load the CA certs from */
int ssl_require_client_cert; /**< Are clients required to present certs? */
int mem_check; /**< Turn on the memory allocation checker? */
int use_quota; /**< Are quotas enabled? */
View
@@ -448,7 +448,7 @@ void parse_attrib(dbref player, char *str, dbref *thing, ATTR **attrib);
* Prepared via fetch_ufun_attrib, used in call_ufun
*/
typedef struct _ufun_attrib {
dbref thing; /**< Object with attribute */
dbref thing; /**< Object with attribute */
char contents[BUFFER_LEN + SSE_OFFSET]; /**< Attribute value */
char attrname[ATTRIBUTE_NAME_LIMIT + 1];
/**< Name of attribute */
View
@@ -239,8 +239,8 @@ struct new_pe_info {
PE_REGS *regvals; /**< Saved register values. */
char cmd_raw[BUFFER_LEN + SSE_OFFSET]; /**< Unevaluated cmd executed (%c) */
char cmd_evaled[BUFFER_LEN]; /**< Evaluated cmd executed (%u) */
char cmd_raw[BUFFER_LEN + SSE_OFFSET]; /**< Unevaluated cmd executed (%c) */
char cmd_evaled[BUFFER_LEN]; /**< Evaluated cmd executed (%u) */
char attrname[BUFFER_LEN]; /**< The attr currently being evaluated */
#ifdef DEBUG
View
@@ -11,7 +11,8 @@
#include <openssl/ssl.h>
SSL_CTX *ssl_init(char *private_key_file, char *ca_file, char *ca_dir, int req_client_cert);
SSL_CTX *ssl_init(char *private_key_file, char *ca_file, char *ca_dir,
int req_client_cert);
SSL *ssl_setup_socket(int sock);
void ssl_close_connection(SSL *ssl);
SSL *ssl_alloc_struct(void);
View
@@ -37,39 +37,41 @@
extern "C" {
#endif
struct pcg_state_setseq_64 { // Internals are *Private*.
uint64_t state; // RNG state. All values are possible.
uint64_t inc; // Controls which RNG sequence (stream) is
// selected. Must *always* be odd.
struct pcg_state_setseq_64 { // Internals are *Private*.
uint64_t state; // RNG state. All values are possible.
uint64_t inc; // Controls which RNG sequence (stream) is
// selected. Must *always* be odd.
};
typedef struct pcg_state_setseq_64 pcg32_random_t;
// If you *must* statically initialize it, here's one.
#define PCG32_INITIALIZER { 0x853c49e6748fea9bULL, 0xda3e39cb94b95bdbULL }
#define PCG32_INITIALIZER \
{ \
0x853c49e6748fea9bULL, 0xda3e39cb94b95bdbULL \
}
// pcg32_srandom(initstate, initseq)
// pcg32_srandom_r(rng, initstate, initseq):
// Seed the rng. Specified in two parts, state initializer and a
// sequence selection constant (a.k.a. stream id)
void pcg32_srandom(uint64_t initstate, uint64_t initseq);
void pcg32_srandom_r(pcg32_random_t* rng, uint64_t initstate,
uint64_t initseq);
void pcg32_srandom_r(pcg32_random_t *rng, uint64_t initstate, uint64_t initseq);
// pcg32_random()
// pcg32_random_r(rng)
// Generate a uniformly distributed 32-bit random number
uint32_t pcg32_random(void);
uint32_t pcg32_random_r(pcg32_random_t* rng);
uint32_t pcg32_random_r(pcg32_random_t *rng);
// pcg32_boundedrand(bound):
// pcg32_boundedrand_r(rng, bound):
// Generate a uniformly distributed number, r, where 0 <= r < bound
uint32_t pcg32_boundedrand(uint32_t bound);
uint32_t pcg32_boundedrand_r(pcg32_random_t* rng, uint32_t bound);
uint32_t pcg32_boundedrand_r(pcg32_random_t *rng, uint32_t bound);
#if __cplusplus
}
View
@@ -1106,8 +1106,8 @@ shovechars(Port_t port, Port_t sslport)
if (!queue_event(SYSEVENT, "SIGNAL`USR1", "%s", "")) {
do_rawlog(LT_ERR, "SIGUSR1 received. Rebooting.");
do_reboot(
NOTHING,
0); /* We don't return from this except in case of a failed db save */
NOTHING,
0); /* We don't return from this except in case of a failed db save */
}
}
@@ -1143,7 +1143,7 @@ shovechars(Port_t port, Port_t sslport)
if (slice_timeout.tv_usec < 0)
slice_timeout.tv_usec = 0;
timeout = (struct timeval){ .tv_sec = queue_timeout, .tv_usec = 0 };
timeout = (struct timeval){.tv_sec = queue_timeout, .tv_usec = 0};
if (((int) fd_size) < ((int) im_count(descs_by_fd) + 6)) {
fd_size = im_count(descs_by_fd) + 16;
@@ -1197,7 +1197,9 @@ shovechars(Port_t port, Port_t sslport)
}
}
fds[fds_used].events = 0;
if (d->input.head) { /* Don't get more input while this desc has a command ready to eval. */
if (d
->input.head) { /* Don't get more input while this desc has a
command ready to eval. */
timeout = slice_timeout;
} else {
fds[fds_used].events = POLLIN;
@@ -1289,7 +1291,7 @@ shovechars(Port_t port, Port_t sslport)
#endif /* LOCAL_SOCKET */
}
#endif /* INFO_SLAVE */
if (found > 0 && notify_fd >= 0 && fds[fds_used++].revents & POLLIN) {
found -= 1;
file_watch_event(notify_fd);
@@ -1301,13 +1303,13 @@ shovechars(Port_t port, Port_t sslport)
sigrecv_ack();
}
#endif
for (d = descriptor_list; d && found > 0; d = dnext) {
unsigned int input_ready, output_ready, errors;
dnext = d->next;
if ((SOCKET)d->descriptor != fds[fds_used].fd)
if ((SOCKET) d->descriptor != fds[fds_used].fd)
continue;
input_ready = fds[fds_used].revents & POLLIN;
@@ -5119,10 +5121,10 @@ reaper(int sig __attribute__((__unused__)))
} else
#endif
if (forked_dump_pid > -1 && pid == forked_dump_pid) {
dump_error = forked_dump_pid;
dump_status = error_code;
forked_dump_pid = -1;
sigrecv_notify();
dump_error = forked_dump_pid;
dump_status = error_code;
forked_dump_pid = -1;
sigrecv_notify();
}
}
reload_sig_handler(SIGCHLD, reaper);
View
@@ -23,18 +23,19 @@
#include <nmmintrin.h>
#endif
#if defined(WIN32) && !defined(HAVE_FFS)
/* Windows version of ffs() */
int ffs(int i) {
unsigned long pos;
if (_BitScanForward(&pos, (unsigned long)i))
return (int)pos;
else
return 0;
int
ffs(int i)
{
unsigned long pos;
if (_BitScanForward(&pos, (unsigned long) i))
return (int) pos;
else
return 0;
}
#define HAVE_FFS
View
@@ -1453,14 +1453,15 @@ read_cache_region(fd_type fd, RegionHeader *rhp, uint16_t region)
char *pos;
size_t remaining;
ssize_t done = 0;
debug_log("read_cache_region %04x", region);
#ifndef HAVE_PREAD
/* Try to seek up to 3 times... */
for (j = 0; j < 3; j++)
#ifdef WIN32
if (SetFilePointer(fd, file_offset, NULL, FILE_BEGIN) != INVALID_SET_FILE_POINTER)
if (SetFilePointer(fd, file_offset, NULL, FILE_BEGIN) !=
INVALID_SET_FILE_POINTER)
break;
#else
if (lseek(fd, file_offset, SEEK_SET) == file_offset)
@@ -1483,7 +1484,7 @@ read_cache_region(fd_type fd, RegionHeader *rhp, uint16_t region)
if (ReadFile(fd, pos, remaining, &rfbytes, NULL))
done = (ssize_t) rfbytes;
else
done = -1;
done = -1;
#else
done = read(fd, pos, remaining);
#endif
@@ -1524,7 +1525,8 @@ write_cache_region(fd_type fd, RegionHeader *rhp, uint16_t region)
/* Try to seek up to 3 times... */
for (j = 0; j < 3; j++)
#ifdef WIN32
if (SetFilePointer(fd, file_offset, NULL, FILE_BEGIN) != INVALID_SET_FILE_POINTER)
if (SetFilePointer(fd, file_offset, NULL, FILE_BEGIN) !=
INVALID_SET_FILE_POINTER)
break;
#else
if (lseek(fd, file_offset, SEEK_SET) == file_offset)
@@ -1551,9 +1553,9 @@ write_cache_region(fd_type fd, RegionHeader *rhp, uint16_t region)
#elif defined(WIN32)
DWORD wfbytes;
if (WriteFile(fd, pos, remaining, &wfbytes, NULL))
done = (ssize_t) wfbytes;
done = (ssize_t) wfbytes;
else
done = -1;
done = -1;
#else
done = write(fd, pos, remaining);
#endif
View
@@ -1486,9 +1486,8 @@ config_file_checks(void)
}
if (((options.compresssuff && *options.compresssuff))) {
do_rawlog(
LT_ERR,
"CONFIG: compression suffix is specified but not used in Win32, ignoring.");
do_rawlog(LT_ERR, "CONFIG: compression suffix is specified but not used in "
"Win32, ignoring.");
}
/* Also remove the compression options */
View
@@ -279,8 +279,9 @@ static int
pay_queue(dbref player, const char *command)
{
int estcost;
estcost = QUEUE_COST +
(QUEUE_LOSS ? ((get_random_u32(0, QUEUE_LOSS - 1) == 0) ? 1 : 0) : 0);
estcost =
QUEUE_COST +
(QUEUE_LOSS ? ((get_random_u32(0, QUEUE_LOSS - 1) == 0) ? 1 : 0) : 0);
if (!quiet_payfor(player, estcost)) {
notify_format(Owner(player),
T("Not enough money to queue command for %s(#%d)."),
@@ -1072,7 +1073,7 @@ static int
do_entry(MQUE *entry, int include_recurses)
{
dbref executor;
char tbuf[BUFFER_LEN + SSE_OFFSET] = { '\0' };
char tbuf[BUFFER_LEN + SSE_OFFSET] = {'\0'};
int inplace_break_called = 0;
char *r;
char const *s;
View
@@ -1586,7 +1586,7 @@ FUNCTION(fun_remove)
char sep;
char **list, **rem;
int list_counter, rem_counter, list_total, rem_total;
int skip[MAX_SORTSIZE] = { 0 };
int skip[MAX_SORTSIZE] = {0};
int first = 1;
/* zap word from string */
View
@@ -595,7 +595,7 @@ FUNCTION(fun_merge)
int i, j;
size_t len;
char *ptr = args[0];
char matched[UCHAR_MAX + 1] = { '\0' };
char matched[UCHAR_MAX + 1] = {'\0'};
ansi_string *as;
/* find the characters to look for */
@@ -1228,7 +1228,7 @@ FUNCTION(fun_trim)
ansi_string *as;
int s, e;
char *delims;
char totrim[0x100] = { '\0' };
char totrim[0x100] = {'\0'};
/* Alas, PennMUSH and TinyMUSH used different orders for the arguments.
* We'll give the users an option about it
View
@@ -86,7 +86,7 @@ GLOBALTAB globals = {0, "", 0, 0, 0, 0, 0, 0, 0, 0};
static int epoch = 0;
#ifndef WIN32
static int reserved; /**< Reserved file descriptor */
static int reserved; /**< Reserved file descriptor */
#endif
static dbref *errdblist = NULL; /**< List of dbrefs to return errors from */
static dbref *errdbtail = NULL; /**< Pointer to end of errdblist */
@@ -551,7 +551,7 @@ fork_and_dump(int forking)
bool split = false;
#endif
epoch++;
epoch++;
#ifdef LOG_CHUNK_STATS
chunk_stats(NOTHING, 0);
@@ -786,8 +786,7 @@ init_game_postdb(const char *conf)
/* Set up ssl */
#ifndef SSL_SLAVE
if (!ssl_init(options.ssl_private_key_file, options.ssl_ca_file,
options.ssl_ca_dir,
options.ssl_require_client_cert)) {
options.ssl_ca_dir, options.ssl_require_client_cert)) {
fprintf(stderr, "SSL initialization failure\n");
options.ssl_port = 0; /* Disable ssl */
}
View
@@ -72,11 +72,11 @@ help_search(dbref executor, help_file *h, char *_term, char *delim)
{
static char results[BUFFER_LEN];
char *rp;
char searchterm[BUFFER_LEN] = { '\0' }, *st;
char topic[TOPIC_NAME_LEN + 1] = { '\0' };
char line[LINE_SIZE + 1] = { '\0' }, *l;
char cleanline[LINE_SIZE + 1] = { '\0' }, *cl;
char buff[BUFFER_LEN] = { '\0' }, *bp;
char searchterm[BUFFER_LEN] = {'\0'}, *st;
char topic[TOPIC_NAME_LEN + 1] = {'\0'};
char line[LINE_SIZE + 1] = {'\0'}, *l;
char cleanline[LINE_SIZE + 1] = {'\0'}, *cl;
char buff[BUFFER_LEN] = {'\0'}, *bp;
int n;
size_t i;
help_indx *entry;
View
@@ -393,7 +393,9 @@ kill_info_slave(void)
#endif /* INFO_SLAVE */
#ifdef WIN32
void dummy_function(void) {
/* Supress a warning about empty soure files. */
void
dummy_function(void)
{
/* Supress a warning about empty soure files. */
}
#endif
View
@@ -321,7 +321,7 @@ resize_log_rotate(struct log_stream *log)
log->filename, namea);
}
}
} else
} else
#endif
{
if (copy_file(log->fp, namea, 1) < 0) {
View
@@ -555,7 +555,7 @@ look_description(dbref player, dbref thing, const char *def,
char fbuff[BUFFER_LEN];
ufun_attrib ufun;
char *bp = buff;
if (!GoodObject(player) || !GoodObject(thing))
return;
if (fetch_ufun_attrib(descname, thing, &ufun,
View
@@ -148,7 +148,6 @@ lookup_check(const char *ref)
return NULL;
}
/* Return the number of links to use for a new node. Result's range is
1..maxcount */
static int
Oops, something went wrong.

0 comments on commit ccca9a7

Please sign in to comment.