rweather / arduinolibs

Arduino Cryptography Library
444 stars 212 forks source link

Correct -Wsign-compare warnings #30

Closed ciband closed 6 years ago

ciband commented 6 years ago

Corrected -Wsign-compare warnings on ESP8266 under platformio.

/home/travis/.platformio/lib/Crypto_ID1168/RNG.cpp: In member function 'void RNGClass::rand(uint8_t, size_t)': /home/travis/.platformio/lib/Crypto_ID1168/RNG.cpp:574:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (len > (credits / 8)) ^ /home/travis/.platformio/lib/Crypto_ID1168/RNG.cpp: In member function 'bool RNGClass::available(size_t) const': /home/travis/.platformio/lib/Crypto_ID1168/RNG.cpp:665:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] return len <= (credits / 8); ^ /home/travis/.platformio/lib/Crypto_ID1168/RNG.cpp: In member function 'void RNGClass::stir(const uint8_t, size_t, unsigned int)': /home/travis/.platformio/lib/Crypto_ID1168/RNG.cpp:698:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if ((RNG_MAX_CREDITS - credits) > credit) ^