string_list: Fix argument order for string_list_insert

Update the definition and callers of string_list_insert to use the
string_list as the first argument.  This helps make the string_list
API easier to use by being more consistent.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Julian Phillips
2010-06-26 00:41:35 +01:00
committed by Junio C Hamano
parent b684e97736
commit 78a395d371
19 changed files with 40 additions and 40 deletions

View File

@ -232,7 +232,7 @@ static void wt_status_collect_changed_cb(struct diff_queue_struct *q,
struct wt_status_change_data *d;
p = q->queue[i];
it = string_list_insert(p->one->path, &s->change);
it = string_list_insert(&s->change, p->one->path);
d = it->util;
if (!d) {
d = xcalloc(1, sizeof(*d));
@ -279,7 +279,7 @@ static void wt_status_collect_updated_cb(struct diff_queue_struct *q,
struct wt_status_change_data *d;
p = q->queue[i];
it = string_list_insert(p->two->path, &s->change);
it = string_list_insert(&s->change, p->two->path);
d = it->util;
if (!d) {
d = xcalloc(1, sizeof(*d));
@ -346,7 +346,7 @@ static void wt_status_collect_changes_initial(struct wt_status *s)
if (!ce_path_match(ce, s->pathspec))
continue;
it = string_list_insert(ce->name, &s->change);
it = string_list_insert(&s->change, ce->name);
d = it->util;
if (!d) {
d = xcalloc(1, sizeof(*d));
@ -381,7 +381,7 @@ static void wt_status_collect_untracked(struct wt_status *s)
continue;
if (!match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL))
continue;
string_list_insert(ent->name, &s->untracked);
string_list_insert(&s->untracked, ent->name);
free(ent);
}
@ -395,7 +395,7 @@ static void wt_status_collect_untracked(struct wt_status *s)
continue;
if (!match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL))
continue;
string_list_insert(ent->name, &s->ignored);
string_list_insert(&s->ignored, ent->name);
free(ent);
}
}