Skip to content

Commit 20dab9d

Browse files
committed
Avoid unused variable warnings in case __ASSERT evaluates to NOP.
1 parent 6b06176 commit 20dab9d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/osdp_cp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ static inline void assert_buf_len(int need, int have)
181181
{
182182
__ASSERT(need < have, "OOM at build command: need:%d have:%d",
183183
need, have);
184+
(void)need;
185+
(void)have;
184186
}
185187

186188
static int cp_build_command(struct osdp_pd *pd, uint8_t *buf, int max_len)

src/osdp_pd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ static inline void assert_buf_len(int need, int have)
748748
{
749749
__ASSERT(need < have, "OOM at build command: need:%d have:%d",
750750
need, have);
751+
(void)need;
752+
(void)have;
751753
}
752754

753755
/**

0 commit comments

Comments
 (0)