1 Various fixes to compile libsidplay2 with newer gcc compilers
4 http://tsubasa.googlecode.com/svn/trunk/tsubasa/sidplay2-libs/sidplay2-libs-2.1.1.diff
6 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
8 --- sidplay-libs-2.1.1.orig/Makefile.in
9 +++ sidplay-libs-2.1.1/Makefile.in
11 -# Makefile.in generated by automake 1.8.4 from Makefile.am.
12 +# Makefile.in generated by automake 1.8.5 from Makefile.am.
15 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
18 list='$(SUBDIRS)'; for subdir in $$list; do \
19 if test "$$subdir" = .; then :; else \
20 - test -f $$subdir/TAGS && \
21 + test ! -f $$subdir/TAGS || \
22 tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
26 $(AWK) ' { files[$$0] = 1; } \
27 END { for (i in files) print i; }'`; \
28 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
29 - test -z "$$unique" && unique=$$empty_fix; \
30 + test -n "$$unique" || unique=$$empty_fix; \
31 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
34 --- sidplay-libs-2.1.1.orig/aclocal.m4
35 +++ sidplay-libs-2.1.1/aclocal.m4
37 -# generated automatically by aclocal 1.8.4 -*- Autoconf -*-
38 +# generated automatically by aclocal 1.8.5 -*- Autoconf -*-
40 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
41 # Free Software Foundation, Inc.
43 # Call AM_AUTOMAKE_VERSION so it can be traced.
44 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
45 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
46 - [AM_AUTOMAKE_VERSION([1.8.4])])
47 + [AM_AUTOMAKE_VERSION([1.8.5])])
51 --- sidplay-libs-2.1.1.orig/builders/Makefile.in
52 +++ sidplay-libs-2.1.1/builders/Makefile.in
54 -# Makefile.in generated by automake 1.8.4 from Makefile.am.
55 +# Makefile.in generated by automake 1.8.5 from Makefile.am.
58 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
63 - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu builders/Makefile'; \
64 + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builders/Makefile'; \
66 - $(AUTOMAKE) --gnu builders/Makefile
67 + $(AUTOMAKE) --foreign builders/Makefile
69 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
73 list='$(SUBDIRS)'; for subdir in $$list; do \
74 if test "$$subdir" = .; then :; else \
75 - test -f $$subdir/TAGS && \
76 + test ! -f $$subdir/TAGS || \
77 tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
81 $(AWK) ' { files[$$0] = 1; } \
82 END { for (i in files) print i; }'`; \
83 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
84 - test -z "$$unique" && unique=$$empty_fix; \
85 + test -n "$$unique" || unique=$$empty_fix; \
86 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
89 --- sidplay-libs-2.1.1.orig/builders/hardsid-builder/src/hardsid-builder.cpp
90 +++ sidplay-libs-2.1.1/builders/hardsid-builder/src/hardsid-builder.cpp
92 ***************************************************************************/
98 #ifdef HAVE_EXCEPTIONS
99 --- sidplay-libs-2.1.1.orig/builders/resid-builder/src/resid-builder.cpp
100 +++ sidplay-libs-2.1.1/builders/resid-builder/src/resid-builder.cpp
102 ***************************************************************************/
108 #ifdef HAVE_EXCEPTIONS
109 --- sidplay-libs-2.1.1.orig/builders/resid-builder/src/resid.cpp
110 +++ sidplay-libs-2.1.1/builders/resid-builder/src/resid.cpp
113 ***************************************************************************/
118 #ifdef HAVE_EXCEPTIONS
119 --- sidplay-libs-2.1.1.orig/configure.ac
120 +++ sidplay-libs-2.1.1/configure.ac
125 -builders='${libdir}'/sidplay/builders
126 +builders='${libdir}'/
127 ac_configure_args="$ac_configure_args --disable-library-checks"
129 AC_CONFIG_AUX_DIR(unix)
134 - *linux*) hardsid=true
135 + *linux*|*-k*bsd*-gnu) hardsid=true
138 AM_CONDITIONAL(HARDSID, test x$hardsid = xtrue)
139 --- sidplay-libs-2.1.1.orig/libsidplay/include/sidplay/SmartPtr.h
140 +++ sidplay-libs-2.1.1/libsidplay/include/sidplay/SmartPtr.h
143 if ( bufferLen >= 1 )
145 - pBufCurrent = ( bufBegin = buffer );
146 - bufEnd = bufBegin + bufferLen;
147 - bufLen = bufferLen;
149 + this->pBufCurrent = ( this->bufBegin = buffer );
150 + this->bufEnd = this->bufBegin + bufferLen;
151 + this->bufLen = bufferLen;
152 + this->status = true;
156 - pBufCurrent = ( bufBegin = ( bufEnd = 0 ));
159 + this->pBufCurrent = ( this->bufBegin = ( this->bufEnd = 0 ));
161 + this->status = false;
165 @@ -211,16 +211,16 @@
167 if ( bufferLen >= 1 )
169 - pBufCurrent = ( bufBegin = buffer );
170 - bufEnd = bufBegin + bufferLen;
171 - bufLen = bufferLen;
173 + this->pBufCurrent = ( this->bufBegin = buffer );
174 + this->bufEnd = this->bufBegin + bufferLen;
175 + this->bufLen = bufferLen;
176 + this->status = true;
180 - pBufCurrent = bufBegin = bufEnd = 0;
183 + this->pBufCurrent = this->bufBegin = this->bufEnd = 0;
185 + this->status = false;
189 --- sidplay-libs-2.1.1.orig/libsidplay/include/sidplay/sidendian.h
190 +++ sidplay-libs-2.1.1/libsidplay/include/sidplay/sidendian.h
192 ***************************************************************************/
193 /***************************************************************************
194 * $Log: sidendian.h,v $
195 + * Revision 1.6 2005/11/20 11:02:06 s_a_white
196 + * Work around for bug in gcc 4 (optimiser breaks if variable never has a
197 + * direct assignment).
199 * Revision 1.5 2001/07/03 22:44:13 s_a_white
200 * Added endian_16 to convert a 16 bit value to an array of 8s.
203 // Convert high-byte and low-byte to 16-bit word.
204 inline uint_least16_t endian_16 (uint8_t hi, uint8_t lo)
206 - uint_least16_t word;
207 + uint_least16_t word = 0;
208 endian_16lo8 (word, lo);
209 endian_16hi8 (word, hi);
213 inline void endian_16 (char ptr[2], uint_least16_t word)
215 - endian_16 ((uint8_t *) ptr, word);
216 + endian_16 ((uint8_t *) ptr, word);
219 // Convert high-byte and low-byte to 16-bit little endian word.
222 inline void endian_32swap8 (uint_least32_t &dword)
224 - uint_least16_t lo, hi;
225 + uint_least16_t lo = 0, hi = 0;
226 lo = endian_32lo16 (dword);
227 hi = endian_32hi16 (dword);
230 // Convert high-byte and low-byte to 32-bit word.
231 inline uint_least32_t endian_32 (uint8_t hihi, uint8_t hilo, uint8_t hi, uint8_t lo)
233 - uint_least32_t dword;
234 - uint_least16_t word;
235 + uint_least32_t dword = 0;
236 + uint_least16_t word = 0;
237 endian_32lo8 (dword, lo);
238 endian_32hi8 (dword, hi);
239 endian_16lo8 (word, hilo);
241 defined(SID_WORDS_LITTLEENDIAN)
242 *((uint_least32_t *) ptr) = dword;
244 - uint_least16_t word;
245 + uint_least16_t word = 0;
246 ptr[0] = endian_32lo8 (dword);
247 ptr[1] = endian_32hi8 (dword);
248 word = endian_32hi16 (dword);
250 defined(SID_WORDS_BIGENDIAN)
251 *((uint_least32_t *) ptr) = dword;
253 - uint_least16_t word;
254 + uint_least16_t word = 0;
255 word = endian_32hi16 (dword);
256 ptr[1] = endian_16lo8 (word);
257 ptr[0] = endian_16hi8 (word);
258 --- sidplay-libs-2.1.1.orig/libsidplay/unix/config.h.in
259 +++ sidplay-libs-2.1.1/libsidplay/unix/config.h.in
261 /* Define to the version of this package. */
262 #undef PACKAGE_VERSION
264 -/* The size of a `char', as computed by sizeof. */
265 +/* The size of `char', as computed by sizeof. */
268 -/* The size of a `int', as computed by sizeof. */
269 +/* The size of `int', as computed by sizeof. */
272 /* The number of bytes in type long */
275 -/* The size of a `long int', as computed by sizeof. */
276 +/* The size of `long int', as computed by sizeof. */
277 #undef SIZEOF_LONG_INT
279 /* The number of bytes in type short */
282 -/* The size of a `short int', as computed by sizeof. */
283 +/* The size of `short int', as computed by sizeof. */
284 #undef SIZEOF_SHORT_INT
286 /* The number of bytes in type void* */
287 --- sidplay-libs-2.1.1.orig/libsidplay/unix/my_macros.m4
288 +++ sidplay-libs-2.1.1/libsidplay/unix/my_macros.m4
290 AC_CACHE_VAL(test_cv_have_ios_openmode,
293 - [#include <fstream.h>
294 - #include <iomanip.h>],
295 + [#include <fstream>
297 + using namespace std;],
298 [ios::openmode myTest = ios::in;],
299 [test_cv_have_ios_openmode=yes],
300 [test_cv_have_ios_openmode=no]
301 --- sidplay-libs-2.1.1.orig/libsidplay/unix/sidint.h
302 +++ sidplay-libs-2.1.1/libsidplay/unix/sidint.h
304 +#ifndef _UNIX_SIDINT_H
305 +#define _UNIX_SIDINT_H 1
306 +#ifndef _GENERATED_STDINT_H
307 +#define _GENERATED_STDINT_H "libsidplay 2.1.1"
308 +/* generated using a gnu compiler version gcc (Debian 4.3-20080219-1) 4.3.0 20080219 (prerelease) [gcc-4_3-branch revision 132456] Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
313 +/* system headers have good uint64_t */
314 +#ifndef _HAVE_UINT64_T
315 +#define _HAVE_UINT64_T
321 --- sidplay-libs-2.1.1.orig/libsidutils/include/sidplay/utils/SidUsage.h
322 +++ sidplay-libs-2.1.1/libsidutils/include/sidplay/utils/SidUsage.h
324 uint_least16_t length; // usage scan length
326 // Copy common parts of basic usage to extended usage.
327 - sid2_usage_t &sid2_usage_t::operator= (const sid_usage_t &usage)
328 + sid2_usage_t &operator= (const sid_usage_t &usage)
330 *((sid_usage_t *) this) = usage;