From: Ethan Jackson Date: Sun, 2 Jan 2011 21:24:27 +0000 (-0800) Subject: multipath: Fix compiler warning. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19f62195a5d7f92bd22482db746d830c7cde40c4;p=openvswitch multipath: Fix compiler warning. This commit fixes the following compiler warning: "cast from function call of type 'uint16_t' to non-matching type 'enum nx_mp_fields'" --- diff --git a/lib/multipath.c b/lib/multipath.c index 13f88ff0..af0ebffe 100644 --- a/lib/multipath.c +++ b/lib/multipath.c @@ -17,6 +17,7 @@ #include #include "multipath.h" +#include #include #include #include @@ -268,7 +269,10 @@ multipath_format(const struct nx_action_multipath *mp, struct ds *s) { const char *fields, *algorithm; - switch ((enum nx_mp_fields) ntohs(mp->fields)) { + uint16_t mp_fields = ntohs(mp->fields); + uint16_t mp_algorithm = ntohs(mp->algorithm); + + switch ((enum nx_mp_fields) mp_fields) { case NX_MP_FIELDS_ETH_SRC: fields = "eth_src"; break; @@ -279,7 +283,7 @@ multipath_format(const struct nx_action_multipath *mp, struct ds *s) fields = ""; } - switch ((enum nx_mp_algorithm) ntohs(mp->algorithm)) { + switch ((enum nx_mp_algorithm) mp_algorithm) { case NX_MP_ALG_MODULO_N: algorithm = "modulo_n"; break;