From 0eb6d8317cdbdb28663ff779d31684b3c7a47274 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 27 Jun 2014 23:21:10 +0200 Subject: [PATCH] Table: Default format string for 64-bit numbers was wrong --- ucw/table.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ucw/table.h b/ucw/table.h index 06da5481..e99961c1 100644 --- a/ucw/table.h +++ b/ucw/table.h @@ -7,6 +7,8 @@ #ifndef _UCW_TABLE_H #define _UCW_TABLE_H +#include + #include #include @@ -158,9 +160,9 @@ struct table { #define TBL_COL_STR(_name, _width) { .name = _name, .width = _width, .fmt = "%s", .type = COL_TYPE_STR } #define TBL_COL_INT(_name, _width) { .name = _name, .width = _width, .fmt = "%d", .type = COL_TYPE_INT } -#define TBL_COL_S64(_name, _width) { .name = _name, .width = _width, .fmt = "%lld", .type = COL_TYPE_S64 } +#define TBL_COL_S64(_name, _width) { .name = _name, .width = _width, .fmt = "%" PRId64, .type = COL_TYPE_S64 } #define TBL_COL_UINT(_name, _width) { .name = _name, .width = _width, .fmt = "%u", .type = COL_TYPE_UINT } -#define TBL_COL_U64(_name, _width) { .name = _name, .width = _width, .fmt = "%llu", .type = COL_TYPE_U64 } +#define TBL_COL_U64(_name, _width) { .name = _name, .width = _width, .fmt = "%" PRIu64, .type = COL_TYPE_U64 } #define TBL_COL_INTMAX(_name, _width) { .name = _name, .width = _width, .fmt = "%jd", .type = COL_TYPE_INTMAX } #define TBL_COL_UINTMAX(_name, _width) { .name = _name, .width = _width, .fmt = "%ju", .type = COL_TYPE_UINTMAX } #define TBL_COL_HEXUINT(_name, _width) { .name = _name, .width = _width, .fmt = "0x%x", .type = COL_TYPE_UINT } -- 2.39.2