about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-18 17:06:41 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-18 17:06:41 +0200
commit22f456a2a02d2b8b4b6fb4da9927683bc5d4a29f (patch)
treefac7537e31634d146cc65f96344d81fbfbaacbcb
parent4babc3e95acc89e5e483c1ee5050272454eccfdc (diff)
downloadmblaze-22f456a2a02d2b8b4b6fb4da9927683bc5d4a29f.tar.gz
mblaze-22f456a2a02d2b8b4b6fb4da9927683bc5d4a29f.tar.xz
mblaze-22f456a2a02d2b8b4b6fb4da9927683bc5d4a29f.zip
clean up header includes
-rw-r--r--blaze822.c16
-rw-r--r--hdr.c16
-rw-r--r--list.c23
-rw-r--r--mseq.c12
-rw-r--r--rfc2045.c3
-rw-r--r--rfc2047.c4
-rw-r--r--scan.c14
-rw-r--r--seq.c16
-rw-r--r--show.c17
-rw-r--r--thread.c20
10 files changed, 63 insertions, 78 deletions
diff --git a/blaze822.c b/blaze822.c
index dad52f3..70ceb96 100644
--- a/blaze822.c
+++ b/blaze822.c
@@ -1,18 +1,18 @@
 // memmem
 #define _GNU_SOURCE
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <errno.h>
 #include <fcntl.h>
-#include <unistd.h>
-#include <ctype.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <errno.h>
 #include <time.h>
+#include <unistd.h>
 
 #include "blaze822.h"
 #include "blaze822_priv.h"
diff --git a/hdr.c b/hdr.c
index 6dd96ca..3fc4a7c 100644
--- a/hdr.c
+++ b/hdr.c
@@ -1,15 +1,13 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
+#include <sys/types.h>
+
 #include <ctype.h>
-#include <string.h>
 #include <errno.h>
-#include <time.h>
-#include <wchar.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 #include "blaze822.h"
 
diff --git a/list.c b/list.c
index 2a115c8..689743b 100644
--- a/list.c
+++ b/list.c
@@ -1,17 +1,16 @@
 #define _GNU_SOURCE
-#include <dirent.h>     /* Defines DT_* constants */
+
+#include <sys/stat.h>
+#include <sys/syscall.h>
+
+#include <dirent.h>
 #include <fcntl.h>
+#include <limits.h>
+#include <stdint.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/syscall.h>
-#include <stdint.h>
-#include <limits.h>
-
-#define handle_error(msg)					\
-	do { perror(msg); exit(EXIT_FAILURE); } while (0)
 
 #define lc(c) ((c) | 0x20)
 #define uc(c) ((c) & 0xdf)
@@ -115,8 +114,10 @@ listdir(char *dir)
 	
 	while (1) {
 		nread = syscall(SYS_getdents64, fd, buf, BUF_SIZE);
-		if (nread == -1)
-			handle_error("getdents64");
+		if (nread == -1) {
+			perror("getdents64");
+			break;
+		}
 		
 		if (nread == 0)
 			break;
diff --git a/mseq.c b/mseq.c
index a700b72..2fba9ad 100644
--- a/mseq.c
+++ b/mseq.c
@@ -1,14 +1,6 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <stdlib.h>
-#include <string.h>
 #include <stdio.h>
-#include <limits.h>
-#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
 
 #include "blaze822.h"
 
diff --git a/rfc2045.c b/rfc2045.c
index 5b6ab4f..ef073d3 100644
--- a/rfc2045.c
+++ b/rfc2045.c
@@ -1,4 +1,7 @@
 #define _GNU_SOURCE
+
+#include <sys/types.h>
+
 #include <string.h>
 
 #include "blaze822.h"
diff --git a/rfc2047.c b/rfc2047.c
index e53a5ce..fdf3589 100644
--- a/rfc2047.c
+++ b/rfc2047.c
@@ -1,9 +1,9 @@
-#include <stdlib.h>
 #include <errno.h>
 #include <iconv.h>
+#include <stdint.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <stdint.h>
 
 #include "blaze822.h"
 #include "blaze822_priv.h"
diff --git a/scan.c b/scan.c
index d370f14..ff19f2e 100644
--- a/scan.c
+++ b/scan.c
@@ -1,15 +1,13 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/types.h>
+
+#include <errno.h>
 #include <fcntl.h>
-#include <unistd.h>
-#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <errno.h>
 #include <time.h>
-#include <wchar.h>
+#include <unistd.h>
 
 #include "blaze822.h"
 
diff --git a/seq.c b/seq.c
index ab74023..dcecc09 100644
--- a/seq.c
+++ b/seq.c
@@ -1,15 +1,15 @@
-#include <sys/types.h>
+#include <sys/mman.h>
 #include <sys/stat.h>
+#include <sys/types.h>
+
+#include <errno.h>
 #include <fcntl.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
 #include <limits.h>
-#include <errno.h>
 #include <search.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 #include "blaze822.h"
 #include "blaze822_priv.h"
diff --git a/show.c b/show.c
index 5fd93e3..7c90b79 100644
--- a/show.c
+++ b/show.c
@@ -1,17 +1,14 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
+#include <sys/types.h>
+
 #include <ctype.h>
-#include <string.h>
 #include <errno.h>
-#include <time.h>
-#include <wchar.h>
-#include <unistd.h>
+#include <fcntl.h>
 #include <iconv.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 #include "blaze822.h"
 
diff --git a/thread.c b/thread.c
index f919442..e4766d0 100644
--- a/thread.c
+++ b/thread.c
@@ -5,21 +5,17 @@
  * subject threading and sibling sorting is not done yet
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <time.h>
-#include <wchar.h>
+#include <sys/types.h>
 
+#include <errno.h>
+#include <fcntl.h>
 #include <search.h>
-
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 #include "blaze822.h"