Ignore:
Timestamp:
Apr 30, 2018, 11:08:10 AM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
1518b39, 1a3eab8
Parents:
7958e67 (diff), 5e5dbc2 (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:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/coroutine/fibonacci.c

    r7958e67 rb9c432f  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // fibonacci.c --
     7// fibonacci.c -- 3-state finite-state machine
     8
    89//
    910// Author           : Thierry Delisle
    1011// Created On       : Thu Jun  8 07:29:37 2017
    1112// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 22 22:45:44 2018
    13 // Update Count     : 15
     13// Last Modified On : Fri Apr 27 08:55:31 2018
     14// Update Count     : 19
    1415//
    1516
     
    1920coroutine Fibonacci { int fn; };                                                // used for communication
    2021
    21 void ?{}( Fibonacci & fib ) with( fib ) { fn = 0; }
    22 
    23 // main automatically called on first resume
    24 void main( Fibonacci & fib ) with( fib ) {
     22void main( Fibonacci & fib ) with( fib ) {                              // called on first resume
    2523        int fn1, fn2;                                                                           // retained between resumes
    2624        fn = 0;  fn1 = fn;                                                                      // 1st case
     
    2927        suspend();                                                                                      // restart last resume
    3028        for ( ;; ) {
    31                 fn = fn1 + fn2; fn2 = fn1;  fn1 = fn;                   // general case
     29                fn = fn1 + fn2;  fn2 = fn1;  fn1 = fn;                  // general case
    3230                suspend();                                                                              // restart last resume
    3331        } // for
Note: See TracChangeset for help on using the changeset viewer.