Commit 45ec0848 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Remove include of glog from various places

Summary: [Folly] Remove include of `glog` from various places.

Reviewed By: spalamarchuk

Differential Revision: D14494311

fbshipit-source-id: 122b63a726a08802d7b4ef6b55b304e9800c258d
parent 4a1b5a3a
......@@ -24,6 +24,7 @@
#pragma once
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cstddef>
......@@ -35,7 +36,6 @@
#include <utility>
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
#include <glog/logging.h>
#include <folly/Demangle.h>
#include <folly/Expected.h>
......@@ -700,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;
}
......
......@@ -22,8 +22,6 @@
#include <cassert>
#include <limits>
#include <glog/logging.h>
#include <folly/Portability.h>
#include <folly/Range.h>
#include <folly/ScopeGuard.h>
......@@ -131,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);
};
......@@ -175,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,12 +17,12 @@
#pragma once
#include <sys/types.h>
#include <cassert>
#include <cstddef>
#include <iosfwd>
#include <string>
#include <glog/logging.h>
#include <folly/IPAddress.h>
#include <folly/Portability.h>
#include <folly/Range.h>
......@@ -405,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,10 +16,9 @@
#pragma once
#include <cassert>
#include <string>
#include <glog/logging.h>
#include <folly/Function.h>
#include <folly/Optional.h>
#include <folly/Range.h>
......@@ -83,7 +82,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>
......
......@@ -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>
......
......@@ -17,6 +17,8 @@
#include <iostream>
#include <stdexcept>
#include <glog/logging.h>
#include <folly/Format.h>
#include <folly/Range.h>
#include <folly/experimental/io/HugePages.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;
......
......@@ -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,11 +16,10 @@
#pragma once
#include <cassert>
#include <cmath>
#include <vector>
#include <glog/logging.h>
#include <folly/Range.h>
#include <folly/Utility.h>
......@@ -55,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 {
......
......@@ -20,6 +20,8 @@
#include <functional>
#include <utility>
#include <glog/logging.h>
#include <folly/Format.h>
#include <folly/portability/GFlags.h>
#include <folly/portability/SysMman.h>
......
......@@ -16,7 +16,7 @@
#pragma once
#include <glog/logging.h>
#include <cassert>
#include <folly/File.h>
#include <folly/Range.h>
......@@ -40,8 +40,8 @@ class MemoryMapping {
MUST_LOCK,
};
/**
* Map a portion of the file indicated by filename in memory, causing a CHECK
* failure on error.
* Map a portion of the file indicated by filename in memory, causing SIGABRT
* on error.
*
* By default, map the whole file. length=-1: map from offset to EOF.
* Unlike the mmap() system call, offset and length don't need to be
......@@ -204,7 +204,7 @@ class MemoryMapping {
*/
template <class T>
Range<T*> asWritableRange() const {
DCHECK(options_.writable); // you'll segfault anyway...
assert(options_.writable); // you'll segfault anyway...
size_t count = data_.size() / sizeof(T);
return Range<T*>(static_cast<T*>(static_cast<void*>(data_.data())), count);
}
......@@ -213,7 +213,7 @@ class MemoryMapping {
* A range of mutable bytes mapped by this mapping.
*/
MutableByteRange writableRange() const {
DCHECK(options_.writable); // you'll segfault anyway...
assert(options_.writable); // you'll segfault anyway...
return data_;
}
......
......@@ -16,6 +16,8 @@
#include <cstdlib>
#include <glog/logging.h>
#include <folly/FileUtil.h>
#include <folly/Random.h>
#include <folly/portability/GTest.h>
......
......@@ -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