X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Fdetail%2FGroupVarintDetail.h;h=57ec96fbe78e7d308f3cc8b58fae04b9be1e67f8;hb=34a2f64fb65d4cb446e4ac7623a777191bffa43f;hp=bbd337ab2d8bf030dad21876076c7528995652ca;hpb=22afce906d7e98d95f8c45c3301072d9fd891d41;p=folly.git diff --git a/folly/detail/GroupVarintDetail.h b/folly/detail/GroupVarintDetail.h index bbd337ab..57ec96fb 100644 --- a/folly/detail/GroupVarintDetail.h +++ b/folly/detail/GroupVarintDetail.h @@ -1,5 +1,5 @@ /* - * Copyright 2014 Facebook, Inc. + * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_GROUPVARINTDETAIL_H_ -#define FOLLY_DETAIL_GROUPVARINTDETAIL_H_ +#pragma once #include @@ -31,7 +30,7 @@ struct GroupVarintTraits; template <> struct GroupVarintTraits { - enum { + enum : uint32_t { kGroupSize = 4, kHeaderSize = 1, }; @@ -39,7 +38,7 @@ struct GroupVarintTraits { template <> struct GroupVarintTraits { - enum { + enum : uint32_t { kGroupSize = 5, kHeaderSize = 2, }; @@ -49,7 +48,7 @@ template class GroupVarintBase { protected: typedef GroupVarintTraits Traits; - enum { kHeaderSize = Traits::kHeaderSize }; + enum : uint32_t { kHeaderSize = Traits::kHeaderSize }; public: typedef T type; @@ -57,12 +56,12 @@ class GroupVarintBase { /** * Number of integers encoded / decoded in one pass. */ - enum { kGroupSize = Traits::kGroupSize }; + enum : uint32_t { kGroupSize = Traits::kGroupSize }; /** * Maximum encoded size. */ - enum { kMaxSize = kHeaderSize + sizeof(type) * kGroupSize }; + enum : uint32_t { kMaxSize = kHeaderSize + sizeof(type) * kGroupSize }; /** * Maximum size for n values. @@ -97,8 +96,5 @@ class GroupVarintBase { enum { kFullGroupSize = kHeaderSize + kGroupSize * sizeof(type) }; }; -} // namespace detail -} // namespace folly - -#endif /* FOLLY_DETAIL_GROUPVARINTDETAIL_H_ */ - +} // namespace detail +} // namespace folly