summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 78a395d)
raw | patch | inline | side by side (parent: 78a395d)
author | Julian Phillips <julian@quantumfyre.co.uk> | |
Fri, 25 Jun 2010 23:41:36 +0000 (00:41 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 27 Jun 2010 17:06:51 +0000 (10:06 -0700) |
Update the definition and callers of string_list_insert_at_index 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>
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>
mailmap.c | patch | blob | history | |
string-list.c | patch | blob | history | |
string-list.h | patch | blob | history |
diff --git a/mailmap.c b/mailmap.c
index badf6a4dad909e2cd462ee08682f98334b6102e8..8b6dc36bbc54bf8c4606ad9ecf03b8cdcc8f9dac 100644 (file)
--- a/mailmap.c
+++ b/mailmap.c
index = -1 - index;
} else {
/* create mailmap entry */
- struct string_list_item *item = string_list_insert_at_index(index, old_email, map);
+ struct string_list_item *item = string_list_insert_at_index(map, index, old_email);
item->util = xmalloc(sizeof(struct mailmap_entry));
memset(item->util, 0, sizeof(struct mailmap_entry));
((struct mailmap_entry *)item->util)->namemap.strdup_strings = 1;
diff --git a/string-list.c b/string-list.c
index de89efd2d88fcdcbe7e1b52c800c451dd95890e4..84444c2c19e623ac7bf825ea331918b6db9e9666 100644 (file)
--- a/string-list.c
+++ b/string-list.c
@@ -53,11 +53,11 @@ static int add_entry(int insert_at, struct string_list *list, const char *string
struct string_list_item *string_list_insert(struct string_list *list, const char *string)
{
- return string_list_insert_at_index(-1, string, list);
+ return string_list_insert_at_index(list, -1, string);
}
-struct string_list_item *string_list_insert_at_index(int insert_at,
- const char *string, struct string_list *list)
+struct string_list_item *string_list_insert_at_index(struct string_list *list,
+ int insert_at, const char *string)
{
int index = add_entry(insert_at, list, string);
diff --git a/string-list.h b/string-list.h
index 3d5a8de4b5a4977900268f29ccc92a09bd98c6b3..a4e1919ada3c2ac95765bc0e952b1328a18e53d1 100644 (file)
--- a/string-list.h
+++ b/string-list.h
int string_list_find_insert_index(const struct string_list *list, const char *string,
int negative_existing_index);
struct string_list_item *string_list_insert(struct string_list *list, const char *string);
-struct string_list_item *string_list_insert_at_index(int insert_at,
- const char *string, struct string_list *list);
+struct string_list_item *string_list_insert_at_index(struct string_list *list,
+ int insert_at, const char *string);
struct string_list_item *string_list_lookup(const char *string, struct string_list *list);
/* Use these functions only on unsorted lists: */