Skip to content

Commit

Permalink
Fix harmless signed/unsigned comparison warnings in Firebird code.
Browse files Browse the repository at this point in the history
At least MSVC warns about comparing unsigned std::string::size() result with a
signed value, fix the warning by simply converting the former to signed int.
  • Loading branch information
vadz authored and mloskot committed Mar 24, 2013
1 parent 74158bc commit a83861b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backends/firebird/common.h
Expand Up @@ -161,7 +161,7 @@ std::string format_decimal(const void *sqldata, int sqlscale)
std::string r = out.str();
if (sqlscale < 0)
{
if (r.size() - (x < 0) <= -sqlscale)
if (static_cast<int>(r.size()) - (x < 0) <= -sqlscale)
{
r = std::string(size_t(x < 0), '-') +
std::string(-sqlscale - (r.size() - (x < 0)) + 1, '0') +
Expand Down

0 comments on commit a83861b

Please sign in to comment.