1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00

Merge pull request #30 from ciband/master

Correct -Wsign-compare warnings
This commit is contained in:
rweather 2018-04-24 04:44:48 +10:00 committed by GitHub
commit 5ca5f805d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,7 +173,7 @@ RNGClass RNG;
#define RNG_REKEY_BLOCKS 16
// Maximum entropy credit that can be contained in the pool.
#define RNG_MAX_CREDITS 384
#define RNG_MAX_CREDITS 384u
/** @cond */
@ -571,7 +571,7 @@ void RNGClass::rand(uint8_t *data, size_t len)
begin(0);
// Decrease the amount of entropy in the pool.
if (len > (credits / 8))
if (len > (credits / 8u))
credits = 0;
else
credits -= len * 8;
@ -662,7 +662,7 @@ bool RNGClass::available(size_t len) const
if (len >= (RNG_MAX_CREDITS / 8))
return credits >= RNG_MAX_CREDITS;
else
return len <= (credits / 8);
return len <= (credits / 8u);
}
/**