Consistency in namespace-closing comments
[folly.git] / folly / GroupVarint.h
index ae3afdb8d3f683ca737b5e648cbd4ad637563ebf..8780f04e4088ebfd09c91485d423fc8a75ee4a50 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 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.
 
 #pragma once
 
+#include <cstdint>
+#include <limits>
+
+#include <glog/logging.h>
+
 #if !defined(__GNUC__) && !defined(_MSC_VER)
 #error GroupVarint.h requires GCC or MSVC
 #endif
 #if FOLLY_X64 || defined(__i386__) || FOLLY_PPC64 || FOLLY_A64
 #define HAVE_GROUP_VARINT 1
 
-#include <cstdint>
-#include <limits>
-#include <folly/detail/GroupVarintDetail.h>
 #include <folly/Bits.h>
 #include <folly/Range.h>
+#include <folly/detail/GroupVarintDetail.h>
 #include <folly/portability/Builtins.h>
-#include <glog/logging.h>
 
 #if FOLLY_SSE >= 3
 #include <nmmintrin.h>
 namespace folly {
 namespace detail {
 alignas(16) extern const uint64_t groupVarintSSEMasks[];
-}  // namespace detail
-}  // namespace folly
+} // namespace detail
+} // namespace folly
 #endif
 
 namespace folly {
 namespace detail {
 extern const uint8_t groupVarintLengths[];
-}  // namespace detail
-}  // namespace folly
+} // namespace detail
+} // namespace folly
 
 namespace folly {
 
@@ -549,7 +551,7 @@ class GroupVarintDecoder {
   bool next(type* val) {
     if (pos_ == count_) {
       // refill
-      size_t rem = end_ - p_;
+      size_t rem = size_t(end_ - p_);
       if (rem == 0 || remaining_ == 0) {
         return false;
       }
@@ -581,7 +583,7 @@ class GroupVarintDecoder {
         }
       } else {
         // Can't decode a full group
-        count_ = Base::partialCount(p_, end_ - p_);
+        count_ = Base::partialCount(p_, size_t(end_ - p_));
         if (remaining_ >= count_) {
           remaining_ -= count_;
           p_ = end_;
@@ -604,7 +606,7 @@ class GroupVarintDecoder {
     CHECK(pos_ == count_ && (p_ == end_ || remaining_ == 0));
     // p_ may point to the internal buffer (tmp_), but we want
     // to return subpiece of the original data
-    size_t size = end_ - p_;
+    size_t size = size_t(end_ - p_);
     return StringPiece(rrest_ - size, rrest_);
   }
 
@@ -623,6 +625,6 @@ class GroupVarintDecoder {
 typedef GroupVarintDecoder<uint32_t> GroupVarint32Decoder;
 typedef GroupVarintDecoder<uint64_t> GroupVarint64Decoder;
 
-}  // namespace folly
+} // namespace folly
 
 #endif /* FOLLY_X64 || defined(__i386__) || FOLLY_PPC64 */