Changeset af1ed1ad for src/tests


Ignore:
Timestamp:
Mar 23, 2018, 9:29:57 AM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
2a84d06d, b5563e1
Parents:
7e419e7
Message:

formatting

File:
1 edited

Legend:

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

    r7e419e7 raf1ed1ad  
    1010// Created On       : Thu Jun  8 07:29:37 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  5 22:27:54 2017
    13 // Update Count     : 14
     12// Last Modified On : Thu Mar 22 22:45:44 2018
     13// Update Count     : 15
    1414//
    1515
     
    2121void ?{}( Fibonacci & fib ) with( fib ) { fn = 0; }
    2222
     23// main automatically called on first resume
    2324void main( Fibonacci & fib ) with( fib ) {
    2425        int fn1, fn2;                                                                           // retained between resumes
    25 
    26         fn = 0; fn1 = fn;                                                                       // 1st case
     26        fn = 0;  fn1 = fn;                                                                      // 1st case
    2727        suspend();                                                                                      // restart last resume
    28 
    29         fn = 1; fn2 = fn1;  fn1 = fn;                                           // 2nd case
     28        fn = 1;  fn2 = fn1;  fn1 = fn;                                          // 2nd case
    3029        suspend();                                                                                      // restart last resume
    31 
    3230        for ( ;; ) {
    3331                fn = fn1 + fn2; fn2 = fn1;  fn1 = fn;                   // general case
Note: See TracChangeset for help on using the changeset viewer.