#include <assert.h>
#include <glib.h>
#include <errno.h>
+#include <inttypes.h>
#include <babeltrace/list.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
{
int ret;
- ret = (int) g_hash_table_lookup(s->types, id);
+ ret = (int) (long) g_hash_table_lookup(s->types, id);
printf_dbg("lookup %p %s %d\n", s, id, ret);
return ret;
}
{
$$ = make_node(scanner, NODE_UNARY_EXPRESSION);
$$->u.unary_expression.type = UNARY_UNSIGNED_CONSTANT;
- sscanf(yylval.gs->s, "%llu",
+ sscanf(yylval.gs->s, "%" PRIu64,
&$$->u.unary_expression.u.unsigned_constant);
}
| OCTAL_CONSTANT
{
$$ = make_node(scanner, NODE_UNARY_EXPRESSION);
$$->u.unary_expression.type = UNARY_UNSIGNED_CONSTANT;
- sscanf(yylval.gs->s, "0%llo",
+ sscanf(yylval.gs->s, "0%" PRIo64,
&$$->u.unary_expression.u.unsigned_constant);
}
| HEXADECIMAL_CONSTANT
{
$$ = make_node(scanner, NODE_UNARY_EXPRESSION);
$$->u.unary_expression.type = UNARY_UNSIGNED_CONSTANT;
- sscanf(yylval.gs->s, "0x%llx",
+ sscanf(yylval.gs->s, "0x%" PRIx64,
&$$->u.unary_expression.u.unsigned_constant);
}
| STRING_LITERAL_START DQUOTE
{
$$ = make_node(scanner, NODE_UNARY_EXPRESSION);
$$->u.unary_expression.type = UNARY_UNSIGNED_CONSTANT;
- sscanf(yylval.gs->s, "%llu",
+ sscanf(yylval.gs->s, "%" PRIu64,
&$$->u.unary_expression.u.unsigned_constant);
}
| OCTAL_CONSTANT
{
$$ = make_node(scanner, NODE_UNARY_EXPRESSION);
$$->u.unary_expression.type = UNARY_UNSIGNED_CONSTANT;
- sscanf(yylval.gs->s, "0%llo",
+ sscanf(yylval.gs->s, "0%" PRIo64,
&$$->u.unary_expression.u.unsigned_constant);
}
| HEXADECIMAL_CONSTANT
{
$$ = make_node(scanner, NODE_UNARY_EXPRESSION);
$$->u.unary_expression.type = UNARY_UNSIGNED_CONSTANT;
- sscanf(yylval.gs->s, "0x%llx",
+ sscanf(yylval.gs->s, "0x%" PRIx64,
&$$->u.unary_expression.u.unsigned_constant);
}
;
#include <stdlib.h>
#include <assert.h>
#include <glib.h>
+#include <inttypes.h>
#include <errno.h>
#include <babeltrace/list.h>
#include "ctf-scanner.h"
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:
g_array_set_size(array, 1);
g_array_index(array, GQuark, array->len - 1) = q;
g_hash_table_insert(enum_class->table.value_to_quark_set,
- (gconstpointer) v, array);
+ (gpointer) v, array);
} else {
g_array_set_size(array, array->len + 1);
g_array_index(array, GQuark, array->len - 1) = q;
g_array_set_size(array, 1);
g_array_index(array, GQuark, array->len - 1) = q;
g_hash_table_insert(enum_class->table.value_to_quark_set,
- (gconstpointer) v, array);
+ (gpointer) v, array);
} else {
g_array_set_size(array, array->len + 1);
g_array_index(array, GQuark, array->len - 1) = q;