Changes in / [f6bbc92:1d8a349]
- Location:
- libcfa/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/enum.cfa
rf6bbc92 r1d8a349 11 11 // It is okay to overflow as overflow will be theoretically caught by the other bound 12 12 if ( i < fromInstance( lower ) || i > fromInstance( upper ) ) 13 abort( "call to fromInt has index %d outside of enumeration range %d-%d.",13 abort( "call to fromInt has index %d outside enumeration range %d-%d", 14 14 i, fromInstance( lower ), fromInstance( upper ) ); 15 15 return fromInt_unsafe( i ); … … 19 19 E upper = upperBound(); 20 20 if ( fromInstance( e ) >= fromInstance( upper ) ) 21 abort( "call to succ() exceeds enumeration upper bound of %d .", fromInstance( upper ) );21 abort( "call to succ() exceeds enumeration upper bound of %d", fromInstance( upper ) ); 22 22 return succ_unsafe(e); 23 23 } … … 26 26 E lower = lowerBound(); 27 27 if ( fromInstance( e ) <= fromInstance(lower ) ) 28 abort( "call to pred() exceeds enumeration lower bound of %d .", fromInstance( lower ) );28 abort( "call to pred() exceeds enumeration lower bound of %d", fromInstance( lower ) ); 29 29 return pred_unsafe( e ); 30 30 } 31 31 32 int Countof( E) {32 int Countof( __attribute__((unused)) E e ) { 33 33 E upper = upperBound(); 34 34 E lower = lowerBound(); -
libcfa/src/enum.hfa
rf6bbc92 r1d8a349 19 19 E succ( E e ); 20 20 E pred( E e ); 21 int Countof( E );21 int Countof( E e ); 22 22 } 23 23
Note: See TracChangeset
for help on using the changeset viewer.