summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/xorg-lib/libxxf86dga/libxxf86dga-1.1.3_fix_for_x32.patch
blob: 4a0c682554e2f307edb12ce5b7816f9467006f8a (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
Upstream-Status: pending

Fix type conversion for x32. For x32 the off_t is 64bit and pointers are 32bit.
so the conversion of pointer to off_t was resulting into this error:

| XF86DGA2.c:931:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
| cc1: some warnings being treated as errors
| 
| make[2]: *** [XF86DGA2.lo] Error 1

Fixed it by typecasting pointer into unsigned long 1st and then again typecasting 
unsigned long to off_t.

Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2012/01/04


Index: libXxf86dga-1.1.3/src/XF86DGA2.c
===================================================================
--- libXxf86dga-1.1.3.orig/src/XF86DGA2.c
+++ libXxf86dga-1.1.3/src/XF86DGA2.c
@@ -928,7 +928,7 @@ DGAMapPhysical(
     if ((pMap->fd = open(name, O_RDWR)) < 0)
 	return False;
     pMap->virtual = mmap(NULL, size, PROT_READ | PROT_WRITE,
-			MAP_FILE | MAP_SHARED, pMap->fd, (off_t)base);
+			MAP_FILE | MAP_SHARED, pMap->fd, (off_t)(unsigned long)base);
     if (pMap->virtual == (void *)-1)
 	return False;
     mprotect(pMap->virtual, size, PROT_READ | PROT_WRITE);