diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 5099920f328c6fa1d38870392eabd5d7b1c18d55..3de5e04177c3217e2c6a9890292521dabbd766f5 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -1624,9 +1624,6 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
 			//genNGon(params, llfloor(MIN_DETAIL_FACES * detail), 4.f, 0.f);
 			genNGon(params, llfloor(MIN_DETAIL_FACES * detail));
 
-			F32 t     = 0.f;
-			F32 tStep = 1.0f / mPath.size();
-
 			F32 toggle = 0.5f;
 			for (S32 i=0;i<(S32)mPath.size();i++)
 			{
@@ -1635,7 +1632,6 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
 					toggle = -0.5f;
 				else
 					toggle = 0.5f;
-				t += tStep;
 			}
 		}
 
diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp
index 96c1297e0d24b2090d8744a5a9c8da3898cf4c28..b6adc102d2149d788a25e57f47a1c03025a359b9 100644
--- a/indra/llmessage/lldatapacker.cpp
+++ b/indra/llmessage/lldatapacker.cpp
@@ -127,13 +127,7 @@ BOOL LLDataPacker::unpackFixed(F32 &value, const char *name,
 		total_bits++;
 	}
 
-	S32 min_val;
 	U32 max_val;
-	if (is_signed)
-	{
-		min_val = 1 << int_bits;
-		min_val *= -1;
-	}
 	max_val = 1 << int_bits;
 
 	F32 fixed_val;
diff --git a/indra/llmessage/llthrottle.cpp b/indra/llmessage/llthrottle.cpp
index 7605da4d3fa9b06c0f5700eb351bf8d1f56226be..935af2aa5a551b04c45b54cc6d8bc637c296d664 100644
--- a/indra/llmessage/llthrottle.cpp
+++ b/indra/llmessage/llthrottle.cpp
@@ -374,7 +374,6 @@ BOOL LLThrottleGroup::dynamicAdjust()
 	}
 	mDynamicAdjustTime = mt_sec;
 
-	S32 total = 0;
 	// Update historical information
 	for (i = 0; i < TC_EOF; i++)
 	{
@@ -391,7 +390,6 @@ BOOL LLThrottleGroup::dynamicAdjust()
 		}
 
 		mBitsSentThisPeriod[i] = 0;
-		total += ll_round(mBitsSentHistory[i]);
 	}
 
 	// Look for busy channels
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 204ff637123a007e1ffafb64a74940a6a8a742bf..cc85f3d7a8583d6c1454e0e09dffd93e17e2b151 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -881,8 +881,6 @@ LLSD LLModel::writeModel(
 
 LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, BOOL nowrite, BOOL as_slm)
 {
-	U32 bytes = 0;
-	
 	std::string::size_type cur_offset = 0;
 
 	LLSD header;
@@ -904,7 +902,6 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, BOOL nowrite, BO
 			header["skin"]["offset"] = (LLSD::Integer) cur_offset;
 			header["skin"]["size"] = (LLSD::Integer) size;
 			cur_offset += size;
-			bytes += size;
 		}
 	}
 
@@ -920,7 +917,6 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, BOOL nowrite, BO
 			header["physics_convex"]["offset"] = (LLSD::Integer) cur_offset;
 			header["physics_convex"]["size"] = (LLSD::Integer) size;
 			cur_offset += size;
-			bytes += size;
 		}
 	}
 
@@ -942,7 +938,6 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, BOOL nowrite, BO
 			header[model_names[i]]["offset"] = (LLSD::Integer) cur_offset;
 			header[model_names[i]]["size"] = (LLSD::Integer) size;
 			cur_offset += size;
-			bytes += size;
 		}
 	}
 
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index aac28e04b93257bc9b12215c520c56e1220bfd41..77938edf274290caba9553ed744f05edf1d141b6 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -395,7 +395,6 @@ void LLLayoutStack::updateLayout()
 	space_to_distribute += panelp ? ll_round((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
 
 	S32 remaining_space = space_to_distribute;
-	F32 fraction_distributed = 0.f;
 	if (space_to_distribute > 0 && total_visible_fraction > 0.f)
 	{	// give space proportionally to visible auto resize panels
 		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
@@ -404,7 +403,6 @@ void LLLayoutStack::updateLayout()
 			{
 				F32 fraction_to_distribute = (panelp->mFractionalSize * panelp->getAutoResizeFactor()) / (total_visible_fraction);
 				S32 delta = ll_round((F32)space_to_distribute * fraction_to_distribute);
-				fraction_distributed += fraction_to_distribute;
 				panelp->mTargetDim += delta;
 				remaining_space -= delta;
 			}
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index bc4f07941b2511adcfdcc27ce2eb8bbdff7e3f64..5c8fd62d3b840ef16a9551a6189aaf75025c9efe 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -621,8 +621,6 @@ void LLWindowMacOSX::getMouseDeltas(float* delta)
 
 BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL enable_vsync)
 {
-	BOOL			glNeedsInit = FALSE;
-
 	mFullscreen = fullscreen;
 	
 	if (mWindow == NULL)
@@ -637,9 +635,6 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
 		mGLView = createOpenGLView(mWindow, mFSAASamples, enable_vsync);
 		mContext = getCGLContextObj(mGLView);
 		
-		// Since we just created the context, it needs to be set up.
-		glNeedsInit = TRUE;
-		
 		gGLManager.mVRAM = getVramSize(mGLView);
 	}
 	
@@ -1721,9 +1716,7 @@ void LLSplashScreenMacOSX::updateImpl(const std::string& mesg)
 {
 	if(mWindow != NULL)
 	{
-		CFStringRef string = NULL;
-
-		string = CFStringCreateWithCString(NULL, mesg.c_str(), kCFStringEncodingUTF8);
+		CFStringCreateWithCString(NULL, mesg.c_str(), kCFStringEncodingUTF8);
 	}
 }
 
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 1605e4133d985bec1b68d41baac901d4e79aa6c6..9bb3bac1040b3f82581b3667d88ad48b1d20530f 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -504,20 +504,6 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t
 		is.close();
 	}
 
-	//get time domain
-	LLSD::Real cur_total_time = 0.0;
-
-	for (U32 i = 0; i < cur_data.size(); ++i)
-	{
-		cur_total_time += cur_data[i]["Total"]["Time"].asReal();
-	}
-
-	LLSD::Real base_total_time = 0.0;
-	for (U32 i = 0; i < base_data.size(); ++i)
-	{
-		base_total_time += base_data[i]["Total"]["Time"].asReal();
-	}
-
 	//allocate raw scratch space
 	LLPointer<LLImageRaw> scratch = new LLImageRaw(1024, 512, 3);
 
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 37500176ea5f5b280c9aa4e02215ca8fef2fb1e6..88cf89d4d433b492f910ac3c35803ed944d2239c 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -3132,7 +3132,6 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, U32
 		gInventory.accountForUpdate(update);
 	}
 
-	U32 changes = 0x0;
 	if (account)
 	{
 		mask |= LLInventoryObserver::CREATE;
@@ -3140,7 +3139,7 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, U32
 	//as above, this loop never seems to loop more than once per call
 	for (item_array_t::iterator it = items.begin(); it != items.end(); ++it)
 	{
-		changes |= gInventory.updateItem(*it, mask);
+		gInventory.updateItem(*it, mask);
 	}
 	gInventory.notifyObservers();
 	gViewerWindow->getWindow()->decBusyCount();
@@ -4551,12 +4550,10 @@ void LLInventoryModel::FetchItemHttpHandler::processData(LLSD & content, LLCore:
 	}
 
 	// as above, this loop never seems to loop more than once per call
-	U32 changes(0U);
 	for (LLInventoryModel::item_array_t::iterator it = items.begin(); it != items.end(); ++it)
 	{
-		changes |= gInventory.updateItem(*it);
+		gInventory.updateItem(*it);
 	}
-	// *HUH:  Have computed 'changes', nothing uses it.
 	
 	gInventory.notifyObservers();
 	gViewerWindow->getWindow()->decBusyCount();
diff --git a/indra/newview/lllegacyatmospherics.cpp b/indra/newview/lllegacyatmospherics.cpp
index 136406794943ffa85fbe0f6450ecc41fdf97076e..ce4ec668f144f0045fc24c77977c7ddbd26aeeff 100644
--- a/indra/newview/lllegacyatmospherics.cpp
+++ b/indra/newview/lllegacyatmospherics.cpp
@@ -386,7 +386,6 @@ void LLAtmospherics::updateFog(const F32 distance, const LLVector3& tosun_in)
 		return;
 	}
 
-	const BOOL hide_clip_plane = TRUE;
 	LLColor4 target_fog(0.f, 0.2f, 0.5f, 0.f);
 
 	const F32 water_height = gAgent.getRegion() ? gAgent.getRegion()->getWaterHeight() : 0.f;
@@ -472,33 +471,17 @@ void LLAtmospherics::updateFog(const F32 distance, const LLVector3& tosun_in)
 
 	render_fog_color = sky_fog_color;
 
-	F32 fog_density = 0.f;
 	fog_distance = mFogRatio * distance;
 	
 	if (camera_height > water_height)
 	{
 		LLColor4 fog(render_fog_color);
 		mGLFogCol = fog;
-
-		if (hide_clip_plane)
-		{
-			// For now, set the density to extend to the cull distance.
-			const F32 f_log = 2.14596602628934723963618357029f; // sqrt(fabs(log(0.01f)))
-			fog_density = f_log/fog_distance;
-		}
-		else
-		{
-			const F32 f_log = 4.6051701859880913680359829093687f; // fabs(log(0.01f))
-			fog_density = (f_log)/fog_distance;
-		}
 	}
 	else
 	{
         LLSettingsWater::ptr_t pwater = LLEnvironment::instance().getCurrentWater();
 		F32 depth = water_height - camera_height;
-		
-		// get the water param manager variables
-        float water_fog_density = pwater->getModifiedWaterFogDensity(depth <= 0.0f);
 
 		LLColor4 water_fog_color(pwater->getWaterFogColor());
 
@@ -512,9 +495,6 @@ void LLAtmospherics::updateFog(const F32 distance, const LLVector3& tosun_in)
 
 		// set the gl fog color
 		mGLFogCol = fogCol;
-
-		// set the density based on what the shaders use
-		fog_density = water_fog_density * gSavedSettings.getF32("WaterGLFogDensityScale");
 	}
 
 	mFogColor = sky_fog_color;
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index d28e929b48830463e8aea86fdc24789a185353f7..92b062a51f1c6d5cd65029a8fd0bd9593803cfd8 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2054,17 +2054,6 @@ EMeshProcessingResult LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_
 
 		if (volume->unpackVolumeFaces(stream, data_size))
 		{
-			//load volume faces into decomposition buffer
-			S32 vertex_count = 0;
-			S32 index_count = 0;
-
-			for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
-			{
-				const LLVolumeFace& face = volume->getVolumeFace(i);
-				vertex_count += face.mNumVertices;
-				index_count += face.mNumIndices;
-			}
-
 			d->mPhysicsShapeMesh.clear();
 
 			std::vector<LLVector3>& pos = d->mPhysicsShapeMesh.mPositions;
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index d012a9b32823b946fc2a7c140605c1ae6ccc8c95..d64f1a36f59e086d89940efa72781900ad0ca189 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -2583,8 +2583,6 @@ void LLModelPreview::clearBuffers()
 
 void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
 {
-    U32 tri_count = 0;
-    U32 vertex_count = 0;
     U32 mesh_count = 0;
 
 
@@ -2720,10 +2718,7 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
 
             mVertexBuffer[lod][mdl].push_back(vb);
 
-            vertex_count += num_vertices;
-            tri_count += num_indices / 3;
             ++mesh_count;
-
         }
     }
 }
diff --git a/indra/newview/llpatchvertexarray.cpp b/indra/newview/llpatchvertexarray.cpp
index 6e3e3754884b8f302854e6af845c4204a2e5cf06..a7011dfad5057e6048c9f395c5ce2b815d9f9933 100644
--- a/indra/newview/llpatchvertexarray.cpp
+++ b/indra/newview/llpatchvertexarray.cpp
@@ -69,11 +69,9 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p
 	// (The -1 is there because an LLSurface has a buffer of 1 on 
 	// its East and North edges).
 	U32 power_of_two = 1;
-	U32 surface_order = 0;
 	while (power_of_two < (surface_width-1))
 	{
 		power_of_two *= 2;
-		surface_order += 1;
 	}
 
 	if (power_of_two == (surface_width-1))
diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp
index c267c3c699520752b8d15dfc8453a153fec088dc..30d0a22ef07033049280efb045c3426c0d87fafa 100644
--- a/indra/newview/llpresetsmanager.cpp
+++ b/indra/newview/llpresetsmanager.cpp
@@ -332,7 +332,6 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n
 	else
 	{
 		ECameraPreset new_camera_preset = (ECameraPreset)gSavedSettings.getU32("CameraPresetType");
-		bool new_camera_offsets = false;
 		if (IS_CAMERA)
 		{
 			if (isDefaultCameraPreset(name))
@@ -354,7 +353,6 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n
 			{
 				new_camera_preset = CAMERA_PRESET_CUSTOM;
 			}
-			new_camera_offsets = (!isDefaultCameraPreset(name) || (ECameraPreset)gSavedSettings.getU32("CameraPresetType") != new_camera_preset);
 		}
 		for (std::vector<std::string>::iterator it = name_list.begin(); it != name_list.end(); ++it)
 		{
diff --git a/indra/newview/llsceneview.cpp b/indra/newview/llsceneview.cpp
index f7aa63e34d8a504696272cb98d0e37503d13f006..e250f9bc7a998730c056b98cc448ad670f229f06 100644
--- a/indra/newview/llsceneview.cpp
+++ b/indra/newview/llsceneview.cpp
@@ -266,14 +266,11 @@ void LLSceneView::draw()
 
 			U32 count = triangles[idx].size();
 
-			U32 total = 0;
-
 			gGL.begin(LLRender::LINE_STRIP);
 			//plot triangles
 			for (U32 i = 0; i < count; ++i)
 			{
 				U32 tri_count = triangles[idx][i];
-				total += tri_count;	
 				F32 y = (F32) (tri_count-tri_domain[0])/triangle_range*tri_rect.getHeight()+tri_rect.mBottom;
 				F32 x = (F32) i / count * tri_rect.getWidth() + tri_rect.mLeft;
 
@@ -290,15 +287,8 @@ void LLSceneView::draw()
 			gGL.end();
 			gGL.flush();
 
-			U32 total_visible = 0;
 			count = visible_triangles[idx].size();
 
-			for (U32 i = 0; i < count; ++i)
-			{
-				U32 tri_count = visible_triangles[idx][i];
-				total_visible += tri_count;	
-			}
-
 			std::string label = llformat("%s Object Triangle Counts (Ktris) -- Visible: %.2f/%.2f (%.2f KB Visible)",
 				category[idx], total_visible_triangles[idx]/1024.f, total_triangles[idx]/1024.f, total_visible_bytes[idx]/1024.f);
 
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 208574f0a33d0d88e6d3d793c541e6424e4e02f6..baca7b664894290465a0ca1404d5e328cea166b3 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -1148,15 +1148,14 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time)
 			total_update_count--;
 		}
 	}
-	
-	S32 fetch_count = 0;
+
 	size_t min_update_count = llmin(MIN_UPDATE_COUNT,(S32)(entries.size()-max_priority_count));
 	S32 min_count = max_priority_count + min_update_count;
 	for (entries_list_t::iterator iter3 = entries.begin();
 		 iter3 != entries.end(); )
 	{
 		LLViewerFetchedTexture* imagep = *iter3++;
-		fetch_count += (imagep->updateFetch() ? 1 : 0);
+        imagep->updateFetch();
 		if (min_count <= min_update_count)
 		{
 			mLastFetchKey = LLTextureKey(imagep->getID(), (ETexListType)imagep->getTextureListType());
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index 068e8a131db7b1c846088765970122730cd77a19..f3affbeb3342ca907204d74cbefd5a672bfd974c 100644
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -845,9 +845,6 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group)
 
 	std::sort(mFaceList.begin(), mFaceList.end(), LLFace::CompareDistanceGreater());
 
-	U32 index_count = 0;
-	U32 vertex_count = 0;
-
 	group->clearDrawMap();
 
 	LLVertexBuffer* buffer = group->mVertexBuffer;
@@ -913,9 +910,6 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group)
 		llassert(facep->getIndicesCount() == 6);
 
 
-		vertex_count += facep->getGeomCount();
-		index_count += facep->getIndicesCount();
-
 		S32 idx = draw_vec.size()-1;
 
 		BOOL fullbright = facep->isState(LLFace::FULLBRIGHT);
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index f47fb6287c83c08abaa1f47e3ad66284ab705eed..832803ea6ec3f9f2a6de115897d072a1a986e91b 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1748,16 +1748,6 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global)
         }
     }
 
-    bool rigged = false;
-
-    if (!isAnimatedObject())
-    {
-        rigged = isRiggedMesh() && isAttachment();
-    }
-    else
-    {
-        rigged = isRiggedMesh() && getControlAvatar() && getControlAvatar()->mPlaying;
-    }
 
     if (any_valid_boxes)
     {
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 8abb49fba8b871b6c9e56976eff55b14aeceffeb..aa32ef04b289723e29c5a1077da0c95c058143bb 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -763,14 +763,13 @@ void LLWorld::updateParticles()
 void LLWorld::renderPropertyLines()
 {
 	S32 region_count = 0;
-	S32 vertex_count = 0;
 
 	for (region_list_t::iterator iter = mVisibleRegionList.begin();
 		 iter != mVisibleRegionList.end(); ++iter)
 	{
 		LLViewerRegion* regionp = *iter;
 		region_count++;
-		vertex_count += regionp->renderPropertyLines();
+		regionp->renderPropertyLines();
 	}
 }
 
@@ -778,7 +777,6 @@ void LLWorld::renderPropertyLines()
 void LLWorld::updateNetStats()
 {
 	F64Bits bits;
-	U32 packets = 0;
 
 	for (region_list_t::iterator iter = mActiveRegionList.begin();
 		 iter != mActiveRegionList.end(); ++iter)
@@ -786,7 +784,6 @@ void LLWorld::updateNetStats()
 		LLViewerRegion* regionp = *iter;
 		regionp->updateNetStats();
 		bits += regionp->mBitsReceived;
-		packets += llfloor( regionp->mPacketsReceived );
 		regionp->mBitsReceived = (F32Bits)0.f;
 		regionp->mPacketsReceived = 0.f;
 	}