diff options
author | cvs2svn <> | 2008-09-05 00:26:21 +0400 |
---|---|---|
committer | cvs2svn <> | 2008-09-05 00:26:21 +0400 |
commit | 07b4b67a88f386ce4716a14e0ff2c2bce992b985 (patch) | |
tree | 2d367e3f5c271ef2cdf093f175039cd701237bc7 /newlib/libc/stdlib | |
parent | cfef0dc52cc4eab69ddeab566fa31790a2328b6a (diff) |
This commit was manufactured by cvs2svn to create tag 'newlib-1_16_0'.newlib-1_16_0
Sprout from binutils-arc-20080908-branch 2008-09-04 20:26:19 UTC cvs2svn 'This commit was manufactured by cvs2svn to create branch 'binutils-'
Cherrypick from master 2007-12-19 22:36:48 UTC Jeff Johnston <jjohnstn@redhat.com> '':
ChangeLog
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
config.guess
config.rpath
config.sub
config/ChangeLog
config/acinclude.m4
config/acx.m4
config/confsubdir.m4
config/mh-i370pic
config/mh-ia64pic
config/mh-mingw
config/mh-ppc-darwin
config/mh-s390pic
config/mh-sparcpic
config/mt-mips-elfoabi
config/mt-spu
config/tls.m4
configure
configure.ac
libgloss/ChangeLog
libgloss/arm/configure
libgloss/arm/crt0.S
libgloss/arm/redboot-syscalls.c
libgloss/bfin/Makefile.in
libgloss/bfin/configure
libgloss/bfin/syscalls.c
libgloss/configure
libgloss/cris/configure
libgloss/cris/gensyscalls
libgloss/crx/configure
libgloss/d30v/configure
libgloss/doc/configure
libgloss/fr30/configure
libgloss/fr30/syscalls.c
libgloss/frv/configure
libgloss/frv/crt0.S
libgloss/frv/isatty.c
libgloss/hp74x/configure
libgloss/i386/configure
libgloss/i960/configure
libgloss/iq2000/configure
libgloss/iq2000/crt0.S
libgloss/iq2000/isatty.c
libgloss/libnosys/configure
libgloss/libnosys/configure.in
libgloss/libnosys/isatty.c
libgloss/m32c/configure
libgloss/m32c/exit.S
libgloss/m32r/configure
libgloss/m32r/isatty.c
libgloss/m68hc11/configure
libgloss/m68k/cf-crt1.c
libgloss/m68k/configure
libgloss/mcore/configure
libgloss/mep/configure
libgloss/mips/configure
libgloss/mn10200/configure
libgloss/mn10200/isatty.c
libgloss/mn10300/configure
libgloss/mn10300/crt0.S
libgloss/mn10300/isatty.c
libgloss/mt/configure
libgloss/pa/configure
libgloss/rs6000/configure
libgloss/sparc/configure
libgloss/sparc/libsys/configure
libgloss/spu/Makefile.in
libgloss/spu/configure
libgloss/spu/readlink.c
libgloss/spu/sbrk.c
libgloss/spu/syscalls.c
libgloss/wince/configure
libgloss/xstormy16/configure
libtool.m4
ltsugar.m4
newlib/ChangeLog
newlib/Makefile.am
newlib/Makefile.in
newlib/configure.host
newlib/libc/argz/argz_count.c
newlib/libc/argz/argz_extract.c
newlib/libc/argz/argz_stringify.c
newlib/libc/ctype/ctype_.c
newlib/libc/ctype/isalnum.c
newlib/libc/ctype/isalpha.c
newlib/libc/ctype/iscntrl.c
newlib/libc/ctype/isdigit.c
newlib/libc/ctype/islower.c
newlib/libc/ctype/isprint.c
newlib/libc/ctype/ispunct.c
newlib/libc/ctype/isspace.c
newlib/libc/ctype/isupper.c
newlib/libc/ctype/isxdigit.c
newlib/libc/include/_ansi.h
newlib/libc/include/_syslist.h
newlib/libc/include/assert.h
newlib/libc/include/ctype.h
newlib/libc/include/getopt.h
newlib/libc/include/machine/_default_types.h
newlib/libc/include/machine/ieeefp.h
newlib/libc/include/machine/setjmp.h
newlib/libc/include/math.h
newlib/libc/include/reent.h
newlib/libc/include/stdint.h
newlib/libc/include/stdio.h
newlib/libc/include/string.h
newlib/libc/include/sys/_default_fcntl.h
newlib/libc/include/sys/reent.h
newlib/libc/include/sys/stat.h
newlib/libc/include/sys/unistd.h
newlib/libc/libc.texinfo
newlib/libc/machine/arm/setjmp.S
newlib/libc/machine/configure
newlib/libc/machine/i386/memchr.S
newlib/libc/machine/i386/memset.S
newlib/libc/machine/i386/strchr.S
newlib/libc/machine/i386/strlen.S
newlib/libc/machine/m68k/memcpy.S
newlib/libc/machine/m68k/memset.S
newlib/libc/machine/m68k/setjmp.S
newlib/libc/machine/mips/strncpy.c
newlib/libc/machine/mn10300/memset.S
newlib/libc/machine/powerpc/vfprintf.c
newlib/libc/machine/spu/Makefile.am
newlib/libc/machine/spu/Makefile.in
newlib/libc/machine/spu/fprintf.S
newlib/libc/machine/spu/fscanf.S
newlib/libc/machine/spu/mk_syscalls
newlib/libc/machine/spu/printf.S
newlib/libc/machine/spu/scanf.S
newlib/libc/machine/spu/setjmp.S
newlib/libc/machine/spu/snprintf.S
newlib/libc/machine/spu/sprintf.S
newlib/libc/machine/spu/sscanf.S
newlib/libc/machine/spu/stack_reg_va.S
newlib/libc/machine/spu/strcat.c
newlib/libc/machine/spu/strcpy.c
newlib/libc/machine/spu/strlen.c
newlib/libc/machine/spu/strncat.c
newlib/libc/machine/spu/strncmp.c
newlib/libc/machine/spu/strncpy.c
newlib/libc/machine/spu/sys/dirent.h
newlib/libc/machine/spu/sys/errno.h
newlib/libc/machine/spu/sys/sched.h
newlib/libc/machine/spu/sys/syscall.h
newlib/libc/posix/Makefile.am
newlib/libc/posix/Makefile.in
newlib/libc/posix/isatty.c
newlib/libc/reent/Makefile.am
newlib/libc/reent/Makefile.in
newlib/libc/search/hash.h
newlib/libc/stdio/Makefile.am
newlib/libc/stdio/Makefile.in
newlib/libc/stdio/asiprintf.c
newlib/libc/stdio/asniprintf.c
newlib/libc/stdio/asnprintf.c
newlib/libc/stdio/asprintf.c
newlib/libc/stdio/dprintf.c
newlib/libc/stdio/fflush.c
newlib/libc/stdio/freopen.c
newlib/libc/stdio/ftell.c
newlib/libc/stdio/local.h
newlib/libc/stdio/makebuf.c
newlib/libc/stdio/rget.c
newlib/libc/stdio/siprintf.c
newlib/libc/stdio/siscanf.c
newlib/libc/stdio/sniprintf.c
newlib/libc/stdio/snprintf.c
newlib/libc/stdio/sprintf.c
newlib/libc/stdio/sscanf.c
newlib/libc/stdio/vasiprintf.c
newlib/libc/stdio/vasniprintf.c
newlib/libc/stdio/vasnprintf.c
newlib/libc/stdio/vasprintf.c
newlib/libc/stdio/vdiprintf.c
newlib/libc/stdio/vdprintf.c
newlib/libc/stdio/vfprintf.c
newlib/libc/stdio/vfscanf.c
newlib/libc/stdio/vsiprintf.c
newlib/libc/stdio/vsiscanf.c
newlib/libc/stdio/vsniprintf.c
newlib/libc/stdio/vsnprintf.c
newlib/libc/stdio/vsprintf.c
newlib/libc/stdio/vsscanf.c
newlib/libc/stdio64/ftello64.c
newlib/libc/stdlib/envlock.h
newlib/libc/stdlib/gdtoa-hexnan.c
newlib/libc/stdlib/getopt.c
newlib/libc/stdlib/mprec.h
newlib/libc/stdlib/strtod.c
newlib/libc/stdlib/wcsrtombs.c
newlib/libc/string/Makefile.am
newlib/libc/string/Makefile.in
newlib/libc/string/memchr.c
newlib/libc/string/memset.c
newlib/libc/string/strcasestr.c
newlib/libc/string/strchr.c
newlib/libc/string/strings.tex
newlib/libc/string/strlen.c
newlib/libc/string/strstr.c
newlib/libc/sys/a29khif/_isatty.S
newlib/libc/sys/arc/isatty.c
newlib/libc/sys/arm/syscalls.c
newlib/libc/sys/configure
newlib/libc/sys/d10v/syscalls.c
newlib/libc/sys/h8300hms/syscalls.c
newlib/libc/sys/h8500hms/syscalls.c
newlib/libc/sys/linux/Makefile.am
newlib/libc/sys/linux/Makefile.in
newlib/libc/sys/linux/bits/libc-lock.h
newlib/libc/sys/linux/iconv/iconvconfig.c
newlib/libc/sys/linux/iconv/strtab.c
newlib/libc/sys/linux/include/arpa/nameser.h
newlib/libc/sys/linux/include/hesiod.h
newlib/libc/sys/linux/include/libc_private.h
newlib/libc/sys/linux/include/net/ethernet.h
newlib/libc/sys/linux/include/net/if_atm.h
newlib/libc/sys/linux/include/net/if_media.h
newlib/libc/sys/linux/include/net/if_ppp.h
newlib/libc/sys/linux/include/net/if_pppvar.h
newlib/libc/sys/linux/include/netdb.h
newlib/libc/sys/linux/include/netinet/if_atm.h
newlib/libc/sys/linux/include/netinet/if_ether.h
newlib/libc/sys/linux/include/netinet/ip_flow.h
newlib/libc/sys/linux/include/nsswitch.h
newlib/libc/sys/linux/include/resolv.h
newlib/libc/sys/linux/include/sched.h
newlib/libc/sys/linux/include/stdint.h
newlib/libc/sys/linux/intl/locale.alias
newlib/libc/sys/linux/libc-symbols.h
newlib/libc/sys/linux/machine/i386/get_clockfreq.c
newlib/libc/sys/linux/machine/i386/include/endian.h
newlib/libc/sys/linux/machine/i386/include/param.h
newlib/libc/sys/linux/net/Makefile.am
newlib/libc/sys/linux/net/Makefile.in
newlib/libc/sys/linux/net/addr2ascii.3
newlib/libc/sys/linux/net/base64.c
newlib/libc/sys/linux/net/bindresvport.c
newlib/libc/sys/linux/net/byteorder.3
newlib/libc/sys/linux/net/ether_addr.c
newlib/libc/sys/linux/net/ethers.3
newlib/libc/sys/linux/net/getaddrinfo.3
newlib/libc/sys/linux/net/getaddrinfo.c
newlib/libc/sys/linux/net/gethostbydns.c
newlib/libc/sys/linux/net/gethostbyht.c
newlib/libc/sys/linux/net/gethostbyname.3
newlib/libc/sys/linux/net/gethostbynis.c
newlib/libc/sys/linux/net/gethostnamadr.c
newlib/libc/sys/linux/net/getifaddrs.3
newlib/libc/sys/linux/net/getifaddrs.c
newlib/libc/sys/linux/net/getipnodebyname.3
newlib/libc/sys/linux/net/getnameinfo.3
newlib/libc/sys/linux/net/getnameinfo.c
newlib/libc/sys/linux/net/getnetbydns.c
newlib/libc/sys/linux/net/getnetbyht.c
newlib/libc/sys/linux/net/getnetbynis.c
newlib/libc/sys/linux/net/getnetent.3
newlib/libc/sys/linux/net/getnetnamadr.c
newlib/libc/sys/linux/net/getproto.c
newlib/libc/sys/linux/net/getprotoent.3
newlib/libc/sys/linux/net/getprotoent.c
newlib/libc/sys/linux/net/getprotoname.c
newlib/libc/sys/linux/net/getservbyname.c
newlib/libc/sys/linux/net/getservbyport.c
newlib/libc/sys/linux/net/getservent.3
newlib/libc/sys/linux/net/getservent.c
newlib/libc/sys/linux/net/herror.c
newlib/libc/sys/linux/net/hesiod.3
newlib/libc/sys/linux/net/hesiod.c
newlib/libc/sys/linux/net/if_indextoname.3
newlib/libc/sys/linux/net/inet.3
newlib/libc/sys/linux/net/inet6_option_space.3
newlib/libc/sys/linux/net/inet6_rthdr_space.3
newlib/libc/sys/linux/net/inet_lnaof.c
newlib/libc/sys/linux/net/inet_makeaddr.c
newlib/libc/sys/linux/net/inet_net.3
newlib/libc/sys/linux/net/inet_netof.c
newlib/libc/sys/linux/net/inet_network.c
newlib/libc/sys/linux/net/inet_ntoa.c
newlib/libc/sys/linux/net/innetgr-stub.c
newlib/libc/sys/linux/net/ip6opt.c
newlib/libc/sys/linux/net/iso_addr.3
newlib/libc/sys/linux/net/iso_addr.c
newlib/libc/sys/linux/net/linkaddr.3
newlib/libc/sys/linux/net/linkaddr.c
newlib/libc/sys/linux/net/map_v4v6.c
newlib/libc/sys/linux/net/name6.c
newlib/libc/sys/linux/net/namespace.h
newlib/libc/sys/linux/net/ns.3
newlib/libc/sys/linux/net/ns_addr.c
newlib/libc/sys/linux/net/ns_name.c
newlib/libc/sys/linux/net/ns_netint.c
newlib/libc/sys/linux/net/ns_ntoa.c
newlib/libc/sys/linux/net/ns_parse.c
newlib/libc/sys/linux/net/ns_print.c
newlib/libc/sys/linux/net/ns_ttl.c
newlib/libc/sys/linux/net/nsap_addr.c
newlib/libc/sys/linux/net/nsdispatch.3
newlib/libc/sys/linux/net/nsdispatch.c
newlib/libc/sys/linux/net/nslexer.c
newlib/libc/sys/linux/net/nslexer.l
newlib/libc/sys/linux/net/nsparser.c
newlib/libc/sys/linux/net/nsparser.h
newlib/libc/sys/linux/net/nsparser.y
newlib/libc/sys/linux/net/rcmd.3
newlib/libc/sys/linux/net/rcmd.c
newlib/libc/sys/linux/net/rcmdsh.3
newlib/libc/sys/linux/net/res_comp.c
newlib/libc/sys/linux/net/res_config.h
newlib/libc/sys/linux/net/res_data.c
newlib/libc/sys/linux/net/res_debug.c
newlib/libc/sys/linux/net/res_init.c
newlib/libc/sys/linux/net/res_mkquery.c
newlib/libc/sys/linux/net/res_mkupdate.c
newlib/libc/sys/linux/net/res_query.c
newlib/libc/sys/linux/net/res_send.c
newlib/libc/sys/linux/net/res_update.c
newlib/libc/sys/linux/net/resolver.3
newlib/libc/sys/linux/net/rthdr.c
newlib/libc/sys/linux/net/send.c
newlib/libc/sys/linux/net/vars.c
newlib/libc/sys/linux/stdlib/COPYRIGHT
newlib/libc/sys/linux/stdlib/Makefile.am
newlib/libc/sys/linux/stdlib/Makefile.in
newlib/libc/sys/linux/stdlib/cclass.h
newlib/libc/sys/linux/stdlib/cname.h
newlib/libc/sys/linux/stdlib/collate.c
newlib/libc/sys/linux/stdlib/collate.h
newlib/libc/sys/linux/stdlib/collcmp.c
newlib/libc/sys/linux/stdlib/engine.c
newlib/libc/sys/linux/stdlib/fnmatch.3
newlib/libc/sys/linux/stdlib/fnmatch.c
newlib/libc/sys/linux/stdlib/glob.3
newlib/libc/sys/linux/stdlib/glob.c
newlib/libc/sys/linux/stdlib/reallocf.c
newlib/libc/sys/linux/stdlib/regcomp.c
newlib/libc/sys/linux/stdlib/regerror.c
newlib/libc/sys/linux/stdlib/regex.3
newlib/libc/sys/linux/stdlib/regex2.h
newlib/libc/sys/linux/stdlib/regexec.c
newlib/libc/sys/linux/stdlib/regfree.c
newlib/libc/sys/linux/stdlib/utils.h
newlib/libc/sys/linux/stdlib/wordexp.c
newlib/libc/sys/linux/stdlib/wordfree.c
newlib/libc/sys/linux/sys/ioctl.h
newlib/libc/sys/linux/sys/socket.h
newlib/libc/sys/linux/sys/types.h
newlib/libc/sys/linux/sys/unistd.h
newlib/libc/sys/mmixware/isatty.c
newlib/libc/sys/sh/syscalls.c
newlib/libc/sys/sysnecv850/crt0.S
newlib/libc/sys/sysnecv850/isatty.c
newlib/libc/syscalls/Makefile.am
newlib/libc/syscalls/Makefile.in
newlib/libc/syscalls/sysclose.c
newlib/libc/syscalls/sysexecve.c
newlib/libc/syscalls/sysfcntl.c
newlib/libc/syscalls/sysfork.c
newlib/libc/syscalls/sysfstat.c
newlib/libc/syscalls/sysgetpid.c
newlib/libc/syscalls/sysgettod.c
newlib/libc/syscalls/syskill.c
newlib/libc/syscalls/syslink.c
newlib/libc/syscalls/syslseek.c
newlib/libc/syscalls/sysopen.c
newlib/libc/syscalls/sysread.c
newlib/libc/syscalls/syssbrk.c
newlib/libc/syscalls/sysstat.c
newlib/libc/syscalls/systimes.c
newlib/libc/syscalls/sysunlink.c
newlib/libc/syscalls/syswait.c
newlib/libc/syscalls/syswrite.c
newlib/libc/time/mktime.c
newlib/libm/libm.texinfo
newlib/libm/machine/spu/configure
newlib/libm/machine/spu/headers/acosd2.h
newlib/libm/machine/spu/headers/acosf4.h
newlib/libm/machine/spu/headers/acoshd2.h
newlib/libm/machine/spu/headers/acoshf4.h
newlib/libm/machine/spu/headers/asind2.h
newlib/libm/machine/spu/headers/asinf4.h
newlib/libm/machine/spu/headers/asinhd2.h
newlib/libm/machine/spu/headers/asinhf4.h
newlib/libm/machine/spu/headers/atan2d2.h
newlib/libm/machine/spu/headers/atan2f4.h
newlib/libm/machine/spu/headers/atand2.h
newlib/libm/machine/spu/headers/atanf4.h
newlib/libm/machine/spu/headers/atanhd2.h
newlib/libm/machine/spu/headers/atanhf4.h
newlib/libm/machine/spu/headers/cbrt.h
newlib/libm/machine/spu/headers/cbrtf.h
newlib/libm/machine/spu/headers/cos_sin.h
newlib/libm/machine/spu/headers/cosd2.h
newlib/libm/machine/spu/headers/cosf4.h
newlib/libm/machine/spu/headers/coshd2.h
newlib/libm/machine/spu/headers/coshf4.h
newlib/libm/machine/spu/headers/divd2.h
newlib/libm/machine/spu/headers/divf4.h
newlib/libm/machine/spu/headers/erf_utils.h
newlib/libm/machine/spu/headers/erfcd2.h
newlib/libm/machine/spu/headers/erfcf4.h
newlib/libm/machine/spu/headers/erfd2.h
newlib/libm/machine/spu/headers/erff4.h
newlib/libm/machine/spu/headers/exp2d2.h
newlib/libm/machine/spu/headers/exp2f4.h
newlib/libm/machine/spu/headers/expd2.h
newlib/libm/machine/spu/headers/expf4.h
newlib/libm/machine/spu/headers/expm1d2.h
newlib/libm/machine/spu/headers/expm1f4.h
newlib/libm/machine/spu/headers/floord2.h
newlib/libm/machine/spu/headers/floorf4.h
newlib/libm/machine/spu/headers/hypotd2.h
newlib/libm/machine/spu/headers/hypotf4.h
newlib/libm/machine/spu/headers/isnand2.h
newlib/libm/machine/spu/headers/isnanf4.h
newlib/libm/machine/spu/headers/ldexpd2.h
newlib/libm/machine/spu/headers/ldexpf4.h
newlib/libm/machine/spu/headers/lgammad2.h
newlib/libm/machine/spu/headers/lgammaf4.h
newlib/libm/machine/spu/headers/log10d2.h
newlib/libm/machine/spu/headers/log1pd2.h
newlib/libm/machine/spu/headers/log1pf4.h
newlib/libm/machine/spu/headers/log2d2.h
newlib/libm/machine/spu/headers/log2f4.h
newlib/libm/machine/spu/headers/logbf4.h
newlib/libm/machine/spu/headers/logd2.h
newlib/libm/machine/spu/headers/logf4.h
newlib/libm/machine/spu/headers/nearbyintf4.h
newlib/libm/machine/spu/headers/nextafterd2.h
newlib/libm/machine/spu/headers/nextafterf4.h
newlib/libm/machine/spu/headers/powd2.h
newlib/libm/machine/spu/headers/powf4.h
newlib/libm/machine/spu/headers/recipd2.h
newlib/libm/machine/spu/headers/recipf4.h
newlib/libm/machine/spu/headers/rintf4.h
newlib/libm/machine/spu/headers/scalbnf4.h
newlib/libm/machine/spu/headers/signbitd2.h
newlib/libm/machine/spu/headers/simdmath.h
newlib/libm/machine/spu/headers/sincosd2.h
newlib/libm/machine/spu/headers/sincosf4.h
newlib/libm/machine/spu/headers/sind2.h
newlib/libm/machine/spu/headers/sinf4.h
newlib/libm/machine/spu/headers/sinhd2.h
newlib/libm/machine/spu/headers/sinhf4.h
newlib/libm/machine/spu/headers/sqrtd2.h
newlib/libm/machine/spu/headers/sqrtf4.h
newlib/libm/machine/spu/headers/tand2.h
newlib/libm/machine/spu/headers/tanf4.h
newlib/libm/machine/spu/headers/tanhd2.h
newlib/libm/machine/spu/headers/tanhf4.h
newlib/libm/machine/spu/headers/tgammad2.h
newlib/libm/machine/spu/headers/tgammaf4.h
newlib/libm/machine/spu/headers/truncd2.h
newlib/libm/machine/spu/headers/truncf4.h
src-release
Cherrypick from cygnus 1999-05-03 07:29:06 UTC Richard Henderson <rth@redhat.com> '19990502 sourceware import':
config/mh-armpic
config/mh-elfalphapic
config/mh-m68kpic
config/mh-papic
config/mh-ppcpic
config/mh-x86pic
Delete:
config/extensions.m4
config/futex.m4
config/mh-pa
config/mh-pa-hpux10
config/mt-mips-gnu
config/mt-mips16-compat
config/override.m4
config/proginstall.m4
config/tcl.m4
libgloss/bfin/basiccrt.S
libgloss/bfin/bf522.ld
libgloss/bfin/bf523.ld
libgloss/bfin/bf524.ld
libgloss/bfin/bf525.ld
libgloss/bfin/bf526.ld
libgloss/bfin/bf527.ld
libgloss/bfin/bf531.ld
libgloss/bfin/bf532.ld
libgloss/bfin/bf533.ld
libgloss/bfin/bf534.ld
libgloss/bfin/bf536.ld
libgloss/bfin/bf537.ld
libgloss/bfin/bf538.ld
libgloss/bfin/bf539.ld
libgloss/bfin/bf542.ld
libgloss/bfin/bf544.ld
libgloss/bfin/bf547.ld
libgloss/bfin/bf548.ld
libgloss/bfin/bf549.ld
libgloss/bfin/bf561.ld
libgloss/bfin/bf561a.ld
libgloss/bfin/bf561b.ld
libgloss/bfin/bf561m.ld
libgloss/bfin/bfin-common-mc.ld
libgloss/bfin/bfin-common-sc.ld
libgloss/bfin/include/blackfin.h
libgloss/bfin/include/cdefBF522.h
libgloss/bfin/include/cdefBF525.h
libgloss/bfin/include/cdefBF527.h
libgloss/bfin/include/cdefBF52x_base.h
libgloss/bfin/include/cdefBF531.h
libgloss/bfin/include/cdefBF532.h
libgloss/bfin/include/cdefBF533.h
libgloss/bfin/include/cdefBF534.h
libgloss/bfin/include/cdefBF535.h
libgloss/bfin/include/cdefBF536.h
libgloss/bfin/include/cdefBF537.h
libgloss/bfin/include/cdefBF538.h
libgloss/bfin/include/cdefBF539.h
libgloss/bfin/include/cdefBF53x.h
libgloss/bfin/include/cdefBF541.h
libgloss/bfin/include/cdefBF542.h
libgloss/bfin/include/cdefBF544.h
libgloss/bfin/include/cdefBF547.h
libgloss/bfin/include/cdefBF548.h
libgloss/bfin/include/cdefBF549.h
libgloss/bfin/include/cdefBF54x_base.h
libgloss/bfin/include/cdefBF561.h
libgloss/bfin/include/cdef_LPBlackfin.h
libgloss/bfin/include/cdefblackfin.h
libgloss/bfin/include/cplb.h
libgloss/bfin/include/cplbtab.h
libgloss/bfin/include/defBF522.h
libgloss/bfin/include/defBF525.h
libgloss/bfin/include/defBF527.h
libgloss/bfin/include/defBF52x_base.h
libgloss/bfin/include/defBF531.h
libgloss/bfin/include/defBF532.h
libgloss/bfin/include/defBF533.h
libgloss/bfin/include/defBF534.h
libgloss/bfin/include/defBF535.h
libgloss/bfin/include/defBF536.h
libgloss/bfin/include/defBF537.h
libgloss/bfin/include/defBF538.h
libgloss/bfin/include/defBF539.h
libgloss/bfin/include/defBF541.h
libgloss/bfin/include/defBF542.h
libgloss/bfin/include/defBF544.h
libgloss/bfin/include/defBF547.h
libgloss/bfin/include/defBF548.h
libgloss/bfin/include/defBF549.h
libgloss/bfin/include/defBF54x_base.h
libgloss/bfin/include/defBF561.h
libgloss/bfin/include/def_LPBlackfin.h
libgloss/bfin/include/defblackfin.h
libgloss/bfin/include/sys/_adi_platform.h
libgloss/bfin/include/sys/anomaly_macros_rtl.h
libgloss/bfin/include/sys/excause.h
libgloss/bfin/include/sys/exception.h
libgloss/bfin/include/sys/mc_typedef.h
libgloss/bfin/include/sys/platform.h
libgloss/bfin/include/sys/pll.h
libgloss/bfin/include/sysreg.h
libgloss/spu/linux_syscalls.c
libgloss/xstormy16/isatty.c
newlib/libc/machine/m68k/m68kasm.h
newlib/libc/machine/spu/assert.c
newlib/libc/machine/spu/impure.c
newlib/libc/machine/spu/include/spu_timer.h
newlib/libc/machine/spu/memcmp.c
newlib/libc/machine/spu/spu_clock_stop.c
newlib/libc/machine/spu/spu_clock_svcs.c
newlib/libc/machine/spu/spu_timebase.c
newlib/libc/machine/spu/spu_timer_flih.S
newlib/libc/machine/spu/spu_timer_free.c
newlib/libc/machine/spu/spu_timer_internal.h
newlib/libc/machine/spu/spu_timer_slih.c
newlib/libc/machine/spu/spu_timer_slih_reg.c
newlib/libc/machine/spu/spu_timer_stop.c
newlib/libc/machine/spu/spu_timer_svcs.c
newlib/libc/machine/spu/straddr.h
newlib/libc/machine/spu/strcpy.h
newlib/libc/machine/spu/strncmp.h
newlib/libc/machine/spu/sys/linux_syscalls.h
newlib/libc/posix/_isatty.c
newlib/libc/reent/isattyr.c
newlib/libc/string/memmem.c
newlib/libc/string/str-two-way.h
newlib/libc/sys/linux/isatty.c
newlib/libc/sys/linux/machine/i386/atomic.h
newlib/libc/sys/linux/net/XXX-lookup.c
newlib/libc/sys/linux/net/alias-lookup.c
newlib/libc/sys/linux/net/aliases.h
newlib/libc/sys/linux/net/check_pf.c
newlib/libc/sys/linux/net/databases.def
newlib/libc/sys/linux/net/digits_dots.c
newlib/libc/sys/linux/net/ether_aton.c
newlib/libc/sys/linux/net/ether_aton_r.c
newlib/libc/sys/linux/net/ether_hton.c
newlib/libc/sys/linux/net/ether_line.c
newlib/libc/sys/linux/net/ether_ntoa.c
newlib/libc/sys/linux/net/ether_ntoa_r.c
newlib/libc/sys/linux/net/ether_ntoh.c
newlib/libc/sys/linux/net/etherent.h
newlib/libc/sys/linux/net/ethers-lookup.c
newlib/libc/sys/linux/net/function.def
newlib/libc/sys/linux/net/getXXbyYY.c
newlib/libc/sys/linux/net/getXXbyYY_r.c
newlib/libc/sys/linux/net/getXXent.c
newlib/libc/sys/linux/net/getXXent_r.c
newlib/libc/sys/linux/net/getaliasent.c
newlib/libc/sys/linux/net/getaliasent_r.c
newlib/libc/sys/linux/net/getaliasname.c
newlib/libc/sys/linux/net/getaliasname_r.c
newlib/libc/sys/linux/net/gethstbyad.c
newlib/libc/sys/linux/net/gethstbyad_r.c
newlib/libc/sys/linux/net/gethstbynm.c
newlib/libc/sys/linux/net/gethstbynm2.c
newlib/libc/sys/linux/net/gethstbynm2_r.c
newlib/libc/sys/linux/net/gethstbynm_r.c
newlib/libc/sys/linux/net/gethstent.c
newlib/libc/sys/linux/net/gethstent_r.c
newlib/libc/sys/linux/net/getnetbyad.c
newlib/libc/sys/linux/net/getnetbyad_r.c
newlib/libc/sys/linux/net/getnetbynm.c
newlib/libc/sys/linux/net/getnetbynm_r.c
newlib/libc/sys/linux/net/getnetent.c
newlib/libc/sys/linux/net/getnetent_r.c
newlib/libc/sys/linux/net/getnetgrent.c
newlib/libc/sys/linux/net/getnetgrent_r.c
newlib/libc/sys/linux/net/getnssent.c
newlib/libc/sys/linux/net/getnssent_r.c
newlib/libc/sys/linux/net/getproto_r.c
newlib/libc/sys/linux/net/getprtent.c
newlib/libc/sys/linux/net/getprtent_r.c
newlib/libc/sys/linux/net/getprtname.c
newlib/libc/sys/linux/net/getprtname_r.c
newlib/libc/sys/linux/net/getrpcbyname.c
newlib/libc/sys/linux/net/getrpcbyname_r.c
newlib/libc/sys/linux/net/getrpcbynumber.c
newlib/libc/sys/linux/net/getrpcbynumber_r.c
newlib/libc/sys/linux/net/getrpcent.c
newlib/libc/sys/linux/net/getrpcent_r.c
newlib/libc/sys/linux/net/getservent_r.c
newlib/libc/sys/linux/net/getsrvbynm.c
newlib/libc/sys/linux/net/getsrvbynm_r.c
newlib/libc/sys/linux/net/getsrvbypt.c
newlib/libc/sys/linux/net/getsrvbypt_r.c
newlib/libc/sys/linux/net/grp-lookup.c
newlib/libc/sys/linux/net/herrno.c
newlib/libc/sys/linux/net/hosts-lookup.c
newlib/libc/sys/linux/net/ifaddrs.h
newlib/libc/sys/linux/net/ifreq.c
newlib/libc/sys/linux/net/ifreq.h
newlib/libc/sys/linux/net/in6_addr.c
newlib/libc/sys/linux/net/inet6_option.c
newlib/libc/sys/linux/net/inet_mkadr.c
newlib/libc/sys/linux/net/inet_net.c
newlib/libc/sys/linux/net/key-lookup.c
newlib/libc/sys/linux/net/local.h
newlib/libc/sys/linux/net/netgroup.h
newlib/libc/sys/linux/net/netgrp-lookup.c
newlib/libc/sys/linux/net/network-lookup.c
newlib/libc/sys/linux/net/not-cancel.h
newlib/libc/sys/linux/net/ns_samedomain.c
newlib/libc/sys/linux/net/nscd-types.h
newlib/libc/sys/linux/net/nscd/nscd-client.h
newlib/libc/sys/linux/net/nscd/nscd_proto.h
newlib/libc/sys/linux/net/nss.h
newlib/libc/sys/linux/net/nsswitch.c
newlib/libc/sys/linux/net/nsswitch.h
newlib/libc/sys/linux/net/opensock.c
newlib/libc/sys/linux/net/proto-lookup.c
newlib/libc/sys/linux/net/pwd-lookup.c
newlib/libc/sys/linux/net/res_debug.h
newlib/libc/sys/linux/net/res_hconf.c
newlib/libc/sys/linux/net/res_hconf.h
newlib/libc/sys/linux/net/res_libc.c
newlib/libc/sys/linux/net/rexec.c
newlib/libc/sys/linux/net/rpc-lookup.c
newlib/libc/sys/linux/net/ruserpass.c
newlib/libc/sys/linux/net/service-lookup.c
newlib/libc/sys/linux/net/spwd-lookup.c
newlib/libc/sys/linux/shlib-compat.h
newlib/libc/syscalls/sysisatty.c
newlib/testsuite/newlib.stdlib/size_max.c
newlib/testsuite/newlib.stdlib/stdlib.exp
Diffstat (limited to 'newlib/libc/stdlib')
-rw-r--r-- | newlib/libc/stdlib/envlock.h | 15 | ||||
-rw-r--r-- | newlib/libc/stdlib/gdtoa-hexnan.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdlib/getopt.c | 433 | ||||
-rw-r--r-- | newlib/libc/stdlib/mprec.h | 49 | ||||
-rw-r--r-- | newlib/libc/stdlib/strtod.c | 65 | ||||
-rw-r--r-- | newlib/libc/stdlib/wcsrtombs.c | 2 |
6 files changed, 262 insertions, 304 deletions
diff --git a/newlib/libc/stdlib/envlock.h b/newlib/libc/stdlib/envlock.h new file mode 100644 index 000000000..9bb6a813e --- /dev/null +++ b/newlib/libc/stdlib/envlock.h @@ -0,0 +1,15 @@ +/* envlock.h -- header file for env routines. */ + +#ifndef _INCLUDE_ENVLOCK_H_ +#define _INCLUDE_ENVLOCK_H_ + +#include <_ansi.h> +#include <sys/reent.h> + +#define ENV_LOCK __env_lock(reent_ptr) +#define ENV_UNLOCK __env_unlock(reent_ptr) + +void _EXFUN(__env_lock,(struct _reent *reent)); +void _EXFUN(__env_unlock,(struct _reent *reent)); + +#endif /* _INCLUDE_ENVLOCK_H_ */ diff --git a/newlib/libc/stdlib/gdtoa-hexnan.c b/newlib/libc/stdlib/gdtoa-hexnan.c index 189fb238d..058bbd17d 100644 --- a/newlib/libc/stdlib/gdtoa-hexnan.c +++ b/newlib/libc/stdlib/gdtoa-hexnan.c @@ -98,7 +98,7 @@ _DEFUN (hexnan, (sp, fpi, x0), } continue; } - if (/*(*/ c == ')') { + if (/*(*/ c == ')' && havedig) { *sp = s + 1; break; } diff --git a/newlib/libc/stdlib/getopt.c b/newlib/libc/stdlib/getopt.c index 944214d5f..06e378170 100644 --- a/newlib/libc/stdlib/getopt.c +++ b/newlib/libc/stdlib/getopt.c @@ -83,13 +83,10 @@ Gregory Pietsch's current e-mail address: gpietsch@comcast.net ****************************************************************************/ -#ifndef HAVE_GETOPT - /* include files */ #include <stdio.h> #include <stdlib.h> #include <string.h> -#define __need_getopt_newlib #include <getopt.h> /* macros */ @@ -103,19 +100,16 @@ typedef enum GETOPT_ORDERING_T } GETOPT_ORDERING_T; /* globally-defined variables */ -char *optarg = 0; +char *optarg = NULL; int optind = 0; int opterr = 1; int optopt = '?'; -/* static variables */ -static int optwhere = 0; - /* functions */ /* reverse_argv_elements: reverses num elements starting at argv */ static void -reverse_argv_elements (char **argv, int num) +reverse_argv_elements (char ** argv, int num) { int i; char *tmp; @@ -132,348 +126,281 @@ reverse_argv_elements (char **argv, int num) static void permute (char *const argv[], int len1, int len2) { - reverse_argv_elements ((char **) argv, len1); - reverse_argv_elements ((char **) argv, len1 + len2); - reverse_argv_elements ((char **) argv, len2); + reverse_argv_elements ((char **)argv, len1); + reverse_argv_elements ((char **)argv, len1 + len2); + reverse_argv_elements ((char **)argv, len2); } /* is_option: is this argv-element an option or the end of the option list? */ static int is_option (char *argv_element, int only) { - return ((argv_element == 0) - || (argv_element[0] == '-') || (only && argv_element[0] == '+')); -} - -/* read_globals: read the values from the globals into a getopt_data - structure */ -static void -read_globals (struct getopt_data *data) -{ - data->optarg = optarg; - data->optind = optind; - data->opterr = opterr; - data->optopt = optopt; - data->optwhere = optwhere; -} - -/* write_globals: write the values into the globals from a getopt_data - structure */ -static void -write_globals (struct getopt_data *data) -{ - optarg = data->optarg; - optind = data->optind; - opterr = data->opterr; - optopt = data->optopt; - optwhere = data->optwhere; + return ((argv_element == NULL) + || (argv_element[0] == '-') || (only && argv_element[0] == '+')); } /* getopt_internal: the function that does all the dirty work */ static int getopt_internal (int argc, char *const argv[], const char *shortopts, - const struct option *longopts, int *longind, int only, - struct getopt_data *data) + const struct option *longopts, int *longind, int only) { GETOPT_ORDERING_T ordering = PERMUTE; + static size_t optwhere = 0; size_t permute_from = 0; int num_nonopts = 0; int optindex = 0; size_t match_chars = 0; - char *possible_arg = 0; + char *possible_arg = NULL; int longopt_match = -1; int has_arg = -1; - char *cp = 0; + char *cp = NULL; int arg_next = 0; /* first, deal with silly parameters and easy stuff */ - if (argc == 0 || argv == 0 || (shortopts == 0 && longopts == 0) - || data->optind >= argc || argv[data->optind] == 0) + if (argc == 0 || argv == NULL || (shortopts == NULL && longopts == NULL)) return EOF; - if (strcmp (argv[data->optind], "--") == 0) + if (optind >= argc || argv[optind] == NULL) + return EOF; + if (strcmp (argv[optind], "--") == 0) { - data->optind++; + optind++; return EOF; } - /* if this is our first time through */ - if (data->optind == 0) - data->optind = data->optwhere = 1; + if (optind == 0) + optind = optwhere = 1; /* define ordering */ - if (shortopts != 0 && (*shortopts == '-' || *shortopts == '+')) + if (shortopts != NULL && (*shortopts == '-' || *shortopts == '+')) { ordering = (*shortopts == '-') ? RETURN_IN_ORDER : REQUIRE_ORDER; shortopts++; } else - ordering = (getenv ("POSIXLY_CORRECT") != 0) ? REQUIRE_ORDER : PERMUTE; + ordering = (getenv ("POSIXLY_CORRECT") != NULL) ? REQUIRE_ORDER : PERMUTE; /* * based on ordering, find our next option, if we're at the beginning of * one */ - if (data->optwhere == 1) + if (optwhere == 1) { switch (ordering) - { - default: /* shouldn't happen */ - case PERMUTE: - permute_from = data->optind; - num_nonopts = 0; - while (!is_option (argv[data->optind], only)) - { - data->optind++; - num_nonopts++; - } - if (argv[data->optind] == 0) - { - /* no more options */ - data->optind = permute_from; - return EOF; - } - else if (strcmp (argv[data->optind], "--") == 0) - { - /* no more options, but have to get `--' out of the way */ - permute (argv + permute_from, num_nonopts, 1); - data->optind = permute_from + 1; - return EOF; - } - break; - case RETURN_IN_ORDER: - if (!is_option (argv[data->optind], only)) - { - data->optarg = argv[data->optind++]; - return (data->optopt = 1); - } - break; - case REQUIRE_ORDER: - if (!is_option (argv[data->optind], only)) - return EOF; - break; - } + { + case PERMUTE: + permute_from = optind; + num_nonopts = 0; + while (!is_option (argv[optind], only)) + { + optind++; + num_nonopts++; + } + if (argv[optind] == NULL) + { + /* no more options */ + optind = permute_from; + return EOF; + } + else if (strcmp (argv[optind], "--") == 0) + { + /* no more options, but have to get `--' out of the way */ + permute (argv + permute_from, num_nonopts, 1); + optind = permute_from + 1; + return EOF; + } + break; + case RETURN_IN_ORDER: + if (!is_option (argv[optind], only)) + { + optarg = argv[optind++]; + return (optopt = 1); + } + break; + case REQUIRE_ORDER: + if (!is_option (argv[optind], only)) + return EOF; + break; + } } /* we've got an option, so parse it */ /* first, is it a long option? */ - if (longopts != 0 - && (memcmp (argv[data->optind], "--", 2) == 0 - || (only && argv[data->optind][0] == '+')) && data->optwhere == 1) + if (longopts != NULL + && (memcmp (argv[optind], "--", 2) == 0 + || (only && argv[optind][0] == '+')) && optwhere == 1) { /* handle long options */ - if (memcmp (argv[data->optind], "--", 2) == 0) - data->optwhere = 2; + if (memcmp (argv[optind], "--", 2) == 0) + optwhere = 2; longopt_match = -1; - possible_arg = strchr (argv[data->optind] + data->optwhere, '='); - if (possible_arg == 0) - { - /* no =, so next argv might be arg */ - match_chars = strlen (argv[data->optind]); - possible_arg = argv[data->optind] + match_chars; - match_chars = match_chars - data->optwhere; - } + possible_arg = strchr (argv[optind] + optwhere, '='); + if (possible_arg == NULL) + { + /* no =, so next argv might be arg */ + match_chars = strlen (argv[optind]); + possible_arg = argv[optind] + match_chars; + match_chars = match_chars - optwhere; + } else - match_chars = (possible_arg - argv[data->optind]) - data->optwhere; - for (optindex = 0; longopts[optindex].name != 0; ++optindex) - { - if (memcmp - (argv[data->optind] + data->optwhere, longopts[optindex].name, - match_chars) == 0) - { - /* do we have an exact match? */ - if (match_chars == (int) (strlen (longopts[optindex].name))) - { - longopt_match = optindex; - break; - } - /* do any characters match? */ - else - { - if (longopt_match < 0) - longopt_match = optindex; - else - { - /* we have ambiguous options */ - if (data->opterr) - fprintf (stderr, "%s: option `%s' is ambiguous " - "(could be `--%s' or `--%s')\n", - argv[0], - argv[data->optind], - longopts[longopt_match].name, - longopts[optindex].name); - return (data->optopt = '?'); - } - } - } - } + match_chars = (possible_arg - argv[optind]) - optwhere; + for (optindex = 0; longopts[optindex].name != NULL; optindex++) + { + if (memcmp (argv[optind] + optwhere, + longopts[optindex].name, match_chars) == 0) + { + /* do we have an exact match? */ + if (match_chars == (int) (strlen (longopts[optindex].name))) + { + longopt_match = optindex; + break; + } + /* do any characters match? */ + else + { + if (longopt_match < 0) + longopt_match = optindex; + else + { + /* we have ambiguous options */ + if (opterr) + fprintf (stderr, "%s: option `%s' is ambiguous " + "(could be `--%s' or `--%s')\n", + argv[0], + argv[optind], + longopts[longopt_match].name, + longopts[optindex].name); + return (optopt = '?'); + } + } + } + } if (longopt_match >= 0) - has_arg = longopts[longopt_match].has_arg; + has_arg = longopts[longopt_match].has_arg; } - /* if we didn't find a long option, is it a short option? */ - if (longopt_match < 0 && shortopts != 0) + if (longopt_match < 0 && shortopts != NULL) { - cp = strchr (shortopts, argv[data->optind][data->optwhere]); - if (cp == 0) - { - /* couldn't find option in shortopts */ - if (data->opterr) - fprintf (stderr, - "%s: invalid option -- `-%c'\n", - argv[0], argv[data->optind][data->optwhere]); - data->optwhere++; - if (argv[data->optind][data->optwhere] == '\0') - { - data->optind++; - data->optwhere = 1; - } - return (data->optopt = '?'); - } + cp = strchr (shortopts, argv[optind][optwhere]); + if (cp == NULL) + { + /* couldn't find option in shortopts */ + if (opterr) + fprintf (stderr, + "%s: invalid option -- `-%c'\n", + argv[0], argv[optind][optwhere]); + optwhere++; + if (argv[optind][optwhere] == '\0') + { + optind++; + optwhere = 1; + } + return (optopt = '?'); + } has_arg = ((cp[1] == ':') - ? ((cp[2] == ':') ? OPTIONAL_ARG : REQUIRED_ARG) : NO_ARG); - possible_arg = argv[data->optind] + data->optwhere + 1; - data->optopt = *cp; + ? ((cp[2] == ':') ? OPTIONAL_ARG : REQUIRED_ARG) : NO_ARG); + possible_arg = argv[optind] + optwhere + 1; + optopt = *cp; } - - /* get argument and reset data->optwhere */ + /* get argument and reset optwhere */ arg_next = 0; switch (has_arg) { case OPTIONAL_ARG: if (*possible_arg == '=') - possible_arg++; - data->optarg = (*possible_arg != '\0') ? possible_arg : 0; - data->optwhere = 1; + possible_arg++; + if (*possible_arg != '\0') + { + optarg = possible_arg; + optwhere = 1; + } + else + optarg = NULL; break; case REQUIRED_ARG: if (*possible_arg == '=') - possible_arg++; + possible_arg++; if (*possible_arg != '\0') - { - data->optarg = possible_arg; - data->optwhere = 1; - } - else if (data->optind + 1 >= argc) - { - if (data->opterr) - { - fprintf (stderr, "%s: argument required for option `", argv[0]); - if (longopt_match >= 0) - fprintf (stderr, "--%s'\n", longopts[longopt_match].name); - else - fprintf (stderr, "-%c'\n", *cp); - } - data->optind++; - return (data->optopt = ':'); - } + { + optarg = possible_arg; + optwhere = 1; + } + else if (optind + 1 >= argc) + { + if (opterr) + { + fprintf (stderr, "%s: argument required for option `", argv[0]); + if (longopt_match >= 0) + fprintf (stderr, "--%s'\n", longopts[longopt_match].name); + else + fprintf (stderr, "-%c'\n", *cp); + } + optind++; + return (optopt = ':'); + } else - { - data->optarg = argv[data->optind + 1]; - arg_next = 1; - data->optwhere = 1; - } + { + optarg = argv[optind + 1]; + arg_next = 1; + optwhere = 1; + } break; - default: /* shouldn't happen */ case NO_ARG: if (longopt_match < 0) - { - data->optwhere++; - if (argv[data->optind][data->optwhere] == '\0') - data->optwhere = 1; - } + { + optwhere++; + if (argv[optind][optwhere] == '\0') + optwhere = 1; + } else - data->optwhere = 1; - data->optarg = 0; + optwhere = 1; + optarg = NULL; break; } - /* do we have to permute or otherwise modify data->optind? */ - if (ordering == PERMUTE && data->optwhere == 1 && num_nonopts != 0) + /* do we have to permute or otherwise modify optind? */ + if (ordering == PERMUTE && optwhere == 1 && num_nonopts != 0) { permute (argv + permute_from, num_nonopts, 1 + arg_next); - data->optind = permute_from + 1 + arg_next; + optind = permute_from + 1 + arg_next; } - else if (data->optwhere == 1) - data->optind = data->optind + 1 + arg_next; + else if (optwhere == 1) + optind = optind + 1 + arg_next; /* finally return */ if (longopt_match >= 0) { - if (longind != 0) - *longind = longopt_match; - if (longopts[longopt_match].flag != 0) - { - *(longopts[longopt_match].flag) = longopts[longopt_match].val; - return 0; - } + if (longind != NULL) + *longind = longopt_match; + if (longopts[longopt_match].flag != NULL) + { + *(longopts[longopt_match].flag) = longopts[longopt_match].val; + return 0; + } else - return longopts[longopt_match].val; + return longopts[longopt_match].val; } else - return data->optopt; + return optopt; } int getopt (int argc, char *const argv[], const char *optstring) { - struct getopt_data data; - int r; - - read_globals (&data); - r = getopt_internal (argc, argv, optstring, 0, 0, 0, &data); - write_globals (&data); - return r; + return getopt_internal (argc, argv, optstring, NULL, NULL, 0); } int getopt_long (int argc, char *const argv[], const char *shortopts, - const struct option *longopts, int *longind) + const struct option *longopts, int *longind) { - struct getopt_data data; - int r; - - read_globals (&data); - r = getopt_internal (argc, argv, shortopts, longopts, longind, 0, &data); - write_globals (&data); - return r; + return getopt_internal (argc, argv, shortopts, longopts, longind, 0); } int getopt_long_only (int argc, char *const argv[], const char *shortopts, - const struct option *longopts, int *longind) -{ - struct getopt_data data; - int r; - - read_globals (&data); - r = getopt_internal (argc, argv, shortopts, longopts, longind, 1, &data); - write_globals (&data); - return r; -} - -int -__getopt_r (int argc, char *const argv[], const char *optstring, - struct getopt_data *data) -{ - return getopt_internal (argc, argv, optstring, 0, 0, 0, data); -} - -int -__getopt_long_r (int argc, char *const argv[], const char *shortopts, - const struct option *longopts, int *longind, - struct getopt_data *data) -{ - return getopt_internal (argc, argv, shortopts, longopts, longind, 0, data); -} - -int -__getopt_long_only_r (int argc, char *const argv[], const char *shortopts, - const struct option *longopts, int *longind, - struct getopt_data *data) + const struct option *longopts, int *longind) { - return getopt_internal (argc, argv, shortopts, longopts, longind, 1, data); + return getopt_internal (argc, argv, shortopts, longopts, longind, 1); } -#endif /* !HAVE_GETOPT */ - /* end of file GETOPT.C */ diff --git a/newlib/libc/stdlib/mprec.h b/newlib/libc/stdlib/mprec.h index dea89bf11..498de5b74 100644 --- a/newlib/libc/stdlib/mprec.h +++ b/newlib/libc/stdlib/mprec.h @@ -78,18 +78,31 @@ union double_union #define word1(x) (x.i[1]) #endif -/* The following is taken from gdtoaimp.h for use with new strtod, but - adjusted to avoid invalid type-punning. */ + +/* The following is taken from gdtoaimp.h for use with new strtod. */ typedef __int32_t Long; +typedef union { double d; __ULong L[2]; } U; -/* Unfortunately, because __ULong might be a different type than - __uint32_t, we can't re-use union double_union as-is without - further edits in strtod.c. */ -typedef union { double d; __ULong i[2]; } U; +#ifdef YES_ALIAS +#define dval(x) x +#ifdef IEEE_8087 +#define dword0(x) ((__ULong *)&x)[1] +#define dword1(x) ((__ULong *)&x)[0] +#else +#define dword0(x) ((__ULong *)&x)[0] +#define dword1(x) ((__ULong *)&x)[1] +#endif +#else /* !YES_ALIAS */ +#ifdef IEEE_8087 +#define dword0(x) ((U*)&x)->L[1] +#define dword1(x) ((U*)&x)->L[0] +#else +#define dword0(x) ((U*)&x)->L[0] +#define dword1(x) ((U*)&x)->L[1] +#endif +#define dval(x) ((U*)&x)->d +#endif /* YES_ALIAS */ -#define dword0(x) word0(x) -#define dword1(x) word1(x) -#define dval(x) (x.d) #undef SI #ifdef Sudden_Underflow @@ -98,7 +111,17 @@ typedef union { double d; __ULong i[2]; } U; #define SI 0 #endif -#define Storeinc(a,b,c) (*(a)++ = (b) << 16 | (c) & 0xffff) +/* The following definition of Storeinc is appropriate for MIPS processors. + * An alternative that might be better on some machines is + * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) + */ +#if defined (__IEEE_BYTES_LITTLE_ENDIAN) + defined (IEEE_8087) + defined (VAX) +#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \ +((unsigned short *)a)[0] = (unsigned short)c, a++) +#else +#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \ +((unsigned short *)a)[1] = (unsigned short)c, a++) +#endif /* #define P DBL_MANT_DIG */ /* Ten_pmax = floor(P*log(2)/log(5)) */ @@ -144,7 +167,11 @@ typedef union { double d; __ULong i[2]; } U; #define word0(x) (x.i[0]) #define word1(x) 0 -#define dword0(x) word0(x) +#ifdef YES_ALIAS +#define dword0(x) ((__ULong *)&x)[0] +#else +#define dword0(x) ((U*)&x)->L[0] +#endif #define dword1(x) 0 #else diff --git a/newlib/libc/stdlib/strtod.c b/newlib/libc/stdlib/strtod.c index 703fbce1d..e206d0587 100644 --- a/newlib/libc/stdlib/strtod.c +++ b/newlib/libc/stdlib/strtod.c @@ -14,7 +14,7 @@ ANSI_SYNOPSIS double strtod(const char *<[str]>, char **<[tail]>); float strtof(const char *<[str]>, char **<[tail]>); - double _strtod_r(void *<[reent]>, + double _strtod_r(void *<[reent]>, const char *<[str]>, char **<[tail]>); TRAD_SYNOPSIS @@ -37,19 +37,12 @@ DESCRIPTION producing a substring which can be converted to a double value. The substring converted is the longest initial subsequence of <[str]>, beginning with the first - non-whitespace character, that has one of these formats: - .[+|-]<[digits]>[.[<[digits]>]][(e|E)[+|-]<[digits]>] - .[+|-].<[digits]>[(e|E)[+|-]<[digits]>] - .[+|-](i|I)(n|N)(f|F)[(i|I)(n|N)(i|I)(t|T)(y|Y)] - .[+|-](n|N)(a|A)(n|N)[<(>[<[hexdigits]>]<)>] - .[+|-]0(x|X)<[hexdigits]>[.[<[hexdigits]>]][(p|P)[+|-]<[digits]>] - .[+|-]0(x|X).<[hexdigits]>[(p|P)[+|-]<[digits]>] + non-whitespace character, that has the format: + .[+|-]<[digits]>[.][<[digits]>][(e|E)[+|-]<[digits]>] The substring contains no characters if <[str]> is empty, consists entirely of whitespace, or if the first non-whitespace character is something other than <<+>>, <<->>, <<.>>, or a - digit, and cannot be parsed as infinity or NaN. If the platform - does not support NaN, then NaN is treated as an empty substring. - If the substring is empty, no conversion is done, and + digit. If the substring is empty, no conversion is done, and the value of <[str]> is stored in <<*<[tail]>>>. Otherwise, the substring is converted, and a pointer to the final string (which will contain at least the terminating null character of @@ -59,8 +52,7 @@ DESCRIPTION This implementation returns the nearest machine number to the input decimal string. Ties are broken by using the IEEE - round-even rule. However, <<strtof>> is currently subject to - double rounding errors. + round-even rule. The alternate function <<_strtod_r>> is a reentrant version. The extra argument <[reent]> is a pointer to a reentrancy structure. @@ -184,7 +176,7 @@ _DEFUN (ULtod, (L, bits, exp, k), L[_0] |= 0x80000000L; } #endif /* !NO_HEX_FP */ - + #ifdef INFNAN_CHECK static int _DEFUN (match, (sp, t), @@ -218,8 +210,7 @@ _DEFUN (_strtod_r, (ptr, s00, se), int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, decpt, dsign, e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; _CONST char *s, *s0, *s1; - double aadj, adj; - U aadj1, rv, rv0; + double aadj, aadj1, adj, rv, rv0; Long L; __ULong y, z; _Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; @@ -263,9 +254,6 @@ _DEFUN (_strtod_r, (ptr, s00, se), switch(s[1]) { case 'x': case 'X': - /* If the number is not hex, then the parse of - 0 is still valid. */ - s00 = s + 1; { #if defined(FE_DOWNWARD) && defined(FE_TONEAREST) && defined(FE_TOWARDZERO) && defined(FE_UPWARD) FPI fpi1 = fpi; @@ -280,6 +268,7 @@ _DEFUN (_strtod_r, (ptr, s00, se), switch((i = gethex(ptr, &s, &fpi1, &exp, &bb, sign)) & STRTOG_Retmask) { case STRTOG_NoNumber: s = s00; + sign = 0; case STRTOG_Zero: break; default: @@ -287,7 +276,7 @@ _DEFUN (_strtod_r, (ptr, s00, se), copybits(bits, fpi.nbits, bb); Bfree(ptr,bb); } - ULtod(rv.i, bits, exp, i); + ULtod(((U*)&rv)->L, bits, exp, i); }} goto ret; } @@ -470,7 +459,7 @@ _DEFUN (_strtod_r, (ptr, s00, se), #ifdef Honor_FLT_ROUNDS /* round correctly FLT_ROUNDS = 2 or 3 */ if (sign) { - dval(rv) = -dval(rv); + rv = -rv; sign = 0; } #endif @@ -486,7 +475,7 @@ _DEFUN (_strtod_r, (ptr, s00, se), #ifdef Honor_FLT_ROUNDS /* round correctly FLT_ROUNDS = 2 or 3 */ if (sign) { - dval(rv) = -dval(rv); + rv = -rv; sign = 0; } #endif @@ -514,7 +503,7 @@ _DEFUN (_strtod_r, (ptr, s00, se), #ifdef Honor_FLT_ROUNDS /* round correctly FLT_ROUNDS = 2 or 3 */ if (sign) { - dval(rv) = -dval(rv); + rv = -rv; sign = 0; } #endif @@ -977,14 +966,14 @@ _DEFUN (_strtod_r, (ptr, s00, se), } if ((aadj = ratio(delta, bs)) <= 2.) { if (dsign) - aadj = dval(aadj1) = 1.; + aadj = aadj1 = 1.; else if (dword1(rv) || dword0(rv) & Bndry_mask) { #ifndef Sudden_Underflow if (dword1(rv) == Tiny1 && !dword0(rv)) goto undfl; #endif aadj = 1.; - dval(aadj1) = -1.; + aadj1 = -1.; } else { /* special case -- power of FLT_RADIX to be */ @@ -994,24 +983,24 @@ _DEFUN (_strtod_r, (ptr, s00, se), aadj = 1./FLT_RADIX; else aadj *= 0.5; - dval(aadj1) = -aadj; + aadj1 = -aadj; } } else { aadj *= 0.5; - dval(aadj1) = dsign ? aadj : -aadj; + aadj1 = dsign ? aadj : -aadj; #ifdef Check_FLT_ROUNDS switch(Rounding) { case 2: /* towards +infinity */ - dval(aadj1) -= 0.5; + aadj1 -= 0.5; break; case 0: /* towards 0 */ case 3: /* towards -infinity */ - dval(aadj1) += 0.5; + aadj1 += 0.5; } #else if (Flt_Rounds == 0) - dval(aadj1) += 0.5; + aadj1 += 0.5; #endif /*Check_FLT_ROUNDS*/ } y = dword0(rv) & Exp_mask; @@ -1021,7 +1010,7 @@ _DEFUN (_strtod_r, (ptr, s00, se), if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) { dval(rv0) = dval(rv); dword0(rv) -= P*Exp_msk1; - adj = dval(aadj1) * ulp(dval(rv)); + adj = aadj1 * ulp(dval(rv)); dval(rv) += adj; if ((dword0(rv) & Exp_mask) >= Exp_msk1*(DBL_MAX_EXP+Bias-P)) { @@ -1043,18 +1032,18 @@ _DEFUN (_strtod_r, (ptr, s00, se), if ((z = aadj) <= 0) z = 1; aadj = z; - dval(aadj1) = dsign ? aadj : -aadj; + aadj1 = dsign ? aadj : -aadj; } dword0(aadj1) += (2*P+1)*Exp_msk1 - y; } - adj = dval(aadj1) * ulp(dval(rv)); + adj = aadj1 * ulp(dval(rv)); dval(rv) += adj; #else #ifdef Sudden_Underflow if ((dword0(rv) & Exp_mask) <= P*Exp_msk1) { dval(rv0) = dval(rv); dword0(rv) += P*Exp_msk1; - adj = dval(aadj1) * ulp(dval(rv)); + adj = aadj1 * ulp(dval(rv)); dval(rv) += adj; #ifdef IBM if ((dword0(rv) & Exp_mask) < P*Exp_msk1) @@ -1077,7 +1066,7 @@ _DEFUN (_strtod_r, (ptr, s00, se), dword0(rv) -= P*Exp_msk1; } else { - adj = dval(aadj1) * ulp(dval(rv)); + adj = aadj1 * ulp(dval(rv)); dval(rv) += adj; } #else /*Sudden_Underflow*/ @@ -1089,11 +1078,11 @@ _DEFUN (_strtod_r, (ptr, s00, se), * example: 1.2e-307 . */ if (y <= (P-1)*Exp_msk1 && aadj > 1.) { - dval(aadj1) = (double)(int)(aadj + 0.5); + aadj1 = (double)(int)(aadj + 0.5); if (!dsign) - dval(aadj1) = -dval(aadj1); + aadj1 = -aadj1; } - adj = dval(aadj1) * ulp(dval(rv)); + adj = aadj1 * ulp(dval(rv)); dval(rv) += adj; #endif /*Sudden_Underflow*/ #endif /*Avoid_Underflow*/ diff --git a/newlib/libc/stdlib/wcsrtombs.c b/newlib/libc/stdlib/wcsrtombs.c index a16d36cf6..6871d0c00 100644 --- a/newlib/libc/stdlib/wcsrtombs.c +++ b/newlib/libc/stdlib/wcsrtombs.c @@ -45,7 +45,7 @@ _DEFUN (_wcsrtombs_r, (r, dst, src, len, ps), ps->__count = 0; return (size_t)-1; } - if (n + bytes <= len) + if (n <= len - bytes && bytes < len) { n += bytes; if (dst) |