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:
commit
5ca5f805d2
@ -173,7 +173,7 @@ RNGClass RNG;
|
|||||||
#define RNG_REKEY_BLOCKS 16
|
#define RNG_REKEY_BLOCKS 16
|
||||||
|
|
||||||
// Maximum entropy credit that can be contained in the pool.
|
// Maximum entropy credit that can be contained in the pool.
|
||||||
#define RNG_MAX_CREDITS 384
|
#define RNG_MAX_CREDITS 384u
|
||||||
|
|
||||||
/** @cond */
|
/** @cond */
|
||||||
|
|
||||||
@ -571,7 +571,7 @@ void RNGClass::rand(uint8_t *data, size_t len)
|
|||||||
begin(0);
|
begin(0);
|
||||||
|
|
||||||
// Decrease the amount of entropy in the pool.
|
// Decrease the amount of entropy in the pool.
|
||||||
if (len > (credits / 8))
|
if (len > (credits / 8u))
|
||||||
credits = 0;
|
credits = 0;
|
||||||
else
|
else
|
||||||
credits -= len * 8;
|
credits -= len * 8;
|
||||||
@ -662,7 +662,7 @@ bool RNGClass::available(size_t len) const
|
|||||||
if (len >= (RNG_MAX_CREDITS / 8))
|
if (len >= (RNG_MAX_CREDITS / 8))
|
||||||
return credits >= RNG_MAX_CREDITS;
|
return credits >= RNG_MAX_CREDITS;
|
||||||
else
|
else
|
||||||
return len <= (credits / 8);
|
return len <= (credits / 8u);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user