Gentoo Archives: gentoo-commits

From: "Samuli Suominen (drac)" <drac@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in games-arcade/amphetamine/files: 020_assumed_sizeof_long.diff
Date: Fri, 02 Nov 2007 21:23:59
Message-Id: E1Io3ze-0001SZ-3X@stork.gentoo.org
1 drac 07/11/02 21:23:54
2
3 Added: 020_assumed_sizeof_long.diff
4 Log:
5 While keywording for AMD64, add a new patch from Debian, courtesy of Darren Salt: fix wrong assumption that long is a 32 bit type. Also fix desktop file to meet f.d.o standard, Icon= should not be suffixed if full path is not specified. Bug 166049.
6 (Portage version: 2.1.3.16)
7
8 Revision Changes Path
9 1.1 games-arcade/amphetamine/files/020_assumed_sizeof_long.diff
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-arcade/amphetamine/files/020_assumed_sizeof_long.diff?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-arcade/amphetamine/files/020_assumed_sizeof_long.diff?rev=1.1&content-type=text/plain
13
14 Index: 020_assumed_sizeof_long.diff
15 ===================================================================
16 --- amphetamine-0.8.10.orig/src/Shape.cpp
17 +++ amphetamine-0.8.10/src/Shape.cpp
18 @@ -56,12 +56,12 @@
19 */
20 #ifdef __OPT_MEM_ACCESS__
21
22 -#define GET_LONG(adr) *(unsigned long *)adr
23 -#define SET_LONG(adr, l) *(unsigned long *)adr = l
24 +#define GET_LONG(adr) *(uint32_t *)adr
25 +#define SET_LONG(adr, l) *(uint32_t *)adr = l
26
27 #else
28
29 -#define GET_LONG(adr) ((long)((unsigned char *)(adr))[0] << 24) + ((long)((unsigned char *)(adr))[1] << 16) + ((long)((unsigned char *)(adr))[2] << 8) + ((long)((unsigned char *)(adr))[3])
30 +#define GET_LONG(adr) ((uint32_t)((unsigned char *)(adr))[0] << 24) + ((uint32_t)((unsigned char *)(adr))[1] << 16) + ((uint32_t)((unsigned char *)(adr))[2] << 8) + ((uint32_t)((unsigned char *)(adr))[3])
31 #define SET_LONG(adr, l) ((unsigned char *)adr)[0] = (unsigned char)((l) >> 24); \
32 ((unsigned char *)adr)[1] = (unsigned char)((l) >> 16); \
33 ((unsigned char *)adr)[2] = (unsigned char)((l) >> 8); \
34 @@ -116,7 +116,7 @@
35 {
36 // store the location of this line start
37 lineStartPtr = destPtr;
38 - destPtr += sizeof( unsigned long );
39 + destPtr += sizeof( uint32_t );
40
41 // at the beginning of each row we are not in any run
42 drawRunFlag = kFalse;
43 @@ -160,7 +160,7 @@
44 // create the skip token
45 //*( ( unsigned long * )destPtr ) = ( kSkipPixelsToken << 24 ) + runCounter;
46 SET_LONG(destPtr, ( kSkipPixelsToken << 24 ) + runCounter);
47 - destPtr += sizeof( unsigned long );
48 + destPtr += sizeof( uint32_t );
49 }
50
51 // are we in a draw run
52 @@ -179,7 +179,7 @@
53
54 // save the location of the token (so we can fill it in later)
55 runTokenPtr = destPtr;
56 - destPtr += sizeof( unsigned long );
57 + destPtr += sizeof( uint32_t );
58
59 // copy the pixel
60 *destPtr = *srcPtr;
61 @@ -215,7 +215,7 @@
62
63 // create the end of shape token
64 SET_LONG(destPtr, kEndShapeToken << 24);
65 - destPtr += sizeof( unsigned long );
66 + destPtr += sizeof( uint32_t );
67
68 // Resize the handle to match the real size of the shape
69 //SetHandleSize( shapeHandle, destPtr - ( unsigned char * )( *shapeHandle ) );
70 @@ -280,7 +280,7 @@
71 // get a token
72 tokenOp = GET_LONG(srcPtr ) >> 24;
73 tokenData = GET_LONG(srcPtr ) & 0x00ffffff;
74 - srcPtr += sizeof( unsigned long );
75 + srcPtr += sizeof( uint32_t );
76
77 // depending on the token
78 switch( tokenOp )
79 @@ -435,7 +435,7 @@
80 // get a token
81 tokenOp = GET_LONG(srcPtr) >> 24;
82 tokenData = GET_LONG(srcPtr) & 0x00ffffff;
83 - srcPtr += sizeof( unsigned long );
84 + srcPtr += sizeof( uint32_t );
85
86 // depending on the token
87 switch( tokenOp )
88
89
90
91 --
92 gentoo-commits@g.o mailing list