Make the signedness warning useful with the field name
authorYannick Brosseau <yannick.brosseau@gmail.com>
Thu, 2 Aug 2012 21:53:33 +0000 (17:53 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 Aug 2012 21:53:33 +0000 (17:53 -0400)
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
types/integer.c

index af5cc39fe8d98d589eb1ed2c5a6c249b546d592e..39c9f5c95bca6ee5d7315d855f985ed85cf76af1 100644 (file)
@@ -173,7 +173,8 @@ uint64_t get_unsigned_int(const struct definition *field)
        if (!integer_declaration->signedness) {
                return integer_definition->value._unsigned;
        }
-       fprintf(stderr, "[warning] Extracting unsigned value in a signed int\n");
+       fprintf(stderr, "[warning] Extracting unsigned value in a signed int (%s)\n",
+               g_quark_to_string(field->name));
        return (uint64_t)integer_definition->value._signed;
 }
 
@@ -188,6 +189,7 @@ int64_t get_signed_int(const struct definition *field)
        if (integer_declaration->signedness) {
                return integer_definition->value._signed;
        }
-       fprintf(stderr, "[warning] Extracting signed value in an unsigned int\n");
+       fprintf(stderr, "[warning] Extracting signed value in an unsigned int (%s)\n", 
+               g_quark_to_string(field->name));
        return (int64_t)integer_definition->value._unsigned;
 }
This page took 0.033466 seconds and 4 git commands to generate.