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

Commit

Permalink
Use parentheses around an argument to make these cause an error if you
Browse files Browse the repository at this point in the history
	* 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.
  • Loading branch information
Dan Winship committed Jan 2, 2001
1 parent 1f3cae7 commit 41b0cbc
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 6 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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>

* gmain.c (g_main_add_poll_unlocked): Initial fd->revents
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.pre-2-0
Original file line number Diff line number Diff line change
@@ -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>

* gmain.c (g_main_add_poll_unlocked): Initial fd->revents
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.pre-2-10
Original file line number Diff line number Diff line change
@@ -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>

* gmain.c (g_main_add_poll_unlocked): Initial fd->revents
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.pre-2-12
Original file line number Diff line number Diff line change
@@ -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>

* gmain.c (g_main_add_poll_unlocked): Initial fd->revents
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.pre-2-2
Original file line number Diff line number Diff line change
@@ -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>

* gmain.c (g_main_add_poll_unlocked): Initial fd->revents
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.pre-2-4
Original file line number Diff line number Diff line change
@@ -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>

* gmain.c (g_main_add_poll_unlocked): Initial fd->revents
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.pre-2-6
Original file line number Diff line number Diff line change
@@ -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>

* gmain.c (g_main_add_poll_unlocked): Initial fd->revents
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.pre-2-8
Original file line number Diff line number Diff line change
@@ -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>

* gmain.c (g_main_add_poll_unlocked): Initial fd->revents
Expand Down
6 changes: 3 additions & 3 deletions glib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1677,9 +1677,9 @@ void g_string_sprintfa (GString *string,
* 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,
Expand Down
6 changes: 3 additions & 3 deletions glib/glib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1677,9 +1677,9 @@ void g_string_sprintfa (GString *string,
* 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,
Expand Down

0 comments on commit 41b0cbc

Please sign in to comment.