fix compiler warning with -Wstrict-overflow enabled
fix compiler warning with -Wunused-result enabled