aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Åldstedt Sund <erik.sund@conoptica.com>2017-10-22 13:45:59 +0200
committerErik Åldstedt Sund <erik.sund@conoptica.com>2017-10-30 20:45:34 +0100
commit83bd8c09a09073ad4617dcb42d3f8253d324d9c6 (patch)
tree83b645d199c3cbbd3d1f412c9f5cf2e81f1806e8
parent7f3f72441c242836d00ab2109a83baef89c08aaa (diff)
downloadcrow-83bd8c09a09073ad4617dcb42d3f8253d324d9c6.tar.gz
crow-83bd8c09a09073ad4617dcb42d3f8253d324d9c6.zip
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.
-rw-r--r--include/crow/websocket.h2
1 files changed, 1 insertions, 1 deletions
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<uint64_t*>(buf+2) = ((1==htonl(1)) ? static_cast<uint64_t>(size) : (static_cast<uint64_t>(htonl((size) & 0xFFFFFFFF)) << 32) | htonl(static_cast<uint64_t>(size) >> 32));
return {buf, buf+10};
}
}