kcar RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [PATCH] fix signedness check on 32-bit systems
@ 2017-03-05 23:21 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2017-03-05 23:21 UTC (permalink / raw)
  To: kcar-public

This fixes a -Wsign-compare warning on my 32-bit system:
 warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
---
 ext/kcar/kcar.rl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext/kcar/kcar.rl b/ext/kcar/kcar.rl
index 2155ab4..d21b243 100644
--- a/ext/kcar/kcar.rl
+++ b/ext/kcar/kcar.rl
@@ -560,7 +560,7 @@ static VALUE chunked(VALUE self)
 
 static void check_buffer_size(long dlen)
 {
-  if (dlen > UINT_MAX)
+  if ((uint64_t)dlen > UINT_MAX)
     rb_raise(rb_eRangeError, "headers too large to process (%ld bytes)", dlen);
 }
 
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-05 23:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-05 23:21 [PATCH] fix signedness check on 32-bit systems Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/kcar.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).