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 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>
This commit is contained in:
Elijah Newren 2023-04-11 00:42:02 -07:00 committed by Junio C Hamano
parent 31dfa17b3b
commit 65156bb7ec
12 changed files with 11 additions and 6 deletions

View File

@ -42,6 +42,7 @@
#include "hook.h" #include "hook.h"
#include "bundle.h" #include "bundle.h"
#include "bundle-uri.h" #include "bundle-uri.h"
#include "wrapper.h"
/* /*
* Overall FIXMEs: * Overall FIXMEs:

View File

@ -17,6 +17,7 @@
#include "packfile.h" #include "packfile.h"
#include "object-file.h" #include "object-file.h"
#include "object-store.h" #include "object-store.h"
#include "wrapper.h"
static int odb_transaction_nesting; static int odb_transaction_nesting;

View File

@ -16,6 +16,7 @@
#include "userdiff.h" #include "userdiff.h"
#include "oid-array.h" #include "oid-array.h"
#include "revision.h" #include "revision.h"
#include "wrapper.h"
static int compare_paths(const struct combine_diff_path *one, static int compare_paths(const struct combine_diff_path *one,
const struct diff_filespec *two) const struct diff_filespec *two)

View File

@ -1,4 +1,5 @@
#include "../git-compat-util.h" #include "../git-compat-util.h"
#include "../wrapper.h"
ssize_t git_pread(int fd, void *buf, size_t count, off_t offset) ssize_t git_pread(int fd, void *buf, size_t count, off_t offset)
{ {

View File

@ -859,12 +859,6 @@ int git_lstat(const char *, struct stat *);
#define pread git_pread #define pread git_pread
ssize_t git_pread(int fd, void *buf, size_t count, off_t offset); ssize_t git_pread(int fd, void *buf, size_t count, off_t offset);
#endif #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 #ifdef NO_SETENV
#define setenv gitsetenv #define setenv gitsetenv

1
grep.c
View File

@ -11,6 +11,7 @@
#include "commit.h" #include "commit.h"
#include "quote.h" #include "quote.h"
#include "help.h" #include "help.h"
#include "wrapper.h"
static int grep_source_load(struct grep_source *gs); static int grep_source_load(struct grep_source *gs);
static int grep_source_is_binary(struct grep_source *gs, static int grep_source_is_binary(struct grep_source *gs,

View File

@ -10,6 +10,7 @@
#include "oidmap.h" #include "oidmap.h"
#include "pack-objects.h" #include "pack-objects.h"
#include "pack-revindex.h" #include "pack-revindex.h"
#include "wrapper.h"
void reset_pack_idx_option(struct pack_idx_option *opts) void reset_pack_idx_option(struct pack_idx_option *opts)
{ {

1
path.c
View File

@ -18,6 +18,7 @@
#include "object-store.h" #include "object-store.h"
#include "lockfile.h" #include "lockfile.h"
#include "exec-cmd.h" #include "exec-cmd.h"
#include "wrapper.h"
static int get_st_mode_bits(const char *path, int *mode) static int get_st_mode_bits(const char *path, int *mode)
{ {

View File

@ -9,6 +9,7 @@
#include "../iterator.h" #include "../iterator.h"
#include "../lockfile.h" #include "../lockfile.h"
#include "../chdir-notify.h" #include "../chdir-notify.h"
#include "../wrapper.h"
#include "../write-or-die.h" #include "../write-or-die.h"
enum mmap_strategy { enum mmap_strategy {

View File

@ -14,6 +14,7 @@
#include "quote.h" #include "quote.h"
#include "transport.h" #include "transport.h"
#include "version.h" #include "version.h"
#include "wrapper.h"
#include "oid-array.h" #include "oid-array.h"
#include "gpg-interface.h" #include "gpg-interface.h"
#include "shallow.h" #include "shallow.h"

View File

@ -12,6 +12,7 @@
#include "promisor-remote.h" #include "promisor-remote.h"
#include "quote.h" #include "quote.h"
#include "trace2.h" #include "trace2.h"
#include "wrapper.h"
static int inside_git_dir = -1; static int inside_git_dir = -1;
static int inside_work_tree = -1; static int inside_work_tree = -1;

View File

@ -32,6 +32,7 @@
#include "commit-graph.h" #include "commit-graph.h"
#include "commit-reach.h" #include "commit-reach.h"
#include "shallow.h" #include "shallow.h"
#include "wrapper.h"
#include "write-or-die.h" #include "write-or-die.h"
/* Remember to update object flag allocation in object.h */ /* Remember to update object flag allocation in object.h */