diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp
index c6f5cac4b8aea2fb699e38de8bcfd2b6ac063cf2..66e9751f0622a81a012867ffc38745e0cf9d6ab6 100644
--- a/indra/llappearance/llpolymorph.cpp
+++ b/indra/llappearance/llpolymorph.cpp
@@ -384,8 +384,8 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
 	if (!mMorphData)
 	{
 		const std::string driven_tag = "_Driven";
-		U32 pos = morph_param_name.find(driven_tag);
-		if (pos > 0)
+		size_t pos = morph_param_name.find(driven_tag);
+		if (pos != std::string::npos && pos > 0)
 		{
 			morph_param_name = morph_param_name.substr(0,pos);
 			mMorphData = mMesh->getMorphData(morph_param_name);
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 66bd85f4e6aceae6c0af0864ee616aa94aa746a1..0064b10fefb4505f2b315444e45c37fd3abf3089 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -560,13 +560,13 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name)
 {
 	//boost::regexp was showing up in the crashreporter, so doing  
 	//painfully manual parsing using substr. LF
-	S32 open_paren = complete_name.rfind(" (");
-	S32 close_paren = complete_name.rfind(')');
+	size_t open_paren = complete_name.rfind(" (");
+	size_t close_paren = complete_name.rfind(')');
 
 	if (open_paren != std::string::npos &&
 		close_paren == complete_name.length()-1)
 	{
-		S32 length = close_paren - open_paren - 2;
+		size_t length = close_paren - open_paren - 2;
 		std::string legacy_name = complete_name.substr(open_paren+2, length);
 		
 		if (legacy_name.length() > 0)
@@ -575,7 +575,7 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name)
 			LLStringUtil::toUpper(cap_letter);
 			legacy_name = cap_letter + legacy_name.substr(1);
 	
-			S32 separator = legacy_name.find('.');
+			size_t separator = legacy_name.find('.');
 
 			if (separator != std::string::npos)
 			{
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 0a67d8f73b06901e89e229a5a348b7d28bc8eb71..73dbac87f9f34ed067d39f2b90cef81e2584c519 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -362,10 +362,10 @@ void LLTextEditor::selectNext(const std::string& search_text_in, BOOL case_insen
 		}
 	}
 	
-	S32 loc = text.find(search_text,mCursorPos);
+	size_t loc = text.find(search_text,mCursorPos);
 	
 	// If Maybe we wrapped, search again
-	if (wrap && (-1 == loc))
+	if (wrap && (std::string::npos == loc))
 	{	
 		loc = text.find(search_text);
 	}
diff --git a/indra/llui/lltimectrl.cpp b/indra/llui/lltimectrl.cpp
index 516057f8fd58f1d235979c98ac547adb4bdfc779..f76c6bc92e5900a479cfa8014422c08dc8e564ba 100644
--- a/indra/llui/lltimectrl.cpp
+++ b/indra/llui/lltimectrl.cpp
@@ -322,19 +322,21 @@ LLTimeCtrl::EEditingPart LLTimeCtrl::getEditingPart()
 	S32 cur_pos = mEditor->getCursor();
 	std::string time_str = mEditor->getText();
 
-	S32 colon_index = time_str.find_first_of(':');
-
-	if (cur_pos <= colon_index)
-	{
-		return HOURS;
-	}
-	else if (cur_pos > colon_index && cur_pos <= (S32)(time_str.length() - AMPM_LEN))
+	size_t colon_index = time_str.find_first_of(':');
+	if (colon_index != std::string::npos)
 	{
-		return MINUTES;
-	}
-	else if (cur_pos > (S32)(time_str.length() - AMPM_LEN))
-	{
-		return DAYPART;
+		if (cur_pos <= colon_index)
+		{
+			return HOURS;
+		}
+		else if (cur_pos > colon_index&& cur_pos <= (S32)(time_str.length() - AMPM_LEN))
+		{
+			return MINUTES;
+		}
+		else if (cur_pos > (S32)(time_str.length() - AMPM_LEN))
+		{
+			return DAYPART;
+		}
 	}
 
 	return NONE;
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index ce7414983d44d023fe1c0b802c246c50d2ee376c..18af7c8c5f1034f2015697f1737bcfbe9c533529 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -4333,8 +4333,8 @@ bool LLAppViewer::initCache()
 		{
 			old_vfs_data_file = gDirUtilp->add(dir, found_file);
 
-			S32 start_pos = found_file.find_last_of('.');
-			if (start_pos > 0)
+			size_t start_pos = found_file.find_last_of('.');
+			if (start_pos != std::string::npos && start_pos > 0)
 			{
 				sscanf(found_file.substr(start_pos+1).c_str(), "%d", &old_salt);
 			}