SF.net SVN: geany: [1475] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Mon Apr 23 15:52:45 UTC 2007


Revision: 1475
          http://svn.sourceforge.net/geany/?rev=1475&view=rev
Author:   ntrel
Date:     2007-04-23 08:52:44 -0700 (Mon, 23 Apr 2007)

Log Message:
-----------
Add G_GNUC_NULL_TERMINATED to ensure variable arglists are NULL
terminated (for GLib >= 2.8).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/utils.c
    trunk/src/utils.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-04-23 15:15:13 UTC (rev 1474)
+++ trunk/ChangeLog	2007-04-23 15:52:44 UTC (rev 1475)
@@ -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 at btinternet.com>

Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c	2007-04-23 15:15:13 UTC (rev 1474)
+++ trunk/src/utils.c	2007-04-23 15:52:44 UTC (rev 1475)
@@ -1496,7 +1496,7 @@
 }
 
 
-/* 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 @@
 }
 
 
-/* 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;

Modified: trunk/src/utils.h
===================================================================
--- trunk/src/utils.h	2007-04-23 15:15:13 UTC (rev 1474)
+++ trunk/src/utils.h	2007-04-23 15:52:44 UTC (rev 1475)
@@ -152,15 +152,20 @@
  * 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,
+
+#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, ...);
+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, ...);
+/* 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);
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list