Changeset 6a6e205


Ignore:
Timestamp:
Jan 13, 2025, 1:32:32 PM (7 days ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
c086c6e
Parents:
267b543
Message:

Clean some warnings from unused variables and pointer-to-int casts.

Files:
15 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/actor.hfa

    r267b543 r6a6e205  
    113113                return buffer[old_idx];
    114114        }
    115         request * ret = 0p;
    116115        return *0p;
    117116}
     
    147146        id = i;
    148147        missed = 0;
     148        #else
     149        (void) i;
    149150        #endif
    150151}
     
    715716struct finished_msg_t { inline message; } finished_msg = __base_msg_finished;
    716717
    717 allocation receive( actor & this, delete_msg_t & ) { return Delete; }
    718 allocation receive( actor & this, destroy_msg_t & ) { return Destroy; }
    719 allocation receive( actor & this, finished_msg_t & ) { return Finished; }
     718allocation receive( actor &, delete_msg_t & ) { return Delete; }
     719allocation receive( actor &, destroy_msg_t & ) { return Destroy; }
     720allocation receive( actor &, finished_msg_t & ) { return Finished; }
    720721
    721722// Default messages used all the time.
  • tests/Makefile.am

    r267b543 r6a6e205  
    6262WFLGAS_OPT_LAX_TO_INVESTIGATE = \
    6363        attributes \
    64         collections/atomic_mpsc \
    6564        collections/queue \
    6665        collections/sequence \
     
    9089        concurrency/pthread/pthread_demo_lock \
    9190        concurrency/pthread/pthread_key_test \
    92         concurrency/pthread/pthread_once_test \
    93         concurrency/unified_locking/block_spin_lock \
    94         concurrency/unified_locking/exp_backoff \
    95         concurrency/unified_locking/fast_block_lock \
    96         concurrency/unified_locking/futex_mutex \
    97         concurrency/unified_locking/locks \
    98         concurrency/unified_locking/mcs \
    99         concurrency/unified_locking/mcs_block_spin_lock \
    100         concurrency/unified_locking/mcs_spin \
    101         concurrency/unified_locking/pthread_locks \
    102         concurrency/unified_locking/simple_owner_lock \
    103         concurrency/unified_locking/spin_queue_lock \
    104         concurrency/unified_locking/timeout_lock \
    10591        concurrency/waituntil/all_types \
    10692        concurrency/waituntil/basic_else \
  • tests/collections/atomic_mpsc.cfa

    r267b543 r6a6e205  
    3333void wait(Producer & this) {
    3434        some_node node;
    35         node.value = (unsigned)&this;
     35        node.value = (uintptr_t)&this;
    3636        push(global_queue, &node);
    3737        wait(node.sem);
  • tests/concurrency/actors/dynamic.cfa

    r267b543 r6a6e205  
    1919void ?{}( derived_msg & this ) { ((derived_msg &)this){ 0 }; }
    2020
    21 allocation receive( derived_actor & receiver, derived_msg & msg ) {
     21allocation receive( derived_actor &, derived_msg & msg ) {
    2222        if ( msg.cnt >= Times ) {
    2323                sout | "Done";
  • tests/concurrency/actors/inherit.cfa

    r267b543 r6a6e205  
    2121}
    2222
    23 allocation receive( Server & receiver, D_msg & msg ) { return handle(); }
    24 allocation receive( Server & receiver, D_msg2 & msg ) { return handle(); }
    25 allocation receive( Server2 & receiver, D_msg & msg ) { return Delete; }
    26 allocation receive( Server2 & receiver, D_msg2 & msg ) { return Delete; }
     23allocation receive( Server &, D_msg & ) { return handle(); }
     24allocation receive( Server &, D_msg2 & ) { return handle(); }
     25allocation receive( Server2 &, D_msg & ) { return Delete; }
     26allocation receive( Server2 &, D_msg2 & ) { return Delete; }
    2727
    2828int main() {
  • tests/concurrency/actors/inline.cfa

    r267b543 r6a6e205  
    5050                d_msg2 dm{ 29079 };
    5151                set_allocation( dm, Nodelete );
    52                 msg_wrapper * mw = &dm;
    53                 message * mg = &dm;
    54                 virtual_dtor * v = &dm;
     52                msg_wrapper * mw = &dm;         (void) mw;
     53                message * mg = &dm;                     (void) mg;
     54                virtual_dtor * v = &dm;         (void) v;
    5555                da | dm;
    5656                actor_stop();                                                           // waits until actors finish
  • tests/concurrency/actors/pingpong.cfa

    r267b543 r6a6e205  
    2020size_t times = 100000;
    2121
    22 allocation receive( ping & receiver, p_msg & msg ) {
     22allocation receive( ping &, p_msg & msg ) {
    2323        msg.count++;
    2424        if ( msg.count > times ) return Finished;
     
    3030}
    3131
    32 allocation receive( pong & receiver, p_msg & msg ) {
     32allocation receive( pong &, p_msg & msg ) {
    3333        msg.count++;
    3434        if ( msg.count > times ) return Finished;
     
    4242size_t Processors = 2;
    4343
    44 int main( int argc, char * argv[] ) {
     44int main() {
    4545        sout | "start";
    4646
  • tests/concurrency/actors/types.cfa

    r267b543 r6a6e205  
    3636};
    3737
    38 allocation receive( derived_actor2 & receiver, d_msg & msg ) {
     38allocation receive( derived_actor2 &, d_msg & msg ) {
    3939        mutex(sout) sout | msg.num;
    4040        return Finished;
     
    4848};
    4949
    50 allocation receive( derived_actor3 & receiver, d_msg & msg ) {
     50allocation receive( derived_actor3 &, d_msg & msg ) {
    5151        mutex(sout) sout | msg.num;
    5252        if ( msg.num == -1 ) return Nodelete;
     
    5454}
    5555
    56 allocation receive( derived_actor3 & receiver, d_msg2 & msg ) {
     56allocation receive( derived_actor3 &, d_msg2 & msg ) {
    5757        mutex(sout) sout | msg.num;
    5858        return Finished;
     
    6161size_t Processors = 3;
    6262
    63 int main( int argc, char * argv[] ) {
     63int main() {
    6464        sout | "start";
    6565
  • tests/concurrency/pthread/bounded_buffer.cfa

    r267b543 r6a6e205  
    126126                exit( EXIT_FAILURE );
    127127            } // if
    128             if ( (uint64_t)result != 0 ) {
     128            if ( result != 0p ) {
    129129                sout | "producers" | prods[i] |" bad return value " | result;
    130130                exit( EXIT_FAILURE );
     
    142142                exit( EXIT_FAILURE );
    143143            } // if
    144             if ( (uint64_t)result != 0 ) {
     144            if ( result != 0p ) {
    145145                sout| "consumers bad return value" | result;
    146146                exit( EXIT_FAILURE );
  • tests/concurrency/pthread/pthread_demo_lock.cfa

    r267b543 r6a6e205  
    1515// unlocked increnment
    1616void* inc_unlock(void* cnt){
    17     for (int i = 0; i < (uint64_t)cnt; i++){
     17    for (uintptr_t i = 0; i < (uintptr_t)cnt; i++){
    1818        cnt_nolock++;
    1919    }   // for
     
    2323void* inc_lock(void* cnt){
    2424    pthread_mutex_lock(&_mutex);
    25     for (int i = 0; i < (uint64_t)cnt; i++){
     25    for (uintptr_t i = 0; i < (uintptr_t)cnt; i++){
    2626        cnt_lock++;
    2727    }   // for
     
    7373    sout | "in trylocktest2 res2 is" | res;
    7474    pthread_mutex_lock(&_mutex);
    75     for (int i = 0; i < (uint64_t)arg; i++) cnt_trylock++;
     75    for (uintptr_t i = 0; i < (uintptr_t)arg; i++) cnt_trylock++;
    7676    pthread_mutex_unlock(&_mutex);
    7777    return NULL;
     
    8787
    8888    // inc cnt then release the lock
    89     for (int i = 0; i < (uint64_t)arg; i++) cnt_trylock++;
     89    for (uintptr_t i = 0; i < (uintptr_t)arg; i++) cnt_trylock++;
    9090    pthread_mutex_unlock(&_mutex);
    9191    pthread_mutex_unlock(&_mutex);
     
    113113
    114114
    115 int main(int argc, char const *argv[])
     115int main()
    116116{
    117117   
  • tests/concurrency/pthread/pthread_once_test.cfa

    r267b543 r6a6e205  
    7474                                                                                       
    7575            if (thread_stat[i] != 0)                                                   
    76                 printf("bad thread status, thread %d, status=%d\n", i+1,               
    77                                                         (int)thread_stat[i]);             
     76                printf("bad thread status, thread %d, status=%zu\n", i+1,               
     77                                                        (size_t)thread_stat[i]);             
    7878        }                                                                             
    7979                                                                                       
  • tests/concurrency/unified_locking/mcs.cfa

    r267b543 r6a6e205  
    2222unsigned cs() {
    2323        thread$ * me = active_thread();
    24         unsigned value = (unsigned)me;
     24        unsigned value = (uintptr_t)me;
    2525        mcs_node n;
    2626        lock(mo.l, n);
  • tests/concurrency/unified_locking/mcs_spin.cfa

    r267b543 r6a6e205  
    3232                mo.id = me;
    3333                yield(random(5));
    34                 value = ((uint32_t)random()) ^ ((uint32_t)me);
     34                value = ((uint32_t)random()) ^ ((uint32_t)(uintptr_t)me);
    3535                if(mo.id != me) sout | "Intruder!";
    3636                mo.cnt = cnt + 1;
  • tests/concurrency/unified_locking/mutex_test.hfa

    r267b543 r6a6e205  
    3232                mo.id = me;
    3333                yield(random(5));
    34                 value = ((uint32_t)random()) ^ ((uint32_t)me);
     34                value = ((uint32_t)random()) ^ ((uint32_t)(uintptr_t)me);
    3535                if(mo.id != me) sout | "Intruder!";
    3636                mo.cnt = cnt + 1;
  • tests/concurrency/unified_locking/timeout_lock.cfa

    r267b543 r6a6e205  
    2323thread T1 {};
    2424
    25 void main( T1 & this ) {
     25void main( T1 & ) {
    2626        lock(m);
    2727        wait( c_m, m, 1`s );
     
    4646thread T2 {};
    4747
    48 void main( T2 & this ) {
     48void main( T2 & ) {
    4949        block();
    5050
Note: See TracChangeset for help on using the changeset viewer.