diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index 8052da24505212ec908d5d39c4e5be6c844f570e..6516d1779ea404ca53fe34628e1b0843833257a1 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -155,7 +155,7 @@ S32 wchar_to_utf8chars(llwchar in_char, char* outchars)
 		*outchars++ = 0xF0 | (cur_char >> 18);
 		*outchars++ = 0x80 | ((cur_char >> 12) & 0x3F);
 		*outchars++ = 0x80 | ((cur_char >> 6) & 0x3F);
-		*outchars++ = 0x80 | cur_char & 0x3F;
+		*outchars++ = 0x80 | (cur_char & 0x3F);
 	}
 	else if (cur_char < 0x4000000)
 	{
@@ -163,7 +163,7 @@ S32 wchar_to_utf8chars(llwchar in_char, char* outchars)
 		*outchars++ = 0x80 | ((cur_char >> 18) & 0x3F);
 		*outchars++ = 0x80 | ((cur_char >> 12) & 0x3F);
 		*outchars++ = 0x80 | ((cur_char >> 6) & 0x3F);
-		*outchars++ = 0x80 | cur_char & 0x3F;
+		*outchars++ = 0x80 | (cur_char & 0x3F);
 	}
 	else if (cur_char < 0x80000000)
 	{
@@ -172,7 +172,7 @@ S32 wchar_to_utf8chars(llwchar in_char, char* outchars)
 		*outchars++ = 0x80 | ((cur_char >> 18) & 0x3F);
 		*outchars++ = 0x80 | ((cur_char >> 12) & 0x3F);
 		*outchars++ = 0x80 | ((cur_char >> 6) & 0x3F);
-		*outchars++ = 0x80 | cur_char & 0x3F;
+		*outchars++ = 0x80 | (cur_char & 0x3F);
 	}
 	else
 	{
diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h
index 805d7e63842607e6ae5d616902969f0054444755..06a4f5c542daf822454874b7d054319401022959 100644
--- a/indra/llmath/v3math.h
+++ b/indra/llmath/v3math.h
@@ -409,8 +409,8 @@ inline bool operator<(const LLVector3 &a, const LLVector3 &b)
 	return (a.mV[0] < b.mV[0]
 			|| (a.mV[0] == b.mV[0]
 				&& (a.mV[1] < b.mV[1]
-					|| (a.mV[1] == b.mV[1])
-						&& a.mV[2] < b.mV[2])));
+					|| ((a.mV[1] == b.mV[1])
+						&& a.mV[2] < b.mV[2]))));
 }
 
 inline const LLVector3& operator+=(LLVector3 &a, const LLVector3 &b)
diff --git a/indra/llmessage/lliobuffer.cpp b/indra/llmessage/lliobuffer.cpp
index 71c1df8f9940e741257ad0041735f42592d32fe5..223a23949b5a08722852d8fd6ddb8a13d6952aac 100644
--- a/indra/llmessage/lliobuffer.cpp
+++ b/indra/llmessage/lliobuffer.cpp
@@ -87,7 +87,7 @@ LLIOPipe::EStatus LLIOBuffer::seek(LLIOBuffer::EHead head, S64 delta)
 	{
 	case READ:
 		if(((delta >= 0) && ((mReadHead + delta) <= mWriteHead))
-		   || (delta < 0) && ((mReadHead + delta) >= mBuffer))
+		   || ((delta < 0) && ((mReadHead + delta) >= mBuffer)))
 		{
 			mReadHead += delta;
 			status = STATUS_OK;
@@ -95,7 +95,7 @@ LLIOPipe::EStatus LLIOBuffer::seek(LLIOBuffer::EHead head, S64 delta)
 		break;
 	case WRITE:
 		if(((delta >= 0) && ((mWriteHead + delta) < (mBuffer + mBufferSize)))
-		   || (delta < 0) && ((mWriteHead + delta) > mReadHead))
+		   || ((delta < 0) && ((mWriteHead + delta) > mReadHead)))
 		{
 			mWriteHead += delta;
 			status = STATUS_OK;
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index 567e3a6c3ea71b43b48af83d5ee1b8b74166b9eb..d9520b3bf63c1f226bb65244bb50904b4a51ee2f 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -140,7 +140,7 @@ void LLRenderTarget::addColorAttachment(U32 color_fmt)
 
 	U32 offset = mTex.size();
 	if (offset >= 4 ||
-		offset > 0 && (mFBO == 0 || !gGLManager.mHasDrawBuffers))
+		(offset > 0 && (mFBO == 0 || !gGLManager.mHasDrawBuffers)))
 	{
 		llerrs << "Too many color attachments!" << llendl;
 	}
@@ -660,7 +660,7 @@ void LLMultisampleBuffer::addColorAttachment(U32 color_fmt)
 
 	U32 offset = mTex.size();
 	if (offset >= 4 ||
-		offset > 0 && (mFBO == 0 || !gGLManager.mHasDrawBuffers))
+		(offset > 0 && (mFBO == 0 || !gGLManager.mHasDrawBuffers)))
 	{
 		llerrs << "Too many color attachments!" << llendl;
 	}
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 75b08038909832d53041a5441f7a648492ed2fe1..f2d147ac3926e3e5e363e413ea6136216dc82d74 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -2346,8 +2346,8 @@ void LLMenuGL::createJumpKeys()
 				{
 					char jump_key = uppercase_word[i];
 					
-					if (LLStringOps::isDigit(jump_key) || LLStringOps::isUpper(jump_key) &&
-						mJumpKeys.find(jump_key) == mJumpKeys.end())
+					if (LLStringOps::isDigit(jump_key) || (LLStringOps::isUpper(jump_key) &&
+						mJumpKeys.find(jump_key) == mJumpKeys.end()))
 					{
 						mJumpKeys.insert(std::pair<KEY, LLMenuItemGL*>(jump_key, (*item_it)));
 						(*item_it)->setJumpKey(jump_key);
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index f581f2c4022454cca60e700f9b117920473ee700..e087feeaecf4c13ff55318b8604e968e4b351ec1 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -309,8 +309,8 @@ void LLDrawPoolBump::endRenderPass(S32 pass)
 void LLDrawPoolBump::beginShiny(bool invisible)
 {
 	LLFastTimer t(FTM_RENDER_SHINY);
-	if (!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY)|| 
-		invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY))
+	if ((!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))|| 
+		(invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)))
 	{
 		return;
 	}
@@ -384,8 +384,8 @@ void LLDrawPoolBump::beginShiny(bool invisible)
 void LLDrawPoolBump::renderShiny(bool invisible)
 {
 	LLFastTimer t(FTM_RENDER_SHINY);
-	if (!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY)|| 
-		invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY))
+	if ((!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))|| 
+		(invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)))
 	{
 		return;
 	}
@@ -411,8 +411,8 @@ void LLDrawPoolBump::renderShiny(bool invisible)
 void LLDrawPoolBump::endShiny(bool invisible)
 {
 	LLFastTimer t(FTM_RENDER_SHINY);
-	if (!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY)|| 
-		invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY))
+	if ((!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))|| 
+		(invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)))
 	{
 		return;
 	}
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 8aea7422fc3ec0f699189323fdce32f774a109f2..fc5b27dd1b355b887dc194ed46a538c86de13759 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -1007,7 +1007,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 			0.75f
 		};
 
-		if (getPoolType() != LLDrawPool::POOL_ALPHA && (LLPipeline::sRenderDeferred || LLPipeline::sRenderBump && tep->getShiny()))
+		if (getPoolType() != LLDrawPool::POOL_ALPHA && (LLPipeline::sRenderDeferred || (LLPipeline::sRenderBump && tep->getShiny())))
 		{
 			color.mV[3] = U8 (alpha[tep->getShiny()] * 255);
 		}
diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp
index e366340a10b5a0d85f3eeb9666c0cc017a12b285..07b81ef13496897bfb6fff37250bb01ca9687bda 100644
--- a/indra/newview/llhudeffectlookat.cpp
+++ b/indra/newview/llhudeffectlookat.cpp
@@ -421,8 +421,8 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec
 	BOOL lookAtChanged = (target_type != mTargetType) || (object != mTargetObject);
 
 	// lookat position has moved a certain amount and we haven't just sent an update
-	lookAtChanged = lookAtChanged || (dist_vec(position, mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE) && 
-		((current_time - mLastSendTime) > (1.f / MAX_SENDS_PER_SEC));
+	lookAtChanged = lookAtChanged || ((dist_vec(position, mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE) && 
+		((current_time - mLastSendTime) > (1.f / MAX_SENDS_PER_SEC)));
 
 	if (lookAtChanged)
 	{
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 8a052b61dbad7c71d10c6c642e13544800e61425..4e13cb17a2ab1081c57f9cfc45a8d38feefacb29 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -1975,9 +1975,9 @@ class LLOctreeCullDetectVisible: public LLOctreeCullShadow
 	virtual bool earlyFail(LLSpatialGroup* group)
 	{
 		if (mResult || //already found a node, don't check any more
-			group->mOctreeNode->getParent() &&	//never occlusion cull the root node
-			LLPipeline::sUseOcclusion &&			//ignore occlusion if disabled
-			group->isOcclusionState(LLSpatialGroup::OCCLUDED))
+			(group->mOctreeNode->getParent() &&	//never occlusion cull the root node
+			 LLPipeline::sUseOcclusion &&			//ignore occlusion if disabled
+			 group->isOcclusionState(LLSpatialGroup::OCCLUDED)))
 		{
 			return true;
 		}
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index d6297c30c757543e97b975fcd0205e6c65cc57aa..5c210c5c28a1088c28fafac770e15a1d50bf1984 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -210,8 +210,8 @@ BOOL LLToolPie::pickLeftMouseDownCallback()
 			} // else nothing (fall through to touch)
 			
 		case CLICK_ACTION_PAY:
-			if (object && object->flagTakesMoney()
-				|| parent && parent->flagTakesMoney())
+			if ((object && object->flagTakesMoney())
+				|| (parent && parent->flagTakesMoney()))
 			{
 				// pay event goes to object actually clicked on
 				mClickActionObject = object;
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index 1c2894dc37568cb34d693af7cef209161a5af228..ee6ef6ffee397d7187fd79f502cf1bf4555a08f7 100644
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -781,8 +781,8 @@ BOOL LLViewerCamera::areVertsVisible(LLViewerObject* volumep, BOOL all_verts)
 
 			BOOL in_frustum = pointInFrustum(LLVector3(vec)) > 0;
 
-			if ( !in_frustum && all_verts ||
-				 in_frustum && !all_verts)
+			if (( !in_frustum && all_verts) ||
+				 (in_frustum && !all_verts))
 			{
 				return !all_verts;
 			}
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index fc2f00a2ea6bf410374ed0d67a0d85925969020f..2dc317e067f9e0cbed7b714c3f740088720b6d1c 100644
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -716,7 +716,7 @@ BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, c
 			if (idx >=2 && idx <= 12)
 			{
 				U32 keyidx = ((mask<<16)|key);
-				(mRemapKeys[mode])[keyidx] = ((0<<16)|KEY_F1+(idx-1));
+				(mRemapKeys[mode])[keyidx] = ((0<<16)|(KEY_F1+(idx-1)));
 				return TRUE;
 			}
 		}
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 8c223557bf2724887c40616081848db83ace023d..d3d5f060e1fe13d8003bea3493d5410bc119197a 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -660,8 +660,8 @@ BOOL LLViewerObject::setDrawableParent(LLDrawable* parentp)
 	mDrawable->mParent = parentp; 
 		
 	gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
-	if(	old_parent != parentp &&
-		old_parent || (parentp && parentp->isActive()))
+	if(	(old_parent != parentp && old_parent)
+		|| (parentp && parentp->isActive()))
 	{
 		// *TODO we should not be relying on setDrawable parent to call markMoved
 		gPipeline.markMoved(mDrawable, FALSE);
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 92dbb29d8ed2df2b4b8c664f4145d81b922427fc..60d64d50b93afd607365d6598ecfd8efffe1ead6 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1404,7 +1404,7 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector3& start, const LLVector3& e
 									  LLVector3* normal,
 									  LLVector3* bi_normal)
 {
-	if (isSelf() && !gAgent.needsRenderAvatar() || !LLPipeline::sPickAvatar)
+	if ((isSelf() && !gAgent.needsRenderAvatar()) || !LLPipeline::sPickAvatar)
 	{
 		return FALSE;
 	}
@@ -7471,9 +7471,9 @@ BOOL LLVOAvatar::updateLOD()
 
 	LLFace* facep = mDrawable->getFace(0);
 	if (facep->mVertexBuffer.isNull() ||
-		LLVertexBuffer::sEnableVBOs &&
+		(LLVertexBuffer::sEnableVBOs &&
 		((facep->mVertexBuffer->getUsage() == GL_STATIC_DRAW ? TRUE : FALSE) !=
-		 (facep->getPool()->getVertexShaderLevel() > 0 ? TRUE : FALSE)))
+		 (facep->getPool()->getVertexShaderLevel() > 0 ? TRUE : FALSE))))
 	{
 		mDirtyMesh = TRUE;
 	}
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index ae5992099d967e0e4bd7f6c4903cf427cef5cbfa..33b86660fa85524d11c0d1b854b89eacdc89ec67 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -1095,10 +1095,10 @@ BOOL LLVOSky::updateSky()
 							   mLastTotalAmbient.mV[2] - mTotalAmbient.mV[2]);
 
 			if ( mForceUpdate 
-				 || ((dot_lighting < LIGHT_DIRECTION_THRESHOLD)
+				 || (((dot_lighting < LIGHT_DIRECTION_THRESHOLD)
 				 || (delta_color.length() > COLOR_CHANGE_THRESHOLD)
 				 || !mInitialized)
-				&& !direction.isExactlyZero())
+				&& !direction.isExactlyZero()))
 			{
 				mLastLightingDirection = direction;
 				mLastTotalAmbient = mTotalAmbient;
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 03709a14fb54ccc8fff3843fadc918f13cfc6aa4..93cb0f0f45562ba856307f9dc784704b5ef1770e 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -507,8 +507,8 @@ void LLVOVolume::updateTextures()
 
 		if (face->mTextureMatrix != NULL)
 		{
-			if (vsize < MIN_TEX_ANIM_SIZE && old_size > MIN_TEX_ANIM_SIZE ||
-				vsize > MIN_TEX_ANIM_SIZE && old_size < MIN_TEX_ANIM_SIZE)
+			if ((vsize < MIN_TEX_ANIM_SIZE && old_size > MIN_TEX_ANIM_SIZE) ||
+				(vsize > MIN_TEX_ANIM_SIZE && old_size < MIN_TEX_ANIM_SIZE))
 			{
 				gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_TCOORD, FALSE);
 			}
@@ -2601,7 +2601,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 						{ //needs normal + binormal
 							bump_faces.push_back(facep);
 						}
-						else if (te->getShiny() && LLPipeline::sRenderBump ||
+						else if ((te->getShiny() && LLPipeline::sRenderBump) ||
 							!te->getFullbright())
 						{ //needs normal
 							simple_faces.push_back(facep);