Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrency/channels/hot_potato.cfa

    r50be8af rc26bea2a  
    88
    99size_t total_operations = 0;
    10 ssize_t Processors = 1, Tasks = 4;                                              // must be signed
     10size_t Processors = 1, Tasks = 4;
    1111
    1212owner_lock o;
     
    3838}
    3939
     40
    4041int main( int argc, char * argv[] ) {
    4142    switch ( argc ) {
    4243          case 3:
    4344                if ( strcmp( argv[2], "d" ) != 0 ) {                    // default ?
    44                         Tasks = ato( argv[2] );
    45             if ( Tasks < 1 ) fallthru default;
     45                        Tasks = atoi( argv[2] );
     46            if ( Tasks < 1 ) goto Usage;
    4647                } // if
    4748          case 2:
    4849                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    49                         Processors = ato( argv[1] );
    50                         if ( Processors < 1 ) fallthru default;
     50                        Processors = atoi( argv[1] );
     51                        if ( Processors < 1 ) goto Usage;
    5152                } // if
    5253          case 1:                                                                                       // use defaults
    5354                break;
    5455          default:
    55                 exit | "Usage: " | argv[0]
     56          Usage:
     57                sout | "Usage: " | argv[0]
    5658             | " [ processors (> 0) | 'd' (default " | Processors
    5759                         | ") ] [ channel size (>= 0) | 'd' (default " | Tasks
    5860                         | ") ]" ;
     61                exit( EXIT_FAILURE );
    5962        } // switch
    60 
    6163    processor proc[Processors - 1];
    6264
Note: See TracChangeset for help on using the changeset viewer.