From ba982c0575515a8524d5044f928cd336303f807c Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sat, 6 Apr 2013 21:47:13 +1000 Subject: Clean up some compiler warnings. More to come. --- linden/indra/llcommon/llsdserialize.cpp | 5 ++++- linden/indra/llmath/llvolume.cpp | 5 ----- linden/indra/llmessage/llhttpassetstorage.cpp | 3 ++- linden/indra/llrender/llfont.cpp | 2 ++ linden/indra/llrender/llgl.cpp | 13 ++++++------- linden/indra/llrender/llimagegl.cpp | 4 +++- linden/indra/llui/llfunctorregistry.h | 2 -- linden/indra/llwindow/GL/glh_extensions.h | 4 +++- linden/indra/lscript/lscript_execute/lscript_execute.cpp | 11 +---------- linden/indra/lscript/lscript_execute/lscript_readlso.cpp | 6 ++++-- 10 files changed, 25 insertions(+), 30 deletions(-) diff --git a/linden/indra/llcommon/llsdserialize.cpp b/linden/indra/llcommon/llsdserialize.cpp index e2be922..f648c5c 100644 --- a/linden/indra/llcommon/llsdserialize.cpp +++ b/linden/indra/llcommon/llsdserialize.cpp @@ -1447,9 +1447,12 @@ S32 LLSDBinaryFormatter::format(const LLSD& data, std::ostream& ostr, U32 option } case LLSD::TypeUUID: + { ostr.put('u'); - ostr.write((const char*)(&(data.asUUID().mData)), UUID_BYTES); + U8 *value = data.asUUID().mData; + ostr.write((const char*)(&value), UUID_BYTES); break; + } case LLSD::TypeString: ostr.put('s'); diff --git a/linden/indra/llmath/llvolume.cpp b/linden/indra/llmath/llvolume.cpp index 618048c..63869ea 100644 --- a/linden/indra/llmath/llvolume.cpp +++ b/linden/indra/llmath/llvolume.cpp @@ -4438,14 +4438,9 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) S32 max_s = volume->getProfile().getTotal(); S32 max_t = volume->getPath().mPath.size(); - // S32 i; - S32 num_vertices = 0, num_indices = 0; S32 grid_size = (profile.size()-1)/4; S32 quad_count = (grid_size * grid_size); - num_vertices = (grid_size+1)*(grid_size+1); - num_indices = quad_count * 4; - LLVector3& min = mExtents[0]; LLVector3& max = mExtents[1]; diff --git a/linden/indra/llmessage/llhttpassetstorage.cpp b/linden/indra/llmessage/llhttpassetstorage.cpp index 49dbdbd..fcdb354 100644 --- a/linden/indra/llmessage/llhttpassetstorage.cpp +++ b/linden/indra/llmessage/llhttpassetstorage.cpp @@ -743,7 +743,8 @@ LLAssetRequest* LLHTTPAssetStorage::findNextRequest(LLAssetStorage::request_list request_list_t::iterator running_end = running.end(); request_list_t::iterator pending_iter = pending.begin(); - request_list_t::iterator pending_end = pending.end(); + // FIXME onefang - I assume this was being used to speed up the for(), but this is just a quick pass to get rid of warnings. Try to understand it later. + //request_list_t::iterator pending_end = pending.end(); // Loop over all pending requests until we miss finding it in the running list. for (; pending_iter != pending.end(); ++pending_iter) { diff --git a/linden/indra/llrender/llfont.cpp b/linden/indra/llrender/llfont.cpp index 5ee3929..1cad593 100644 --- a/linden/indra/llrender/llfont.cpp +++ b/linden/indra/llrender/llfont.cpp @@ -535,6 +535,8 @@ void LLFont::renderGlyph(const U32 glyph_index) const int error = FT_Load_Glyph(mFTFace, glyph_index, FT_LOAD_DEFAULT ); llassert(!error); + // Work around the compiler warning about error not being used when llassert() is compiled out. + error = error + 0; error = FT_Render_Glyph(mFTFace->glyph, gFontRenderMode); mRenderGlyphCount++; diff --git a/linden/indra/llrender/llgl.cpp b/linden/indra/llrender/llgl.cpp index 4a4ff1b..b57a562 100644 --- a/linden/indra/llrender/llgl.cpp +++ b/linden/indra/llrender/llgl.cpp @@ -383,11 +383,10 @@ bool LLGLManager::initGL() if (mGLVendor.substr(0,4) == "ATI ") { mGLVendorShort = "ATI"; - BOOL mobile = FALSE; - if (mGLRenderer.find("MOBILITY") != std::string::npos) - { - mobile = TRUE; - } + // This is not used anywhere. + //BOOL mobile = FALSE; + //if (mGLRenderer.find("MOBILITY") != std::string::npos) + // mobile = TRUE; mIsATI = TRUE; #if LL_WINDOWS && !LL_MESA_HEADLESS @@ -1014,8 +1013,8 @@ void assert_glerror() void clear_glerror() { // Create or update texture to be used with this data - GLenum error; - error = glGetError(); + //GLenum error; + /*error =*/ glGetError(); } /////////////////////////////////////////////////////////////// diff --git a/linden/indra/llrender/llimagegl.cpp b/linden/indra/llrender/llimagegl.cpp index c63d7ad..f99d4a9 100644 --- a/linden/indra/llrender/llimagegl.cpp +++ b/linden/indra/llrender/llimagegl.cpp @@ -711,7 +711,9 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) { S32 bytes = w * h * mComponents; llassert(prev_mip_data); - llassert(prev_mip_size == bytes*4); + llassert(prev_mip_size == (bytes*4)); + // Work around llassert() being compiled out and prev_mip_size not otherwise being used. + prev_mip_size = prev_mip_size + 0; U8* new_data = new U8[bytes]; llassert_always(new_data); LLImageBase::generateMip(prev_mip_data, new_data, w, h, mComponents); diff --git a/linden/indra/llui/llfunctorregistry.h b/linden/indra/llui/llfunctorregistry.h index 8864f7a..7c03f2f 100644 --- a/linden/indra/llui/llfunctorregistry.h +++ b/linden/indra/llui/llfunctorregistry.h @@ -75,7 +75,6 @@ public: bool registerFunctor(const std::string& name, ResponseFunctor f) { bool retval = true; - typename FunctorMap::iterator it = mMap.find(name); if (mMap.count(name) == 0) { mMap[name] = f; @@ -102,7 +101,6 @@ public: FUNCTOR_TYPE getFunctor(const std::string& name) { - typename FunctorMap::iterator it = mMap.find(name); if (mMap.count(name) != 0) { return mMap[name]; diff --git a/linden/indra/llwindow/GL/glh_extensions.h b/linden/indra/llwindow/GL/glh_extensions.h index 5b149c9..ce2865b 100644 --- a/linden/indra/llwindow/GL/glh_extensions.h +++ b/linden/indra/llwindow/GL/glh_extensions.h @@ -111,7 +111,9 @@ static const char* EatNonWhiteSpace(const char *str) int glh_init_extensions(const char *origReqExts) { // Length of requested extensions string + /* unsigned reqExtsLen; + */ char *reqExts; // Ptr for individual extensions within reqExts char *reqExt; @@ -153,8 +155,8 @@ int glh_init_extensions(const char *origReqExts) return TRUE; } reqExts = strdup(origReqExts); - reqExtsLen = (S32)strlen(reqExts); /* + reqExtsLen = (S32)strlen(reqExts); if (NULL == gGLHExts.mUnsupportedExts) { gGLHExts.mUnsupportedExts = (char*)malloc(reqExtsLen + 1); diff --git a/linden/indra/lscript/lscript_execute/lscript_execute.cpp b/linden/indra/lscript/lscript_execute/lscript_execute.cpp index b2b54cd..7af407f 100644 --- a/linden/indra/lscript/lscript_execute/lscript_execute.cpp +++ b/linden/indra/lscript/lscript_execute/lscript_execute.cpp @@ -809,16 +809,7 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id, // is there a fault? // if yes, print out message and exit S32 value = getVersion(); - S32 major_version = 0; - if (value == LSL2_VERSION1_END_NUMBER) - { - major_version = 1; - } - else if (value == LSL2_VERSION_NUMBER) - { - major_version = 2; - } - else + if ((value != LSL2_VERSION1_END_NUMBER) && (value != LSL2_VERSION_NUMBER)) { setFault(LSRF_VERSION_MISMATCH); } diff --git a/linden/indra/lscript/lscript_execute/lscript_readlso.cpp b/linden/indra/lscript/lscript_execute/lscript_readlso.cpp index 3b10cc6..05eb826 100644 --- a/linden/indra/lscript/lscript_execute/lscript_readlso.cpp +++ b/linden/indra/lscript/lscript_execute/lscript_readlso.cpp @@ -150,7 +150,9 @@ void LLScriptLSOParse::printGlobals(LLFILE *fp) // get offset to skip past name varoffset = global_v_offset; + // FIXME: Not actually used, perhaps there's a skip function? Or perhaps we really do need to skip past a name as the above comment suggests? offset = bytestream2integer(mRawData, global_v_offset); + offset = offset + 0; // get typeexport type = *(mRawData + global_v_offset++); @@ -268,8 +270,6 @@ void LLScriptLSOParse::printGlobalFunctions(LLFILE *fp) fprintf(fp, "[Function #%d] [0x%X] %s\n", function_number, orig_function_offset, name); fprintf(fp, "\tReturn Type: %s\n", LSCRIPTTypeNames[type]); type = *(mRawData + function_offset++); - S32 params; - params = 0; S32 pcount = 0; while (type) { @@ -362,7 +362,9 @@ void LLScriptLSOParse::printStates(LLFILE *fp) if (event_handlers & LSCRIPTStateBitField[k]) { temp_end = bytestream2integer(mRawData, read_ahead); + // FIXME onefang: Dummy is not actually used, but perhaps this is here to stop a warning? We need to stop another warning now. Some sort of skip might be better. dummy = bytestream2integer(mRawData, read_ahead); + dummy = dummy + 0; if ( (temp_end < opcode_end) &&(temp_end > event_offset)) { -- cgit v1.1