summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2004-09-17 10:19:19 +0000
committerJohan Dahlin <johan@src.gnome.org>2004-09-17 10:19:19 +0000
commitfc28e99b30b138d89834b3c0d5526e99aa138596 (patch)
treeb97b52a0fe4fff6477b7cc67d513c9b0f980fb18
parent4d0b801bf182e23da70ba04910b6cc688e6c62a3 (diff)
downloadpygobject-fc28e99b30b138d89834b3c0d5526e99aa138596.tar.gz
pygobject-fc28e99b30b138d89834b3c0d5526e99aa138596.tar.xz
pygobject-fc28e99b30b138d89834b3c0d5526e99aa138596.zip
Filter out 0 values
* gobject/pygflags.c: Filter out 0 values * Makefile.am: * docs/Makefile.am: Revert documentation changes
-rw-r--r--gobject/pygflags.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gobject/pygflags.c b/gobject/pygflags.c
index 13c7cab..d6388bb 100644
--- a/gobject/pygflags.c
+++ b/gobject/pygflags.c
@@ -58,7 +58,13 @@ generate_repr(GType gtype, int value)
g_assert(G_IS_FLAGS_CLASS(flags_class));
for (i = 0; i < flags_class->n_values; i++) {
- if ((value & flags_class->values[i].value) == flags_class->values[i].value) {
+ /* Some types (eg GstElementState in GStreamer 0.8) has flags with 0 values,
+ * we're just ignore them for now otherwise they'll always show up
+ */
+ if (flags_class->values[i].value == 0)
+ continue;
+
+ if ((value & flags_class->values[i].value) == flags_class->values[i].value) {
if (retval) {
tmp = g_strdup_printf("%s | %s", retval, flags_class->values[i].value_name);
g_free(retval);