Fix 64-bit warnings
[babeltrace.git] / formats / ctf / metadata / ctf-visitor-xml.c
index 22829d9b47401ab1132cfcf0465fb113267bdce4..54b5feb84d552e0e70cfb4fa11e2884723a64a86 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 #include <assert.h>
-#include <helpers/list.h>
 #include <glib.h>
+#include <inttypes.h>
 #include <errno.h>
+#include <babeltrace/list.h>
 #include "ctf-scanner.h"
 #include "ctf-parser.h"
 #include "ctf-ast.h"
@@ -73,13 +74,13 @@ int ctf_visitor_print_unary_expression(FILE *fd, int depth, struct ctf_node *nod
        case UNARY_SIGNED_CONSTANT:
                print_tabs(fd, depth);
                fprintf(fd, "<unary_expression value=");
-               fprintf(fd, "%lld", node->u.unary_expression.u.signed_constant);
+               fprintf(fd, "%" PRId64, node->u.unary_expression.u.signed_constant);
                fprintf(fd, " />\n");
                break;
        case UNARY_UNSIGNED_CONSTANT:
                print_tabs(fd, depth);
                fprintf(fd, "<unary_expression value=");
-               fprintf(fd, "%llu", node->u.unary_expression.u.signed_constant);
+               fprintf(fd, "%" PRIu64, node->u.unary_expression.u.signed_constant);
                fprintf(fd, " />\n");
                break;
        case UNARY_SBRAC:
@@ -192,10 +193,12 @@ int ctf_visitor_print_type_declarator(FILE *fd, int depth, struct ctf_node *node
 
        switch (node->u.type_declarator.type) {
        case TYPEDEC_ID:
-               print_tabs(fd, depth);
-               fprintf(fd, "<id \"");
-               fprintf(fd, "%s", node->u.type_declarator.u.id);
-               fprintf(fd, "\" />\n");
+               if (node->u.type_declarator.u.id) {
+                       print_tabs(fd, depth);
+                       fprintf(fd, "<id \"");
+                       fprintf(fd, "%s", node->u.type_declarator.u.id);
+                       fprintf(fd, "\" />\n");
+               }
                break;
        case TYPEDEC_NESTED:
                if (node->u.type_declarator.u.nested.type_declarator) {
This page took 0.024455 seconds and 4 git commands to generate.