Skip to content

Commit 65156bb

Browse files
newrengitster
authored andcommitted
treewide: remove double forward declaration of read_in_full
cache.h's nature of a dumping ground of includes prevented it from being included in some compat/ files, forcing us into a workaround of having a double forward declaration of the read_in_full() function (see commit 14086b0 ("compat/pread.c: Add a forward declaration to fix a warning", 2007-11-17)). Now that we have moved functions like read_in_full() from cache.h to wrapper.h, and wrapper.h isn't littered with unrelated and scary #defines, get rid of the extra forward declaration and just have compat/pread.c include wrapper.h. Signed-off-by: Elijah Newren <[email protected]> Acked-by: Calvin Wan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 31dfa17 commit 65156bb

File tree

12 files changed

+11
-6
lines changed

12 files changed

+11
-6
lines changed

builtin/clone.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "hook.h"
4343
#include "bundle.h"
4444
#include "bundle-uri.h"
45+
#include "wrapper.h"
4546

4647
/*
4748
* Overall FIXMEs:

bulk-checkin.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "packfile.h"
1818
#include "object-file.h"
1919
#include "object-store.h"
20+
#include "wrapper.h"
2021

2122
static int odb_transaction_nesting;
2223

combine-diff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "userdiff.h"
1717
#include "oid-array.h"
1818
#include "revision.h"
19+
#include "wrapper.h"
1920

2021
static int compare_paths(const struct combine_diff_path *one,
2122
const struct diff_filespec *two)

compat/pread.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "../git-compat-util.h"
2+
#include "../wrapper.h"
23

34
ssize_t git_pread(int fd, void *buf, size_t count, off_t offset)
45
{

git-compat-util.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -859,12 +859,6 @@ int git_lstat(const char *, struct stat *);
859859
#define pread git_pread
860860
ssize_t git_pread(int fd, void *buf, size_t count, off_t offset);
861861
#endif
862-
/*
863-
* Forward decl that will remind us if its twin in cache.h changes.
864-
* This function is used in compat/pread.c. But we can't include
865-
* cache.h there.
866-
*/
867-
ssize_t read_in_full(int fd, void *buf, size_t count);
868862

869863
#ifdef NO_SETENV
870864
#define setenv gitsetenv

grep.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "commit.h"
1212
#include "quote.h"
1313
#include "help.h"
14+
#include "wrapper.h"
1415

1516
static int grep_source_load(struct grep_source *gs);
1617
static int grep_source_is_binary(struct grep_source *gs,

pack-write.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "oidmap.h"
1111
#include "pack-objects.h"
1212
#include "pack-revindex.h"
13+
#include "wrapper.h"
1314

1415
void reset_pack_idx_option(struct pack_idx_option *opts)
1516
{

path.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "object-store.h"
1919
#include "lockfile.h"
2020
#include "exec-cmd.h"
21+
#include "wrapper.h"
2122

2223
static int get_st_mode_bits(const char *path, int *mode)
2324
{

refs/packed-backend.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "../iterator.h"
1010
#include "../lockfile.h"
1111
#include "../chdir-notify.h"
12+
#include "../wrapper.h"
1213
#include "../write-or-die.h"
1314

1415
enum mmap_strategy {

send-pack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "quote.h"
1515
#include "transport.h"
1616
#include "version.h"
17+
#include "wrapper.h"
1718
#include "oid-array.h"
1819
#include "gpg-interface.h"
1920
#include "shallow.h"

0 commit comments

Comments
 (0)