Changeset 10b5970 for tests/concurrency


Ignore:
Timestamp:
Jan 7, 2025, 3:22:19 PM (9 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
190a833
Parents:
70670e7
Message:

Fix many test-suite- and libcfa-caused unused variable warnings.

In scope are easy fixes among tests whose sole warnings were unused variable. Reduces the wflags lax list by 40%.

Location:
tests/concurrency
Files:
28 edited

Legend:

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

    r70670e7 r10b5970  
    1616
    1717thread Pong {};
    18 void main(Pong & this) {
     18void main(Pong &) {
    1919    try {
    2020        for ( ;; ) {
     
    2727
    2828thread Ping {};
    29 void main(Ping & this) {
     29void main(Ping &) {
    3030    try {
    3131        for ( ;; ) {
     
    3939
    4040
    41 int main( int argc, char * argv[] ) {
     41int main() {
    4242    sout | "start";
    4343    processor proc[1];
  • tests/concurrency/cluster.cfa

    r70670e7 r10b5970  
    99}
    1010
    11 void main( MyThread & this ) {
     11void main( MyThread & ) {
    1212        for(50) {
    1313                yield();
  • tests/concurrency/coroutineYield.cfa

    r70670e7 r10b5970  
    2424coroutine Coroutine {};
    2525
    26 void main(Coroutine& this) {
     26void main( Coroutine & ) {
    2727        while(true) {
    2828                #if !defined(TEST_FOREVER)
     
    3939
    4040Coroutine c;
    41 int main(int argc, char* argv[]) {
     41int main() {
    4242        for(int i = 0; TEST(i < N); i++) {
    4343                #if !defined(TEST_FOREVER)
  • tests/concurrency/examples/boundedBufferEXT.cfa

    r70670e7 r10b5970  
    9494        Buffer(int) buffer;
    9595        int sums[Cons];
    96         int i;
    9796        processor p;
    9897
  • tests/concurrency/examples/boundedBufferINT.cfa

    r70670e7 r10b5970  
    9494        Consumer * cons[Cons];
    9595        int sums[Cons];
    96         int i;
    9796        processor p;
    9897
  • tests/concurrency/futures/wait_any.cfa

    r70670e7 r10b5970  
    3232
    3333thread Waiter {};
    34 void main( Waiter & this ) {
     34void main( Waiter & ) {
    3535    for (numtimes) {
    3636        wait_any(futures, num_futures);
     
    4242
    4343thread Deliverer {};
    44 void main( Deliverer & this ) {
     44void main( Deliverer & ) {
    4545    while (!done) {
    4646        size_t num_satisfy = random(1,num_futures);
  • tests/concurrency/join.cfa

    r70670e7 r10b5970  
    2828
    2929
    30 int main(int argc, char* argv[]) {
     30int main() {
    3131        {
    3232                Worker workers[17];
  • tests/concurrency/migrate.cfa

    r70670e7 r10b5970  
    4747        }
    4848
    49         struct cluster_wrapper * curr = (struct cluster_wrapper *)&the_clusters[0];
    50 
    5149        for(100) {
    5250                unsigned idx = prng( this, cluster_cnt );
  • tests/concurrency/monitor.cfa

    r70670e7 r10b5970  
    2828thread MyThread {};
    2929
    30 void main( MyThread & this ) {
     30void main( MyThread & ) {
    3131        for(int i = 0; i < 750_000; i++) {
    3232                increment( global );
     
    3434}
    3535
    36 int main(int argc, char* argv[]) {
     36int main() {
    3737        assert( global.__mon.entry_queue.tail != NULL );
    3838        processor p;
  • tests/concurrency/multi-monitor.cfa

    r70670e7 r10b5970  
    4444}
    4545
    46 int main(int argc, char* argv[]) {
     46int main() {
    4747        processor p;
    4848        {
  • tests/concurrency/mutexstmt/locks.cfa

    r70670e7 r10b5970  
    1212int count = 0;
    1313
    14 void main( T_Mutex & this ) {
     14void main( T_Mutex & ) {
    1515        for (unsigned int i = 0; i < num_times; i++) {
    1616                mutex ( m1 ) count++;
     
    3535thread T_Multi {};
    3636
    37 void main( T_Multi & this ) {
     37void main( T_Multi & ) {
    3838        for (unsigned int i = 0; i < num_times; i++) {
    3939                refTest( m1 );
     
    8181thread T_Multi_Poly {};
    8282
    83 void main( T_Multi_Poly & this ) {
     83void main( T_Multi_Poly & ) {
    8484        for (unsigned int i = 0; i < num_times; i++) {
    8585                refTest( l1 );
  • tests/concurrency/mutexstmt/monitors.cfa

    r70670e7 r10b5970  
    1616bool startFlag = false;
    1717
    18 void main( T_Mutex & this ) {
     18void main( T_Mutex & ) {
    1919        for (unsigned int i = 0; i < num_times; i++) {
    2020                mutex ( m1 ) count++;
     
    3030thread T_Multi {};
    3131
    32 void main( T_Multi & this ) {
     32void main( T_Multi & ) {
    3333        for (unsigned int i = 0; i < num_times; i++) {
    3434                mutex ( m1 ) {
  • tests/concurrency/preempt.cfa

    r70670e7 r10b5970  
    7171}
    7272
    73 int main(int argc, char* argv[]) {
     73int main() {
    7474        processor p;
    7575        globals.counter = 0;
  • tests/concurrency/pthread/pthread_cond_test.cfa

    r70670e7 r10b5970  
    99pthread_cond_t cond;
    1010
    11 extern "C"{
    12     void* S1(void* arg){
     11extern "C" {
     12    void* S1( void * ) {
    1313        pthread_mutex_lock(&_mutex);
    1414        for (int i = 0; i < 1000; i++) sout | "S1 done " | i;
     
    1919    }
    2020
    21     void* S2(void* arg){
     21    void* S2( void * ) {
    2222        pthread_mutex_lock(&_mutex);
    2323        if (!done_flag) pthread_cond_wait(&cond, &_mutex);
     
    3030
    3131
    32 int main(int argc, char const *argv[])
    33 {
    34     /* code */
     32int main() {
    3533    pthread_mutex_init(&_mutex, NULL);
    3634    pthread_cond_init(&cond, NULL);
  • tests/concurrency/pthread/pthread_once_test.cfa

    r70670e7 r10b5970  
    9090
    9191
    92 int main(int argc, char const *argv[])
     92int main()
    9393{
    9494    test();
  • tests/concurrency/readyQ/leader_spin.cfa

    r70670e7 r10b5970  
    9797
    9898// ==================================================
    99 int main(int argc, char * argv[]) {
     99int main() {
    100100        lead_idx = 0;
    101101        leader = prng( lead_rng, nthreads );
  • tests/concurrency/signal/block.cfa

    r70670e7 r10b5970  
    5151
    5252//------------------------------------------------------------------------------
    53 void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned i ) {
     53void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned ) {
    5454    wait( cond, (uintptr_t)active_thread() );
    5555
     
    6767
    6868thread Waiter {};
    69 void main( Waiter & this ) {
     69void main( Waiter & ) {
    7070        for( int i = 0; TEST(i < N); i++ ) {
    7171                wait_op( globalA, globalB, i );
     
    100100
    101101thread Signaller {};
    102 void main( Signaller & this ) {
     102void main( Signaller & ) {
    103103        while( !done ) {
    104104                signal_op( globalA, globalB );
     
    112112
    113113thread Barger {};
    114 void main( Barger & this ) {
     114void main( Barger & ) {
    115115        for( unsigned i = 0; !done; i++ ) {
    116116                //Choose some monitor to barge into with some irregular pattern
     
    123123//------------------------------------------------------------------------------
    124124
    125 int main(int argc, char* argv[]) {
     125int main() {
    126126        srandom( time( NULL ) );
    127127        done = false;
  • tests/concurrency/signal/disjoint.cfa

    r70670e7 r10b5970  
    6565}
    6666
    67 void main( Barger & this ) {
     67void main( Barger & ) {
    6868        while( !all_done ) {
    6969                barge( globals.data );
     
    9393}
    9494
    95 void main( Waiter & this ) {
     95void main( Waiter & ) {
    9696        while( wait( globals.mut, globals.data ) ) { KICK_WATCHDOG; yield(); }
    9797}
     
    122122}
    123123
    124 void main( Signaller & this ) {
     124void main( Signaller & ) {
    125125        while( !all_done ) {
    126126                logic( globals.mut );
     
    131131//------------------------------------------------------------------------------
    132132// Main loop
    133 int main(int argc, char* argv[]) {
     133int main() {
    134134        srandom( time( NULL ) );
    135135        all_done = false;
  • tests/concurrency/signal/wait.cfa

    r70670e7 r10b5970  
    6565//----------------------------------------------------------------------------------------------------
    6666// Signaler
    67 void main( Signaler & this ) {
     67void main( Signaler & ) {
    6868
    6969        while( waiter_left != 0 ) {
     
    9292//----------------------------------------------------------------------------------------------------
    9393// Waiter ABC
    94 void main( WaiterABC & this ) {
     94void main( WaiterABC & ) {
    9595        for( int i = 0; TEST(i < N); i++ ) {
    9696                wait( condABC, globalA, globalB, globalC );
     
    103103//----------------------------------------------------------------------------------------------------
    104104// Waiter AB
    105 void main( WaiterAB & this ) {
     105void main( WaiterAB & ) {
    106106        for( int i = 0; TEST(i < N); i++ ) {
    107107                wait( condAB , globalA, globalB );
     
    114114//----------------------------------------------------------------------------------------------------
    115115// Waiter AC
    116 void main( WaiterAC & this ) {
     116void main( WaiterAC & ) {
    117117        for( int i = 0; TEST(i < N); i++ ) {
    118118                wait( condAC , globalA, globalC );
     
    125125//----------------------------------------------------------------------------------------------------
    126126// Waiter BC
    127 void main( WaiterBC & this ) {
     127void main( WaiterBC & ) {
    128128        for( int i = 0; TEST(i < N); i++ ) {
    129129                wait( condBC , globalB, globalC );
     
    136136//----------------------------------------------------------------------------------------------------
    137137// Main
    138 int main(int argc, char* argv[]) {
     138int main() {
    139139        srandom( time( NULL ) );
    140140        waiter_left = 4;
  • tests/concurrency/suspend_then.cfa

    r70670e7 r10b5970  
    6464
    6565thread Thread {};
    66 void main(Thread & this) {
     66void main( Thread & ) {
    6767        Coroutine * mine = 0p;
    6868        while(!done) {
     
    7878
    7979
    80 int main(int argc, char* argv[]) {
     80int main() {
    8181        processor p[2];
    8282        Coroutine c;
  • tests/concurrency/thread.cfa

    r70670e7 r10b5970  
    2828
    2929
    30 int main(int argc, char* argv[]) {
     30int main() {
    3131        semaphore lock = { 0 };
    3232        sout | "User main begin";
  • tests/concurrency/unified_locking/locks.cfa

    r70670e7 r10b5970  
    2323thread T_C_M_WS1 {};
    2424
    25 void main( T_C_M_WS1 & this ) {
     25void main( T_C_M_WS1 & ) {
    2626        for (unsigned int i = 0; i < num_times; i++) {
    2727                lock(m);
     
    3737thread T_C_M_WB1 {};
    3838
    39 void main( T_C_M_WB1 & this ) {
     39void main( T_C_M_WB1 & ) {
    4040        for (unsigned int i = 0; i < num_times; i++) {
    4141                lock(m);
     
    5151thread T_C_S_WS1 {};
    5252
    53 void main( T_C_S_WS1 & this ) {
     53void main( T_C_S_WS1 & ) {
    5454        for (unsigned int i = 0; i < num_times; i++) {
    5555                lock(s);
     
    6565thread T_C_S_WB1 {};
    6666
    67 void main( T_C_S_WB1 & this ) {
     67void main( T_C_S_WB1 & ) {
    6868        for (unsigned int i = 0; i < num_times; i++) {
    6969                lock(s);
     
    7979thread T_C_L_WS1 {};
    8080
    81 void main( T_C_L_WS1 & this ) {
     81void main( T_C_L_WS1 & ) {
    8282        for (unsigned int i = 0; i < num_times; i++) {
    8383                lock(l);
     
    9393thread T_C_L_WB1 {};
    9494
    95 void main( T_C_L_WB1 & this ) {
     95void main( T_C_L_WB1 & ) {
    9696        for (unsigned int i = 0; i < num_times; i++) {
    9797                lock(l);
     
    107107thread T_F_C_F_WS1 {};
    108108
    109 void main( T_F_C_F_WS1 & this ) {
     109void main( T_F_C_F_WS1 & ) {
    110110        for (unsigned int i = 0; i < num_times; i++) {
    111111                lock(f);
     
    121121thread T_C_O_WS1 {};
    122122
    123 void main( T_C_O_WS1 & this ) {
     123void main( T_C_O_WS1 & ) {
    124124        for (unsigned int i = 0; i < num_times; i++) {
    125125                lock(o);
     
    135135thread T_C_O_WB1 {};
    136136
    137 void main( T_C_O_WB1 & this ) {
     137void main( T_C_O_WB1 & ) {
    138138        for (unsigned int i = 0; i < num_times; i++) {
    139139                lock(o);
     
    149149thread T_C_M_WS2 {};
    150150
    151 void main( T_C_M_WS2 & this ) {
     151void main( T_C_M_WS2 & ) {
    152152        for (unsigned int i = 0; i < num_times; i++) {
    153153                lock(m);
     
    167167thread T_C_O_WS2 {};
    168168
    169 void main( T_C_O_WS2 & this ) {
     169void main( T_C_O_WS2 & ) {
    170170        for (unsigned int i = 0; i < num_times; i++) {
    171171                lock(o);
     
    185185thread T_C_NLW {};
    186186
    187 void main( T_C_NLW & this ) {
     187void main( T_C_NLW & ) {
    188188        for (unsigned int i = 0; i < num_times; i++) {
    189189                wait(c_o);
     
    193193thread T_C_NLS {};
    194194
    195 void main( T_C_NLS & this ) {
     195void main( T_C_NLS & ) {
    196196        for (unsigned int i = 0; i < num_times; i++) {
    197197                while (empty(c_o)) { }
     
    202202thread T_C_S_WNF {};
    203203
    204 void main( T_C_S_WNF & this ) {
     204void main( T_C_S_WNF & ) {
    205205        for (unsigned int i = 0; i < num_times; i++) {
    206206                lock(s);
     
    219219thread T_C_NLWD {};
    220220
    221 void main( T_C_NLWD & this ) {
     221void main( T_C_NLWD & ) {
    222222        done = false;
    223223        for (unsigned int i = 0; i < num_times/5; i++) {
     
    230230thread T_C_WDS {};
    231231
    232 void main( T_C_WDS & this ) {
     232void main( T_C_WDS & ) {
    233233        for (unsigned int i = 0; i < num_times; i++) {
    234234                while (empty(c_s) && !done) { }
     
    241241thread T_C_LWD {};
    242242
    243 void main( T_C_LWD & this ) {
     243void main( T_C_LWD & ) {
    244244        done = false;
    245245        for (unsigned int i = 0; i < num_times/5; i++) {
     
    254254thread T_C_LWDS {};
    255255
    256 void main( T_C_LWDS & this ) {
     256void main( T_C_LWDS & ) {
    257257        for (unsigned int i = 0; i < num_times; i++) {
    258258                while (empty(c_s) && !done) { }
  • tests/concurrency/unified_locking/pthread_locks.cfa

    r70670e7 r10b5970  
    1818thread Wait_Signal_1 {};
    1919
    20 void main( Wait_Signal_1 & this ) {
     20void main( Wait_Signal_1 & ) {
    2121        for (unsigned int i = 0; i < num_times; i++) {
    2222                lock(l);
     
    3232thread Wait_3_Signal_3 {};
    3333
    34 void main( Wait_3_Signal_3 & this ) {
     34void main( Wait_3_Signal_3 & ) {
    3535        for (unsigned int i = 0; i < num_times; i++) {
    3636                lock(l);
     
    4848thread Rec_Lock_Wait_Signal_1 {};
    4949
    50 void main( Rec_Lock_Wait_Signal_1 & this ) {
     50void main( Rec_Lock_Wait_Signal_1 & ) {
    5151        for (unsigned int i = 0; i < num_times; i++) {
    5252                lock(l);
     
    6666thread Wait_Time_Signal_1 {};
    6767
    68 void main( Wait_Time_Signal_1 & this ) {
     68void main( Wait_Time_Signal_1 & ) {
    6969        for (unsigned int i = 0; i < num_times; i++) {
    7070                lock(l);
     
    7474                        timespec waitTime{0,1};
    7575                        bool woken = wait(c,l, t + waitTime);
     76                        (void) woken;
    7677                }else{
    7778                        notify_one(c);
  • tests/concurrency/waitfor/barge.cfa

    r70670e7 r10b5970  
    3030}
    3131
    32 void ^?{} ( global_t & mutex this ) {}
     32void ^?{} ( global_t & mutex ) {}
    3333
    3434global_t global;
     
    4040
    4141thread barger_t {};
    42 void main( barger_t & this ) {
     42void main( barger_t & ) {
    4343        yield();
    4444        while( barge( global ) ) { yield(random( 10 )); }
     
    5656
    5757thread caller_t {};
    58 void main( caller_t & this ) {
     58void main( caller_t & ) {
    5959        while( do_call(global) ) { yield(random( 10 )); }
    6060}
     
    7878
    7979thread waiter_t{};
    80 void main( waiter_t & this ) {
     80void main( waiter_t & ) {
    8181        do_wait(global);
    8282}
  • tests/concurrency/waitfor/statment.cfa

    r70670e7 r10b5970  
    8989}
    9090
    91 void main( caller & this ) {
     91void main( caller & ) {
    9292        int index = get_index( m );
    9393        while( !start ) yield();
     
    122122thread waiter{};
    123123
    124 void main( waiter & this ) {
     124void main( waiter & ) {
    125125        do_wait( m );
    126126}
  • tests/concurrency/waitfor/when.cfa

    r70670e7 r10b5970  
    3939
    4040thread caller_t{};
    41 void main( caller_t & this ) {
     41void main( caller_t & ) {
    4242        while( true ) {
    4343                rand_yield();
     
    7676
    7777thread arbiter_t{};
    78 void main( arbiter_t & this ) {
     78void main( arbiter_t & ) {
    7979        arbiter( global );
    8080}
  • tests/concurrency/waituntil/channel_zero_size.cfa

    r70670e7 r10b5970  
    99
    1010thread Server1 {};
    11 void main( Server1 & this ) {
     11void main( Server1 & ) {
    1212    long long int a, b, c, i = 0, myTotal = 0;
    1313    for( ;;i++ ) {
  • tests/concurrency/waituntil/one_chan.cfa

    r70670e7 r10b5970  
    99
    1010thread Server1 {};
    11 void main( Server1 & this ) {
     11void main( Server1 & ) {
    1212    long long int c, i = 0, myTotal = 0;
    1313    for( ;;i++ ) {
Note: See TracChangeset for help on using the changeset viewer.