diff --git a/Libraries/LibC/stdlib.cpp b/Libraries/LibC/stdlib.cpp index 2adcba1d44..b65455214b 100644 --- a/Libraries/LibC/stdlib.cpp +++ b/Libraries/LibC/stdlib.cpp @@ -760,7 +760,7 @@ void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, int nmemb /= 2; } - return NULL; + return nullptr; } div_t div(int numerator, int denominator) diff --git a/Libraries/LibC/sys/socket.h b/Libraries/LibC/sys/socket.h index 298b863388..e39092c0d7 100644 --- a/Libraries/LibC/sys/socket.h +++ b/Libraries/LibC/sys/socket.h @@ -169,7 +169,7 @@ static inline struct cmsghdr* CMSG_NXTHDR(struct msghdr* msg, struct cmsghdr* cm struct cmsghdr* next = (struct cmsghdr*)((char*)cmsg + CMSG_ALIGN(cmsg->cmsg_len)); unsigned offset = (char*)next - (char*)msg->msg_control; if (msg->msg_controllen < offset + sizeof(struct cmsghdr)) - return NULL; + return nullptr; return next; } diff --git a/Libraries/LibC/syslog.h b/Libraries/LibC/syslog.h index 77f3e419eb..1a396e67f6 100644 --- a/Libraries/LibC/syslog.h +++ b/Libraries/LibC/syslog.h @@ -132,7 +132,7 @@ CODE prioritynames[] = { { "none", INTERNAL_NOPRI }, { "notice", LOG_NOTICE }, { "warning", LOG_WARNING }, - { NULL, -1 }, + { nullptr, -1 }, }; CODE facilitynames[] = { @@ -158,7 +158,7 @@ CODE facilitynames[] = { { "syslog", LOG_SYSLOG }, { "user", LOG_USER }, { "uucp", LOG_UUCP }, - { NULL, -1 }, + { nullptr, -1 }, }; #endif diff --git a/Libraries/LibGfx/PNGLoader.cpp b/Libraries/LibGfx/PNGLoader.cpp index 0dae43e948..320787e5f7 100644 --- a/Libraries/LibGfx/PNGLoader.cpp +++ b/Libraries/LibGfx/PNGLoader.cpp @@ -745,7 +745,7 @@ static bool decode_png_bitmap(PNGLoadingContext& context) unsigned long srclen = context.compressed_data.size() - 6; unsigned long destlen = 0; - int ret = puff(NULL, &destlen, context.compressed_data.data() + 2, &srclen); + int ret = puff(nullptr, &destlen, context.compressed_data.data() + 2, &srclen); if (ret != 0) { context.state = PNGLoadingContext::State::Error; return false; diff --git a/Shell/main.cpp b/Shell/main.cpp index cf1dfddf1b..4ab4805a5b 100644 --- a/Shell/main.cpp +++ b/Shell/main.cpp @@ -72,7 +72,7 @@ int main(int argc, char** argv) sigemptyset(&blocked); sigaddset(&blocked, SIGTTOU); sigaddset(&blocked, SIGTTIN); - pthread_sigmask(SIG_BLOCK, &blocked, NULL); + pthread_sigmask(SIG_BLOCK, &blocked, nullptr); #endif #ifdef __serenity__ if (pledge("stdio rpath wpath cpath proc exec tty accept sigaction unix fattr", nullptr) < 0) { diff --git a/Userland/nc.cpp b/Userland/nc.cpp index 13fee77f10..1f726488f0 100644 --- a/Userland/nc.cpp +++ b/Userland/nc.cpp @@ -175,7 +175,7 @@ int main(int argc, char** argv) highest_fd = max(highest_fd, fd); } - int ready = select(highest_fd + 1, &readfds, &writefds, &exceptfds, NULL); + int ready = select(highest_fd + 1, &readfds, &writefds, &exceptfds, nullptr); if (ready == -1) { if (errno == EINTR) continue; diff --git a/Userland/wc.cpp b/Userland/wc.cpp index 497e5e937d..708df9c96b 100644 --- a/Userland/wc.cpp +++ b/Userland/wc.cpp @@ -65,7 +65,7 @@ static Count get_count(const String& file_name) file_pointer = stdin; } else { count.name = file_name; - if ((file_pointer = fopen(file_name.characters(), "r")) == NULL) { + if ((file_pointer = fopen(file_name.characters(), "r")) == nullptr) { fprintf(stderr, "wc: unable to open %s\n", file_name.characters()); count.exists = false; return count;