From 7b7f7e4ebdcba8a52cdd76e4cb911ec7c6e7dbf9 Mon Sep 17 00:00:00 2001 From: Christophe Juniet Date: Wed, 3 Jul 2013 22:30:48 +0200 Subject: [PATCH] Fix compilation warnings on unsigned comparisons. Fix two unsigned comparisons to zero or more being always true. Clang won't compile this with -Werror. --- src/options.cpp | 4 ++-- src/z85_codec.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/options.cpp b/src/options.cpp index bc3dbfb2..f1767437 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -264,7 +264,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_, return 0; } else - if (optvallen_ >= 0 && optvallen_ < 256 && optval_ != NULL) { + if (optvallen_ > 0 && optvallen_ < 256 && optval_ != NULL) { plain_username.assign ((const char *) optval_, optvallen_); as_server = 0; mechanism = ZMQ_PLAIN; @@ -278,7 +278,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_, return 0; } else - if (optvallen_ >= 0 && optvallen_ < 256 && optval_ != NULL) { + if (optvallen_ > 0 && optvallen_ < 256 && optval_ != NULL) { plain_password.assign ((const char *) optval_, optvallen_); as_server = 0; mechanism = ZMQ_PLAIN; diff --git a/src/z85_codec.hpp b/src/z85_codec.hpp index d5c5981c..dabdf652 100644 --- a/src/z85_codec.hpp +++ b/src/z85_codec.hpp @@ -105,4 +105,4 @@ Z85_decode (uint8_t *dest, char *string) return dest; } -#endif \ No newline at end of file +#endif