summaryrefslogtreecommitdiff
path: root/lib/ovsdb-data.c
diff options
context:
space:
mode:
authorAlin Serdean <aserdean@cloudbasesolutions.com>2013-11-25 23:38:48 -0800
committerBen Pfaff <blp@nicira.com>2013-11-25 23:38:59 -0800
commit34582733d9aad82bba60f4bf986b62d58412502a (patch)
tree9f42e24f813d7059b6c0ef529e1b631b443e53cb /lib/ovsdb-data.c
parent4d3daf048134e8c375fdadcec7e51d1dc28fe0b6 (diff)
downloadopenvswitch-34582733d9aad82bba60f4bf986b62d58412502a.tar.gz
Avoid printf type modifiers not supported by MSVC C runtime library.
The MSVC C library printf() implementation does not support the 'z', 't', 'j', or 'hh' format specifiers. This commit changes the Open vSwitch code to avoid those format specifiers, switching to standard macros from <inttypes.h> where available and inventing new macros resembling them where necessary. It also updates CodingStyle to specify the macros' use and adds a Makefile rule to report violations. Signed-off-by: Alin Serdean <aserdean@cloudbasesolutions.com> Co-authored-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/ovsdb-data.c')
-rw-r--r--lib/ovsdb-data.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c
index ade1971c3..4e918a6ab 100644
--- a/lib/ovsdb-data.c
+++ b/lib/ovsdb-data.c
@@ -741,12 +741,12 @@ check_string_constraints(const char *s,
if (n_chars < c->minLen) {
return ovsdb_error(
"constraint violation",
- "\"%s\" length %zu is less than minimum allowed "
+ "\"%s\" length %"PRIuSIZE" is less than minimum allowed "
"length %u", s, n_chars, c->minLen);
} else if (n_chars > c->maxLen) {
return ovsdb_error(
"constraint violation",
- "\"%s\" length %zu is greater than maximum allowed "
+ "\"%s\" length %"PRIuSIZE" is greater than maximum allowed "
"length %u", s, n_chars, c->maxLen);
}
@@ -1224,7 +1224,7 @@ ovsdb_datum_from_json__(struct ovsdb_datum *datum,
n = inner->u.array.n;
if (n < type->n_min || n > type->n_max) {
return ovsdb_syntax_error(json, NULL, "%s must have %u to "
- "%u members but %zu are present",
+ "%u members but %"PRIuSIZE" are present",
class, type->n_min, type->n_max, n);
}