Code

Include file cleanups..
authorLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 22 May 2005 18:54:17 +0000 (11:54 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 22 May 2005 18:54:17 +0000 (11:54 -0700)
Add <limits.h> to the include files handled by "cache.h", and remove
extraneous #include directives from various .c files. The rule is that
"cache.h" gets all the basic stuff, so that we'll have as few system
dependencies as possible.

14 files changed:
cache.h
commit-tree.c
commit.c
date.c
delta.c
diff-helper.c
diff.c
http-pull.c
local-pull.c
object.c
read-cache.c
rpull.c
sha1_file.c
usage.c

diff --git a/cache.h b/cache.h
index 28e3dbddcabbbff0f246a21114f27e1e5721ce04..d38d9a848c2fa0793bb849f17e33e75efc927bc7 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -10,6 +10,7 @@
 #include <stdarg.h>
 #include <string.h>
 #include <errno.h>
+#include <limits.h>
 #include <sys/mman.h>
 #include <sys/param.h>
 #include <netinet/in.h>
index e6f001ea279b4d64d427495da91cc7737e2faa80..e81e530fd4d5a118f814754455d36d83649b3124 100644 (file)
@@ -7,9 +7,7 @@
 
 #include <pwd.h>
 #include <time.h>
-#include <string.h>
 #include <ctype.h>
-#include <time.h>
 
 #define BLOCKING (1ul << 14)
 
index 3f2235ecf87b63bc5d16342ebcf7f8faf098530a..b4e000e9c2cdc726271bdc3ced9c2534848d18de 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -1,8 +1,6 @@
 #include "tag.h"
 #include "commit.h"
 #include "cache.h"
-#include <string.h>
-#include <limits.h>
 
 const char *commit_type = "commit";
 
diff --git a/date.c b/date.c
index 1f366a67f8b0d282088a26d900a3031fdc3e6012..ff922fe4fc896f4d1132ae84ab5fa74c7f582484 100644 (file)
--- a/date.c
+++ b/date.c
@@ -4,9 +4,6 @@
  * Copyright (C) Linus Torvalds, 2005
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <ctype.h>
 #include <time.h>
 
diff --git a/delta.c b/delta.c
index 05ef7fd6e4e06206fe60078c05cd054ab1254060..b31957a1d38046b9ead2569bbdd59be061f0157b 100644 (file)
--- a/delta.c
+++ b/delta.c
@@ -5,7 +5,6 @@
 #include "tag.h"
 #include "delta.h"
 #include "cache.h"
-#include <string.h>
 
 /* the delta object definition (it can alias any other object) */
 struct delta {
index 0bc54a3434e1467cf7c647cb2410da06a6f9ca01..23855759eebc649e7dcc03b6fb3abae3064bb5ed 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (C) 2005 Junio C Hamano
  */
-#include <limits.h>
 #include "cache.h"
 #include "strbuf.h"
 #include "diff.h"
diff --git a/diff.c b/diff.c
index eb8424e22cb10502e9854a962293732677c25970..4757547ea00f57a6523f0300be24b1c8bcde316e 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -4,7 +4,6 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <signal.h>
-#include <limits.h>
 #include "cache.h"
 #include "diff.h"
 #include "diffcore.h"
index cc62f85f48fd5fa1e2e09039846845c495fd084a..ba8585cfd4fcbe05b62a7ed2f0aa4ddbb625326e 100644 (file)
@@ -1,11 +1,5 @@
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
 #include "cache.h"
 #include "commit.h"
-#include <errno.h>
-#include <stdio.h>
 
 #include "pull.h"
 
index 3a342ab18390d7ce0df1f970a4961b31548a9417..10d4ca890502d03a72d82a4eb2556d76cdf6d2c7 100644 (file)
@@ -1,15 +1,8 @@
 /*
  * Copyright (C) 2005 Junio C Hamano
  */
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <limits.h>
 #include "cache.h"
 #include "commit.h"
-#include <errno.h>
-#include <stdio.h>
 #include "pull.h"
 
 static int use_link = 0;
index deb683076d7e1a91e913398ff905085230014a4f..d093e17d240cff9e62a62b74ca4b3c86a472f54a 100644 (file)
--- a/object.c
+++ b/object.c
@@ -5,8 +5,6 @@
 #include "cache.h"
 #include "tag.h"
 #include "delta.h"
-#include <stdlib.h>
-#include <string.h>
 
 struct object **objs;
 int nr_objs;
index b3eec846731b3c3b8b61f94ba0dff3e80fc1407d..24ebe383d7a4e72c8cd461f90b4b06bf5cfdb0d1 100644 (file)
@@ -3,7 +3,6 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include <stdarg.h>
 #include "cache.h"
 
 struct cache_entry **active_cache = NULL;
diff --git a/rpull.c b/rpull.c
index b48e63157c66c160b9751603a92831f77106044c..36e49f799a6ac300a00f8d09d9dc9e6636b3d8e0 100644 (file)
--- a/rpull.c
+++ b/rpull.c
@@ -1,11 +1,5 @@
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
 #include "cache.h"
 #include "commit.h"
-#include <errno.h>
-#include <stdio.h>
 #include "rsh.h"
 #include "pull.h"
 
index edbf9f9a84602c9d7b0f8064a943bdc83344c728..e6fdaa217a8ef7d2ac58e705d72bb7b34fd49282 100644 (file)
@@ -6,8 +6,6 @@
  * This handles basic git sha1 object files - packing, unpacking,
  * creation etc.
  */
-#include <stdarg.h>
-#include <limits.h>
 #include "cache.h"
 #include "delta.h"
 
diff --git a/usage.c b/usage.c
index e774d2ef32726af0707d817cdb63fc8751ddc9d8..86211c9141b788f6dbdf7b192f0ac4f4e2527d64 100644 (file)
--- a/usage.c
+++ b/usage.c
@@ -3,7 +3,6 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include <stdarg.h>
 #include "cache.h"
 
 static void report(const char *prefix, const char *err, va_list params)