Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/stdlib.c

    r52f85e0 rbd85400  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 10 15:45:56 2016
    13 // Update Count     : 140
     12// Last Modified On : Fri Feb  5 15:41:24 2016
     13// Update Count     : 128
    1414//
    1515
     
    2323#include <string.h>                                                                             // memset
    2424#include <malloc.h>                                                                             // malloc_usable_size
     25#include <stdio.h>
    2526#include <math.h>                                                                               // fabsf, fabs, fabsl
    2627#include <complex.h>                                                                    // _Complex_I, cabsf, cabs, cabsl
     
    105106long int ato( const char * ptr ) {
    106107        long int li;
    107         if ( sscanf( ptr, "%ld", &li ) == EOF ) {}                      // check return code
     108        if ( sscanf( ptr, "%ld", &li ) == EOF ) {};                     // check return code
    108109        return li;
    109110}
    110111unsigned long int ato( const char * ptr ) {
    111112        unsigned long int uli;
    112         if ( sscanf( ptr, "%lu", &uli ) == EOF ) {}                     // check return code
     113        if ( sscanf( ptr, "%lu", &uli ) == EOF ) {};            // check return code
    113114        return uli;
    114115}
    115116long long int ato( const char * ptr ) {
    116117        long long int lli;
    117         if ( sscanf( ptr, "%lld", &lli ) == EOF ) {}            // check return code
     118        if ( sscanf( ptr, "%lld", &lli ) == EOF ) {};           // check return code
    118119        return lli;
    119120}
    120121unsigned long long int ato( const char * ptr ) {
    121122        unsigned long long int ulli;
    122         if ( sscanf( ptr, "%llu", &ulli ) == EOF ) {}           // check return code
     123        if ( sscanf( ptr, "%llu", &ulli ) == EOF ) {};          // check return code
    123124        return ulli;
    124125}
    125126float ato( const char * ptr ) {
    126127        float f;
    127         if ( sscanf( ptr, "%f", &f ) == EOF ) {}                        // check return code
     128        if ( sscanf( ptr, "%f", &f ) == EOF ) {};                       // check return code
    128129        return f;
    129130}
    130131double ato( const char * ptr ) {
    131132        double d;
    132         if ( sscanf( ptr, "%lf", &d ) == EOF ) {}                       // check return code
     133        if ( sscanf( ptr, "%lf", &d ) == EOF ) {};                      // check return code
    133134        return d;
    134135}
    135136long double ato( const char * ptr ) {
    136137        long double ld;
    137         if ( sscanf( ptr, "%Lf", &ld ) == EOF ) {}                      // check return code
     138        printf( "FRED " );
     139        if ( sscanf( ptr, "%.32Lf", &ld ) == EOF ) {};          // check return code
    138140        return ld;
    139141}
    140142float _Complex ato( const char * ptr ) {
    141143        float re, im;
    142         if ( sscanf( ptr, "%g%gi", &re, &im ) == EOF ) {}       // check return code
     144        if ( sscanf( ptr, "%g%g", &re, &im ) == EOF ) {};       // check return code
    143145        return re + im * _Complex_I;
    144146}
    145147double _Complex ato( const char * ptr ) {
    146148        double re, im;
    147         if ( sscanf( ptr, "%lf%lfi", &re, &im ) == EOF ) {} // check return code
     149        if ( sscanf( ptr, "%.16lg%.16lg", &re, &im ) == EOF ) {}; // check return code
    148150        return re + im * _Complex_I;
    149151}
    150152long double _Complex ato( const char * ptr ) {
    151153        long double re, im;
    152         if ( sscanf( ptr, "%Lf%Lfi", &re, &im ) == EOF ) {}     // check return code
     154        if ( sscanf( ptr, "%.32Lg%.32Lg", &re, &im ) == EOF ) {}; // check return code
    153155        return re + im * _Complex_I;
    154156}       
Note: See TracChangeset for help on using the changeset viewer.