mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
Style: Remove uses of NULL, substituting nullptr
This commit is contained in:
parent
93f4388e45
commit
5d5c32cec1
Notes:
sideshowbarker
2024-07-19 01:55:01 +09:00
Author: https://github.com/mlcurry 🔰
Commit: 5d5c32cec1
Pull-request: https://github.com/SerenityOS/serenity/pull/3756
7 changed files with 8 additions and 8 deletions
|
@ -760,7 +760,7 @@ void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, int
|
||||||
nmemb /= 2;
|
nmemb /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
div_t div(int numerator, int denominator)
|
div_t div(int numerator, int denominator)
|
||||||
|
|
|
@ -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));
|
struct cmsghdr* next = (struct cmsghdr*)((char*)cmsg + CMSG_ALIGN(cmsg->cmsg_len));
|
||||||
unsigned offset = (char*)next - (char*)msg->msg_control;
|
unsigned offset = (char*)next - (char*)msg->msg_control;
|
||||||
if (msg->msg_controllen < offset + sizeof(struct cmsghdr))
|
if (msg->msg_controllen < offset + sizeof(struct cmsghdr))
|
||||||
return NULL;
|
return nullptr;
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ CODE prioritynames[] = {
|
||||||
{ "none", INTERNAL_NOPRI },
|
{ "none", INTERNAL_NOPRI },
|
||||||
{ "notice", LOG_NOTICE },
|
{ "notice", LOG_NOTICE },
|
||||||
{ "warning", LOG_WARNING },
|
{ "warning", LOG_WARNING },
|
||||||
{ NULL, -1 },
|
{ nullptr, -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
CODE facilitynames[] = {
|
CODE facilitynames[] = {
|
||||||
|
@ -158,7 +158,7 @@ CODE facilitynames[] = {
|
||||||
{ "syslog", LOG_SYSLOG },
|
{ "syslog", LOG_SYSLOG },
|
||||||
{ "user", LOG_USER },
|
{ "user", LOG_USER },
|
||||||
{ "uucp", LOG_UUCP },
|
{ "uucp", LOG_UUCP },
|
||||||
{ NULL, -1 },
|
{ nullptr, -1 },
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -745,7 +745,7 @@ static bool decode_png_bitmap(PNGLoadingContext& context)
|
||||||
|
|
||||||
unsigned long srclen = context.compressed_data.size() - 6;
|
unsigned long srclen = context.compressed_data.size() - 6;
|
||||||
unsigned long destlen = 0;
|
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) {
|
if (ret != 0) {
|
||||||
context.state = PNGLoadingContext::State::Error;
|
context.state = PNGLoadingContext::State::Error;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -72,7 +72,7 @@ int main(int argc, char** argv)
|
||||||
sigemptyset(&blocked);
|
sigemptyset(&blocked);
|
||||||
sigaddset(&blocked, SIGTTOU);
|
sigaddset(&blocked, SIGTTOU);
|
||||||
sigaddset(&blocked, SIGTTIN);
|
sigaddset(&blocked, SIGTTIN);
|
||||||
pthread_sigmask(SIG_BLOCK, &blocked, NULL);
|
pthread_sigmask(SIG_BLOCK, &blocked, nullptr);
|
||||||
#endif
|
#endif
|
||||||
#ifdef __serenity__
|
#ifdef __serenity__
|
||||||
if (pledge("stdio rpath wpath cpath proc exec tty accept sigaction unix fattr", nullptr) < 0) {
|
if (pledge("stdio rpath wpath cpath proc exec tty accept sigaction unix fattr", nullptr) < 0) {
|
||||||
|
|
|
@ -175,7 +175,7 @@ int main(int argc, char** argv)
|
||||||
highest_fd = max(highest_fd, fd);
|
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 (ready == -1) {
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -65,7 +65,7 @@ static Count get_count(const String& file_name)
|
||||||
file_pointer = stdin;
|
file_pointer = stdin;
|
||||||
} else {
|
} else {
|
||||||
count.name = file_name;
|
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());
|
fprintf(stderr, "wc: unable to open %s\n", file_name.characters());
|
||||||
count.exists = false;
|
count.exists = false;
|
||||||
return count;
|
return count;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue