summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/llsdserialize_xml.cpp15
-rw-r--r--indra/llimage/llimageworker.cpp11
-rw-r--r--indra/llui/llmultisliderctrl.cpp7
-rw-r--r--indra/llui/llpanel.cpp8
-rw-r--r--indra/llui/lltabcontainer.cpp4
-rw-r--r--indra/llxuixml/llxuiparser.cpp36
-rw-r--r--indra/lscript/lscript_compile/lscript_tree.cpp15
-rw-r--r--indra/newview/llchiclet.h5
-rw-r--r--indra/newview/llfloatertopobjects.cpp9
-rw-r--r--indra/newview/llinventorybridge.cpp16
-rw-r--r--indra/newview/llinventorymodel.cpp21
-rw-r--r--indra/newview/llpanelface.cpp20
-rw-r--r--indra/newview/llpanellandmarkinfo.cpp32
-rw-r--r--indra/newview/llviewermenu.cpp5
-rw-r--r--indra/newview/llvovolume.cpp11
15 files changed, 128 insertions, 87 deletions
diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp
index 7e1c2e35e0..fca173df47 100644
--- a/indra/llcommon/llsdserialize_xml.cpp
+++ b/indra/llcommon/llsdserialize_xml.cpp
@@ -139,12 +139,8 @@ S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 opti
case LLSD::TypeBoolean:
ostr << pre << "<boolean>";
if(mBoolAlpha ||
-#if( LL_WINDOWS || __GNUC__ > 2)
(ostr.flags() & std::ios::boolalpha)
-#else
- (ostr.flags() & 0x0100)
-#endif
- )
+ )
{
ostr << (data.asBoolean() ? "true" : "false");
}
@@ -511,12 +507,7 @@ void LLSDXMLParser::Impl::reset()
mSkipping = false;
-#if( LL_WINDOWS || __GNUC__ > 2)
mCurrentKey.clear();
-#else
- mCurrentKey = std::string();
-#endif
-
XML_ParserReset(mParser, "utf-8");
XML_SetUserData(mParser, this);
@@ -644,11 +635,7 @@ void LLSDXMLParser::Impl::startElementHandler(const XML_Char* name, const XML_Ch
LLSD& newElement = map[mCurrentKey];
mStack.push_back(&newElement);
-#if( LL_WINDOWS || __GNUC__ > 2)
mCurrentKey.clear();
-#else
- mCurrentKey = std::string();
-#endif
}
else if (mStack.back()->isArray())
{
diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp
index 86d41515e7..20a72d0a28 100644
--- a/indra/llimage/llimageworker.cpp
+++ b/indra/llimage/llimageworker.cpp
@@ -54,9 +54,14 @@ S32 LLImageDecodeThread::update(U32 max_time_ms)
{
creation_info& info = *iter;
ImageRequest* req = new ImageRequest(info.handle, info.image,
- info.priority, info.discard, info.needs_aux,
- info.responder);
- addRequest(req);
+ info.priority, info.discard, info.needs_aux,
+ info.responder);
+
+ bool res = addRequest(req);
+ if (!res)
+ {
+ llerrs << "request added after LLLFSThread::cleanupClass()" << llendl;
+ }
}
mCreationList.clear();
S32 res = LLQueuedThread::update(max_time_ms);
diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp
index 50942e55ca..cc26c00a3e 100644
--- a/indra/llui/llmultisliderctrl.cpp
+++ b/indra/llui/llmultisliderctrl.cpp
@@ -330,13 +330,14 @@ void LLMultiSliderCtrl::updateText()
// static
void LLMultiSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata)
{
+ llassert(ctrl);
+ if (!ctrl)
+ return;
+
LLMultiSliderCtrl* self = dynamic_cast<LLMultiSliderCtrl*>(ctrl->getParent());
llassert(self);
if (!self) // cast failed - wrong type! :O
return;
-
- if (!ctrl)
- return;
BOOL success = FALSE;
F32 val = self->mCurValue;
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 7b406e090a..d963cf4c98 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -397,6 +397,12 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_
if (!panelp)
{
panelp = LLUICtrlFactory::getInstance()->createFactoryPanel(name);
+ llassert(panelp);
+
+ if (!panelp)
+ {
+ return NULL; // :(
+ }
}
}
@@ -414,7 +420,7 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_
panelp->mCommitCallbackRegistrar.popScope();
panelp->mEnableCallbackRegistrar.popScope();
- if (panelp && !panelp->getFactoryMap().empty())
+ if (!panelp->getFactoryMap().empty())
{
LLUICtrlFactory::instance().popFactoryFunctions();
}
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 575b6e3b6c..ffaf84cb9b 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -891,6 +891,10 @@ void LLTabContainer::update_images(LLTabTuple* tuple, TabParams params, LLTabCon
void LLTabContainer::addTabPanel(const TabPanelParams& panel)
{
LLPanel* child = panel.panel();
+
+ llassert(child);
+ if (!child) return;
+
const std::string& label = panel.label.isProvided()
? panel.label()
: panel.panel()->getLabel();
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index 17399865e5..dbc20a5a1e 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -324,33 +324,33 @@ void LLXUIXSDWriter::writeXSD(const std::string& type_name, const std::string& p
// add includes for all possible children
const std::type_info* type = *LLWidgetTypeRegistry::instance().getValue(type_name);
const widget_registry_t* widget_registryp = LLChildRegistryRegistry::instance().getValue(type);
-
- // add include declarations for all valid children
- for (widget_registry_t::Registrar::registry_map_t::const_iterator it = widget_registryp->currentRegistrar().beginItems();
- it != widget_registryp->currentRegistrar().endItems();
- ++it)
- {
- std::string widget_name = it->first;
- if (widget_name == type_name)
- {
- continue;
- }
- LLXMLNodePtr nodep = new LLXMLNode("xs:include", false);
- nodep->createChild("schemaLocation", true)->setStringValue(widget_name + ".xsd");
-
- // add to front of schema
- mSchemaNode->addChild(nodep, mSchemaNode);
- }
// add choices for valid children
if (widget_registryp)
{
+ // add include declarations for all valid children
+ for (widget_registry_t::Registrar::registry_map_t::const_iterator it = widget_registryp->currentRegistrar().beginItems();
+ it != widget_registryp->currentRegistrar().endItems();
+ ++it)
+ {
+ std::string widget_name = it->first;
+ if (widget_name == type_name)
+ {
+ continue;
+ }
+ LLXMLNodePtr nodep = new LLXMLNode("xs:include", false);
+ nodep->createChild("schemaLocation", true)->setStringValue(widget_name + ".xsd");
+
+ // add to front of schema
+ mSchemaNode->addChild(nodep, mSchemaNode);
+ }
+
for (widget_registry_t::Registrar::registry_map_t::const_iterator it = widget_registryp->currentRegistrar().beginItems();
it != widget_registryp->currentRegistrar().endItems();
++it)
{
std::string widget_name = it->first;
- //<xs:element name="widget_name" type="widget_name">
+ //<xs:element name="widget_name" type="widget_name">
LLXMLNodePtr widget_node = mElementNode->createChild("xs:element", false);
widget_node->createChild("name", true)->setStringValue(widget_name);
widget_node->createChild("type", true)->setStringValue(widget_name);
diff --git a/indra/lscript/lscript_compile/lscript_tree.cpp b/indra/lscript/lscript_compile/lscript_tree.cpp
index 4ba41db2fc..3d19de193a 100644
--- a/indra/lscript/lscript_compile/lscript_tree.cpp
+++ b/indra/lscript/lscript_compile/lscript_tree.cpp
@@ -9805,6 +9805,9 @@ void LLScriptEventHandler::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
break;
case LSCP_EMIT_BYTE_CODE:
{
+ llassert(mEventp);
+ if (!mEventp) return;
+
// order for event handler
// set jump table value
S32 jumpoffset;
@@ -9818,13 +9821,11 @@ void LLScriptEventHandler::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
chunk->addBytes(4);
// null terminated event name and null terminated parameters
- if (mEventp)
- {
- LLScriptByteCodeChunk *event = new LLScriptByteCodeChunk(FALSE);
- mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, event, heap, stacksize, entry, entrycount, NULL);
- chunk->addBytes(event->mCodeChunk, event->mCurrentOffset);
- delete event;
- }
+ LLScriptByteCodeChunk *event = new LLScriptByteCodeChunk(FALSE);
+ mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, event, heap, stacksize, entry, entrycount, NULL);
+ chunk->addBytes(event->mCodeChunk, event->mCurrentOffset);
+ delete event;
+
chunk->addBytes(1);
// now we're at the first opcode
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index b006ae3420..ba17c5970e 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -1228,12 +1228,15 @@ T* LLChicletPanel::findChiclet(const LLUUID& im_session_id)
{
LLChiclet* chiclet = *it;
+ llassert(chiclet);
+ if (!chiclet) continue;
if(chiclet->getSessionId() == im_session_id)
{
T* result = dynamic_cast<T*>(chiclet);
- if(!result && chiclet)
+ if(!result)
{
llwarns << "Found chiclet but of wrong type " << llendl;
+ continue;
}
return result;
}
diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp
index c930e99bad..8ab050beaa 100644
--- a/indra/newview/llfloatertopobjects.cpp
+++ b/indra/newview/llfloatertopobjects.cpp
@@ -283,8 +283,13 @@ void LLFloaterTopObjects::updateSelectionInfo()
std::string object_id_string = object_id.asString();
childSetValue("id_editor", LLSD(object_id_string));
- childSetValue("object_name_editor", list->getFirstSelected()->getColumn(1)->getValue().asString());
- childSetValue("owner_name_editor", list->getFirstSelected()->getColumn(2)->getValue().asString());
+ LLScrollListItem* sli = list->getFirstSelected();
+ llassert(sli);
+ if (sli)
+ {
+ childSetValue("object_name_editor", sli->getColumn(1)->getValue().asString());
+ childSetValue("owner_name_editor", sli->getColumn(2)->getValue().asString());
+ }
}
// static
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index d0ef159228..7b80d00c2c 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -5176,12 +5176,18 @@ void LLInvFVBridgeAction::doAction(LLAssetType::EType asset_type,
//static
void LLInvFVBridgeAction::doAction(const LLUUID& uuid, LLInventoryModel* model)
{
- LLAssetType::EType asset_type = model->getItem(uuid)->getType();
- LLInvFVBridgeAction* action = createAction(asset_type,uuid,model);
- if(action)
+ llassert(model);
+ LLViewerInventoryItem* item = model->getItem(uuid);
+ llassert(item);
+ if (item)
{
- action->doIt();
- delete action;
+ LLAssetType::EType asset_type = item->getType();
+ LLInvFVBridgeAction* action = createAction(asset_type,uuid,model);
+ if(action)
+ {
+ action->doIt();
+ delete action;
+ }
}
}
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 7ec976604a..326f2a5577 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1937,23 +1937,26 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item)
{
//llinfos << "LLInventoryModel::addItem()" << llendl;
- // This can happen if assettype enums from llassettype.h ever change.
- // For example, there is a known backwards compatibility issue in some viewer prototypes prior to when
- // the AT_LINK enum changed from 23 to 24.
- if ((item->getType() == LLAssetType::AT_NONE)
- || LLAssetType::lookup(item->getType()) == LLAssetType::badLookup())
- {
- llwarns << "Got bad asset type for item [ name: " << item->getName() << " type: " << item->getType() << " inv-type: " << item->getInventoryType() << " ], ignoring." << llendl;
- return;
- }
+ llassert(item);
if(item)
{
+ // This can happen if assettype enums from llassettype.h ever change.
+ // For example, there is a known backwards compatibility issue in some viewer prototypes prior to when
+ // the AT_LINK enum changed from 23 to 24.
+ if ((item->getType() == LLAssetType::AT_NONE)
+ || LLAssetType::lookup(item->getType()) == LLAssetType::badLookup())
+ {
+ llwarns << "Got bad asset type for item [ name: " << item->getName() << " type: " << item->getType() << " inv-type: " << item->getInventoryType() << " ], ignoring." << llendl;
+ return;
+ }
+
// This condition means that we tried to add a link without the baseobj being in memory.
// The item will show up as a broken link.
if (item->getIsBrokenLink())
{
llinfos << "Adding broken link [ name: " << item->getName() << " itemID: " << item->getUUID() << " assetID: " << item->getAssetUUID() << " ) parent: " << item->getParentUUID() << llendl;
}
+
mItemMap[item->getUUID()] = item;
}
}
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 8c5208678e..b50c6442e1 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -265,10 +265,13 @@ void LLPanelFace::sendAlpha()
void LLPanelFace::sendGlow()
{
- LLSpinCtrl* mCtrlGlow = getChild<LLSpinCtrl>("glow");
- F32 glow = mCtrlGlow->get();
-
- LLSelectMgr::getInstance()->selectionSetGlow( glow );
+ LLSpinCtrl* mCtrlGlow = getChild<LLSpinCtrl>("glow");
+ llassert(mCtrlGlow);
+ if (mCtrlGlow)
+ {
+ F32 glow = mCtrlGlow->get();
+ LLSelectMgr::getInstance()->selectionSetGlow( glow );
+ }
}
struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
@@ -286,6 +289,9 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
LLCheckBoxCtrl* checkFlipScaleS = mPanel->getChild<LLCheckBoxCtrl>("checkbox flip s");
LLCheckBoxCtrl* checkFlipScaleT = mPanel->getChild<LLCheckBoxCtrl>("checkbox flip t");
LLComboBox* comboTexGen = mPanel->getChild<LLComboBox>("combobox texgen");
+ llassert(comboTexGen);
+ llassert(object);
+
if (ctrlTexScaleS)
{
valid = !ctrlTexScaleS->getTentative() || !checkFlipScaleS->getTentative();
@@ -296,7 +302,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
{
value = -value;
}
- if (comboTexGen->getCurrentIndex() == 1)
+ if (comboTexGen &&
+ comboTexGen->getCurrentIndex() == 1)
{
value *= 0.5f;
}
@@ -314,7 +321,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
{
value = -value;
}
- if (comboTexGen->getCurrentIndex() == 1)
+ if (comboTexGen &&
+ comboTexGen->getCurrentIndex() == 1)
{
value *= 0.5f;
}
diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp
index cd6c727b5c..56d52ccc65 100644
--- a/indra/newview/llpanellandmarkinfo.cpp
+++ b/indra/newview/llpanellandmarkinfo.cpp
@@ -376,21 +376,31 @@ void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id)
// static
std::string LLPanelLandmarkInfo::getFullFolderName(const LLViewerInventoryCategory* cat)
{
- std::string name = cat->getName();
+ std::string name;
LLUUID parent_id;
- // translate category name, if it's right below the root
- // FIXME: it can throw notification about non existent string in strings.xml
- if (cat->getParentUUID().notNull() && cat->getParentUUID() == gInventory.getRootFolderID())
+ llassert(cat);
+ if (cat)
{
- LLTrans::findString(name, "InvFolder " + name);
- }
+ name = cat->getName();
- // we don't want "My Inventory" to appear in the name
- while ((parent_id = cat->getParentUUID()).notNull() && parent_id != gInventory.getRootFolderID())
- {
- cat = gInventory.getCategory(parent_id);
- name = cat->getName() + "/" + name;
+ // translate category name, if it's right below the root
+ // FIXME: it can throw notification about non existent string in strings.xml
+ if (cat->getParentUUID().notNull() && cat->getParentUUID() == gInventory.getRootFolderID())
+ {
+ LLTrans::findString(name, "InvFolder " + name);
+ }
+
+ // we don't want "My Inventory" to appear in the name
+ while ((parent_id = cat->getParentUUID()).notNull() && parent_id != gInventory.getRootFolderID())
+ {
+ cat = gInventory.getCategory(parent_id);
+ llassert(cat);
+ if (cat)
+ {
+ name = cat->getName() + "/" + name;
+ }
+ }
}
return name;
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 1ff7920bb2..c18628d6f0 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -4842,9 +4842,10 @@ class LLToolsEnableUnlink : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
+ LLViewerObject* first_editable_object = LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject();
bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
- LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
- !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment();
+ first_editable_object &&
+ !first_editable_object->isAttachment();
return new_value;
}
};
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index e95c7f411c..0e5a01ca2c 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3644,7 +3644,8 @@ static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry");
void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
{
llpushcallstacks ;
- if (group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY))
+ llassert(group);
+ if (group && group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY))
{
LLFastTimer tm(FTM_VOLUME_GEOM);
S32 num_mapped_veretx_buffer = LLVertexBuffer::sMappedCount ;
@@ -3703,9 +3704,9 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
}
// don't forget alpha
- if( group != NULL &&
- !group->mVertexBuffer.isNull() &&
- group->mVertexBuffer->isLocked())
+ if(group != NULL &&
+ !group->mVertexBuffer.isNull() &&
+ group->mVertexBuffer->isLocked())
{
group->mVertexBuffer->setBuffer(0);
}
@@ -3731,7 +3732,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
group->clearState(LLSpatialGroup::MESH_DIRTY | LLSpatialGroup::NEW_DRAWINFO);
}
- if (group->isState(LLSpatialGroup::NEW_DRAWINFO))
+ if (group && group->isState(LLSpatialGroup::NEW_DRAWINFO))
{
llerrs << "WTF?" << llendl;
}