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/iterator.c

    r93885663 r134b86a  
    1818        type iterator_type | iterator( iterator_type, elt_type ),
    1919        dtype os_type | ostream( os_type ) )
    20 void
    21 write_all( iterator_type begin, iterator_type end, os_type *os )
    22 {
    23   iterator_type i;
    24   for( i = begin; i != end; ++i ) {
    25     os << *i << ' ';
    26   }
     20void write_all( iterator_type begin, iterator_type end, os_type *os ) {
     21    iterator_type i;
     22    for ( i = begin; i != end; ++i ) {
     23        os << *i << ' ';
     24    }
    2725}
    2826
     27forall( type elt_type | writeable( elt_type ),
     28        type iterator_type | iterator( iterator_type, elt_type ),
     29        dtype os_type | ostream( os_type ) )
     30void write_reverse( iterator_type begin, iterator_type end, os_type *os ) {
     31    iterator_type i; /* = end; do not work */
     32    i = end;
     33    do {
     34        --i;
     35        os << *i << ' ';
     36    } while ( i != begin );
     37}
Note: See TracChangeset for help on using the changeset viewer.