| Index: tools/skpdiff/skpdiff_util.cpp
|
| diff --git a/tools/skpdiff/skpdiff_util.cpp b/tools/skpdiff/skpdiff_util.cpp
|
| index 4b5d52110b587f457732765b371cad1d12487771..d33ca24a3ab23bb42aa1261cbdccb080d70275e6 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(¤tTime, NULL);
|
| + gettimeofday(¤tTime, 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;
|
|
|