[aravis] genicam: fix typo in EnumEntry Value attribute.



commit c0352f48996dc5ccf41b67c40d41d3c564100c04
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Wed Apr 7 09:58:23 2010 +0200

    genicam: fix typo in EnumEntry Value attribute.

 src/arvgcenumentry.c   |    2 +-
 src/arvgcenumeration.c |   16 +++++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/arvgcenumentry.c b/src/arvgcenumentry.c
index af7338a..c92d2e8 100644
--- a/src/arvgcenumentry.c
+++ b/src/arvgcenumentry.c
@@ -33,7 +33,7 @@ arv_gc_enum_entry_add_element (ArvGcNode *node, const char *name, const char *co
 {
 	ArvGcEnumEntry *gc_enum_entry = ARV_GC_ENUM_ENTRY (node);
 
-	if (strcmp (name, "value") == 0) {
+	if (strcmp (name, "Value") == 0) {
 		gc_enum_entry->value = g_ascii_strtoll (content, NULL, 0);
 	} else
 		ARV_GC_NODE_CLASS (parent_class)->add_element (node, name, content, attributes);
diff --git a/src/arvgcenumeration.c b/src/arvgcenumeration.c
index 8970719..22b67e0 100644
--- a/src/arvgcenumeration.c
+++ b/src/arvgcenumeration.c
@@ -24,6 +24,7 @@
 #include <arvgcenumentry.h>
 #include <arvgc.h>
 #include <arvtools.h>
+#include <arvdebug.h>
 #include <string.h>
 
 static GObjectClass *parent_class = NULL;
@@ -66,9 +67,18 @@ arv_gc_enumeration_get_string_value (ArvGcEnumeration *enumeration)
 	value = arv_gc_get_int64_from_value (arv_gc_node_get_genicam (ARV_GC_NODE (enumeration)),
 								      &enumeration->value);
 
-	for (iter = arv_gc_node_get_childs (ARV_GC_NODE (enumeration)); iter != NULL; iter = iter->next)
-		if (arv_gc_enum_entry_get_value (iter->data) == value)
-			return arv_gc_node_get_name (iter->data);
+	for (iter = arv_gc_node_get_childs (ARV_GC_NODE (enumeration)); iter != NULL; iter = iter->next) {
+		if (arv_gc_enum_entry_get_value (iter->data) == value) {
+			const char *string;
+
+			string = arv_gc_node_get_name (iter->data);
+			arv_debug ("genicam", "[GcEnumeration::get_string_value] value = %Ld - string = %s",
+				   value, string);
+			return string;
+		}
+	}
+
+	arv_debug ("genicam", "[GcEnumeration::get_string_value] value = %Ld not found", value);
 
 	return NULL;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]