From 554544276a604c144df45efcb060c80aa322088c Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Mon, 29 Apr 2019 04:28:14 -0400 Subject: *.[ch]: remove extern from function declarations using spatch There has been a push to remove extern from function declarations. Remove some instances of "extern" for function declarations which are caught by Coccinelle. Note that Coccinelle has some difficulty with processing functions with `__attribute__` or varargs so some `extern` declarations are left behind to be dealt with in a future patch. This was the Coccinelle patch used: @@ type T; identifier f; @@ - extern T f(...); and it was run with: $ git ls-files \*.{c,h} | grep -v ^compat/ | xargs spatch --sp-file contrib/coccinelle/noextern.cocci --in-place Files under `compat/` are intentionally excluded as some are directly copied from external sources and we should avoid churning them as much as possible. Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- pack.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'pack.h') diff --git a/pack.h b/pack.h index da99fdd1d2..de941858c5 100644 --- a/pack.h +++ b/pack.h @@ -55,7 +55,7 @@ struct pack_idx_option { uint32_t *anomaly; }; -extern void reset_pack_idx_option(struct pack_idx_option *); +void reset_pack_idx_option(struct pack_idx_option *); /* * Packed object index header @@ -79,28 +79,28 @@ struct progress; /* Note, the data argument could be NULL if object type is blob */ typedef int (*verify_fn)(const struct object_id *, enum object_type, unsigned long, void*, int*); -extern const char *write_idx_file(const char *index_name, struct pack_idx_entry **objects, int nr_objects, const struct pack_idx_option *, const unsigned char *sha1); -extern int check_pack_crc(struct packed_git *p, struct pack_window **w_curs, off_t offset, off_t len, unsigned int nr); -extern int verify_pack_index(struct packed_git *); -extern int verify_pack(struct repository *, struct packed_git *, verify_fn fn, struct progress *, uint32_t); -extern off_t write_pack_header(struct hashfile *f, uint32_t); -extern void fixup_pack_header_footer(int, unsigned char *, const char *, uint32_t, unsigned char *, off_t); -extern char *index_pack_lockfile(int fd); +const char *write_idx_file(const char *index_name, struct pack_idx_entry **objects, int nr_objects, const struct pack_idx_option *, const unsigned char *sha1); +int check_pack_crc(struct packed_git *p, struct pack_window **w_curs, off_t offset, off_t len, unsigned int nr); +int verify_pack_index(struct packed_git *); +int verify_pack(struct repository *, struct packed_git *, verify_fn fn, struct progress *, uint32_t); +off_t write_pack_header(struct hashfile *f, uint32_t); +void fixup_pack_header_footer(int, unsigned char *, const char *, uint32_t, unsigned char *, off_t); +char *index_pack_lockfile(int fd); /* * The "hdr" output buffer should be at least this big, which will handle sizes * up to 2^67. */ #define MAX_PACK_OBJECT_HEADER 10 -extern int encode_in_pack_object_header(unsigned char *hdr, int hdr_len, +int encode_in_pack_object_header(unsigned char *hdr, int hdr_len, enum object_type, uintmax_t); #define PH_ERROR_EOF (-1) #define PH_ERROR_PACK_SIGNATURE (-2) #define PH_ERROR_PROTOCOL (-3) -extern int read_pack_header(int fd, struct pack_header *); +int read_pack_header(int fd, struct pack_header *); -extern struct hashfile *create_tmp_packfile(char **pack_tmp_name); -extern void finish_tmp_packfile(struct strbuf *name_buffer, const char *pack_tmp_name, struct pack_idx_entry **written_list, uint32_t nr_written, struct pack_idx_option *pack_idx_opts, unsigned char sha1[]); +struct hashfile *create_tmp_packfile(char **pack_tmp_name); +void finish_tmp_packfile(struct strbuf *name_buffer, const char *pack_tmp_name, struct pack_idx_entry **written_list, uint32_t nr_written, struct pack_idx_option *pack_idx_opts, unsigned char sha1[]); #endif -- cgit v1.2.3 From ad6dad0996f9226b2c3a5a3c725bf2952e52d7e7 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Mon, 29 Apr 2019 04:28:23 -0400 Subject: *.[ch]: manually align parameter lists In previous patches, extern was mechanically removed from function declarations without care to formatting, causing parameter lists to be misaligned. Manually format changed sections such that the parameter lists should be realigned. Viewing this patch with 'git diff -w' should produce no output. Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- pack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pack.h') diff --git a/pack.h b/pack.h index de941858c5..9fc0945ac9 100644 --- a/pack.h +++ b/pack.h @@ -93,7 +93,7 @@ char *index_pack_lockfile(int fd); */ #define MAX_PACK_OBJECT_HEADER 10 int encode_in_pack_object_header(unsigned char *hdr, int hdr_len, - enum object_type, uintmax_t); + enum object_type, uintmax_t); #define PH_ERROR_EOF (-1) #define PH_ERROR_PACK_SIGNATURE (-2) -- cgit v1.2.3