This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: Importing inttypes methods from FreeBSD


On Jul 11 08:58, Aditya Upadhyay wrote:
> Hello Developers,
> 
> I have ported these inttypes methods from FreeBSD. I am requesting you
> to please review the same and suggest me changes.

Nope, sorry, patch 3 is no-go.  Adding the infrastructure from
xlocale_private.h is not the right thing to do.  You're adding a
completely new way of doing stuff, which is differently implemented
in newlib already.  The thread-local stuff is in the reent struct,
which also points to thread local locale info.  States for
multibyte/wide char conversion are already kept in reent.  Use those.
If something's missing, add it there.

> diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am
> index ebae00a..bf44953 100644
> --- a/newlib/libc/stdlib/Makefile.am
> +++ b/newlib/libc/stdlib/Makefile.am
> @@ -33,6 +33,7 @@ GENERAL_SOURCES = \
>  	getenv.c  	\
>  	getenv_r.c	\
>  	itoa.c          \
> +        imaxabs.c       \

tab, not spaces

>  	labs.c 		\
>  	ldiv.c  	\
>  	ldtoa.c		\
> [...]
> From: Aditya Upadhyay <aadit0402@gmail.com>
> Date: Mon, 10 Jul 2017 18:41:38 +0530
> Subject: [PATCH 2/4] Importing imaxdiv inttypes method from FreeBSD.
> 
> ---
>  newlib/libc/stdlib/Makefile.am |  1 +
>  newlib/libc/stdlib/imaxdiv.c   | 44 ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 45 insertions(+)
>  create mode 100644 newlib/libc/stdlib/imaxdiv.c
> 
> diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am
> index bf44953..5a50c3a 100644
> --- a/newlib/libc/stdlib/Makefile.am
> +++ b/newlib/libc/stdlib/Makefile.am
> @@ -34,6 +34,7 @@ GENERAL_SOURCES = \
>  	getenv_r.c	\
>  	itoa.c          \
>          imaxabs.c       \
> +        imaxdiv.c       \

Same here

>  	labs.c 		\
>  	ldiv.c  	\
>  	ldtoa.c		\

> From 1e914a2098de912d3d0e8c2fb350dd4f9f9b5435 Mon Sep 17 00:00:00 2001
> From: Aditya Upadhyay <aadit0402@gmail.com>
> Date: Tue, 11 Jul 2017 08:32:42 +0530
> Subject: [PATCH 4/4] Importing strtoimax inttypes methods from FreeBSD.
> 
> ---
>  newlib/libc/locale/Makefile.am | 2 +-
>  newlib/libc/stdlib/Makefile.am | 1 +
>  newlib/libc/stdlib/strtoimax.c | 0
>  3 files changed, 2 insertions(+), 1 deletion(-)
>  create mode 100644 newlib/libc/stdlib/strtoimax.c
> 
> diff --git a/newlib/libc/locale/Makefile.am b/newlib/libc/locale/Makefile.am
> index 7312654..5f00d72 100644
> --- a/newlib/libc/locale/Makefile.am
> +++ b/newlib/libc/locale/Makefile.am
> @@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = cygnus
>  
>  INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
>  
> -GENERAL_SOURCES = setlocale.h locale.c localeconv.c
> +GENERAL_SOURCES = setlocale.h locale.c localeconv.c xlocale_private.h
>  
>  ## The following interfaces are EL/IX level 2
>  if ELIX_LEVEL_1
> diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am
> index 5a50c3a..0f05154 100644
> --- a/newlib/libc/stdlib/Makefile.am
> +++ b/newlib/libc/stdlib/Makefile.am
> @@ -59,6 +59,7 @@ GENERAL_SOURCES = \
>  	sb_charsets.c	\
>  	strtod.c	\
>  	strtodg.c	\
> +        strtoimax.c     \

Same here

>  	strtol.c	\
>  	strtorx.c	\
>  	strtoul.c	\
> diff --git a/newlib/libc/stdlib/strtoimax.c b/newlib/libc/stdlib/strtoimax.c
> new file mode 100644
> index 0000000..e69de29

The function is missing.  If it uses the new code from xlocale_private.h,
you'll have to reevaluate.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: signature.asc
Description: PGP signature


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