Merge branch 'jk/unused-post-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
This commit is contained in:
@ -724,7 +724,7 @@ static int run_update(struct add_i_state *s, const struct pathspec *ps,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void revert_from_diff(struct diff_queue_struct *q,
|
static void revert_from_diff(struct diff_queue_struct *q,
|
||||||
struct diff_options *opt, void *data)
|
struct diff_options *opt, void *data UNUSED)
|
||||||
{
|
{
|
||||||
int i, add_flags = ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE;
|
int i, add_flags = ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE;
|
||||||
|
|
||||||
|
4
apply.c
4
apply.c
@ -2913,7 +2913,7 @@ static int apply_one_fragment(struct apply_state *state,
|
|||||||
break;
|
break;
|
||||||
case ' ':
|
case ' ':
|
||||||
if (plen && (ws_rule & WS_BLANK_AT_EOF) &&
|
if (plen && (ws_rule & WS_BLANK_AT_EOF) &&
|
||||||
ws_blank_line(patch + 1, plen, ws_rule))
|
ws_blank_line(patch + 1, plen))
|
||||||
is_blank_context = 1;
|
is_blank_context = 1;
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
case '-':
|
case '-':
|
||||||
@ -2942,7 +2942,7 @@ static int apply_one_fragment(struct apply_state *state,
|
|||||||
(first == '+' ? 0 : LINE_COMMON));
|
(first == '+' ? 0 : LINE_COMMON));
|
||||||
if (first == '+' &&
|
if (first == '+' &&
|
||||||
(ws_rule & WS_BLANK_AT_EOF) &&
|
(ws_rule & WS_BLANK_AT_EOF) &&
|
||||||
ws_blank_line(patch + 1, plen, ws_rule))
|
ws_blank_line(patch + 1, plen))
|
||||||
added_blank_line = 1;
|
added_blank_line = 1;
|
||||||
break;
|
break;
|
||||||
case '@': case '\\':
|
case '@': case '\\':
|
||||||
|
3
blob.c
3
blob.c
@ -13,8 +13,7 @@ struct blob *lookup_blob(struct repository *r, const struct object_id *oid)
|
|||||||
return object_as_type(obj, OBJ_BLOB, 0);
|
return object_as_type(obj, OBJ_BLOB, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
|
void parse_blob_buffer(struct blob *item)
|
||||||
{
|
{
|
||||||
item->object.parsed = 1;
|
item->object.parsed = 1;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
3
blob.h
3
blob.h
@ -11,8 +11,6 @@ struct blob {
|
|||||||
|
|
||||||
struct blob *lookup_blob(struct repository *r, const struct object_id *oid);
|
struct blob *lookup_blob(struct repository *r, const struct object_id *oid);
|
||||||
|
|
||||||
int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Blobs do not contain references to other objects and do not have
|
* Blobs do not contain references to other objects and do not have
|
||||||
* structured data that needs parsing. However, code may use the
|
* 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);
|
|||||||
* parse_blob_buffer() is used (by object.c) to flag that the object
|
* parse_blob_buffer() is used (by object.c) to flag that the object
|
||||||
* has been read successfully from the database.
|
* has been read successfully from the database.
|
||||||
**/
|
**/
|
||||||
|
void parse_blob_buffer(struct blob *item);
|
||||||
|
|
||||||
#endif /* BLOB_H */
|
#endif /* BLOB_H */
|
||||||
|
@ -88,7 +88,7 @@ static int fix_unmerged_status(struct diff_filepair *p,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void update_callback(struct diff_queue_struct *q,
|
static void update_callback(struct diff_queue_struct *q,
|
||||||
struct diff_options *opt, void *cbdata)
|
struct diff_options *opt UNUSED, void *cbdata)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct update_callback_data *data = cbdata;
|
struct update_callback_data *data = cbdata;
|
||||||
|
@ -409,7 +409,7 @@ static const char *anonymize_oid(const char *oid_hex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void show_filemodify(struct diff_queue_struct *q,
|
static void show_filemodify(struct diff_queue_struct *q,
|
||||||
struct diff_options *options, void *data)
|
struct diff_options *options UNUSED, void *data)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct string_list *changed = data;
|
struct string_list *changed = data;
|
||||||
|
@ -99,7 +99,7 @@ static void *origin(struct merge_list *entry, unsigned long *size)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int show_outf(void *priv_, mmbuffer_t *mb, int nbuf)
|
static int show_outf(void *priv UNUSED, mmbuffer_t *mb, int nbuf)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < nbuf; i++)
|
for (i = 0; i < nbuf; i++)
|
||||||
|
@ -776,7 +776,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void count_diff_files(struct diff_queue_struct *q,
|
static void count_diff_files(struct diff_queue_struct *q,
|
||||||
struct diff_options *opt, void *data)
|
struct diff_options *opt UNUSED, void *data)
|
||||||
{
|
{
|
||||||
int *count = data;
|
int *count = data;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ static const char * const rerere_usage[] = {
|
|||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int outf(void *dummy, mmbuffer_t *ptr, int nbuf)
|
static int outf(void *dummy UNUSED, mmbuffer_t *ptr, int nbuf)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < nbuf; i++)
|
for (i = 0; i < nbuf; i++)
|
||||||
|
@ -133,7 +133,8 @@ static void print_new_head_line(struct commit *commit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void update_index_from_diff(struct diff_queue_struct *q,
|
static void update_index_from_diff(struct diff_queue_struct *q,
|
||||||
struct diff_options *opt, void *data)
|
struct diff_options *opt UNUSED,
|
||||||
|
void *data)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int intent_to_add = *(int *)data;
|
int intent_to_add = *(int *)data;
|
||||||
|
@ -1043,7 +1043,7 @@ static void prepare_submodule_summary(struct summary_cb *info,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void submodule_summary_callback(struct diff_queue_struct *q,
|
static void submodule_summary_callback(struct diff_queue_struct *q,
|
||||||
struct diff_options *options,
|
struct diff_options *options UNUSED,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
2
cache.h
2
cache.h
@ -1865,7 +1865,7 @@ unsigned ws_check(const char *line, int len, unsigned ws_rule);
|
|||||||
void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *stream, const char *set, const char *reset, const char *ws);
|
void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *stream, const char *set, const char *reset, const char *ws);
|
||||||
char *whitespace_error_string(unsigned ws);
|
char *whitespace_error_string(unsigned ws);
|
||||||
void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *);
|
void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *);
|
||||||
int ws_blank_line(const char *line, int len, unsigned ws_rule);
|
int ws_blank_line(const char *line, int len);
|
||||||
#define ws_tab_width(rule) ((rule) & WS_TAB_WIDTH_MASK)
|
#define ws_tab_width(rule) ((rule) & WS_TAB_WIDTH_MASK)
|
||||||
|
|
||||||
/* ls-files */
|
/* ls-files */
|
||||||
|
@ -372,7 +372,7 @@ struct combine_diff_state {
|
|||||||
static void consume_hunk(void *state_,
|
static void consume_hunk(void *state_,
|
||||||
long ob, long on,
|
long ob, long on,
|
||||||
long nb, long nn,
|
long nb, long nn,
|
||||||
const char *funcline, long funclen)
|
const char *func UNUSED, long funclen UNUSED)
|
||||||
{
|
{
|
||||||
struct combine_diff_state *state = state_;
|
struct combine_diff_state *state = state_;
|
||||||
|
|
||||||
|
@ -673,7 +673,7 @@ int index_differs_from(struct repository *r,
|
|||||||
return (has_changes != 0);
|
return (has_changes != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct strbuf *idiff_prefix_cb(struct diff_options *opt, void *data)
|
static struct strbuf *idiff_prefix_cb(struct diff_options *opt UNUSED, void *data)
|
||||||
{
|
{
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
18
diff.c
18
diff.c
@ -604,7 +604,7 @@ static unsigned long diff_filespec_size(struct repository *r,
|
|||||||
return one->size;
|
return one->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int count_trailing_blank(mmfile_t *mf, unsigned ws_rule)
|
static int count_trailing_blank(mmfile_t *mf)
|
||||||
{
|
{
|
||||||
char *ptr = mf->ptr;
|
char *ptr = mf->ptr;
|
||||||
long size = mf->size;
|
long size = mf->size;
|
||||||
@ -622,7 +622,7 @@ static int count_trailing_blank(mmfile_t *mf, unsigned ws_rule)
|
|||||||
for (prev_eol = ptr; mf->ptr <= prev_eol; prev_eol--)
|
for (prev_eol = ptr; mf->ptr <= prev_eol; prev_eol--)
|
||||||
if (*prev_eol == '\n')
|
if (*prev_eol == '\n')
|
||||||
break;
|
break;
|
||||||
if (!ws_blank_line(prev_eol + 1, ptr - prev_eol, ws_rule))
|
if (!ws_blank_line(prev_eol + 1, ptr - prev_eol))
|
||||||
break;
|
break;
|
||||||
cnt++;
|
cnt++;
|
||||||
ptr = prev_eol - 1;
|
ptr = prev_eol - 1;
|
||||||
@ -634,9 +634,8 @@ static void check_blank_at_eof(mmfile_t *mf1, mmfile_t *mf2,
|
|||||||
struct emit_callback *ecbdata)
|
struct emit_callback *ecbdata)
|
||||||
{
|
{
|
||||||
int l1, l2, at;
|
int l1, l2, at;
|
||||||
unsigned ws_rule = ecbdata->ws_rule;
|
l1 = count_trailing_blank(mf1);
|
||||||
l1 = count_trailing_blank(mf1, ws_rule);
|
l2 = count_trailing_blank(mf2);
|
||||||
l2 = count_trailing_blank(mf2, ws_rule);
|
|
||||||
if (l2 <= l1) {
|
if (l2 <= l1) {
|
||||||
ecbdata->blank_at_eof_in_preimage = 0;
|
ecbdata->blank_at_eof_in_preimage = 0;
|
||||||
ecbdata->blank_at_eof_in_postimage = 0;
|
ecbdata->blank_at_eof_in_postimage = 0;
|
||||||
@ -1583,7 +1582,7 @@ static int new_blank_line_at_eof(struct emit_callback *ecbdata, const char *line
|
|||||||
ecbdata->blank_at_eof_in_preimage <= ecbdata->lno_in_preimage &&
|
ecbdata->blank_at_eof_in_preimage <= ecbdata->lno_in_preimage &&
|
||||||
ecbdata->blank_at_eof_in_postimage <= ecbdata->lno_in_postimage))
|
ecbdata->blank_at_eof_in_postimage <= ecbdata->lno_in_postimage))
|
||||||
return 0;
|
return 0;
|
||||||
return ws_blank_line(line, len, ecbdata->ws_rule);
|
return ws_blank_line(line, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void emit_add_line(struct emit_callback *ecbdata,
|
static void emit_add_line(struct emit_callback *ecbdata,
|
||||||
@ -1955,7 +1954,7 @@ static int color_words_output_graph_prefix(struct diff_words_data *diff_words)
|
|||||||
static void fn_out_diff_words_aux(void *priv,
|
static void fn_out_diff_words_aux(void *priv,
|
||||||
long minus_first, long minus_len,
|
long minus_first, long minus_len,
|
||||||
long plus_first, long plus_len,
|
long plus_first, long plus_len,
|
||||||
const char *func, long funclen)
|
const char *func UNUSED, long funclen UNUSED)
|
||||||
{
|
{
|
||||||
struct diff_words_data *diff_words = priv;
|
struct diff_words_data *diff_words = priv;
|
||||||
struct diff_words_style *style = diff_words->style;
|
struct diff_words_style *style = diff_words->style;
|
||||||
@ -3185,8 +3184,9 @@ static int is_conflict_marker(const char *line, int marker_size, unsigned long l
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void checkdiff_consume_hunk(void *priv,
|
static void checkdiff_consume_hunk(void *priv,
|
||||||
long ob, long on, long nb, long nn,
|
long ob UNUSED, long on UNUSED,
|
||||||
const char *func, long funclen)
|
long nb, long nn UNUSED,
|
||||||
|
const char *func UNUSED, long funclen UNUSED)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct checkdiff_t *data = priv;
|
struct checkdiff_t *data = priv;
|
||||||
|
@ -70,13 +70,13 @@ struct filter {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static enum list_objects_filter_result filter_blobs_none(
|
static enum list_objects_filter_result filter_blobs_none(
|
||||||
struct repository *r,
|
struct repository *r UNUSED,
|
||||||
enum list_objects_filter_situation filter_situation,
|
enum list_objects_filter_situation filter_situation,
|
||||||
struct object *obj,
|
struct object *obj,
|
||||||
const char *pathname,
|
const char *pathname UNUSED,
|
||||||
const char *filename,
|
const char *filename UNUSED,
|
||||||
struct oidset *omits,
|
struct oidset *omits,
|
||||||
void *filter_data_)
|
void *filter_data_ UNUSED)
|
||||||
{
|
{
|
||||||
switch (filter_situation) {
|
switch (filter_situation) {
|
||||||
default:
|
default:
|
||||||
@ -112,7 +112,7 @@ static enum list_objects_filter_result filter_blobs_none(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void filter_blobs_none__init(
|
static void filter_blobs_none__init(
|
||||||
struct list_objects_filter_options *filter_options,
|
struct list_objects_filter_options *filter_options UNUSED,
|
||||||
struct filter *filter)
|
struct filter *filter)
|
||||||
{
|
{
|
||||||
filter->filter_object_fn = filter_blobs_none;
|
filter->filter_object_fn = filter_blobs_none;
|
||||||
@ -159,11 +159,11 @@ static int filter_trees_update_omits(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static enum list_objects_filter_result filter_trees_depth(
|
static enum list_objects_filter_result filter_trees_depth(
|
||||||
struct repository *r,
|
struct repository *r UNUSED,
|
||||||
enum list_objects_filter_situation filter_situation,
|
enum list_objects_filter_situation filter_situation,
|
||||||
struct object *obj,
|
struct object *obj,
|
||||||
const char *pathname,
|
const char *pathname UNUSED,
|
||||||
const char *filename,
|
const char *filename UNUSED,
|
||||||
struct oidset *omits,
|
struct oidset *omits,
|
||||||
void *filter_data_)
|
void *filter_data_)
|
||||||
{
|
{
|
||||||
@ -274,8 +274,8 @@ static enum list_objects_filter_result filter_blobs_limit(
|
|||||||
struct repository *r,
|
struct repository *r,
|
||||||
enum list_objects_filter_situation filter_situation,
|
enum list_objects_filter_situation filter_situation,
|
||||||
struct object *obj,
|
struct object *obj,
|
||||||
const char *pathname,
|
const char *pathname UNUSED,
|
||||||
const char *filename,
|
const char *filename UNUSED,
|
||||||
struct oidset *omits,
|
struct oidset *omits,
|
||||||
void *filter_data_)
|
void *filter_data_)
|
||||||
{
|
{
|
||||||
@ -555,12 +555,12 @@ struct filter_object_type_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static enum list_objects_filter_result filter_object_type(
|
static enum list_objects_filter_result filter_object_type(
|
||||||
struct repository *r,
|
struct repository *r UNUSED,
|
||||||
enum list_objects_filter_situation filter_situation,
|
enum list_objects_filter_situation filter_situation,
|
||||||
struct object *obj,
|
struct object *obj,
|
||||||
const char *pathname,
|
const char *pathname UNUSED,
|
||||||
const char *filename,
|
const char *filename UNUSED,
|
||||||
struct oidset *omits,
|
struct oidset *omits UNUSED,
|
||||||
void *filter_data_)
|
void *filter_data_)
|
||||||
{
|
{
|
||||||
struct filter_object_type_data *filter_data = filter_data_;
|
struct filter_object_type_data *filter_data = filter_data_;
|
||||||
@ -676,7 +676,7 @@ static enum list_objects_filter_result filter_combine(
|
|||||||
struct object *obj,
|
struct object *obj,
|
||||||
const char *pathname,
|
const char *pathname,
|
||||||
const char *filename,
|
const char *filename,
|
||||||
struct oidset *omits,
|
struct oidset *omits UNUSED,
|
||||||
void *filter_data)
|
void *filter_data)
|
||||||
{
|
{
|
||||||
struct combine_filter_data *d = filter_data;
|
struct combine_filter_data *d = filter_data;
|
||||||
|
@ -81,36 +81,6 @@ static void process_blob(struct traversal_context *ctx,
|
|||||||
strbuf_setlen(path, pathlen);
|
strbuf_setlen(path, pathlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Processing a gitlink entry currently does nothing, since
|
|
||||||
* we do not recurse into the subproject.
|
|
||||||
*
|
|
||||||
* We *could* eventually add a flag that actually does that,
|
|
||||||
* which would involve:
|
|
||||||
* - is the subproject actually checked out?
|
|
||||||
* - if so, see if the subproject has already been added
|
|
||||||
* to the alternates list, and add it if not.
|
|
||||||
* - process the commit (or tag) the gitlink points to
|
|
||||||
* recursively.
|
|
||||||
*
|
|
||||||
* However, it's unclear whether there is really ever any
|
|
||||||
* reason to see superprojects and subprojects as such a
|
|
||||||
* "unified" object pool (potentially resulting in a totally
|
|
||||||
* humongous pack - avoiding which was the whole point of
|
|
||||||
* having gitlinks in the first place!).
|
|
||||||
*
|
|
||||||
* So for now, there is just a note that we *could* follow
|
|
||||||
* the link, and how to do it. Whether it necessarily makes
|
|
||||||
* any sense what-so-ever to ever do that is another issue.
|
|
||||||
*/
|
|
||||||
static void process_gitlink(struct traversal_context *ctx,
|
|
||||||
const unsigned char *sha1,
|
|
||||||
struct strbuf *path,
|
|
||||||
const char *name)
|
|
||||||
{
|
|
||||||
/* Nothing to do */
|
|
||||||
}
|
|
||||||
|
|
||||||
static void process_tree(struct traversal_context *ctx,
|
static void process_tree(struct traversal_context *ctx,
|
||||||
struct tree *tree,
|
struct tree *tree,
|
||||||
struct strbuf *base,
|
struct strbuf *base,
|
||||||
@ -149,8 +119,7 @@ static void process_tree_contents(struct traversal_context *ctx,
|
|||||||
process_tree(ctx, t, base, entry.path);
|
process_tree(ctx, t, base, entry.path);
|
||||||
}
|
}
|
||||||
else if (S_ISGITLINK(entry.mode))
|
else if (S_ISGITLINK(entry.mode))
|
||||||
process_gitlink(ctx, entry.oid.hash,
|
; /* ignore gitlink */
|
||||||
base, entry.path);
|
|
||||||
else {
|
else {
|
||||||
struct blob *b = lookup_blob(ctx->revs->repo, &entry.oid);
|
struct blob *b = lookup_blob(ctx->revs->repo, &entry.oid);
|
||||||
if (!b) {
|
if (!b) {
|
||||||
|
@ -194,8 +194,9 @@ int ls_refs(struct repository *r, struct packet_reader *request)
|
|||||||
send_possibly_unborn_head(&data);
|
send_possibly_unborn_head(&data);
|
||||||
if (!data.prefixes.nr)
|
if (!data.prefixes.nr)
|
||||||
strvec_push(&data.prefixes, "");
|
strvec_push(&data.prefixes, "");
|
||||||
for_each_fullref_in_prefixes(get_git_namespace(), data.prefixes.v,
|
refs_for_each_fullref_in_prefixes(get_main_ref_store(r),
|
||||||
send_ref, &data);
|
get_git_namespace(), data.prefixes.v,
|
||||||
|
send_ref, &data);
|
||||||
packet_fflush(stdout);
|
packet_fflush(stdout);
|
||||||
strvec_clear(&data.prefixes);
|
strvec_clear(&data.prefixes);
|
||||||
strbuf_release(&data.buf);
|
strbuf_release(&data.buf);
|
||||||
|
5
object.c
5
object.c
@ -212,8 +212,7 @@ struct object *parse_object_buffer(struct repository *r, const struct object_id
|
|||||||
if (type == OBJ_BLOB) {
|
if (type == OBJ_BLOB) {
|
||||||
struct blob *blob = lookup_blob(r, oid);
|
struct blob *blob = lookup_blob(r, oid);
|
||||||
if (blob) {
|
if (blob) {
|
||||||
if (parse_blob_buffer(blob, buffer, size))
|
parse_blob_buffer(blob);
|
||||||
return NULL;
|
|
||||||
obj = &blob->object;
|
obj = &blob->object;
|
||||||
}
|
}
|
||||||
} else if (type == OBJ_TREE) {
|
} else if (type == OBJ_TREE) {
|
||||||
@ -292,7 +291,7 @@ struct object *parse_object_with_flags(struct repository *r,
|
|||||||
error(_("hash mismatch %s"), oid_to_hex(oid));
|
error(_("hash mismatch %s"), oid_to_hex(oid));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
parse_blob_buffer(lookup_blob(r, oid), NULL, 0);
|
parse_blob_buffer(lookup_blob(r, oid));
|
||||||
return lookup_object(r, oid);
|
return lookup_object(r, oid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
range-diff.c
12
range-diff.c
@ -269,14 +269,18 @@ static void find_exact_matches(struct string_list *a, struct string_list *b)
|
|||||||
hashmap_clear(&map);
|
hashmap_clear(&map);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int diffsize_consume(void *data, char *line, unsigned long len)
|
static int diffsize_consume(void *data,
|
||||||
|
char *line UNUSED,
|
||||||
|
unsigned long len UNUSED)
|
||||||
{
|
{
|
||||||
(*(int *)data)++;
|
(*(int *)data)++;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void diffsize_hunk(void *data, long ob, long on, long nb, long nn,
|
static void diffsize_hunk(void *data,
|
||||||
const char *funcline, long funclen)
|
long ob UNUSED, long on UNUSED,
|
||||||
|
long nb UNUSED, long nn UNUSED,
|
||||||
|
const char *func UNUSED, long funclen UNUSED)
|
||||||
{
|
{
|
||||||
diffsize_consume(data, NULL, 0);
|
diffsize_consume(data, NULL, 0);
|
||||||
}
|
}
|
||||||
@ -461,7 +465,7 @@ static void patch_diff(const char *a, const char *b,
|
|||||||
diff_flush(diffopt);
|
diff_flush(diffopt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct strbuf *output_prefix_cb(struct diff_options *opt, void *data)
|
static struct strbuf *output_prefix_cb(struct diff_options *opt UNUSED, void *data)
|
||||||
{
|
{
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -2129,8 +2129,9 @@ static int for_each_fullref_in_pattern(struct ref_filter *filter,
|
|||||||
return for_each_fullref_in("", cb, cb_data);
|
return for_each_fullref_in("", cb, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return for_each_fullref_in_prefixes(NULL, filter->name_patterns,
|
return refs_for_each_fullref_in_prefixes(get_main_ref_store(the_repository),
|
||||||
cb, cb_data);
|
NULL, filter->name_patterns,
|
||||||
|
cb, cb_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
9
refs.c
9
refs.c
@ -1723,9 +1723,10 @@ static void find_longest_prefixes(struct string_list *out,
|
|||||||
strbuf_release(&prefix);
|
strbuf_release(&prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
int for_each_fullref_in_prefixes(const char *namespace,
|
int refs_for_each_fullref_in_prefixes(struct ref_store *ref_store,
|
||||||
const char **patterns,
|
const char *namespace,
|
||||||
each_ref_fn fn, void *cb_data)
|
const char **patterns,
|
||||||
|
each_ref_fn fn, void *cb_data)
|
||||||
{
|
{
|
||||||
struct string_list prefixes = STRING_LIST_INIT_DUP;
|
struct string_list prefixes = STRING_LIST_INIT_DUP;
|
||||||
struct string_list_item *prefix;
|
struct string_list_item *prefix;
|
||||||
@ -1740,7 +1741,7 @@ int for_each_fullref_in_prefixes(const char *namespace,
|
|||||||
|
|
||||||
for_each_string_list_item(prefix, &prefixes) {
|
for_each_string_list_item(prefix, &prefixes) {
|
||||||
strbuf_addstr(&buf, prefix->string);
|
strbuf_addstr(&buf, prefix->string);
|
||||||
ret = for_each_fullref_in(buf.buf, fn, cb_data);
|
ret = refs_for_each_fullref_in(ref_store, buf.buf, fn, cb_data);
|
||||||
if (ret)
|
if (ret)
|
||||||
break;
|
break;
|
||||||
strbuf_setlen(&buf, namespace_len);
|
strbuf_setlen(&buf, namespace_len);
|
||||||
|
6
refs.h
6
refs.h
@ -354,8 +354,10 @@ int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data);
|
|||||||
*
|
*
|
||||||
* callers should be prepared to ignore references that they did not ask for.
|
* callers should be prepared to ignore references that they did not ask for.
|
||||||
*/
|
*/
|
||||||
int for_each_fullref_in_prefixes(const char *namespace, const char **patterns,
|
int refs_for_each_fullref_in_prefixes(struct ref_store *refs,
|
||||||
each_ref_fn fn, void *cb_data);
|
const char *namespace, const char **patterns,
|
||||||
|
each_ref_fn fn, void *cb_data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iterate refs from the respective area.
|
* iterate refs from the respective area.
|
||||||
*/
|
*/
|
||||||
|
25
revision.c
25
revision.c
@ -600,10 +600,12 @@ static struct commit *one_relevant_parent(const struct rev_info *revs,
|
|||||||
static int tree_difference = REV_TREE_SAME;
|
static int tree_difference = REV_TREE_SAME;
|
||||||
|
|
||||||
static void file_add_remove(struct diff_options *options,
|
static void file_add_remove(struct diff_options *options,
|
||||||
int addremove, unsigned mode,
|
int addremove,
|
||||||
const struct object_id *oid,
|
unsigned mode UNUSED,
|
||||||
int oid_valid,
|
const struct object_id *oid UNUSED,
|
||||||
const char *fullpath, unsigned dirty_submodule)
|
int oid_valid UNUSED,
|
||||||
|
const char *fullpath UNUSED,
|
||||||
|
unsigned dirty_submodule UNUSED)
|
||||||
{
|
{
|
||||||
int diff = addremove == '+' ? REV_TREE_NEW : REV_TREE_OLD;
|
int diff = addremove == '+' ? REV_TREE_NEW : REV_TREE_OLD;
|
||||||
struct rev_info *revs = options->change_fn_data;
|
struct rev_info *revs = options->change_fn_data;
|
||||||
@ -614,12 +616,15 @@ static void file_add_remove(struct diff_options *options,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void file_change(struct diff_options *options,
|
static void file_change(struct diff_options *options,
|
||||||
unsigned old_mode, unsigned new_mode,
|
unsigned old_mode UNUSED,
|
||||||
const struct object_id *old_oid,
|
unsigned new_mode UNUSED,
|
||||||
const struct object_id *new_oid,
|
const struct object_id *old_oid UNUSED,
|
||||||
int old_oid_valid, int new_oid_valid,
|
const struct object_id *new_oid UNUSED,
|
||||||
const char *fullpath,
|
int old_oid_valid UNUSED,
|
||||||
unsigned old_dirty_submodule, unsigned new_dirty_submodule)
|
int new_oid_valid UNUSED,
|
||||||
|
const char *fullpath UNUSED,
|
||||||
|
unsigned old_dirty_submodule UNUSED,
|
||||||
|
unsigned new_dirty_submodule UNUSED)
|
||||||
{
|
{
|
||||||
tree_difference = REV_TREE_DIFFERENT;
|
tree_difference = REV_TREE_DIFFERENT;
|
||||||
options->flags.has_changes = 1;
|
options->flags.has_changes = 1;
|
||||||
|
@ -832,7 +832,7 @@ static void changed_submodule_data_clear(struct changed_submodule_data *cs_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void collect_changed_submodules_cb(struct diff_queue_struct *q,
|
static void collect_changed_submodules_cb(struct diff_queue_struct *q,
|
||||||
struct diff_options *options,
|
struct diff_options *options UNUSED,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
struct collect_changed_submodules_cb_data *me = data;
|
struct collect_changed_submodules_cb_data *me = data;
|
||||||
|
@ -315,7 +315,8 @@ struct find_by_namelen_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int userdiff_find_by_namelen_cb(struct userdiff_driver *driver,
|
static int userdiff_find_by_namelen_cb(struct userdiff_driver *driver,
|
||||||
enum userdiff_driver_type type, void *priv)
|
enum userdiff_driver_type type UNUSED,
|
||||||
|
void *priv)
|
||||||
{
|
{
|
||||||
struct find_by_namelen_data *cb_data = priv;
|
struct find_by_namelen_data *cb_data = priv;
|
||||||
|
|
||||||
|
2
ws.c
2
ws.c
@ -252,7 +252,7 @@ unsigned ws_check(const char *line, int len, unsigned ws_rule)
|
|||||||
return ws_check_emit_1(line, len, ws_rule, NULL, NULL, NULL, NULL);
|
return ws_check_emit_1(line, len, ws_rule, NULL, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ws_blank_line(const char *line, int len, unsigned ws_rule)
|
int ws_blank_line(const char *line, int len)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* We _might_ want to treat CR differently from other
|
* We _might_ want to treat CR differently from other
|
||||||
|
@ -440,7 +440,7 @@ static char short_submodule_status(struct wt_status_change_data *d)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void wt_status_collect_changed_cb(struct diff_queue_struct *q,
|
static void wt_status_collect_changed_cb(struct diff_queue_struct *q,
|
||||||
struct diff_options *options,
|
struct diff_options *options UNUSED,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
struct wt_status *s = data;
|
struct wt_status *s = data;
|
||||||
@ -527,7 +527,7 @@ static int unmerged_mask(struct index_state *istate, const char *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void wt_status_collect_updated_cb(struct diff_queue_struct *q,
|
static void wt_status_collect_updated_cb(struct diff_queue_struct *q,
|
||||||
struct diff_options *options,
|
struct diff_options *options UNUSED,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
struct wt_status *s = data;
|
struct wt_status *s = data;
|
||||||
|
@ -973,7 +973,7 @@ void xdl_free_script(xdchange_t *xscr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int xdl_call_hunk_func(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
|
static int xdl_call_hunk_func(xdfenv_t *xe UNUSED, xdchange_t *xscr, xdemitcb_t *ecb,
|
||||||
xdemitconf_t const *xecfg)
|
xdemitconf_t const *xecfg)
|
||||||
{
|
{
|
||||||
xdchange_t *xch, *xche;
|
xdchange_t *xch, *xche;
|
||||||
|
@ -95,7 +95,7 @@ xdchange_t *xdl_get_hunk(xdchange_t **xscr, xdemitconf_t const *xecfg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static long def_ff(const char *rec, long len, char *buf, long sz, void *priv)
|
static long def_ff(const char *rec, long len, char *buf, long sz)
|
||||||
{
|
{
|
||||||
if (len > 0 &&
|
if (len > 0 &&
|
||||||
(isalpha((unsigned char)*rec) || /* identifier? */
|
(isalpha((unsigned char)*rec) || /* identifier? */
|
||||||
@ -117,7 +117,7 @@ static long match_func_rec(xdfile_t *xdf, xdemitconf_t const *xecfg, long ri,
|
|||||||
const char *rec;
|
const char *rec;
|
||||||
long len = xdl_get_rec(xdf, ri, &rec);
|
long len = xdl_get_rec(xdf, ri, &rec);
|
||||||
if (!xecfg->find_func)
|
if (!xecfg->find_func)
|
||||||
return def_ff(rec, len, buf, sz, xecfg->find_func_priv);
|
return def_ff(rec, len, buf, sz);
|
||||||
return xecfg->find_func(rec, len, buf, sz, xecfg->find_func_priv);
|
return xecfg->find_func(rec, len, buf, sz, xecfg->find_func_priv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user