- Timestamp:
- Aug 7, 2024, 6:48:39 AM (4 months ago)
- Branches:
- master
- Children:
- f6bbc92
- Parents:
- 5fdaeab1
- Location:
- libcfa/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/enum.cfa
r5fdaeab1 re49c308 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 enumeration range %d-%d",13 abort( "call to fromInt has index %d outside of 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( __attribute__((unused)) E e) {32 int Countof( E ) { 33 33 E upper = upperBound(); 34 34 E lower = lowerBound(); -
libcfa/src/enum.hfa
r5fdaeab1 re49c308 19 19 E succ( E e ); 20 20 E pred( E e ); 21 int Countof( E e);21 int Countof( E ); 22 22 } 23 23
Note: See TracChangeset
for help on using the changeset viewer.