Skip to content

Commit 6b0c312

Browse files
author
Linus Torvalds
committed
Include file cleanups..
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.
1 parent ca67f00 commit 6b0c312

File tree

14 files changed

+1
-35
lines changed

14 files changed

+1
-35
lines changed

cache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <stdarg.h>
1111
#include <string.h>
1212
#include <errno.h>
13+
#include <limits.h>
1314
#include <sys/mman.h>
1415
#include <sys/param.h>
1516
#include <netinet/in.h>

commit-tree.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
#include <pwd.h>
99
#include <time.h>
10-
#include <string.h>
1110
#include <ctype.h>
12-
#include <time.h>
1311

1412
#define BLOCKING (1ul << 14)
1513

commit.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#include "tag.h"
22
#include "commit.h"
33
#include "cache.h"
4-
#include <string.h>
5-
#include <limits.h>
64

75
const char *commit_type = "commit";
86

date.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
* Copyright (C) Linus Torvalds, 2005
55
*/
66

7-
#include <stdio.h>
8-
#include <stdlib.h>
9-
#include <string.h>
107
#include <ctype.h>
118
#include <time.h>
129

delta.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "tag.h"
66
#include "delta.h"
77
#include "cache.h"
8-
#include <string.h>
98

109
/* the delta object definition (it can alias any other object) */
1110
struct delta {

diff-helper.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
22
* Copyright (C) 2005 Junio C Hamano
33
*/
4-
#include <limits.h>
54
#include "cache.h"
65
#include "strbuf.h"
76
#include "diff.h"

diff.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <sys/types.h>
55
#include <sys/wait.h>
66
#include <signal.h>
7-
#include <limits.h>
87
#include "cache.h"
98
#include "diff.h"
109
#include "diffcore.h"

http-pull.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
#include <fcntl.h>
2-
#include <unistd.h>
3-
#include <string.h>
4-
#include <stdlib.h>
51
#include "cache.h"
62
#include "commit.h"
7-
#include <errno.h>
8-
#include <stdio.h>
93

104
#include "pull.h"
115

local-pull.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
/*
22
* Copyright (C) 2005 Junio C Hamano
33
*/
4-
#include <fcntl.h>
5-
#include <unistd.h>
6-
#include <string.h>
7-
#include <stdlib.h>
8-
#include <limits.h>
94
#include "cache.h"
105
#include "commit.h"
11-
#include <errno.h>
12-
#include <stdio.h>
136
#include "pull.h"
147

158
static int use_link = 0;

object.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#include "cache.h"
66
#include "tag.h"
77
#include "delta.h"
8-
#include <stdlib.h>
9-
#include <string.h>
108

119
struct object **objs;
1210
int nr_objs;

0 commit comments

Comments
 (0)