/[pkg-kde]/people/chrsmrtn/qt-x11-free/debian/patches/07_gcc4_workarounds.dpatch
ViewVC logotype

Contents of /people/chrsmrtn/qt-x11-free/debian/patches/07_gcc4_workarounds.dpatch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1529 - (show annotations) (download)
Sun Aug 21 21:27:46 2005 UTC (7 years, 8 months ago) by chrsmrtn-guest
File size: 2777 byte(s)
OK, here's the postscript patch. This really must be in the next
upload - once kdebase hits unstable, people will start to notice
that printing doesn't work. We may already be responsible for some
bugs files against ghostscript packages.
1 #! /bin/sh -e
2
3 if [ $# -lt 1 ]; then
4 echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
5 exit 1
6 fi
7
8 [ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
9 patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
10
11 case "$1" in
12 -patch) patch -p1 ${patch_opts} < $0;;
13 -unpatch) patch -R -p1 ${patch_opts} < $0;;
14 *)
15 echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
16 exit 1;;
17 esac
18
19 exit 0
20
21 @DPATCH@
22 --- qt.orig/src/tools/qlocale.cpp
23 +++ qt.orig/src/tools/qlocale.cpp
24 @@ -72,6 +72,12 @@
25 # define NAN DBL_QNAN
26 #endif
27
28 +#if (defined(Q_CC_GNU) && defined(Q_OS_WIN)) || __GNUC__ == 4 || defined(QT_QLOCALE_NEEDS_VOLATILE)
29 +# define NEEDS_VOLATILE volatile
30 +#else
31 +# define NEEDS_VOLATILE
32 +#endif
33 +
34 enum {
35 LittleEndian,
36 BigEndian
37 @@ -4068,9 +4074,9 @@
38 #error Exactly one of IEEE_BIG_OR_LITTLE_ENDIAN, VAX, or IBM should be defined.
39 #endif
40
41 -inline ULong getWord0(double x)
42 +inline ULong getWord0(const NEEDS_VOLATILE double x)
43 {
44 - uchar *ptr = (uchar *)&x;
45 + const NEEDS_VOLATILE uchar *ptr = reinterpret_cast<const NEEDS_VOLATILE uchar *>(&x);
46 if (ByteOrder == BigEndian) {
47 return (ptr[0]<<24) + (ptr[1]<<16) + (ptr[2]<<8) + ptr[3];
48 } else {
49 @@ -4078,9 +4084,9 @@
50 }
51 }
52
53 -inline void setWord0(double *x, ULong l)
54 +inline void setWord0(NEEDS_VOLATILE double *x, ULong l)
55 {
56 - uchar *ptr = (uchar *)x;
57 + NEEDS_VOLATILE uchar *ptr = reinterpret_cast<NEEDS_VOLATILE uchar *>(x);
58 if (ByteOrder == BigEndian) {
59 ptr[0] = (uchar)(l>>24);
60 ptr[1] = (uchar)(l>>16);
61 @@ -4094,18 +4100,18 @@
62 }
63 }
64
65 -inline ULong getWord1(double x)
66 +inline ULong getWord1(const NEEDS_VOLATILE double x)
67 {
68 - uchar *ptr = (uchar *)&x;
69 + const NEEDS_VOLATILE uchar *ptr = reinterpret_cast<const NEEDS_VOLATILE uchar *>(&x);
70 if (ByteOrder == BigEndian) {
71 return (ptr[4]<<24) + (ptr[5]<<16) + (ptr[6]<<8) + ptr[7];
72 } else {
73 return (ptr[3]<<24) + (ptr[2]<<16) + (ptr[1]<<8) + ptr[0];
74 }
75 }
76 -inline void setWord1(double *x, ULong l)
77 +inline void setWord1(NEEDS_VOLATILE double *x, ULong l)
78 {
79 - uchar *ptr = (uchar *)x;
80 + NEEDS_VOLATILE uchar *ptr = reinterpret_cast<uchar NEEDS_VOLATILE *>(x);
81 if (ByteOrder == BigEndian) {
82 ptr[4] = (uchar)(l>>24);
83 ptr[5] = (uchar)(l>>16);
84 @@ -5679,11 +5685,11 @@
85 #ifdef Q_OS_LINUX
86 fesetenv(&envp);
87 #endif
88 -
89 +
90 return s;
91 }
92
93 -static char *_qdtoa( double d, int mode, int ndigits, int *decpt, int *sign, char **rve, char **resultp)
94 +static char *_qdtoa( NEEDS_VOLATILE double d, int mode, int ndigits, int *decpt, int *sign, char **rve, char **resultp)
95 {
96 /*
97 Arguments ndigits, decpt, sign are similar to those

  ViewVC Help
Powered by ViewVC 1.1.5