From a5ce7f6083509a0d14d3388883cde9871d198996 Mon Sep 17 00:00:00 2001 From: dmiller Date: Fri, 29 Nov 2013 01:42:42 +0000 Subject: [PATCH] Cast literal to appropriate type On 64-bit, the literal 1 is a 32-bit integer, and can't be shifted by the appropriate amount (61 bits). --- nsock/src/nsock_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nsock/src/nsock_event.c b/nsock/src/nsock_event.c index 6e8250756..101930926 100644 --- a/nsock/src/nsock_event.c +++ b/nsock/src/nsock_event.c @@ -395,7 +395,7 @@ nsock_event_id get_new_event_id(mspool *ms, enum nse_type type) { assert(type < NSE_TYPE_MAX); shiftbits = sizeof(nsock_event_id) * 8 - TYPE_CODE_NUM_BITS; - max_serial_allowed = (1 << shiftbits) - 1; + max_serial_allowed = ((unsigned long)1 << shiftbits) - 1; if (serial == max_serial_allowed) { /* then the next serial will be one because 0 is forbidden */ ms->next_event_serial = 1;