diff options
author | Denton Liu <liu.denton@gmail.com> | 2019-04-29 11:28:14 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-05 09:20:06 +0300 |
commit | 554544276a604c144df45efcb060c80aa322088c (patch) | |
tree | ce55b3dc9ca47c326991ecfc06a2b1103f60be3a /pack.h | |
parent | ffac537e6cbbf934b08745a378932722df287a53 (diff) |
*.[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 <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack.h')
-rw-r--r-- | pack.h | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -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 |