diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 8028f397f3ebf99bc2c52d25888ab68c8d350bbf..3354cb2db3ae5c39f313d6a3c00873ab1ba4f83b 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -942,11 +942,8 @@ void LLButton::draw()
 			break;
 		}
 
-		S32 y_offset = 2 + (getRect().getHeight() - 20)/2;
-	
 		if (pressed && mDisplayPressedState)
 		{
-			y_offset--;
 			x++;
 		}
 
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 5cb840fd613e9bf370295d54ad3620c54570f7b2..d29781cf339ca624a72f08d940ff8ef55425608d 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -487,9 +487,6 @@ void LLMenuItemGL::draw( void )
 	// let disabled items be highlighted, just don't draw them as such
 	if( getEnabled() && getHighlight() && !mBriefItem)
 	{
-		int debug_count = 0;
-		if (dynamic_cast<LLMenuItemCallGL*>(this))
-			debug_count++;
 		gGL.color4fv( mHighlightBackground.get().mV );
 
 		gl_rect_2d( 0, getRect().getHeight(), getRect().getWidth(), 0 );
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 9018a5f168cd4f54415647fd695bc64db53b3bc2..f158d312fff4d8ad771b9621002b36aa4965e2cb 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -3707,7 +3707,6 @@ void LLAgent::processScriptControlChange(LLMessageSystem *msg, void **)
 			// take controls
 			msg->getU32("Data", "Controls", controls, block_index );
 			msg->getBOOL("Data", "PassToAgent", passon, block_index );
-			U32 total_count = 0;
 			for (i = 0; i < TOTAL_CONTROLS; i++)
 			{
 				if (controls & ( 1 << i))
@@ -3720,7 +3719,6 @@ void LLAgent::processScriptControlChange(LLMessageSystem *msg, void **)
 					{
 						gAgent.mControlsTakenCount[i]++;
 					}
-					total_count++;
 				}
 			}
 		}
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index e1a5b224909846fa31b48a3e18b5c3794893c3bb..495153981b8183f06d4a9b9a88a986913ca77680 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -2685,9 +2685,6 @@ void LLModelPreview::clearBuffers()
 
 void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
 {
-    U32 mesh_count = 0;
-
-
     LLModelLoader::model_list* model = NULL;
 
     if (lod < 0 || lod > 4)
@@ -2818,8 +2815,6 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
             vb->flush();
 
             mVertexBuffer[lod][mdl].push_back(vb);
-
-            ++mesh_count;
         }
     }
 }
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index 02911313ed41784d3fd020f08a552c560498ea23..3c3cd5d5223b280f3c760c6f2888c9ff4a5bd03f 100644
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -619,7 +619,6 @@ void LLPanelNearByMedia::refreshList()
 	LLViewerMedia::impl_list impls = media_inst->getPriorityList();
 	LLViewerMedia::impl_list::iterator priority_iter;
 	
-	U32 enabled_count = 0;
 	U32 disabled_count = 0;
 	
 	// iterate over the impl list, creating rows as necessary.
@@ -662,13 +661,10 @@ void LLPanelNearByMedia::refreshList()
 			{
 				disabled_count++;
 			}
-			else {
-				enabled_count++;
 		}
 	}
-	}	
 	mDisableAllCtrl->setEnabled((gSavedSettings.getBOOL("AudioStreamingMusic") || 
-		                         gSavedSettings.getBOOL("AudioStreamingMedia")) &&
+								 gSavedSettings.getBOOL("AudioStreamingMedia")) &&
 								(media_inst->isAnyMediaShowing() || 
 								 media_inst->isParcelMediaPlaying() ||
 								 media_inst->isParcelAudioPlaying()));
diff --git a/indra/newview/llsceneview.cpp b/indra/newview/llsceneview.cpp
index 5e339a52bf1da57f3c522456fa88c1747c573bc5..9b1d2d48c65cdbe7f7bb1316f88ce1d1cc86129b 100644
--- a/indra/newview/llsceneview.cpp
+++ b/indra/newview/llsceneview.cpp
@@ -100,8 +100,6 @@ void LLSceneView::draw()
 	F32 total_physics[] = { 0.f, 0.f };
 	
 
-	U32 object_count = 0;
-
 	LLViewerRegion* region = gAgent.getRegion();
 	if (region)
 	{
@@ -116,8 +114,7 @@ void LLSceneView::draw()
 				U32 idx = object->isAttachment() ? 1 : 0;
 
 				LLVolume* volume = object->getVolume();
-				object_count++;
-				
+
 				F32 radius = object->getScale().magVec();
 				size[idx].push_back(radius);
 
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 86f7d2bf2535780005711693f2dc1e0d6be3a00f..195b172102dff3dbe8018187b15a8329f2e6fa77 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -5274,8 +5274,8 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle,
 	LLViewerRegion*	last_region;
 	LLViewerRegion*	current_region;
 
-	S32 objects_sent = 0;
-	S32 packets_sent = 0;
+//	S32 objects_sent = 0;
+//	S32 packets_sent = 0;
 	S32 objects_in_this_packet = 0;
 
 	bool link_operation = message_name == "ObjectLink";
@@ -5407,7 +5407,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle,
 			(*pack_body)(node, user_data);
             // do any related logging
             (*log_func)(node, user_data);
-			++objects_sent;
+//			++objects_sent;
 			++objects_in_this_packet;
 
 			// and on to the next object
@@ -5425,7 +5425,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle,
 		{
 			// otherwise send current message and start new one
 			gMessageSystem->sendReliable( last_region->getHost());
-			packets_sent++;
+//			packets_sent++;
 			objects_in_this_packet = 0;
 
 			gMessageSystem->newMessage(message_name.c_str());
@@ -5442,7 +5442,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle,
 				{
 					// add root instance into new message
 					(*pack_body)(linkset_root, user_data);
-					++objects_sent;
+//					++objects_sent;
 					++objects_in_this_packet;
 				}
 			}
@@ -5456,7 +5456,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle,
 	if (gMessageSystem->getCurrentSendTotal() > 0)
 	{
 		gMessageSystem->sendReliable( current_region->getHost());
-		packets_sent++;
+//		packets_sent++;
 	}
 	else
 	{
diff --git a/indra/newview/llsprite.cpp b/indra/newview/llsprite.cpp
index c3eb70f850c2a7622d5a2423b7e32908a2a850a9..fd41cdf0d7d986d1a74f04cee48408aa0285fb23 100644
--- a/indra/newview/llsprite.cpp
+++ b/indra/newview/llsprite.cpp
@@ -79,7 +79,6 @@ void LLSprite::updateFace(LLFace &face)
 
 	// First, figure out how many vertices/indices we need.
 	U32 num_vertices, num_indices;
-	U32 vertex_count = 0;
 	
 	// Get the total number of vertices and indices
 	if (mFollow)
@@ -203,25 +202,21 @@ void LLSprite::updateFace(LLFace &face)
 	*verticesp = mC;
 	tex_coordsp++;
 	verticesp++;
-	vertex_count++;
 
 	*tex_coordsp = LLVector2(0.f, 1.f);
 	*verticesp = mB;
 	tex_coordsp++;
 	verticesp++;
-	vertex_count++;
 
 	*tex_coordsp = LLVector2(1.f, 1.f);
 	*verticesp = mA;
 	tex_coordsp++;
 	verticesp++;
-	vertex_count++;
 
 	*tex_coordsp = LLVector2(1.f, 0.0f);
 	*verticesp = mD;
 	tex_coordsp++;
 	verticesp++;
-	vertex_count++;
 
 	// Generate indices, since they're easy.
 	// Just a series of quads.
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 6883ead5ee08e34f44f77309238d0ac69025b749..70ca41c8215155ccd1b63fe5540df3f867e33914 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -3244,7 +3244,7 @@ LLSD transform_cert_args(LLPointer<LLCertificate> cert)
 		// are actually arrays, and we want to format them as comma separated          
 		// strings, so special case those.                                             
 		LLSDSerialize::toXML(cert_info[iter->first], std::cout);
-		if((iter->first== std::string(CERT_KEY_USAGE)) |
+		if((iter->first == std::string(CERT_KEY_USAGE)) ||
 		   (iter->first == std::string(CERT_EXTENDED_KEY_USAGE)))
 		{
 			value = "";
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index cf9211767e1ea50d9df264ab93f183e168686ebf..84b61fc6122b39912f5d50deb708b0d280b8c60e 100644
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -845,8 +845,8 @@ void LLTextureView::draw()
 
 			if (imagep->getID() == LLAppViewer::getTextureFetch()->mDebugID)
 			{
-				static S32 debug_count = 0;
-				++debug_count; // for breakpoints
+//				static S32 debug_count = 0;
+//				++debug_count; // for breakpoints
 			}
 			
 			F32 pri;
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index efc4ded79ef086d5c287d19bf67255f17f79b625..9666533db89f8ea63e2b46c5b7e7de07c859a8d0 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -773,7 +773,6 @@ void LLViewerObjectList::dirtyAllObjectInventory()
 void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
 {
 	S32 i;
-	S32 num_objects = 0;
 	LLViewerObject *objectp;
 
 	S32 num_updates, max_value;
@@ -830,8 +829,6 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
 		objectp = mObjects[i];
 		if (!objectp->isDead())
 		{
-			num_objects++;
-
 			//  Update distance & gpw 
 			objectp->setPixelAreaAndAngle(agent); // Also sets the approx. pixel area
 			objectp->updateTextures();	// Update the image levels of textures for this object.
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index b0af565867725d991563bbbb6d311058d355b6f9..5cb7e7478b3fca4d0a06aac4a976addce9616db8 100644
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -408,7 +408,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 										LLStrider<U16> &indicesp,
 										U32 &index_offset)
 {
-	S32 vertex_count = 0;
 	S32 i, x, y;
 
 	S32 num_vertices;
@@ -443,7 +442,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 			normalsp++;
 			texCoords0p++;
 			texCoords1p++;
-			vertex_count++;
 		}
 
 		// North patch
@@ -456,7 +454,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 			normalsp++;
 			texCoords0p++;
 			texCoords1p++;
-			vertex_count++;
 		}
 
 
@@ -493,7 +490,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 			normalsp++;
 			texCoords0p++;
 			texCoords1p++;
-			vertex_count++;
 		}
 
 		// Iterate through the north patch's points
@@ -507,7 +503,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 			normalsp++;
 			texCoords0p++;
 			texCoords1p++;
-			vertex_count++;
 		}
 
 
@@ -551,7 +546,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 			normalsp++;
 			texCoords0p++;
 			texCoords1p++;
-			vertex_count++;
 		}
 
 		// Iterate through the north patch's points
@@ -565,7 +559,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
 			normalsp++;
 			texCoords0p++;
 			texCoords1p++;
-			vertex_count++;
 		}
 
 		for (i = 0; i < length; i++)
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 2e7ccc83343864f884794e81bcbf322edcbaf1ba..97b129db18283c3e4528bcc05a748dfe9210c758 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -6287,7 +6287,6 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
 	LLSpatialGroup::buffer_map_t buffer_map;
 
 	LLViewerTexture* last_tex = NULL;
-	S32 buffer_index = 0;
 
 	S32 texture_index_channels = 1;
 	
@@ -6300,11 +6299,6 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
 	{
 		texture_index_channels = gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels;
 	}
-    
-    if (distance_sort)
-    {
-        buffer_index = -1;
-    }
 
 	static LLCachedControl<U32> max_texture_index(gSavedSettings, "RenderMaxTextureIndex", 16);
 	texture_index_channels = llmin(texture_index_channels, (S32) max_texture_index);
@@ -6328,14 +6322,9 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
 			tex = NULL;
 		}
 
-		if (last_tex == tex)
-		{
-			buffer_index++;
-		}
-		else
+		if (last_tex != tex)
 		{
 			last_tex = tex;
-			buffer_index = 0;
 		}
 
 		bool bake_sunlight = LLPipeline::sBakeSunlight && facep->getDrawable()->isStatic();