From 83bd8c09a09073ad4617dcb42d3f8253d324d9c6 Mon Sep 17 00:00:00 2001 From: Erik Ã…ldstedt Sund Date: Sun, 22 Oct 2017 13:45:59 +0200 Subject: Fixed warning in websocket.h: right shift count >= width of type Fixed by static_cast-ing values from 32-bit values to 64-bit values. --- include/crow/websocket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/crow/websocket.h b/include/crow/websocket.h index ee0885f..9361285 100644 --- a/include/crow/websocket.h +++ b/include/crow/websocket.h @@ -152,7 +152,7 @@ namespace crow else { buf[1] += 127; - *(uint64_t*)(buf+2) = ((1==htonl(1)) ? (uint64_t)size : ((uint64_t)htonl((size) & 0xFFFFFFFF) << 32) | htonl((size) >> 32)); + *reinterpret_cast(buf+2) = ((1==htonl(1)) ? static_cast(size) : (static_cast(htonl((size) & 0xFFFFFFFF)) << 32) | htonl(static_cast(size) >> 32)); return {buf, buf+10}; } } -- cgit v1.2.3-54-g00ecf