Skip to content

Commit 8d404d0

Browse files
committed
Merge branch 'jk/unused-post-2.39' into maint-2.39
Code clean-up around unused function parameters. * jk/unused-post-2.39: userdiff: mark unused parameter in internal callback list-objects-filter: mark unused parameters in virtual functions diff: mark unused parameters in callbacks xdiff: mark unused parameter in xdl_call_hunk_func() xdiff: drop unused parameter in def_ff() ws: drop unused parameter from ws_blank_line() list-objects: drop process_gitlink() function blob: drop unused parts of parse_blob_buffer() ls-refs: use repository parameter to iterate refs
2 parents 2f80d1b + c25d9e5 commit 8d404d0

30 files changed

+90
-108
lines changed

add-interactive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ static int run_update(struct add_i_state *s, const struct pathspec *ps,
724724
}
725725

726726
static void revert_from_diff(struct diff_queue_struct *q,
727-
struct diff_options *opt, void *data)
727+
struct diff_options *opt, void *data UNUSED)
728728
{
729729
int i, add_flags = ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE;
730730

apply.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,7 +2913,7 @@ static int apply_one_fragment(struct apply_state *state,
29132913
break;
29142914
case ' ':
29152915
if (plen && (ws_rule & WS_BLANK_AT_EOF) &&
2916-
ws_blank_line(patch + 1, plen, ws_rule))
2916+
ws_blank_line(patch + 1, plen))
29172917
is_blank_context = 1;
29182918
/* fallthrough */
29192919
case '-':
@@ -2942,7 +2942,7 @@ static int apply_one_fragment(struct apply_state *state,
29422942
(first == '+' ? 0 : LINE_COMMON));
29432943
if (first == '+' &&
29442944
(ws_rule & WS_BLANK_AT_EOF) &&
2945-
ws_blank_line(patch + 1, plen, ws_rule))
2945+
ws_blank_line(patch + 1, plen))
29462946
added_blank_line = 1;
29472947
break;
29482948
case '@': case '\\':

blob.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ struct blob *lookup_blob(struct repository *r, const struct object_id *oid)
1313
return object_as_type(obj, OBJ_BLOB, 0);
1414
}
1515

16-
int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
16+
void parse_blob_buffer(struct blob *item)
1717
{
1818
item->object.parsed = 1;
19-
return 0;
2019
}

blob.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ struct blob {
1111

1212
struct blob *lookup_blob(struct repository *r, const struct object_id *oid);
1313

14-
int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size);
15-
1614
/**
1715
* Blobs do not contain references to other objects and do not have
1816
* structured data that needs parsing. However, code may use the
@@ -21,5 +19,6 @@ int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size);
2119
* parse_blob_buffer() is used (by object.c) to flag that the object
2220
* has been read successfully from the database.
2321
**/
22+
void parse_blob_buffer(struct blob *item);
2423

2524
#endif /* BLOB_H */

builtin/add.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static int fix_unmerged_status(struct diff_filepair *p,
8888
}
8989

9090
static void update_callback(struct diff_queue_struct *q,
91-
struct diff_options *opt, void *cbdata)
91+
struct diff_options *opt UNUSED, void *cbdata)
9292
{
9393
int i;
9494
struct update_callback_data *data = cbdata;

builtin/fast-export.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ static const char *anonymize_oid(const char *oid_hex)
409409
}
410410

411411
static void show_filemodify(struct diff_queue_struct *q,
412-
struct diff_options *options, void *data)
412+
struct diff_options *options UNUSED, void *data)
413413
{
414414
int i;
415415
struct string_list *changed = data;

builtin/merge-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static void *origin(struct merge_list *entry, unsigned long *size)
9898
return NULL;
9999
}
100100

101-
static int show_outf(void *priv_, mmbuffer_t *mb, int nbuf)
101+
static int show_outf(void *priv UNUSED, mmbuffer_t *mb, int nbuf)
102102
{
103103
int i;
104104
for (i = 0; i < nbuf; i++)

builtin/merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
776776
}
777777

778778
static void count_diff_files(struct diff_queue_struct *q,
779-
struct diff_options *opt, void *data)
779+
struct diff_options *opt UNUSED, void *data)
780780
{
781781
int *count = data;
782782

builtin/rerere.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static const char * const rerere_usage[] = {
1414
NULL,
1515
};
1616

17-
static int outf(void *dummy, mmbuffer_t *ptr, int nbuf)
17+
static int outf(void *dummy UNUSED, mmbuffer_t *ptr, int nbuf)
1818
{
1919
int i;
2020
for (i = 0; i < nbuf; i++)

builtin/reset.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ static void print_new_head_line(struct commit *commit)
133133
}
134134

135135
static void update_index_from_diff(struct diff_queue_struct *q,
136-
struct diff_options *opt, void *data)
136+
struct diff_options *opt UNUSED,
137+
void *data)
137138
{
138139
int i;
139140
int intent_to_add = *(int *)data;

0 commit comments

Comments
 (0)