mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-23 10:19:59 +00:00
NimBLE: Fix misc warnings and return code in ble_hs_tx_data
- Previously `ble_hs_tx_data` returned 0 irrespective of error code returned by `ble_hci_trans_hs_acl_tx`. - Minor changes in `porting/nimble/` and `ble_gattc.c` to remove discard const qualifier warnings, fixes #4028.
This commit is contained in:
committed by
Abhinav Kudnar
parent
e326f38f31
commit
fd31133ae0
@@ -42,7 +42,7 @@ int mem_malloc_mbufpkt_pool(struct os_mempool *mempool,
|
||||
void **out_buf);
|
||||
int mem_init_mbuf_pool(void *mem, struct os_mempool *mempool,
|
||||
struct os_mbuf_pool *mbuf_pool, int num_blocks,
|
||||
int block_size, char *name);
|
||||
int block_size, const char *name);
|
||||
|
||||
/**
|
||||
* Specifies a function used as a callback. Functions of this type allocate an
|
||||
|
||||
@@ -26,6 +26,18 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined __cplusplus
|
||||
#define static_assert _Static_assert
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(a, b) ((a)<(b)?(a):(b))
|
||||
#endif
|
||||
|
||||
#ifndef max
|
||||
#define max(a, b) ((a)>(b)?(a):(b))
|
||||
#endif
|
||||
|
||||
#include "syscfg/syscfg.h"
|
||||
#include "nimble/nimble_npl.h"
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ struct os_mempool {
|
||||
STAILQ_ENTRY(os_mempool) mp_list;
|
||||
SLIST_HEAD(,os_memblock);
|
||||
/** Name for memory block */
|
||||
char *name;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -182,7 +182,7 @@ typedef __uint128_t os_membuf_t;
|
||||
* @return os_error_t
|
||||
*/
|
||||
os_error_t os_mempool_init(struct os_mempool *mp, uint16_t blocks,
|
||||
uint32_t block_size, void *membuf, char *name);
|
||||
uint32_t block_size, void *membuf, const char *name);
|
||||
|
||||
/**
|
||||
* Initializes an extended memory pool. Extended attributes (e.g., callbacks)
|
||||
@@ -198,7 +198,7 @@ os_error_t os_mempool_init(struct os_mempool *mp, uint16_t blocks,
|
||||
* @return os_error_t
|
||||
*/
|
||||
os_error_t os_mempool_ext_init(struct os_mempool_ext *mpe, uint16_t blocks,
|
||||
uint32_t block_size, void *membuf, char *name);
|
||||
uint32_t block_size, void *membuf, const char *name);
|
||||
|
||||
/**
|
||||
* Removes the specified mempool from the list of initialized mempools.
|
||||
|
||||
@@ -67,7 +67,7 @@ stats_register(void *a, void *b)
|
||||
}
|
||||
|
||||
static inline int
|
||||
stats_init_and_reg(void *a, uint8_t b, uint8_t c, void *d, uint8_t e, void *f)
|
||||
stats_init_and_reg(void *a, uint8_t b, uint8_t c, void *d, uint8_t e, const char *f)
|
||||
{
|
||||
/* dummy */
|
||||
return 0;
|
||||
|
||||
@@ -206,7 +206,7 @@ mem_malloc_mbufpkt_pool(struct os_mempool *mempool,
|
||||
int
|
||||
mem_init_mbuf_pool(void *mem, struct os_mempool *mempool,
|
||||
struct os_mbuf_pool *mbuf_pool, int num_blocks,
|
||||
int block_size, char *name)
|
||||
int block_size, const char *name)
|
||||
{
|
||||
int rc;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#define OS_MEMPOOL_TRUE_BLOCK_SIZE(mp) OS_MEM_TRUE_BLOCK_SIZE(mp->mp_block_size)
|
||||
#endif
|
||||
|
||||
STAILQ_HEAD(, os_mempool) g_os_mempool_list;
|
||||
STAILQ_HEAD(, os_mempool) g_os_mempool_list = STAILQ_HEAD_INITIALIZER(g_os_mempool_list);
|
||||
|
||||
#if MYNEWT_VAL(OS_MEMPOOL_POISON)
|
||||
static uint32_t os_mem_poison = 0xde7ec7ed;
|
||||
@@ -118,7 +118,7 @@ os_mempool_guard_check(const struct os_mempool *mp, void *start)
|
||||
|
||||
static os_error_t
|
||||
os_mempool_init_internal(struct os_mempool *mp, uint16_t blocks,
|
||||
uint32_t block_size, void *membuf, char *name,
|
||||
uint32_t block_size, void *membuf, const char *name,
|
||||
uint8_t flags)
|
||||
{
|
||||
int true_block_size;
|
||||
@@ -181,14 +181,14 @@ os_mempool_init_internal(struct os_mempool *mp, uint16_t blocks,
|
||||
|
||||
os_error_t
|
||||
os_mempool_init(struct os_mempool *mp, uint16_t blocks, uint32_t block_size,
|
||||
void *membuf, char *name)
|
||||
void *membuf, const char *name)
|
||||
{
|
||||
return os_mempool_init_internal(mp, blocks, block_size, membuf, name, 0);
|
||||
}
|
||||
|
||||
os_error_t
|
||||
os_mempool_ext_init(struct os_mempool_ext *mpe, uint16_t blocks,
|
||||
uint32_t block_size, void *membuf, char *name)
|
||||
uint32_t block_size, void *membuf, const char *name)
|
||||
{
|
||||
int rc;
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ os_msys_sanity(struct os_sanity_check *sc, void *arg)
|
||||
static void
|
||||
os_msys_init_once(void *data, struct os_mempool *mempool,
|
||||
struct os_mbuf_pool *mbuf_pool,
|
||||
int block_count, int block_size, char *name)
|
||||
int block_count, int block_size, const char *name)
|
||||
{
|
||||
int rc;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user