Skip to content

Commit

Permalink
dtls_debug.h: explicitly cast macro parameter to size_t.
Browse files Browse the repository at this point in the history
Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
  • Loading branch information
boaks committed Mar 18, 2024
1 parent 0e865aa commit 8c55636
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dtls_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ void dtls_dsrv_log_addr(log_t level, const char *name, const session_t *addr);
#define dtls_notice(...) LOG_INF(__VA_ARGS__)
#define dtls_info(...) LOG_INF(__VA_ARGS__)
#define dtls_debug(...) LOG_DBG(__VA_ARGS__)
#define dtls_debug_hexdump(name, buf, length) { LOG_DBG("%s (%zu bytes):", name, length); LOG_HEXDUMP_DBG(buf, length, name); }
#define dtls_debug_dump(name, buf, length) { LOG_DBG("%s (%zu bytes):", name, length); LOG_HEXDUMP_DBG(buf, length, name); }
#define dtls_debug_hexdump(name, buf, length) { LOG_DBG("%s (%zu bytes):", name, (size_t)(length)); LOG_HEXDUMP_DBG(buf, length, name); }
#define dtls_debug_dump(name, buf, length) { LOG_DBG("%s (%zu bytes):", name, (size_t)(length)); LOG_HEXDUMP_DBG(buf, length, name); }
#elif defined(RIOT_VERSION)
#define dtls_emerg(...) LOG_ERROR(__VA_ARGS__)
#define dtls_alert(...) LOG_ERROR(__VA_ARGS__)
Expand All @@ -139,8 +139,8 @@ void dtls_dsrv_log_addr(log_t level, const char *name, const session_t *addr);
#define dtls_notice(...) LOG_INFO(__VA_ARGS__)
#define dtls_info(...) LOG_INFO(__VA_ARGS__)
#define dtls_debug(...) LOG_DEBUG(__VA_ARGS__)
#define dtls_debug_hexdump(name, buf, length) { if (LOG_DEBUG <= LOG_LEVEL) { LOG_DEBUG("-= %s (%zu bytes) =-\n", name, length); od_hex_dump(buf, length, 0); }}
#define dtls_debug_dump(name, buf, length) { if (LOG_DEBUG <= LOG_LEVEL) { LOG_DEBUG("%s (%zu bytes):", name, length); od_hex_dump(buf, length, 0); }}
#define dtls_debug_hexdump(name, buf, length) { if (LOG_DEBUG <= LOG_LEVEL) { LOG_DEBUG("-= %s (%zu bytes) =-\n", name, (size_t)(length)); od_hex_dump(buf, length, 0); }}
#define dtls_debug_dump(name, buf, length) { if (LOG_DEBUG <= LOG_LEVEL) { LOG_DEBUG("%s (%zu bytes):", name, (size_t)(length)); od_hex_dump(buf, length, 0); }}
#else /* neither RIOT nor Zephyr */
#define dtls_emerg(...) dsrv_log(DTLS_LOG_EMERG, __VA_ARGS__)
#define dtls_alert(...) dsrv_log(DTLS_LOG_ALERT, __VA_ARGS__)
Expand Down

0 comments on commit 8c55636

Please sign in to comment.