Skip to content

Commit 5ade034

Browse files
committed
Merge branch 'en/incl-forward-decl'
Code hygiene improvement for the header files. * en/incl-forward-decl: Remove forward declaration of an enum compat/precompose_utf8.h: use more common include guard style urlmatch.h: fix include guard Move definition of enum branch_track from cache.h to branch.h alloc: make allocate_alloc_state and clear_alloc_state more consistent Add missing includes and forward declarations
2 parents 36f0f34 + 1076f1e commit 5ade034

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+151
-17
lines changed

alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct alloc_state {
3636
int slab_nr, slab_alloc;
3737
};
3838

39-
void *allocate_alloc_state(void)
39+
struct alloc_state *allocate_alloc_state(void)
4040
{
4141
return xcalloc(1, sizeof(struct alloc_state));
4242
}

alloc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#ifndef ALLOC_H
22
#define ALLOC_H
33

4+
struct alloc_state;
45
struct tree;
56
struct commit;
67
struct tag;
8+
struct repository;
79

810
void *alloc_blob_node(struct repository *r);
911
void *alloc_tree_node(struct repository *r);
@@ -13,7 +15,7 @@ void *alloc_object_node(struct repository *r);
1315
void alloc_report(struct repository *r);
1416
unsigned int alloc_commit_index(struct repository *r);
1517

16-
void *allocate_alloc_state(void);
18+
struct alloc_state *allocate_alloc_state(void);
1719
void clear_alloc_state(struct alloc_state *s);
1820

1921
#endif

apply.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#ifndef APPLY_H
22
#define APPLY_H
33

4+
#include "lockfile.h"
5+
#include "string-list.h"
6+
47
struct repository;
58

69
enum apply_ws_error_action {

archive.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef ARCHIVE_H
22
#define ARCHIVE_H
33

4+
#include "cache.h"
45
#include "pathspec.h"
56

67
struct repository;

attr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ struct git_attr;
99
/* opaque structures used internally for attribute collection */
1010
struct all_attrs_item;
1111
struct attr_stack;
12+
struct index_state;
1213

1314
/*
1415
* Given a string, return the gitattribute object that

bisect.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef BISECT_H
22
#define BISECT_H
33

4+
struct commit_list;
5+
46
/*
57
* Find bisection. If something is found, `reaches` will be the number of
68
* commits that the best commit reaches. `all` will be the count of

branch.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
#ifndef BRANCH_H
22
#define BRANCH_H
33

4+
struct strbuf;
5+
6+
enum branch_track {
7+
BRANCH_TRACK_UNSPECIFIED = -1,
8+
BRANCH_TRACK_NEVER = 0,
9+
BRANCH_TRACK_REMOTE,
10+
BRANCH_TRACK_ALWAYS,
11+
BRANCH_TRACK_EXPLICIT,
12+
BRANCH_TRACK_OVERRIDE
13+
};
14+
15+
extern enum branch_track git_branch_track;
16+
417
/* Functions for acting on the information about branches. */
518

619
/*

bulk-checkin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#ifndef BULK_CHECKIN_H
55
#define BULK_CHECKIN_H
66

7+
#include "cache.h"
8+
79
extern int index_bulk_checkin(struct object_id *oid,
810
int fd, size_t size, enum object_type type,
911
const char *path, unsigned flags);

cache.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -917,15 +917,6 @@ enum log_refs_config {
917917
};
918918
extern enum log_refs_config log_all_ref_updates;
919919

920-
enum branch_track {
921-
BRANCH_TRACK_UNSPECIFIED = -1,
922-
BRANCH_TRACK_NEVER = 0,
923-
BRANCH_TRACK_REMOTE,
924-
BRANCH_TRACK_ALWAYS,
925-
BRANCH_TRACK_EXPLICIT,
926-
BRANCH_TRACK_OVERRIDE
927-
};
928-
929920
enum rebase_setup_type {
930921
AUTOREBASE_NEVER = 0,
931922
AUTOREBASE_LOCAL,
@@ -942,7 +933,6 @@ enum push_default_type {
942933
PUSH_DEFAULT_UNSPECIFIED
943934
};
944935

945-
extern enum branch_track git_branch_track;
946936
extern enum rebase_setup_type autorebase;
947937
extern enum push_default_type push_default;
948938

column.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static inline int column_active(unsigned int colopts)
3636
return (colopts & COL_ENABLE_MASK) == COL_ENABLED;
3737
}
3838

39+
struct string_list;
3940
extern void print_columns(const struct string_list *list, unsigned int colopts,
4041
const struct column_options *opts);
4142

0 commit comments

Comments
 (0)