Use parentheses around an argument to make these cause an error if you

* 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.
This commit is contained in:
Dan Winship 2001-01-02 21:02:08 +00:00
parent 1f3cae7e26
commit 41b0cbc3c0
10 changed files with 62 additions and 6 deletions

View 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.
Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com> Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_add_poll_unlocked): Initial fd->revents * gmain.c (g_main_add_poll_unlocked): Initial fd->revents

View 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.
Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com> Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_add_poll_unlocked): Initial fd->revents * gmain.c (g_main_add_poll_unlocked): Initial fd->revents

View 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.
Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com> Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_add_poll_unlocked): Initial fd->revents * gmain.c (g_main_add_poll_unlocked): Initial fd->revents

View 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.
Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com> Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_add_poll_unlocked): Initial fd->revents * gmain.c (g_main_add_poll_unlocked): Initial fd->revents

View 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.
Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com> Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_add_poll_unlocked): Initial fd->revents * gmain.c (g_main_add_poll_unlocked): Initial fd->revents

View 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.
Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com> Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_add_poll_unlocked): Initial fd->revents * gmain.c (g_main_add_poll_unlocked): Initial fd->revents

View 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.
Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com> Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_add_poll_unlocked): Initial fd->revents * gmain.c (g_main_add_poll_unlocked): Initial fd->revents

View 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.
Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com> Sat Dec 2 09:24:35 2000 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_add_poll_unlocked): Initial fd->revents * gmain.c (g_main_add_poll_unlocked): Initial fd->revents

6
glib.h
View File

@ -1677,9 +1677,9 @@ void g_string_sprintfa (GString *string,
* order by moving the last element to the position of the removed * 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_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_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_insert_val(a,i,v) g_array_insert_vals (a, i, &(v), 1)
#define g_array_index(a,t,i) (((t*) (a)->data) [(i)]) #define g_array_index(a,t,i) (((t*) (a)->data) [(i)])
GArray* g_array_new (gboolean zero_terminated, GArray* g_array_new (gboolean zero_terminated,

View File

@ -1677,9 +1677,9 @@ void g_string_sprintfa (GString *string,
* order by moving the last element to the position of the removed * 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_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_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_insert_val(a,i,v) g_array_insert_vals (a, i, &(v), 1)
#define g_array_index(a,t,i) (((t*) (a)->data) [(i)]) #define g_array_index(a,t,i) (((t*) (a)->data) [(i)])
GArray* g_array_new (gboolean zero_terminated, GArray* g_array_new (gboolean zero_terminated,