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
@@ -35,7 +35,7 @@ static inline const char* getVendorString(unsigned vendorId) {
case 0x0467:
return "Ramaxel";
default:
return NULL;
return nullptr;
}
}
@@ -61,7 +61,7 @@ void FFPhysicalMemoryUpdateVendorString(FFPhysicalMemoryResult* device) {
memcpy(vendorIdStr, device->vendor.chars, 4);
}
vendorIdStr[4] = '\0';
char* pEnd = NULL;
char* pEnd = nullptr;
uint32_t vendorId = (uint32_t) strtoul(vendorIdStr, &pEnd, 16);
if (*pEnd != '\0') {
return;
@@ -37,7 +37,7 @@ static void appendDevice(
if (size)
{
char* unit = NULL;
char* unit = nullptr;
device->size = strtoul(size.UTF8String, &unit, 10);
if (*unit == ' ') ++unit;
@@ -52,7 +52,7 @@ static void appendDevice(
if (speed)
{
char* unit = NULL;
char* unit = nullptr;
device->maxSpeed = (uint32_t) strtoul(speed.UTF8String, &unit, 10);
if (*unit == ' ') ++unit;
@@ -74,8 +74,8 @@ static const char* detectFromSystemProfiler(FFlist* result)
"-xml",
"-detailLevel",
"full",
NULL
}) != NULL)
nullptr
}) != nullptr)
return "Starting `system_profiler SPMemoryDataType -xml -detailLevel full` failed";
NSArray* arr = [NSPropertyListSerialization propertyListWithData:[NSData dataWithBytes:buffer.chars length:buffer.length]
@@ -118,7 +118,7 @@ static const char* detectFromSystemProfiler(FFlist* result)
}
}
return NULL;
return nullptr;
}
FF_A_UNUSED static const char* detectFromIokit(FFlist* result)
@@ -149,14 +149,14 @@ FF_A_UNUSED static const char* detectFromIokit(FFlist* result)
ffCfStrGetString(dramType, &device->type);
ffCfStrGetString(dramVendor, &device->vendor);
ffCfNumGetInt64(dramSize, (int64_t*) &device->size);
return NULL;
return nullptr;
}
const char* ffDetectPhysicalMemory(FF_A_UNUSED FFPhysicalMemoryOptions* options, FFlist* result)
{
#if __aarch64__
if (detectFromIokit(result) == NULL)
return NULL;
if (detectFromIokit(result) == nullptr)
return nullptr;
#endif
return detectFromSystemProfiler(result);
@@ -129,7 +129,7 @@ const char* ffDetectPhysicalMemory(FFPhysicalMemoryOptions* options, FFlist* res
}
const char* formFactorNames[] = {
NULL, // 0x00 (Placeholder for indexing)
nullptr, // 0x00 (Placeholder for indexing)
"Other", // 0x01
"Unknown", // 0x02
"SIMM", // 0x03
@@ -157,7 +157,7 @@ const char* ffDetectPhysicalMemory(FFPhysicalMemoryOptions* options, FFlist* res
}
const char* memoryTypeNames[] = {
NULL, // 0x00 (Placeholder for indexing)
nullptr, // 0x00 (Placeholder for indexing)
"Other", // 0x01
"Unknown", // 0x02
"DRAM", // 0x03
@@ -231,5 +231,5 @@ const char* ffDetectPhysicalMemory(FFPhysicalMemoryOptions* options, FFlist* res
}
}
return NULL;
return nullptr;
}