Changeset 706

Show
Ignore:
Timestamp:
10/30/09 12:55:40 (3 weeks ago)
Author:
robl
Message:

make printf happy on both 32 and 64 bit platforms

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/header.c

    r704 r706  
    2626#ifndef MIN 
    2727#define MIN(mm,nn) (((mm) < (nn)) ? (mm) : (nn)) 
     28#endif 
     29 
     30#ifdef SIZEOF_INT 
     31# if SIZEOF_INT == 4 
     32#  define lld(x) (x) 
     33# elif  SIZEOF_INT == 8 
     34#  define lld(x) (long long)(x) 
     35# endif 
    2836#endif 
    2937 
     
    12981306#ifdef METADATA_CONSISTENCY_CHECK 
    12991307        if (nc_attr1->nelems != nc_attr2->nelems){ 
    1300            printf("Warning: The number of attributes (root=%d != %d) of NC definations on multiprocesses inconsistent.\n",nc_attr1->nelems,nc_attr2->nelems); 
     1308           printf("Warning: The number of attributes (root=%lld != %lld) of NC definations on multiprocesses inconsistent.\n",lld(nc_attr1->nelems),lld(nc_attr2->nelems)); 
    13011309        } else { 
    13021310                for (i=0; i<nc_attr1->nelems; i++){ 
    13031311                   if (nc_attr1->value[i]->xsz != nc_attr2->value[i]->xsz){ 
    1304                        printf("Warning: The size of attribute (root=%d != %d) of NC definations on multiprocesses inconsistent.\n",nc_attr1->value[i]->xsz,nc_attr2->value[i]->xsz); 
     1312                       printf("Warning: The size of attribute (root=%lld != %lld) of NC definations on multiprocesses inconsistent.\n",lld(nc_attr1->value[i]->xsz),lld(nc_attr2->value[i]->xsz)); 
    13051313                   } 
    13061314                   if ((nc_attr1->value[i]->name->nchars != nc_attr2->value[i]->name->nchars)||(strcmp(nc_attr1->value[i]->name->cp, nc_attr2->value[i]->name->cp))){ 
     
    13141322                   } 
    13151323                   if (nc_attr1->value[i]->nelems != nc_attr2->value[i]->nelems){ 
    1316                     printf("Warning: The length of attribute (root=%d != %d) of NC definations on multiprocesses inconsistent.\n",nc_attr1->value[i]->nelems,nc_attr2->value[i]->nelems); 
     1324                    printf("Warning: The length of attribute (root=%lld != %lld) of NC definations on multiprocesses inconsistent.\n",lld(nc_attr1->value[i]->nelems),lld(nc_attr2->value[i]->nelems)); 
    13171325                   } 
    13181326                }