Commit 1c841a35 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Remove include of glog from Range.h

Summary: [Folly] Remove include of `glog` from `Range.h`.

Reviewed By: lbrandy, Orvid

Differential Revision: D14114164

fbshipit-source-id: e227609e9214ab39ff272e44519d34f3047fe025
parent 20a8a095
......@@ -24,6 +24,7 @@
#pragma once
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cstddef>
......@@ -699,7 +700,7 @@ toAppend(
conv.ToFixed(value, int(numDigits), &builder);
break;
default:
CHECK(mode == DoubleToStringConverter::PRECISION);
assert(mode == DoubleToStringConverter::PRECISION);
conv.ToPrecision(value, int(numDigits), &builder);
break;
}
......
......@@ -129,7 +129,7 @@ bool readFile(
size_t soFar = 0; // amount of bytes successfully read
SCOPE_EXIT {
DCHECK(out.size() >= soFar); // resize better doesn't throw
assert(out.size() >= soFar); // resize better doesn't throw
out.resize(soFar);
};
......@@ -173,7 +173,7 @@ bool readFile(
const char* file_name,
Container& out,
size_t num_bytes = std::numeric_limits<size_t>::max()) {
DCHECK(file_name);
assert(file_name);
const auto fd = openNoInt(file_name, O_RDONLY | O_CLOEXEC);
if (fd == -1) {
......
......@@ -16,6 +16,8 @@
#include <folly/Format.h>
#include <cassert>
#include <folly/ConstexprMath.h>
#include <folly/CppAttributes.h>
#include <folly/container/Array.h>
......@@ -208,7 +210,7 @@ void FormatValue<double>::formatHelper(
int len = builder.position();
builder.Finalize();
DCHECK_GT(len, 0);
assert(len > 0);
// Add '+' or ' ' sign if needed
char* p = buf + 1;
......
......@@ -18,6 +18,7 @@
#define FOLLY_FORMAT_H_
#include <cstdio>
#include <ios>
#include <stdexcept>
#include <tuple>
#include <type_traits>
......@@ -241,9 +242,9 @@ class Formatter : public BaseFormatter<
/**
* Formatter objects can be written to streams.
*/
template <bool containerMode, class... Args>
template <class C, bool containerMode, class... Args>
std::ostream& operator<<(
std::ostream& out,
std::basic_ostream<C>& out,
const Formatter<containerMode, Args...>& formatter) {
auto writer = [&out](StringPiece sp) {
out.write(sp.data(), std::streamsize(sp.size()));
......
......@@ -16,6 +16,7 @@
#include <folly/MacAddress.h>
#include <cassert>
#include <ostream>
#include <folly/Exception.h>
......@@ -38,7 +39,7 @@ MacAddress::MacAddress(StringPiece str) {
MacAddress MacAddress::createMulticast(IPAddressV6 v6addr) {
// This method should only be used for multicast addresses.
DCHECK(v6addr.isMulticast());
assert(v6addr.isMulticast());
uint8_t bytes[SIZE];
bytes[0] = 0x33;
......
......@@ -20,6 +20,7 @@
#include <folly/SocketAddress.h>
#include <cassert>
#include <cerrno>
#include <cstdio>
#include <cstring>
......@@ -585,7 +586,7 @@ size_t SocketAddress::hash() const {
break;
}
case AF_UNIX:
DCHECK(external_);
assert(external_);
break;
case AF_UNSPEC:
default:
......
......@@ -17,6 +17,8 @@
#pragma once
#include <sys/types.h>
#include <cassert>
#include <cstddef>
#include <iosfwd>
#include <string>
......@@ -403,7 +405,7 @@ class SocketAddress {
socklen_t getActualSize() const;
sa_family_t getFamily() const {
DCHECK(external_ || AF_UNIX != storage_.addr.family());
assert(external_ || AF_UNIX != storage_.addr.family());
return external_ ? sa_family_t(AF_UNIX) : storage_.addr.family();
}
......
......@@ -13,8 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <folly/chrono/Conv.h>
#include <glog/logging.h>
#include <folly/portability/GTest.h>
using namespace folly;
......
......@@ -16,6 +16,7 @@
#pragma once
#include <cassert>
#include <string>
#include <folly/Function.h>
......@@ -80,7 +81,7 @@ class CompressionCounter {
return makeCompressionCounterHandler(
codecType, codecName, level, key, counterType);
};
DCHECK(!initialize_.hasAllocatedMemory());
assert(!initialize_.hasAllocatedMemory());
}
void operator+=(double sum) {
......
......@@ -19,6 +19,8 @@
#include <algorithm>
#include <unordered_map>
#include <glog/logging.h>
#include <folly/Conv.h>
#include <folly/FBString.h>
#include <folly/container/test/F14TestUtil.h>
......
......@@ -18,6 +18,8 @@
#include <unordered_map>
#include <glog/logging.h>
#include <folly/Conv.h>
#include <folly/FBString.h>
#include <folly/container/test/F14TestUtil.h>
......
......@@ -17,10 +17,9 @@
#pragma once
#include <algorithm>
#include <cassert>
#include <string>
#include <glog/logging.h>
#include <folly/Likely.h>
namespace folly {
......@@ -56,7 +55,7 @@ class StringPieceLite {
return size() == 0;
}
const char& operator[](size_t i) const {
DCHECK_GT(size(), i);
assert(size() > i);
return b_[i];
}
template <typename Range>
......
......@@ -16,7 +16,7 @@
#include <folly/detail/RangeSse42.h>
#include <glog/logging.h>
#include <cassert>
#include <folly/Portability.h>
......@@ -73,9 +73,9 @@ static inline size_t nextAlignedIndex(const char* arr) {
size_t qfind_first_byte_of_needles16(
const StringPieceLite haystack,
const StringPieceLite needles) {
DCHECK_GT(haystack.size(), 0u);
DCHECK_GT(needles.size(), 0u);
DCHECK_LE(needles.size(), 16u);
assert(haystack.size() > 0u);
assert(needles.size() > 0u);
assert(needles.size() <= 16u);
if ((needles.size() <= 2 && haystack.size() >= 256) ||
// must bail if we can't even SSE-load a single segment of haystack
(haystack.size() < 16 &&
......@@ -119,8 +119,8 @@ size_t scanHaystackBlock(
const StringPieceLite haystack,
const StringPieceLite needles,
uint64_t blockStartIdx) {
DCHECK_GT(needles.size(), 16u); // should handled by *needles16() method
DCHECK(
assert(needles.size() > 16u); // should handled by *needles16() method
assert(
blockStartIdx + 16 <= haystack.size() ||
(page_for(haystack.data() + blockStartIdx) ==
page_for(haystack.data() + blockStartIdx + 15)));
......
......@@ -119,7 +119,6 @@ struct hash<::folly::dynamic> {
apply(std::string); \
break; \
default: \
CHECK(0); \
abort(); \
} \
} while (0)
......
......@@ -14,12 +14,14 @@
* limitations under the License.
*/
#include <folly/dynamic.h>
#include <numeric>
#include <folly/container/Enumerate.h>
#include <folly/dynamic.h>
#include <glog/logging.h>
#include <folly/Format.h>
#include <folly/container/Enumerate.h>
#include <folly/hash/Hash.h>
#include <folly/lang/Assume.h>
#include <folly/lang/Exception.h>
......
......@@ -18,6 +18,8 @@
#include <folly/executors/thread_factory/ThreadFactory.h>
#include <glog/logging.h>
#include <folly/String.h>
#include <folly/portability/SysResource.h>
#include <folly/portability/SysTime.h>
......
......@@ -26,6 +26,8 @@
#include <sstream>
#include <glog/logging.h>
#include <folly/Optional.h>
namespace folly {
......
......@@ -16,6 +16,8 @@
#include <folly/experimental/EnvUtil.h>
#include <glog/logging.h>
#include <folly/String.h>
#include <folly/portability/Stdlib.h>
#include <folly/portability/Unistd.h>
......
......@@ -18,6 +18,8 @@
#include <random>
#include <glog/logging.h>
#include <folly/Conv.h>
#include <folly/Random.h>
#include <folly/String.h>
......
......@@ -18,6 +18,8 @@
#include <iostream>
#include <glog/logging.h>
#include <folly/FileUtil.h>
#include <folly/Format.h>
#include <folly/experimental/io/FsUtil.h>
......
......@@ -20,6 +20,7 @@
#include <sys/types.h>
#include <boost/regex.hpp>
#include <glog/logging.h>
#include <folly/Exception.h>
#include <folly/File.h>
......
......@@ -18,6 +18,8 @@
// specializations.
#include <folly/experimental/crypto/detail/LtHashInternal.h>
#include <glog/logging.h>
#ifdef __AVX2__
#include <immintrin.h>
#include <sodium.h>
......
......@@ -18,6 +18,8 @@
// specializations.
#include <folly/experimental/crypto/detail/LtHashInternal.h>
#include <glog/logging.h>
#ifdef __SSE2__
#include <emmintrin.h>
#include <sodium.h>
......
......@@ -18,6 +18,8 @@
// specializations.
#include <folly/experimental/crypto/detail/LtHashInternal.h>
#include <glog/logging.h>
#include <folly/Memory.h>
#include <folly/lang/Bits.h>
......
......@@ -597,7 +597,7 @@ bool Dwarf::findAddress(
// it only if such behavior is requested via LocationInfoMode.
return false;
} else {
DCHECK(mode == LocationInfoMode::FULL);
FOLLY_SAFE_DCHECK(mode == LocationInfoMode::FULL, "unexpected mode");
// Fall back to the linear scan.
}
}
......
......@@ -16,6 +16,8 @@
#include <folly/experimental/symbolizer/Dwarf.h>
#include <glog/logging.h>
#include <folly/portability/GTest.h>
using folly::symbolizer::Dwarf;
......
......@@ -20,6 +20,7 @@
#include <random>
#include <boost/thread.hpp>
#include <glog/logging.h>
#include <folly/Random.h>
#include <folly/experimental/FunctionScheduler.h>
......
......@@ -13,10 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <string>
#include <tuple>
#include <vector>
#include <glog/logging.h>
#include <folly/FBVector.h>
#include <folly/Range.h>
#include <folly/gen/Base.h>
......
......@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <folly/json.h>
#include <algorithm>
......@@ -21,6 +22,7 @@
#include <type_traits>
#include <boost/algorithm/string.hpp>
#include <glog/logging.h>
#include <folly/Conv.h>
#include <folly/Portability.h>
......
......@@ -16,6 +16,8 @@
#include <folly/json_patch.h>
#include <glog/logging.h>
#include <folly/container/Enumerate.h>
namespace {
......
......@@ -15,6 +15,9 @@
*/
#include <folly/ssl/detail/SSLSessionImpl.h>
#include <glog/logging.h>
#include <folly/portability/OpenSSL.h>
#include <folly/ssl/OpenSSLVersionFinder.h>
......
......@@ -15,6 +15,9 @@
*/
#include <folly/stats/TDigest.h>
#include <glog/logging.h>
#include <folly/stats/detail/DoubleRadixSort.h>
#include <algorithm>
......
......@@ -16,6 +16,7 @@
#pragma once
#include <cassert>
#include <cmath>
#include <vector>
......@@ -53,7 +54,7 @@ class TDigest {
public:
explicit Centroid(double mean = 0.0, double weight = 1.0)
: mean_(mean), weight_(weight) {
DCHECK_GT(weight, 0);
assert(weight > 0);
}
inline double mean() const {
......
......@@ -19,6 +19,7 @@
#endif
#include <boost/lexical_cast.hpp>
#include <glog/logging.h>
#include <folly/Conv.h>
#include <folly/container/Foreach.h>
......
......@@ -16,6 +16,8 @@
#include <folly/dynamic.h>
#include <glog/logging.h>
#include <folly/Range.h>
#include <folly/json.h>
#include <folly/portability/GTest.h>
......
......@@ -27,6 +27,7 @@
#include <sstream>
#include <boost/algorithm/string.hpp>
#include <glog/logging.h>
#include <folly/Conv.h>
#include <folly/Portability.h>
......
......@@ -16,6 +16,8 @@
#include <folly/File.h>
#include <glog/logging.h>
#include <folly/String.h>
#include <folly/portability/Fcntl.h>
#include <folly/portability/GTest.h>
......
......@@ -16,6 +16,8 @@
#include <stdexcept>
#include <glog/logging.h>
#include <folly/portability/GMock.h>
#include <folly/portability/GTest.h>
#include <folly/test/JsonMockUtil.h>
......
......@@ -25,6 +25,7 @@
#include <set>
#include <boost/regex.hpp>
#include <glog/logging.h>
#include <folly/FBVector.h>
#include <folly/container/Array.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment