Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tests/concurrency/examples/quickSort.cfa

    re8b5ba4 r3ac5fd8  
    1111// Created On       : Wed Dec  6 12:15:52 2017
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Fri Oct 18 16:43:26 2024
    14 // Update Count     : 200
     13// Last Modified On : Sat Aug 17 13:59:15 2024
     14// Update Count     : 199
    1515//
    1616
     
    112112                                fallthrough;
    113113                          case 3: case 2:
    114                                 // open input file first as output creates file
    115114                                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
    117121                                } // if
    118122                                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
    120129                                } // if
    121130                                fallthrough;
     
    125134                        } // choose
    126135                } // 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] | "\"";
    131136        } catch( exception_t * ) {                                                      // catch any
    132137                exit | "Usage: " | argv[0] |                                    // TERMINATE
    133138                        " ( [ unsorted-file | 'd' [ sorted-file | 'd' [ depth (>= 0) ] ] ]"
    134139                        " | -t size (>= 0) [ depth (>= 0) ] )";
    135         } // try
     140        } //  try
    136141
    137142        enum { ValuesPerLine = 22 };                                            // number of values printed per line
Note: See TracChangeset for help on using the changeset viewer.