bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memxor


From: Paul Eggert
Subject: Re: memxor
Date: Wed, 05 Oct 2005 14:54:03 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Simon Josefsson <address@hidden> writes:

> I am not sure about the prototype.  Should it use 'char*'?  'int*'?

If its name is mem* then it should use void *, for consistency.

The current implementation uses 'restrict', so memxor.m4 should
AC_REQUIRE([gl_C_RESTRICT]) and the memxor module should depend on the
restrict module.

The current implementation casts 'const void *' to 'char *', which
will provoke warnings with many compilers.  Also, it contains
unnecessary casts.  How about this implementation instead?

  char *d = dest;
  char const *s = src;

  for (; n > 0; n--)
    *d++ ^= *s++;

  return dest;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]