[gobject-introspection] Fix checks in gfield.c
- From: Owen Taylor <otaylor src gnome org>
- To: svn-commits-list gnome org
- Subject: [gobject-introspection] Fix checks in gfield.c
- Date: Thu, 9 Jul 2009 10:10:36 +0000 (UTC)
commit 578717e32c3c15fb2e99068e0ef9ee90171fd8ba
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Tue Apr 21 10:57:50 2009 -0400
Fix checks in gfield.c
When checking if the readable/writable flags are missing for the fields
we are trying to read and write, use (a & flag) == 0, not (!a & flag).
http://bugzilla.gnome.org/show_bug.cgi?id=579727
girepository/gfield.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/girepository/gfield.c b/girepository/gfield.c
index 2fa9822..94c2fb5 100644
--- a/girepository/gfield.c
+++ b/girepository/gfield.c
@@ -25,7 +25,7 @@ g_field_info_get_field (GIFieldInfo *field_info,
GITypeInfo *type_info;
gboolean result = FALSE;
- if (!g_field_info_get_flags (field_info) & GI_FIELD_IS_READABLE)
+ if ((g_field_info_get_flags (field_info) & GI_FIELD_IS_READABLE) == 0)
return FALSE;
offset = g_field_info_get_offset (field_info);
@@ -219,7 +219,7 @@ g_field_info_get_field (GIFieldInfo *field_info,
* to write fields where memory management would by required. A field
* with a type such as 'char *' must be set with a setter function.
*
- * Returns: %TRUE if reading the field succeeded, otherwise %FALSE
+ * Returns: %TRUE if writing the field succeeded, otherwise %FALSE
*/
gboolean
g_field_info_set_field (GIFieldInfo *field_info,
@@ -230,7 +230,7 @@ g_field_info_set_field (GIFieldInfo *field_info,
GITypeInfo *type_info;
gboolean result = FALSE;
- if (!g_field_info_get_flags (field_info) & GI_FIELD_IS_WRITABLE)
+ if ((g_field_info_get_flags (field_info) & GI_FIELD_IS_WRITABLE) == 0)
return FALSE;
offset = g_field_info_get_offset (field_info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]