Changeset 3ecfa13 for libcfa/src/gmp.hfa
- Timestamp:
- Feb 8, 2020, 3:21:45 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8c9da33
- Parents:
- 0f5da65 (diff), 74330e7 (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. - File:
-
- 1 edited
-
libcfa/src/gmp.hfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/gmp.hfa
r0f5da65 r3ecfa13 10 10 // Created On : Tue Apr 19 08:43:43 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 13 15:25:05 201913 // Update Count : 2 712 // Last Modified On : Fri Feb 7 22:10:30 2020 13 // Update Count : 29 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.