Fix VS2013 warnings about integer conversions

This commit is contained in:
Vinnie Falco
2014-04-17 11:57:48 -07:00
parent fdfcebd1cb
commit df3f5e442d
13 changed files with 34 additions and 31 deletions

View File

@@ -114,10 +114,11 @@ public:
}
/** Build the inverse mapping table from characters to digits. */
static std::vector <int> invert (std::string const& alphabet, std::size_t radix)
static std::vector <int>
invert (std::string const& alphabet, int radix)
{
std::vector <int> table (256, -1);
for (std::size_t i (0); i < radix; ++i)
for (int i (0); i < radix; ++i)
table [alphabet [i]] = i;
return table;
}
@@ -183,11 +184,12 @@ public:
}
/** Build the inverse mapping table from characters to digits. */
static std::vector <int> invert (std::string const& alphabet, std::size_t radix)
static std::vector <int>
invert (std::string const& alphabet, int radix)
{
std::vector <int> table (256, -1);
for (std::size_t i (0); i < radix; ++i)
table [alphabet [i]] = i;
for (int i (0); i < radix; ++i)
table [alphabet [i]] = int(i);
return table;
}
};