Global: replaces NULL to nullptr

This commit is contained in:
李通洲
2026-07-10 18:08:04 +08:00
parent 873454191f
commit ba18705d2e
387 changed files with 2411 additions and 2411 deletions
+1 -1
View File
@@ -12,5 +12,5 @@ const char* ffDetectBios(FFBiosResult* bios) {
ffStrbufSetStatic(&bios->type, "Bootloader");
return NULL;
return nullptr;
}
+2 -2
View File
@@ -13,7 +13,7 @@ const char* ffDetectBios(FFBiosResult* bios) {
return "IODeviceTree:/rom not found";
}
FF_CFTYPE_AUTO_RELEASE CFMutableDictionaryRef deviceRomProps = NULL;
FF_CFTYPE_AUTO_RELEASE CFMutableDictionaryRef deviceRomProps = nullptr;
if (IORegistryEntryCreateCFProperties(deviceRom, &deviceRomProps, kCFAllocatorDefault, kNilOptions) != kIOReturnSuccess) {
return "IORegistryEntryCreateCFProperties(deviceRom) failed";
}
@@ -54,5 +54,5 @@ const char* ffDetectBios(FFBiosResult* bios) {
}
#endif
return NULL;
return nullptr;
}
+1 -1
View File
@@ -27,5 +27,5 @@ const char* ffDetectBios(FFBiosResult* result) {
: "BIOS");
}
}
return NULL;
return nullptr;
}
+1 -1
View File
@@ -17,5 +17,5 @@ const char* ffDetectBios(FFBiosResult* bios) {
} else {
ffStrbufSetStatic(&bios->type, "BIOS");
}
return NULL;
return nullptr;
}
+5 -5
View File
@@ -4,17 +4,17 @@
#include "common/io.h"
const char* ffDetectBios(FFBiosResult* bios) {
if (ffSysctlGetString("machdep.dmi.bios-date", &bios->date) == NULL) {
if (ffSysctlGetString("machdep.dmi.bios-date", &bios->date) == nullptr) {
ffCleanUpSmbiosValue(&bios->date);
}
if (ffSysctlGetString("machdep.dmi.bios-version", &bios->version) == NULL) {
if (ffSysctlGetString("machdep.dmi.bios-version", &bios->version) == nullptr) {
ffCleanUpSmbiosValue(&bios->version);
}
if (ffSysctlGetString("machdep.dmi.bios-vendor", &bios->vendor) == NULL) {
if (ffSysctlGetString("machdep.dmi.bios-vendor", &bios->vendor) == nullptr) {
ffCleanUpSmbiosValue(&bios->vendor);
}
if (ffSysctlGetString("machdep.bootmethod", &bios->type) != NULL) {
if (ffSysctlGetString("machdep.bootmethod", &bios->type) != nullptr) {
ffStrbufSetStatic(&bios->type, ffPathExists("/dev/efi", FF_PATHTYPE_FILE) ? "UEFI" : "BIOS");
}
return NULL;
return nullptr;
}
+3 -3
View File
@@ -71,7 +71,7 @@ const char* ffDetectBios(FFBiosResult* bios) {
// Same as GetFirmwareType, but support (?) Windows 7
// https://ntdoc.m417z.com/system_information_class
SYSTEM_BOOT_ENVIRONMENT_INFORMATION sbei;
if (NT_SUCCESS(NtQuerySystemInformation(SystemBootEnvironmentInformation, &sbei, sizeof(sbei), NULL))) {
if (NT_SUCCESS(NtQuerySystemInformation(SystemBootEnvironmentInformation, &sbei, sizeof(sbei), nullptr))) {
switch (sbei.FirmwareType) {
case FirmwareTypeBios:
ffStrbufSetStatic(&bios->type, "BIOS");
@@ -86,7 +86,7 @@ const char* ffDetectBios(FFBiosResult* bios) {
#elif __sun
di_node_t rootNode = di_init("/", DINFOPROP);
if (rootNode != DI_NODE_NIL) {
char* efiVersion = NULL;
char* efiVersion = nullptr;
if (di_prop_lookup_strings(DDI_DEV_T_ANY, rootNode, "efi-version", &efiVersion) > 0) {
ffStrbufSetStatic(&bios->type, "UEFI");
} else {
@@ -103,5 +103,5 @@ const char* ffDetectBios(FFBiosResult* bios) {
ffStrbufSetStatic(&bios->type, deviceEfi ? "UEFI" : "BIOS");
#endif
return NULL;
return nullptr;
}