Skip to content

Commit

Permalink
Fixup: NDEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesLorenz committed Nov 4, 2023
1 parent df489d6 commit f444d3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cpp/default-value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ int get_default_value(const char* port_name, const char* port_args,
if(pretty)
{
nargs = rtosc_count_printed_arg_vals(pretty);
#ifdef NDEBUG
(void)n;
#else
assert(nargs > 0); // parse error => error in the metadata?
assert((size_t)nargs < n);
#endif

rtosc_scan_arg_vals(pretty, res, nargs, strbuf, strbufsize);

Expand Down
4 changes: 4 additions & 0 deletions src/rtosc-time.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ uint64_t rtosc_float2secfracs(float secfracsf)
int scanned = sscanf(secfracs_as_hex + scanpos,
"%"PRIx64"p-%i" /* expands to like "%lxp-%i" */,
&secfracs, &exp);
#ifdef NDEBUG
(void)scanned;
#else
assert(scanned == 2);
#endif
}
const char* p = strchr(secfracs_as_hex, 'p');
assert(p);
Expand Down

0 comments on commit f444d3d

Please sign in to comment.