git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/6] string_list: Fix argument order for print_string_list

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Apr 6, 2010, 01:11 UTC
Message-ID
<20100406011139.71279.53152.julian@quantumfyre.co.uk>
In-Reply-To
<20100406011106.71279.92681.julian@quantumfyre.co.uk>

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

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
---
 string-list.c |    2 +-
 string-list.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/string-list.c b/string-list.c
index c9ad7fc..b7e57a4 100644
--- a/string-list.c
+++ b/string-list.c
@@ -139,7 +139,7 @@ void string_list_clear_func(struct string_list *list, string_list_clear_func_t c
 }
 
 
-void print_string_list(const char *text, const struct string_list *p)
+void print_string_list(const struct string_list *p, const char *text)
 {
 	int i;
 	if ( text )
diff --git a/string-list.h b/string-list.h
index 63b69c8..de29dcd 100644
--- a/string-list.h
+++ b/string-list.h
@@ -12,7 +12,7 @@ struct string_list
 	unsigned int strdup_strings:1;
 };
 
-void print_string_list(const char *text, const struct string_list *p);
+void print_string_list(const struct string_list *p, const char *text);
 void string_list_clear(struct string_list *list, int free_util);
 
 /* Use this function to call a custom clear function on each util pointer */
-- 
1.7.0.2
Previous: Julian PhillipsNext: Julian Phillips
Message 2 of 7 in “Make the string_list API consistent”
  1. 0/6 Make the string_list API consistentJulian Phillips, Apr 6, 2010
  2. 1/6 string_list: Fix argument order for print_string_listJulian Phillips, Apr 6, 2010
  3. 2/6 string_list: Fix argument order for for_each_string_listJulian Phillips, Apr 6, 2010
  4. 3/6 string_list: Fix argument order for string_list_insertJulian Phillips, Apr 6, 2010
  5. 4/6 string_list: Fix argument order for string_list_insert_at_indexJulian Phillips, Apr 6, 2010
  6. 5/6 string_list: Fix argument order for string_list_lookupJulian Phillips, Apr 6, 2010
  7. 6/6 string_list: Fix argument order for string_list_appendJulian Phillips, Apr 6, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.