summaryrefslogtreecommitdiff
path: root/games-engines/gemrb/files/fix_endian.patch
blob: f7592a218a73341f8757072079ccc362b503764e (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
--- gemrb/plugins/ACMImporter/readers.cpp	2007/11/02 15:43:25	4806
+++ gemrb/plugins/ACMImporter/readers.cpp	2007/11/03 18:57:46	4807
@@ -277,21 +277,21 @@
 inline void fix_endian(ieDword &dest)
 {
 	unsigned char tmp;
-	tmp=((unsigned char *) dest)[0];
-	((unsigned char *) dest)[0]=((unsigned char *) dest)[3];
-	((unsigned char *) dest)[3]=tmp;
+	tmp=((unsigned char *) &dest)[0];
+	((unsigned char *) &dest)[0]=((unsigned char *) &dest)[3];
+	((unsigned char *) &dest)[3]=tmp;
 	tmp=((unsigned char *) dest)[1];
-	((unsigned char *) dest)[1]=((unsigned char *) dest)[2];
-	((unsigned char *) dest)[2]=tmp;
+	((unsigned char *) &dest)[1]=((unsigned char *) &dest)[2];
+	((unsigned char *) &dest)[2]=tmp;
 
 }
 
 inline void fix_endian(ieWord &dest)
 {
 	unsigned char tmp;
-	tmp=((unsigned char *) dest)[0];
-	((unsigned char *) dest)[0]=((unsigned char *) dest)[1];
-	((unsigned char *) dest)[1]=tmp;
+	tmp=((unsigned char *) &dest)[0];
+	((unsigned char *) &dest)[0]=((unsigned char *) &dest)[1];
+	((unsigned char *) &dest)[1]=tmp;
 }
 
 int CWavPCMReader::init_reader()