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 <ppaalanen@gmail.com>
This commit is contained in:
Pekka Paalanen 2012-03-22 11:50:40 +02:00
parent 3b7cdcb5c6
commit 80cf9cb44d

View file

@ -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);