Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Take a va_list*, not a va_list, to avoid compiler warnings about
Browse files Browse the repository at this point in the history
2005-08-10  Matthias Clasen  <mclasen@redhat.com>

	* glib/gfileutils.c (g_build_path_va, g_build_pathname_va):
	Take a va_list*, not a va_list, to avoid compiler warnings
	about uninitialized variables.
  • Loading branch information
Matthias Clasen authored and Matthias Clasen committed Aug 10, 2005
1 parent 320711e commit 833abd5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 13 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,3 +1,9 @@
2005-08-10 Matthias Clasen <mclasen@redhat.com>

* glib/gfileutils.c (g_build_path_va, g_build_pathname_va):
Take a va_list*, not a va_list, to avoid compiler warnings
about uninitialized variables.

2005-08-09 Matthias Clasen <mclasen@redhat.com>

* tests/gobject/Makefile.am (test_programs): Add it here.
Expand Down
6 changes: 6 additions & 0 deletions ChangeLog.pre-2-10
@@ -1,3 +1,9 @@
2005-08-10 Matthias Clasen <mclasen@redhat.com>

* glib/gfileutils.c (g_build_path_va, g_build_pathname_va):
Take a va_list*, not a va_list, to avoid compiler warnings
about uninitialized variables.

2005-08-09 Matthias Clasen <mclasen@redhat.com>

* tests/gobject/Makefile.am (test_programs): Add it here.
Expand Down
6 changes: 6 additions & 0 deletions ChangeLog.pre-2-12
@@ -1,3 +1,9 @@
2005-08-10 Matthias Clasen <mclasen@redhat.com>

* glib/gfileutils.c (g_build_path_va, g_build_pathname_va):
Take a va_list*, not a va_list, to avoid compiler warnings
about uninitialized variables.

2005-08-09 Matthias Clasen <mclasen@redhat.com>

* tests/gobject/Makefile.am (test_programs): Add it here.
Expand Down
6 changes: 6 additions & 0 deletions ChangeLog.pre-2-8
@@ -1,3 +1,9 @@
2005-08-10 Matthias Clasen <mclasen@redhat.com>

* glib/gfileutils.c (g_build_path_va, g_build_pathname_va):
Take a va_list*, not a va_list, to avoid compiler warnings
about uninitialized variables.

2005-08-09 Matthias Clasen <mclasen@redhat.com>

* tests/gobject/Makefile.am (test_programs): Add it here.
Expand Down
23 changes: 10 additions & 13 deletions glib/gfileutils.c
Expand Up @@ -1572,7 +1572,7 @@ g_file_open_tmp (const gchar *tmpl,
static gchar *
g_build_path_va (const gchar *separator,
const gchar *first_element,
va_list args,
va_list *args,
gchar **str_array)
{
GString *result;
Expand Down Expand Up @@ -1603,7 +1603,7 @@ g_build_path_va (const gchar *separator,
if (str_array)
next_element = str_array[i++];
else
next_element = va_arg (args, gchar *);
next_element = va_arg (*args, gchar *);
}
else
break;
Expand Down Expand Up @@ -1690,12 +1690,10 @@ gchar *
g_build_pathv (const gchar *separator,
gchar **args)
{
va_list va_args;

if (!args)
return NULL;

return g_build_path_va (separator, NULL, va_args, args);
return g_build_path_va (separator, NULL, NULL, args);
}


Expand Down Expand Up @@ -1746,7 +1744,7 @@ g_build_path (const gchar *separator,
g_return_val_if_fail (separator != NULL, NULL);

va_start (args, first_element);
str = g_build_path_va (separator, first_element, args, NULL);
str = g_build_path_va (separator, first_element, &args, NULL);
va_end (args);

return str;
Expand All @@ -1756,7 +1754,7 @@ g_build_path (const gchar *separator,

static gchar *
g_build_pathname_va (const gchar *first_element,
va_list args,
va_list *args,
gchar **str_array)
{
/* Code copied from g_build_pathv(), and modified to use two
Expand Down Expand Up @@ -1790,7 +1788,7 @@ g_build_pathname_va (const gchar *first_element,
if (str_array)
next_element = str_array[i++];
else
next_element = va_arg (args, gchar *);
next_element = va_arg (*args, gchar *);
}
else
break;
Expand Down Expand Up @@ -1884,12 +1882,11 @@ gchar *
g_build_filenamev (gchar **args)
{
gchar *str;
va_list va_args;

#ifndef G_OS_WIN32
str = g_build_path_va (G_DIR_SEPARATOR_S, NULL, va_args, args);
str = g_build_path_va (G_DIR_SEPARATOR_S, NULL, NULL, args);
#else
str = g_build_pathname_va (NULL, va_args, args);
str = g_build_pathname_va (NULL, NULL, args);
#endif

return str;
Expand Down Expand Up @@ -1928,9 +1925,9 @@ g_build_filename (const gchar *first_element,

va_start (args, first_element);
#ifndef G_OS_WIN32
str = g_build_path_va (G_DIR_SEPARATOR_S, first_element, args, NULL);
str = g_build_path_va (G_DIR_SEPARATOR_S, first_element, &args, NULL);
#else
str = g_build_pathname_va (first_element, args, NULL);
str = g_build_pathname_va (first_element, &args, NULL);
#endif
va_end (args);

Expand Down

0 comments on commit 833abd5

Please sign in to comment.