Skip to content

Commit 331af43

Browse files
committed
formatting: Remove leading and trailing spaces in code.
* Convert leading spaces to tabs. * Remove trailing spaces and TABs.
1 parent 5e232bf commit 331af43

31 files changed

Lines changed: 88 additions & 98 deletions

bbs/config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ static struct bbs_config *config_parse_or_write(const char *name, FILE **restric
410410
const char *endl = NULL;
411411
int has_line_ending = 0;
412412
size_t len = 0;
413-
ssize_t bytes_read;
413+
ssize_t bytes_read;
414414
char *key, *value;
415415
int lineno = 0;
416416
char fullname[PATH_MAX];

bbs/crypt_blowfish.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,7 @@ static void BF_swap(BF_word *x, int count)
554554

555555
#pragma GCC diagnostic push
556556
#pragma GCC diagnostic ignored "-Wsign-conversion"
557-
static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
558-
unsigned char flags)
557+
static void BF_set_key(const char *key, BF_key expanded, BF_key initial, unsigned char flags)
559558
{
560559
const char *ptr = key;
561560
unsigned int bug, i, j;

bbs/lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ extern int high_concurrency_mode;
7777
#define STORE_CALLER_INFO() \
7878
safe_strncpy(t->info.filename, filename, sizeof(t->info.filename)); \
7979
t->info.lineno = lineno; \
80-
t->info.lwp = bbs_gettid();
80+
t->info.lwp = bbs_gettid();
8181

8282
#ifdef ENABLE_LOCK_LOGFILE
8383
FILE *locklogfp; /* This is never closed anywhere, but this is just a hack to dump lock interactions for debugging */

bbs/node.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ static int authenticate(struct bbs_node *node)
14511451
return -1;
14521452
} else if (!strcasecmp(username, "New")) {
14531453
int res;
1454-
1454+
14551455
/* User registration could vary from system to system,
14561456
* for example, some systems may allow users to self-register,
14571457
* others may have a process for sysops verifying new users, etc.

bbs/system.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ static int setup_namespace(pid_t pid)
578578

579579
snprintf(map_path, sizeof(map_path), "/proc/%d/gid_map", pid);
580580
map_len = snprintf(map_buf, sizeof(map_buf), "0 %ld 1", (long) getgid());
581-
if (update_map(gid_map, map_path, map_len)) {
581+
if (update_map(gid_map, map_path, map_len)) {
582582
return -1;
583583
}
584584

doors/door_irc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ static int __attribute__ ((nonnull (1, 6))) __chat_send(struct client_relay *cli
195195
* since we don't control the prefix at all towards other IRC networks. */
196196
if (sender) { /* Yes, sender can be NULL */
197197
snprintf(prefix, sizeof(prefix), "%s@%u", bbs_username(sender->node->user), sender->node->id);
198-
199198
}
200199
#else
201200
if (sender) {

external/filemgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ static int filemgr(void)
598598
initscr();
599599
cbreak();
600600
nonl();
601-
noecho();
601+
noecho();
602602
keypad(stdscr, TRUE); /* Enable keypad for function key interpretation (escape sequences) */
603603
curs_set(0); /* Disable cursor */
604604
start_color(); /* Enable colors */

external/isoroot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static int setup_namespace(pid_t pid)
182182

183183
snprintf(map_path, sizeof(map_path), "/proc/%d/gid_map", pid);
184184
map_len = snprintf(map_buf, sizeof(map_buf), "0 %ld 1", (long) getgid());
185-
if (update_map(gid_map, map_path, map_len)) {
185+
if (update_map(gid_map, map_path, map_len)) {
186186
return -1;
187187
}
188188

external/saslencode.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,23 @@ static char *base64_encode(const char *data, int input_length, int *outlen)
4747
return NULL;
4848
}
4949

50-
for (i = 0, j = 0; i < input_length; ) {
51-
uint32_t octet_a = i < input_length ? (unsigned char) data[i++] : 0;
52-
uint32_t octet_b = i < input_length ? (unsigned char) data[i++] : 0;
53-
uint32_t octet_c = i < input_length ? (unsigned char) data[i++] : 0;
54-
uint32_t triple = (octet_a << 0x10) + (octet_b << 0x08) + octet_c;
55-
encoded_data[j++] = encoding_table[(triple >> 3 * 6) & 0x3F];
56-
encoded_data[j++] = encoding_table[(triple >> 2 * 6) & 0x3F];
57-
encoded_data[j++] = encoding_table[(triple >> 1 * 6) & 0x3F];
58-
encoded_data[j++] = encoding_table[(triple >> 0 * 6) & 0x3F];
59-
}
50+
for (i = 0, j = 0; i < input_length; ) {
51+
uint32_t octet_a = i < input_length ? (unsigned char) data[i++] : 0;
52+
uint32_t octet_b = i < input_length ? (unsigned char) data[i++] : 0;
53+
uint32_t octet_c = i < input_length ? (unsigned char) data[i++] : 0;
54+
uint32_t triple = (octet_a << 0x10) + (octet_b << 0x08) + octet_c;
55+
encoded_data[j++] = encoding_table[(triple >> 3 * 6) & 0x3F];
56+
encoded_data[j++] = encoding_table[(triple >> 2 * 6) & 0x3F];
57+
encoded_data[j++] = encoding_table[(triple >> 1 * 6) & 0x3F];
58+
encoded_data[j++] = encoding_table[(triple >> 0 * 6) & 0x3F];
59+
}
6060

61-
for (i = 0; i < mod_table[input_length % 3]; i++) {
62-
encoded_data[output_len - 1 - i] = '=';
61+
for (i = 0; i < mod_table[input_length % 3]; i++) {
62+
encoded_data[output_len - 1 - i] = '=';
6363
}
6464

6565
*outlen = output_len;
66-
return encoded_data;
66+
return encoded_data;
6767
}
6868

6969
int main(int argc, char *argv[])

include/linkedlists.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ struct name { \
112112
* entry to \a NULL (empty list) and recreating the embedded lock.
113113
*/
114114
#define RWLIST_HEAD_INIT(head) { \
115-
(head)->first = NULL; \
116-
(head)->last = NULL; \
117-
__bbs_rwlock_init(&(head)->lock, __FILE__, __LINE__, __func__, #head); \
115+
(head)->first = NULL; \
116+
(head)->last = NULL; \
117+
__bbs_rwlock_init(&(head)->lock, __FILE__, __LINE__, __func__, #head); \
118118
}
119119

120120
/*!
@@ -126,9 +126,9 @@ struct name { \
126126
* It does not free the structure from memory.
127127
*/
128128
#define RWLIST_HEAD_DESTROY(head) { \
129-
(head)->first = NULL; \
130-
(head)->last = NULL; \
131-
__bbs_rwlock_destroy(&(head)->lock, __FILE__, __LINE__, __func__, #head); \
129+
(head)->first = NULL; \
130+
(head)->last = NULL; \
131+
__bbs_rwlock_destroy(&(head)->lock, __FILE__, __LINE__, __func__, #head); \
132132
}
133133

134134
/*!
@@ -310,13 +310,13 @@ struct { \
310310
* temporarily (until the next RWLIST_INSERT_TAIL is performed).
311311
*/
312312
#define RWLIST_INSERT_TAIL(head, elm, field) do { \
313-
if (!(head)->first) { \
313+
if (!(head)->first) { \
314314
(head)->first = (elm); \
315315
(head)->last = (elm); \
316-
} else { \
316+
} else { \
317317
(head)->last->field.next = (elm); \
318318
(head)->last = (elm); \
319-
} \
319+
} \
320320
} while (0)
321321

322322
/*!

0 commit comments

Comments
 (0)