c42f / tinyformat

Minimal, type safe printf replacement library for C++
532 stars 75 forks source link

Fix useless cast #30

Closed romanp-nexusgroup closed 8 years ago

romanp-nexusgroup commented 8 years ago

When compiling on Ubuntu 14.04 with gcc 4.8.4 with -Wuseless-cast I get this:

tinyformat.h:555:68: error: useless cast to type ‘std::streamsize {aka long int}’ [-Werror=useless-cast]
                 out.write(fmt, static_cast<std::streamsize>(c - fmt));
                                                                ^
tinyformat.h:558:68: error: useless cast to type ‘std::streamsize {aka long int}’ [-Werror=useless-cast]
                 out.write(fmt, static_cast<std::streamsize>(c - fmt));
                                                                ^

Also fix warnings produced by adding -Wswitch-default

c42f commented 8 years ago

Hmm. I have a sneaking suspicion that this useless cast was added to appease MSVC, I'll need to check.

c42f commented 8 years ago

Looks good, seems to work on MSVC too, thanks!