aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2013-10-15 10:49:55 +0200
committerHenrik Nord <[email protected]>2013-12-02 15:20:50 +0100
commit09152f810b04715785cb0437f9bc0ce42bb0f85f (patch)
treec22ef0edb285d16f80ba1db2f1a3e8fbc4a8d806 /lib/erl_interface
parent8e970802761c593e2ed556722276ea036c4ad031 (diff)
downloadotp-09152f810b04715785cb0437f9bc0ce42bb0f85f.tar.gz
otp-09152f810b04715785cb0437f9bc0ce42bb0f85f.tar.bz2
otp-09152f810b04715785cb0437f9bc0ce42bb0f85f.zip
Silence two warnings about tests being always true
encode/encode_ulonglong.c:55:25: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare] if ((p < 256) && (p >= 0)) { ~ ^ ~ legacy/erl_marshal.c:293:24: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare] if ((ul < 256) && (ul >= 0)) { ~~ ^ ~
Diffstat (limited to 'lib/erl_interface')
-rw-r--r--lib/erl_interface/src/encode/encode_ulonglong.c2
-rw-r--r--lib/erl_interface/src/legacy/erl_marshal.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/erl_interface/src/encode/encode_ulonglong.c b/lib/erl_interface/src/encode/encode_ulonglong.c
index 0f21af2a91..2f136abf96 100644
--- a/lib/erl_interface/src/encode/encode_ulonglong.c
+++ b/lib/erl_interface/src/encode/encode_ulonglong.c
@@ -52,7 +52,7 @@ int ei_encode_ulonglong(char *buf, int *index, EI_ULONGLONG p)
char *s = buf + *index;
char *s0 = s;
- if ((p < 256) && (p >= 0)) {
+ if (p < 256) {
if (!buf) s += 2;
else {
put8(s,ERL_SMALL_INTEGER_EXT);
diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c
index e207b5f0f1..9558dc134b 100644
--- a/lib/erl_interface/src/legacy/erl_marshal.c
+++ b/lib/erl_interface/src/legacy/erl_marshal.c
@@ -290,7 +290,7 @@ int erl_encode_it(ETERM *ep, unsigned char **ext, int dist)
return 0;
}
/* SMALL_INTEGER */
- if ((ul < 256) && (ul >= 0)) {
+ if (ul < 256) {
*(*ext)++ = ERL_SMALL_INTEGER_EXT;
*(*ext)++ = ul & 0xff;
return 0;