Skip to content

Commit bdae9b4

Browse files
committed
nc4hdf: use PRId64 for hid_t format strings
1 parent b432a52 commit bdae9b4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

libsrc4/nc4hdf.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
#include <H5DSpublic.h>
2222
#include <math.h>
2323

24+
#ifdef HAVE_INTTYPES_H
25+
#define __STDC_FORMAT_MACROS
26+
#include <inttypes.h>
27+
#endif
28+
2429
#ifdef USE_PARALLEL
2530
#include "netcdf_par.h"
2631
#endif
@@ -4226,10 +4231,10 @@ reportobject(int log, hid_t id, unsigned int type)
42264231
}
42274232
if(log) {
42284233
#ifdef LOGGING
4229-
LOG((0,"Type = %s(%8u) name='%s'",typename,id,name));
4234+
LOG((0,"Type = %s(%8" PRId64 ") name='%s'",typename,id,name));
42304235
#endif
42314236
} else {
4232-
fprintf(stderr,"Type = %s(%8u) name='%s'",typename,(unsigned int)id,name);
4237+
fprintf(stderr,"Type = %s(%8" PRId64 ") name='%s'",typename,id,name);
42334238
}
42344239
}
42354240

@@ -4253,10 +4258,10 @@ reportopenobjectsT(int log, hid_t fid, int ntypes, unsigned int* otypes)
42534258

42544259
if(log) {
42554260
#ifdef LOGGING
4256-
LOG((0,"\nReport: open objects on %d\n",fid));
4261+
LOG((0,"\nReport: open objects on %" PRId64 "\n",fid));
42574262
#endif
42584263
} else {
4259-
fprintf(stdout,"\nReport: open objects on %d\n",(int)fid);
4264+
fprintf(stdout,"\nReport: open objects on %" PRId64 "\n",fid);
42604265
}
42614266
maxobjs = H5Fget_obj_count(fid,H5F_OBJ_ALL);
42624267
if(idlist != NULL) free(idlist);

0 commit comments

Comments
 (0)