DRTVWR-418: Casting pointer to BOOL is just wrong.

Since BOOL is simply a typedef for int, casting a 64-bit pointer to 32-bit int
is correctly diagnosed by the compiler as an error.

What works is to cast the pointer to (lowercase) bool, the builtin type, which
engages the compiler's test for "is this pointer NULL?"
master
Nat Goodspeed 2016-12-20 09:39:31 -05:00
parent 42b8895c54
commit 2499f6bcff
2 changed files with 2 additions and 2 deletions

View File

@ -184,7 +184,7 @@ void LLFloaterBump::onScrollListRightClicked(LLUICtrl* ctrl, S32 x, S32 y)
std::string mute_msg = (LLMuteList::getInstance()->isMuted(mItemUUID, mNames[mItemUUID])) ? "UnmuteAvatar" : "MuteAvatar";
mPopupMenu->getChild<LLUICtrl>("Avatar Mute")->setValue(LLTrans::getString(mute_msg));
mPopupMenu->setItemEnabled(std::string("Zoom In"), (BOOL)gObjectList.findObject(mItemUUID));
mPopupMenu->setItemEnabled(std::string("Zoom In"), bool(gObjectList.findObject(mItemUUID)));
((LLContextMenu*)mPopupMenu)->show(x, y);
LLMenuGL::showPopup(ctrl, mPopupMenu, x, y);

View File

@ -282,7 +282,7 @@ void LLFloaterIMNearbyChat::onTearOffClicked()
LLFloaterIMSessionTab::onTearOffClicked();
// see CHUI-170: Save torn-off state of the nearby chat between sessions
BOOL in_the_multifloater = (BOOL)getHost();
bool in_the_multifloater(getHost());
gSavedPerAccountSettings.setBOOL("NearbyChatIsNotTornOff", in_the_multifloater);
}