]> git.pld-linux.org Git - packages/libsidplay2.git/blame - gcc4-fixes.patch
debian patch to fix build with gcc >= 6
[packages/libsidplay2.git] / gcc4-fixes.patch
CommitLineData
f8449d47
AF
1--- sidplay-libs-2.1.1.orig/libsidplay/unix/my_macros.m4
2+++ sidplay-libs-2.1.1/libsidplay/unix/my_macros.m4
3@@ -105,8 +105,9 @@ AC_DEFUN([MY_CHECK_IOS_OPENMODE],
4 AC_CACHE_VAL(test_cv_have_ios_openmode,
5 [
6 AC_TRY_COMPILE(
7- [#include <fstream.h>
8- #include <iomanip.h>],
9+ [#include <fstream>
10+ #include <iomanip>
11+ using namespace std;],
12 [ios::openmode myTest = ios::in;],
13 [test_cv_have_ios_openmode=yes],
14 [test_cv_have_ios_openmode=no]
15--- sidplay-libs-2.1.1.orig/libsidplay/include/sidplay/SmartPtr.h
16+++ sidplay-libs-2.1.1/libsidplay/include/sidplay/SmartPtr.h
17@@ -17,16 +17,16 @@ class SmartPtrBase_sidtt
18 doFree = bufOwner;
19 if ( bufferLen >= 1 )
20 {
21- pBufCurrent = ( bufBegin = buffer );
22- bufEnd = bufBegin + bufferLen;
23- bufLen = bufferLen;
24- status = true;
25+ this->pBufCurrent = ( this->bufBegin = buffer );
26+ this->bufEnd = this->bufBegin + bufferLen;
27+ this->bufLen = bufferLen;
28+ this->status = true;
29 }
30 else
31 {
32- pBufCurrent = ( bufBegin = ( bufEnd = 0 ));
33- bufLen = 0;
34- status = false;
35+ this->pBufCurrent = ( this->bufBegin = ( this->bufEnd = 0 ));
36+ this->bufLen = 0;
37+ this->status = false;
38 }
39 }
40
41@@ -211,16 +211,16 @@ class SmartPtr_sidtt : public SmartPtrBa
42 {
43 if ( bufferLen >= 1 )
44 {
45- pBufCurrent = ( bufBegin = buffer );
46- bufEnd = bufBegin + bufferLen;
47- bufLen = bufferLen;
48- status = true;
49+ this->pBufCurrent = ( this->bufBegin = buffer );
50+ this->bufEnd = this->bufBegin + bufferLen;
51+ this->bufLen = bufferLen;
52+ this->status = true;
53 }
54 else
55 {
56- pBufCurrent = bufBegin = bufEnd = 0;
57- bufLen = 0;
58- status = false;
59+ this->pBufCurrent = this->bufBegin = this->bufEnd = 0;
60+ this->bufLen = 0;
61+ this->status = false;
62 }
63 }
64 };
65--- sidplay-libs-2.1.1.orig/libsidplay/include/sidplay/sidendian.h
66+++ sidplay-libs-2.1.1/libsidplay/include/sidplay/sidendian.h
f8449d47
AF
67@@ -141,7 +145,7 @@ inline void endian_16swap8 (uint_least16
68 // Convert high-byte and low-byte to 16-bit word.
69 inline uint_least16_t endian_16 (uint8_t hi, uint8_t lo)
70 {
71- uint_least16_t word;
72+ uint_least16_t word = 0;
73 endian_16lo8 (word, lo);
74 endian_16hi8 (word, hi);
75 return word;
76@@ -165,7 +169,7 @@ inline void endian_16 (uint8_t ptr[2], u
77
78 inline void endian_16 (char ptr[2], uint_least16_t word)
79 {
80- endian_16 ((uint8_t *) ptr, word);
81+ endian_16 ((uint8_t *) ptr, word);
82 }
83
84 // Convert high-byte and low-byte to 16-bit little endian word.
85@@ -334,7 +338,7 @@ inline void endian_32swap16 (uint_least3
86 // Swap word endian.
87 inline void endian_32swap8 (uint_least32_t &dword)
88 {
89- uint_least16_t lo, hi;
90+ uint_least16_t lo = 0, hi = 0;
91 lo = endian_32lo16 (dword);
92 hi = endian_32hi16 (dword);
93 endian_16swap8 (lo);
94@@ -346,8 +350,8 @@ inline void endian_32swap8 (uint_least32
95 // Convert high-byte and low-byte to 32-bit word.
96 inline uint_least32_t endian_32 (uint8_t hihi, uint8_t hilo, uint8_t hi, uint8_t lo)
97 {
98- uint_least32_t dword;
99- uint_least16_t word;
100+ uint_least32_t dword = 0;
101+ uint_least16_t word = 0;
102 endian_32lo8 (dword, lo);
103 endian_32hi8 (dword, hi);
104 endian_16lo8 (word, hilo);
105@@ -374,7 +378,7 @@ inline void endian_little32 (uint8_t ptr
106 defined(SID_WORDS_LITTLEENDIAN)
107 *((uint_least32_t *) ptr) = dword;
108 #else
109- uint_least16_t word;
110+ uint_least16_t word = 0;
111 ptr[0] = endian_32lo8 (dword);
112 ptr[1] = endian_32hi8 (dword);
113 word = endian_32hi16 (dword);
114@@ -401,7 +405,7 @@ inline void endian_big32 (uint8_t ptr[4]
115 defined(SID_WORDS_BIGENDIAN)
116 *((uint_least32_t *) ptr) = dword;
117 #else
118- uint_least16_t word;
119+ uint_least16_t word = 0;
120 word = endian_32hi16 (dword);
121 ptr[1] = endian_16lo8 (word);
122 ptr[0] = endian_16hi8 (word);
123--- sidplay-libs-2.1.1.orig/libsidutils/include/sidplay/utils/SidUsage.h
124+++ sidplay-libs-2.1.1/libsidutils/include/sidplay/utils/SidUsage.h
125@@ -33,7 +33,7 @@ struct sid2_usage_t: public sid_usage_t
126 uint_least16_t length; // usage scan length
127
128 // Copy common parts of basic usage to extended usage.
129- sid2_usage_t &sid2_usage_t::operator= (const sid_usage_t &usage)
130+ sid2_usage_t &operator= (const sid_usage_t &usage)
131 {
132 *((sid_usage_t *) this) = usage;
133 return *this;
134--- sidplay-libs-2.1.1.orig/builders/resid-builder/src/resid-builder.cpp
135+++ sidplay-libs-2.1.1/builders/resid-builder/src/resid-builder.cpp
136@@ -37,6 +37,7 @@
137 ***************************************************************************/
138
139 #include <stdio.h>
140+#include <cstring>
141
142 #include "config.h"
143 #ifdef HAVE_EXCEPTIONS
144--- sidplay-libs-2.1.1.orig/builders/resid-builder/src/resid.cpp
145+++ sidplay-libs-2.1.1/builders/resid-builder/src/resid.cpp
146@@ -16,6 +16,7 @@
147 * *
148 ***************************************************************************/
149
150+#include <cstring>
151 #include "config.h"
152
153 #ifdef HAVE_EXCEPTIONS
154--- sidplay-libs-2.1.1.orig/builders/hardsid-builder/src/hardsid-builder.cpp
155+++ sidplay-libs-2.1.1/builders/hardsid-builder/src/hardsid-builder.cpp
156@@ -47,6 +47,7 @@
157 ***************************************************************************/
158
159 #include <stdio.h>
160+#include <cstring>
161 #include "config.h"
162
163 #ifdef HAVE_EXCEPTIONS
This page took 0.085484 seconds and 4 git commands to generate.