Ignore:
File:
1 edited

Legend:

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

    r50be8af rcb344f7  
    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;
     
    3737          case 3:
    3838                if ( strcmp( argv[2], "d" ) != 0 ) {                    // default ?
    39                         Tasks = ato( argv[2] );
    40             if ( Tasks < 1 ) fallthru default;
     39                        Tasks = atoi( argv[2] );
     40            if ( Tasks < 1 ) goto Usage;
    4141                } // if
    4242          case 2:
    4343                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    44                         Processors = ato( argv[1] );
    45                         if ( Processors < 1 ) fallthru default;
     44                        Processors = atoi( argv[1] );
     45                        if ( Processors < 1 ) goto Usage;
    4646                } // if
    4747          case 1:                                                                                       // use defaults
    4848                break;
    4949          default:
    50                 exit | "Usage: " | argv[0]
     50          Usage:
     51                sout | "Usage: " | argv[0]
    5152             | " [ processors (> 0) | 'd' (default " | Processors
    5253                         | ") ] [ channel size (>= 0) | 'd' (default " | Tasks
    5354                         | ") ]" ;
     55                exit( EXIT_FAILURE );
    5456        } // switch
    5557    processor proc[Processors - 1];
     
    6971    // sout | total_operations;
    7072    sout | "done";
     73
     74    return 0;
    7175}
Note: See TracChangeset for help on using the changeset viewer.