Ignore:
Timestamp:
Sep 17, 2023, 11:19:08 AM (8 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
7edf912
Parents:
697c957
Message:

clean up command-line handling and I/O

File:
1 edited

Legend:

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

    r697c957 r50be8af  
    8787          case 3:
    8888                if ( strcmp( argv[2], "d" ) != 0 ) {                    // default ?
    89                         Tasks = atoi( argv[2] );
    90             if ( Tasks < 1 ) goto Usage;
     89                        Tasks = ato( argv[2] );
     90            if ( Tasks < 1 ) fallthru default;
    9191                } // if
    9292          case 2:
    9393                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
    94                         Processors = atoi( argv[1] );
    95                         if ( Processors < 1 ) goto Usage;
     94                        Processors = ato( argv[1] );
     95                        if ( Processors < 1 ) fallthru default;
    9696                } // if
    9797          case 1:                                                                                       // use defaults
    9898                break;
    9999          default:
    100           Usage:
    101                 sout | "Usage: " | argv[0]
     100                exit | "Usage: " | argv[0]
    102101             | " [ processors (> 0) | 'd' (default " | Processors
    103102                         | ") ] [ Tasks (> 0) | 'd' (default " | Tasks
    104103                         | ") ]" ;
    105                 exit( EXIT_FAILURE );
    106104        } // switch
    107105    BarrierSize = Tasks;
Note: See TracChangeset for help on using the changeset viewer.