Skip to content

Commit 7116f67

Browse files
committed
Avoid NULL for non-pointer
FreeBSD and OpenBSD define NULL as nullptr for C++11 or later. freebsd/freebsd-src@c8ed04c openbsd/src@6ecde74 Source/GmmLib/TranslationTable/GmmPageTableMgr.cpp:415:21: error: non-pointer operand type 'GMM_GFX_ADDRESS' (aka 'unsigned long') incompatible with nullptr return AuxTTObj ? AuxTTObj->GetL3Address() : NULL; ^ ~~~~~~~~~~~~~~~~~~~~~~~~ Source/GmmLib/TranslationTable/GmmPageTableMgr.cpp:474:28: error: invalid operands to binary expression ('GMM_GFX_ADDRESS' (aka 'unsigned long') and 'nullptr_t') if(GetAuxL3TableAddr() == NULL) ~~~~~~~~~~~~~~~~~~~ ^ ~~~~
1 parent 21888bb commit 7116f67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/GmmLib/TranslationTable/GmmPageTableMgr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ GmmLib::GmmPageTableMgr::GmmPageTableMgr(GMM_DEVICE_CALLBACKS_INT *DeviceCB, uin
412412
/////////////////////////////////////////////////////////////////////////////////////
413413
GMM_GFX_ADDRESS GmmLib::GmmPageTableMgr::GetAuxL3TableAddr()
414414
{
415-
return AuxTTObj ? AuxTTObj->GetL3Address() : NULL;
415+
return AuxTTObj ? AuxTTObj->GetL3Address() : 0;
416416
}
417417

418418
/////////////////////////////////////////////////////////////////////////////////////
@@ -471,7 +471,7 @@ GMM_STATUS GmmLib::GmmPageTableMgr::InitContextAuxTableRegister(HANDLE CmdQHandl
471471
/////////////////////////////////////////////////////////////////////////////////////
472472
GMM_STATUS GmmLib::GmmPageTableMgr::UpdateAuxTable(const GMM_DDI_UPDATEAUXTABLE *UpdateReq)
473473
{
474-
if(GetAuxL3TableAddr() == NULL)
474+
if(GetAuxL3TableAddr() == 0)
475475
{
476476
GMM_ASSERTDPF(0, "Invalid AuxTable update request, AuxTable is not initialized");
477477
return GMM_INVALIDPARAM;

0 commit comments

Comments
 (0)