Replace zero constants with nullptr

This commit is contained in:
Dr. Dystopia
2026-07-29 18:15:38 +02:00
parent 73de7b8d3e
commit 61e97c9a09
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -427,7 +427,7 @@ u64 GetHash64(const u8* src, u32 len, u32 samples)
u32 StartCRC32()
{
return crc32_z(0L, Z_NULL, 0);
return crc32_z(0L, nullptr, 0);
}
u32 UpdateCRC32(u32 crc, const u8* data, size_t len)
+2 -2
View File
@@ -149,8 +149,8 @@ void* LazyMemoryRegion::Create(size_t size)
if (size == 0)
return nullptr;
void* memory =
mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0);
void* memory = mmap(nullptr, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0);
if (memory == MAP_FAILED)
{
NOTICE_LOG_FMT(MEMMAP, "Memory allocation of {} bytes failed.", size);
+1 -1
View File
@@ -17,7 +17,7 @@ std::optional<std::tm> LocalTime(std::time_t time)
#ifdef _MSC_VER
if (localtime_s(&local_time, &time) != 0)
#else
if (localtime_r(&time, &local_time) == NULL)
if (localtime_r(&time, &local_time) == nullptr)
#endif
{
ERROR_LOG_FMT(COMMON, "Failed to convert time to local time: {}", std::strerror(errno));
@@ -231,7 +231,7 @@ private:
// It is used by the assembly dispatcher to quickly
// know where to jump based on pc and msr bits.
Common::LazyMemoryRegion m_entry_points_arena;
u8** m_entry_points_ptr = 0;
u8** m_entry_points_ptr = nullptr;
// An alternative for the above but without a shm segment
// in case the shm memory region couldn't be allocated.
@@ -78,7 +78,7 @@ private:
opt.decorationSize = QSize(0, 0);
// Default draw command for paint.
QApplication::style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter, 0);
QApplication::style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter, nullptr);
// Draw pixmap at the center of the tablewidget cell
QPixmap pix = qvariant_cast<QPixmap>(index.data(Qt::DecorationRole));
@@ -191,7 +191,7 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
if (g_ActiveConfig.bShowGraphs)
{
// A font size of 13 is small enough to keep the tick numbers from overlapping too much.
ImGui::PushFont(NULL, 13.0f);
ImGui::PushFont(nullptr, 13.0f);
ImGui::PushStyleColor(ImGuiCol_ResizeGrip, 0);
const auto graph_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings |
ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoNav | movable_flag |