MathLib::intsuffix: Added support for LLU and LU suffixes.
This commit is contained in:
parent
227b48212e
commit
9b14ab15eb
|
@ -547,11 +547,13 @@ static std::string intsuffix(const std::string & first, const std::string & seco
|
|||
suffix2 = c + suffix2;
|
||||
}
|
||||
|
||||
if (suffix1 == "ULL" || suffix2 == "ULL")
|
||||
if (suffix1 == "ULL" || suffix2 == "ULL"
|
||||
|| suffix1 == "LLU" || suffix2 == "LLU")
|
||||
return "ULL";
|
||||
if (suffix1 == "LL" || suffix2 == "LL")
|
||||
return "LL";
|
||||
if (suffix1 == "UL" || suffix2 == "UL")
|
||||
if (suffix1 == "UL" || suffix2 == "UL"
|
||||
|| suffix1 == "LU" || suffix2 == "LU")
|
||||
return "UL";
|
||||
if (suffix1 == "L" || suffix2 == "L")
|
||||
return "L";
|
||||
|
|
|
@ -189,6 +189,13 @@ private:
|
|||
ASSERT_EQUALS("2LL", MathLib::add("1LL", "1UL"));
|
||||
ASSERT_EQUALS("2ULL", MathLib::add("1ULL", "1UL"));
|
||||
|
||||
ASSERT_EQUALS("2UL", MathLib::add("1", "1LU"));
|
||||
ASSERT_EQUALS("2UL", MathLib::add("1U", "1LU"));
|
||||
ASSERT_EQUALS("2UL", MathLib::add("1L", "1LU"));
|
||||
ASSERT_EQUALS("2UL", MathLib::add("1UL", "1LU"));
|
||||
ASSERT_EQUALS("2LL", MathLib::add("1LL", "1LU"));
|
||||
ASSERT_EQUALS("2ULL", MathLib::add("1ULL", "1LU"));
|
||||
|
||||
ASSERT_EQUALS("2LL", MathLib::add("1", "1LL"));
|
||||
ASSERT_EQUALS("2LL", MathLib::add("1U", "1LL"));
|
||||
ASSERT_EQUALS("2LL", MathLib::add("1L", "1LL"));
|
||||
|
@ -202,6 +209,13 @@ private:
|
|||
ASSERT_EQUALS("2ULL", MathLib::add("1UL", "1ULL"));
|
||||
ASSERT_EQUALS("2ULL", MathLib::add("1LL", "1ULL"));
|
||||
ASSERT_EQUALS("2ULL", MathLib::add("1ULL", "1ULL"));
|
||||
|
||||
ASSERT_EQUALS("2ULL", MathLib::add("1", "1LLU"));
|
||||
ASSERT_EQUALS("2ULL", MathLib::add("1U", "1LLU"));
|
||||
ASSERT_EQUALS("2ULL", MathLib::add("1L", "1LLU"));
|
||||
ASSERT_EQUALS("2ULL", MathLib::add("1UL", "1LLU"));
|
||||
ASSERT_EQUALS("2ULL", MathLib::add("1LL", "1LLU"));
|
||||
ASSERT_EQUALS("2ULL", MathLib::add("1ULL", "1LLU"));
|
||||
}
|
||||
|
||||
void convert() const {
|
||||
|
|
Loading…
Reference in New Issue