Mail Archives: djgpp-workers/2011/08/20/12:21:38
On Sat, Aug 20, 2011 at 3:52 PM, Eli Zaretskii <eliz AT gnu DOT org> wrote:
>> Date: Sat, 20 Aug 2011 14:26:18 +0300
>> From: Ozkan Sezer <sezeroz AT gmail DOT com>
>>
>> PING^2
>
> Sorry for the delay. I applied the patch now, with 3 changes:
>
> . I added a Copyright year to each file to indicate a change in the
> year 2011.
>
> . I used "_Complex double" and "_Complex float" in the declarations,
> not "double _Complex" etc., as the GCC manual seems to suggest the
> former.
>
> . I didn't remove the K&R prototypes, and instead modified them to
> fit the STDC ones.
>
> The patch I committed appears below. Please see if I didn't screw up
> anything.
>
AFAICS, seems OK and compiles.
> Thanks again for your work on this.
>
My pleasure.
> Index: src/libm/math/w_cabs.c
> ===================================================================
> RCS file: /cvs/djgpp/djgpp/src/libm/math/w_cabs.c,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -r1.3 -r1.4
> --- src/libm/math/w_cabs.c 14 Dec 1999 12:01:34 -0000 1.3
> +++ src/libm/math/w_cabs.c 20 Aug 2011 12:41:02 -0000 1.4
> @@ -1,3 +1,4 @@
> +/* Copyright (C) 2011 DJ Delorie, see COPYING.DJ for details */
> /* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
> /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
> /*
> @@ -9,18 +10,13 @@
>
> #include "fdlibm.h"
>
> -struct complex {
> - double x;
> - double y;
> -};
> -
> #ifdef __STDC__
> -double cabs(struct complex);
> -double cabs(struct complex z)
> +double cabs(_Complex double);
> +double cabs(_Complex double z)
> #else
> double cabs(z)
> - struct complex z;
> + _Complex double z;
> #endif
> {
> - return hypot(z.x, z.y);
> + return hypot(__real__ z, __imag__ z);
> }
> Index: src/libm/math/wf_cabs.c
> ===================================================================
> RCS file: /cvs/djgpp/djgpp/src/libm/math/wf_cabs.c,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -r1.3 -r1.4
> --- src/libm/math/wf_cabs.c 14 Dec 1999 12:01:34 -0000 1.3
> +++ src/libm/math/wf_cabs.c 20 Aug 2011 12:41:02 -0000 1.4
> @@ -1,3 +1,4 @@
> +/* Copyright (C) 2011 DJ Delorie, see COPYING.DJ for details */
> /* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
> /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
> /*
> @@ -9,18 +10,13 @@
>
> #include "fdlibm.h"
>
> -struct complex {
> - float x;
> - float y;
> -};
> -
> #ifdef __STDC__
> -float cabsf(struct complex);
> -float cabsf(struct complex z)
> +float cabsf(_Complex float);
> +float cabsf(_Complex float z)
> #else
> float cabsf(z)
> - struct complex z;
> + _Complex float z;
> #endif
> {
> - return hypotf(z.x, z.y);
> + return hypotf(__real__ z, __imag__ z);
> }
>
--
O.S.
- Raw text -