Fix coding style

It was about damn time. Consistency is very important in such a
big codebase.
This commit is contained in:
FRIGN 2014-11-13 18:29:30 +01:00 committed by sin
parent e35d9e62a5
commit eee98ed3a4
70 changed files with 622 additions and 557 deletions

1
cal.c
View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include "util.h" #include "util.h"
#define MONTHMAX 100 #define MONTHMAX 100

View File

@ -7,6 +7,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "util.h" #include "util.h"
static int gid; static int gid;

View File

@ -6,6 +6,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void chownpwgr(const char *); static void chownpwgr(const char *);

View File

@ -2,6 +2,7 @@
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void static void

View File

@ -4,6 +4,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "util.h" #include "util.h"
static void cksum(FILE *, const char *); static void cksum(FILE *, const char *);

1
cmp.c
View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
enum { Same = 0, Diff = 1, Error = 2 }; enum { Same = 0, Diff = 1, Error = 2 };

1
cols.c
View File

@ -6,6 +6,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "text.h" #include "text.h"
#include "util.h" #include "util.h"

1
comm.c
View File

@ -4,6 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <limits.h> #include <limits.h>
#include "util.h" #include "util.h"
#define CLAMP(x, l, h) MIN(h, MAX(l, x)) #define CLAMP(x, l, h) MIN(h, MAX(l, x))

1
cp.c
View File

@ -2,6 +2,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "fs.h" #include "fs.h"
#include "util.h" #include "util.h"

1
cut.c
View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "text.h" #include "text.h"
#include "util.h" #include "util.h"

1
date.c
View File

@ -3,6 +3,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void static void

View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void static void

1
du.c
View File

@ -8,6 +8,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
#include <limits.h> #include <limits.h>
#include "util.h" #include "util.h"
static long blksize = 512; static long blksize = 512;

1
echo.c
View File

@ -2,6 +2,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "util.h" #include "util.h"
static void static void

1
env.c
View File

@ -4,6 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include "util.h" #include "util.h"
extern char **environ; extern char **environ;

View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <wchar.h> #include <wchar.h>
#include "util.h" #include "util.h"
typedef struct { typedef struct {

1
fold.c
View File

@ -4,6 +4,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "text.h" #include "text.h"
#include "util.h" #include "util.h"

1
grep.c
View File

@ -5,6 +5,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "text.h" #include "text.h"
#include "util.h" #include "util.h"

1
head.c
View File

@ -3,6 +3,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "text.h" #include "text.h"
#include "util.h" #include "util.h"

View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void static void

1
kill.c
View File

@ -9,6 +9,7 @@
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
struct { struct {

1
link.c
View File

@ -1,6 +1,7 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
int int

1
ln.c
View File

@ -6,6 +6,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void static void

View File

@ -1,6 +1,7 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
int int

1
ls.c
View File

@ -10,6 +10,7 @@
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "util.h" #include "util.h"
typedef struct { typedef struct {

View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include "util.h" #include "util.h"
#include "crypt.h" #include "crypt.h"
#include "md5.h" #include "md5.h"

View File

@ -7,6 +7,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "util.h" #include "util.h"
static void mkdirp(char *); static void mkdirp(char *);

View File

@ -3,6 +3,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "util.h" #include "util.h"
static void static void

View File

@ -5,6 +5,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void static void

1
mv.c
View File

@ -4,6 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "fs.h" #include "fs.h"
#include "util.h" #include "util.h"

1
nice.c
View File

@ -6,6 +6,7 @@
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void static void

1
nl.c
View File

@ -4,6 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "text.h" #include "text.h"
#include "util.h" #include "util.h"

View File

@ -5,6 +5,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "util.h" #include "util.h"
enum { Error = 127, Found = 126 }; enum { Error = 127, Found = 126 };

View File

@ -6,6 +6,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <wchar.h> #include <wchar.h>
#include "util.h" #include "util.h"
typedef struct { typedef struct {

View File

@ -1,6 +1,7 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "util.h" #include "util.h"
extern char **environ; extern char **environ;

1
pwd.c
View File

@ -3,6 +3,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "util.h" #include "util.h"
static const char *getpwd(const char *cwd); static const char *getpwd(const char *cwd);

View File

@ -6,6 +6,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "util.h" #include "util.h"
static void static void

View File

@ -7,6 +7,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "util.h" #include "util.h"
static int strtop(const char *); static int strtop(const char *);

1
rm.c
View File

@ -4,6 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "fs.h" #include "fs.h"
#include "util.h" #include "util.h"

View File

@ -4,6 +4,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include "util.h" #include "util.h"
static void static void

1
seq.c
View File

@ -4,6 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static int digitsleft(const char *); static int digitsleft(const char *);

View File

@ -4,6 +4,7 @@
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "util.h" #include "util.h"
static void static void

View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include "util.h" #include "util.h"
#include "crypt.h" #include "crypt.h"
#include "sha1.h" #include "sha1.h"

View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include "util.h" #include "util.h"
#include "crypt.h" #include "crypt.h"
#include "sha256.h" #include "sha256.h"

View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include "util.h" #include "util.h"
#include "crypt.h" #include "crypt.h"
#include "sha512.h" #include "sha512.h"

View File

@ -1,6 +1,7 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void static void

3
sort.c
View File

@ -5,6 +5,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "text.h" #include "text.h"
#include "util.h" #include "util.h"
@ -20,7 +21,7 @@ enum {
MOD_N = 1 << 1, MOD_N = 1 << 1,
MOD_STARTB = 1 << 2, MOD_STARTB = 1 << 2,
MOD_ENDB = 1 << 3, MOD_ENDB = 1 << 3,
MOD_R = 1 << 4 MOD_R = 1 << 4,
}; };
struct kdlist { struct kdlist {

View File

@ -5,6 +5,7 @@
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <limits.h> #include <limits.h>
#include "util.h" #include "util.h"
static int itostr(char *, int, int); static int itostr(char *, int, int);

View File

@ -1,6 +1,7 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "text.h" #include "text.h"
#include "util.h" #include "util.h"

View File

@ -2,6 +2,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <ctype.h> #include <ctype.h>
#include "util.h" #include "util.h"
static void dostrings(FILE *fp, const char *fname); static void dostrings(FILE *fp, const char *fname);

1
sync.c
View File

@ -2,6 +2,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void static void

1
tail.c
View File

@ -3,6 +3,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "text.h" #include "text.h"
#include "util.h" #include "util.h"

1
tar.c
View File

@ -10,6 +10,7 @@
#include <limits.h> #include <limits.h>
#include <grp.h> #include <grp.h>
#include <pwd.h> #include <pwd.h>
#include "util.h" #include "util.h"
typedef struct Header Header; typedef struct Header Header;

1
tee.c
View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void static void

1
test.c
View File

@ -6,6 +6,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void static void

View File

@ -7,6 +7,7 @@
#include <unistd.h> #include <unistd.h>
#include <utime.h> #include <utime.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "util.h" #include "util.h"
static void touch(const char *); static void touch(const char *);

1
tr.c
View File

@ -5,6 +5,7 @@
#include <string.h> #include <string.h>
#include <locale.h> #include <locale.h>
#include <wchar.h> #include <wchar.h>
#include "text.h" #include "text.h"
#include "util.h" #include "util.h"

1
tty.c
View File

@ -2,6 +2,7 @@
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "util.h" #include "util.h"
static void static void

View File

@ -4,6 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include "util.h" #include "util.h"
static void static void

View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <wchar.h> #include <wchar.h>
#include "util.h" #include "util.h"
typedef struct { typedef struct {

View File

@ -7,6 +7,7 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include "util.h" #include "util.h"
#include "text.h" #include "text.h"

View File

@ -4,6 +4,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void uuencode(FILE *, const char *, const char *); static void uuencode(FILE *, const char *, const char *);

1
wc.c
View File

@ -4,6 +4,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "util.h" #include "util.h"
static void output(const char *, long, long, long); static void output(const char *, long, long, long);

View File

@ -5,6 +5,7 @@
#include <string.h> #include <string.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h> #include <unistd.h>
#include "text.h" #include "text.h"
#include "util.h" #include "util.h"

1
yes.c
View File

@ -1,6 +1,7 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "util.h" #include "util.h"
static void static void