MCPcopy Create free account
hub / github.com/google/snappy / LeftShiftOverflows

Function LeftShiftOverflows

snappy.cc:1229–1237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1227}
1228
1229static inline bool LeftShiftOverflows(uint8_t value, uint32_t shift) {
1230 assert(shift < 32);
1231 static const uint8_t masks[] = {
1232 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
1233 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
1234 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
1235 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe};
1236 return (value & masks[shift]) != 0;
1237}
1238
1239inline bool Copy64BytesWithPatternExtension(ptrdiff_t dst, size_t offset) {
1240 // TODO: Switch to [[maybe_unused]] when we can assume C++17.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected