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:
#include "hook.h"
#include "bundle.h"
#include "bundle-uri.h"
#include "hook.h"
#include "bundle.h"
#include "bundle-uri.h"
#include "packfile.h"
#include "object-file.h"
#include "object-store.h"
#include "packfile.h"
#include "object-file.h"
#include "object-store.h"
static int odb_transaction_nesting;
static int odb_transaction_nesting;
#include "userdiff.h"
#include "oid-array.h"
#include "revision.h"
#include "userdiff.h"
#include "oid-array.h"
#include "revision.h"
static int compare_paths(const struct combine_diff_path *one,
const struct diff_filespec *two)
static int compare_paths(const struct combine_diff_path *one,
const struct diff_filespec *two)
#include "../git-compat-util.h"
#include "../git-compat-util.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)
{
#define pread git_pread
ssize_t git_pread(int fd, void *buf, size_t count, off_t offset);
#endif
#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
#ifdef NO_SETENV
#define setenv gitsetenv
#include "commit.h"
#include "quote.h"
#include "help.h"
#include "commit.h"
#include "quote.h"
#include "help.h"
static int grep_source_load(struct grep_source *gs);
static int grep_source_is_binary(struct grep_source *gs,
static int grep_source_load(struct grep_source *gs);
static int grep_source_is_binary(struct grep_source *gs,
#include "oidmap.h"
#include "pack-objects.h"
#include "pack-revindex.h"
#include "oidmap.h"
#include "pack-objects.h"
#include "pack-revindex.h"
void reset_pack_idx_option(struct pack_idx_option *opts)
{
void reset_pack_idx_option(struct pack_idx_option *opts)
{
#include "object-store.h"
#include "lockfile.h"
#include "exec-cmd.h"
#include "object-store.h"
#include "lockfile.h"
#include "exec-cmd.h"
static int get_st_mode_bits(const char *path, int *mode)
{
static int get_st_mode_bits(const char *path, int *mode)
{
#include "../iterator.h"
#include "../lockfile.h"
#include "../chdir-notify.h"
#include "../iterator.h"
#include "../lockfile.h"
#include "../chdir-notify.h"
#include "../write-or-die.h"
enum mmap_strategy {
#include "../write-or-die.h"
enum mmap_strategy {
#include "quote.h"
#include "transport.h"
#include "version.h"
#include "quote.h"
#include "transport.h"
#include "version.h"
#include "oid-array.h"
#include "gpg-interface.h"
#include "shallow.h"
#include "oid-array.h"
#include "gpg-interface.h"
#include "shallow.h"
#include "promisor-remote.h"
#include "quote.h"
#include "trace2.h"
#include "promisor-remote.h"
#include "quote.h"
#include "trace2.h"
static int inside_git_dir = -1;
static int inside_work_tree = -1;
static int inside_git_dir = -1;
static int inside_work_tree = -1;
#include "commit-graph.h"
#include "commit-reach.h"
#include "shallow.h"
#include "commit-graph.h"
#include "commit-reach.h"
#include "shallow.h"
#include "write-or-die.h"
/* Remember to update object flag allocation in object.h */
#include "write-or-die.h"
/* Remember to update object flag allocation in object.h */