From 19f62195a5d7f92bd22482db746d830c7cde40c4 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Sun, 2 Jan 2011 13:24:27 -0800 Subject: [PATCH] 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'" --- lib/multipath.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/multipath.c b/lib/multipath.c index 13f88ff02..af0ebffe4 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; -- 2.43.0