*.h: remove extern from function declarations
PATCH v4 3/4 *.[ch]: manually align parameter lists
In reply to Denton LiuIn 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.
--- archive.h | 10 ++++---- bisect.h | 14 +++++------ branch.h | 2 +- builtin.h | 2 +- bulk-checkin.h | 4 +-- cache.h | 42 +++++++++++++++---------------- checkout.h | 4 +-- column.h | 4 +-- commit.h | 44 ++++++++++++++++---------------- config.h | 44 ++++++++++++++++---------------- connect.h | 2 +- delta.h | 4 +-- dir.h | 62 +++++++++++++++++++++++----------------------- git-compat-util.h | 4 +-- help.h | 6 ++--- http.h | 10 ++++---- khash.h | 6 ++--- lockfile.h | 2 +- ls-refs.h | 2 +- merge-blobs.h | 4 +-- object-store.h | 16 ++++++------ oidmap.h | 2 +- pack.h | 2 +- packfile.h | 8 +++--- path.h | 10 ++++---- pkt-line.h | 4 +-- ppc/sha1.c | 2 +- quote.h | 2 +- reachable.h | 4 +-- reflog-walk.h | 12 ++++----- remote.h | 12 ++++----- replace-object.h | 2 +- serve.h | 2 +- sha1-lookup.h | 6 ++--- string-list.h | 2 +- sub-process.h | 6 ++--- submodule-config.h | 2 +- tag.h | 2 +- tempfile.h | 4 +-- trace.h | 10 ++++---- upload-pack.h | 4 +-- vcs-svn/svndiff.h | 2 +- worktree.h | 14 +++++------ xdiff-interface.h | 2 +- 44 files changed, 202 insertions(+), 202 deletions(-)
archive.h +5 -5
@@ -24,8 +24,8 @@ struct archiver_args {/* main api */ int write_archive (int argc,const char **argv,const char *prefix, -struct repository *repo, -const char *name_hint,int remote); +struct repository *repo, +const char *name_hint,int remote);const char *archive_format_from_filename (const char *filename);
@@ -52,8 +52,8 @@ typedef int (*write_archive_entry_fn_t)(struct archiver_args *args,int write_archive_entries (struct archiver_args *args,write_archive_entry_fn_t write_entry);void *object_file_to_archive (const struct archiver_args *args, -const char *path,const struct object_id *oid, -unsigned int mode,enum object_type *type, -unsigned long *sizep); +const char *path,const struct object_id *oid, +unsigned int mode,enum object_type *type, +unsigned long *sizep);#endif /* ARCHIVE_H */
bisect.h +7 -7
@@ -12,13 +12,13 @@ struct repository;* best commit, as chosen by `find_all`. */ void find_bisection (struct commit_list **list,int *reaches,int *all, -int find_all); +int find_all);struct commit_list *filter_skipped (struct commit_list *list, -struct commit_list **tried, -int show_all, -int *count, -int *skipped_first); +struct commit_list **tried, +int show_all, +int *count, +int *skipped_first);#define BISECT_SHOW_ALL (1<<0)#define REV_LIST_QUIET (1<<1)
@@ -32,8 +32,8 @@ struct rev_list_info { };int bisect_next_all (struct repository *r, -const char *prefix, -int no_checkout); +const char *prefix, +int no_checkout);int estimate_bisect_steps (int all);
branch.h +1 -1
@@ -92,6 +92,6 @@ void die_if_checked_out(const char *branch, int ignore_current_worktree);* otherwise. */ int replace_each_worktree_head_symref (const char *oldref,const char *newref, -const char *logmsg); +const char *logmsg);#endif
builtin.h +1 -1
@@ -111,7 +111,7 @@ struct fmt_merge_msg_opts { };int fmt_merge_msg (struct strbuf *in,struct strbuf *out, -struct fmt_merge_msg_opts *); +struct fmt_merge_msg_opts *);/** * If a built-in has DELAY_PAGER_CONFIG set, the built-in should call this early
bulk-checkin.h +2 -2
@@ -7,8 +7,8 @@#include "cache.h" int index_bulk_checkin (struct object_id *oid, -int fd,size_t size,enum object_type type, -const char *path,unsigned flags); +int fd,size_t size,enum object_type type, +const char *path,unsigned flags);void plug_bulk_checkin (void );void unplug_bulk_checkin (void );
cache.h +21 -21
112 lines not on this page · raw message
checkout.h +2 -2
@@ -9,7 +9,7 @@* exists, NULL otherwise. */ const char *unique_tracking_name (const char *name, -struct object_id *oid, -int *dwim_remotes_matched); +struct object_id *oid, +int *dwim_remotes_matched);#endif /* CHECKOUT_H */
column.h +2 -2
@@ -29,7 +29,7 @@ struct column_options {struct option ;int parseopt_column_callback (const struct option *,const char *,int );int git_column_config (const char *var,const char *value, -const char *command,unsigned int *colopts); +const char *command,unsigned int *colopts);int finalize_colopts (unsigned int *colopts,int stdout_is_tty);static inline int column_active (unsigned int colopts) {
@@ -38,7 +38,7 @@ static inline int column_active(unsigned int colopts)struct string_list ;void print_columns (const struct string_list *list,unsigned int colopts, -const struct column_options *opts); +const struct column_options *opts);int run_column_filter (int colopts,const struct column_options *);int stop_column_filter (void );
commit.h +22 -22
106 lines not on this page · raw message
config.h +22 -22
78 lines not on this page · raw message
connect.h +1 -1
@@ -20,6 +20,6 @@ enum protocol_version discover_version(struct packet_reader *reader);int server_supports_v2 (const char *c,int die_on_error);int server_supports_feature (const char *c,const char *feature, -int die_on_error); +int die_on_error);#endif
delta.h +2 -2
@@ -76,8 +76,8 @@ diff_delta(const void *src_buf, unsigned long src_bufsize,* returned. The returned buffer must be freed by the caller. */ void *patch_delta (const void *src_buf,unsigned long src_size, -const void *delta_buf,unsigned long delta_size, -unsigned long *dst_size); +const void *delta_buf,unsigned long delta_size, +unsigned long *dst_size);/* the smallest possible delta size is 4 bytes */ #define DELTA_SIZE_MIN 4
dir.h +31 -31
106 lines not on this page · raw message
git-compat-util.h +2 -2
@@ -770,13 +770,13 @@ FILE *git_fopen(const char*, const char*);#endif #define snprintf git_snprintfint git_snprintf (char *str,size_t maxsize, -const char *format, ...); +const char *format, ...);#ifdef vsnprintf#undef vsnprintf#endif #define vsnprintf git_vsnprintfint git_vsnprintf (char *str,size_t maxsize, -const char *format,va_list ap); +const char *format,va_list ap);#endif #ifdef __GLIBC_PREREQ
help.h +3 -3
@@ -27,12 +27,12 @@ void list_config_help(int for_human);void list_all_main_cmds (struct string_list *list);void list_all_other_cmds (struct string_list *list);void list_cmds_by_category (struct string_list *list, -const char *category); +const char *category);void list_cmds_by_config (struct string_list *list);const char *help_unknown_cmd (const char *cmd);void load_command_list (const char *prefix, -struct cmdnames *main_cmds, -struct cmdnames *other_cmds); +struct cmdnames *main_cmds, +struct cmdnames *other_cmds);void add_cmdname (struct cmdnames *cmds,const char *name,int len);/* Here we require that excludes is a sorted list. */ void exclude_cmds (struct cmdnames *cmds,struct cmdnames *excludes);
http.h +5 -5
@@ -104,7 +104,7 @@ void step_active_slots(void);#endif void http_init (struct remote *remote,const char *url, -int proactive_auth); +int proactive_auth);void http_cleanup (void );struct curl_slist *http_copy_default_headers (void );
@@ -147,10 +147,10 @@ void normalize_curl_result(CURLcode *result, long http_code, char *errorstr,/* Helpers for modifying and creating URLs */ void append_remote_object_url (struct strbuf *buf,const char *url, -const char *hex, -int only_two_digit_prefix); +const char *hex, +int only_two_digit_prefix);char *get_remote_object_url (const char *url,const char *hex, -int only_two_digit_prefix); +int only_two_digit_prefix);/* Options for http_get_*() */ struct http_get_options {
@@ -208,7 +208,7 @@ int http_fetch_ref(const char *base, struct ref *ref);/* Helpers for fetching packs */ int http_get_info_packs (const char *base_url, -struct packed_git **packs_head); +struct packed_git **packs_head);struct http_pack_request {char *url;
khash.h +3 -3
@@ -69,11 +69,11 @@ static const double __ac_HASH_UPPER = 0.77;khval_t *vals; \ } kh_##name##_t; -#define __KHASH_PROTOTYPES (name, khkey_t, khval_t) \ - kh_##name##_t *kh_init_##name(void); \ +#define __KHASH_PROTOTYPES (name, khkey_t, khval_t) \ + kh_##name##_t *kh_init_##name(void); \ void kh_destroy_##name(kh_##name##_t *h); \ void kh_clear_##name(kh_##name##_t *h); \ - khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key); \ + khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key); \ int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets); \ khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret); \ void kh_del_##name(kh_##name##_t *h, khint_t x);
lockfile.h +1 -1
@@ -189,7 +189,7 @@ static inline int is_lock_file_locked(struct lock_file *lk)* `errno` set by the failing call. */ void unable_to_lock_message (const char *path,int err, -struct strbuf *buf); +struct strbuf *buf);/* * Emit an appropriate error message and `die()` following the failure
ls-refs.h +1 -1
@@ -5,6 +5,6 @@ struct repository;struct argv_array ;struct packet_reader ;int ls_refs (struct repository *r,struct argv_array *keys, -struct packet_reader *request); +struct packet_reader *request);#endif /* LS_REFS_H */
merge-blobs.h +2 -2
@@ -5,7 +5,7 @@ struct blob;struct index_state ;void *merge_blobs (struct index_state *,const char *, -struct blob *,struct blob *, -struct blob *,unsigned long *); +struct blob *,struct blob *, +struct blob *,unsigned long *);#endif /* MERGE_BLOBS_H */
object-store.h +8 -8
@@ -163,9 +163,9 @@ void *map_loose_object(struct repository *r, const struct object_id *oid, unsigned long *size);void *read_object_file_extended (struct repository *r, -const struct object_id *oid, -enum object_type *type, -unsigned long *size,int lookup_replace); +const struct object_id *oid, +enum object_type *type, +unsigned long *size,int lookup_replace); static inline void *repo_read_object_file(struct repository *r, const struct object_id *oid, enum object_type *type,
@@ -181,17 +181,17 @@ static inline void *repo_read_object_file(struct repository *r,int oid_object_info (struct repository *r,const struct object_id *,unsigned long *);int hash_object_file (const void *buf,unsigned long len, -const char *type,struct object_id *oid); +const char *type,struct object_id *oid);int write_object_file (const void *buf,unsigned long len, -const char *type,struct object_id *oid); +const char *type,struct object_id *oid);int hash_object_file_literally (const void *buf,unsigned long len, -const char *type,struct object_id *oid, -unsigned flags); +const char *type,struct object_id *oid, +unsigned flags);int pretend_object_file (void *,unsigned long ,enum object_type , -struct object_id *oid); +struct object_id *oid);int force_object_loose (const struct object_id *oid,time_t mtime);
oidmap.h +1 -1
@@ -47,7 +47,7 @@ void oidmap_free(struct oidmap *map, int free_entries);* Returns the oidmap entry for the specified oid, or NULL if not found. */ void *oidmap_get (const struct oidmap *map, -const struct object_id *key); +const struct object_id *key);/* * Adds or replaces an oidmap entry.
pack.h +1 -1
@@ -93,7 +93,7 @@ char *index_pack_lockfile(int fd);*/ #define MAX_PACK_OBJECT_HEADER 10int 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)
packfile.h +4 -4
@@ -60,7 +60,7 @@ struct packed_git *get_all_packs(struct repository *r);unsigned long approximate_object_count (void );struct packed_git *find_sha1_pack (const unsigned char *sha1, -struct packed_git *packs); +struct packed_git *packs);void pack_report (void );
@@ -144,8 +144,8 @@ void release_pack_memory(size_t);extern int do_check_packed_object_crc;int packed_object_info (struct repository *r, -struct packed_git *pack, -off_t offset,struct object_info *); +struct packed_git *pack, +off_t offset,struct object_info *);void mark_bad_packed_object (struct packed_git *p,const unsigned char *sha1);const struct packed_git *has_packed_and_bad (struct repository *r,const unsigned char *sha1);
@@ -177,6 +177,6 @@ int is_promisor_object(const struct object_id *oid);* probably use open_pack_index() or parse_pack_index() instead. */ int load_idx (const char *path,const unsigned int hashsz,void *idx_map, -size_t idx_size,struct packed_git *p); +size_t idx_size,struct packed_git *p);#endif
path.h +5 -5
@@ -38,8 +38,8 @@ char *mksnpath(char *buf, size_t n, const char *fmt, ...)* append it in the provided buffer `sb`. */ void strbuf_git_common_path (struct strbuf *sb, -const struct repository *repo, -const char *fmt, ...) +const struct repository *repo, +const char *fmt, ...) __attribute__((format (printf,3 ,4 )));/*
@@ -67,7 +67,7 @@ const char *git_common_path(const char *fmt, ...)* Return a path into the git directory of repository `repo`. */ char *repo_git_path (const struct repository *repo, -const char *fmt, ...) +const char *fmt, ...) __attribute__((format (printf,2 ,3 )));/*
@@ -75,8 +75,8 @@ char *repo_git_path(const struct repository *repo,* to the provided buffer `sb`. */ void strbuf_repo_git_path (struct strbuf *sb, -const struct repository *repo, -const char *fmt, ...) +const struct repository *repo, +const char *fmt, ...) __attribute__((format (printf,3 ,4 )));/*
pkt-line.h +2 -2
@@ -173,8 +173,8 @@ struct packet_reader {* abstraction around the 'packet_read_with_status()' function. */ void packet_reader_init (struct packet_reader *reader,int fd, -char *src_buffer,size_t src_len, -int options); +char *src_buffer,size_t src_len, +int options);/* * Perform a packet read and return the status of the read.
ppc/sha1.c +1 -1
@@ -11,7 +11,7 @@#include "sha1.h" void ppc_sha1_core (uint32_t *hash,const unsigned char *p, -unsigned int nblocks); +unsigned int nblocks);int ppc_SHA1_Init (ppc_SHA_CTX *c) {
quote.h +1 -1
@@ -68,7 +68,7 @@ void quote_two_c_style(struct strbuf *, const char *, const char *, int);void write_name_quoted (const char *name,FILE *,int terminator);void write_name_quoted_relative (const char *name,const char *prefix, -FILE *fp,int terminator); +FILE *fp,int terminator);/* quote path as relative to the given prefix */ char *quote_path_relative(const char *in, const char *prefix,
reachable.h +2 -2
@@ -5,8 +5,8 @@ struct progress;struct rev_info ;int add_unseen_recent_objects_to_traversal (struct rev_info *revs, -timestamp_t timestamp); +timestamp_t timestamp);void mark_reachable_objects (struct rev_info *revs,int mark_reflog, -timestamp_t mark_recent,struct progress *); +timestamp_t mark_recent,struct progress *);#endif
reflog-walk.h +6 -6
@@ -8,17 +8,17 @@ struct reflog_walk_info;void init_reflog_walk (struct reflog_walk_info **info);int add_reflog_for_walk (struct reflog_walk_info *info, -struct commit *commit,const char *name); +struct commit *commit,const char *name);void show_reflog_message (struct reflog_walk_info *info,int , -const struct date_mode *,int force_date); +const struct date_mode *,int force_date);void get_reflog_message (struct strbuf *sb, -struct reflog_walk_info *reflog_info); +struct reflog_walk_info *reflog_info);const char *get_reflog_ident (struct reflog_walk_info *reflog_info);timestamp_t get_reflog_timestamp (struct reflog_walk_info *reflog_info);void get_reflog_selector (struct strbuf *sb, -struct reflog_walk_info *reflog_info, -const struct date_mode *dmode,int force_date, -int shorten); +struct reflog_walk_info *reflog_info, +const struct date_mode *dmode,int force_date, +int shorten);int reflog_walk_empty (struct reflog_walk_info *walk);
remote.h +6 -6
@@ -140,15 +140,15 @@ struct packet_reader;struct argv_array ;struct string_list ;struct ref **get_remote_heads (struct packet_reader *reader, -struct ref **list,unsigned int flags, -struct oid_array *extra_have, -struct oid_array *shallow_points); +struct ref **list,unsigned int flags, +struct oid_array *extra_have, +struct oid_array *shallow_points);/* Used for protocol v2 in order to retrieve refs from a remote */ struct ref **get_remote_refs (int fd_out,struct packet_reader *reader, -struct ref **list,int for_push, -const struct argv_array *ref_prefixes, -const struct string_list *server_options); +struct ref **list,int for_push, +const struct argv_array *ref_prefixes, +const struct string_list *server_options);int resolve_remote_symref (struct ref *ref,struct ref *list);
replace-object.h +1 -1
@@ -17,7 +17,7 @@ void prepare_replace_object(struct repository *r);* lookup_replace_object(). Please do not call it directly. */ const struct object_id *do_lookup_replace_object (struct repository *r, -const struct object_id *oid); +const struct object_id *oid);/* * If object sha1 should be replaced, return the replacement object's
serve.h +1 -1
@@ -3,7 +3,7 @@struct argv_array ;int has_capability (const struct argv_array *keys,const char *capability, -const char **value); +const char **value);struct serve_options {unsigned advertise_capabilities;
sha1-lookup.h +3 -3
@@ -4,9 +4,9 @@typedef const unsigned char *sha1_access_fn (size_t index,void *table);int sha1_pos (const unsigned char *sha1, -void *table, -size_t nr, -sha1_access_fn fn); +void *table, +size_t nr, +sha1_access_fn fn);/* * Searches for sha1 in table, using the given fanout table to determine the
string-list.h +1 -1
@@ -175,7 +175,7 @@ struct string_list_item *string_list_insert(struct string_list *list, const char* doesn't exist, the list is not altered. */ void string_list_remove (struct string_list *list,const char *string, -int free_util); +int free_util);/** * Check if the given string is part of a sorted list. If it is part of the list,
sub-process.h +3 -3
@@ -43,9 +43,9 @@ struct subprocess_capability {/* Function to test two subprocess hashmap entries for equality. */ int cmd2process_cmp (const void *unused_cmp_data, -const void *e1, -const void *e2, -const void *unused_keydata); +const void *e1, +const void *e2, +const void *unused_keydata);/* * User-supplied function to initialize the sub-process. This is
submodule-config.h +1 -1
@@ -36,7 +36,7 @@ int parse_submodule_fetchjobs(const char *var, const char *value);int parse_fetch_recurse_submodules_arg (const char *opt,const char *arg);struct option ;int option_fetch_parse_recurse_submodules (const struct option *opt, -const char *arg,int unset); +const char *arg,int unset);int parse_update_recurse_submodules_arg (const char *opt,const char *arg);int parse_push_recurse_submodules_arg (const char *opt,const char *arg);void repo_read_gitmodules (struct repository *repo);
tag.h +1 -1
@@ -18,6 +18,6 @@ void release_tag_memory(struct tag *t);struct object *deref_tag (struct repository *r,struct object *,const char *,int );struct object *deref_tag_noverify (struct object *);int gpg_verify_tag (const struct object_id *oid, -const char *name_to_report,unsigned flags); +const char *name_to_report,unsigned flags);#endif /* TAG_H */
tempfile.h +2 -2
@@ -137,7 +137,7 @@ struct tempfile *register_tempfile(const char *path);/* See "mks_tempfile functions" above. */ struct tempfile *mks_tempfile_sm (const char *filename_template, -int suffixlen,int mode); +int suffixlen,int mode);/* See "mks_tempfile functions" above. */ static inline struct tempfile *mks_tempfile_s(const char *filename_template,
@@ -160,7 +160,7 @@ static inline struct tempfile *mks_tempfile(const char *filename_template)/* See "mks_tempfile functions" above. */ struct tempfile *mks_tempfile_tsm (const char *filename_template, -int suffixlen,int mode); +int suffixlen,int mode);/* See "mks_tempfile functions" above. */ static inline struct tempfile *mks_tempfile_ts(const char *filename_template,
trace.h +5 -5
@@ -133,18 +133,18 @@ void trace_performance_leave(const char *format, ...);/* backend functions, use non-*fl macros instead */ __attribute__((format (printf,4 ,5 )))void trace_printf_key_fl (const char *file,int line,struct trace_key *key, -const char *format, ...); +const char *format, ...); __attribute__((format (printf,4 ,5 )))void trace_argv_printf_fl (const char *file,int line,const char **argv, -const char *format, ...); +const char *format, ...);void trace_strbuf_fl (const char *file,int line,struct trace_key *key, -const struct strbuf *data); +const struct strbuf *data); __attribute__((format (printf,4 ,5 )))void trace_performance_fl (const char *file,int line, -uint64_t nanos,const char *fmt, ...); +uint64_t nanos,const char *fmt, ...); __attribute__((format (printf,4 ,5 )))void trace_performance_leave_fl (const char *file,int line, -uint64_t nanos,const char *fmt, ...); +uint64_t nanos,const char *fmt, ...);static inline int trace_pass_fl (struct trace_key *key) {return key->fd || !key->initialized;
upload-pack.h +2 -2
@@ -14,10 +14,10 @@ struct repository;struct argv_array ;struct packet_reader ;int upload_pack_v2 (struct repository *r,struct argv_array *keys, -struct packet_reader *request); +struct packet_reader *request);struct strbuf ;int upload_pack_advertise (struct repository *r, -struct strbuf *value); +struct strbuf *value);#endif /* UPLOAD_PACK_H */
vcs-svn/svndiff.h +1 -1
@@ -5,6 +5,6 @@ struct line_buffer;struct sliding_view ;int svndiff0_apply (struct line_buffer *delta,off_t delta_len, -struct sliding_view *preimage,FILE *postimage); +struct sliding_view *preimage,FILE *postimage);#endif
worktree.h +7 -7
@@ -48,8 +48,8 @@ const char *get_worktree_git_dir(const struct worktree *wt);* "arg". "prefix" must not be NULL. */ struct worktree *find_worktree (struct worktree **list, -const char *prefix, -const char *arg); +const char *prefix, +const char *arg);/* * Return true if the given worktree is the main one.
@@ -69,14 +69,14 @@ const char *worktree_lock_reason(struct worktree *wt);* returned if "errmsg" is not NULL. */ int validate_worktree (const struct worktree *wt, -struct strbuf *errmsg, -unsigned flags); +struct strbuf *errmsg, +unsigned flags);/* * Update worktrees/xxx/gitdir with the new path. */ void update_worktree_location (struct worktree *wt, -const char *path_); +const char *path_);/* * Free up the memory for worktree(s)
@@ -89,7 +89,7 @@ void free_worktrees(struct worktree **);* or NULL otherwise. The result may be destroyed by the next call. */ const struct worktree *find_shared_symref (const char *symref, -const char *target); +const char *target);/* * Similar to head_ref() for all HEADs _except_ one from the current
@@ -105,7 +105,7 @@ int is_worktree_being_bisected(const struct worktree *wt, const char *target);* worktree instead of current one */ const char *worktree_git_path (const struct worktree *wt, -const char *fmt, ...) +const char *fmt, ...) __attribute__((format (printf,2 ,3 )));/*
xdiff-interface.h +1 -1
@@ -47,7 +47,7 @@ void discard_hunk_line(void *priv,* are treated for the comparision. */ int xdiff_compare_lines (const char *l1,long s1, -const char *l2,long s2,long flags); +const char *l2,long s2,long flags);/* * Returns a hash of the string s of length len.
Signature · 1 line
2.21.0.1000.g7817e26e80
PATCH v4 4/4 cocci: prevent extern function declarations
In reply to Denton LiuSince function declarations already implicitly imply extern, create a Coccinelle rule which removes the redundant extern.
--- contrib/coccinelle/noextern.cocci | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 contrib/coccinelle/noextern.cocci
contrib/coccinelle/noextern.cocci new file +6 -0
@@ -0,0 +1,6 @@ +@@ +type T; +identifier f; +@@ +- extern + T f(...);
Signature · 1 line
2.21.0.1000.g7817e26e80
v5 cover *** SUBJECT HERE ***
In reply to Denton LiuHi Junio,
Since you mentioned you prefer wholesale replacement patches, here's a reroll.
I dropped the trailing '\' in the log messages and we also drop the 4th patch since Szeder reported that it was causing problems for the CI.
---
Changes since v1:
* Used spatch with sed instead of sed alone
* Fixed sed expression to ignore function variables
Changes since v2:
* Rebased on latest master (since last patchset hasn't been picked up yet)
* Manually aligned parameter lists that were mangled by the tools
Changes since v3:
* Excluded compat/ from cleanup
Changes since v4:
* Dropped trailing '\' from log messages
* Dropped "cocci: prevent extern function declarations"
Denton Liu (3):
*.[ch]: remove extern from function declarations using spatch *.[ch]: remove extern from function declarations using sed *.[ch]: manually align parameter lists
advice.h | 2 +- archive.h | 24 +-- bisect.h | 26 +-- blame.h | 2 +- branch.h | 14 +- builtin.h | 254 +++++++++++++------------- bulk-checkin.h | 10 +- cache.h | 386 +++++++++++++++++++-------------------- checkout.h | 6 +- column.h | 16 +- commit.h | 116 ++++++------ config.h | 226 +++++++++++------------ connect.h | 22 +-- csum-file.h | 20 +- decorate.h | 4 +- delta.h | 14 +- dir.h | 144 +++++++-------- exec-cmd.h | 16 +- fmt-merge-msg.h | 2 +- fsmonitor.h | 14 +- gettext.h | 8 +- git-compat-util.h | 132 ++++++------- grep.h | 22 +-- hashmap.h | 30 +-- help.h | 36 ++-- http.h | 62 +++---- khash.h | 16 +- kwset.h | 10 +- line-log.h | 16 +- lockfile.h | 12 +- ls-refs.h | 4 +- mailinfo.h | 6 +- merge-blobs.h | 6 +- object-store.h | 32 ++-- object.h | 12 +- oidmap.h | 12 +- pack.h | 26 +-- packfile.h | 82 ++++----- path.h | 42 ++--- pkt-line.h | 10 +- ppc/sha1.c | 4 +- prio-queue.h | 10 +- protocol.h | 6 +- quote.h | 34 ++-- reachable.h | 8 +- reflog-walk.h | 28 +-- refs.h | 2 +- remote.h | 24 +-- replace-object.h | 4 +- resolve-undo.h | 14 +- run-command.h | 8 +- serve.h | 6 +- sha1-lookup.h | 8 +- streaming.h | 8 +- string-list.h | 4 +- sub-process.h | 8 +- submodule-config.h | 22 +-- tag.h | 16 +- tempfile.h | 30 +-- trace.h | 44 ++--- transport.h | 4 +- tree-walk.h | 4 +- upload-pack.h | 8 +- url.h | 16 +- urlmatch.h | 4 +- utf8.h | 2 +- varint.h | 4 +- vcs-svn/sliding_window.h | 2 +- vcs-svn/svndiff.h | 4 +- worktree.h | 36 ++-- xdiff-interface.h | 12 +- 71 files changed, 1139 insertions(+), 1139 deletions(-)
Range-diff against v4:
1: 6c27c8b17c ! 1: 200c556b7d *.[ch]: remove extern from function declarations using spatch
@@ -19,8 +19,8 @@
and it was run with:
- $ git ls-files \*.{c,h} | \
- grep -v ^compat/ | \
+ $ 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
2: a996466d3b ! 2: 6fe5c773ea *.[ch]: remove extern from function declarations using sed
@@ -8,8 +8,8 @@
This was done by running the following on my system with sed 4.2.2:
- $ git ls-files \*.{c,h} | \
- grep -v ^compat/ | \
+ $ git ls-files \*.{c,h} |
+ grep -v ^compat/ |
xargs sed -i'' -e 's/^\(\s*\)extern \([^(]*([^*]\)/\1\2/'
Files under compat/ are intentionally excluded as some are directly
3: 6c8489b26b = 3: 98c743b19d *.[ch]: manually align parameter lists 4: ec08af884c < -: ---------- cocci: prevent extern function declarations
Signature · 1 line
2.21.0.1033.g0e8cc1100c
PATCH v5 1/3 *.[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-placeFiles under compat/ are intentionally excluded as some are directly copied from external sources and we should avoid churning them as much as possible.
--- advice.h | 2 +- archive.h | 14 +- bisect.h | 12 +- blame.h | 2 +- branch.h | 12 +- builtin.h | 252 ++++++++++++++--------------- bulk-checkin.h | 6 +- cache.h | 340 +++++++++++++++++++-------------------- checkout.h | 2 +- column.h | 12 +- commit.h | 70 ++++---- config.h | 182 ++++++++++----------- connect.h | 20 +-- csum-file.h | 20 +-- decorate.h | 4 +- delta.h | 10 +- dir.h | 70 ++++---- exec-cmd.h | 14 +- fmt-merge-msg.h | 2 +- fsmonitor.h | 14 +- gettext.h | 8 +- git-compat-util.h | 108 ++++++------- grep.h | 22 +-- hashmap.h | 30 ++-- help.h | 30 ++-- http.h | 52 +++--- kwset.h | 10 +- line-log.h | 16 +- lockfile.h | 10 +- ls-refs.h | 2 +- mailinfo.h | 6 +- merge-blobs.h | 2 +- object-store.h | 16 +- object.h | 12 +- oidmap.h | 10 +- pack.h | 24 +-- packfile.h | 74 ++++----- path.h | 2 +- pkt-line.h | 6 +- ppc/sha1.c | 2 +- prio-queue.h | 10 +- protocol.h | 6 +- quote.h | 30 ++-- reachable.h | 4 +- reflog-walk.h | 16 +- refs.h | 2 +- remote.h | 12 +- replace-object.h | 2 +- resolve-undo.h | 14 +- run-command.h | 6 +- serve.h | 4 +- sha1-lookup.h | 2 +- streaming.h | 8 +- string-list.h | 2 +- sub-process.h | 2 +- submodule-config.h | 20 +-- tag.h | 14 +- tempfile.h | 26 +-- trace.h | 16 +- transport.h | 4 +- tree-walk.h | 4 +- upload-pack.h | 4 +- url.h | 16 +- urlmatch.h | 4 +- utf8.h | 2 +- varint.h | 4 +- vcs-svn/sliding_window.h | 2 +- vcs-svn/svndiff.h | 2 +- worktree.h | 20 +-- xdiff-interface.h | 10 +- 70 files changed, 885 insertions(+), 885 deletions(-)
advice.h +1 -1
@@ -31,7 +31,7 @@ int git_default_advice_config(const char *var, const char *value); __attribute__((format (printf,1 ,2 )))void advise (const char *advice, ...);int error_resolve_conflict (const char *me); -extern void NORETURN die_resolve_conflict(const char *me); +void NORETURN die_resolve_conflict(const char *me); void NORETURN die_conclude_merge(void);void detach_advice (const char *new_name);
archive.h +7 -7
@@ -23,7 +23,7 @@ struct archiver_args {/* main api */ -extern int write_archive (int argc,const char **argv,const char *prefix, +int write_archive (int argc,const char **argv,const char *prefix,struct repository *repo,const char *name_hint,int remote);
@@ -39,19 +39,19 @@ struct archiver {unsigned flags;void *data; }; -extern void register_archiver (struct archiver *); +void register_archiver (struct archiver *); -extern void init_tar_archiver (void ); -extern void init_zip_archiver (void ); -extern void init_archivers (void ); +void init_tar_archiver (void ); +void init_zip_archiver (void ); +void init_archivers (void );typedef int (*write_archive_entry_fn_t )(struct archiver_args *args,const struct object_id *oid,const char *path,size_t pathlen,unsigned int mode); -extern int write_archive_entries (struct archiver_args *args,write_archive_entry_fn_t write_entry); -extern void *object_file_to_archive (const struct archiver_args *args, +int write_archive_entries (struct archiver_args *args,write_archive_entry_fn_t write_entry); +void *object_file_to_archive (const struct archiver_args *args,const char *path,const struct object_id *oid,unsigned int mode,enum object_type *type,unsigned long *sizep);
bisect.h +6 -6
@@ -11,10 +11,10 @@ struct repository;* Otherwise, it will be either all non-SAMETREE commits or the single * best commit, as chosen by `find_all`. */ -extern void find_bisection (struct commit_list **list,int *reaches,int *all, +void find_bisection (struct commit_list **list,int *reaches,int *all,int find_all); -extern struct commit_list *filter_skipped(struct commit_list *list, +struct commit_list *filter_skipped(struct commit_list *list, struct commit_list **tried, int show_all, int *count,
@@ -31,14 +31,14 @@ struct rev_list_info { const char *header_prefix; }; -extern int bisect_next_all (struct repository *r, +int bisect_next_all (struct repository *r,const char *prefix,int no_checkout); -extern int estimate_bisect_steps (int all); +int estimate_bisect_steps (int all); -extern void read_bisect_terms (const char **bad,const char **good); +void read_bisect_terms (const char **bad,const char **good); -extern int bisect_clean_state (void ); +int bisect_clean_state (void );#endif
blame.h +1 -1
@@ -177,6 +177,6 @@ struct blame_entry *blame_entry_prepend(struct blame_entry *head, long start, long end, struct blame_origin *o); -extern struct blame_origin *get_blame_suspects (struct commit *commit); +struct blame_origin *get_blame_suspects (struct commit *commit);#endif /* BLAME_H */
branch.h +6 -6
@@ -50,7 +50,7 @@ void create_branch(struct repository *r,* Return 1 if the named branch already exists; return 0 otherwise. * Fill ref with the full refname for the branch. */ -extern int validate_branchname (const char *name,struct strbuf *ref); +int validate_branchname (const char *name,struct strbuf *ref);/* * Check if a branch 'name' can be created as a new branch; die otherwise.
@@ -58,7 +58,7 @@ extern int validate_branchname(const char *name, struct strbuf *ref);* Return 1 if the named branch already exists; return 0 otherwise. * Fill ref with the full refname for the branch. */ -extern int validate_new_branchname (const char *name,struct strbuf *ref,int force); +int validate_new_branchname (const char *name,struct strbuf *ref,int force);/* * Remove information about the state of working on the current
@@ -72,26 +72,26 @@ void remove_branch_state(struct repository *r);* Returns 0 on success. */ #define BRANCH_CONFIG_VERBOSE 01 -extern int install_branch_config (int flag,const char *local,const char *origin,const char *remote); +int install_branch_config (int flag,const char *local,const char *origin,const char *remote);/* * Read branch description */ -extern int read_branch_desc (struct strbuf *,const char *branch_name); +int read_branch_desc (struct strbuf *,const char *branch_name);/* * Check if a branch is checked out in the main worktree or any linked * worktree and die (with a message describing its checkout location) if * it is. */ -extern void die_if_checked_out (const char *branch,int ignore_current_worktree); +void die_if_checked_out (const char *branch,int ignore_current_worktree);/* * Update all per-worktree HEADs pointing at the old ref to point the new ref. * This will be used when renaming a branch. Returns 0 if successful, non-zero * otherwise. */ -extern int replace_each_worktree_head_symref (const char *oldref,const char *newref, +int replace_each_worktree_head_symref (const char *oldref,const char *newref,const char *logmsg);#endif
builtin.h +126 -126
271 lines not on this page · raw message
bulk-checkin.h +3 -3
@@ -6,11 +6,11 @@#include "cache.h" -extern int index_bulk_checkin (struct object_id *oid, +int index_bulk_checkin (struct object_id *oid,int fd,size_t size,enum object_type type,const char *path,unsigned flags); -extern void plug_bulk_checkin (void ); -extern void unplug_bulk_checkin (void ); +void plug_bulk_checkin (void ); +void unplug_bulk_checkin (void );#endif
cache.h +170 -170
663 lines not on this page · raw message
checkout.h +1 -1
@@ -8,7 +8,7 @@* tracking branch. Return the name of the remote if such a branch * exists, NULL otherwise. */ -extern const char *unique_tracking_name (const char *name, +const char *unique_tracking_name (const char *name,struct object_id *oid,int *dwim_remotes_matched);
column.h +6 -6
@@ -27,20 +27,20 @@ struct column_options { };struct option ; -extern int parseopt_column_callback (const struct option *,const char *,int ); -extern int git_column_config (const char *var,const char *value, +int parseopt_column_callback (const struct option *,const char *,int ); +int git_column_config (const char *var,const char *value,const char *command,unsigned int *colopts); -extern int finalize_colopts (unsigned int *colopts,int stdout_is_tty); +int finalize_colopts (unsigned int *colopts,int stdout_is_tty);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, +void print_columns (const struct string_list *list,unsigned int colopts,const struct column_options *opts); -extern int run_column_filter (int colopts,const struct column_options *); -extern int stop_column_filter (void ); +int run_column_filter (int colopts,const struct column_options *); +int stop_column_filter (void );#endif
commit.h +35 -35
155 lines not on this page · raw message
config.h +91 -91
254 lines not on this page · raw message
connect.h +10 -10
@@ -7,19 +7,19 @@#define CONNECT_DIAG_URL (1u << 1)#define CONNECT_IPV4 (1u << 2)#define CONNECT_IPV6 (1u << 3) -extern struct child_process *git_connect (int fd[2 ],const char *url,const char *prog,int flags); -extern int finish_connect (struct child_process *conn); -extern int git_connection_is_socket (struct child_process *conn); -extern int server_supports (const char *feature); -extern int parse_feature_request (const char *features,const char *feature); -extern const char *server_feature_value (const char *feature,int *len_ret); -extern int url_is_local_not_ssh (const char *url); +struct child_process *git_connect (int fd[2 ],const char *url,const char *prog,int flags); +int finish_connect (struct child_process *conn); +int git_connection_is_socket (struct child_process *conn); +int server_supports (const char *feature); +int parse_feature_request (const char *features,const char *feature); +const char *server_feature_value (const char *feature,int *len_ret); +int url_is_local_not_ssh (const char *url);struct packet_reader ; -extern enum protocol_version discover_version (struct packet_reader *reader); +enum protocol_version discover_version (struct packet_reader *reader); -extern int server_supports_v2 (const char *c,int die_on_error); -extern int server_supports_feature (const char *c,const char *feature, +int server_supports_v2 (const char *c,int die_on_error); +int server_supports_feature (const char *c,const char *feature,int die_on_error);#endif
csum-file.h +10 -10
@@ -25,22 +25,22 @@ struct hashfile_checkpoint {git_hash_ctx ctx; }; -extern void hashfile_checkpoint (struct hashfile *,struct hashfile_checkpoint *); -extern int hashfile_truncate (struct hashfile *,struct hashfile_checkpoint *); +void hashfile_checkpoint (struct hashfile *,struct hashfile_checkpoint *); +int hashfile_truncate (struct hashfile *,struct hashfile_checkpoint *);/* finalize_hashfile flags */ #define CSUM_CLOSE 1#define CSUM_FSYNC 2#define CSUM_HASH_IN_STREAM 4 -extern struct hashfile *hashfd (int fd,const char *name); -extern struct hashfile *hashfd_check (const char *name); -extern struct hashfile *hashfd_throughput (int fd,const char *name,struct progress *tp); -extern int finalize_hashfile (struct hashfile *,unsigned char *,unsigned int ); -extern void hashwrite (struct hashfile *,const void *,unsigned int ); -extern void hashflush (struct hashfile *f); -extern void crc32_begin (struct hashfile *); -extern uint32_t crc32_end (struct hashfile *); +struct hashfile *hashfd (int fd,const char *name); +struct hashfile *hashfd_check (const char *name); +struct hashfile *hashfd_throughput (int fd,const char *name,struct progress *tp); +int finalize_hashfile (struct hashfile *,unsigned char *,unsigned int ); +void hashwrite (struct hashfile *,const void *,unsigned int ); +void hashflush (struct hashfile *f); +void crc32_begin (struct hashfile *); +uint32_t crc32_end (struct hashfile *);static inline void hashwrite_u8 (struct hashfile *f,uint8_t data) {
decorate.h +2 -2
@@ -50,12 +50,12 @@ struct decoration {* NULL), returning the previously associated pointer. If there is no previous * association, this function returns NULL. */ -extern void *add_decoration (struct decoration *n,const struct object *obj,void *decoration); +void *add_decoration (struct decoration *n,const struct object *obj,void *decoration);/* * Return the pointer associated to the given object. If there is no * association, this function returns NULL. */ -extern void *lookup_decoration (struct decoration *n,const struct object *obj); +void *lookup_decoration (struct decoration *n,const struct object *obj);#endif
delta.h +5 -5
@@ -13,7 +13,7 @@ struct delta_index;* before free_delta_index() is called. The returned pointer must be freed * using free_delta_index(). */ -extern struct delta_index * +struct delta_index *create_delta_index (const void *buf,unsigned long bufsize);/*
@@ -21,14 +21,14 @@ create_delta_index(const void *buf, unsigned long bufsize);* * Given pointer must be what create_delta_index() returned, or NULL. */ -extern void free_delta_index (struct delta_index *index); +void free_delta_index (struct delta_index *index);/* * sizeof_delta_index: returns memory usage of delta index * * Given pointer must be what create_delta_index() returned, or NULL. */ -extern unsigned long sizeof_delta_index (struct delta_index *index); +unsigned long sizeof_delta_index (struct delta_index *index);/* * create_delta: create a delta from given index for the given buffer
@@ -40,7 +40,7 @@ extern unsigned long sizeof_delta_index(struct delta_index *index);* returned and *delta_size is updated with its size. The returned buffer * must be freed by the caller. */ -extern void * +void *create_delta (const struct delta_index *index,const void *buf,unsigned long bufsize,unsigned long *delta_size,unsigned long max_delta_size);
@@ -75,7 +75,7 @@ diff_delta(const void *src_buf, unsigned long src_bufsize,* *trg_bufsize is updated with its size. On failure a NULL pointer is * returned. The returned buffer must be freed by the caller. */ -extern void *patch_delta (const void *src_buf,unsigned long src_size, +void *patch_delta (const void *src_buf,unsigned long src_size,const void *delta_buf,unsigned long delta_size,unsigned long *dst_size);
dir.h +35 -35
145 lines not on this page · raw message
exec-cmd.h +7 -7
@@ -3,14 +3,14 @@struct argv_array ; -extern void git_set_exec_path (const char *exec_path); -extern void git_resolve_executable_dir (const char *path); -extern const char *git_exec_path (void ); -extern void setup_path (void ); -extern const char **prepare_git_cmd (struct argv_array *out,const char **argv); -extern int execv_git_cmd (const char **argv);/* NULL terminated */ +void git_set_exec_path (const char *exec_path); +void git_resolve_executable_dir (const char *path); +const char *git_exec_path (void ); +void setup_path (void ); +const char **prepare_git_cmd (struct argv_array *out,const char **argv); +int execv_git_cmd (const char **argv);/* NULL terminated */ LAST_ARG_MUST_BE_NULL extern int execl_git_cmd(const char *cmd, ...); -extern char *system_path (const char *path); +char *system_path (const char *path);#endif /* GIT_EXEC_CMD_H */
fmt-merge-msg.h +1 -1
@@ -2,6 +2,6 @@#define FMT_MERGE_MSG_H extern int merge_log_config; -extern int fmt_merge_msg_config (const char *key,const char *value,void *cb); +int fmt_merge_msg_config (const char *key,const char *value,void *cb);#endif /* FMT_MERGE_MSG_H */
fsmonitor.h +7 -7
@@ -10,31 +10,31 @@ extern struct trace_key trace_fsmonitor;* Read the fsmonitor index extension and (if configured) restore the * CE_FSMONITOR_VALID state. */ -extern int read_fsmonitor_extension (struct index_state *istate,const void *data,unsigned long sz); +int read_fsmonitor_extension (struct index_state *istate,const void *data,unsigned long sz);/* * Fill the fsmonitor_dirty ewah bits with their state from the index, * before it is split during writing. */ -extern void fill_fsmonitor_bitmap (struct index_state *istate); +void fill_fsmonitor_bitmap (struct index_state *istate);/* * Write the CE_FSMONITOR_VALID state into the fsmonitor index * extension. Reads from the fsmonitor_dirty ewah in the index. */ -extern void write_fsmonitor_extension (struct strbuf *sb,struct index_state *istate); +void write_fsmonitor_extension (struct strbuf *sb,struct index_state *istate);/* * Add/remove the fsmonitor index extension */ -extern void add_fsmonitor (struct index_state *istate); -extern void remove_fsmonitor (struct index_state *istate); +void add_fsmonitor (struct index_state *istate); +void remove_fsmonitor (struct index_state *istate);/* * Add/remove the fsmonitor index extension as necessary based on the current * core.fsmonitor setting. */ -extern void tweak_fsmonitor (struct index_state *istate); +void tweak_fsmonitor (struct index_state *istate);/* * Run the configured fsmonitor integration script and clear the
@@ -42,7 +42,7 @@ extern void tweak_fsmonitor(struct index_state *istate);* any corresponding untracked cache directory structures. Optimized to only * run the first time it is called. */ -extern void refresh_fsmonitor (struct index_state *istate); +void refresh_fsmonitor (struct index_state *istate);/* * Set the given cache entries CE_FSMONITOR_VALID bit. This should be
gettext.h +4 -4
@@ -28,11 +28,11 @@#define FORMAT_PRESERVING (n) __attribute__((format_arg(n))) -extern int use_gettext_poison (void ); +int use_gettext_poison (void );#ifndef NO_GETTEXT -extern void git_setup_gettext (void ); -extern int gettext_width (const char *s); +void git_setup_gettext (void ); +int gettext_width (const char *s);#else static inline void git_setup_gettext (void ) {
@@ -87,6 +87,6 @@ const char *Q_(const char *msgid, const char *plu, unsigned long n)#endif const char *get_preferred_languages (void ); -extern int is_utf8_locale (void ); +int is_utf8_locale (void );#endif
git-compat-util.h +54 -54
242 lines not on this page · raw message
grep.h +11 -11
@@ -186,17 +186,17 @@ struct grep_opt {void *output_priv; }; -extern void init_grep_defaults (struct repository *); -extern int grep_config (const char *var,const char *value,void *); -extern void grep_init (struct grep_opt *,struct repository *repo,const char *prefix); +void init_grep_defaults (struct repository *); +int grep_config (const char *var,const char *value,void *); +void grep_init (struct grep_opt *,struct repository *repo,const char *prefix);void grep_commit_pattern_type (enum grep_pattern_type ,struct grep_opt *opt); -extern void append_grep_pat (struct grep_opt *opt,const char *pat,size_t patlen,const char *origin,int no,enum grep_pat_token t); -extern void append_grep_pattern (struct grep_opt *opt,const char *pat,const char *origin,int no,enum grep_pat_token t); -extern void append_header_grep_pattern (struct grep_opt *,enum grep_header_field ,const char *); -extern void compile_grep_patterns (struct grep_opt *opt); -extern void free_grep_patterns (struct grep_opt *opt); -extern int grep_buffer (struct grep_opt *opt,char *buf,unsigned long size); +void append_grep_pat (struct grep_opt *opt,const char *pat,size_t patlen,const char *origin,int no,enum grep_pat_token t); +void append_grep_pattern (struct grep_opt *opt,const char *pat,const char *origin,int no,enum grep_pat_token t); +void append_header_grep_pattern (struct grep_opt *,enum grep_header_field ,const char *); +void compile_grep_patterns (struct grep_opt *opt); +void free_grep_patterns (struct grep_opt *opt); +int grep_buffer (struct grep_opt *opt,char *buf,unsigned long size);struct grep_source {char *name;
@@ -226,8 +226,8 @@ void grep_source_load_driver(struct grep_source *gs,int grep_source (struct grep_opt *opt,struct grep_source *gs); -extern struct grep_opt *grep_opt_dup (const struct grep_opt *opt); -extern int grep_threads_ok (const struct grep_opt *opt); +struct grep_opt *grep_opt_dup (const struct grep_opt *opt); +int grep_threads_ok (const struct grep_opt *opt);/* * Mutex used around access to the attributes machinery if
hashmap.h +15 -15
@@ -104,11 +104,11 @@* `memihash_cont` is a variant of `memihash` that allows a computation to be * continued with another chunk of data. */ -extern unsigned int strhash (const char *buf); -extern unsigned int strihash (const char *buf); -extern unsigned int memhash (const void *buf,size_t len); -extern unsigned int memihash (const void *buf,size_t len); -extern unsigned int memihash_cont (unsigned int hash_seed,const void *buf,size_t len); +unsigned int strhash (const char *buf); +unsigned int strihash (const char *buf); +unsigned int memhash (const void *buf,size_t len); +unsigned int memihash (const void *buf,size_t len); +unsigned int memihash_cont (unsigned int hash_seed,const void *buf,size_t len);/* * Converts a cryptographic hash (e.g. SHA-1) into an int-sized hash code
@@ -216,7 +216,7 @@ struct hashmap {* parameter may be used to preallocate a sufficiently large table and thus * prevent expensive resizing. If 0, the table is dynamically resized. */ -extern void hashmap_init (struct hashmap *map, +void hashmap_init (struct hashmap *map,hashmap_cmp_fn equals_function,const void *equals_function_data,size_t initial_size);
@@ -227,7 +227,7 @@ extern void hashmap_init(struct hashmap *map,* If `free_entries` is true, each hashmap_entry in the map is freed as well * using stdlibs free(). */ -extern void hashmap_free (struct hashmap *map,int free_entries); +void hashmap_free (struct hashmap *map,int free_entries);/* hashmap_entry functions */
@@ -284,7 +284,7 @@ static inline unsigned int hashmap_get_size(struct hashmap *map)* If an entry with matching hash code is found, `key` and `keydata` are passed * to `hashmap_cmp_fn` to decide whether the entry matches the key. */ -extern void *hashmap_get (const struct hashmap *map,const void *key, +void *hashmap_get (const struct hashmap *map,const void *key,const void *keydata);/*
@@ -316,7 +316,7 @@ static inline void *hashmap_get_from_hash(const struct hashmap *map,* `entry` is the hashmap_entry to start the search from, obtained via a previous * call to `hashmap_get` or `hashmap_get_next`. */ -extern void *hashmap_get_next (const struct hashmap *map,const void *entry); +void *hashmap_get_next (const struct hashmap *map,const void *entry);/* * Adds a hashmap entry. This allows to add duplicate entries (i.e.
@@ -325,7 +325,7 @@ extern void *hashmap_get_next(const struct hashmap *map, const void *entry);* `map` is the hashmap structure. * `entry` is the entry to add. */ -extern void hashmap_add (struct hashmap *map,void *entry); +void hashmap_add (struct hashmap *map,void *entry);/* * Adds or replaces a hashmap entry. If the hashmap contains duplicate
@@ -335,7 +335,7 @@ extern void hashmap_add(struct hashmap *map, void *entry);* `entry` is the entry to add or replace. * Returns the replaced entry, or NULL if not found (i.e. the entry was added). */ -extern void *hashmap_put (struct hashmap *map,void *entry); +void *hashmap_put (struct hashmap *map,void *entry);/* * Removes a hashmap entry matching the specified key. If the hashmap contains
@@ -344,7 +344,7 @@ extern void *hashmap_put(struct hashmap *map, void *entry);* * Argument explanation is the same as in `hashmap_get`. */ -extern void *hashmap_remove (struct hashmap *map,const void *key, +void *hashmap_remove (struct hashmap *map,const void *key,const void *keydata);/*
@@ -365,10 +365,10 @@ struct hashmap_iter { };/* Initializes a `hashmap_iter` structure. */ -extern void hashmap_iter_init (struct hashmap *map,struct hashmap_iter *iter); +void hashmap_iter_init (struct hashmap *map,struct hashmap_iter *iter);/* Returns the next hashmap_entry, or NULL if there are no more entries. */ -extern void *hashmap_iter_next (struct hashmap_iter *iter); +void *hashmap_iter_next (struct hashmap_iter *iter);/* Initializes the iterator and returns the first entry, if any. */ static inline void *hashmap_iter_first(struct hashmap *map,
@@ -429,7 +429,7 @@ static inline void hashmap_enable_item_counting(struct hashmap *map)* * Uses a hashmap to store the pool of interned strings. */ -extern const void *memintern (const void *data,size_t len); +const void *memintern (const void *data,size_t len);static inline const char *strintern (const char *string) {return memintern (string,strlen (string));
help.h +15 -15
@@ -19,31 +19,31 @@ static inline void mput_char(char c, unsigned int num)putchar (c); } -extern void list_common_cmds_help (void ); -extern void list_all_cmds_help (void ); -extern void list_common_guides_help (void ); -extern void list_config_help (int for_human); +void list_common_cmds_help (void ); +void list_all_cmds_help (void ); +void list_common_guides_help (void ); +void list_config_help (int for_human); -extern void list_all_main_cmds (struct string_list *list); -extern void list_all_other_cmds (struct string_list *list); -extern void list_cmds_by_category (struct string_list *list, +void list_all_main_cmds (struct string_list *list); +void list_all_other_cmds (struct string_list *list); +void list_cmds_by_category (struct string_list *list,const char *category); -extern void list_cmds_by_config (struct string_list *list); -extern const char *help_unknown_cmd (const char *cmd); -extern void load_command_list (const char *prefix, +void list_cmds_by_config (struct string_list *list); +const char *help_unknown_cmd (const char *cmd); +void load_command_list (const char *prefix,struct cmdnames *main_cmds,struct cmdnames *other_cmds); -extern void add_cmdname (struct cmdnames *cmds,const char *name,int len); +void add_cmdname (struct cmdnames *cmds,const char *name,int len);/* Here we require that excludes is a sorted list. */ -extern void exclude_cmds (struct cmdnames *cmds,struct cmdnames *excludes); -extern int is_in_cmdlist (struct cmdnames *cmds,const char *name); -extern void list_commands (unsigned int colopts,struct cmdnames *main_cmds,struct cmdnames *other_cmds); +void exclude_cmds (struct cmdnames *cmds,struct cmdnames *excludes); +int is_in_cmdlist (struct cmdnames *cmds,const char *name); +void list_commands (unsigned int colopts,struct cmdnames *main_cmds,struct cmdnames *other_cmds);/* * call this to die(), when it is suspected that the user mistyped a * ref to the command, to give suggested "correct" refs. */ -extern void help_unknown_ref (const char *ref,const char *cmd,const char *error); +void help_unknown_ref (const char *ref,const char *cmd,const char *error); static inline void list_config_item(struct string_list *list, const char *prefix,
http.h +26 -26
101 lines not on this page · raw message
kwset.h +5 -5
@@ -37,16 +37,16 @@ typedef struct kwset_t* kwset_t;if enough memory cannot be obtained. The argument if non-NULL specifies a table of character translations to be applied to all pattern and search text. */ -extern kwset_t kwsalloc (unsigned char const *); +kwset_t kwsalloc (unsigned char const *);/* Incrementally extend the keyword set to include the given string. Return NULL for success, or an error message. Remember an index number for each keyword included in the set. */ -extern const char *kwsincr (kwset_t ,char const *,size_t ); +const char *kwsincr (kwset_t ,char const *,size_t );/* When the keyword set has been completely built, prepare it for use. Return NULL for success, or an error message. */ -extern const char *kwsprep (kwset_t ); +const char *kwsprep (kwset_t );/* Search through the given buffer for a member of the keyword set. Return a pointer to the leftmost longest match found, or NULL if
@@ -54,8 +54,8 @@ extern const char *kwsprep(kwset_t);the matching substring in the integer it points to. Similarly, if foundindex is non-NULL, store the index of the particular keyword found therein. */ -extern size_t kwsexec (kwset_t ,char const *,size_t ,struct kwsmatch *); +size_t kwsexec (kwset_t ,char const *,size_t ,struct kwsmatch *);/* Deallocate the given keyword set and all its associated storage. */ -extern void kwsfree (kwset_t ); +void kwsfree (kwset_t );
line-log.h +8 -8
@@ -25,17 +25,17 @@ struct diff_ranges {struct range_set target; }; -extern void range_set_init (struct range_set *,size_t prealloc); -extern void range_set_release (struct range_set *); +void range_set_init (struct range_set *,size_t prealloc); +void range_set_release (struct range_set *);/* Range includes start; excludes end */ -extern void range_set_append_unsafe (struct range_set *,long start,long end); +void range_set_append_unsafe (struct range_set *,long start,long end);/* New range must begin at or after end of last added range */ -extern void range_set_append (struct range_set *,long start,long end); +void range_set_append (struct range_set *,long start,long end);/* * In-place pass of sorting and merging the ranges in the range set, * to sort and make the ranges disjoint. */ -extern void sort_and_merge_range_set (struct range_set *); +void sort_and_merge_range_set (struct range_set *);/* Linked list of interesting files and their associated ranges. The * list must be kept sorted by path.
@@ -54,10 +54,10 @@ struct line_log_data { struct diff_ranges diff; }; -extern void line_log_init (struct rev_info *rev,const char *prefix,struct string_list *args); +void line_log_init (struct rev_info *rev,const char *prefix,struct string_list *args); -extern int line_log_filter (struct rev_info *rev); +int line_log_filter (struct rev_info *rev); -extern int line_log_print (struct rev_info *rev,struct commit *commit); +int line_log_print (struct rev_info *rev,struct commit *commit);#endif /* LINE_LOG_H */
lockfile.h +5 -5
@@ -159,7 +159,7 @@ struct lock_file {* timeout_ms is -1, retry indefinitely. The flags argument and error * handling are described above. */ -extern int hold_lock_file_for_update_timeout ( +int hold_lock_file_for_update_timeout (struct lock_file *lk,const char *path,int flags,long timeout_ms);
@@ -188,7 +188,7 @@ static inline int is_lock_file_locked(struct lock_file *lk)* of `hold_lock_file_for_update()` to lock `path`. `err` should be the * `errno` set by the failing call. */ -extern void unable_to_lock_message (const char *path,int err, +void unable_to_lock_message (const char *path,int err,struct strbuf *buf);/*
@@ -197,7 +197,7 @@ extern void unable_to_lock_message(const char *path, int err,* `errno` set by the failing * call. */ -extern NORETURN void unable_to_lock_die(const char *path, int err); +NORETURN void unable_to_lock_die(const char *path, int err);/* * Associate a stdio stream with the lockfile (which must still be
@@ -234,7 +234,7 @@ static inline FILE *get_lock_file_fp(struct lock_file *lk)* Return the path of the file that is locked by the specified * lock_file object. The caller must free the memory. */ -extern char *get_locked_file_path (struct lock_file *lk); +char *get_locked_file_path (struct lock_file *lk);/* * If the lockfile is still open, close it (and the file pointer if it
@@ -282,7 +282,7 @@ static inline int reopen_lock_file(struct lock_file *lk)* call `commit_lock_file()` for a `lock_file` object that is not * currently locked. */ -extern int commit_lock_file (struct lock_file *lk); +int commit_lock_file (struct lock_file *lk);/* * Like `commit_lock_file()`, but rename the lockfile to the provided
ls-refs.h +1 -1
@@ -4,7 +4,7 @@struct repository ;struct argv_array ;struct packet_reader ; -extern int ls_refs (struct repository *r,struct argv_array *keys, +int ls_refs (struct repository *r,struct argv_array *keys,struct packet_reader *request);#endif /* LS_REFS_H */
mailinfo.h +3 -3
@@ -39,8 +39,8 @@ struct mailinfo { int input_error; }; -extern void setup_mailinfo (struct mailinfo *); -extern int mailinfo (struct mailinfo *,const char *msg,const char *patch); -extern void clear_mailinfo (struct mailinfo *); +void setup_mailinfo (struct mailinfo *); +int mailinfo (struct mailinfo *,const char *msg,const char *patch); +void clear_mailinfo (struct mailinfo *);#endif /* MAILINFO_H */
merge-blobs.h +1 -1
@@ -4,7 +4,7 @@struct blob ;struct index_state ; -extern void *merge_blobs (struct index_state *,const char *, +void *merge_blobs (struct index_state *,const char *,struct blob *,struct blob *,struct blob *,unsigned long *);
object-store.h +8 -8
@@ -162,7 +162,7 @@ const char *loose_object_path(struct repository *r, struct strbuf *buf,void *map_loose_object (struct repository *r,const struct object_id *oid,unsigned long *size); -extern void *read_object_file_extended (struct repository *r, +void *read_object_file_extended (struct repository *r,const struct object_id *oid,enum object_type *type,unsigned long *size,int lookup_replace);
@@ -180,20 +180,20 @@ static inline void *repo_read_object_file(struct repository *r,/* Read and unpack an object file into memory, write memory to an object file */ int oid_object_info (struct repository *r,const struct object_id *,unsigned long *); -extern int hash_object_file (const void *buf,unsigned long len, +int hash_object_file (const void *buf,unsigned long len,const char *type,struct object_id *oid); -extern int write_object_file (const void *buf,unsigned long len, +int write_object_file (const void *buf,unsigned long len,const char *type,struct object_id *oid); -extern int hash_object_file_literally (const void *buf,unsigned long len, +int hash_object_file_literally (const void *buf,unsigned long len,const char *type,struct object_id *oid,unsigned flags); -extern int pretend_object_file (void *,unsigned long ,enum object_type , +int pretend_object_file (void *,unsigned long ,enum object_type ,struct object_id *oid); -extern int force_object_loose (const struct object_id *oid,time_t mtime); +int force_object_loose (const struct object_id *oid,time_t mtime);/* * Open the loose object at path, check its hash, and return the contents,
@@ -227,9 +227,9 @@ int repo_has_object_file_with_flags(struct repository *r,* with the specified name. This function does not respect replace * references. */ -extern int has_loose_object_nonlocal (const struct object_id *); +int has_loose_object_nonlocal (const struct object_id *); -extern void assert_oid_type (const struct object_id *oid,enum object_type expect); +void assert_oid_type (const struct object_id *oid,enum object_type expect);struct object_info {/* Request */
object.h +6 -6
@@ -90,19 +90,19 @@ struct object {struct object_id oid; }; -extern const char *type_name (unsigned int type); -extern int type_from_string_gently (const char *str,ssize_t ,int gentle); +const char *type_name (unsigned int type); +int type_from_string_gently (const char *str,ssize_t ,int gentle);#define type_from_string (str) type_from_string_gently(str, -1, 0)/* * Return the current number of buckets in the object hashmap. */ -extern unsigned int get_max_object_index (void ); +unsigned int get_max_object_index (void );/* * Return the object from the specified bucket in the object hashmap. */ -extern struct object *get_indexed_object (unsigned int ); +struct object *get_indexed_object (unsigned int );/* * This can be used to see if we have heard of the object before, but
@@ -118,7 +118,7 @@ extern struct object *get_indexed_object(unsigned int);*/ struct object *lookup_object (struct repository *r,const unsigned char *sha1); -extern void *create_object (struct repository *r,const unsigned char *sha1,void *obj); +void *create_object (struct repository *r,const unsigned char *sha1,void *obj);void *object_as_type (struct repository *r,struct object *obj,enum object_type type,int quiet);
@@ -189,6 +189,6 @@ void clear_object_flags(unsigned flags);/* * Clear the specified object flags from all in-core commit objects. */ -extern void clear_commit_marks_all (unsigned int flags); +void clear_commit_marks_all (unsigned int flags);#endif /* OBJECT_H */
oidmap.h +5 -5
@@ -33,7 +33,7 @@ struct oidmap {* parameter may be used to preallocate a sufficiently large table and thus * prevent expensive resizing. If 0, the table is dynamically resized. */ -extern void oidmap_init (struct oidmap *map,size_t initial_size); +void oidmap_init (struct oidmap *map,size_t initial_size);/* * Frees an oidmap structure and allocated memory.
@@ -41,12 +41,12 @@ extern void oidmap_init(struct oidmap *map, size_t initial_size);* If `free_entries` is true, each oidmap_entry in the map is freed as well * using stdlibs free(). */ -extern void oidmap_free (struct oidmap *map,int free_entries); +void oidmap_free (struct oidmap *map,int free_entries);/* * Returns the oidmap entry for the specified oid, or NULL if not found. */ -extern void *oidmap_get (const struct oidmap *map, +void *oidmap_get (const struct oidmap *map,const struct object_id *key);/*
@@ -57,14 +57,14 @@ extern void *oidmap_get(const struct oidmap *map,* * Returns the replaced entry, or NULL if not found (i.e. the entry was added). */ -extern void *oidmap_put (struct oidmap *map,void *entry); +void *oidmap_put (struct oidmap *map,void *entry);/* * Removes an oidmap entry matching the specified oid. * * Returns the removed entry, or NULL if not found. */ -extern void *oidmap_remove (struct oidmap *map,const struct object_id *key); +void *oidmap_remove (struct oidmap *map,const struct object_id *key);struct oidmap_iter {
pack.h +12 -12
@@ -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
packfile.h +37 -37
175 lines not on this page · raw message
path.h +1 -1
@@ -143,7 +143,7 @@ extern int strbuf_git_path_submodule(struct strbuf *sb, const char *path, const char *fmt, ...) __attribute__((format (printf, 3, 4))); -extern void report_linked_checkout_garbage (void ); +void report_linked_checkout_garbage (void );/* * You can define a static memoized git path like:
pkt-line.h +3 -3
@@ -172,7 +172,7 @@ struct packet_reader {* Initialize a 'struct packet_reader' object which is an * abstraction around the 'packet_read_with_status()' function. */ -extern void packet_reader_init (struct packet_reader *reader,int fd, +void packet_reader_init (struct packet_reader *reader,int fd,char *src_buffer,size_t src_len,int options);
@@ -186,7 +186,7 @@ extern void packet_reader_init(struct packet_reader *reader, int fd,* 'line' is set to point at the read line * PACKET_READ_FLUSH: 'pktlen' is set to '0' and 'line' is set to NULL */ -extern enum packet_read_status packet_reader_read (struct packet_reader *reader); +enum packet_read_status packet_reader_read (struct packet_reader *reader);/* * Peek the next packet line without consuming it and return the status.
@@ -196,7 +196,7 @@ extern enum packet_read_status packet_reader_read(struct packet_reader *reader);* Peeking multiple times without calling 'packet_reader_read()' will return * the same result. */ -extern enum packet_read_status packet_reader_peek (struct packet_reader *reader); +enum packet_read_status packet_reader_peek (struct packet_reader *reader);#define DEFAULT_PACKET_MAX 1000#define LARGE_PACKET_MAX 65520
ppc/sha1.c +1 -1
@@ -10,7 +10,7 @@#include <string.h> #include "sha1.h" -extern void ppc_sha1_core (uint32_t *hash,const unsigned char *p, +void ppc_sha1_core (uint32_t *hash,const unsigned char *p,unsigned int nblocks);int ppc_SHA1_Init (ppc_SHA_CTX *c)
prio-queue.h +5 -5
@@ -37,24 +37,24 @@ struct prio_queue {/* * Add the "thing" to the queue. */ -extern void prio_queue_put (struct prio_queue *,void *thing); +void prio_queue_put (struct prio_queue *,void *thing);/* * Extract the "thing" that compares the smallest out of the queue, * or NULL. If compare function is NULL, the queue acts as a LIFO * stack. */ -extern void *prio_queue_get (struct prio_queue *); +void *prio_queue_get (struct prio_queue *);/* * Gain access to the "thing" that would be returned by * prio_queue_get, but do not remove it from the queue. */ -extern void *prio_queue_peek (struct prio_queue *); +void *prio_queue_peek (struct prio_queue *); -extern void clear_prio_queue (struct prio_queue *); +void clear_prio_queue (struct prio_queue *);/* Reverse the LIFO elements */ -extern void prio_queue_reverse (struct prio_queue *); +void prio_queue_reverse (struct prio_queue *);#endif /* PRIO_QUEUE_H */
protocol.h +3 -3
@@ -14,7 +14,7 @@ enum protocol_version {* 'protocol.version' config. If unconfigured, a value of 'protocol_v0' is * returned. */ -extern enum protocol_version get_protocol_version_config (void ); +enum protocol_version get_protocol_version_config (void );/* * Used by a server to determine which protocol version should be used based on
@@ -23,12 +23,12 @@ extern enum protocol_version get_protocol_version_config(void);* request a particular protocol version, a default of 'protocol_v0' will be * used. */ -extern enum protocol_version determine_protocol_version_server (void ); +enum protocol_version determine_protocol_version_server (void );/* * Used by a client to determine which protocol version the server is speaking * based on the server's initial response. */ -extern enum protocol_version determine_protocol_version_client (const char *server_response); +enum protocol_version determine_protocol_version_client (const char *server_response);#endif /* PROTOCOL_H */
quote.h +15 -15
@@ -29,8 +29,8 @@ struct strbuf;* sq_quotef() quotes the entire formatted string as a single result. */ -extern void sq_quote_buf (struct strbuf *,const char *src); -extern void sq_quote_argv (struct strbuf *,const char **argv); +void sq_quote_buf (struct strbuf *,const char *src); +void sq_quote_argv (struct strbuf *,const char **argv);extern void sq_quotef (struct strbuf *,const char *fmt, ...);/*
@@ -45,14 +45,14 @@ void sq_quote_argv_pretty(struct strbuf *, const char **argv);* NULL if the input does not look like what sq_quote would have * produced. */ -extern char *sq_dequote (char *); +char *sq_dequote (char *);/* * Same as the above, but can be used to unwrap many arguments in the * same string separated by space. Like sq_quote, it works in place, * modifying arg and appending pointers into it to argv. */ -extern int sq_dequote_to_argv (char *arg,const char ***argv,int *nr,int *alloc); +int sq_dequote_to_argv (char *arg,const char ***argv,int *nr,int *alloc);/* * Same as above, but store the unquoted strings in an argv_array. We will
@@ -60,24 +60,24 @@ extern int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc* will duplicate and take ownership of the strings. */ struct argv_array ; -extern int sq_dequote_to_argv_array (char *arg,struct argv_array *); +int sq_dequote_to_argv_array (char *arg,struct argv_array *); -extern int unquote_c_style (struct strbuf *,const char *quoted,const char **endp); -extern size_t quote_c_style (const char *name,struct strbuf *,FILE *,int no_dq); -extern void quote_two_c_style (struct strbuf *,const char *,const char *,int ); +int unquote_c_style (struct strbuf *,const char *quoted,const char **endp); +size_t quote_c_style (const char *name,struct strbuf *,FILE *,int no_dq); +void quote_two_c_style (struct strbuf *,const char *,const char *,int ); -extern void write_name_quoted (const char *name,FILE *,int terminator); -extern void write_name_quoted_relative (const char *name,const char *prefix, +void write_name_quoted (const char *name,FILE *,int terminator); +void write_name_quoted_relative (const char *name,const char *prefix,FILE *fp,int terminator);/* quote path as relative to the given prefix */ -extern char *quote_path_relative (const char *in,const char *prefix, +char *quote_path_relative (const char *in,const char *prefix,struct strbuf *out);
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.21.0.1033.g0e8cc1100c
Part of the diff is not shown here. View the raw message.
PATCH v5 2/3 *.[ch]: remove extern from function declarations using sed
In reply to Denton LiuThere has been a push to remove extern from function declarations. Finish the job by removing all instances of "extern" for function declarations in headers using sed.
This was done by running the following on my system with sed 4.2.2:
$ git ls-files \*.{c,h} |
grep -v ^compat/ |
xargs sed -i'' -e 's/^\(\s*\)extern \([^(]*([^*]\)/\1\2/'Files under compat/ are intentionally excluded as some are directly copied from external sources and we should avoid churning them as much as possible.
Then, leftover instances of extern were found by running
$ git grep -w -C3 extern \*.{c,h}and manually checking the output. No other instances were found.
Note that the regex used specifically excludes function variables which _should_ be left as extern.
Not the most elegant way to do it but it gets the job done.
--- cache.h | 4 ++-- commit.h | 2 +- config.h | 2 +- exec-cmd.h | 2 +- git-compat-util.h | 20 ++++++++++---------- khash.h | 14 +++++++------- path.h | 30 +++++++++++++++--------------- quote.h | 2 +- run-command.h | 2 +- trace.h | 18 +++++++++--------- worktree.h | 2 +- 11 files changed, 49 insertions(+), 49 deletions(-)
cache.h +2 -2
@@ -1690,7 +1690,7 @@ extern const char *git_mailmap_blob;/* IO helper functions */ void maybe_flush_or_die (FILE *,const char *); __attribute__((format (printf,2 ,3 ))) -extern void fprintf_or_die (FILE *,const char *fmt, ...); +void fprintf_or_die (FILE *,const char *fmt, ...);#define COPY_READ_ERROR (-2)#define COPY_WRITE_ERROR (-3)
@@ -1724,7 +1724,7 @@ void write_file_buf(const char *path, const char *buf, size_t len);* write_file(path, "counter: %d", ctr); */ __attribute__((format (printf,2 ,3 ))) -extern void write_file (const char *path,const char *fmt, ...); +void write_file (const char *path,const char *fmt, ...);/* pager.c */ void setup_pager (void );
commit.h +1 -1
@@ -379,6 +379,6 @@ int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused)int compare_commits_by_gen_then_commit_date (const void *a_,const void *b_,void *unused);LAST_ARG_MUST_BE_NULL -extern int run_commit_hook(int editor_is_used, const char *index_file, const char *name, ...); +int run_commit_hook(int editor_is_used, const char *index_file, const char *name, ...);#endif /* COMMIT_H */
config.h +1 -1
@@ -265,7 +265,7 @@ struct key_value_info {enum config_scope scope; }; -extern NORETURN void git_die_config(const char *key, const char *err, ...) __attribute__((format(printf, 2, 3))); +NORETURN void git_die_config(const char *key, const char *err, ...) __attribute__((format(printf, 2, 3))); NORETURN void git_die_config_linenr(const char *key, const char *filename, int linenr);#define LOOKUP_CONFIG (mapping, var) \
exec-cmd.h +1 -1
@@ -10,7 +10,7 @@ void setup_path(void);const char **prepare_git_cmd (struct argv_array *out,const char **argv);int execv_git_cmd (const char **argv);/* NULL terminated */ LAST_ARG_MUST_BE_NULL -extern int execl_git_cmd(const char *cmd, ...); +int execl_git_cmd(const char *cmd, ...);char *system_path (const char *path);#endif /* GIT_EXEC_CMD_H */
git-compat-util.h +10 -10
@@ -448,13 +448,13 @@ struct strbuf;/* General helper functions */ void vreportf (const char *prefix,const char *err,va_list params); NORETURN void usage(const char *err); -extern NORETURN void usagef(const char *err, ...) __attribute__((format (printf, 1, 2))); -extern NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2))); -extern NORETURN void die_errno(const char *err, ...) __attribute__((format (printf, 1, 2))); -extern int error (const char *err, ...) __attribute__((format (printf,1 ,2 ))); -extern int error_errno (const char *err, ...) __attribute__((format (printf,1 ,2 ))); -extern void warning (const char *err, ...) __attribute__((format (printf,1 ,2 ))); -extern void warning_errno (const char *err, ...) __attribute__((format (printf,1 ,2 ))); +NORETURN void usagef(const char *err, ...) __attribute__((format (printf, 1, 2))); +NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2))); +NORETURN void die_errno(const char *err, ...) __attribute__((format (printf, 1, 2))); +int error (const char *err, ...) __attribute__((format (printf,1 ,2 ))); +int error_errno (const char *err, ...) __attribute__((format (printf,1 ,2 ))); +void warning (const char *err, ...) __attribute__((format (printf,1 ,2 ))); +void warning_errno (const char *err, ...) __attribute__((format (printf,1 ,2 )));#ifndef NO_OPENSSL #ifdef APPLE_COMMON_CRYPTO
@@ -769,7 +769,7 @@ FILE *git_fopen(const char*, const char*);#undef snprintf#endif #define snprintf git_snprintf -extern int git_snprintf (char *str,size_t maxsize, +int git_snprintf (char *str,size_t maxsize,const char *format, ...);#ifdef vsnprintf#undef vsnprintf
@@ -855,7 +855,7 @@ void *xrealloc(void *ptr, size_t size);void *xcalloc (size_t nmemb,size_t size);void *xmmap (void *start,size_t length,int prot,int flags,int fd,off_t offset);void *xmmap_gently (void *start,size_t length,int prot,int flags,int fd,off_t offset); -extern int xopen (const char *path,int flags, ...); +int xopen (const char *path,int flags, ...);ssize_t xread (int fd,void *buf,size_t len);ssize_t xwrite (int fd,const void *buf,size_t len);ssize_t xpread (int fd,void *buf,size_t len,off_t offset);
@@ -966,7 +966,7 @@ static inline size_t xsize_t(off_t len) } __attribute__((format (printf,3 ,4 ))) -extern int xsnprintf (char *dst,size_t max,const char *fmt, ...); +int xsnprintf (char *dst,size_t max,const char *fmt, ...);#ifndef HOST_NAME_MAX #define HOST_NAME_MAX 256
khash.h +7 -7
@@ -70,13 +70,13 @@ static const double __ac_HASH_UPPER = 0.77; } kh_##name##_t;#define __KHASH_PROTOTYPES (name, khkey_t, khval_t) \ - extern kh_##name##_t *kh_init_##name(void); \ - extern void kh_destroy_##name(kh_##name##_t *h); \ - extern void kh_clear_##name(kh_##name##_t *h); \ - extern khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key); \ - extern int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets); \ - extern khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret); \ - extern void kh_del_##name(kh_##name##_t *h, khint_t x); + kh_##name##_t *kh_init_##name(void); \ + void kh_destroy_##name(kh_##name##_t *h); \ + void kh_clear_##name(kh_##name##_t *h); \ + khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key); \ + int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets); \ + khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret); \ + void kh_del_##name(kh_##name##_t *h, khint_t x);#define __KHASH_IMPL (name,SCOPE , khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ SCOPE kh_##name##_t *kh_init_##name(void) { \
path.h +15 -15
@@ -13,19 +13,19 @@ struct strbuf;/* * Return a statically allocated path. */ -extern const char *mkpath (const char *fmt, ...) +const char *mkpath (const char *fmt, ...) __attribute__((format (printf,1 ,2 )));/* * Return a path. */ -extern char *mkpathdup (const char *fmt, ...) +char *mkpathdup (const char *fmt, ...) __attribute__((format (printf,1 ,2 )));/* * Construct a path and place the result in the provided buffer `buf`. */ -extern char *mksnpath (char *buf,size_t n,const char *fmt, ...) +char *mksnpath (char *buf,size_t n,const char *fmt, ...) __attribute__((format (printf,3 ,4 )));/*
@@ -37,7 +37,7 @@ extern char *mksnpath(char *buf, size_t n, const char *fmt, ...)* Constructs a path into the common git directory of repository `repo` and * append it in the provided buffer `sb`. */ -extern void strbuf_git_common_path (struct strbuf *sb, +void strbuf_git_common_path (struct strbuf *sb,const struct repository *repo,const char *fmt, ...) __attribute__((format (printf,3 ,4 )));
@@ -46,7 +46,7 @@ extern void strbuf_git_common_path(struct strbuf *sb,* Return a statically allocated path into the main repository's * (the_repository) common git directory. */ -extern const char *git_common_path (const char *fmt, ...) +const char *git_common_path (const char *fmt, ...) __attribute__((format (printf,1 ,2 )));
@@ -66,7 +66,7 @@ extern const char *git_common_path(const char *fmt, ...)/* * Return a path into the git directory of repository `repo`. */ -extern char *repo_git_path (const struct repository *repo, +char *repo_git_path (const struct repository *repo,const char *fmt, ...) __attribute__((format (printf,2 ,3 )));
@@ -74,7 +74,7 @@ extern char *repo_git_path(const struct repository *repo,* Construct a path into the git directory of repository `repo` and append it * to the provided buffer `sb`. */ -extern void strbuf_repo_git_path (struct strbuf *sb, +void strbuf_repo_git_path (struct strbuf *sb,const struct repository *repo,const char *fmt, ...) __attribute__((format (printf,3 ,4 )));
@@ -83,13 +83,13 @@ extern void strbuf_repo_git_path(struct strbuf *sb,* Return a statically allocated path into the main repository's * (the_repository) git directory. */ -extern const char *git_path (const char *fmt, ...) +const char *git_path (const char *fmt, ...) __attribute__((format (printf,1 ,2 )));/* * Return a path into the main repository's (the_repository) git directory. */ -extern char *git_pathdup (const char *fmt, ...) +char *git_pathdup (const char *fmt, ...) __attribute__((format (printf,1 ,2 )));/*
@@ -97,14 +97,14 @@ extern char *git_pathdup(const char *fmt, ...)* and place it in the provided buffer `buf`, the contents of the buffer will * be overridden. */ -extern char *git_path_buf (struct strbuf *buf,const char *fmt, ...) +char *git_path_buf (struct strbuf *buf,const char *fmt, ...) __attribute__((format (printf,2 ,3 )));/* * Construct a path into the main repository's (the_repository) git directory * and append it to the provided buffer `sb`. */ -extern void strbuf_git_path (struct strbuf *sb,const char *fmt, ...) +void strbuf_git_path (struct strbuf *sb,const char *fmt, ...) __attribute__((format (printf,2 ,3 )));/*
@@ -112,7 +112,7 @@ extern void strbuf_git_path(struct strbuf *sb, const char *fmt, ...)* * If the repository doesn't have a worktree NULL is returned. */ -extern char *repo_worktree_path (const struct repository *repo, +char *repo_worktree_path (const struct repository *repo,const char *fmt, ...) __attribute__((format (printf,2 ,3 )));
@@ -122,7 +122,7 @@ extern char *repo_worktree_path(const struct repository *repo,* * If the repository doesn't have a worktree nothing will be appended to `sb`. */ -extern void strbuf_repo_worktree_path (struct strbuf *sb, +void strbuf_repo_worktree_path (struct strbuf *sb,const struct repository *repo,const char *fmt, ...) __attribute__((format (printf,3 ,4 )));
@@ -131,7 +131,7 @@ extern void strbuf_repo_worktree_path(struct strbuf *sb,* Return a path into a submodule's git directory located at `path`. `path` * must only reference a submodule of the main repository (the_repository). */ -extern char *git_pathdup_submodule (const char *path,const char *fmt, ...) +char *git_pathdup_submodule (const char *path,const char *fmt, ...) __attribute__((format (printf,2 ,3 )));/*
@@ -139,7 +139,7 @@ extern char *git_pathdup_submodule(const char *path, const char *fmt, ...)* append it to the provided buffer `sb`. `path` must only reference a * submodule of the main repository (the_repository). */ -extern int strbuf_git_path_submodule (struct strbuf *sb,const char *path, +int strbuf_git_path_submodule (struct strbuf *sb,const char *path,const char *fmt, ...) __attribute__((format (printf,3 ,4 )));
quote.h +1 -1
@@ -31,7 +31,7 @@ struct strbuf;void sq_quote_buf (struct strbuf *,const char *src);void sq_quote_argv (struct strbuf *,const char **argv); -extern void sq_quotef (struct strbuf *,const char *fmt, ...); +void sq_quotef (struct strbuf *,const char *fmt, ...);/* * These match their non-pretty variants, except that they avoid
run-command.h +1 -1
@@ -69,7 +69,7 @@ int run_command(struct child_process *);*/ const char *find_hook (const char *name);LAST_ARG_MUST_BE_NULL -extern int run_hook_le(const char *const *env, const char *name, ...); +int run_hook_le(const char *const *env, const char *name, ...);int run_hook_ve (const char *const *env,const char *name,va_list args);#define RUN_COMMAND_NO_STDIN 1
trace.h +9 -9
@@ -28,23 +28,23 @@ uint64_t trace_performance_enter(void);#ifndef HAVE_VARIADIC_MACROS __attribute__((format (printf,1 ,2 ))) -extern void trace_printf (const char *format, ...); +void trace_printf (const char *format, ...); __attribute__((format (printf,2 ,3 ))) -extern void trace_printf_key (struct trace_key *key,const char *format, ...); +void trace_printf_key (struct trace_key *key,const char *format, ...); __attribute__((format (printf,2 ,3 ))) -extern void trace_argv_printf (const char **argv,const char *format, ...); +void trace_argv_printf (const char **argv,const char *format, ...);void trace_strbuf (struct trace_key *key,const struct strbuf *data);/* Prints elapsed time (in nanoseconds) if GIT_TRACE_PERFORMANCE is enabled. */ __attribute__((format (printf,2 ,3 ))) -extern void trace_performance (uint64_t nanos,const char *format, ...); +void trace_performance (uint64_t nanos,const char *format, ...);/* Prints elapsed time since 'start' if GIT_TRACE_PERFORMANCE is enabled. */ __attribute__((format (printf,2 ,3 ))) -extern void trace_performance_since (uint64_t start,const char *format, ...); +void trace_performance_since (uint64_t start,const char *format, ...); __attribute__((format (printf,1 ,2 )))void trace_performance_leave (const char *format, ...);
@@ -132,18 +132,18 @@ void trace_performance_leave(const char *format, ...);/* backend functions, use non-*fl macros instead */ __attribute__((format (printf,4 ,5 ))) -extern void trace_printf_key_fl (const char *file,int line,struct trace_key *key, +void trace_printf_key_fl (const char *file,int line,struct trace_key *key,const char *format, ...); __attribute__((format (printf,4 ,5 ))) -extern void trace_argv_printf_fl (const char *file,int line,const char **argv, +void trace_argv_printf_fl (const char *file,int line,const char **argv,const char *format, ...);void trace_strbuf_fl (const char *file,int line,struct trace_key *key,const struct strbuf *data); __attribute__((format (printf,4 ,5 ))) -extern void trace_performance_fl (const char *file,int line, +void trace_performance_fl (const char *file,int line,uint64_t nanos,const char *fmt, ...); __attribute__((format (printf,4 ,5 ))) -extern void trace_performance_leave_fl (const char *file,int line, +void trace_performance_leave_fl (const char *file,int line,uint64_t nanos,const char *fmt, ...);static inline int trace_pass_fl (struct trace_key *key) {
worktree.h +1 -1
@@ -104,7 +104,7 @@ int is_worktree_being_bisected(const struct worktree *wt, const char *target);* Similar to git_path() but can produce paths for a specified * worktree instead of current one */ -extern const char *worktree_git_path (const struct worktree *wt, +const char *worktree_git_path (const struct worktree *wt,const char *fmt, ...) __attribute__((format (printf,2 ,3 )));
Signature · 1 line
2.21.0.1033.g0e8cc1100c
PATCH v5 3/3 *.[ch]: manually align parameter lists
In reply to Denton LiuIn 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.
--- archive.h | 10 ++++---- bisect.h | 14 +++++------ branch.h | 2 +- builtin.h | 2 +- bulk-checkin.h | 4 +-- cache.h | 42 +++++++++++++++---------------- checkout.h | 4 +-- column.h | 4 +-- commit.h | 44 ++++++++++++++++---------------- config.h | 44 ++++++++++++++++---------------- connect.h | 2 +- delta.h | 4 +-- dir.h | 62 +++++++++++++++++++++++----------------------- git-compat-util.h | 4 +-- help.h | 6 ++--- http.h | 10 ++++---- khash.h | 6 ++--- lockfile.h | 2 +- ls-refs.h | 2 +- merge-blobs.h | 4 +-- object-store.h | 16 ++++++------ oidmap.h | 2 +- pack.h | 2 +- packfile.h | 8 +++--- path.h | 10 ++++---- pkt-line.h | 4 +-- ppc/sha1.c | 2 +- quote.h | 2 +- reachable.h | 4 +-- reflog-walk.h | 12 ++++----- remote.h | 12 ++++----- replace-object.h | 2 +- serve.h | 2 +- sha1-lookup.h | 6 ++--- string-list.h | 2 +- sub-process.h | 6 ++--- submodule-config.h | 2 +- tag.h | 2 +- tempfile.h | 4 +-- trace.h | 10 ++++---- upload-pack.h | 4 +-- vcs-svn/svndiff.h | 2 +- worktree.h | 14 +++++------ xdiff-interface.h | 2 +- 44 files changed, 202 insertions(+), 202 deletions(-)
archive.h +5 -5
@@ -24,8 +24,8 @@ struct archiver_args {/* main api */ int write_archive (int argc,const char **argv,const char *prefix, -struct repository *repo, -const char *name_hint,int remote); +struct repository *repo, +const char *name_hint,int remote);const char *archive_format_from_filename (const char *filename);
@@ -52,8 +52,8 @@ typedef int (*write_archive_entry_fn_t)(struct archiver_args *args,int write_archive_entries (struct archiver_args *args,write_archive_entry_fn_t write_entry);void *object_file_to_archive (const struct archiver_args *args, -const char *path,const struct object_id *oid, -unsigned int mode,enum object_type *type, -unsigned long *sizep); +const char *path,const struct object_id *oid, +unsigned int mode,enum object_type *type, +unsigned long *sizep);#endif /* ARCHIVE_H */
bisect.h +7 -7
@@ -12,13 +12,13 @@ struct repository;* best commit, as chosen by `find_all`. */ void find_bisection (struct commit_list **list,int *reaches,int *all, -int find_all); +int find_all);struct commit_list *filter_skipped (struct commit_list *list, -struct commit_list **tried, -int show_all, -int *count, -int *skipped_first); +struct commit_list **tried, +int show_all, +int *count, +int *skipped_first);#define BISECT_SHOW_ALL (1<<0)#define REV_LIST_QUIET (1<<1)
@@ -32,8 +32,8 @@ struct rev_list_info { };int bisect_next_all (struct repository *r, -const char *prefix, -int no_checkout); +const char *prefix, +int no_checkout);int estimate_bisect_steps (int all);
branch.h +1 -1
@@ -92,6 +92,6 @@ void die_if_checked_out(const char *branch, int ignore_current_worktree);* otherwise. */ int replace_each_worktree_head_symref (const char *oldref,const char *newref, -const char *logmsg); +const char *logmsg);#endif
builtin.h +1 -1
@@ -111,7 +111,7 @@ struct fmt_merge_msg_opts { };int fmt_merge_msg (struct strbuf *in,struct strbuf *out, -struct fmt_merge_msg_opts *); +struct fmt_merge_msg_opts *);/** * If a built-in has DELAY_PAGER_CONFIG set, the built-in should call this early
bulk-checkin.h +2 -2
@@ -7,8 +7,8 @@#include "cache.h" int index_bulk_checkin (struct object_id *oid, -int fd,size_t size,enum object_type type, -const char *path,unsigned flags); +int fd,size_t size,enum object_type type, +const char *path,unsigned flags);void plug_bulk_checkin (void );void unplug_bulk_checkin (void );
cache.h +21 -21
112 lines not on this page · raw message
checkout.h +2 -2
@@ -9,7 +9,7 @@* exists, NULL otherwise. */ const char *unique_tracking_name (const char *name, -struct object_id *oid, -int *dwim_remotes_matched); +struct object_id *oid, +int *dwim_remotes_matched);#endif /* CHECKOUT_H */
column.h +2 -2
@@ -29,7 +29,7 @@ struct column_options {struct option ;int parseopt_column_callback (const struct option *,const char *,int );int git_column_config (const char *var,const char *value, -const char *command,unsigned int *colopts); +const char *command,unsigned int *colopts);int finalize_colopts (unsigned int *colopts,int stdout_is_tty);static inline int column_active (unsigned int colopts) {
@@ -38,7 +38,7 @@ static inline int column_active(unsigned int colopts)struct string_list ;void print_columns (const struct string_list *list,unsigned int colopts, -const struct column_options *opts); +const struct column_options *opts);int run_column_filter (int colopts,const struct column_options *);int stop_column_filter (void );
commit.h +22 -22
106 lines not on this page · raw message
config.h +22 -22
78 lines not on this page · raw message
connect.h +1 -1
@@ -20,6 +20,6 @@ enum protocol_version discover_version(struct packet_reader *reader);int server_supports_v2 (const char *c,int die_on_error);int server_supports_feature (const char *c,const char *feature, -int die_on_error); +int die_on_error);#endif
delta.h +2 -2
@@ -76,8 +76,8 @@ diff_delta(const void *src_buf, unsigned long src_bufsize,* returned. The returned buffer must be freed by the caller. */ void *patch_delta (const void *src_buf,unsigned long src_size, -const void *delta_buf,unsigned long delta_size, -unsigned long *dst_size); +const void *delta_buf,unsigned long delta_size, +unsigned long *dst_size);/* the smallest possible delta size is 4 bytes */ #define DELTA_SIZE_MIN 4
dir.h +31 -31
106 lines not on this page · raw message
git-compat-util.h +2 -2
@@ -770,13 +770,13 @@ FILE *git_fopen(const char*, const char*);#endif #define snprintf git_snprintfint git_snprintf (char *str,size_t maxsize, -const char *format, ...); +const char *format, ...);#ifdef vsnprintf#undef vsnprintf#endif #define vsnprintf git_vsnprintfint git_vsnprintf (char *str,size_t maxsize, -const char *format,va_list ap); +const char *format,va_list ap);#endif #ifdef __GLIBC_PREREQ
help.h +3 -3
@@ -27,12 +27,12 @@ void list_config_help(int for_human);void list_all_main_cmds (struct string_list *list);void list_all_other_cmds (struct string_list *list);void list_cmds_by_category (struct string_list *list, -const char *category); +const char *category);void list_cmds_by_config (struct string_list *list);const char *help_unknown_cmd (const char *cmd);void load_command_list (const char *prefix, -struct cmdnames *main_cmds, -struct cmdnames *other_cmds); +struct cmdnames *main_cmds, +struct cmdnames *other_cmds);void add_cmdname (struct cmdnames *cmds,const char *name,int len);/* Here we require that excludes is a sorted list. */ void exclude_cmds (struct cmdnames *cmds,struct cmdnames *excludes);
http.h +5 -5
@@ -104,7 +104,7 @@ void step_active_slots(void);#endif void http_init (struct remote *remote,const char *url, -int proactive_auth); +int proactive_auth);void http_cleanup (void );struct curl_slist *http_copy_default_headers (void );
@@ -147,10 +147,10 @@ void normalize_curl_result(CURLcode *result, long http_code, char *errorstr,/* Helpers for modifying and creating URLs */ void append_remote_object_url (struct strbuf *buf,const char *url, -const char *hex, -int only_two_digit_prefix); +const char *hex, +int only_two_digit_prefix);char *get_remote_object_url (const char *url,const char *hex, -int only_two_digit_prefix); +int only_two_digit_prefix);/* Options for http_get_*() */ struct http_get_options {
@@ -208,7 +208,7 @@ int http_fetch_ref(const char *base, struct ref *ref);/* Helpers for fetching packs */ int http_get_info_packs (const char *base_url, -struct packed_git **packs_head); +struct packed_git **packs_head);struct http_pack_request {char *url;
khash.h +3 -3
@@ -69,11 +69,11 @@ static const double __ac_HASH_UPPER = 0.77;khval_t *vals; \ } kh_##name##_t; -#define __KHASH_PROTOTYPES (name, khkey_t, khval_t) \ - kh_##name##_t *kh_init_##name(void); \ +#define __KHASH_PROTOTYPES (name, khkey_t, khval_t) \ + kh_##name##_t *kh_init_##name(void); \ void kh_destroy_##name(kh_##name##_t *h); \ void kh_clear_##name(kh_##name##_t *h); \ - khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key); \ + khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key); \ int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets); \ khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret); \ void kh_del_##name(kh_##name##_t *h, khint_t x);
lockfile.h +1 -1
@@ -189,7 +189,7 @@ static inline int is_lock_file_locked(struct lock_file *lk)* `errno` set by the failing call. */ void unable_to_lock_message (const char *path,int err, -struct strbuf *buf); +struct strbuf *buf);/* * Emit an appropriate error message and `die()` following the failure
ls-refs.h +1 -1
@@ -5,6 +5,6 @@ struct repository;struct argv_array ;struct packet_reader ;int ls_refs (struct repository *r,struct argv_array *keys, -struct packet_reader *request); +struct packet_reader *request);#endif /* LS_REFS_H */
merge-blobs.h +2 -2
@@ -5,7 +5,7 @@ struct blob;struct index_state ;void *merge_blobs (struct index_state *,const char *, -struct blob *,struct blob *, -struct blob *,unsigned long *); +struct blob *,struct blob *, +struct blob *,unsigned long *);#endif /* MERGE_BLOBS_H */
object-store.h +8 -8
@@ -163,9 +163,9 @@ void *map_loose_object(struct repository *r, const struct object_id *oid, unsigned long *size);void *read_object_file_extended (struct repository *r, -const struct object_id *oid, -enum object_type *type, -unsigned long *size,int lookup_replace); +const struct object_id *oid, +enum object_type *type, +unsigned long *size,int lookup_replace); static inline void *repo_read_object_file(struct repository *r, const struct object_id *oid, enum object_type *type,
@@ -181,17 +181,17 @@ static inline void *repo_read_object_file(struct repository *r,int oid_object_info (struct repository *r,const struct object_id *,unsigned long *);int hash_object_file (const void *buf,unsigned long len, -const char *type,struct object_id *oid); +const char *type,struct object_id *oid);int write_object_file (const void *buf,unsigned long len, -const char *type,struct object_id *oid); +const char *type,struct object_id *oid);int hash_object_file_literally (const void *buf,unsigned long len, -const char *type,struct object_id *oid, -unsigned flags); +const char *type,struct object_id *oid, +unsigned flags);int pretend_object_file (void *,unsigned long ,enum object_type , -struct object_id *oid); +struct object_id *oid);int force_object_loose (const struct object_id *oid,time_t mtime);
oidmap.h +1 -1
@@ -47,7 +47,7 @@ void oidmap_free(struct oidmap *map, int free_entries);* Returns the oidmap entry for the specified oid, or NULL if not found. */ void *oidmap_get (const struct oidmap *map, -const struct object_id *key); +const struct object_id *key);/* * Adds or replaces an oidmap entry.
pack.h +1 -1
@@ -93,7 +93,7 @@ char *index_pack_lockfile(int fd);*/ #define MAX_PACK_OBJECT_HEADER 10int 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)
packfile.h +4 -4
@@ -60,7 +60,7 @@ struct packed_git *get_all_packs(struct repository *r);unsigned long approximate_object_count (void );struct packed_git *find_sha1_pack (const unsigned char *sha1, -struct packed_git *packs); +struct packed_git *packs);void pack_report (void );
@@ -144,8 +144,8 @@ void release_pack_memory(size_t);extern int do_check_packed_object_crc;int packed_object_info (struct repository *r, -struct packed_git *pack, -off_t offset,struct object_info *); +struct packed_git *pack, +off_t offset,struct object_info *);void mark_bad_packed_object (struct packed_git *p,const unsigned char *sha1);const struct packed_git *has_packed_and_bad (struct repository *r,const unsigned char *sha1);
@@ -177,6 +177,6 @@ int is_promisor_object(const struct object_id *oid);* probably use open_pack_index() or parse_pack_index() instead. */ int load_idx (const char *path,const unsigned int hashsz,void *idx_map, -size_t idx_size,struct packed_git *p); +size_t idx_size,struct packed_git *p);#endif
path.h +5 -5
@@ -38,8 +38,8 @@ char *mksnpath(char *buf, size_t n, const char *fmt, ...)* append it in the provided buffer `sb`. */ void strbuf_git_common_path (struct strbuf *sb, -const struct repository *repo, -const char *fmt, ...) +const struct repository *repo, +const char *fmt, ...) __attribute__((format (printf,3 ,4 )));/*
@@ -67,7 +67,7 @@ const char *git_common_path(const char *fmt, ...)* Return a path into the git directory of repository `repo`. */ char *repo_git_path (const struct repository *repo, -const char *fmt, ...) +const char *fmt, ...) __attribute__((format (printf,2 ,3 )));/*
@@ -75,8 +75,8 @@ char *repo_git_path(const struct repository *repo,* to the provided buffer `sb`. */ void strbuf_repo_git_path (struct strbuf *sb, -const struct repository *repo, -const char *fmt, ...) +const struct repository *repo, +const char *fmt, ...) __attribute__((format (printf,3 ,4 )));/*
pkt-line.h +2 -2
@@ -173,8 +173,8 @@ struct packet_reader {* abstraction around the 'packet_read_with_status()' function. */ void packet_reader_init (struct packet_reader *reader,int fd, -char *src_buffer,size_t src_len, -int options); +char *src_buffer,size_t src_len, +int options);/* * Perform a packet read and return the status of the read.
ppc/sha1.c +1 -1
@@ -11,7 +11,7 @@#include "sha1.h" void ppc_sha1_core (uint32_t *hash,const unsigned char *p, -unsigned int nblocks); +unsigned int nblocks);int ppc_SHA1_Init (ppc_SHA_CTX *c) {
quote.h +1 -1
@@ -68,7 +68,7 @@ void quote_two_c_style(struct strbuf *, const char *, const char *, int);void write_name_quoted (const char *name,FILE *,int terminator);void write_name_quoted_relative (const char *name,const char *prefix, -FILE *fp,int terminator); +FILE *fp,int terminator);/* quote path as relative to the given prefix */ char *quote_path_relative(const char *in, const char *prefix,
reachable.h +2 -2
@@ -5,8 +5,8 @@ struct progress;struct rev_info ;int add_unseen_recent_objects_to_traversal (struct rev_info *revs, -timestamp_t timestamp); +timestamp_t timestamp);void mark_reachable_objects (struct rev_info *revs,int mark_reflog, -timestamp_t mark_recent,struct progress *); +timestamp_t mark_recent,struct progress *);#endif
reflog-walk.h +6 -6
@@ -8,17 +8,17 @@ struct reflog_walk_info;void init_reflog_walk (struct reflog_walk_info **info);int add_reflog_for_walk (struct reflog_walk_info *info, -struct commit *commit,const char *name); +struct commit *commit,const char *name);void show_reflog_message (struct reflog_walk_info *info,int , -const struct date_mode *,int force_date); +const struct date_mode *,int force_date);void get_reflog_message (struct strbuf *sb, -struct reflog_walk_info *reflog_info); +struct reflog_walk_info *reflog_info);const char *get_reflog_ident (struct reflog_walk_info *reflog_info);timestamp_t get_reflog_timestamp (struct reflog_walk_info *reflog_info);void get_reflog_selector (struct strbuf *sb, -struct reflog_walk_info *reflog_info, -const struct date_mode *dmode,int force_date, -int shorten); +struct reflog_walk_info *reflog_info, +const struct date_mode *dmode,int force_date, +int shorten);int reflog_walk_empty (struct reflog_walk_info *walk);
remote.h +6 -6
@@ -140,15 +140,15 @@ struct packet_reader;struct argv_array ;struct string_list ;struct ref **get_remote_heads (struct packet_reader *reader, -struct ref **list,unsigned int flags, -struct oid_array *extra_have, -struct oid_array *shallow_points); +struct ref **list,unsigned int flags, +struct oid_array *extra_have, +struct oid_array *shallow_points);/* Used for protocol v2 in order to retrieve refs from a remote */ struct ref **get_remote_refs (int fd_out,struct packet_reader *reader, -struct ref **list,int for_push, -const struct argv_array *ref_prefixes, -const struct string_list *server_options); +struct ref **list,int for_push, +const struct argv_array *ref_prefixes, +const struct string_list *server_options);int resolve_remote_symref (struct ref *ref,struct ref *list);
replace-object.h +1 -1
@@ -17,7 +17,7 @@ void prepare_replace_object(struct repository *r);* lookup_replace_object(). Please do not call it directly. */ const struct object_id *do_lookup_replace_object (struct repository *r, -const struct object_id *oid); +const struct object_id *oid);/* * If object sha1 should be replaced, return the replacement object's
serve.h +1 -1
@@ -3,7 +3,7 @@struct argv_array ;int has_capability (const struct argv_array *keys,const char *capability, -const char **value); +const char **value);struct serve_options {unsigned advertise_capabilities;
sha1-lookup.h +3 -3
@@ -4,9 +4,9 @@typedef const unsigned char *sha1_access_fn (size_t index,void *table);int sha1_pos (const unsigned char *sha1, -void *table, -size_t nr, -sha1_access_fn fn); +void *table, +size_t nr, +sha1_access_fn fn);/* * Searches for sha1 in table, using the given fanout table to determine the
string-list.h +1 -1
@@ -175,7 +175,7 @@ struct string_list_item *string_list_insert(struct string_list *list, const char* doesn't exist, the list is not altered. */ void string_list_remove (struct string_list *list,const char *string, -int free_util); +int free_util);/** * Check if the given string is part of a sorted list. If it is part of the list,
sub-process.h +3 -3
@@ -43,9 +43,9 @@ struct subprocess_capability {/* Function to test two subprocess hashmap entries for equality. */ int cmd2process_cmp (const void *unused_cmp_data, -const void *e1, -const void *e2, -const void *unused_keydata); +const void *e1, +const void *e2, +const void *unused_keydata);/* * User-supplied function to initialize the sub-process. This is
submodule-config.h +1 -1
@@ -36,7 +36,7 @@ int parse_submodule_fetchjobs(const char *var, const char *value);int parse_fetch_recurse_submodules_arg (const char *opt,const char *arg);struct option ;int option_fetch_parse_recurse_submodules (const struct option *opt, -const char *arg,int unset); +const char *arg,int unset);int parse_update_recurse_submodules_arg (const char *opt,const char *arg);int parse_push_recurse_submodules_arg (const char *opt,const char *arg);void repo_read_gitmodules (struct repository *repo);
tag.h +1 -1
@@ -18,6 +18,6 @@ void release_tag_memory(struct tag *t);struct object *deref_tag (struct repository *r,struct object *,const char *,int );struct object *deref_tag_noverify (struct object *);int gpg_verify_tag (const struct object_id *oid, -const char *name_to_report,unsigned flags); +const char *name_to_report,unsigned flags);#endif /* TAG_H */
tempfile.h +2 -2
@@ -137,7 +137,7 @@ struct tempfile *register_tempfile(const char *path);/* See "mks_tempfile functions" above. */ struct tempfile *mks_tempfile_sm (const char *filename_template, -int suffixlen,int mode); +int suffixlen,int mode);/* See "mks_tempfile functions" above. */ static inline struct tempfile *mks_tempfile_s(const char *filename_template,
@@ -160,7 +160,7 @@ static inline struct tempfile *mks_tempfile(const char *filename_template)/* See "mks_tempfile functions" above. */ struct tempfile *mks_tempfile_tsm (const char *filename_template, -int suffixlen,int mode); +int suffixlen,int mode);/* See "mks_tempfile functions" above. */ static inline struct tempfile *mks_tempfile_ts(const char *filename_template,
trace.h +5 -5
@@ -133,18 +133,18 @@ void trace_performance_leave(const char *format, ...);/* backend functions, use non-*fl macros instead */ __attribute__((format (printf,4 ,5 )))void trace_printf_key_fl (const char *file,int line,struct trace_key *key, -const char *format, ...); +const char *format, ...); __attribute__((format (printf,4 ,5 )))void trace_argv_printf_fl (const char *file,int line,const char **argv, -const char *format, ...); +const char *format, ...);void trace_strbuf_fl (const char *file,int line,struct trace_key *key, -const struct strbuf *data); +const struct strbuf *data); __attribute__((format (printf,4 ,5 )))void trace_performance_fl (const char *file,int line, -uint64_t nanos,const char *fmt, ...); +uint64_t nanos,const char *fmt, ...); __attribute__((format (printf,4 ,5 )))void trace_performance_leave_fl (const char *file,int line, -uint64_t nanos,const char *fmt, ...); +uint64_t nanos,const char *fmt, ...);static inline int trace_pass_fl (struct trace_key *key) {return key->fd || !key->initialized;
upload-pack.h +2 -2
@@ -14,10 +14,10 @@ struct repository;struct argv_array ;struct packet_reader ;int upload_pack_v2 (struct repository *r,struct argv_array *keys, -struct packet_reader *request); +struct packet_reader *request);struct strbuf ;int upload_pack_advertise (struct repository *r, -struct strbuf *value); +struct strbuf *value);#endif /* UPLOAD_PACK_H */
vcs-svn/svndiff.h +1 -1
@@ -5,6 +5,6 @@ struct line_buffer;struct sliding_view ;int svndiff0_apply (struct line_buffer *delta,off_t delta_len, -struct sliding_view *preimage,FILE *postimage); +struct sliding_view *preimage,FILE *postimage);#endif
worktree.h +7 -7
@@ -48,8 +48,8 @@ const char *get_worktree_git_dir(const struct worktree *wt);* "arg". "prefix" must not be NULL. */ struct worktree *find_worktree (struct worktree **list, -const char *prefix, -const char *arg); +const char *prefix, +const char *arg);/* * Return true if the given worktree is the main one.
@@ -69,14 +69,14 @@ const char *worktree_lock_reason(struct worktree *wt);* returned if "errmsg" is not NULL. */ int validate_worktree (const struct worktree *wt, -struct strbuf *errmsg, -unsigned flags); +struct strbuf *errmsg, +unsigned flags);/* * Update worktrees/xxx/gitdir with the new path. */ void update_worktree_location (struct worktree *wt, -const char *path_); +const char *path_);/* * Free up the memory for worktree(s)
@@ -89,7 +89,7 @@ void free_worktrees(struct worktree **);* or NULL otherwise. The result may be destroyed by the next call. */ const struct worktree *find_shared_symref (const char *symref, -const char *target); +const char *target);/* * Similar to head_ref() for all HEADs _except_ one from the current
@@ -105,7 +105,7 @@ int is_worktree_being_bisected(const struct worktree *wt, const char *target);* worktree instead of current one */ const char *worktree_git_path (const struct worktree *wt, -const char *fmt, ...) +const char *fmt, ...) __attribute__((format (printf,2 ,3 )));/*
xdiff-interface.h +1 -1
@@ -47,7 +47,7 @@ void discard_hunk_line(void *priv,* are treated for the comparision. */ int xdiff_compare_lines (const char *l1,long s1, -const char *l2,long s2,long flags); +const char *l2,long s2,long flags);/* * Returns a hash of the string s of length len.
Signature · 1 line
2.21.0.1033.g0e8cc1100c
Re: [PATCH v5 0/3] *** SUBJECT HERE ***
In reply to Denton LiuQuoted 1 line
Subject: [PATCH v5 0/3] *** SUBJECT HERE ***
I forgot to change the subject... Embarassing.
Quoted 138 lines · Denton Liu
Hi Junio,
Since you mentioned you prefer wholesale replacement patches, here's a reroll.
I dropped the trailing '\' in the log messages and we also drop the 4th patch since Szeder reported that it was causing problems for the CI.
---
Changes since v1:
* Used spatch with sed instead of sed alone
* Fixed sed expression to ignore function variablesChanges since v2:
* Rebased on latest master (since last patchset hasn't been picked up yet)
* Manually aligned parameter lists that were mangled by the toolsChanges since v3:
* Excluded compat/ from cleanup
Changes since v4:
* Dropped trailing '\' from log messages
* Dropped "cocci: prevent extern function declarations"Denton Liu (3):
*.[ch]: remove extern from function declarations using spatch *.[ch]: remove extern from function declarations using sed *.[ch]: manually align parameter listsadvice.h | 2 +- archive.h | 24 +-- bisect.h | 26 +-- blame.h | 2 +- branch.h | 14 +- builtin.h | 254 +++++++++++++------------- bulk-checkin.h | 10 +- cache.h | 386 +++++++++++++++++++-------------------- checkout.h | 6 +- column.h | 16 +- commit.h | 116 ++++++------ config.h | 226 +++++++++++------------ connect.h | 22 +-- csum-file.h | 20 +- decorate.h | 4 +- delta.h | 14 +- dir.h | 144 +++++++-------- exec-cmd.h | 16 +- fmt-merge-msg.h | 2 +- fsmonitor.h | 14 +- gettext.h | 8 +- git-compat-util.h | 132 ++++++------- grep.h | 22 +-- hashmap.h | 30 +-- help.h | 36 ++-- http.h | 62 +++---- khash.h | 16 +- kwset.h | 10 +- line-log.h | 16 +- lockfile.h | 12 +- ls-refs.h | 4 +- mailinfo.h | 6 +- merge-blobs.h | 6 +- object-store.h | 32 ++-- object.h | 12 +- oidmap.h | 12 +- pack.h | 26 +-- packfile.h | 82 ++++----- path.h | 42 ++--- pkt-line.h | 10 +- ppc/sha1.c | 4 +- prio-queue.h | 10 +- protocol.h | 6 +- quote.h | 34 ++-- reachable.h | 8 +- reflog-walk.h | 28 +-- refs.h | 2 +- remote.h | 24 +-- replace-object.h | 4 +- resolve-undo.h | 14 +- run-command.h | 8 +- serve.h | 6 +- sha1-lookup.h | 8 +- streaming.h | 8 +- string-list.h | 4 +- sub-process.h | 8 +- submodule-config.h | 22 +-- tag.h | 16 +- tempfile.h | 30 +-- trace.h | 44 ++--- transport.h | 4 +- tree-walk.h | 4 +- upload-pack.h | 8 +- url.h | 16 +- urlmatch.h | 4 +- utf8.h | 2 +- varint.h | 4 +- vcs-svn/sliding_window.h | 2 +- vcs-svn/svndiff.h | 4 +- worktree.h | 36 ++-- xdiff-interface.h | 12 +- 71 files changed, 1139 insertions(+), 1139 deletions(-)Range-diff against v4:
1:6c27c8b17c! 1:200c556b7d*.[ch]: remove extern from function declarations using spatch
@@ -19,8 +19,8 @@and it was run with:
- $ git ls-files \*.{c,h} | \
- grep -v ^compat/ | \
+ $ git ls-files \*.{c,h} |
+ grep -v ^compat/ |
xargs spatch --sp-filecontrib/coccinelle/noextern.cocci--in-placeFiles under
compat/are intentionally excluded as some are directly
2:a996466d3b! 2:6fe5c773ea*.[ch]: remove extern from function declarations using sed
@@ -8,8 +8,8 @@This was done by running the following on my system with sed 4.2.2:
- $ git ls-files \*.{c,h} | \
- grep -v ^compat/ | \
+ $ git ls-files \*.{c,h} |
+ grep -v ^compat/ |
xargs sed -i'' -e 's/^\(\s*\)extern \([^(]*([^*]\)/\1\2/'Files under
compat/are intentionally excluded as some are directly3: 6c8489b26b = 3: 98c743b19d *.[ch]: manually align parameter lists 4: ec08af884c < -: ---------- cocci: prevent extern function declarationsSignature · 1 line
2.21.0.1033.g0e8cc1100c
Re: [PATCH v5 0/3] *** SUBJECT HERE ***
Quoted 3 lines · Denton Liu
Quoted 1 line
Subject: [PATCH v5 0/3] *** SUBJECT HERE ***
I forgot to change the subject... Embarassing.
Do you use git-send-email with --force? We should detect & stop these being sent out otherwise. See a03bc5b6ad ("send-email: Refuse to send cover-letter template subject", 2009-06-08).
Don't worry about the E-Mail itself, shit happens :) Just wondering if that detection case is buggy, or if you used --force, or maybe sent the E-Mails through another method than git-send-email...
Re: [PATCH v5 0/3] *** SUBJECT HERE ***
Quoted 7 lines · Ævar Arnfjörð Bjarmason
Quoted 3 lines · Denton Liu
Quoted 1 line
Subject: [PATCH v5 0/3] *** SUBJECT HERE ***
I forgot to change the subject... Embarassing.
Quoted 7 lines
Do you use git-send-email with --force? We should detect & stop these being sent out otherwise. See
a03bc5b6ad("send-email: Refuse to send cover-letter template subject", 2009-06-08).Don't worry about the E-Mail itself, shit happens :) Just wondering if that detection case is buggy, or if you used --force, or maybe sent the E-Mails through another method than git-send-email...
No, when I started doing work on Git, I couldn't get git-send-email to work and, since then, I've just used Mutt to send my patches. So the only bug is in my workflow ;)