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

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

Location:
tests/concurrency/pthread
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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                                                                                       
Note: See TracChangeset for help on using the changeset viewer.