Ignore:
File:
1 edited

Legend:

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

    rcb344f7 r50be8af  
    88
    99size_t total_operations = 0;
    10 size_t Processors = 1, Tasks = 4;
     10ssize_t Processors = 1, Tasks = 4;                                              // must be signed
    1111
    1212owner_lock o;
     
    3737          case 3:
    3838                if ( strcmp( argv[2], "d" ) != 0 ) {                    // default ?
    39                         Tasks = atoi( argv[2] );
    40             if ( Tasks < 1 ) goto Usage;
     39                        Tasks = ato( argv[2] );
     40            if ( Tasks < 1 ) fallthru default;
    4141                } // if
    4242          case 2:
    4343                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    44                         Processors = atoi( argv[1] );
    45                         if ( Processors < 1 ) goto Usage;
     44                        Processors = ato( argv[1] );
     45                        if ( Processors < 1 ) fallthru default;
    4646                } // if
    4747          case 1:                                                                                       // use defaults
    4848                break;
    4949          default:
    50           Usage:
    51                 sout | "Usage: " | argv[0]
     50                exit | "Usage: " | argv[0]
    5251             | " [ processors (> 0) | 'd' (default " | Processors
    5352                         | ") ] [ channel size (>= 0) | 'd' (default " | Tasks
    5453                         | ") ]" ;
    55                 exit( EXIT_FAILURE );
    5654        } // switch
    5755    processor proc[Processors - 1];
     
    7169    // sout | total_operations;
    7270    sout | "done";
    73 
    74     return 0;
    7571}
Note: See TracChangeset for help on using the changeset viewer.