From 4347b8987732b5bea83ddb8fb9605cf2c4a1c2fe Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 18 Feb 2010 18:44:38 -0800 Subject: http: avoid signedness warnings We never come close to the signed limits anywhere, so it should be safe either way, but make paranoid compiler settings less noisy if possible. --- ext/unicorn_http/ext_help.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/unicorn_http/ext_help.h') diff --git a/ext/unicorn_http/ext_help.h b/ext/unicorn_http/ext_help.h index 7df73f7..888bd36 100644 --- a/ext/unicorn_http/ext_help.h +++ b/ext/unicorn_http/ext_help.h @@ -47,7 +47,7 @@ static void rb_18_str_set_len(VALUE str, long len) # define rb_str_modify(x) do {} while (0) #endif /* ! defined(HAVE_RB_STR_MODIFY) */ -static inline int str_cstr_eq(VALUE val, const char *ptr, size_t len) +static inline int str_cstr_eq(VALUE val, const char *ptr, long len) { return (RSTRING_LEN(val) == len && !memcmp(ptr, RSTRING_PTR(val), len)); } @@ -56,7 +56,7 @@ static inline int str_cstr_eq(VALUE val, const char *ptr, size_t len) str_cstr_eq(val, const_str, sizeof(const_str) - 1) /* strcasecmp isn't locale independent */ -static int str_cstr_case_eq(VALUE val, const char *ptr, size_t len) +static int str_cstr_case_eq(VALUE val, const char *ptr, long len) { if (RSTRING_LEN(val) == len) { const char *v = RSTRING_PTR(val); -- cgit v1.2.3-24-ge0c7