espressif: Force cast param in libc stubs

Fix:
```
chip/esp_libc_stubs.c: In function '__retarget_lock_init':
Error: chip/esp_libc_stubs.c:246:14: error: passing argument 1 of '_lock_init' from incompatible pointer type [-Werror=incompatible-pointer-types]
  246 |   _lock_init(lock);
      |              ^~~~
      |              |
      |              struct __lock **
chip/esp_libc_stubs.c:181:26: note: expected 'int *' but argument is of type 'struct __lock **'
  181 | void _lock_init(_lock_t *lock)
      |                          ^
chip/esp_libc_stubs.c: In function '__retarget_lock_init_recursive':
Error: chip/esp_libc_stubs.c:251:24: error: passing argument 1 of '_lock_init_recursive' from incompatible pointer type [-Werror=incompatible-pointer-types]
  251 |   _lock_init_recursive(lock);
      |                        ^~~~
      |                        |
      |                        struct __lock **
chip/esp_libc_stubs.c:187:36: note: expected 'int *' but argument is of type 'struct __lock **'
  187 | void _lock_init_recursive(_lock_t *lock)
      |                                    ^
chip/esp_libc_stubs.c: In function '__retarget_lock_close':
Error: chip/esp_libc_stubs.c:256:15: error: passing argument 1 of '_lock_close' from incompatible pointer type [-Werror=incompatible-pointer-types]
  256 |   _lock_close(&lock);
      |               ^~~~~
      |               |
      |               struct __lock **
chip/esp_libc_stubs.c:193:27: note: expected 'int *' but argument is of type 'struct __lock **'
  193 | void _lock_close(_lock_t *lock)
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2023-09-20 14:29:54 +08:00 committed by Xiang Xiao
parent 74e59feaaa
commit ac5e99d330

View file

@ -243,52 +243,52 @@ void _lock_release_recursive(_lock_t *lock)
#if ESP_ROM_HAS_RETARGETABLE_LOCKING
void __retarget_lock_init(_LOCK_T *lock)
{
_lock_init(lock);
_lock_init((_lock_t *)lock);
}
void __retarget_lock_init_recursive(_LOCK_T *lock)
{
_lock_init_recursive(lock);
_lock_init_recursive((_lock_t *)lock);
}
void __retarget_lock_close(_LOCK_T lock)
{
_lock_close(&lock);
_lock_close((_lock_t *)&lock);
}
void __retarget_lock_close_recursive(_LOCK_T lock)
{
_lock_close_recursive(&lock);
_lock_close_recursive((_lock_t *)&lock);
}
void __retarget_lock_acquire(_LOCK_T lock)
{
_lock_acquire(&lock);
_lock_acquire((_lock_t *)&lock);
}
void __retarget_lock_acquire_recursive(_LOCK_T lock)
{
_lock_acquire_recursive(&lock);
_lock_acquire_recursive((_lock_t *)&lock);
}
int __retarget_lock_try_acquire(_LOCK_T lock)
{
return _lock_try_acquire(&lock);
return _lock_try_acquire((_lock_t *)&lock);
}
int __retarget_lock_try_acquire_recursive(_LOCK_T lock)
{
return _lock_try_acquire_recursive(&lock);
return _lock_try_acquire_recursive((_lock_t *)&lock);
}
void __retarget_lock_release(_LOCK_T lock)
{
_lock_release(&lock);
_lock_release((_lock_t *)&lock);
}
void __retarget_lock_release_recursive(_LOCK_T lock)
{
_lock_release_recursive(&lock);
_lock_release_recursive((_lock_t *)&lock);
}
#endif