Changeset 342495


Ignore:
Timestamp:
02/04/13 12:37:37 (15 months ago)
Author:
James Dinan <dinan@…>
Branches:
master
Children:
f71dd6
Parents:
7e56bf
Message:

Fix type incompat. for size_t in BSend degug msgs

This patch updates BSend debugging messages to be compatible with new size_t
arguments added in [7fa7e2cf]. Format strings are updated and size_t args are
cast to unsigned long long. Upconverting to the largest unsinged integer type
is the only safe way to deal with this in pre-C99. If we were coding to C99,
we could have avoided the type cast and used '%z' directly in the format
strings. This closes ticket #1786.

Reviewer: goodell

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mpi/pt2pt/bsendutil.c

    r7fa7e2 r342495  
    335335 
    336336    MPIU_DBG_MSG_FMT(BSEND,TYPICAL,(MPIU_DBG_FDEST, 
    337                  "Freeing bsend segment at %p of size %d, next at %p", 
    338                  p,p->size, ((char *)p)+p->total_size)); 
     337                 "Freeing bsend segment at %p of size %llu, next at %p", 
     338                 p, (unsigned long long) p->size, ((char *)p)+p->total_size)); 
    339339 
    340340    MPIU_DBG_MSG_D(BSEND,TYPICAL, 
    341              "At the begining of free_segment with size %d:", p->total_size ); 
     341                   "At the begining of free_segment with size %llu:", 
     342                   (unsigned long long) p->total_size ); 
    342343    MPIU_DBG_STMT(BSEND,TYPICAL,MPIR_Bsend_dump()); 
    343344 
     
    531532 
    532533    MPIU_DBG_MSG_FMT(BSEND,TYPICAL,(MPIU_DBG_FDEST, 
    533                             "Taking %d bytes from a block with %d bytes\n",  
    534                                     alloc_size, p->total_size )); 
     534                                    "Taking %d bytes from a block with %llu bytes\n", 
     535                                    alloc_size, (unsigned long long) p->total_size )); 
    535536 
    536537    /* Is there enough space left to create a new block? */ 
     
    560561 
    561562        MPIU_DBG_MSG_FMT(BSEND,TYPICAL,(MPIU_DBG_FDEST, 
    562                    "broken blocks p (%d) and new (%d)\n", 
    563                     p->total_size, newp->total_size )); 
     563                                        "broken blocks p (%llu) and new (%llu)\n", 
     564                                        (unsigned long long) p->total_size, 
     565                                        (unsigned long long) newp->total_size )); 
    564566    } 
    565567 
     
    611613    MPIR_Bsend_data_t *a = BsendBuffer.avail; 
    612614 
    613     MPIU_DBG_MSG_D(BSEND,TYPICAL,"Total size is %d",BsendBuffer.buffer_size ); 
     615    MPIU_DBG_MSG_D(BSEND, TYPICAL, "Total size is %llu", 
     616                   (unsigned long long) BsendBuffer.buffer_size); 
    614617    MPIU_DBG_MSG(BSEND,TYPICAL,"Avail list is:" ); 
    615618    while (a) { 
    616         MPIU_DBG_MSG_FMT(BSEND,TYPICAL,(MPIU_DBG_FDEST, 
    617                                 "[%p] totalsize = %d(%x)", a, a->total_size,  
    618                                         a->total_size )); 
     619        MPIU_DBG_MSG_FMT(BSEND, TYPICAL, (MPIU_DBG_FDEST, "[%p] totalsize = %llu(%llx)", 
     620                                          a, (unsigned long long) a->total_size, 
     621                                          (unsigned long long) a->total_size)); 
    619622        if (a == a->next) { 
    620623            MPIU_DBG_MSG(BSEND,TYPICAL, 
     
    628631    a = BsendBuffer.active; 
    629632    while (a) { 
    630         MPIU_DBG_MSG_FMT(BSEND,TYPICAL,(MPIU_DBG_FDEST, 
    631                                 "[%p] totalsize = %d(%x)", a, a->total_size,  
    632                                         a->total_size )); 
     633        MPIU_DBG_MSG_FMT(BSEND, TYPICAL, (MPIU_DBG_FDEST, "[%p] totalsize = %llu(%llx)", 
     634                                          a, (unsigned long long) a->total_size, 
     635                                          (unsigned long long) a->total_size)); 
    633636        if (a == a->next) { 
    634637            MPIU_DBG_MSG(BSEND,TYPICAL, 
Note: See TracChangeset for help on using the changeset viewer.