diff options
author | Shu Shen <shu.shen@gmail.com> | 2017-01-13 17:51:00 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-01-14 08:32:01 -0800 |
commit | 94783c7cfb45bcc4846b7c07663f4c5864a5edf0 (patch) | |
tree | 541acdd22fb863d1ac1ceb605d2a1866ff5d70d6 /lib/ofp-actions.c | |
parent | 2041809932c65f71acb55ae493e33f5372f3c93d (diff) | |
download | openvswitch-94783c7cfb45bcc4846b7c07663f4c5864a5edf0.tar.gz |
Use PRIu32 format for ofp_port_t
Although ofp_port_t uses a 16-bit range, it is defined as a 32-bit type.
The format strings throughout the code base were using PRIu16 for
ofp_port_t which leads to the compiler to throw Wformat message on
platforms that don't promote 16-bit to 32-bit integers, e.g., on macOS.
Signed-off-by: Shu Shen <shu.shen@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/ofp-actions.c')
-rw-r--r-- | lib/ofp-actions.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index 47365215c..cf1ad0fa9 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -645,7 +645,7 @@ static void format_OUTPUT(const struct ofpact_output *a, struct ds *s) { if (ofp_to_u16(a->port) < ofp_to_u16(OFPP_MAX)) { - ds_put_format(s, "%soutput:%s%"PRIu16, + ds_put_format(s, "%soutput:%s%"PRIu32, colors.special, colors.end, a->port); } else { ofputil_format_port(a->port, s); @@ -5077,7 +5077,7 @@ format_SAMPLE(const struct ofpact_sample *a, struct ds *s) colors.param, colors.end, a->obs_domain_id, colors.param, colors.end, a->obs_point_id); if (a->sampling_port != OFPP_NONE) { - ds_put_format(s, ",%ssampling_port=%s%"PRIu16, + ds_put_format(s, ",%ssampling_port=%s%"PRIu32, colors.param, colors.end, a->sampling_port); } if (a->direction == NX_ACTION_SAMPLE_INGRESS) { @@ -5933,7 +5933,7 @@ parse_OUTPUT_TRUNC(const char *arg, struct ofpbuf *ofpacts OVS_UNUSED, static void format_OUTPUT_TRUNC(const struct ofpact_output_trunc *a, struct ds *s) { - ds_put_format(s, "%soutput%s(port=%"PRIu16",max_len=%"PRIu32")", + ds_put_format(s, "%soutput%s(port=%"PRIu32",max_len=%"PRIu32")", colors.special, colors.end, a->port, a->max_len); } |