commit ef20f542049f5928fa256eb470801089d0b1048b from: Omar Polo via: Thomas Adam date: Sun Jun 26 18:06:59 2022 UTC build with -Wmissing-prototypes ok stsp@ commit - ef0b17aa7b1ff2b4dd0c2ee7b2e28eb5cd3b47c8 commit + ef20f542049f5928fa256eb470801089d0b1048b blob - 328c4a1e1795d88a1e53519b52ad67b9e682f85a blob + ef99224d337170364b2e5458bf6e2a3206c3e05a --- Makefile.inc +++ Makefile.inc @@ -10,7 +10,8 @@ BINDIR ?= ${PREFIX}/bin LIBEXECDIR ?= ${PREFIX}/libexec MANDIR ?= ${PREFIX}/man/man .else -CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable +CFLAGS += -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes +CFLAGS += -Wunused-variable PREFIX ?= ${HOME} BINDIR ?= ${PREFIX}/bin LIBEXECDIR ?= ${BINDIR} blob - 60476351c5599bd9549cccf48000ca54c8e8964e blob + 64e9211906bb2f24ea99ab4711625da3df5aa9cb --- got/got.c +++ got/got.c @@ -404,7 +404,7 @@ usage_import(void) exit(1); } -int +static int spawn_editor(const char *editor, const char *file) { pid_t pid; @@ -3117,7 +3117,7 @@ struct got_update_progress_arg { int verbosity; }; -void +static void print_update_progress_stats(struct got_update_progress_arg *upa) { if (!upa->did_something) @@ -3140,7 +3140,7 @@ print_update_progress_stats(struct got_update_progress * if the work tree was updated. This function should be used by any operation * which merges changes into the work tree without updating the work tree. */ -void +static void print_merge_progress_stats(struct got_update_progress_arg *upa) { if (!upa->did_something) @@ -9153,7 +9153,7 @@ usage_rebase(void) exit(1); } -void +static void trim_logmsg(char *logmsg, int limit) { char *nl; @@ -10696,7 +10696,7 @@ done: return err; } -void +static void histedit_free_list(struct got_histedit_list *histedit_cmds) { struct got_histedit_list_entry *hle; blob - dac1eae40679c47137747bc4f1d9aa0f054e8f59 blob + 9ae9b6d5b2c163cd71dd4d6c284eeb75e027fb1a --- gotweb/parse.y +++ gotweb/parse.y @@ -70,6 +70,7 @@ struct sym { }; int symset(const char *, const char *, int); +int cmdline_symset(char *); char *symget(const char *); const struct got_error* gerror = NULL; blob - 899aa6d794f3ba3c31ebdd4cacb8b17edd059d9f blob + a4c18d064bd644c6fd5c1a0b49fb88bcdb340def --- lib/dial.c +++ lib/dial.c @@ -32,6 +32,7 @@ #include "got_compat.h" #include "got_lib_dial.h" +#include "got_dial.h" #ifndef nitems #define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) blob - 11768b2c060a299839ae3a716d85f9324d6ce579 blob + e84f689c1bd00b38b2adcb0b972599dba7eec582 --- lib/diff_main.c +++ lib/diff_main.c @@ -351,7 +351,7 @@ diff_state_add_chunk(struct diff_state *state, bool so return diff_state_add_solved_chunk(state, &chunk); } -void +static void diff_data_init_root(struct diff_data *d, FILE *f, const uint8_t *data, unsigned long long len, int diff_flags) { @@ -502,7 +502,7 @@ diff_algo_none(const struct diff_algo_config *algo_con return DIFF_RC_OK; } -int +static int diff_run_algo(const struct diff_algo_config *algo_config, struct diff_state *state) { blob - abcbc8d0355b6f45e427bb4374f6b94fc5c3d7f4 blob + a06df2c36c9d8cb203803661ff563e969a584e88 --- lib/diff_patience.c +++ lib/diff_patience.c @@ -186,7 +186,7 @@ diff_atoms_mark_unique_in_both(struct diff_data *left, /* Use an optimized sorting algorithm (qsort, mergesort) to find unique lines */ -int diff_atoms_compar(const void *_a, const void *_b) +static int diff_atoms_compar(const void *_a, const void *_b) { const struct diff_atom *a = *(struct diff_atom**)_a; const struct diff_atom *b = *(struct diff_atom**)_b; blob - bbbf920360215773ac2f4f979efd72d2e5f2d742 blob + efa4991b9e207e7ed8f7a422e5c83f5cd79b69b4 --- lib/fileindex.c +++ lib/fileindex.c @@ -977,7 +977,7 @@ read_dirlist(struct got_pathlist_head *dirlist, DIR *d return err; } -void +static void free_dirlist(struct got_pathlist_head *dirlist) { struct got_pathlist_entry *dle; blob - f284020602937db76c3bdc3f41457af32264ac4f blob + 162adf613a914f48646e2c282878578a1c726c19 --- lib/gotconfig.c +++ lib/gotconfig.c @@ -37,6 +37,8 @@ #include "got_lib_privsep.h" #include "got_lib_gotconfig.h" +#include "got_gotconfig.h" + const struct got_error * got_gotconfig_read(struct got_gotconfig **conf, const char *gotconfig_path) { blob - d611821e6302999ac110d3b018fd2187899c7436 blob + b4a0b763969633b6075afe7960a4a01da96d421e --- lib/object.c +++ lib/object.c @@ -1068,7 +1068,7 @@ request_tree(struct got_tree_object **tree, struct got return got_privsep_recv_tree(tree, ibuf); } -const struct got_error * +static const struct got_error * read_tree_privsep(struct got_tree_object **tree, int obj_fd, struct got_object_id *id, struct got_repository *repo) { blob - 6eec96582b7d29118c2f757bdb1e828656a52cca blob + 90121b5eb76e85d855091c03ad5c7b2e3b37054e --- lib/object_cache.c +++ lib/object_cache.c @@ -81,7 +81,7 @@ got_object_cache_init(struct got_object_cache *cache, return NULL; } -size_t +static size_t get_size_obj(struct got_object *obj) { size_t size = sizeof(*obj); @@ -99,7 +99,7 @@ get_size_obj(struct got_object *obj) return size; } -size_t +static size_t get_size_tree(struct got_tree_object *tree) { size_t size = sizeof(*tree); @@ -108,7 +108,7 @@ get_size_tree(struct got_tree_object *tree) return size; } -size_t +static size_t get_size_commit(struct got_commit_object *commit) { size_t size = sizeof(*commit); @@ -125,7 +125,7 @@ get_size_commit(struct got_commit_object *commit) return size; } -size_t +static size_t get_size_tag(struct got_tag_object *tag) { size_t size = sizeof(*tag); @@ -137,7 +137,7 @@ get_size_tag(struct got_tag_object *tag) return size; } -size_t +static size_t get_size_raw(struct got_raw_object *raw) { return sizeof(*raw); blob - 4065f5b1391cd57bc92ee6e07e70920e57f016ef blob + 87e3158a38d75521cf4c032fb893550039a3683e --- lib/object_create.c +++ lib/object_create.c @@ -42,6 +42,8 @@ #include "got_lib_object.h" #include "got_lib_object_parse.h" #include "got_lib_lockfile.h" + +#include "got_lib_object_create.h" #ifndef nitems #define nitems(_a) (sizeof(_a) / sizeof((_a)[0])) blob - b772646b72dad6b735412e58c407030184994838 blob + 8ebcec37cc5884e4fd3f5f0986dee830277e39c8 --- lib/pack_create.c +++ lib/pack_create.c @@ -1783,7 +1783,7 @@ done: return err; } -const struct got_error * +static const struct got_error * hwrite(FILE *f, void *buf, off_t len, SHA1_CTX *ctx) { size_t n; @@ -1795,7 +1795,7 @@ hwrite(FILE *f, void *buf, off_t len, SHA1_CTX *ctx) return NULL; } -const struct got_error * +static const struct got_error * hcopy(FILE *fsrc, FILE *fdst, off_t len, SHA1_CTX *ctx) { unsigned char buf[65536]; @@ -1817,7 +1817,7 @@ hcopy(FILE *fsrc, FILE *fdst, off_t len, SHA1_CTX *ctx return NULL; } -const struct got_error * +static const struct got_error * hcopy_mmap(uint8_t *src, off_t src_offset, size_t src_size, FILE *fdst, off_t len, SHA1_CTX *ctx) { blob - d1f32d25f13065c1f79bf94d00db6212ad460558 blob + eee49ec5ceec50d6d9ca6892a0641f9ae82608ff --- lib/path.c +++ lib/path.c @@ -146,12 +146,6 @@ got_path_is_root_dir(const char *path) while (*path == '/') path++; return (*path == '\0'); -} - -int -got_path_is_current_dir(const char *path) -{ - return (path[0] == '.' && path[1] == '\0'); } int blob - b9ef91ba3083180edcfef203a56a0a06f4273b2b blob + a845118f6e6f64c5061dd5eef11341341e9ad2ff --- lib/pkt.c +++ lib/pkt.c @@ -23,6 +23,7 @@ #include #include "got_error.h" +#include "got_lib_pkt.h" const struct got_error * got_pkt_readn(ssize_t *off, int fd, void *buf, size_t n) blob - 4e1d32e818775cf3bc4998760888e27f4370487f blob + 6798aec8479802608cc62a91e461e5b113c80e33 --- lib/privsep.c +++ lib/privsep.c @@ -46,6 +46,8 @@ #include "got_lib_object_parse.h" #include "got_lib_privsep.h" #include "got_lib_pack.h" + +#include "got_privsep.h" #ifndef MIN #define MIN(_a,_b) ((_a) < (_b) ? (_a) : (_b)) blob - 1ead68d8ef23d037e71df862ec8e81b3b66610b0 blob + 9e8ef346fc31e5275d6c78d54e556c1c8941f531 --- lib/worktree.c +++ lib/worktree.c @@ -3347,7 +3347,7 @@ status_old(void *arg, struct got_fileindex_entry *ie, ie->path, &blob_id, NULL, &commit_id, -1, NULL); } -void +static void free_ignorelist(struct got_pathlist_head *ignorelist) { struct got_pathlist_entry *pe; @@ -3357,7 +3357,7 @@ free_ignorelist(struct got_pathlist_head *ignorelist) got_pathlist_free(ignorelist); } -void +static void free_ignores(struct got_pathlist_head *ignores) { struct got_pathlist_entry *pe; @@ -3426,7 +3426,7 @@ done: return err; } -int +static int match_ignores(struct got_pathlist_head *ignores, const char *path) { struct got_pathlist_entry *pe; @@ -5593,7 +5593,7 @@ done: return err; } -const struct got_error * +static const struct got_error * commit_worktree(struct got_object_id **new_commit_id, struct got_pathlist_head *commitable_paths, struct got_object_id *head_commit_id, @@ -6634,7 +6634,7 @@ done: return err; } -const struct got_error * +static const struct got_error * create_backup_ref(const char *backup_ref_prefix, struct got_reference *branch, struct got_object_id *new_commit_id, struct got_repository *repo) { @@ -7915,7 +7915,7 @@ struct check_stage_ok_arg { int have_changes; }; -const struct got_error * +static const struct got_error * check_stage_ok(void *arg, unsigned char status, unsigned char staged_status, const char *relpath, struct got_object_id *blob_id, struct got_object_id *staged_blob_id, blob - 756c326f7d619cfaaa0c5825f8b254e67e6ad4b7 blob + 5030c3f38d4701f0b3d9f9ae5870ffda6d0826b1 --- libexec/got-read-gotconfig/parse.y +++ libexec/got-read-gotconfig/parse.y @@ -74,6 +74,7 @@ struct sym { }; int symset(const char *, const char *, int); +int cmdline_symset(char *); char *symget(const char *); static int atoul(char *, u_long *); blob - 62e7bd4abb455803dad6f0701238c9271478d349 blob + d67081715f628dd92add8cfb5bb5cf950f5dcf87 --- regress/fetch/fetch_test.c +++ regress/fetch/fetch_test.c @@ -43,7 +43,7 @@ static int verbose; static int quiet; -void +static void test_printf(char *fmt, ...) { va_list ap; @@ -246,7 +246,7 @@ fetch_parse_uri(void) if (!quiet) printf("test_%s %s\n", (name), test_ok ? "ok" : "failed"); \ failure = (failure || !test_ok); } -void +static void usage(void) { fprintf(stderr, "usage: fetch_test [-v] [-q]\n"); blob - 429beb1d097c7200262558eb58712cbbc04591b4 blob + 0bed4066576cbb226b23d43fc5c6d18a1e16a9e9 --- regress/idset/idset_test.c +++ regress/idset/idset_test.c @@ -36,19 +36,6 @@ static int verbose; static int quiet; -void -test_printf(char *fmt, ...) -{ - va_list ap; - - if (!verbose) - return; - - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); -} - static const char *id_str1 = "1111111111111111111111111111111111111111"; static const char *id_str2 = "2222222222222222222222222222222222222222"; static const char *id_str3 = "ffffffffffffffffffffffffffffffffffffffff"; @@ -171,7 +158,7 @@ done: if (!quiet) printf("test_%s %s\n", (name), test_ok ? "ok" : "failed"); \ failure = (failure || !test_ok); } -void +static void usage(void) { fprintf(stderr, "usage: id_test [-v] [-q]\n"); blob - 425a9edc3c68e6b156add5769aa1cc51cde35345 blob + f1e809c24d6f539ddb632ad6655346337a07215d --- regress/path/path_test.c +++ regress/path/path_test.c @@ -32,7 +32,7 @@ static int verbose; static int quiet; -void +static void test_printf(char *fmt, ...) { va_list ap; @@ -210,7 +210,7 @@ path_list_reverse_input(void) if (!quiet) printf("test_%s %s\n", (name), test_ok ? "ok" : "failed"); \ failure = (failure || !test_ok); } -void +static void usage(void) { fprintf(stderr, "usage: path_test [-v] [-q]\n"); blob - 2b9004eea994cbc9766982dc6b84bdf43d145ed1 blob + 727754759324b49fe4b4ef652fc8680080c64745 --- tog/tog.c +++ tog/tog.c @@ -231,7 +231,7 @@ free_colors(struct tog_colors *colors) } } -struct tog_color * +static struct tog_color * get_color(struct tog_colors *colors, int colorpair) { struct tog_color *tc = NULL; @@ -1076,7 +1076,7 @@ view_input(struct tog_view **new, int *done, struct to return err; } -void +static void view_vborder(struct tog_view *view) { PANEL *panel; @@ -1094,7 +1094,7 @@ view_vborder(struct tog_view *view) got_locale_is_utf8() ? ACS_VLINE : '|', view->nlines); } -int +static int view_needs_focus_indication(struct tog_view *view) { if (view_is_parent_view(view)) { @@ -3187,7 +3187,7 @@ match_line(const char *line, regex_t *regex, size_t nm return regexec(regex, line, nmatch, regmatch, 0) == 0; } -struct tog_color * +static struct tog_color * match_color(struct tog_colors *colors, const char *line) { struct tog_color *tc = NULL; @@ -6416,7 +6416,7 @@ ref_view_load_refs(struct tog_ref_view_state *s) return NULL; } -void +static void ref_view_free_refs(struct tog_ref_view_state *s) { struct tog_reflist_entry *re;