Changeset 1871


Ignore:
Timestamp:
Mar 14, 2005, 5:51:09 AM (20 years ago)
Author:
bird
Message:

kicked the old atod implementation (asserts on simple '-30' conversion).

Location:
trunk/src/emx
Files:
5 added
5 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/CompileOne.sh

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r1870 r1871  
    1010   gcc -c -O3 -o $TMP/compileO3.o -fmessage-length=0 -std=gnu99 -Wundef -Wall -Wmissing-prototypes -pedantic -Wno-long-long \
    1111    -DIN_INNOTEK_LIBC -D_NFILES=20 -DHAVE_CONFIG_H \
    12     -I$SRCDIR -I$ROOTDIR/include -I$ROOTDIR/src/include -I$OUTDIR/emx -I$ROOTDIR/src/lib/lgpl/include $1 \
     12    -I$SRCDIR -I$ROOTDIR/include -I$ROOTDIR/src/include -I$ROOTDIR/src/lib/bsd/include -I$OUTDIR/emx -I$ROOTDIR/src/lib/lgpl/include $1 \
    1313&& gcc -c -O3 -o $TMP/compileLg.o -fmessage-length=0 -std=gnu99 -Wundef -Wall -Wmissing-prototypes -pedantic -Wno-long-long \
    1414    -DIN_INNOTEK_LIBC -D_NFILES=20 -DHAVE_CONFIG_H -DDEBUG_LOGGING -D__LIBC_STRICT \
    15     -I$SRCDIR -I$ROOTDIR/include -I$ROOTDIR/src/include -I$OUTDIR/emx -I$ROOTDIR/src/lib/lgpl/include $1 \
     15    -I$SRCDIR -I$ROOTDIR/include -I$ROOTDIR/src/include -I$ROOTDIR/src/lib/bsd/include -I$OUTDIR/emx -I$ROOTDIR/src/lib/lgpl/include $1 \
    1616&& echo succesfully built $1
  • trunk/src/emx/Makefile.gmk

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1870 r1871  
    9797endif
    9898CFLAGS.INC  += -Isrc/include
     99CFLAGS.INC  += -Isrc/lib/bsd/include
    99100CFLAGS      = -Wall -Wundef -Wmissing-prototypes -mstack-arg-probe $(CFLAGS.INC) $(CFLAGS.$(MODE)) $(CFLAGS.KIND)
    100101# The additional C compiler flags for different build modes
  • trunk/src/emx/include/emx/float.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1870 r1871  
    2626#define DTOA_GCVT       3
    2727
    28 const char * __atod (long double *p_result, const char *string,
    29                      int min_exp, int max_exp, int bias,
    30                      int mant_dig, int decimal_dig,
    31                      int max_10_exp, int min_den_10_exp);
     28const char * __legacy_atod (long double *p_result, const char *string,
     29                            int min_exp, int max_exp, int bias,
     30                            int mant_dig, int decimal_dig,
     31                            int max_10_exp, int min_den_10_exp);
    3232
    33 char *__dtoa (char *buffer, int *p_exp, long double x, int ndigits,
    34               int fmt, int dig);
     33char *__legacy_dtoa (char *buffer, int *p_exp, long double x, int ndigits,
     34                     int fmt, int dig);
    3535
    3636void __remove_zeros (char *digits, int keep);
  • trunk/src/emx/src/lib/bsd/gdtoa/gdtoaimp.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1870 r1871  
    178178#ifndef GDTOAIMP_H_INCLUDED
    179179#define GDTOAIMP_H_INCLUDED
     180#ifdef __EMX__
     181#include "namespace.h"
     182#endif
    180183#include "gdtoa.h"
    181184
     
    191194
    192195#include "namespace.h"
     196#ifdef __EMX__
     197#include <386/builtin.h>
     198#include <sys/fmutex.h>
     199#else /* !__EMX__ */
    193200#include <pthread.h>
     201#endif /* !__EMX__ */
    194202#include "un-namespace.h"
    195203
     
    470478
    471479#define MULTIPLE_THREADS
     480#ifdef __EMX__
     481extern _fmutex __libc_gdtoa_locks[2];
     482#define ACQUIRE_DTOA_LOCK(n)    do {                            \
     483    if (__libc_gdtoa_locks[n].fs == _FMS_UNINIT)                     \
     484        _fmutex_checked_create2(&__libc_gdtoa_locks[n], 0, "gdtoa lock no." #n); \
     485    _fmutex_checked_request(&__libc_gdtoa_locks[n], 0);              \
     486} while(0)
     487#define FREE_DTOA_LOCK(n)       do {                            \
     488    _fmutex_checked_release(&__libc_gdtoa_locks[n]);                 \
     489} while(0)
     490#else /* !__EMX__ */
    472491extern pthread_mutex_t __gdtoa_locks[2];
    473492#define ACQUIRE_DTOA_LOCK(n)    do {                            \
     
    479498                _pthread_mutex_unlock(&__gdtoa_locks[n]);       \
    480499} while(0)
     500#endif /* !__EMX__ */
    481501
    482502#define Kmax 15
     
    631651 extern int strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*));
    632652
     653#ifdef __EMX__
     654 extern char*   g_ddfmt  ANSI((char*, double*, int, unsigned));
     655 extern char*   g_dfmt   ANSI((char*, double*, int, unsigned));
     656 extern char*   g_ffmt   ANSI((char*, float*,  int, unsigned));
     657 extern char*   g_Qfmt   ANSI((char*, void*,   int, unsigned));
     658 extern char*   g_xfmt   ANSI((char*, void*,   int, unsigned));
     659 extern char*   g_xLfmt  ANSI((char*, void*,   int, unsigned));
     660#endif /* __EMX__ */
     661
    633662 extern int strtoId ANSI((CONST char *, char **, double *, double *));
    634663 extern int strtoIdd ANSI((CONST char *, char **, double *, double *));
  • trunk/src/emx/src/lib/bsd/gdtoa/glue/_hdtoa.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1870 r1871  
    2828__FBSDID("$FreeBSD: src/lib/libc/gdtoa/_hdtoa.c,v 1.2 2004/01/21 04:51:50 grehan Exp $");
    2929
     30#ifdef __EMX__
     31#include "namespace.h"
     32#endif
    3033#include <float.h>
    3134#include <inttypes.h>
     
    3437#include <stdlib.h>
    3538#include "fpmath.h"
     39#ifdef __EMX__
     40#include "../gdtoaimp.h"
     41#else
    3642#include "gdtoaimp.h"
     43#endif
    3744
    3845/* Strings values used by dtoa() */
  • trunk/src/emx/src/lib/bsd/gdtoa/glue/_ldtoa.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1870 r1871  
    2828__FBSDID("$FreeBSD: src/lib/libc/gdtoa/_ldtoa.c,v 1.2 2004/01/18 07:53:49 das Exp $");
    2929
     30#ifdef __EMX__
     31#include "namespace.h"
     32#endif
    3033#include <float.h>
    3134#include <inttypes.h>
     
    3437#include <stdlib.h>
    3538#include "fpmath.h"
     39#ifdef __EMX__
     40#include "../gdtoaimp.h"
     41#else
    3642#include "gdtoaimp.h"
     43#endif
    3744
    3845/*
  • trunk/src/emx/src/lib/bsd/gdtoa/glue/glue.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1870 r1871  
    66 */
    77
     8#ifdef __EMX__
     9
     10#include <386/builtin.h>
     11#include <sys/fmutex.h>
     12_fmutex __libc_gdtoa_locks[2] = {0};
     13
     14#else
     15
    816#include <pthread.h>
    917
     
    1220        PTHREAD_MUTEX_INITIALIZER
    1321};
     22#endif
  • trunk/src/emx/src/lib/bsd/gdtoa/glue/machdep_ldisQ.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1870 r1871  
    3434__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisQ.c,v 1.2 2003/04/09 05:58:43 das Exp $");
    3535
     36#ifdef __EMX__
     37#include "../gdtoaimp.h"
     38#else
    3639#include "gdtoaimp.h"
     40#endif
    3741
    3842long double
  • trunk/src/emx/src/lib/bsd/gdtoa/glue/machdep_ldisd.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1870 r1871  
    3434__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisd.c,v 1.1 2003/03/12 20:29:58 das Exp $");
    3535
     36#ifdef __EMX__
     37#include "../gdtoaimp.h"
     38#else
    3639#include "gdtoaimp.h"
     40#endif
    3741
    3842long double
  • trunk/src/emx/src/lib/bsd/gdtoa/glue/machdep_ldisx.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1870 r1871  
    3434__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisx.c,v 1.2 2003/04/09 05:58:43 das Exp $");
    3535
     36#ifdef __EMX__
     37#include "../gdtoaimp.h"
     38#else
    3639#include "gdtoaimp.h"
     40#endif
    3741
    3842long double
    39 strtold(const char * __restrict s, char ** __restrict sp)
     43_STD(strtold)(const char * __restrict s, char ** __restrict sp)
    4044{
    4145        long double result;
  • trunk/src/emx/src/lib/bsd/gdtoa/strtod.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1870 r1871  
    5959
    6060 double
     61#ifdef __EMX__
     62_STD(strtod)
     63#else
    6164strtod
     65#endif
    6266#ifdef KR_headers
    6367        (s00, se) CONST char *s00; char **se;
  • trunk/src/emx/src/lib/bsd/gdtoa/strtof.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1870 r1871  
    3737
    3838#include "gdtoaimp.h"
     39#include <stdlib.h>
    3940
    4041 float
    4142#ifdef KR_headers
    42 strtof(s, sp) CONST char *s; char **sp;
     43_STD(strtof)(s, sp) CONST char *s; char **sp;
    4344#else
    44 strtof(CONST char *s, char **sp)
     45_STD(strtof)(CONST char *s, char **sp)
    4546#endif
    4647{
  • trunk/src/emx/src/lib/conv/gcvt.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1870 r1871  
    7070  /* Compute a string of digits and an exponent for the number. */
    7171
    72   str = __dtoa (digstr, &xp, x, digits, DTOA_GCVT, DBL_DIG);
     72  str = __legacy_dtoa (digstr, &xp, x, digits, DTOA_GCVT, DBL_DIG);
    7373  __remove_zeros (str, 1);
    7474
  • trunk/src/emx/src/lib/io/_output.c

    • Property cvs2svn:cvs-rev changed from 1.6 to 1.7
    r1870 r1871  
    546546      int xp;
    547547
    548       p = __dtoa (digits, &xp, x, v->prec, DTOA_PRINTF_F, v->dig);
     548      p = __legacy_dtoa (digits, &xp, x, v->prec, DTOA_PRINTF_F, v->dig);
    549549      return cvt_fixed_digits (v, p, xp, is_neg, FALSE);
    550550    }
     
    570570      int xp;
    571571
    572       p = __dtoa (digits, &xp, x, v->prec, DTOA_PRINTF_E, v->dig);
     572      p = __legacy_dtoa (digits, &xp, x, v->prec, DTOA_PRINTF_E, v->dig);
    573573      return cvt_exp_digits (v, p, xp, is_neg, xp_char, FALSE);
    574574    }
     
    587587    v->prec = 1;
    588588
    589   /* 0.0 is treated specially as __dtoa() etc. cannot handle that
     589  /* 0.0 is treated specially as __legacy_dtoa() etc. cannot handle that
    590590     case. */
    591591
     
    598598      int xp;
    599599
    600       p = __dtoa (digits, &xp, x, v->prec, DTOA_PRINTF_G, v->dig);
     600      p = __legacy_dtoa (digits, &xp, x, v->prec, DTOA_PRINTF_G, v->dig);
    601601
    602602      /* If the exponent (of "%e" format) is less than -4 or greater
  • trunk/src/emx/src/lib/libc.def

    • Property cvs2svn:cvs-rev changed from 1.94 to 1.95
    r1870 r1871  
    179179    "___argz_replace" @193
    180180    "___argz_stringify" @194
    181     "___atod" @195
     181    "___legacy_atod" @195
    182182    "___big_delete" @196
    183183    "___big_insert" @197
     
    219219    "___dbpanic" @233
    220220    "___delpair" @234
    221     "___dtoa" @235
     221    "___legacy_dtoa" @235
    222222    "___dup" @236
    223223    "___dup2" @237
     
    14011401    "___textdomain" @1411
    14021402    "__nl_locale_name" @1412
     1403    ;; gdtoa
     1404    "___Balloc_D2A" @1413
     1405    "___Bfree_D2A" @1414
     1406    "___ULtoQ_D2A" @1415
     1407    "___ULtod_D2A" @1416
     1408    "___ULtodd_D2A" @1417
     1409    "___ULtof_D2A" @1418
     1410    "___ULtox_D2A" @1419
     1411    "___ULtoxL_D2A" @1420
     1412    "___any_on_D2A" @1421
     1413    "___b2d_D2A" @1422
     1414    "___bigtens_D2A" @1423
     1415    "___cmp_D2A" @1424
     1416    "___copybits_D2A" @1425
     1417    "___d2b_D2A" @1426
     1418    "___decrement_D2A" @1427
     1419    "___diff_D2A" @1428
     1420    "___freedtoa" @1429
     1421    "___g_Qfmt" @1430
     1422    "___g_ddfmt" @1431
     1423    "___g_dfmt" @1432
     1424    "___gdtoa" @1433
     1425    "___gethex_D2A" @1434
     1426    "___g_ffmt" @1435
     1427    "___g__fmt_D2A" @1436
     1428    "___g_xLfmt" @1437
     1429    "___g_xfmt" @1438
     1430    "___hdtoa" @1439
     1431    "___hexdig_D2A" @1440
     1432    "___hexdig_init_D2A" @1441
     1433    "___hexnan_D2A" @1442
     1434    "___hi0bits_D2A" @1443
     1435    "___hldtoa" @1444
     1436    "___i2b_D2A" @1445
     1437    "___increment_D2A" @1446
     1438    "___ldtoa" @1447
     1439    "___lo0bits_D2A" @1448
     1440    "___lshift_D2A" @1449
     1441    "___match_D2A" @1450
     1442    "___mult_D2A" @1451
     1443    "___multadd_D2A" @1452
     1444    "___nrv_alloc_D2A" @1453
     1445    "___pow5mult_D2A" @1454
     1446    "___quorem_D2A" @1455
     1447    "___ratio_D2A" @1456
     1448    "___rshift_D2A" @1457
     1449    "___rv_alloc_D2A" @1458
     1450    "___s2b_D2A" @1459
     1451    "___set_ones_D2A" @1460
     1452    "___strcp_D2A" @1461
     1453    "___strtoIQ" @1462
     1454    "___strtoId" @1463
     1455    "___strtoIdd" @1464
     1456    "___strtoIf" @1465
     1457    "___strtoIg_D2A" @1466
     1458    "___strtoIx" @1467
     1459    "___strtoIxL" @1468
     1460    "___strtodI" @1469
     1461    "___strtodg" @1470
     1462    "___strtopQ" @1471
     1463    "___strtopd" @1472
     1464    "___strtopdd" @1473
     1465    "___strtopf" @1474
     1466    "___strtopx" @1475
     1467    "___strtopxL" @1476
     1468    "___strtorQ" @1477
     1469    "___strtord" @1478
     1470    "___strtordd" @1479
     1471    "___strtorf" @1480
     1472    "___strtorx" @1481
     1473    "___strtorxL" @1482
     1474    "___sum_D2A" @1483
     1475    "___tens_D2A" @1484
     1476    "___tinytens_D2A" @1485
     1477    "___trailz_D2A" @1486
     1478    "___ulp_D2A" @1487
     1479    "___dtoa" @1488
  • trunk/src/emx/src/lib/libc.smak

    • Property cvs2svn:cvs-rev changed from 1.57 to 1.58
    r1870 r1871  
    391391libc.TDEP.$(CPU) :=
    392392libc.TDEP :=
     393
     394
     395#
     396# Forwarder DLLs for backward compatibility.
     397#                       
     398$.omf/fwdstub.obj: src/lib/fwdstub.asm
     399        $(call DO.COMPILE.asm)
     400       
     401$.omf/libc06b4.dll: src/lib/libc06b4.def $.omf/fwdstub.obj $.omf/libc_dll.lib
     402        gcc -Zomf -o $@ -nostdlib -Zdll $^
     403$(INS)lib/libc06b4.dll: $.omf/libc06b4.dll
     404        $(call CP,$<,$@)
     405INS.FILES += $(INS)lib/libc06b4.dll
     406libc-dll: $.omf/libc06b4.dll
Note: See TracChangeset for help on using the changeset viewer.