From: Aditya Upadhyay <aadit0402@gmail.com>
To: newlib@sourceware.org
Subject: Importing cargl.c from NetBSD
Date: Fri, 23 Jun 2017 23:25:00 -0000 [thread overview]
Message-ID: <CAMZxAxdL3gyjXRDGHfmim1VQxPyXABXehpFbkfmQsoiKRZxwfw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 170 bytes --]
Hello Developers,
This is the patch for cargl.c, imported from NetBSD. Please review the
same and suggest me any needed modification.
Thanks & Regards,
Aditya Upadhyay
[-- Attachment #2: 0001-Importing-cargl.c-from-NetBSD.patch --]
[-- Type: text/x-patch, Size: 4357 bytes --]
From b05ce0b8b9cdcb78e9a9c22b4b24bcf4d937cb24 Mon Sep 17 00:00:00 2001
From: Aditya Upadhyay <aadit0402@gmail.com>
Date: Sat, 24 Jun 2017 04:53:42 +0530
Subject: [PATCH] Importing cargl.c from NetBSD.
---
newlib/libm/complex/Makefile.am | 2 +-
newlib/libm/complex/Makefile.in | 13 ++++++++++---
newlib/libm/complex/cargl.c | 18 ++++++++++++++++++
3 files changed, 29 insertions(+), 4 deletions(-)
create mode 100644 newlib/libm/complex/cargl.c
diff --git a/newlib/libm/complex/Makefile.am b/newlib/libm/complex/Makefile.am
index 4d3ede3..e4460c9 100644
--- a/newlib/libm/complex/Makefile.am
+++ b/newlib/libm/complex/Makefile.am
@@ -10,7 +10,7 @@ src = cabs.c cacos.c cacosh.c carg.c casin.c casinh.c \
cpow.c cproj.c creal.c \
csin.c csinh.c csqrt.c ctan.c ctanh.c
-lsrc = cabsl.c creall.c cimagl.c ccoshl.c cacoshl.c csqrtl.c clogl.c cephes_subrl.c
+lsrc = cabsl.c creall.c cimagl.c ccoshl.c cacoshl.c csqrtl.c clogl.c cephes_subrl.c cargl.c
fsrc = cabsf.c casinf.c ccosf.c cimagf.c cprojf.c \
csqrtf.c cacosf.c casinhf.c ccoshf.c clogf.c clog10f.c \
diff --git a/newlib/libm/complex/Makefile.in b/newlib/libm/complex/Makefile.in
index cfc318a..006e142 100644
--- a/newlib/libm/complex/Makefile.in
+++ b/newlib/libm/complex/Makefile.in
@@ -98,7 +98,8 @@ am__objects_2 = lib_a-cabsf.$(OBJEXT) lib_a-casinf.$(OBJEXT) \
lib_a-cpowf.$(OBJEXT) lib_a-csinhf.$(OBJEXT)
am__objects_3 = lib_a-cabsl.$(OBJEXT) lib_a-creall.$(OBJEXT) \
lib_a-cimagl.$(OBJEXT) lib_a-ccoshl.$(OBJEXT) lib_a-cacoshl.$(OBJEXT) \
- lib_a-clogl.$(OBJEXT) lib_a-csqrtl.$(OBJEXT) lib_a-cephes_subrl.$(OBJEXT)
+ lib_a-clogl.$(OBJEXT) lib_a-csqrtl.$(OBJEXT) lib_a-cephes_subrl.$(OBJEXT) \
+ lib_a-cargl.$(OBJEXT)
@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \
@USE_LIBTOOL_FALSE@ $(am__objects_2) $(am__objects_3)
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
@@ -114,7 +115,7 @@ am__objects_5 = cabsf.lo casinf.lo ccosf.lo cimagf.lo cprojf.lo \
conjf.lo csinf.lo ctanhf.lo cargf.lo catanhf.lo cexpf.lo \
cpowf.lo csinhf.lo
am__objects_6 = cabsl.lo creall.lo cimagl.lo ccoshl.lo cacoshl.lo \
- clogl.lo csqrtl.lo cephes_subrl.lo
+ clogl.lo csqrtl.lo cephes_subrl.lo cargl.lo
@USE_LIBTOOL_TRUE@am_libcomplex_la_OBJECTS = $(am__objects_4) \
@USE_LIBTOOL_TRUE@ $(am__objects_5) $(am__objects_6)
libcomplex_la_OBJECTS = $(am_libcomplex_la_OBJECTS)
@@ -278,7 +279,7 @@ src = cabs.c cacos.c cacosh.c carg.c casin.c casinh.c \
cpow.c cproj.c creal.c \
csin.c csinh.c csqrt.c ctan.c ctanh.c
-lsrc = cabsl.c creall.c cimagl.c ccoshl.c cacoshl.c clogl.c csqrtl.c cephes_subrl.c
+lsrc = cabsl.c creall.c cimagl.c ccoshl.c cacoshl.c clogl.c csqrtl.c cephes_subrl.c cargl.c
fsrc = cabsf.c casinf.c ccosf.c cimagf.c cprojf.c \
csqrtf.c cacosf.c casinhf.c ccoshf.c clogf.c clog10f.c \
crealf.c ctanf.c cacoshf.c catanf.c \
@@ -643,6 +644,12 @@ lib_a-cargf.o: cargf.c
lib_a-cargf.obj: cargf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-cargf.obj `if test -f 'cargf.c'; then $(CYGPATH_W) 'cargf.c'; else $(CYGPATH_W) '$(srcdir)/cargf.c'; fi`
+lib_a-cargl.o: cargl.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-cargl.o `test -f 'cargl.c' || echo '$(srcdir)/'`cargl.c
+
+lib_a-cargl.obj: cargl.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-cargl.obj `if test -f 'cargl.c'; then $(CYGPATH_W) 'cargl.c'; else $(CYGPATH_W) '$(srcdir)/cargl.c'; fi`
+
lib_a-catanhf.o: catanhf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-catanhf.o `test -f 'catanhf.c' || echo '$(srcdir)/'`catanhf.c
diff --git a/newlib/libm/complex/cargl.c b/newlib/libm/complex/cargl.c
new file mode 100644
index 0000000..d2885a4
--- /dev/null
+++ b/newlib/libm/complex/cargl.c
@@ -0,0 +1,18 @@
+/* $NetBSD: cargl.c,v 1.1 2014/10/10 00:48:18 christos Exp $ */
+
+/*
+ * Public domain.
+ */
+
+#include <complex.h>
+#include <math.h>
+
+long double
+cargl(long double complex z)
+{
+ #ifdef _LDBL_EQ_DBL
+ return carg (z);
+ #else
+ return atan2l (imag (z), real (z));
+ #endif
+}
--
2.7.4
reply other threads:[~2017-06-23 23:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMZxAxdL3gyjXRDGHfmim1VQxPyXABXehpFbkfmQsoiKRZxwfw@mail.gmail.com \
--to=aadit0402@gmail.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).