summaryrefslogtreecommitdiff
path: root/indra/llui/lltextvalidate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lltextvalidate.cpp')
-rw-r--r--indra/llui/lltextvalidate.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp
index 10b3be1c23..84f8b9daf0 100644
--- a/indra/llui/lltextvalidate.cpp
+++ b/indra/llui/lltextvalidate.cpp
@@ -1,25 +1,25 @@
-/**
+/**
* @file lltextvalidate.cpp
* @brief Text validation helper functions
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -74,7 +74,7 @@ class ValidatorFloat : public ValidatorImpl
std::basic_string<CHAR> trimmed = str;
LLStringUtilBase<CHAR>::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if (0 < len)
{
// May be a comma or period, depending on the locale
@@ -119,7 +119,7 @@ class ValidatorInt : public ValidatorImpl
std::basic_string<CHAR> trimmed = str;
LLStringUtilBase<CHAR>::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if (0 < len)
{
S32 i = 0;
@@ -158,7 +158,7 @@ class ValidatorPositiveS32 : public ValidatorImpl
std::basic_string<CHAR> trimmed = str;
LLStringUtilBase<CHAR>::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if (0 < len)
{
CHAR ch = trimmed.front();
@@ -168,7 +168,7 @@ class ValidatorPositiveS32 : public ValidatorImpl
return setError("Validator_ShouldNotBeMinusOrZero", LLSD().with("CH", llsd(ch)));
}
- for (S32 i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
{
ch = trimmed[i];
if (!LLStringOps::isDigit(ch))
@@ -178,7 +178,7 @@ class ValidatorPositiveS32 : public ValidatorImpl
}
}
- S32 val = strtol(trimmed);
+ auto val = strtol(trimmed);
if (val <= 0)
{
return setError("Validator_InvalidNumericString", LLSD().with("STR", llsd(trimmed)));
@@ -202,7 +202,7 @@ class ValidatorNonNegativeS32 : public ValidatorImpl
std::basic_string<CHAR> trimmed = str;
LLStringUtilBase<CHAR>::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if (0 < len)
{
CHAR ch = trimmed.front();
@@ -212,7 +212,7 @@ class ValidatorNonNegativeS32 : public ValidatorImpl
return setError("Validator_ShouldNotBeMinus", LLSD().with("CH", llsd(ch)));
}
- for (S32 i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
{
ch = trimmed[i];
if (!LLStringOps::isDigit(ch))
@@ -222,7 +222,7 @@ class ValidatorNonNegativeS32 : public ValidatorImpl
}
}
- S32 val = strtol(trimmed);
+ auto val = strtol(trimmed);
if (val < 0)
{
return setError("Validator_InvalidNumericString", LLSD().with("STR", llsd(trimmed)));
@@ -245,7 +245,7 @@ class ValidatorNonNegativeS32NoSpace : public ValidatorImpl
LLLocale locale(LLLocale::USER_LOCALE);
std::basic_string<CHAR> test_str = str;
- S32 len = test_str.length();
+ auto len = test_str.length();
if (0 < len)
{
CHAR ch = test_str.front();
@@ -255,7 +255,7 @@ class ValidatorNonNegativeS32NoSpace : public ValidatorImpl
return setError("Validator_ShouldNotBeMinus", LLSD().with("CH", llsd(ch)));
}
- for (S32 i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
{
ch = test_str[i];
if (!LLStringOps::isDigit(ch) || LLStringOps::isSpace(ch))
@@ -265,7 +265,7 @@ class ValidatorNonNegativeS32NoSpace : public ValidatorImpl
}
}
- S32 val = strtol(test_str);
+ auto val = strtol(test_str);
if (val < 0)
{
return setError("Validator_InvalidNumericString", LLSD().with("STR", llsd(test_str)));
@@ -287,7 +287,7 @@ class ValidatorAlphaNum : public ValidatorImpl
{
LLLocale locale(LLLocale::USER_LOCALE);
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -314,7 +314,7 @@ class ValidatorAlphaNumSpace : public ValidatorImpl
{
LLLocale locale(LLLocale::USER_LOCALE);
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -342,7 +342,7 @@ class ValidatorASCIIPrintableNoPipe : public ValidatorImpl
template <class CHAR>
bool validate(const std::basic_string<CHAR>& str)
{
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -369,7 +369,7 @@ class ValidatorASCIIPrintableNoSpace : public ValidatorImpl
template <class CHAR>
bool validate(const std::basic_string<CHAR>& str)
{
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -396,7 +396,7 @@ protected:
template <class CHAR>
bool validate(const std::basic_string<CHAR>& str)
{
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];
@@ -442,7 +442,7 @@ class ValidatorASCIIWithNewLine : public ValidatorImpl
template <class CHAR>
bool validate(const std::basic_string<CHAR>& str)
{
- S32 len = str.length();
+ auto len = str.length();
while (len--)
{
CHAR ch = str[len];