projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move max_align_v and max_align_t to folly/lang/Align.h
[folly.git]
/
folly
/
GroupVarint.h
diff --git
a/folly/GroupVarint.h
b/folly/GroupVarint.h
index 8780f04e4088ebfd09c91485d423fc8a75ee4a50..ad0bb361cf59620e229886ab2696d33152c75618 100644
(file)
--- a/
folly/GroupVarint.h
+++ b/
folly/GroupVarint.h
@@
-27,12
+27,12
@@
#include <folly/Portability.h>
#include <folly/Portability.h>
-#if FOLLY_X64 || defined(__i386__) || FOLLY_PPC64 || FOLLY_A64
+#if FOLLY_X64 || defined(__i386__) || FOLLY_PPC64 || FOLLY_A
ARCH
64
#define HAVE_GROUP_VARINT 1
#define HAVE_GROUP_VARINT 1
-#include <folly/Bits.h>
#include <folly/Range.h>
#include <folly/detail/GroupVarintDetail.h>
#include <folly/Range.h>
#include <folly/detail/GroupVarintDetail.h>
+#include <folly/lang/Bits.h>
#include <folly/portability/Builtins.h>
#if FOLLY_SSE >= 3
#include <folly/portability/Builtins.h>
#if FOLLY_SSE >= 3
@@
-107,13
+107,21
@@
class GroupVarint<uint32_t> : public detail::GroupVarintBase<uint32_t> {
uint8_t v = uint8_t(*p);
size_t s = kHeaderSize;
s += 1 + b0key(v);
uint8_t v = uint8_t(*p);
size_t s = kHeaderSize;
s += 1 + b0key(v);
- if (s > size) return 0;
+ if (s > size) {
+ return 0;
+ }
s += 1 + b1key(v);
s += 1 + b1key(v);
- if (s > size) return 1;
+ if (s > size) {
+ return 1;
+ }
s += 1 + b2key(v);
s += 1 + b2key(v);
- if (s > size) return 2;
+ if (s > size) {
+ return 2;
+ }
s += 1 + b3key(v);
s += 1 + b3key(v);
- if (s > size) return 3;
+ if (s > size) {
+ return 3;
+ }
return 4;
}
return 4;
}
@@
-312,15
+320,25
@@
class GroupVarint<uint64_t> : public detail::GroupVarintBase<uint64_t> {
uint16_t v = loadUnaligned<uint16_t>(p);
size_t s = kHeaderSize;
s += 1 + b0key(v);
uint16_t v = loadUnaligned<uint16_t>(p);
size_t s = kHeaderSize;
s += 1 + b0key(v);
- if (s > size) return 0;
+ if (s > size) {
+ return 0;
+ }
s += 1 + b1key(v);
s += 1 + b1key(v);
- if (s > size) return 1;
+ if (s > size) {
+ return 1;
+ }
s += 1 + b2key(v);
s += 1 + b2key(v);
- if (s > size) return 2;
+ if (s > size) {
+ return 2;
+ }
s += 1 + b3key(v);
s += 1 + b3key(v);
- if (s > size) return 3;
+ if (s > size) {
+ return 3;
+ }
s += 1 + b4key(v);
s += 1 + b4key(v);
- if (s > size) return 4;
+ if (s > size) {
+ return 4;
+ }
return 5;
}
return 5;
}