diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-12-22 12:05:18 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-12-22 12:13:05 +0900 |
| commit | a4ebd73f48610ed351c9c53f3646d0597f8ea7bc (patch) | |
| tree | 2edd219eef4cb8f35bb3844d06902ae8b2fcb565 /src/tools/tqlocale.cpp | |
| parent | 7d612f7c91d55501276a385a30dbadb121e7bd9f (diff) | |
| download | tqt-rename/true-false-9.tar.gz tqt-rename/true-false-9.zip | |
Replace TRUE/FALSE with boolean values true/false - part 9rename/true-false-9
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/tools/tqlocale.cpp')
| -rw-r--r-- | src/tools/tqlocale.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/src/tools/tqlocale.cpp b/src/tools/tqlocale.cpp index a53d34571..e3ab4305d 100644 --- a/src/tools/tqlocale.cpp +++ b/src/tools/tqlocale.cpp @@ -2497,7 +2497,7 @@ TQLocale::TQLocale(const TQString &name) break; cntry = codeToCountry(name.mid(3, 2)); - } while (FALSE); + } while (false); d = findLocale(lang, cntry); } @@ -2675,7 +2675,7 @@ short TQLocale::toShort(const TQString &s, bool *ok) const TQ_LLONG i = toLongLong(s, ok); if (i < SHRT_MIN || i > SHRT_MAX) { if (ok != 0) - *ok = FALSE; + *ok = false; return 0; } return (short) i; @@ -2698,7 +2698,7 @@ ushort TQLocale::toUShort(const TQString &s, bool *ok) const TQ_ULLONG i = toULongLong(s, ok); if (i > USHRT_MAX) { if (ok != 0) - *ok = FALSE; + *ok = false; return 0; } return (ushort) i; @@ -2721,7 +2721,7 @@ int TQLocale::toInt(const TQString &s, bool *ok) const TQ_LLONG i = toLongLong(s, ok); if (i < INT_MIN || i > INT_MAX) { if (ok != 0) - *ok = FALSE; + *ok = false; return 0; } return (int) i; @@ -2744,7 +2744,7 @@ uint TQLocale::toUInt(const TQString &s, bool *ok) const TQ_ULLONG i = toULongLong(s, ok); if (i > UINT_MAX) { if (ok != 0) - *ok = FALSE; + *ok = false; return 0; } return (uint) i; @@ -2767,7 +2767,7 @@ TQ_LONG TQLocale::toLong(const TQString &s, bool *ok) const TQ_LLONG i = toLongLong(s, ok); if (i < LONG_MIN || i > LONG_MAX) { if (ok != 0) - *ok = FALSE; + *ok = false; return 0; } return (TQ_LONG) i; @@ -2790,7 +2790,7 @@ TQ_ULONG TQLocale::toULong(const TQString &s, bool *ok) const TQ_ULLONG i = toULongLong(s, ok); if (i > ULONG_MAX) { if (ok != 0) - *ok = FALSE; + *ok = false; return 0; } return (TQ_ULONG) i; @@ -2852,11 +2852,11 @@ float TQLocale::toFloat(const TQString &s, bool *ok) const double d = toDouble(s, &myOk); if (!myOk || d > QT_MAX_FLOAT || d < -QT_MAX_FLOAT) { if (ok != 0) - *ok = FALSE; + *ok = false; return 0.0; } if (ok != 0) - *ok = TRUE; + *ok = true; return (float) d; } @@ -3204,19 +3204,19 @@ TQString TQLocalePrivate::doubleToString(double d, if (width == -1) width = 0; - bool negative = FALSE; - bool special_number = FALSE; // nan, +/-inf + bool negative = false; + bool special_number = false; // nan, +/-inf TQString num_str; #ifdef Q_OS_WIN // Detect special numbers (nan, +/-inf) if (qIsInf(d)) { num_str = infinity(); - special_number = TRUE; + special_number = true; negative = d < 0; } else if (qIsNan(d)) { num_str = nan(); - special_number = TRUE; + special_number = true; } #else // Comparing directly to INFINITY gives weird results on some systems. @@ -3225,11 +3225,11 @@ TQString TQLocalePrivate::doubleToString(double d, // Detect special numbers (nan, +/-inf) if (d == tmp_infinity || d == -tmp_infinity) { num_str = infinity(); - special_number = TRUE; + special_number = true; negative = d < 0; } else if (qIsNan(d)) { num_str = nan(); - special_number = TRUE; + special_number = true; } #endif @@ -3367,9 +3367,9 @@ TQString TQLocalePrivate::longLongToString(TQ_LLONG l, int precision, int base, int width, unsigned flags) const { - bool precision_not_specified = FALSE; + bool precision_not_specified = false; if (precision == -1) { - precision_not_specified = TRUE; + precision_not_specified = true; precision = 1; } @@ -3378,7 +3378,7 @@ TQString TQLocalePrivate::longLongToString(TQ_LLONG l, int precision, // these are not suported by sprintf for octal and hex flags &= ~AlwaysShowSign; flags &= ~BlankBeforePositive; - negative = FALSE; // neither are negative numbers + negative = false; // neither are negative numbers } TQString num_str; @@ -3452,9 +3452,9 @@ TQString TQLocalePrivate::unsLongLongToString(TQ_ULLONG l, int precision, int base, int width, unsigned flags) const { - bool precision_not_specified = FALSE; + bool precision_not_specified = false; if (precision == -1) { - precision_not_specified = TRUE; + precision_not_specified = true; precision = 1; } @@ -3526,15 +3526,15 @@ bool TQLocalePrivate::removeGroupSeparators(TQString &num_str) const if (c.unicode() == ',') { // check that there are digits before and after the separator if (i == 0 || !isLatin1Digit(num_str.unicode()[i - 1])) - return FALSE; + return false; if (i == num_str.length() + 1 || !isLatin1Digit(num_str.unicode()[i + 1])) - return FALSE; + return false; ++group_cnt; } else if (c.unicode() == '.') { // Fail if more than one decimal points if (decpt_idx != -1) - return FALSE; + return false; decpt_idx = i; } else if (c.unicode() == 'e' || c.unicode() == 'E') { // an 'e' or 'E' - if we have not encountered a decimal @@ -3546,7 +3546,7 @@ bool TQLocalePrivate::removeGroupSeparators(TQString &num_str) const // If no group chars, we're done if (group_cnt == 0) - return TRUE; + return true; // No decimal point means that it "is" at the end of the string if (decpt_idx == -1) @@ -3559,11 +3559,11 @@ bool TQLocalePrivate::removeGroupSeparators(TQString &num_str) const if (c.unicode() == ',') { // Don't allow group chars after the decimal point if ((int)i > decpt_idx) - return FALSE; + return false; // Check that it is placed correctly relative to the decpt if ((decpt_idx - i) % 4 != 0) - return FALSE; + return false; // Remove it num_str.remove(i, 1); @@ -3573,12 +3573,12 @@ bool TQLocalePrivate::removeGroupSeparators(TQString &num_str) const } else { // Check that we are not missing a separator if ((int)i < decpt_idx && (decpt_idx - i) % 4 == 0) - return FALSE; + return false; ++i; } } - return TRUE; + return true; } static void stripWhiteSpaceInPlace(TQString &s) @@ -3614,7 +3614,7 @@ bool TQLocalePrivate::numberToCLocale(TQString &l_num, stripWhiteSpaceInPlace(l_num); if (l_num.isEmpty()) - return FALSE; + return false; for (uint idx = 0; idx < l_num.length(); ++idx) { TQChar &c = l_num.ref(idx); @@ -3644,14 +3644,14 @@ bool TQLocalePrivate::numberToCLocale(TQString &l_num, else if (c.unicode() >= 'a' && c.unicode() <= 'z') ; // do nothing else - return FALSE; + return false; } if (group_sep_mode == ParseGroupSeparators && !removeGroupSeparators(l_num)) - return FALSE; + return false; - return TRUE; + return true; } double TQLocalePrivate::stringToDouble(TQString num, @@ -3660,12 +3660,12 @@ double TQLocalePrivate::stringToDouble(TQString num, { if (!numberToCLocale(num, group_sep_mode)) { if (ok != 0) - *ok = FALSE; + *ok = false; return 0.0; } if (ok != 0) - *ok = TRUE; + *ok = true; if (num == "nan") return NAN; @@ -3683,7 +3683,7 @@ double TQLocalePrivate::stringToDouble(TQString num, #ifdef QT_QLOCALE_USES_FCVT char *endptr; double d = strtod(num_buff, &endptr); - _ok = TRUE; + _ok = true; #else const char *endptr; double d = qstrtod(num_buff, &endptr, &_ok); @@ -3691,7 +3691,7 @@ double TQLocalePrivate::stringToDouble(TQString num, if (!_ok || *endptr != '\0') { if (ok != 0) - *ok = FALSE; + *ok = false; return 0.0; } else @@ -3704,7 +3704,7 @@ TQ_LLONG TQLocalePrivate::stringToLongLong(TQString num, int base, { if (!numberToCLocale(num, group_sep_mode)) { if (ok != 0) - *ok = FALSE; + *ok = false; return 0; } @@ -3715,12 +3715,12 @@ TQ_LLONG TQLocalePrivate::stringToLongLong(TQString num, int base, if (!_ok || *endptr != '\0') { if (ok != 0) - *ok = FALSE; + *ok = false; return 0; } if (ok != 0) - *ok = TRUE; + *ok = true; return l; } @@ -3730,7 +3730,7 @@ TQ_ULLONG TQLocalePrivate::stringToUnsLongLong(TQString num, int base, { if (!numberToCLocale(num, group_sep_mode)) { if (ok != 0) - *ok = FALSE; + *ok = false; return 0; } @@ -3741,12 +3741,12 @@ TQ_ULLONG TQLocalePrivate::stringToUnsLongLong(TQString num, int base, if (!_ok || *endptr != '\0') { if (ok != 0) - *ok = FALSE; + *ok = false; return 0; } if (ok != 0) - *ok = TRUE; + *ok = true; return l; } @@ -3801,7 +3801,7 @@ static TQ_ULLONG qstrtoull(const char *nptr, const char **endptr, int base, bool int neg, any, cutlim; if (ok != 0) - *ok = TRUE; + *ok = true; /* * See strtoq for comments as to the logic used. @@ -3812,7 +3812,7 @@ static TQ_ULLONG qstrtoull(const char *nptr, const char **endptr, int base, bool } while (isspace(c)); if (c == '-') { if (ok != 0) - *ok = FALSE; + *ok = false; if (endptr != 0) *endptr = s - 1; return 0; @@ -3854,7 +3854,7 @@ static TQ_ULLONG qstrtoull(const char *nptr, const char **endptr, int base, bool if (any < 0) { acc = ULLONG_MAX; if (ok != 0) - *ok = FALSE; + *ok = false; } else if (neg) acc = (~acc) + 1; @@ -3882,7 +3882,7 @@ static TQ_LLONG qstrtoll(const char *nptr, const char **endptr, int base, bool * int neg, any, cutlim; if (ok != 0) - *ok = TRUE; + *ok = true; /* * Skip white space and pick up leading +/- sign if any. @@ -3955,7 +3955,7 @@ static TQ_LLONG qstrtoll(const char *nptr, const char **endptr, int base, bool * if (any < 0) { acc = neg ? LLONG_MIN : LLONG_MAX; if (ok != 0) - *ok = FALSE; + *ok = false; } else if (neg) { acc = (~acc) + 1; } @@ -5007,7 +5007,7 @@ static double qstrtod(CONST char *s00, CONST char **se, bool *ok) CONST char decimal_point = '.'; #endif */ if (ok != 0) - *ok = TRUE; + *ok = true; CONST char decimal_point = '.'; @@ -5192,7 +5192,7 @@ static double qstrtod(CONST char *s00, CONST char **se, bool *ok) ovfl: // errno = ERANGE; if (ok != 0) - *ok = FALSE; + *ok = false; #ifdef __STDC__ rv = HUGE_VAL; #else @@ -5255,7 +5255,7 @@ static double qstrtod(CONST char *s00, CONST char **se, bool *ok) rv = 0.; // errno = ERANGE; if (ok != 0) - *ok = FALSE; + *ok = false; if (bd0) goto retfree; goto ret; |
