Use parentheses around an argument to make these cause an error if you
authorDan Winship <danw@src.gnome.org>
Tue, 2 Jan 2001 20:52:05 +0000 (20:52 +0000)
committerDan Winship <danw@src.gnome.org>
Tue, 2 Jan 2001 20:52:05 +0000 (20:52 +0000)
* garray.h (g_array_append_val, g_array_prepend_val,
g_array_insert_val): Use parentheses around an argument to make
these cause an error if you pass a non-lvalue for the value,
rather than silently doing the wrong thing.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
garray.h
glib/garray.h

index 582d21d..0fb9444 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-01-02  Dan Winship  <danw@helixcode.com>
+
+       * garray.h (g_array_append_val, g_array_prepend_val,
+       g_array_insert_val): Use parentheses around an argument to make
+       these cause an error if you pass a non-lvalue for the value,
+       rather than silently doing the wrong thing.
+
 2000-12-29  Tor Lillqvist  <tml@iki.fi>
 
        * glibconfig.h.win32.in: Add GLIB_SIZEOF_VOID_P and GLIB_SIZEOF_LONG.
index 582d21d..0fb9444 100644 (file)
@@ -1,3 +1,10 @@
+2001-01-02  Dan Winship  <danw@helixcode.com>
+
+       * garray.h (g_array_append_val, g_array_prepend_val,
+       g_array_insert_val): Use parentheses around an argument to make
+       these cause an error if you pass a non-lvalue for the value,
+       rather than silently doing the wrong thing.
+
 2000-12-29  Tor Lillqvist  <tml@iki.fi>
 
        * glibconfig.h.win32.in: Add GLIB_SIZEOF_VOID_P and GLIB_SIZEOF_LONG.
index 582d21d..0fb9444 100644 (file)
@@ -1,3 +1,10 @@
+2001-01-02  Dan Winship  <danw@helixcode.com>
+
+       * garray.h (g_array_append_val, g_array_prepend_val,
+       g_array_insert_val): Use parentheses around an argument to make
+       these cause an error if you pass a non-lvalue for the value,
+       rather than silently doing the wrong thing.
+
 2000-12-29  Tor Lillqvist  <tml@iki.fi>
 
        * glibconfig.h.win32.in: Add GLIB_SIZEOF_VOID_P and GLIB_SIZEOF_LONG.
index 582d21d..0fb9444 100644 (file)
@@ -1,3 +1,10 @@
+2001-01-02  Dan Winship  <danw@helixcode.com>
+
+       * garray.h (g_array_append_val, g_array_prepend_val,
+       g_array_insert_val): Use parentheses around an argument to make
+       these cause an error if you pass a non-lvalue for the value,
+       rather than silently doing the wrong thing.
+
 2000-12-29  Tor Lillqvist  <tml@iki.fi>
 
        * glibconfig.h.win32.in: Add GLIB_SIZEOF_VOID_P and GLIB_SIZEOF_LONG.
index 582d21d..0fb9444 100644 (file)
@@ -1,3 +1,10 @@
+2001-01-02  Dan Winship  <danw@helixcode.com>
+
+       * garray.h (g_array_append_val, g_array_prepend_val,
+       g_array_insert_val): Use parentheses around an argument to make
+       these cause an error if you pass a non-lvalue for the value,
+       rather than silently doing the wrong thing.
+
 2000-12-29  Tor Lillqvist  <tml@iki.fi>
 
        * glibconfig.h.win32.in: Add GLIB_SIZEOF_VOID_P and GLIB_SIZEOF_LONG.
index 582d21d..0fb9444 100644 (file)
@@ -1,3 +1,10 @@
+2001-01-02  Dan Winship  <danw@helixcode.com>
+
+       * garray.h (g_array_append_val, g_array_prepend_val,
+       g_array_insert_val): Use parentheses around an argument to make
+       these cause an error if you pass a non-lvalue for the value,
+       rather than silently doing the wrong thing.
+
 2000-12-29  Tor Lillqvist  <tml@iki.fi>
 
        * glibconfig.h.win32.in: Add GLIB_SIZEOF_VOID_P and GLIB_SIZEOF_LONG.
index 582d21d..0fb9444 100644 (file)
@@ -1,3 +1,10 @@
+2001-01-02  Dan Winship  <danw@helixcode.com>
+
+       * garray.h (g_array_append_val, g_array_prepend_val,
+       g_array_insert_val): Use parentheses around an argument to make
+       these cause an error if you pass a non-lvalue for the value,
+       rather than silently doing the wrong thing.
+
 2000-12-29  Tor Lillqvist  <tml@iki.fi>
 
        * glibconfig.h.win32.in: Add GLIB_SIZEOF_VOID_P and GLIB_SIZEOF_LONG.
index 582d21d..0fb9444 100644 (file)
@@ -1,3 +1,10 @@
+2001-01-02  Dan Winship  <danw@helixcode.com>
+
+       * garray.h (g_array_append_val, g_array_prepend_val,
+       g_array_insert_val): Use parentheses around an argument to make
+       these cause an error if you pass a non-lvalue for the value,
+       rather than silently doing the wrong thing.
+
 2000-12-29  Tor Lillqvist  <tml@iki.fi>
 
        * glibconfig.h.win32.in: Add GLIB_SIZEOF_VOID_P and GLIB_SIZEOF_LONG.
index 4359c88..ddade36 100644 (file)
--- a/garray.h
+++ b/garray.h
@@ -58,9 +58,9 @@ struct _GPtrArray
  * order by moving the last element to the position of the removed 
  */
 
-#define g_array_append_val(a,v)          g_array_append_vals (a, &v, 1)
-#define g_array_prepend_val(a,v)  g_array_prepend_vals (a, &v, 1)
-#define g_array_insert_val(a,i,v) g_array_insert_vals (a, i, &v, 1)
+#define g_array_append_val(a,v)          g_array_append_vals (a, &(v), 1)
+#define g_array_prepend_val(a,v)  g_array_prepend_vals (a, &(v), 1)
+#define g_array_insert_val(a,i,v) g_array_insert_vals (a, i, &(v), 1)
 #define g_array_index(a,t,i)      (((t*) (a)->data) [(i)])
 
 GArray* g_array_new               (gboolean          zero_terminated,
index 4359c88..ddade36 100644 (file)
@@ -58,9 +58,9 @@ struct _GPtrArray
  * order by moving the last element to the position of the removed 
  */
 
-#define g_array_append_val(a,v)          g_array_append_vals (a, &v, 1)
-#define g_array_prepend_val(a,v)  g_array_prepend_vals (a, &v, 1)
-#define g_array_insert_val(a,i,v) g_array_insert_vals (a, i, &v, 1)
+#define g_array_append_val(a,v)          g_array_append_vals (a, &(v), 1)
+#define g_array_prepend_val(a,v)  g_array_prepend_vals (a, &(v), 1)
+#define g_array_insert_val(a,i,v) g_array_insert_vals (a, i, &(v), 1)
 #define g_array_index(a,t,i)      (((t*) (a)->data) [(i)])
 
 GArray* g_array_new               (gboolean          zero_terminated,