aboutsummaryrefslogtreecommitdiffstats
path: root/epan/in_cksum.c
diff options
context:
space:
mode:
authorStephen Fisher <steve@stephen-fisher.com>2011-01-19 22:53:38 +0000
committerStephen Fisher <steve@stephen-fisher.com>2011-01-19 22:53:38 +0000
commitc732e15d7791aaa4006d3dbc7794e86adf94db3c (patch)
tree86f63ef3389d2bda894c854d701e4467cc1d0d6d /epan/in_cksum.c
parent32f6ab2248a3b0770151d1e5131d8449371299ce (diff)
Change the ADDCARRY(x) macro to eliminate clang warning about unused
result from the ADDCARRY portion of the REDUCE macro. -#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) +#define ADDCARRY(x) {if ((x) > 65535) (x) -= 65535;} The new code is from in_cksum.c in the Tahoe/CGI port of 4.4BSD-Lite2 (we're using the "Portable Version" copy otherwise). svn path=/trunk/; revision=35589
Diffstat (limited to 'epan/in_cksum.c')
-rw-r--r--epan/in_cksum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/in_cksum.c b/epan/in_cksum.c
index 1170f9230a..0b4b163cd1 100644
--- a/epan/in_cksum.c
+++ b/epan/in_cksum.c
@@ -51,7 +51,7 @@
* code and should be modified for each CPU to be as fast as possible.
*/
-#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x)
+#define ADDCARRY(x) {if ((x) > 65535) (x) -= 65535;}
#define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
int