]> git.ipfire.org Git - thirdparty/git.git/commitdiff
treewide: remove double forward declaration of read_in_full
authorElijah Newren <newren@gmail.com>
Tue, 11 Apr 2023 07:42:02 +0000 (00:42 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Apr 2023 15:52:11 +0000 (08:52 -0700)
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 14086b0a13 ("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 <newren@gmail.com>
Acked-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 files changed:
builtin/clone.c
bulk-checkin.c
combine-diff.c
compat/pread.c
git-compat-util.h
grep.c
pack-write.c
path.c
refs/packed-backend.c
send-pack.c
setup.c
upload-pack.c

index c7fdffb484c8972545147efb4c0441a0987d6b2c..4ed0a1d5aad97a78a32ee26158ba8ad6cbbaa6a3 100644 (file)
@@ -42,6 +42,7 @@
 #include "hook.h"
 #include "bundle.h"
 #include "bundle-uri.h"
+#include "wrapper.h"
 
 /*
  * Overall FIXMEs:
index 9192298db6a28ac884ff87e26ca73b0418d05afc..d843279715c3369ed92f853bd91c0e846af55049 100644 (file)
@@ -17,6 +17,7 @@
 #include "packfile.h"
 #include "object-file.h"
 #include "object-store.h"
+#include "wrapper.h"
 
 static int odb_transaction_nesting;
 
index cd5f39f22f40a5278ca4558ebd056b88fc0ea93b..f7e9fb574735d36e57b704c6455eae175fb42103 100644 (file)
@@ -16,6 +16,7 @@
 #include "userdiff.h"
 #include "oid-array.h"
 #include "revision.h"
+#include "wrapper.h"
 
 static int compare_paths(const struct combine_diff_path *one,
                          const struct diff_filespec *two)
index 978cac4ec91e6bb2f81539d85422bb37e4941a51..484e6d4c716ef6b6c3e5b24ff5a1879db3039d5d 100644 (file)
@@ -1,4 +1,5 @@
 #include "../git-compat-util.h"
+#include "../wrapper.h"
 
 ssize_t git_pread(int fd, void *buf, size_t count, off_t offset)
 {
index 1e6592624d09321428b03b6e77361ca2f94ba792..4fb771f42a5f9a0bf12030640b216221c3421e16 100644 (file)
@@ -859,12 +859,6 @@ int git_lstat(const char *, struct stat *);
 #define pread git_pread
 ssize_t git_pread(int fd, void *buf, size_t count, off_t offset);
 #endif
-/*
- * Forward decl that will remind us if its twin in cache.h changes.
- * This function is used in compat/pread.c.  But we can't include
- * cache.h there.
- */
-ssize_t read_in_full(int fd, void *buf, size_t count);
 
 #ifdef NO_SETENV
 #define setenv gitsetenv
diff --git a/grep.c b/grep.c
index bb8796a829f6fe66e4fd8e0a4e0189288f4358c7..d144b374894817c45cd0773bb1d42b884b3e9d9d 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -11,6 +11,7 @@
 #include "commit.h"
 #include "quote.h"
 #include "help.h"
+#include "wrapper.h"
 
 static int grep_source_load(struct grep_source *gs);
 static int grep_source_is_binary(struct grep_source *gs,
index d9b460fab4c858a5c848e781edeaf982c37b6528..9c37121be310096b737e7e018043a52ef4caacd7 100644 (file)
@@ -10,6 +10,7 @@
 #include "oidmap.h"
 #include "pack-objects.h"
 #include "pack-revindex.h"
+#include "wrapper.h"
 
 void reset_pack_idx_option(struct pack_idx_option *opts)
 {
diff --git a/path.c b/path.c
index dff215ac69339dce01cabd9a0f6d01b0e8bcec2f..7c1cd8182a81b9e8892960707cff8a0f7ff174cb 100644 (file)
--- a/path.c
+++ b/path.c
@@ -18,6 +18,7 @@
 #include "object-store.h"
 #include "lockfile.h"
 #include "exec-cmd.h"
+#include "wrapper.h"
 
 static int get_st_mode_bits(const char *path, int *mode)
 {
index 1eba1015dd5aa8378bf722b50a2b466774b43f0d..2333ed5a1f7afef829ef972f85247b7d4ec78fed 100644 (file)
@@ -9,6 +9,7 @@
 #include "../iterator.h"
 #include "../lockfile.h"
 #include "../chdir-notify.h"
+#include "../wrapper.h"
 #include "../write-or-die.h"
 
 enum mmap_strategy {
index 72ebb7b61ae6b2455d5e507d7c681262ddaedcc6..351037b07bce434feb1407e34bad6a804772b15b 100644 (file)
@@ -14,6 +14,7 @@
 #include "quote.h"
 #include "transport.h"
 #include "version.h"
+#include "wrapper.h"
 #include "oid-array.h"
 #include "gpg-interface.h"
 #include "shallow.h"
diff --git a/setup.c b/setup.c
index a546da755f14fa2db301284eb993d820ba20ba10..59abc16ba6da9584d7838896fc567a526f4093ad 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -12,6 +12,7 @@
 #include "promisor-remote.h"
 #include "quote.h"
 #include "trace2.h"
+#include "wrapper.h"
 
 static int inside_git_dir = -1;
 static int inside_work_tree = -1;
index 0305fb2fbdcacfb46f326ad765cd1aff3a412348..e16dee783dd7ac07e27b7f1307d1cfddd8ff654b 100644 (file)
@@ -32,6 +32,7 @@
 #include "commit-graph.h"
 #include "commit-reach.h"
 #include "shallow.h"
+#include "wrapper.h"
 #include "write-or-die.h"
 
 /* Remember to update object flag allocation in object.h */