[Top][All Lists]

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

Re: stop using P_, __P in header files

From: Dan Nicolaescu
Subject: Re: stop using P_, __P in header files
Date: Sun, 04 Jul 2010 11:55:12 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Juanma Barranquero <address@hidden> writes:

> On Sun, Jul 4, 2010 at 10:08, Dan Nicolaescu <address@hidden> wrote:
>> I've done most of this.
> Thanks. I've fixed a few prototypes that break compilation on Windows
> or generate warnings.


> A few questions:
> 1) This one and similar ones on unexelf.c seem errors:
> -round_up (x, y)
> -     ElfW(Addr) x, y;
> +round_up (Elf32_Addr x, Elf32_Addr y)
> The prototypes should presumably still use ElfW(Addr), ElfW(Ehdr),
> etc., shouldn't they?

Yes, they should.  I did not convert the code by hand, but by using
protoize (which runs the preprocessor) so this is why such prototypes got 
I caught a few similar ones and worked around them, but it looks like
some similar things got away.

> 2) In strftme.c you've converted just some functions, not all, and
> removed the LOCALE_PARAM* macros.
>  static CHAR_T *
> -memcpy_lowcase (dest, src, len LOCALE_PARAM)
> -     CHAR_T *dest;
> -     const CHAR_T *src;
> -     size_t len;
> +memcpy_lowcase (char *dest, const char *src, size_t len)
> Apparently, there haven't been any changes from gnulib merged back
> into strftime.c in the past seven years (since 2003-06-24). Should the
> LOCALE_PARAM* macros still be used (and so, re-added to
> memcpy_(low|upp)case), or would it be better to just get rid of that
> cruft?

I'd say we should resync with gnulib.
protoize made this change, so it was not intentional...

> 3) After this change in print.c
>  static void
> -strout (ptr, size, size_byte, printcharfun, multibyte)
> -     char *ptr;
> -     int size, size_byte;
> -     Lisp_Object printcharfun;
> -     int multibyte;
> +strout (char *ptr, int size, int size_byte, Lisp_Object printcharfun,
> int multibyte)
>  {
> compilation throws this warning:
> print.c: In function 'print_object':
> print.c:1973: warning: passing argument 1 of 'strout' discards
> qualifiers from pointer target type
> print.c:353: note: expected 'char *' but argument is of type 'const char *'
> becase of the call
>         strout (XSUBR (obj)->symbol_name, -1, -1, printcharfun, 0);
> AFAICS, the object pointed to by PTR is never modified, so it seems
> safe to use const char *, and I've done so.

That seems TRTD.

reply via email to

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