Skip to content

Commit 8e3c47d

Browse files
committed
examples : fix tautological-compare warning in stb_vorbis.c [no ci]
This commit applies a fix to address a tautological-compare warning in stb_vorbis.c. The motivation for this is that currently the following warning is generated when compiling the commmand-wasm example: ```console /Users/danbev/work/ai/whisper-work/examples/stb_vorbis.c:1404:75: warning: pointer comparison always evaluates to false [-Wtautological-compare] 1404 | if (f->stream_start + loc >= f->stream_end || f->stream_start + loc < f->stream_start) { | ^ 1 warning generated. ``` This fix was taken from an open pull request on the stb repository that addreses this issue: nothings/stb#1746
1 parent 93f4dfc commit 8e3c47d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/stb_vorbis.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ static int set_file_offset(stb_vorbis *f, unsigned int loc)
14011401
#endif
14021402
f->eof = 0;
14031403
if (USE_MEMORY(f)) {
1404-
if (f->stream_start + loc >= f->stream_end || f->stream_start + loc < f->stream_start) {
1404+
if (loc >= f->stream_len) {
14051405
f->stream = f->stream_end;
14061406
f->eof = 1;
14071407
return 0;

0 commit comments

Comments
 (0)