mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
dial back nullPtr usage
while it still remains a good idea to port as many NULL compares and assignments over to nullPtr as feasable, we do still need to sort out how to better support scripted empty, false, and zero assigns for things like objectIDs. this means we'll need to both fully convert the backend of the parser to support that kind of thing, but also alter most if not all exisiting NULLs. up to and including things like SAFE_DELETE. while that's certainly feasable, given there's aproximatel 400 nullptr assigns/checks prior to this commit, and roughly 1800 of the prior, if it terminates in a script call and not an aip one direct, we'll be dialing that back until such time as fork fully fopcused on converting and resolving any lingering mismatches is completed.
This commit is contained in:
parent
e9205027f7
commit
5ffa3b81f1
84 changed files with 319 additions and 319 deletions
|
|
@ -803,7 +803,7 @@ void GuiInspector::sendInspectPostApply()
|
|||
|
||||
S32 GuiInspector::createInspectorGroup(StringTableEntry groupName, S32 index)
|
||||
{
|
||||
GuiInspectorGroup* newGroup = nullptr;
|
||||
GuiInspectorGroup* newGroup = NULL;
|
||||
newGroup = findExistentGroup(groupName);
|
||||
if (newGroup)
|
||||
return newGroup->getId(); //if we already have a group under this name, just return it
|
||||
|
|
@ -830,7 +830,7 @@ S32 GuiInspector::createInspectorGroup(StringTableEntry groupName, S32 index)
|
|||
void GuiInspector::removeInspectorGroup(StringTableEntry groupName)
|
||||
{
|
||||
GuiInspectorGroup* group = findExistentGroup(groupName);
|
||||
if (group == nullptr)
|
||||
if (group == NULL)
|
||||
return;
|
||||
|
||||
mGroups.remove(group);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public:
|
|||
if (!mTargets.empty())
|
||||
return mTargets[index];
|
||||
else
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
S32 getComponentGroupTargetId() { return mComponentGroupTargetId; }
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ void GuiMenuBar::onRemove()
|
|||
if (Sim::findObject("PopUpMenuControl", backgroundCtrl))
|
||||
{
|
||||
if (backgroundCtrl->mMenuBarCtrl == this)
|
||||
backgroundCtrl->mMenuBarCtrl = nullptr;
|
||||
backgroundCtrl->mMenuBarCtrl = NULL;
|
||||
}
|
||||
|
||||
Parent::onRemove();
|
||||
|
|
@ -310,7 +310,7 @@ void GuiMenuBar::onMouseMove(const GuiEvent &event)
|
|||
{
|
||||
MenuEntry *hit = findHitMenu(event.mousePoint);
|
||||
|
||||
if (mouseDownMenu != nullptr && hit != nullptr)
|
||||
if (mouseDownMenu != NULL && hit != NULL)
|
||||
{
|
||||
//we have a standing click, so just update and go
|
||||
mouseDownMenu = mouseOverMenu = hit;
|
||||
|
|
@ -526,15 +526,15 @@ void GuiMenuBar::processTick()
|
|||
|
||||
void GuiMenuBar::insert(SimObject* pObject, S32 pos)
|
||||
{
|
||||
PopupMenu* menu = nullptr;
|
||||
if (pObject != nullptr)
|
||||
PopupMenu* menu = NULL;
|
||||
if (pObject != NULL)
|
||||
{
|
||||
menu = dynamic_cast<PopupMenu*>(pObject);
|
||||
}
|
||||
|
||||
if (menu == nullptr)
|
||||
if (menu == NULL)
|
||||
{
|
||||
if (pObject != nullptr)
|
||||
if (pObject != NULL)
|
||||
{
|
||||
Con::errorf("GuiMenuBar::insert() - attempted to insert non-popupMenu object: %d", pObject->getId());
|
||||
}
|
||||
|
|
@ -564,15 +564,15 @@ void GuiMenuBar::insert(SimObject* pObject, S32 pos)
|
|||
|
||||
void GuiMenuBar::remove(SimObject* pObject)
|
||||
{
|
||||
PopupMenu* menu = nullptr;
|
||||
if (pObject != nullptr)
|
||||
PopupMenu* menu = NULL;
|
||||
if (pObject != NULL)
|
||||
{
|
||||
menu = dynamic_cast<PopupMenu*>(pObject);
|
||||
}
|
||||
|
||||
if (menu == nullptr)
|
||||
if (menu == NULL)
|
||||
{
|
||||
if (pObject != nullptr)
|
||||
if (pObject != NULL)
|
||||
{
|
||||
Con::errorf("GuiMenuBar::insert() - attempted to insert non-popupMenu object: %d", pObject->getId());
|
||||
}
|
||||
|
|
@ -597,7 +597,7 @@ void GuiMenuBar::remove(SimObject* pObject)
|
|||
PopupMenu* GuiMenuBar::getMenu(U32 index)
|
||||
{
|
||||
if (index >= mMenuList.size())
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
return mMenuList[index].popupMenu;
|
||||
}
|
||||
|
|
@ -610,7 +610,7 @@ PopupMenu* GuiMenuBar::findMenu(String barTitle)
|
|||
return mMenuList[i].popupMenu;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -631,7 +631,7 @@ DefineEngineMethod(GuiMenuBar, removeFromCanvas, void, (), , "()")
|
|||
GuiCanvas* canvas = object->getRoot();
|
||||
|
||||
if(canvas)
|
||||
canvas->setMenuBar(nullptr);
|
||||
canvas->setMenuBar(NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -648,7 +648,7 @@ DefineEngineMethod(GuiMenuBar, getMenu, S32, (S32 index), (0), "(Index)")
|
|||
//-----------------------------------------------------------------------------
|
||||
DefineEngineMethod(GuiMenuBar, insert, void, (SimObject* pObject, S32 pos), (nullAsType<SimObject*>(), -1), "(object, pos) insert object at position")
|
||||
{
|
||||
if(pObject == nullptr)
|
||||
if(pObject == NULL)
|
||||
{
|
||||
Con::errorf("GuiMenuBar::insert() - null object");
|
||||
return;
|
||||
|
|
@ -658,7 +658,7 @@ DefineEngineMethod(GuiMenuBar, insert, void, (SimObject* pObject, S32 pos), (nul
|
|||
|
||||
DefineEngineMethod(GuiMenuBar, remove, void, (SimObject* pObject), (nullAsType<SimObject*>()), "(object, pos) remove object")
|
||||
{
|
||||
if (pObject == nullptr)
|
||||
if (pObject == NULL)
|
||||
{
|
||||
Con::errorf("GuiMenuBar::remove() - null object");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
GuiPopupMenuBackgroundCtrl::GuiPopupMenuBackgroundCtrl()
|
||||
{
|
||||
mMenuBarCtrl = nullptr;
|
||||
mMenuBarCtrl = NULL;
|
||||
}
|
||||
|
||||
void GuiPopupMenuBackgroundCtrl::onMouseDown(const GuiEvent &event)
|
||||
|
|
@ -62,7 +62,7 @@ void GuiPopupMenuBackgroundCtrl::close()
|
|||
if(getRoot())
|
||||
getRoot()->removeObject(this);
|
||||
|
||||
mMenuBarCtrl = nullptr;
|
||||
mMenuBarCtrl = NULL;
|
||||
}
|
||||
|
||||
S32 GuiPopupMenuBackgroundCtrl::findPopupMenu(PopupMenu* menu)
|
||||
|
|
@ -91,8 +91,8 @@ GuiPopupMenuTextListCtrl::GuiPopupMenuTextListCtrl()
|
|||
{
|
||||
isSubMenu = false; // Added
|
||||
|
||||
mMenuBar = nullptr;
|
||||
mPopup = nullptr;
|
||||
mMenuBar = NULL;
|
||||
mPopup = NULL;
|
||||
|
||||
mLastHighlightedMenuIdx = -1;
|
||||
mBackground = NULL;
|
||||
|
|
@ -284,7 +284,7 @@ void GuiPopupMenuTextListCtrl::onCellHighlighted(Point2I cell)
|
|||
{
|
||||
MenuItem *list = &mPopup->mMenuItems[selectionIndex];
|
||||
|
||||
if (list->mIsSubmenu && list->mSubMenu != nullptr)
|
||||
if (list->mIsSubmenu && list->mSubMenu != NULL)
|
||||
{
|
||||
list->mSubMenu->showPopup(getRoot(), getPosition().x + mCellSize.x, getPosition().y + (selectionIndex * mCellSize.y));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ bool GuiShapeEdPreview::mountShape(const char* shapeAssetId, const char* nodeNam
|
|||
|
||||
ShapeAsset* model = AssetDatabase.acquireAsset<ShapeAsset>(shapeAssetId);
|
||||
|
||||
if (model == nullptr || !model->getShapeResource())
|
||||
if (model == NULL || !model->getShapeResource())
|
||||
return false;
|
||||
|
||||
TSShapeInstance* tsi = new TSShapeInstance(model->getShapeResource(), true );
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ void GuiInspectorField::setWordData(const S32& wordIndex, const char* data, bool
|
|||
|
||||
if (mSpecialEditField)
|
||||
{
|
||||
if (mTargetObject != nullptr && mVariableName != StringTable->EmptyString())
|
||||
if (mTargetObject != NULL && mVariableName != StringTable->EmptyString())
|
||||
{
|
||||
const char* fieldData = mTargetObject->getDataField(mVariableName, NULL);
|
||||
const char* wordData = StringUnit::getUnit(fieldData, wordIndex, " \t\n");
|
||||
|
|
@ -495,7 +495,7 @@ void GuiInspectorField::setData( const char* data, bool callbacks )
|
|||
{
|
||||
if (mSpecialEditField)
|
||||
{
|
||||
if (mTargetObject != nullptr && mVariableName != StringTable->EmptyString())
|
||||
if (mTargetObject != NULL && mVariableName != StringTable->EmptyString())
|
||||
{
|
||||
mTargetObject->setDataField(mVariableName, NULL, data);
|
||||
|
||||
|
|
@ -645,7 +645,7 @@ const char* GuiInspectorField::getData( U32 inspectObjectIndex )
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mTargetObject != nullptr && mVariableName != StringTable->EmptyString())
|
||||
if (mTargetObject != NULL && mVariableName != StringTable->EmptyString())
|
||||
{
|
||||
return mTargetObject->getDataField(mVariableName, NULL);
|
||||
}
|
||||
|
|
@ -911,7 +911,7 @@ void GuiInspectorField::_registerEditControl(GuiControl* ctrl, StringTableEntry
|
|||
ctrl->setInternalName(suffix);
|
||||
|
||||
char szName[512];
|
||||
if (mInspector->getInspectObject() != nullptr)
|
||||
if (mInspector->getInspectObject() != NULL)
|
||||
dSprintf(szName, 512, "IE_%s_%d_%s_%s_Field", ctrl->getClassName(), mInspector->getInspectObject()->getId(), suffix, mCaption);
|
||||
else
|
||||
dSprintf(szName, 512, "IE_%s_%s_%s_Field", ctrl->getClassName(), suffix, mCaption);
|
||||
|
|
|
|||
|
|
@ -696,7 +696,7 @@ void GuiInspectorGroup::addInspectorField(StringTableEntry name, StringTableEntr
|
|||
else
|
||||
fieldGui = constructField(fieldType);
|
||||
|
||||
if (fieldGui == nullptr)
|
||||
if (fieldGui == NULL)
|
||||
{
|
||||
//call down into script and see if there's special handling for that type of field
|
||||
//this allows us to have completely special-case field types implemented entirely in script
|
||||
|
|
@ -750,7 +750,7 @@ void GuiInspectorGroup::removeInspectorField(StringTableEntry name)
|
|||
{
|
||||
GuiInspectorField* field = dynamic_cast<GuiInspectorField*>(mStack->getObject(i));
|
||||
|
||||
if (field == nullptr)
|
||||
if (field == NULL)
|
||||
continue;
|
||||
|
||||
if (field->getFieldName() == name || field->getSpecialEditVariableName() == name)
|
||||
|
|
@ -764,7 +764,7 @@ void GuiInspectorGroup::removeInspectorField(StringTableEntry name)
|
|||
void GuiInspectorGroup::hideInspectorField(StringTableEntry fieldName, bool setHidden)
|
||||
{
|
||||
SimObject* inspectObj = mParent->getInspectObject();
|
||||
if (inspectObj == nullptr)
|
||||
if (inspectObj == NULL)
|
||||
return;
|
||||
|
||||
AbstractClassRep::Field* field = const_cast<AbstractClassRep::Field*>(inspectObj->getClassRep()->findField(fieldName));
|
||||
|
|
@ -787,7 +787,7 @@ void GuiInspectorGroup::replaceInspectorField(StringTableEntry fieldName, GuiIns
|
|||
{
|
||||
GuiInspectorField* field = dynamic_cast<GuiInspectorField*>(mStack->getObject(i));
|
||||
|
||||
if (field == nullptr)
|
||||
if (field == NULL)
|
||||
continue;
|
||||
|
||||
if (field->getFieldName() == fieldName || field->getSpecialEditVariableName() == fieldName)
|
||||
|
|
@ -878,7 +878,7 @@ DefineEngineMethod(GuiInspectorGroup, findField, S32, (const char* fieldName),,
|
|||
return 0;
|
||||
|
||||
GuiInspectorField* field = object->findField(StringTable->insert(fieldName));
|
||||
if (field == nullptr)
|
||||
if (field == NULL)
|
||||
return 0;
|
||||
|
||||
return field->getId();
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ bool GuiInspectorVariableField::onAdd()
|
|||
|
||||
void GuiInspectorVariableField::setData( const char* data, bool callbacks )
|
||||
{
|
||||
if (mOwnerObject == nullptr && mVariableName == StringTable->EmptyString())
|
||||
if (mOwnerObject == NULL && mVariableName == StringTable->EmptyString())
|
||||
{
|
||||
if (!mCaption || mCaption[0] == 0)
|
||||
return;
|
||||
|
|
@ -106,7 +106,7 @@ void GuiInspectorVariableField::setData( const char* data, bool callbacks )
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mOwnerObject != nullptr)
|
||||
if (mOwnerObject != NULL)
|
||||
{
|
||||
//Special case: if our object is a Settings class, we'll assume that we're trying to get/set the fields via the Setting class's normal behavior
|
||||
//otherwise, use fields as normal
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ void GuiVariableInspector::update()
|
|||
for (U32 i = 0; i < mFields.size(); i++)
|
||||
{
|
||||
//first, get the var's group name. if the group exists, we'll add to it's list
|
||||
GuiInspectorVariableGroup *group = nullptr;
|
||||
GuiInspectorVariableGroup *group = NULL;
|
||||
|
||||
for (U32 g = 0; g < mGroups.size(); g++)
|
||||
{
|
||||
|
|
@ -83,7 +83,7 @@ void GuiVariableInspector::update()
|
|||
}
|
||||
}
|
||||
|
||||
if (group == nullptr)
|
||||
if (group == NULL)
|
||||
{
|
||||
group = new GuiInspectorVariableGroup();
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ void GuiVariableInspector::addField(const char* name, const char* label, const c
|
|||
|
||||
//establish the field on the ownerObject(if we have one)
|
||||
//This way, we can let the field hook into the object's field and modify it when changed
|
||||
if (newField->mOwnerObject != nullptr)
|
||||
if (newField->mOwnerObject != NULL)
|
||||
{
|
||||
if (!newField->mOwnerObject->isField(newField->mFieldName))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public:
|
|||
PopupMenu::PopupMenu()
|
||||
{
|
||||
mMenuItems = 0;
|
||||
mMenuBarCtrl = nullptr;
|
||||
mMenuBarCtrl = NULL;
|
||||
|
||||
mBarTitle = StringTable->EmptyString();
|
||||
mBounds = RectI(0, 0, 64, 64);
|
||||
|
|
@ -57,7 +57,7 @@ PopupMenu::PopupMenu()
|
|||
mDrawBitmapOnly = false;
|
||||
mDrawBorder = false;
|
||||
|
||||
mTextList = nullptr;
|
||||
mTextList = NULL;
|
||||
|
||||
mIsSubmenu = false;
|
||||
|
||||
|
|
@ -168,8 +168,8 @@ S32 PopupMenu::insertItem(S32 pos, const char *title, const char* accelerator, c
|
|||
newItem.mEnabled = !newItem.mIsSpacer;
|
||||
|
||||
newItem.mIsSubmenu = false;
|
||||
newItem.mSubMenu = nullptr;
|
||||
newItem.mSubMenuParentMenu = nullptr;
|
||||
newItem.mSubMenu = NULL;
|
||||
newItem.mSubMenuParentMenu = NULL;
|
||||
|
||||
mMenuItems.push_back(newItem);
|
||||
|
||||
|
|
@ -308,7 +308,7 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */)
|
|||
if (!profile)
|
||||
return;
|
||||
|
||||
if (mTextList == nullptr)
|
||||
if (mTextList == NULL)
|
||||
{
|
||||
mTextList = new GuiPopupMenuTextListCtrl();
|
||||
mTextList->registerObject();
|
||||
|
|
@ -350,7 +350,7 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */)
|
|||
owner->pushDialogControl(backgroundCtrl, 10);
|
||||
|
||||
//Set the background control's menubar, if any, and if it's not already set
|
||||
if(backgroundCtrl->mMenuBarCtrl == nullptr)
|
||||
if(backgroundCtrl->mMenuBarCtrl == NULL)
|
||||
backgroundCtrl->mMenuBarCtrl = getMenuBarCtrl();
|
||||
|
||||
backgroundCtrl->setExtent(owner->getExtent());
|
||||
|
|
@ -473,7 +473,7 @@ void PopupMenu::hidePopupSubmenus()
|
|||
{
|
||||
for (U32 i = 0; i < mMenuItems.size(); i++)
|
||||
{
|
||||
if (mMenuItems[i].mSubMenu != nullptr)
|
||||
if (mMenuItems[i].mSubMenu != NULL)
|
||||
mMenuItems[i].mSubMenu->hidePopup();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue