aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skpdiff/skpdiff_util.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-08-27 07:41:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-27 07:41:16 -0700
commit96fcdcc219d2a0d3579719b84b28bede76efba64 (patch)
tree0ec5ea0193d8292df8bf5ed9dd8498a5eb5763dd /tools/skpdiff/skpdiff_util.cpp
parent435af2f736c85c3274a0c6760a3523810750d237 (diff)
Style Change: NULL->nullptr
Diffstat (limited to 'tools/skpdiff/skpdiff_util.cpp')
-rw-r--r--tools/skpdiff/skpdiff_util.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/skpdiff/skpdiff_util.cpp b/tools/skpdiff/skpdiff_util.cpp
index 4b5d52110b..d33ca24a3a 100644
--- a/tools/skpdiff/skpdiff_util.cpp
+++ b/tools/skpdiff/skpdiff_util.cpp
@@ -5,6 +5,8 @@
* found in the LICENSE file.
*/
+#include "SkTypes.h"
+
#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID)
# include <unistd.h>
# include <sys/time.h>
@@ -97,7 +99,7 @@ double get_seconds() {
return currentTime.tv_sec + (double)currentTime.tv_nsec / 1e9;
#elif defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID)
struct timeval currentTime;
- gettimeofday(&currentTime, NULL);
+ gettimeofday(&currentTime, nullptr);
return currentTime.tv_sec + (double)currentTime.tv_usec / 1e6;
#else
return clock() / (double)CLOCKS_PER_SEC;
@@ -108,11 +110,11 @@ bool get_directory(const char path[], SkTArray<SkString>* entries) {
#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID)
// Open the directory and check for success
DIR* dir = opendir(path);
- if (NULL == dir) {
+ if (nullptr == dir) {
return false;
}
- // Loop through dir entries until there are none left (i.e. readdir returns NULL)
+ // Loop through dir entries until there are none left (i.e. readdir returns nullptr)
struct dirent* entry;
while ((entry = readdir(dir))) {
// dirent only gives relative paths, we need to join them to the base path to check if they
@@ -167,7 +169,7 @@ bool glob_files(const char globPattern[], SkTArray<SkString>* entries) {
#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX)
// TODO Make sure this works on windows. This may require use of FindNextFile windows function.
glob_t globBuffer;
- if (glob(globPattern, 0, NULL, &globBuffer) != 0) {
+ if (glob(globPattern, 0, nullptr, &globBuffer) != 0) {
return false;
}
@@ -190,13 +192,13 @@ bool glob_files(const char globPattern[], SkTArray<SkString>* entries) {
SkString get_absolute_path(const SkString& path) {
#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID)
SkString fullPath(PATH_MAX + 1);
- if (realpath(path.c_str(), fullPath.writable_str()) == NULL) {
+ if (realpath(path.c_str(), fullPath.writable_str()) == nullptr) {
fullPath.reset();
}
return fullPath;
#elif defined(SK_BUILD_FOR_WIN32)
SkString fullPath(MAX_PATH);
- if (_fullpath(fullPath.writable_str(), path.c_str(), MAX_PATH) == NULL) {
+ if (_fullpath(fullPath.writable_str(), path.c_str(), MAX_PATH) == nullptr) {
fullPath.reset();
}
return fullPath;