Skip to content

Commit

Permalink
Fixed compilation warnings
Browse files Browse the repository at this point in the history
Fixed a number of compilation warnings: 
- comparison between size_t and unsigned
- implicit cast from int to bool
  • Loading branch information
kindkaktus committed Jul 20, 2013
1 parent 9d256f3 commit 3590a77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cxxtest/StdValueTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ValueTraits<const CXXTEST_STD(string)> : public StdTraitsBase
{
static bool mb_partial(char ch)
{
return ch & 0x80;
return !!(ch & 0x80);
}
static bool mb_start(char ch)
{
Expand All @@ -80,7 +80,7 @@ class ValueTraits<const CXXTEST_STD(string)> : public StdTraitsBase
{
return false;
}
for (unsigned len = mb_length(s[i]); len > 0; -- len, ++ i)
for (size_t len = mb_length(s[i]); len > 0; -- len, ++ i)
{
if (!mb_partial(s[i]))
{
Expand All @@ -98,7 +98,7 @@ class ValueTraits<const CXXTEST_STD(string)> : public StdTraitsBase
{
if (is_mb(s, i))
{
for (unsigned len = mb_length(s[i]); len > 0; -- len, ++ i)
for (size_t len = mb_length(s[i]); len > 0; -- len, ++ i)
{
char c[2] = { s[i], '\0' };
*this << c;
Expand Down

0 comments on commit 3590a77

Please sign in to comment.