File: cxx20-warnings.diff

package info (click to toggle)
musescore2 2.3.2%2Bdfsg4-17
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 170,488 kB
  • sloc: cpp: 262,612; xml: 176,707; sh: 3,377; ansic: 1,246; python: 356; makefile: 224; perl: 82; pascal: 78
file content (115 lines) | stat: -rw-r--r-- 4,896 bytes parent folder | download
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
Description: fix C++20 compatibility warnings by GCC 14
 and some other warnings shown
Author: mirabilos <tg@debian.org>
Forwarded: no
Justification: upstream only cares about 4.x these days

--- a/libmscore/ambitus.cpp
+++ b/libmscore/ambitus.cpp
@@ -548,7 +548,7 @@ void Ambitus::updateRange()
       int   lastTrack   = firstTrack + VOICES-1;
       int   pitchTop    = -1000;
       int   pitchBottom = 1000;
-      int   tpcTop, tpcBottom;
+      int   tpcTop = 0, tpcBottom = 0; // silence GCC
       int   trk;
       Measure* meas     = segment()->measure();
       Segment* segm     = meas->findSegment(Segment::Type::ChordRest, segment()->tick());
--- a/libmscore/mscore.h
+++ b/libmscore/mscore.h
@@ -507,13 +507,13 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Align);
 
 template <typename T> class QmlListAccess : public QQmlListProperty<T> {
 public:
-      QmlListAccess<T>(QObject* obj, std::vector<T*>& container)
+      QmlListAccess(QObject* obj, std::vector<T*>& container)
             : QQmlListProperty<T>(obj, &container, &stdVectorCount, &stdVectorAt) {};
 
-      QmlListAccess<T>(QObject* obj, QVector<T*>& container)
+      QmlListAccess(QObject* obj, QVector<T*>& container)
             : QQmlListProperty<T>(obj, &container, &qVectorCount, &qVectorAt) {};
 
-      QmlListAccess<T>(QObject* obj, QList<T*>& container)
+      QmlListAccess(QObject* obj, QList<T*>& container)
             : QQmlListProperty<T>(obj, &container, &qListCount, &qListAt) {};
 
       static int stdVectorCount(QQmlListProperty<T>* l)     { return static_cast<std::vector<T*>*>(l->data)->size(); }
--- a/mscore/exportxml.cpp
+++ b/mscore/exportxml.cpp
@@ -3933,7 +3933,7 @@ static void repeatAtMeasureStart(Xml& xm
                   case Element::Type::MARKER:
                         {
                         // filter out the markers at measure Start
-                        const Marker* const mk = static_cast<const Marker* const>(e);
+                        const Marker* const mk = static_cast<const Marker*>(e);
                         Marker::Type mtp = mk->markerType();
                         if (   mtp == Marker::Type::SEGNO
                                || mtp == Marker::Type::CODA
@@ -3976,7 +3976,7 @@ static void repeatAtMeasureStop(Xml& xml
                   case Element::Type::MARKER:
                         {
                         // filter out the markers at measure stop
-                        const Marker* const mk = static_cast<const Marker* const>(e);
+                        const Marker* const mk = static_cast<const Marker*>(e);
                         Marker::Type mtp = mk->markerType();
                         if (mtp == Marker::Type::FINE || mtp == Marker::Type::TOCODA) {
                               directionMarker(xml, mk);
@@ -3990,7 +3990,7 @@ static void repeatAtMeasureStop(Xml& xml
                         }
                         break;
                   case Element::Type::JUMP:
-                        directionJump(xml, static_cast<const Jump* const>(e));
+                        directionJump(xml, static_cast<const Jump*>(e));
                         break;
                   default:
                         qDebug("repeatAtMeasureStop: direction type %s at tick %d not implemented",
--- a/mscore/jackaudio.cpp
+++ b/mscore/jackaudio.cpp
@@ -141,7 +141,8 @@ QList<QString> JackAudio::inputPorts()
             if (!(flags & JackPortIsInput))
                   continue;
             char buffer[128];
-            strncpy(buffer, *p, 128);
+            strncpy(buffer, *p, sizeof(buffer) - 1);
+            buffer[sizeof(buffer) - 1] = 0;
             if (strncmp(buffer, "Mscore", 6) == 0)
                   continue;
             clientList.append(QString(buffer));
--- a/thirdparty/intervaltree/IntervalTree.h
+++ b/thirdparty/intervaltree/IntervalTree.h
@@ -58,13 +58,13 @@ public:
     intervalTree* right;
     int center;
 
-    IntervalTree<T,K>(void)
+    IntervalTree(void)
         : left(NULL)
         , right(NULL)
         , center(0)
     { }
 
-    IntervalTree<T,K>(const intervalTree& other) {
+    IntervalTree(const intervalTree& other) {
         center = other.center;
         intervals = other.intervals;
         if (other.left) {
@@ -99,7 +99,7 @@ public:
         return *this;
     }
 
-    IntervalTree<T,K>(
+    IntervalTree(
             intervalVector& ivals,
             unsigned int depth = 16,
             unsigned int minbucket = 64,
--- a/thirdparty/rtf2html/rtf2html.cpp
+++ b/thirdparty/rtf2html/rtf2html.cpp
@@ -203,7 +203,7 @@ QString rtf2html(const QString& iString)
                case rtf_keyword::rkw_fonttbl:
                {
                   font fnt;
-                  int font_num;
+                  int font_num=-1;
                   bool full_name=false;
                   bool in_font=false;
                   while (! (*buf_in=='}' && !in_font))