[MPlayer-dev-eng] [PATCH] get rid of *void pointer arithemtic in libvo/fastmemcpy.h

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Jan 25 19:17:34 CET 2007


Hello,
On Thu, Jan 25, 2007 at 05:01:02PM +0100, Guillaume POIRIER wrote:
> On 1/25/07, Reimar Doeffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> 
> wrote:
> >On Thu, Jan 25, 2007 at 02:36:46PM +0100, Guillaume Poirier wrote:
> >> The attached patch does $SUBJ.
> >>
> >> It was spotted by Intel's C Compiler.
> >>
> >> As Michael is the one who suggested that changed, unless someone
> >> disagrees or gives the go ahead now, I'll apply it by tomorrow.
> >>
> >> Guillaume
> >
> >> Index: libvo/fastmemcpy.h
> >> ===================================================================
> >> --- libvo/fastmemcpy.h        (revision 21941)
> >> +++ libvo/fastmemcpy.h        (working copy)
> >> @@ -7,6 +7,7 @@
> >>  #if defined(HAVE_MMX) || defined(HAVE_MMX2) || defined(HAVE_3DNOW) \
> >>  /*    || defined(HAVE_SSE) || defined(HAVE_SSE2) */
> >>  #include <stddef.h>
> >> +#include <stdint.h>
> >
> >I think inttypes.h is prefered within MPlayer even if it is not (yet)
> >needed here.
> 
> So you'd vote for which type? char*? int*? I don't think it matter
> here though...

Misunderstanding *g*. I didn't mean no include was needed, I meant that
inttypes.h defines more stuff than stdint.h, none of which is needed
(IOW I prefer inttypes.h even if it is overkill).

> >Also I do not like changing the type of the parameters, the memcpy types
> >are void*, too, AFAIK.
> 
> That's Correct:
> void *memcpy(void *dest, const void *src, size_t n);

Just as a mention why I want this: with uint8_t or so we probably soon
would have more such stupid warnings like "pointer targets differ in
signedness" etc.

> >Instead either cast or use a local variable with appropriate type IMO
> 
> Attached patch implements the solution with casts, with uint8_t*.
> 
> If you prefer char* or whatever else, then I can change it before 
> committing.

I personally prefer using (u)int8_t for arbitrary data and char* only for
strings, so not I don't want to change it.
I think it is fine, and doesn't affect readability too much. Any
objections?

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list