Ignore:
Timestamp:
Aug 31, 2023, 11:31:15 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
950c58e
Parents:
92355883 (diff), 686912c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Resolve conflict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/stdlib.hfa

    r92355883 r2a301ff  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  2 11:30:04 2023
    13 // Update Count     : 766
     12// Last Modified On : Mon Aug 14 18:19:12 2023
     13// Update Count     : 777
    1414//
    1515
     
    1919#include "bits/align.hfa"                                                               // libAlign
    2020#include "bits/random.hfa"                                                              // prng
     21#include <Exception.hfa>
     22#include <heap.hfa>
    2123
    2224#include <stdlib.h>                                                                             // *alloc, strto*, ato*
    23 #include <heap.hfa>
    24 
     25#include <errno.h>
    2526
    2627// Reduce includes by explicitly defining these routines.
     
    294295
    295296static inline {
    296         int strto( const char sptr[], char ** eptr, int base ) { return (int)strtol( sptr, eptr, base ); }
    297         unsigned int strto( const char sptr[], char ** eptr, int base ) { return (unsigned int)strtoul( sptr, eptr, base ); }
    298         long int strto( const char sptr[], char ** eptr, int base ) { return strtol( sptr, eptr, base ); }
    299         unsigned long int strto( const char sptr[], char ** eptr, int base ) { return strtoul( sptr, eptr, base ); }
    300         long long int strto( const char sptr[], char ** eptr, int base ) { return strtoll( sptr, eptr, base ); }
    301         unsigned long long int strto( const char sptr[], char ** eptr, int base ) { return strtoull( sptr, eptr, base ); }
    302 
    303         float strto( const char sptr[], char ** eptr ) { return strtof( sptr, eptr ); }
    304         double strto( const char sptr[], char ** eptr ) { return strtod( sptr, eptr ); }
    305         long double strto( const char sptr[], char ** eptr ) { return strtold( sptr, eptr ); }
    306 } // distribution
    307 
    308 float _Complex strto( const char sptr[], char ** eptr );
    309 double _Complex strto( const char sptr[], char ** eptr );
    310 long double _Complex strto( const char sptr[], char ** eptr );
     297        int strto( const char sptr[], char * eptr[], int base ) { return (int)strtol( sptr, eptr, base ); }
     298        unsigned int strto( const char sptr[], char * eptr[], int base ) { return (unsigned int)strtoul( sptr, eptr, base ); }
     299        long int strto( const char sptr[], char * eptr[], int base ) { return strtol( sptr, eptr, base ); }
     300        unsigned long int strto( const char sptr[], char * eptr[], int base ) { return strtoul( sptr, eptr, base ); }
     301        long long int strto( const char sptr[], char * eptr[], int base ) { return strtoll( sptr, eptr, base ); }
     302        unsigned long long int strto( const char sptr[], char * eptr[], int base ) { return strtoull( sptr, eptr, base ); }
     303
     304        float strto( const char sptr[], char * eptr[] ) { return strtof( sptr, eptr ); }
     305        double strto( const char sptr[], char * eptr[] ) { return strtod( sptr, eptr ); }
     306        long double strto( const char sptr[], char * eptr[] ) { return strtold( sptr, eptr ); }
     307} // distribution
     308
     309float _Complex strto( const char sptr[], char * eptr[] );
     310double _Complex strto( const char sptr[], char * eptr[] );
     311long double _Complex strto( const char sptr[], char * eptr[] );
     312
     313ExceptionDecl( out_of_range );
     314ExceptionDecl( invalid_argument );
     315
     316forall( T | { T strto( const char sptr[], char * eptr[], int ); } )
     317T convert( const char sptr[] );
    311318
    312319static inline {
     
    454461} // distribution
    455462
     463// Set default random-generator size.
     464#if defined( __x86_64__ ) || defined( __aarch64__ )             // 64-bit architecture
     465#define PRNG PRNG64
     466#else                                                                                                   // 32-bit architecture
     467#define PRNG PRNG32
     468#endif // __x86_64__
     469
    456470// Concurrent Pseudo Random-Number Generator : generate repeatable sequence of values that appear random.
    457471//
Note: See TracChangeset for help on using the changeset viewer.