Add G_GNUC_NULL_TERMINATED to ensure variable arglists are NULL
terminated (for GLib >= 2.8). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1475 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
3ffa0a2545
commit
6ebf6aa2f5
@ -5,6 +5,9 @@
|
||||
documents (should fix #1705374).
|
||||
* src/symbols.c:
|
||||
Sort symbol list tags also by line number (fixes #1703575).
|
||||
* src/utils.c, src/utils.h:
|
||||
Add G_GNUC_NULL_TERMINATED to ensure variable arglists are NULL
|
||||
terminated (for GLib >= 2.8).
|
||||
|
||||
|
||||
2007-04-21 Nick Treleaven <nick.treleaven@btinternet.com>
|
||||
|
||||
10
src/utils.c
10
src/utils.c
@ -1496,7 +1496,7 @@ gchar *utils_get_whitespace(gint a, gboolean alternative)
|
||||
}
|
||||
|
||||
|
||||
/* frees all passed pointers if they are non-NULL, the first argument is nothing special,
|
||||
/* Frees all passed pointers if they are non-NULL, the first argument is nothing special,
|
||||
* it will also be freed, the list should be ended with NULL */
|
||||
void utils_free_pointers(gpointer first, ...)
|
||||
{
|
||||
@ -1515,10 +1515,10 @@ void utils_free_pointers(gpointer first, ...)
|
||||
}
|
||||
|
||||
|
||||
/* creates a string array deep copy of a series of non-NULL strings.
|
||||
* the first argument is nothing special.
|
||||
* the list must be ended with NULL.
|
||||
* if first is NULL, NULL is returned. */
|
||||
/* Creates a string array deep copy of a series of non-NULL strings.
|
||||
* The first argument is nothing special.
|
||||
* The list must be ended with NULL.
|
||||
* If first is NULL, NULL is returned. */
|
||||
gchar **utils_strv_new(gchar *first, ...)
|
||||
{
|
||||
gsize strvlen, i;
|
||||
|
||||
21
src/utils.h
21
src/utils.h
@ -152,15 +152,20 @@ gchar *utils_get_utf8_from_locale(const gchar *locale_text);
|
||||
* If alternative is set to TRUE, it returns the opposite of app->pref_editor_use_tabs. */
|
||||
gchar *utils_get_whitespace(gint amount, gboolean alternative);
|
||||
|
||||
/* frees all passed pointers if they are non-NULL, the first argument is nothing special,
|
||||
* it will also be freed, the list should be ended with NULL */
|
||||
void utils_free_pointers(gpointer first, ...);
|
||||
|
||||
/* creates a string array deep copy of a series of non-NULL strings.
|
||||
* the first argument is nothing special.
|
||||
* the list must be ended with NULL.
|
||||
* if first is NULL, NULL is returned. */
|
||||
gchar **utils_strv_new(gchar *first, ...);
|
||||
#if ! GLIB_CHECK_VERSION(2, 8, 0)
|
||||
#define G_GNUC_NULL_TERMINATED
|
||||
#endif
|
||||
|
||||
/* Frees all passed pointers if they are non-NULL, the first argument is nothing special,
|
||||
* it will also be freed, the list should be ended with NULL */
|
||||
void utils_free_pointers(gpointer first, ...) G_GNUC_NULL_TERMINATED;
|
||||
|
||||
/* Creates a string array deep copy of a series of non-NULL strings.
|
||||
* The first argument is nothing special.
|
||||
* The list must be ended with NULL.
|
||||
* If first is NULL, NULL is returned. */
|
||||
gchar **utils_strv_new(gchar *first, ...) G_GNUC_NULL_TERMINATED;
|
||||
|
||||
gint utils_mkdir(const gchar *path, gboolean create_parent_dirs);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user