summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-10-24 13:04:49 +0700
committerhathach <[email protected]>2025-10-24 13:04:49 +0700
commitf39dcae9f1bed1dfcfb239f76677ef980a9976c9 (patch)
treeba8e49a707d1547663abac80ef3c7c4738463c46 /src/common
parent878c8f26c5c760ec683a8d4ee4aa1ee6678b8a12 (diff)
fix several warnings
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_common.h2
-rw-r--r--src/common/tusb_debug.h12
2 files changed, 8 insertions, 6 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h
index 50c1be2c6..dfa9299c1 100644
--- a/src/common/tusb_common.h
+++ b/src/common/tusb_common.h
@@ -131,7 +131,7 @@ TU_ATTR_ALWAYS_INLINE static inline int tu_memcpy_s(void *dest, size_t destsz, c
}
// For memcpy, src may be NULL only if count == 0. Reject otherwise.
- if (src == NULL && count != 0) {
+ if (src == NULL && count != 0u) {
return -1;
}
diff --git a/src/common/tusb_debug.h b/src/common/tusb_debug.h
index 1d0c6f1ad..86517b9c9 100644
--- a/src/common/tusb_debug.h
+++ b/src/common/tusb_debug.h
@@ -58,8 +58,10 @@ void tu_print_mem(void const *buf, uint32_t count, uint8_t indent);
#define tu_printf printf
#endif
-static inline void tu_print_buf(uint8_t const* buf, uint32_t bufsize) {
- for(uint32_t i=0; i<bufsize; i++) tu_printf("%02X ", buf[i]);
+TU_ATTR_ALWAYS_INLINE static inline void tu_print_buf(uint8_t const* buf, uint32_t bufsize) {
+ for(uint32_t i=0; i<bufsize; i++) {
+ tu_printf("%02X ", buf[i]);
+ }
tu_printf("\r\n");
}
@@ -109,7 +111,9 @@ typedef struct {
static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint32_t key) {
for(uint16_t i=0; i<p_table->count; i++) {
- if (p_table->items[i].key == key) { return p_table->items[i].data; }
+ if (p_table->items[i].key == key) {
+ return p_table->items[i].data;
+ }
}
// not found return the key value in hex
@@ -130,8 +134,6 @@ static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint3
#define TU_LOG_FAILED()
#endif
-// TODO replace all TU_LOGn with TU_LOG(n)
-
#define TU_LOG0(...)
#define TU_LOG0_MEM(...)
#define TU_LOG0_BUF(...)