mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 22:21:18 +00:00
Replace NULL with nullptr
This commit is contained in:
parent
5f11e15571
commit
95a1400a2a
755 changed files with 5742 additions and 5742 deletions
|
|
@ -109,7 +109,7 @@ void OS_Unix::initialize_debugging() {
|
|||
struct sigaction action;
|
||||
memset(&action, 0, sizeof(action));
|
||||
action.sa_handler = handle_interrupt;
|
||||
sigaction(SIGINT, &action, NULL);
|
||||
sigaction(SIGINT, &action, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -172,24 +172,24 @@ String OS_Unix::get_name() const {
|
|||
|
||||
uint64_t OS_Unix::get_unix_time() const {
|
||||
|
||||
return time(NULL);
|
||||
return time(nullptr);
|
||||
};
|
||||
|
||||
uint64_t OS_Unix::get_system_time_secs() const {
|
||||
struct timeval tv_now;
|
||||
gettimeofday(&tv_now, NULL);
|
||||
gettimeofday(&tv_now, nullptr);
|
||||
return uint64_t(tv_now.tv_sec);
|
||||
}
|
||||
|
||||
uint64_t OS_Unix::get_system_time_msecs() const {
|
||||
struct timeval tv_now;
|
||||
gettimeofday(&tv_now, NULL);
|
||||
gettimeofday(&tv_now, nullptr);
|
||||
return uint64_t(tv_now.tv_sec) * 1000 + uint64_t(tv_now.tv_usec) / 1000;
|
||||
}
|
||||
|
||||
OS::Date OS_Unix::get_date(bool utc) const {
|
||||
|
||||
time_t t = time(NULL);
|
||||
time_t t = time(nullptr);
|
||||
struct tm *lt;
|
||||
if (utc)
|
||||
lt = gmtime(&t);
|
||||
|
|
@ -209,7 +209,7 @@ OS::Date OS_Unix::get_date(bool utc) const {
|
|||
}
|
||||
|
||||
OS::Time OS_Unix::get_time(bool utc) const {
|
||||
time_t t = time(NULL);
|
||||
time_t t = time(nullptr);
|
||||
struct tm *lt;
|
||||
if (utc)
|
||||
lt = gmtime(&t);
|
||||
|
|
@ -224,7 +224,7 @@ OS::Time OS_Unix::get_time(bool utc) const {
|
|||
}
|
||||
|
||||
OS::TimeZoneInfo OS_Unix::get_time_zone_info() const {
|
||||
time_t t = time(NULL);
|
||||
time_t t = time(nullptr);
|
||||
struct tm *lt = localtime(&t);
|
||||
char name[16];
|
||||
strftime(name, 16, "%Z", lt);
|
||||
|
|
@ -379,7 +379,7 @@ int OS_Unix::get_process_id() const {
|
|||
|
||||
bool OS_Unix::has_environment(const String &p_var) const {
|
||||
|
||||
return getenv(p_var.utf8().get_data()) != NULL;
|
||||
return getenv(p_var.utf8().get_data()) != nullptr;
|
||||
}
|
||||
|
||||
String OS_Unix::get_locale() const {
|
||||
|
|
@ -433,7 +433,7 @@ Error OS_Unix::get_dynamic_library_symbol_handle(void *p_library_handle, const S
|
|||
p_symbol_handle = dlsym(p_library_handle, p_name.utf8().get_data());
|
||||
|
||||
error = dlerror();
|
||||
if (error != NULL) {
|
||||
if (error != nullptr) {
|
||||
ERR_FAIL_COND_V_MSG(!p_optional, ERR_CANT_RESOLVE, "Can't resolve symbol " + p_name + ". Error: " + error + ".");
|
||||
|
||||
return ERR_CANT_RESOLVE;
|
||||
|
|
@ -511,7 +511,7 @@ String OS_Unix::get_executable_path() const {
|
|||
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
|
||||
char buf[MAXPATHLEN];
|
||||
size_t len = sizeof(buf);
|
||||
if (sysctl(mib, 4, buf, &len, NULL, 0) != 0) {
|
||||
if (sysctl(mib, 4, buf, &len, nullptr, 0) != 0) {
|
||||
WARN_PRINT("Couldn't get executable path from sysctl");
|
||||
return OS::get_executable_path();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue