Changes in libcfa/src/stdlib.cfa [b5e725a:f8729be]
- File:
-
- 1 edited
-
libcfa/src/stdlib.cfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/stdlib.cfa
rb5e725a rf8729be 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 14 18:22:36202313 // Update Count : 6 4212 // Last Modified On : Thu Feb 16 16:31:34 2023 13 // Update Count : 633 14 14 // 15 15 … … 65 65 //--------------------------------------- 66 66 67 forall( T | { T strto( const char sptr[], char * eptr[], int ); } ) 68 T convert( const char sptr[] ) { 69 char * eptr; 70 errno = 0; // reset 71 T val = strto( sptr, &eptr, 10 ); // attempt conversion 72 if ( errno == ERANGE ) throw ExceptionInst( out_of_range ); 73 if ( eptr == sptr || // conversion failed, no characters generated 74 *eptr != '\0' ) throw ExceptionInst( invalid_argument ); // not at end of str ? 75 return val; 76 } // convert 77 78 float _Complex strto( const char sptr[], char * eptr[] ) { 67 float _Complex strto( const char sptr[], char ** eptr ) { 79 68 float re, im; 80 69 char * eeptr; … … 87 76 } // strto 88 77 89 double _Complex strto( const char sptr[], char * eptr[]) {78 double _Complex strto( const char sptr[], char ** eptr ) { 90 79 double re, im; 91 80 char * eeptr; … … 98 87 } // strto 99 88 100 long double _Complex strto( const char sptr[], char * eptr[]) {89 long double _Complex strto( const char sptr[], char ** eptr ) { 101 90 long double re, im; 102 91 char * eeptr;
Note:
See TracChangeset
for help on using the changeset viewer.