Fix warnings

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2026-05-06 11:31:07 +02:00
parent 49564e2e5e
commit 1be7acaedd
11 changed files with 76 additions and 60 deletions

View File

@@ -32,7 +32,7 @@
static void hwrng_start(void) {
#if defined(ENABLE_EMULATION)
srand(time(0));
srand((unsigned int)time(NULL));
#elif defined(ESP_PLATFORM)
bootloader_random_enable();
#endif
@@ -188,8 +188,7 @@ uint32_t hwrng_get(void) {
while (true) {
hwrng_lock();
bool empty = rb->empty;
if (!empty) {
if (!rb->empty) {
v = hwrng_buf_del(rb);
hwrng_unlock();
break;
@@ -210,9 +209,8 @@ void hwrng_wait_full(void) {
#endif
while (true) {
hwrng_lock();
bool full = rb->full;
hwrng_unlock();
if (full) {
if (rb->full) {
break;
}
#if defined(PICO_PLATFORM) || defined(ESP_PLATFORM)

View File

@@ -80,7 +80,7 @@ const uint8_t *random_bytes_get(size_t len) {
*/
int random_fill_iterator(void *arg, unsigned char *out, size_t out_len) {
random_fill_iterator_ctx_t *ctx = (random_fill_iterator_ctx_t *) arg;
uint32_t index = ctx ? ctx->index : 0;
uint8_t index = ctx ? ctx->index : 0;
uint8_t n;
int ret = 0;

View File

@@ -24,7 +24,7 @@
#include <stdbool.h>
typedef struct {
uint32_t index;
uint8_t index;
volatile bool cancel;
} random_fill_iterator_ctx_t;