From ef3ca95475ce467ae883cc8175ed40e6f7d27800 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 15 Aug 2018 10:54:05 -0700 Subject: Add missing includes and forward declarations I looped over the toplevel header files, creating a temporary two-line C program for each consisting of #include "git-compat-util.h" #include $HEADER This patch is the result of manually fixing errors in compiling those tiny programs. Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano diff --git a/alloc.h b/alloc.h index 3e4e828..7a41bb9 100644 --- a/alloc.h +++ b/alloc.h @@ -1,9 +1,11 @@ #ifndef ALLOC_H #define ALLOC_H +struct alloc_state; struct tree; struct commit; struct tag; +struct repository; void *alloc_blob_node(struct repository *r); void *alloc_tree_node(struct repository *r); diff --git a/apply.h b/apply.h index b80d8ba..0b70e1f 100644 --- a/apply.h +++ b/apply.h @@ -1,6 +1,9 @@ #ifndef APPLY_H #define APPLY_H +#include "lockfile.h" +#include "string-list.h" + enum apply_ws_error_action { nowarn_ws_error, warn_on_ws_error, diff --git a/archive.h b/archive.h index 1f9954f..7aba133 100644 --- a/archive.h +++ b/archive.h @@ -1,6 +1,7 @@ #ifndef ARCHIVE_H #define ARCHIVE_H +#include "cache.h" #include "pathspec.h" struct archiver_args { diff --git a/attr.h b/attr.h index 442d464..3185538 100644 --- a/attr.h +++ b/attr.h @@ -7,6 +7,7 @@ struct git_attr; /* opaque structures used internally for attribute collection */ struct all_attrs_item; struct attr_stack; +struct index_state; /* * Given a string, return the gitattribute object that diff --git a/bisect.h b/bisect.h index a5d9248..34df209 100644 --- a/bisect.h +++ b/bisect.h @@ -1,6 +1,8 @@ #ifndef BISECT_H #define BISECT_H +struct commit_list; + /* * Find bisection. If something is found, `reaches` will be the number of * commits that the best commit reaches. `all` will be the count of diff --git a/branch.h b/branch.h index 473d0a9..7d9b330 100644 --- a/branch.h +++ b/branch.h @@ -1,6 +1,8 @@ #ifndef BRANCH_H #define BRANCH_H +struct strbuf; + /* Functions for acting on the information about branches. */ /* diff --git a/bulk-checkin.h b/bulk-checkin.h index a855273..f438f93 100644 --- a/bulk-checkin.h +++ b/bulk-checkin.h @@ -4,6 +4,8 @@ #ifndef BULK_CHECKIN_H #define BULK_CHECKIN_H +#include "cache.h" + extern int index_bulk_checkin(struct object_id *oid, int fd, size_t size, enum object_type type, const char *path, unsigned flags); diff --git a/column.h b/column.h index 0a61917..2567a5c 100644 --- a/column.h +++ b/column.h @@ -36,6 +36,7 @@ static inline int column_active(unsigned int colopts) return (colopts & COL_ENABLE_MASK) == COL_ENABLED; } +struct string_list; extern void print_columns(const struct string_list *list, unsigned int colopts, const struct column_options *opts); diff --git a/commit-graph.h b/commit-graph.h index 76e0989..eea62f8 100644 --- a/commit-graph.h +++ b/commit-graph.h @@ -4,6 +4,7 @@ #include "git-compat-util.h" #include "repository.h" #include "string-list.h" +#include "cache.h" struct commit; diff --git a/config.h b/config.h index bb2f506..75ba1d4 100644 --- a/config.h +++ b/config.h @@ -1,6 +1,11 @@ #ifndef CONFIG_H #define CONFIG_H +#include "hashmap.h" +#include "string-list.h" + +struct object_id; + /* git_config_parse_key() returns these negated: */ #define CONFIG_INVALID_KEY 1 #define CONFIG_NO_SECTION_OR_NAME 2 diff --git a/connected.h b/connected.h index 322dc76..e4c9618 100644 --- a/connected.h +++ b/connected.h @@ -1,6 +1,7 @@ #ifndef CONNECTED_H #define CONNECTED_H +struct object_id; struct transport; /* diff --git a/convert.h b/convert.h index 01385d9..76c6543 100644 --- a/convert.h +++ b/convert.h @@ -7,6 +7,8 @@ #include "string-list.h" struct index_state; +struct object_id; +struct strbuf; #define CONV_EOL_RNDTRP_DIE (1<<0) /* Die if CRLF to LF to CRLF is different */ #define CONV_EOL_RNDTRP_WARN (1<<1) /* Warn if CRLF to LF to CRLF is different */ diff --git a/csum-file.h b/csum-file.h index c5a2e33..3bf7184 100644 --- a/csum-file.h +++ b/csum-file.h @@ -1,6 +1,8 @@ #ifndef CSUM_FILE_H #define CSUM_FILE_H +#include "hash.h" + struct progress; /* A SHA1-protected file */ diff --git a/diffcore.h b/diffcore.h index a30da16..0dd1e9a 100644 --- a/diffcore.h +++ b/diffcore.h @@ -4,6 +4,10 @@ #ifndef DIFFCORE_H #define DIFFCORE_H +#include "cache.h" + +struct diff_options; + /* This header file is internal between diff.c and its diff transformers * (e.g. diffcore-rename, diffcore-pickaxe). Never include this header * in anything else. diff --git a/dir-iterator.h b/dir-iterator.h index 27739e6..970793d 100644 --- a/dir-iterator.h +++ b/dir-iterator.h @@ -1,6 +1,8 @@ #ifndef DIR_ITERATOR_H #define DIR_ITERATOR_H +#include "strbuf.h" + /* * Iterate over a directory tree. * diff --git a/fsck.h b/fsck.h index c3cf5e0..0c7e8c9 100644 --- a/fsck.h +++ b/fsck.h @@ -6,6 +6,7 @@ #define FSCK_IGNORE 3 struct fsck_options; +struct object; void fsck_set_msg_type(struct fsck_options *options, const char *msg_id, const char *msg_type); diff --git a/fsmonitor.h b/fsmonitor.h index 65f3743..01017c4 100644 --- a/fsmonitor.h +++ b/fsmonitor.h @@ -1,6 +1,9 @@ #ifndef FSMONITOR_H #define FSMONITOR_H +#include "cache.h" +#include "dir.h" + extern struct trace_key trace_fsmonitor; /* diff --git a/gpg-interface.h b/gpg-interface.h index 5ecff4a..acf50c4 100644 --- a/gpg-interface.h +++ b/gpg-interface.h @@ -1,6 +1,8 @@ #ifndef GPG_INTERFACE_H #define GPG_INTERFACE_H +struct strbuf; + #define GPG_VERIFY_VERBOSE 1 #define GPG_VERIFY_RAW 2 #define GPG_VERIFY_OMIT_STATUS 4 diff --git a/khash.h b/khash.h index c0da40d..07b4cc2 100644 --- a/khash.h +++ b/khash.h @@ -26,6 +26,9 @@ #ifndef __AC_KHASH_H #define __AC_KHASH_H +#include "cache.h" +#include "hashmap.h" + #define AC_VERSION_KHASH_H "0.2.8" typedef uint32_t khint32_t; diff --git a/list-objects-filter.h b/list-objects-filter.h index a963d02..a6f6b49 100644 --- a/list-objects-filter.h +++ b/list-objects-filter.h @@ -1,6 +1,10 @@ #ifndef LIST_OBJECTS_FILTER_H #define LIST_OBJECTS_FILTER_H +struct list_objects_filter_options; +struct object; +struct oidset; + /* * During list-object traversal we allow certain objects to be * filtered (omitted) from the result. The active filter uses diff --git a/list-objects.h b/list-objects.h index aa618d7..ad40762 100644 --- a/list-objects.h +++ b/list-objects.h @@ -1,6 +1,10 @@ #ifndef LIST_OBJECTS_H #define LIST_OBJECTS_H +struct commit; +struct object; +struct rev_info; + typedef void (*show_commit_fn)(struct commit *, void *); typedef void (*show_object_fn)(struct object *, const char *, void *); void traverse_commit_list(struct rev_info *, show_commit_fn, show_object_fn, void *); diff --git a/ll-merge.h b/ll-merge.h index 244a31f..b72b199 100644 --- a/ll-merge.h +++ b/ll-merge.h @@ -5,6 +5,8 @@ #ifndef LL_MERGE_H #define LL_MERGE_H +#include "xdiff/xdiff.h" + struct ll_merge_options { unsigned virtual_ancestor : 1; unsigned variant : 2; /* favor ours, favor theirs, or union merge */ diff --git a/mailinfo.h b/mailinfo.h index 04a2535..766c03d 100644 --- a/mailinfo.h +++ b/mailinfo.h @@ -1,6 +1,8 @@ #ifndef MAILINFO_H #define MAILINFO_H +#include "strbuf.h" + #define MAX_BOUNDARIES 5 struct mailinfo { diff --git a/mailmap.h b/mailmap.h index ed7c93b..d0e6564 100644 --- a/mailmap.h +++ b/mailmap.h @@ -1,6 +1,8 @@ #ifndef MAILMAP_H #define MAILMAP_H +struct string_list; + int read_mailmap(struct string_list *map, char **repo_abbrev); void clear_mailmap(struct string_list *map); diff --git a/merge-recursive.h b/merge-recursive.h index fa7bc6b..0c46a5a 100644 --- a/merge-recursive.h +++ b/merge-recursive.h @@ -1,8 +1,10 @@ #ifndef MERGE_RECURSIVE_H #define MERGE_RECURSIVE_H -#include "unpack-trees.h" #include "string-list.h" +#include "unpack-trees.h" + +struct commit; struct merge_options { const char *ancestor; diff --git a/notes-merge.h b/notes-merge.h index f815f23..6c74e93 100644 --- a/notes-merge.h +++ b/notes-merge.h @@ -2,6 +2,10 @@ #define NOTES_MERGE_H #include "notes-utils.h" +#include "strbuf.h" + +struct commit; +struct object_id; #define NOTES_MERGE_WORKTREE "NOTES_MERGE_WORKTREE" diff --git a/notes-utils.h b/notes-utils.h index 5d79cbe..5408306 100644 --- a/notes-utils.h +++ b/notes-utils.h @@ -3,6 +3,9 @@ #include "notes.h" +struct commit_list; +struct object_id; + /* * Create new notes commit from the given notes tree * diff --git a/notes.h b/notes.h index 0433f45..414bc68 100644 --- a/notes.h +++ b/notes.h @@ -3,6 +3,9 @@ #include "string-list.h" +struct object_id; +struct strbuf; + /* * Function type for combining two notes annotating the same object. * diff --git a/object-store.h b/object-store.h index e481f7a..b6f2c73 100644 --- a/object-store.h +++ b/object-store.h @@ -1,6 +1,7 @@ #ifndef OBJECT_STORE_H #define OBJECT_STORE_H +#include "cache.h" #include "oidmap.h" #include "list.h" #include "sha1-array.h" diff --git a/object.h b/object.h index 177b1a4..6e28fdd 100644 --- a/object.h +++ b/object.h @@ -1,6 +1,8 @@ #ifndef OBJECT_H #define OBJECT_H +#include "cache.h" + struct buffer_slab; struct parsed_object_pool { diff --git a/oidmap.h b/oidmap.h index d3cd2bb..72430b6 100644 --- a/oidmap.h +++ b/oidmap.h @@ -1,6 +1,7 @@ #ifndef OIDMAP_H #define OIDMAP_H +#include "cache.h" #include "hashmap.h" /* diff --git a/pack-bitmap.h b/pack-bitmap.h index 4555907..8a04741 100644 --- a/pack-bitmap.h +++ b/pack-bitmap.h @@ -5,6 +5,9 @@ #include "khash.h" #include "pack-objects.h" +struct commit; +struct rev_info; + struct bitmap_disk_header { char magic[4]; uint16_t version; diff --git a/pack-objects.h b/pack-objects.h index edf74da..08c6b57 100644 --- a/pack-objects.h +++ b/pack-objects.h @@ -2,6 +2,7 @@ #define PACK_OBJECTS_H #include "object-store.h" +#include "pack.h" #define DEFAULT_DELTA_CACHE_SIZE (256 * 1024 * 1024) diff --git a/patch-ids.h b/patch-ids.h index bec0f72..79ac9a8 100644 --- a/patch-ids.h +++ b/patch-ids.h @@ -1,6 +1,12 @@ #ifndef PATCH_IDS_H #define PATCH_IDS_H +#include "diff.h" +#include "hashmap.h" + +struct commit; +struct object_id; + struct patch_id { struct hashmap_entry ent; struct object_id patch_id; diff --git a/path.h b/path.h index ed6732e..b654ea8 100644 --- a/path.h +++ b/path.h @@ -2,6 +2,7 @@ #define PATH_H struct repository; +struct strbuf; /* * The result to all functions which return statically allocated memory may be diff --git a/pathspec.h b/pathspec.h index 099a170..a6525a6 100644 --- a/pathspec.h +++ b/pathspec.h @@ -1,6 +1,8 @@ #ifndef PATHSPEC_H #define PATHSPEC_H +struct index_state; + /* Pathspec magic */ #define PATHSPEC_FROMTOP (1<<0) #define PATHSPEC_MAXDEPTH (1<<1) diff --git a/pretty.h b/pretty.h index 5c85d94..7359d31 100644 --- a/pretty.h +++ b/pretty.h @@ -1,7 +1,11 @@ #ifndef PRETTY_H #define PRETTY_H +#include "cache.h" +#include "string-list.h" + struct commit; +struct strbuf; /* Commit formats */ enum cmit_fmt { diff --git a/reachable.h b/reachable.h index 3c00fa0..18b0f9f 100644 --- a/reachable.h +++ b/reachable.h @@ -2,6 +2,8 @@ #define REACHEABLE_H struct progress; +struct rev_info; + extern int add_unseen_recent_objects_to_traversal(struct rev_info *revs, timestamp_t timestamp); extern void mark_reachable_objects(struct rev_info *revs, int mark_reflog, diff --git a/reflog-walk.h b/reflog-walk.h index 7553c44..cb3e737 100644 --- a/reflog-walk.h +++ b/reflog-walk.h @@ -3,6 +3,7 @@ #include "cache.h" +struct commit; struct reflog_walk_info; extern void init_reflog_walk(struct reflog_walk_info **info); diff --git a/refs.h b/refs.h index cc2fb4c..bd52c1b 100644 --- a/refs.h +++ b/refs.h @@ -3,8 +3,10 @@ struct object_id; struct ref_store; +struct repository; struct strbuf; struct string_list; +struct string_list_item; struct worktree; /* diff --git a/remote.h b/remote.h index 9762921..88f8480 100644 --- a/remote.h +++ b/remote.h @@ -1,6 +1,7 @@ #ifndef REMOTE_H #define REMOTE_H +#include "cache.h" #include "parse-options.h" #include "hashmap.h" #include "refspec.h" diff --git a/repository.h b/repository.h index b9413be..13c8799 100644 --- a/repository.h +++ b/repository.h @@ -1,6 +1,8 @@ #ifndef REPOSITORY_H #define REPOSITORY_H +#include "path.h" + struct config_set; struct git_hash_algo; struct index_state; diff --git a/resolve-undo.h b/resolve-undo.h index 8729190..fbe348e 100644 --- a/resolve-undo.h +++ b/resolve-undo.h @@ -1,6 +1,8 @@ #ifndef RESOLVE_UNDO_H #define RESOLVE_UNDO_H +#include "cache.h" + struct resolve_undo_info { unsigned int mode[3]; struct object_id oid[3]; diff --git a/revision.h b/revision.h index c599c34..850e508 100644 --- a/revision.h +++ b/revision.h @@ -1,6 +1,7 @@ #ifndef REVISION_H #define REVISION_H +#include "commit.h" #include "parse-options.h" #include "grep.h" #include "notes.h" diff --git a/send-pack.h b/send-pack.h index 6af71f7..e148fcd 100644 --- a/send-pack.h +++ b/send-pack.h @@ -3,6 +3,10 @@ #include "string-list.h" +struct child_process; +struct oid_array; +struct ref; + /* Possible values for push_cert field in send_pack_args. */ #define SEND_PACK_PUSH_CERT_NEVER 0 #define SEND_PACK_PUSH_CERT_IF_ASKED 1 diff --git a/sequencer.h b/sequencer.h index c5787c6..c751c9d 100644 --- a/sequencer.h +++ b/sequencer.h @@ -1,6 +1,11 @@ #ifndef SEQUENCER_H #define SEQUENCER_H +#include "cache.h" +#include "strbuf.h" + +struct commit; + const char *git_path_commit_editmsg(void); const char *git_path_seq_dir(void); diff --git a/shortlog.h b/shortlog.h index 5d64cfe..2fa61c4 100644 --- a/shortlog.h +++ b/shortlog.h @@ -3,6 +3,8 @@ #include "string-list.h" +struct commit; + struct shortlog { struct string_list list; int summary; diff --git a/submodule.h b/submodule.h index 4644683..3adbc08 100644 --- a/submodule.h +++ b/submodule.h @@ -1,11 +1,17 @@ #ifndef SUBMODULE_H #define SUBMODULE_H -struct repository; -struct diff_options; struct argv_array; +struct cache_entry; +struct diff_options; +struct index_state; +struct object_id; struct oid_array; +struct pathspec; struct remote; +struct repository; +struct string_list; +struct strbuf; enum { RECURSE_SUBMODULES_ONLY = -5, diff --git a/tempfile.h b/tempfile.h index 8959c5f..36434eb 100644 --- a/tempfile.h +++ b/tempfile.h @@ -2,6 +2,7 @@ #define TEMPFILE_H #include "list.h" +#include "strbuf.h" /* * Handle temporary files. diff --git a/trailer.h b/trailer.h index 6d7f8c2..9c10026 100644 --- a/trailer.h +++ b/trailer.h @@ -3,6 +3,8 @@ #include "list.h" +struct strbuf; + enum trailer_where { WHERE_DEFAULT, WHERE_END, diff --git a/tree-walk.h b/tree-walk.h index 805f58f..1968310 100644 --- a/tree-walk.h +++ b/tree-walk.h @@ -1,6 +1,8 @@ #ifndef TREE_WALK_H #define TREE_WALK_H +struct strbuf; + struct name_entry { const struct object_id *oid; const char *path; diff --git a/unpack-trees.h b/unpack-trees.h index c2b434c..48bc69c 100644 --- a/unpack-trees.h +++ b/unpack-trees.h @@ -1,11 +1,14 @@ #ifndef UNPACK_TREES_H #define UNPACK_TREES_H -#include "tree-walk.h" +#include "cache.h" #include "argv-array.h" +#include "string-list.h" +#include "tree-walk.h" #define MAX_UNPACK_TREES 8 +struct cache_entry; struct unpack_trees_options; struct exclude_list; diff --git a/url.h b/url.h index abdaf6f..f311c40 100644 --- a/url.h +++ b/url.h @@ -1,6 +1,8 @@ #ifndef URL_H #define URL_H +struct strbuf; + extern int is_url(const char *url); extern int is_urlschemechar(int first_flag, int ch); extern char *url_decode(const char *url); diff --git a/utf8.h b/utf8.h index db73a2d..dd5ee10 100644 --- a/utf8.h +++ b/utf8.h @@ -1,6 +1,8 @@ #ifndef GIT_UTF8_H #define GIT_UTF8_H +struct strbuf; + typedef unsigned int ucs_char_t; /* assuming 32bit int */ size_t display_mode_esc_sequence_len(const char *s); diff --git a/worktree.h b/worktree.h index fe38ce1..df3fc30 100644 --- a/worktree.h +++ b/worktree.h @@ -1,6 +1,7 @@ #ifndef WORKTREE_H #define WORKTREE_H +#include "cache.h" #include "refs.h" struct strbuf; -- cgit v0.10.2-6-g49f6 From 17313107454de99c0ebdf1a981b1f6a2b17dc2f5 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 15 Aug 2018 10:54:06 -0700 Subject: alloc: make allocate_alloc_state and clear_alloc_state more consistent Since both functions are using the same data type, they should either both refer to it as void *, or both use the real type (struct alloc_state *). Opt for the latter. Reviewed-by: Jonathan Nieder Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano diff --git a/alloc.c b/alloc.c index c2fc5d6..e7aa81b 100644 --- a/alloc.c +++ b/alloc.c @@ -36,7 +36,7 @@ struct alloc_state { int slab_nr, slab_alloc; }; -void *allocate_alloc_state(void) +struct alloc_state *allocate_alloc_state(void) { return xcalloc(1, sizeof(struct alloc_state)); } diff --git a/alloc.h b/alloc.h index 7a41bb9..ba356ed 100644 --- a/alloc.h +++ b/alloc.h @@ -15,7 +15,7 @@ void *alloc_object_node(struct repository *r); void alloc_report(struct repository *r); unsigned int alloc_commit_index(struct repository *r); -void *allocate_alloc_state(void); +struct alloc_state *allocate_alloc_state(void); void clear_alloc_state(struct alloc_state *s); #endif -- cgit v0.10.2-6-g49f6 From e730b81df6bff6f78ecd705a1f8e5df48cac75ca Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 15 Aug 2018 10:54:07 -0700 Subject: Move definition of enum branch_track from cache.h to branch.h 'branch_track' feels more closely related to branching, and it is needed later in branch.h; rather than #include'ing cache.h in branch.h for this small enum, just move the enum and the external declaration for git_branch_track to branch.h. Reviewed-by: Jonathan Nieder Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano diff --git a/branch.h b/branch.h index 7d9b330..5cace45 100644 --- a/branch.h +++ b/branch.h @@ -3,6 +3,17 @@ struct strbuf; +enum branch_track { + BRANCH_TRACK_UNSPECIFIED = -1, + BRANCH_TRACK_NEVER = 0, + BRANCH_TRACK_REMOTE, + BRANCH_TRACK_ALWAYS, + BRANCH_TRACK_EXPLICIT, + BRANCH_TRACK_OVERRIDE +}; + +extern enum branch_track git_branch_track; + /* Functions for acting on the information about branches. */ /* diff --git a/cache.h b/cache.h index 8dc7134..a1c0c59 100644 --- a/cache.h +++ b/cache.h @@ -919,15 +919,6 @@ enum log_refs_config { }; extern enum log_refs_config log_all_ref_updates; -enum branch_track { - BRANCH_TRACK_UNSPECIFIED = -1, - BRANCH_TRACK_NEVER = 0, - BRANCH_TRACK_REMOTE, - BRANCH_TRACK_ALWAYS, - BRANCH_TRACK_EXPLICIT, - BRANCH_TRACK_OVERRIDE -}; - enum rebase_setup_type { AUTOREBASE_NEVER = 0, AUTOREBASE_LOCAL, @@ -944,7 +935,6 @@ enum push_default_type { PUSH_DEFAULT_UNSPECIFIED }; -extern enum branch_track git_branch_track; extern enum rebase_setup_type autorebase; extern enum push_default_type push_default; diff --git a/config.c b/config.c index 6664504..66dca79 100644 --- a/config.c +++ b/config.c @@ -6,6 +6,7 @@ * */ #include "cache.h" +#include "branch.h" #include "config.h" #include "repository.h" #include "lockfile.h" diff --git a/environment.c b/environment.c index 6cf0079..0c04a6d 100644 --- a/environment.c +++ b/environment.c @@ -8,6 +8,7 @@ * are. */ #include "cache.h" +#include "branch.h" #include "repository.h" #include "config.h" #include "refs.h" -- cgit v0.10.2-6-g49f6 From 64e68a3b326fe766b190152968572f972d25510c Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 15 Aug 2018 10:54:08 -0700 Subject: urlmatch.h: fix include guard Reviewed-by: Jonathan Nieder Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano diff --git a/urlmatch.h b/urlmatch.h index 37ee5da..e482148 100644 --- a/urlmatch.h +++ b/urlmatch.h @@ -1,4 +1,6 @@ #ifndef URL_MATCH_H +#define URL_MATCH_H + #include "string-list.h" struct url_info { -- cgit v0.10.2-6-g49f6 From f790d8125279e44d7611f17466b0248fbdea8ed1 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 15 Aug 2018 10:54:09 -0700 Subject: compat/precompose_utf8.h: use more common include guard style Reviewed-by: Jonathan Nieder Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano diff --git a/compat/precompose_utf8.h b/compat/precompose_utf8.h index a94e7c4..6f843d3 100644 --- a/compat/precompose_utf8.h +++ b/compat/precompose_utf8.h @@ -1,4 +1,6 @@ #ifndef PRECOMPOSE_UNICODE_H +#define PRECOMPOSE_UNICODE_H + #include #include #include @@ -41,5 +43,4 @@ int precompose_utf8_closedir(PREC_DIR *dirp); #define DIR PREC_DIR #endif /* PRECOMPOSE_UNICODE_C */ -#define PRECOMPOSE_UNICODE_H #endif /* PRECOMPOSE_UNICODE_H */ -- cgit v0.10.2-6-g49f6 From 1076f1e454dae338cee8e48f3e69b58181e5e10a Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 15 Aug 2018 10:54:10 -0700 Subject: Remove forward declaration of an enum According to http://c-faq.com/null/machexamp.html, sizeof(char*) != sizeof(int*) on some platforms. Since an enum could be a char or int (or long or...), knowing the size of the enum thus is important to knowing the size of a pointer to an enum, so we cannot just forward declare an enum the way we can a struct. (Also, modern C++ compilers apparently define forward declarations of an enum to either be useless because the enum was defined, or require an explicit size specifier, or be a compilation error.) Helped-by: Jonathan Nieder Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano diff --git a/packfile.h b/packfile.h index cc7eaff..fa36c47 100644 --- a/packfile.h +++ b/packfile.h @@ -1,12 +1,12 @@ #ifndef PACKFILE_H #define PACKFILE_H +#include "cache.h" #include "oidset.h" /* in object-store.h */ struct packed_git; struct object_info; -enum object_type; /* * Generate the filename to be used for a pack file with checksum "sha1" and -- cgit v0.10.2-6-g49f6