Fixup another level of compiler warnings, add _U() definition
This commit is contained in:
@ -11,7 +11,7 @@ static_assert(sizeof(critical_section_t) == 8, "");
|
||||
#endif
|
||||
|
||||
void critical_section_init(critical_section_t *critsec) {
|
||||
critical_section_init_with_lock_num(critsec, spin_lock_claim_unused(true));
|
||||
critical_section_init_with_lock_num(critsec, (uint)spin_lock_claim_unused(true));
|
||||
}
|
||||
|
||||
void critical_section_init_with_lock_num(critical_section_t *critsec, uint lock_num) {
|
||||
|
@ -23,7 +23,7 @@ void __time_critical_func(mutex_enter_blocking)(mutex_t *mtx) {
|
||||
do {
|
||||
uint32_t save = spin_lock_blocking(mtx->core.spin_lock);
|
||||
if (mtx->owner < 0) {
|
||||
mtx->owner = get_core_num();
|
||||
mtx->owner = (int8_t)get_core_num();
|
||||
block = false;
|
||||
}
|
||||
spin_unlock(mtx->core.spin_lock, save);
|
||||
@ -37,10 +37,10 @@ bool __time_critical_func(mutex_try_enter)(mutex_t *mtx, uint32_t *owner_out) {
|
||||
bool entered;
|
||||
uint32_t save = spin_lock_blocking(mtx->core.spin_lock);
|
||||
if (mtx->owner < 0) {
|
||||
mtx->owner = get_core_num();
|
||||
mtx->owner = (int8_t)get_core_num();
|
||||
entered = true;
|
||||
} else {
|
||||
if (owner_out) *owner_out = mtx->owner;
|
||||
if (owner_out) *owner_out = (uint32_t) mtx->owner;
|
||||
entered = false;
|
||||
}
|
||||
spin_unlock(mtx->core.spin_lock, save);
|
||||
@ -57,7 +57,7 @@ bool __time_critical_func(mutex_enter_block_until)(mutex_t *mtx, absolute_time_t
|
||||
do {
|
||||
uint32_t save = spin_lock_blocking(mtx->core.spin_lock);
|
||||
if (mtx->owner < 0) {
|
||||
mtx->owner = get_core_num();
|
||||
mtx->owner = (int8_t)get_core_num();
|
||||
block = false;
|
||||
}
|
||||
spin_unlock(mtx->core.spin_lock, save);
|
||||
|
@ -63,7 +63,7 @@ bool __time_critical_func(sem_release)(semaphore_t *sem) {
|
||||
uint32_t save = spin_lock_blocking(sem->core.spin_lock);
|
||||
int32_t count = sem->permits;
|
||||
if (count < sem->max_permits) {
|
||||
sem->permits = count + 1;
|
||||
sem->permits = (int16_t)(count + 1);
|
||||
__sev();
|
||||
rc = true;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user