mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user