cuetools: fix build with llvm22

error: chained comparison 'X < Y <= Z' does not behave the same as a mathematical expression [-Wparentheses]
This commit is contained in:
tb
2026-05-20 05:33:11 +00:00
parent 2f9301307c
commit 52e35ac9c3
2 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
COMMENT= tools for handling audio-file cue sheets and toc files
DISTNAME= cuetools-1.3.1
REVISION= 2
REVISION= 3
CATEGORIES= audio textproc
+23
View File
@@ -0,0 +1,23 @@
error: chained comparison 'X < Y <= Z' does not behave the same as a mathematical expression [-Wparentheses
Index: src/lib/cd.c
--- src/lib/cd.c.orig
+++ src/lib/cd.c
@@ -144,7 +144,7 @@ int cd_get_ntrack (Cd *cd)
Track *cd_get_track (Cd *cd, int i)
{
- if (0 < i <= cd->ntrack)
+ if (0 < i && i <= cd->ntrack)
return cd->track[i - 1];
return NULL;
@@ -277,7 +277,7 @@ int track_get_nindex (Track *track)
long track_get_index (Track *track, int i)
{
- if (0 <= i < track->nindex)
+ if (0 <= i && i < track->nindex)
return track->index[i];
return -1;