Ignore:
Timestamp:
Nov 3, 2014, 4:38:08 PM (10 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
8c17ab0
Parents:
93885663
Message:

add compiler flag to driver, update examples, fix unnamed bit fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/examples/array.c

    r93885663 r134b86a  
    1010/// {
    1111///   begin = 0;
    12 ///   end = array_last( array );
     12///   end = last( array );
    1313/// }
    1414
     15// The first element is always at index 0.
    1516forall( type array_type, type elt_type | bounded_array( array_type, elt_type ) )
    16 elt_type *
    17 get_begin( array_type array )
    18 {
    19   return &array[ 0 ];
     17elt_type * begin( array_type array ) {
     18    return &array[ 0 ];
    2019}
    2120
     21// The end iterator should point one past the last element.
    2222forall( type array_type, type elt_type | bounded_array( array_type, elt_type ) )
    23 elt_type *
    24 get_end( array_type array )
    25 {
    26   return &array[ array_last( array ) ] + 1;
     23elt_type * end( array_type array ) {
     24    return &array[ last( array ) ] + 1;
    2725}
    28 
Note: See TracChangeset for help on using the changeset viewer.