From 23e1521a6b1efdc42acafce08abe506faddcafbe Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 24 Mar 2011 05:00:46 -0500 Subject: [PATCH] Some assertions, just in case. --- indra/llmessage/lldatapacker.cpp | 7 ++++++- indra/newview/lldrawable.cpp | 7 +++++++ indra/newview/lldrawpoolalpha.cpp | 5 ++++- indra/newview/llsurfacepatch.cpp | 3 +++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp index 9046f9c35..a1b5c7908 100644 --- a/indra/llmessage/lldatapacker.cpp +++ b/indra/llmessage/lldatapacker.cpp @@ -1908,7 +1908,12 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v if (mFP) { fpos_t last_pos; - fgetpos(mFP, &last_pos); + if (0 != fgetpos(mFP, &last_pos)) // 0==success for fgetpos + { + llwarns << "Data packer failed to fgetpos" << llendl; + return FALSE; + } + if (fgets(buffer, DP_BUFSIZE, mFP) == NULL) { buffer[0] = '\0'; diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index a425e30de..bc1ccfc10 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1041,7 +1041,11 @@ LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 dat mPartitionType = LLViewerRegion::PARTITION_VOLUME; mOctree->balance(); + + llassert(mDrawable); + llassert(mDrawable->getRegion()); LLSpatialPartition *part = mDrawable->getRegion()->getSpatialPartition(mPartitionType); + llassert(part); if (part) { @@ -1360,6 +1364,9 @@ void LLSpatialBridge::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL imm BOOL LLSpatialBridge::updateMove() { + llassert_always(mDrawable); + llassert_always(mDrawable->mVObjp); + llassert_always(mDrawable->getRegion()); LLSpatialPartition* part = mDrawable->getRegion()->getSpatialPartition(mPartitionType); llassert_always(part); mOctree->balance(); diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index c93f64c0a..d3a326c93 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -299,8 +299,11 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i) { LLSpatialGroup* group = *i; + llassert(group); + llassert(group->mSpatialPartition); + if (group->mSpatialPartition->mRenderByGroup && - !group->isDead()) + !group->isDead()) { bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow. // All particle systems seem to come off the wire with texture entries which claim that they glow. This is probably a bug in the data. Suppress. diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index b8b4e4f91..48e4a6ccc 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -356,12 +356,14 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) normal %= c2; normal.normVec(); + llassert(mDataNorm); *(mDataNorm + surface_stride * y + x) = normal; } const LLVector3 &LLSurfacePatch::getNormal(const U32 x, const U32 y) const { U32 surface_stride = mSurfacep->getGridsPerEdge(); + llassert(mDataNorm); return *(mDataNorm + surface_stride * y + x); } @@ -403,6 +405,7 @@ void LLSurfacePatch::updateVerticalStats() U32 i, j, k; F32 z, total; + llassert(mDataZ); z = *(mDataZ); mMinZ = z;