[Bug 15151] Compile warning fixes.

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Mar 21 02:40:43 PDT 2008


--- Comment #4 from Paulo César Pereira de Andrade <pcpa at mandriva.com.br>  2008-03-21 02:40:41 PST ---
(In reply to comment #3)
> >   There should not exist any other problems as math with void * is the
> > same as math with signed or unsiged char pointers.
> So I thought, but it turned out that void* arithmetics are a GCC extension and
> not defined in any C standard. It's probably better not to use it.

  Either I am confused, or you misunderstood me :-) The patch changed the
field from "void*" to "unsigned char*" to avoid warnings about void* math.
The cases I casted to unsigned char* were because gcc doesn't compile void*
and char* arithmetic:

-           if (info->tilingEnabled && ((pPix->devPrivate.ptr - info->FB) ==
+           if (info->tilingEnabled && (((unsigned char *)pPix->devPrivate.ptr
- info->FB) == 0))

this could just be "pPix->devPrivate.ptr == info->FB"

-           dst_offset = (pPixmap->devPrivate.ptr - info->FB) +
+           dst_offset = ((unsigned char *)pPixmap->devPrivate.ptr - info->FB)

otherwise, if keeping RADEONInfoRec.FB type as void*, it would be required
a quite larger patch, casting it to a char pointer, to avoid the warnings.

  The comment about the math being the same is because
((void*)<addr> + integer) should result the same pointer as
((unsigned char*)<addr> + integer).

Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the xorg-driver-ati mailing list