Using FMT_NULLPTR instead of literal 0

This commit is contained in:
alabuzhev
2016-11-03 06:39:40 -07:00
committed by Victor Zverovich
parent 7ce7def515
commit 49ccb2e449
10 changed files with 52 additions and 42 deletions
+6 -6
View File
@@ -75,7 +75,7 @@ inline std::tm localtime(std::time_t time) {
return handle(localtime_r(&time_, &tm_));
}
bool handle(std::tm* tm) { return tm != 0; }
bool handle(std::tm* tm) { return tm != FMT_NULLPTR; }
bool handle(internal::Null<>) {
using namespace fmt::internal;
@@ -87,8 +87,8 @@ inline std::tm localtime(std::time_t time) {
bool fallback(internal::Null<>) {
using namespace fmt::internal;
std::tm* tm = std::localtime(&time_);
if (tm != 0) tm_ = *tm;
return tm != 0;
if (tm != FMT_NULLPTR) tm_ = *tm;
return tm != FMT_NULLPTR;
}
};
LocalTime lt(time);
@@ -112,7 +112,7 @@ inline std::tm gmtime(std::time_t time) {
return handle(gmtime_r(&time_, &tm_));
}
bool handle(std::tm* tm) { return tm != 0; }
bool handle(std::tm* tm) { return tm != FMT_NULLPTR; }
bool handle(internal::Null<>) {
using namespace fmt::internal;
@@ -123,8 +123,8 @@ inline std::tm gmtime(std::time_t time) {
bool fallback(internal::Null<>) {
std::tm* tm = std::gmtime(&time_);
if (tm != 0) tm_ = *tm;
return tm != 0;
if (tm != FMT_NULLPTR) tm_ = *tm;
return tm != FMT_NULLPTR;
}
};
GMTime gt(time);