Ignore:
Timestamp:
Jun 21, 2019, 11:46:55 AM (5 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:
49dee5e
Parents:
d38c4b4
Message:

change from C to CFA for statements in example programs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/examples/quickSort.cfa

    rd38c4b4 r3aa1d22  
    1111// Created On       : Wed Dec  6 12:15:52 2017
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Fri Mar 22 13:42:01 2019
    14 // Update Count     : 170
     13// Last Modified On : Fri Jun 21 08:27:45 2019
     14// Update Count     : 172
    1515//
    1616
     
    138138                  if ( eof( unsortedfile ) ) break;
    139139                        int * values = alloc( size );                           // values to be sorted, too large to put on stack
    140                         for ( int counter = 0; counter < size; counter += 1 ) { // read unsorted numbers
     140                        for ( counter; size ) {                                         // read unsorted numbers
    141141                                unsortedfile | values[counter];
    142142                                if ( counter != 0 && counter % ValuesPerLine == 0 ) sortedfile | nl | "  ";
     
    148148                                Quicksort QS = { values, size - 1, 0 }; // sort values
    149149                        } // wait until sort tasks terminate
    150                         for ( int counter = 0; counter < size; counter += 1 ) { // print sorted list
     150                        for ( counter; size ) {                                         // print sorted list
    151151                                if ( counter != 0 && counter % ValuesPerLine == 0 ) sortedfile | nl | "  ";
    152152                                sortedfile | values[counter];
     
    163163
    164164                int * values = alloc( size );                           // values to be sorted, too large to put on stack
    165                 for ( int counter = 0; counter < size; counter += 1 ) { // generate unsorted numbers
     165                for ( counter; size ) {                                         // generate unsorted numbers
    166166                        values[counter] = size - counter;                       // descending values
    167167                } // for
     
    170170                } // wait until sort tasks terminate
    171171
    172                 // for ( int counter = 0; counter < size - 1; counter += 1 ) { // check sorting
     172                // for ( counter; size - 1 ) {                          // check sorting
    173173                //      if ( values[counter] > values[counter + 1] ) abort();
    174174                // } // for
Note: See TracChangeset for help on using the changeset viewer.