Changes in libcfa/src/gmp.hfa [d1a9ff5:ff2a33e]
- File:
-
- 1 edited
-
libcfa/src/gmp.hfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/gmp.hfa
rd1a9ff5 rff2a33e 10 10 // Created On : Tue Apr 19 08:43:43 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Feb 7 22:10:30 202013 // Update Count : 2 912 // Last Modified On : Sat Jul 13 15:25:05 2019 13 // Update Count : 27 14 14 // 15 15 … … 31 31 void ?{}( Int & this, signed long int init ) { mpz_init_set_si( this.mpz, init ); } 32 32 void ?{}( Int & this, unsigned long int init ) { mpz_init_set_ui( this.mpz, init ); } 33 void ?{}( Int & this, const char val[]) { if ( mpz_init_set_str( this.mpz, val, 0 ) ) abort(); }33 void ?{}( Int & this, const char * val ) { if ( mpz_init_set_str( this.mpz, val, 0 ) ) abort(); } 34 34 void ^?{}( Int & this ) { mpz_clear( this.mpz ); } 35 35 … … 37 37 Int ?`mp( signed long int init ) { return (Int){ init }; } 38 38 Int ?`mp( unsigned long int init ) { return (Int){ init }; } 39 Int ?`mp( const char init[]) { return (Int){ init }; }39 Int ?`mp( const char * init ) { return (Int){ init }; } 40 40 41 41 // assignment … … 43 43 Int ?=?( Int & lhs, long int rhs ) { mpz_set_si( lhs.mpz, rhs ); return lhs; } 44 44 Int ?=?( Int & lhs, unsigned long int rhs ) { mpz_set_ui( lhs.mpz, rhs ); return lhs; } 45 Int ?=?( Int & lhs, const char rhs[]) { if ( mpz_set_str( lhs.mpz, rhs, 0 ) ) { abort | "invalid string conversion"; } return lhs; }45 Int ?=?( Int & lhs, const char * rhs ) { if ( mpz_set_str( lhs.mpz, rhs, 0 ) ) { abort | "invalid string conversion"; } return lhs; } 46 46 47 47 char ?=?( char & lhs, Int rhs ) { char val = mpz_get_si( rhs.mpz ); lhs = val; return lhs; } … … 265 265 forall( dtype ostype | ostream( ostype ) ) { 266 266 ostype & ?|?( ostype & os, Int mp ) { 267 if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) );267 if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) ); 268 268 gmp_printf( "%Zd", mp.mpz ); 269 269 sepOn( os );
Note:
See TracChangeset
for help on using the changeset viewer.