summaryrefslogtreecommitdiff
blob: 9264d92f86027e6c195016203c562ca30189f776 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
https://bugs.gentoo.org/740328
https://github.com/Tatsh/bpmdetect/pull/2

From 4dbca9ede5126da8d6ce2949cd8db53096fb03fe Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sun, 9 May 2021 13:12:20 +0100
Subject: [PATCH] src/trackmp3.cpp: fix build against gcc-11

On gcc-11 build fails as:

```
../src/trackmp3.cpp: In member function 'int TrackMp3::findFrame(int)':
../src/trackmp3.cpp:458:13: error:
  ordered comparison of pointer with integer zero ('MadSeekFrameType*' and 'int')
  458 |     if (temp>0) {
      |         ~~~~^~
```

The fix changes pointer-to-int comparison to NULL comparison.

Reported-by: Agostino Sarubbo
Bug: https://bugs.gentoo.org/740328
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 src/trackmp3.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/src/trackmp3.cpp
+++ b/src/trackmp3.cpp
@@ -455,7 +455,7 @@ int TrackMp3::findFrame(int pos) {
             temp = m_qSeekList.at(--frameIdx);
     }
 
-    if (temp>0) {
+    if (temp) {
         return temp->pos;
     } else {
         return 0;
-- 
2.31.1