This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Call memcpy in generic mempcpy


> On 02/06/13 12:53, Ond$,1 yej B,Amlka wrote:
> >    unsigned long int dstp = (long int) dstpp;
> ...
> > +  memcpy (dstpp, srcpp, len);
> > +  return (void *) (dstp + len);
> 
> There's no need to use an integer type, or
> to do any casts.  Something like this, perhaps?
> 
>   char *dstp = dstpp;
>   memcpy (destpp, srcpp, len);
>   return dstp + len;

It's GNU code and can assume GNU C extensions.
So there isn't even a need for a cast.
And, it's more efficient to use the return value.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]