Skip to content

Commit e8b52ac

Browse files
[libc][NFC] replace NULL with nullptr (llvm#134464)
Simple cleanup
1 parent 7001993 commit e8b52ac

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

libc/src/sys/time/linux/utimes.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ LLVM_LIBC_FUNCTION(int, utimes,
3030
#elif defined(SYS_utimensat)
3131
// the utimensat syscall requires a timespec struct, not timeval.
3232
struct timespec ts[2];
33-
struct timespec *ts_ptr = nullptr; // default value if times is NULL
33+
struct timespec *ts_ptr = nullptr; // default value if times is nullptr
3434

3535
// convert the microsec values in timeval struct times
3636
// to nanosecond values in timespec struct ts
37-
if (times != NULL) {
37+
if (times != nullptr) {
3838

3939
// ensure consistent values
4040
if ((times[0].tv_usec < 0 || times[1].tv_usec < 0) ||
@@ -54,7 +54,7 @@ LLVM_LIBC_FUNCTION(int, utimes,
5454
ts_ptr = ts;
5555
}
5656

57-
// If times was NULL, ts_ptr remains NULL, which utimensat interprets
57+
// If times was nullptr, ts_ptr remains nullptr, which utimensat interprets
5858
// as setting times to the current time.
5959

6060
// utimensat syscall.

libc/test/src/time/ctime_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
#include "test/UnitTest/Test.h"
1212
#include "test/src/time/TmHelper.h"
1313

14-
TEST(LlvmLibcCtime, NULL) {
14+
TEST(LlvmLibcCtime, nullptr) {
1515
char *result;
16-
result = LIBC_NAMESPACE::ctime(NULL);
17-
ASSERT_STREQ(NULL, result);
16+
result = LIBC_NAMESPACE::ctime(nullptr);
17+
ASSERT_STREQ(nullptr, result);
1818
}
1919

2020
TEST(LlvmLibcCtime, ValidUnixTimestamp0) {
@@ -38,5 +38,5 @@ TEST(LlvmLibcCtime, InvalidArgument) {
3838
char *result;
3939
t = 2147483648;
4040
result = LIBC_NAMESPACE::ctime(&t);
41-
ASSERT_STREQ(NULL, result);
41+
ASSERT_STREQ(nullptr, result);
4242
}

0 commit comments

Comments
 (0)