- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tests/concurrency/examples/quickSort.cfa ¶
re8b5ba4 r3ac5fd8 11 11 // Created On : Wed Dec 6 12:15:52 2017 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Fri Oct 18 16:43:26202414 // Update Count : 20013 // Last Modified On : Sat Aug 17 13:59:15 2024 14 // Update Count : 199 15 15 // 16 16 … … 112 112 fallthrough; 113 113 case 3: case 2: 114 // open input file first as output creates file115 114 if ( strcmp( argv[1], "d" ) != 0 ) { 116 open( unsortedfile, argv[1] ); 115 try { // open input file first as output creates file 116 open( unsortedfile, argv[1] ); 117 } catch( open_failure * ) { // open failed ? 118 serr | "Error! Could not open unsorted input file \"" | argv[1] | "\""; 119 throw ExceptionInst( cmd_error ); 120 } // try 117 121 } // if 118 122 if ( argc > 2 && strcmp( argv[2], "d" ) != 0 ) { 119 open( sortedfile, argv[2] ); 123 try { 124 open( sortedfile, argv[2] ); 125 } catch( open_failure * ) { // open failed ? 126 serr | "Error! Could not open sorted output file \"" | argv[2] | "\""; 127 throw ExceptionInst( cmd_error ); 128 } // try 120 129 } // if 121 130 fallthrough; … … 125 134 } // choose 126 135 } // if 127 } catch( open_failure * ) { // open failed ?128 exit | "Error! Could not open unsorted input file \"" | argv[1] | "\"";129 } catch( open_failure * ) { // open failed ?130 exit | "Error! Could not open sorted output file \"" | argv[2] | "\"";131 136 } catch( exception_t * ) { // catch any 132 137 exit | "Usage: " | argv[0] | // TERMINATE 133 138 " ( [ unsorted-file | 'd' [ sorted-file | 'd' [ depth (>= 0) ] ] ]" 134 139 " | -t size (>= 0) [ depth (>= 0) ] )"; 135 } // try140 } // try 136 141 137 142 enum { ValuesPerLine = 22 }; // number of values printed per line
Note: See TracChangeset
for help on using the changeset viewer.