Ignore:
Timestamp:
Feb 26, 2020, 6:13:54 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
04e6f93, 5452673, dac55004
Parents:
aeb5d0d (diff), 7dc2e015 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/concurrency/examples/Format.c

    raeb5d0d r930b504  
    22
    33typedef struct {
    4         void * next;
     4        int restart, g, b;
    55        char ch;
    6         int g, b;
    76} Fmt;
    87
    98void comain( Fmt * f ) {
    10         if ( __builtin_expect(f->next != 0, 1) ) goto *f->next;
    11         f->next = &&s1;
     9        static void * states[] = {&&s0, &&s1};
     10        goto *states[f->restart];
     11  s0: f->restart = 1;
    1212        for ( ;; ) {
    1313                for ( f->g = 0; f->g < 5; f->g += 1 ) {                 // groups
    1414                        for ( f->b = 0; f->b < 4; f->b += 1 ) {         // blocks
    15                                 return;
    16                           s1:;  while ( f->ch == '\n' ) return;         // ignore
     15                                do {
     16                                        return;  s1: ;
     17                                } while ( f->ch == '\n' );                              // ignore
    1718                                printf( "%c", f->ch );                                  // print character
    1819                        }
     
    2425
    2526int main() {
    26         Fmt fmt = { NULL };
     27        Fmt fmt = { 0 };
    2728        comain( &fmt );                                                                         // prime
    2829        for ( ;; ) {
Note: See TracChangeset for help on using the changeset viewer.