From 80cf9cb44db836b1a837c030a949c58295e54fcb Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 22 Mar 2012 11:50:40 +0200 Subject: [PATCH] connection: fix signedness warnings Fix two of warning: comparison between signed and unsigned integer expressions If the pointer difference somehow ended up negative, these comparisons would break as the difference was implicitly casted to unsigned. Signed-off-by: Pekka Paalanen --- src/connection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connection.c b/src/connection.c index 9bb2ca43..69bc666d 100644 --- a/src/connection.c +++ b/src/connection.c @@ -428,7 +428,7 @@ wl_connection_vmarshal(struct wl_connection *connection, s = va_arg(ap, const char *); length = s ? strlen(s) + 1: 0; - if (end - p < DIV_ROUNDUP(length, sizeof *p) + 1) + if (end - p < (int)DIV_ROUNDUP(length, sizeof *p) + 1) goto err; *p++ = length; @@ -478,7 +478,7 @@ wl_connection_vmarshal(struct wl_connection *connection, *p++ = 0; break; } - if (end - p < DIV_ROUNDUP(array->size, sizeof *p) + 1) + if (end - p < (int)DIV_ROUNDUP(array->size, sizeof *p) + 1) goto err; *p++ = array->size; memcpy(p, array->data, array->size);