summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/freebsd11
-rw-r--r--hl/tools/gif2h5/readhdf.c4
-rw-r--r--hl/tools/gif2h5/writehdf.c3
-rw-r--r--src/H5.c12
-rw-r--r--src/H5A.c4
-rw-r--r--src/H5B.c12
-rw-r--r--src/H5Bpkg.h2
-rw-r--r--src/H5Dprivate.h2
-rw-r--r--src/H5F.c21
-rw-r--r--src/H5Fpkg.h10
-rw-r--r--src/H5G.c2
-rw-r--r--src/H5Gpkg.h2
-rw-r--r--src/H5Opkg.h2
-rw-r--r--src/H5P.c20
-rw-r--r--test/bittests.c14
-rw-r--r--test/dsets.c2
-rw-r--r--test/testmeta.c6
-rw-r--r--tools/gifconv/readhdf.c4
-rw-r--r--tools/gifconv/writehdf.c3
-rw-r--r--tools/lib/h5tools_str.c14
20 files changed, 69 insertions, 81 deletions
diff --git a/config/freebsd b/config/freebsd
index 4619beb..911a9aa 100644
--- a/config/freebsd
+++ b/config/freebsd
@@ -11,16 +11,17 @@ if test "X-" = "X-$CC"; then
CC_BASENAME=gcc
fi
-# Add "_POSIX_C_SOURCE" define to cpp flags, to quiet warnings
+# Add "_XOPEN_SOURCE" define to cpp flags, to quiet warnings
# from /usr/include/sys/cdefs.h
-CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=1"
+CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600"
-# Figure out compiler flags
+# Figure out C compiler flags
. $srcdir/config/gnu-flags
# Special setup to use pthread support if enable-threadsafe is on.
# Works with static executable only.
if test "X-" != "X-$enable_threadsafe"; then
- CFLAGS="$CFLAGS -D_THREAD_SAFE"
- LDFLAGS="$LDFLAGS -pthread"
+ CFLAGS="$CFLAGS -D_THREAD_SAFE"
+ CXXFLAGS="$CXXFLAGS -D_THREAD_SAFE"
+ LDFLAGS="$LDFLAGS -pthread"
fi
diff --git a/hl/tools/gif2h5/readhdf.c b/hl/tools/gif2h5/readhdf.c
index 4b05ad9..2720d4d 100644
--- a/hl/tools/gif2h5/readhdf.c
+++ b/hl/tools/gif2h5/readhdf.c
@@ -86,7 +86,7 @@ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size,
return -1;
}
if (H5Tget_size(dtype) != 1) {
- fprintf(stderr , "Data is %d bytes per pixel. Cannot convert to GIF\n",H5Tget_size(dtype));
+ fprintf(stderr , "Data is %d bytes per pixel. Cannot convert to GIF\n",(int)H5Tget_size(dtype));
return -1;
}
@@ -141,7 +141,7 @@ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size,
return -1;
}
if (H5Tget_size(pal_dtype) != 1) {
- fprintf(stderr , "Palette data is %d bytes per pixel. Cannot convert to GIF\n",H5Tget_size(pal_dtype));
+ fprintf(stderr , "Palette data is %d bytes per pixel. Cannot convert to GIF\n",(int)H5Tget_size(pal_dtype));
return -1;
}
diff --git a/hl/tools/gif2h5/writehdf.c b/hl/tools/gif2h5/writehdf.c
index 7df7f29..d343aae 100644
--- a/hl/tools/gif2h5/writehdf.c
+++ b/hl/tools/gif2h5/writehdf.c
@@ -25,7 +25,6 @@ static int write_text_attribute(hid_t dataset_id , const char *attr_name,
const char *attr_value, const size_t attr_len)
{
/* variables for the attributes */
- hsize_t attr_dims; /* dimensions for the attribute */
hsize_t attr_size; /* dimensions for the attribute */
hid_t attr_dataspace_id; /* dataspaces needed for the various attributes */
hid_t attr_attr_id; /* attribute id */
@@ -35,8 +34,6 @@ static int write_text_attribute(hid_t dataset_id , const char *attr_name,
if (!attr_name || !attr_value)
return -1;
- attr_dims = 1;
-
/* figure out size of the data */
attr_size = (hsize_t)attr_len;
diff --git a/src/H5.c b/src/H5.c
index de41d2c..ae4fbdc 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -601,7 +601,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
/* Mention the versions we are referring to */
HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n",
majnum, minnum, relnum,
- H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE);
+ (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR, (unsigned)H5_VERS_RELEASE);
/* Bail out now. */
HDfputs ("Bye...\n", stderr);
@@ -621,7 +621,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
/* Mention the versions we are referring to */
HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n",
majnum, minnum, relnum,
- H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE);
+ (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR, (unsigned)H5_VERS_RELEASE);
break;
} /* end switch */
@@ -1280,16 +1280,16 @@ H5_timer_begin (H5_timer_t *timer)
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage (RUSAGE_SELF, &rusage);
timer->utime = (double)rusage.ru_utime.tv_sec +
- (double)rusage.ru_utime.tv_usec/1e6;
+ ((double)rusage.ru_utime.tv_usec/1e6);
timer->stime = (double)rusage.ru_stime.tv_sec +
- (double)rusage.ru_stime.tv_usec/1e6;
+ ((double)rusage.ru_stime.tv_usec/1e6);
#else
timer->utime = 0.0;
timer->stime = 0.0;
#endif
#ifdef H5_HAVE_GETTIMEOFDAY
HDgettimeofday (&etime, NULL);
- timer->etime = (double)etime.tv_sec + (double)etime.tv_usec/1e6;
+ timer->etime = (double)etime.tv_sec + ((double)etime.tv_usec/1e6);
#else
timer->etime = 0.0;
#endif
@@ -1558,7 +1558,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
if (argname) {
unsigned n = (unsigned)MAX (0, (int)HDstrlen(argname)-3); /*lint !e666 Allow expression with side effects */
if (!HDstrcmp (argname+n, "_id")) {
- HDstrncpy (buf, argname, MIN ((int)sizeof(buf)-1, n));
+ HDstrncpy (buf, argname, (size_t)MIN ((int)sizeof(buf)-1, n));
buf[MIN((int)sizeof(buf)-1, n)] = '\0';
argname = buf;
}
diff --git a/src/H5A.c b/src/H5A.c
index 1eb9374..57badd5 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -692,7 +692,7 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id)
HDmemcpy(tconv_buf,buf,(src_type_size*nelmts));
/* Perform datatype conversion */
- if (H5T_convert(tpath, src_id, dst_id, nelmts, 0, 0, tconv_buf, bkg_buf, dxpl_id)<0)
+ if (H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id)<0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed")
/* Free the previous attribute data buffer, if there is one */
@@ -858,7 +858,7 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id)
HDmemcpy(tconv_buf,attr->data,(src_type_size*nelmts));
/* Perform datatype conversion. */
- if (H5T_convert(tpath, src_id, dst_id, nelmts, 0, 0, tconv_buf, bkg_buf, dxpl_id)<0)
+ if (H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id)<0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed")
/* Copy the converted data into the user's buffer */
diff --git a/src/H5B.c b/src/H5B.c
index e53ec86..55f4b73 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -229,7 +229,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata,
shared=H5RC_GET_OBJ(bt->rc_shared);
HDassert(shared);
if (NULL==(bt->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) ||
- NULL==(bt->child=H5FL_SEQ_MALLOC(haddr_t,shared->two_k)))
+ NULL==(bt->child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree root node")
if (HADDR_UNDEF==(*addr_p=H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)shared->sizeof_rnode)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for B-tree root node")
@@ -306,7 +306,7 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata)
shared=H5RC_GET_OBJ(bt->rc_shared);
HDassert(shared);
if (NULL==(bt->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) ||
- NULL==(bt->child=H5FL_SEQ_MALLOC(haddr_t,shared->two_k)))
+ NULL==(bt->child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
if (H5F_block_read(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page)<0)
@@ -315,7 +315,7 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata)
p = shared->page;
/* magic number */
- if (HDmemcmp(p, H5B_MAGIC, H5B_SIZEOF_MAGIC))
+ if (HDmemcmp(p, H5B_MAGIC, (size_t)H5B_SIZEOF_MAGIC))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree signature")
p += 4;
@@ -399,7 +399,7 @@ H5B_serialize(const H5F_t *f, const H5B_t *bt)
p = shared->page;
/* magic number */
- HDmemcpy(p, H5B_MAGIC, H5B_SIZEOF_MAGIC);
+ HDmemcpy(p, H5B_MAGIC, (size_t)H5B_SIZEOF_MAGIC);
p += 4;
/* node type and level */
@@ -1526,7 +1526,7 @@ H5B_iterate (H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op
* We've reached the left-most leaf. Now follow the right-sibling
* pointer from leaf to leaf until we've processed all leaves.
*/
- if (NULL==(child=H5FL_SEQ_MALLOC(haddr_t,shared->two_k)) ||
+ if (NULL==(child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k)) ||
NULL==(key=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
@@ -2097,7 +2097,7 @@ H5B_copy(const H5B_t *old_bt)
HDmemcpy(new_node,old_bt,sizeof(H5B_t));
if ( NULL==(new_node->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) ||
- NULL==(new_node->child=H5FL_SEQ_MALLOC(haddr_t,shared->two_k)))
+ NULL==(new_node->child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree root node")
/* Copy the other structures */
diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h
index 37047e7..74fa393 100644
--- a/src/H5Bpkg.h
+++ b/src/H5Bpkg.h
@@ -49,9 +49,9 @@ struct H5B_t {
/* first field in structure */
H5RC_t *rc_shared; /*ref-counted shared info */
unsigned level; /*node level */
+ unsigned nchildren; /*number of child pointers */
haddr_t left; /*address of left sibling */
haddr_t right; /*address of right sibling */
- unsigned nchildren; /*number of child pointers */
uint8_t *native; /*array of keys in native format */
haddr_t *child; /*2k child pointers */
};
diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h
index d6708f1..1f32c5d 100644
--- a/src/H5Dprivate.h
+++ b/src/H5Dprivate.h
@@ -194,12 +194,12 @@ typedef struct H5D_dxpl_cache_t {
void *tconv_buf; /* Temporary conversion buffer (H5D_XFER_TCONV_BUF_NAME) */
void *bkgr_buf; /* Background conversion buffer (H5D_XFER_BKGR_BUF_NAME) */
H5T_bkg_t bkgr_buf_type; /* Background buffer type (H5D_XFER_BKGR_BUF_NAME) */
+ H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */
double btree_split_ratio[3];/* B-tree split ratios (H5D_XFER_BTREE_SPLIT_RATIO_NAME) */
size_t vec_size; /* Size of hyperslab vector (H5D_XFER_HYPER_VECTOR_SIZE_NAME) */
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */
#endif /*H5_HAVE_PARALLEL*/
- H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */
H5Z_cb_t filter_cb; /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */
} H5D_dxpl_cache_t;
diff --git a/src/H5F.c b/src/H5F.c
index 5ecf3ba..dd6485e 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -1294,9 +1294,9 @@ H5F_locate_signature(H5FD_t *file, hid_t dxpl_id)
addr = (8==n) ? 0 : (haddr_t)1 << n;
if (H5FD_set_eoa(file, addr+H5F_SIGNATURE_LEN)<0)
HGOTO_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF, "unable to set EOA value for file signature")
- if (H5FD_read(file, H5FD_MEM_SUPER, dxpl_id, addr, H5F_SIGNATURE_LEN, buf)<0)
+ if (H5FD_read(file, H5FD_MEM_SUPER, dxpl_id, addr, (size_t)H5F_SIGNATURE_LEN, buf)<0)
HGOTO_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF, "unable to read file signature")
- if (!HDmemcmp(buf, H5F_SIGNATURE, H5F_SIGNATURE_LEN))
+ if (!HDmemcmp(buf, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN))
break;
}
@@ -2399,7 +2399,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent)
UINT32DECODE(p, driver_size);
/* Driver name and/or version */
- HDstrncpy(driver_name, (const char *)p, 8);
+ HDstrncpy(driver_name, (const char *)p, (size_t)8);
driver_name[8] = '\0';
p += 8; /* advance past name/version */
@@ -2602,7 +2602,7 @@ H5F_write_superblock(H5F_t *f, hid_t dxpl_id)
/* Encode the file super block */
p = sbuf;
- HDmemcpy(p, H5F_SIGNATURE, H5F_SIGNATURE_LEN);
+ HDmemcpy(p, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN);
p += H5F_SIGNATURE_LEN;
*p++ = (uint8_t)super_vers;
*p++ = (uint8_t)freespace_vers;
@@ -2665,7 +2665,7 @@ H5F_write_superblock(H5F_t *f, hid_t dxpl_id)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information")
/* Driver name */
- HDmemcpy(dbuf + 8, driver_name, 8);
+ HDmemcpy(dbuf + 8, driver_name, (size_t)8);
} /* end if */
/* Compute super block checksum */
@@ -2901,7 +2901,7 @@ H5F_close(H5F_t *f)
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5F_close, FAIL)
+ FUNC_ENTER_NOAPI_NOINIT(H5F_close)
assert(f->nrefs>0);
@@ -3030,7 +3030,7 @@ H5F_close(H5F_t *f)
int i; /* Local index variable */
/* Get the list of IDs of open dataset objects */
- while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_DATASET, (sizeof(objs)/sizeof(objs[0])), objs))!=0) {
+ while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_DATASET, (int)(sizeof(objs)/sizeof(objs[0])), objs))!=0) {
/* Try to close all the open objects */
for(i=0; i<obj_count; i++)
@@ -3039,7 +3039,7 @@ H5F_close(H5F_t *f)
} /* end while */
/* Get the list of IDs of open group objects */
- while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_GROUP, (sizeof(objs)/sizeof(objs[0])), objs))!=0) {
+ while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_GROUP, (int)(sizeof(objs)/sizeof(objs[0])), objs))!=0) {
/* Try to close all the open objects */
for(i=0; i<obj_count; i++)
@@ -3048,7 +3048,7 @@ H5F_close(H5F_t *f)
} /* end while */
/* Get the list of IDs of open named datatype objects */
- while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_DATATYPE, (sizeof(objs)/sizeof(objs[0])), objs))!=0) {
+ while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_DATATYPE, (int)(sizeof(objs)/sizeof(objs[0])), objs))!=0) {
/* Try to close all the open objects */
for(i=0; i<obj_count; i++)
@@ -3057,7 +3057,7 @@ H5F_close(H5F_t *f)
} /* end while */
/* Get the list of IDs of open attribute objects */
- while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_ATTR, (sizeof(objs)/sizeof(objs[0])), objs))!=0) {
+ while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_ATTR, (int)(sizeof(objs)/sizeof(objs[0])), objs))!=0) {
/* Try to close all the open objects */
for(i=0; i<obj_count; i++)
@@ -4624,4 +4624,3 @@ H5Fget_name(hid_t obj_id, char *name/*out*/, size_t size)
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fget_name() */
-
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 7997524..642b9d9 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -78,16 +78,16 @@
* pointing to this struct.
*/
typedef struct H5F_file_t {
- unsigned flags; /* Access Permissions for file */
H5FD_t *lf; /* Lower level file handle for I/O */
unsigned nrefs; /* Ref count for times file is opened */
uint32_t consist_flags; /* File Consistency Flags */
+ unsigned flags; /* Access Permissions for file */
/* Cached values from FCPL */
- size_t sizeof_addr; /* Size of addresses in file */
- size_t sizeof_size; /* Size of offsets in file */
unsigned sym_leaf_k; /* Size of leaves in symbol tables */
unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree key values for each type */
+ size_t sizeof_addr; /* Size of addresses in file */
+ size_t sizeof_size; /* Size of offsets in file */
haddr_t super_addr; /* Absolute address of super block */
haddr_t base_addr; /* Absolute base address for rel.addrs. */
haddr_t freespace_addr; /* Relative address of free-space info */
@@ -98,6 +98,7 @@ typedef struct H5F_file_t {
H5AC_t *cache; /* The object cache */
hid_t fcpl_id; /* File creation property list ID */
int mdc_nelmts; /* Size of meta data cache (elements) */
+ H5F_close_degree_t fc_degree; /* File close behavior degree */
size_t rdcc_nelmts; /* Size of raw data chunk cache (elmts) */
size_t rdcc_nbytes; /* Size of raw data chunk cache (bytes) */
double rdcc_w0; /* Preempt read chunks first? [0.0..1.0]*/
@@ -105,11 +106,10 @@ typedef struct H5F_file_t {
hsize_t threshold; /* Threshold for alignment */
hsize_t alignment; /* Alignment */
unsigned gc_ref; /* Garbage-collect references? */
- struct H5G_t *root_grp; /* Open root group */
int ncwfs; /* Num entries on cwfs list */
struct H5HG_heap_t **cwfs; /* Global heap cache */
+ struct H5G_t *root_grp; /* Open root group */
H5FO_t *open_objs; /* Open objects in file */
- H5F_close_degree_t fc_degree; /* File close behavior degree */
H5RC_t *grp_btree_shared; /* Ref-counted group B-tree node info */
} H5F_file_t;
diff --git a/src/H5G.c b/src/H5G.c
index f75932a..44e23a4 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -1741,7 +1741,7 @@ H5G_mkroot (H5F_t *f, hid_t dxpl_id, H5G_entry_t *ent)
if (!ent) {
ent = &new_root;
HDmemset(ent, 0, sizeof(H5G_entry_t));
- if (H5G_stab_create (f, dxpl_id, H5G_SIZE_HINT, ent/*out*/)<0)
+ if (H5G_stab_create (f, dxpl_id, (size_t)H5G_SIZE_HINT, ent/*out*/)<0)
HGOTO_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "unable to create root group");
if (1 != H5O_link (ent, 1, dxpl_id))
HGOTO_ERROR (H5E_SYM, H5E_LINK, FAIL, "internal error (wrong link count)");
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index c0f00ee..bc14364 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -97,9 +97,9 @@ typedef struct H5G_bt_ud2_t {
/* downward */
hid_t group_id; /*group id to pass to iteration operator */
H5G_entry_t *ent; /*the entry to which group_id points */
- int skip; /*initial entries to skip */
H5G_iterate_t op; /*iteration operator */
void *op_data; /*user-defined operator data */
+ int skip; /*initial entries to skip */
/* upward */
int final_ent; /*final entry looked at */
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index 5735d9c..116c223 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -77,10 +77,10 @@ typedef struct H5O_mesg_t {
const H5O_class_t *type; /*type of message */
hbool_t dirty; /*raw out of date wrt native */
uint8_t flags; /*message flags */
+ unsigned chunkno; /*chunk number for this mesg */
void *native; /*native format message */
uint8_t *raw; /*ptr to raw data */
size_t raw_size; /*size with alignment */
- unsigned chunkno; /*chunk number for this mesg */
} H5O_mesg_t;
typedef struct H5O_chunk_t {
diff --git a/src/H5P.c b/src/H5P.c
index 8bf560a..5720de7 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -489,11 +489,11 @@ H5P_copy_plist(H5P_genplist_t *old_plist)
/* Initialize the skip list to hold the changed properties */
if((new_plist->props=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL)
- HGOTO_ERROR(H5E_PLIST,H5E_CANTMAKETREE,FAIL,"can't create skip list for changed properties");
+ HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for changed properties");
/* Create the skip list for deleted properties */
if((new_plist->del=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL)
- HGOTO_ERROR(H5E_PLIST,H5E_CANTMAKETREE,FAIL,"can't create skip list for deleted properties");
+ HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for deleted properties");
/* Create the skip list to hold names of properties already seen
* (This prevents a property in the class hierarchy from having it's
@@ -501,7 +501,7 @@ H5P_copy_plist(H5P_genplist_t *old_plist)
* already been seen)
*/
if((seen=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL)
- HGOTO_ERROR(H5E_PLIST,H5E_CANTMAKETREE,FAIL,"can't create skip list for seen properties");
+ HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties");
nseen=0;
/* Cycle through the deleted properties & copy them into the new list's deleted section */
@@ -1363,7 +1363,7 @@ H5P_create_class(H5P_genclass_t *par_class, const char *name, unsigned internal,
/* Create the skip list for properties */
if((pclass->props=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL)
- HGOTO_ERROR(H5E_PLIST,H5E_CANTMAKETREE,NULL,"can't create skip list for properties");
+ HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for properties");
/* Set callback functions and pass-along data */
pclass->create_func = cls_create;
@@ -1527,11 +1527,11 @@ H5P_create(H5P_genclass_t *pclass)
/* Create the skip list for changed properties */
if((plist->props=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL)
- HGOTO_ERROR(H5E_PLIST,H5E_CANTMAKETREE,NULL,"can't create skip list for changed properties");
+ HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for changed properties");
/* Create the skip list for deleted properties */
if((plist->del=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL)
- HGOTO_ERROR(H5E_PLIST,H5E_CANTMAKETREE,NULL,"can't create skip list for deleted properties");
+ HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for deleted properties");
/* Create the skip list to hold names of properties already seen
* (This prevents a property in the class hierarchy from having it's
@@ -1539,7 +1539,7 @@ H5P_create(H5P_genclass_t *pclass)
* already been seen)
*/
if((seen=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL)
- HGOTO_ERROR(H5E_PLIST,H5E_CANTMAKETREE,NULL,"can't create skip list for seen properties");
+ HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for seen properties");
/*
* Check if we should copy class properties (up through list of parent classes also),
@@ -3886,7 +3886,7 @@ H5P_iterate_plist(hid_t plist_id, int *idx, H5P_iterate_t iter_func, void *iter_
/* Create the skip list to hold names of properties already seen */
if((seen=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL)
- HGOTO_ERROR(H5E_PLIST,H5E_CANTMAKETREE,FAIL,"can't create skip list for seen properties");
+ HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties");
/* Walk through the changed properties in the list */
if(H5SL_count(plist->props)>0) {
@@ -5098,7 +5098,7 @@ H5P_close(void *_plist)
H5SL_t *seen=NULL; /* Skip list to hold names of properties already seen */
size_t nseen; /* Number of items 'seen' */
hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */
- ssize_t ndel; /* Number of items deleted */
+ size_t ndel; /* Number of items deleted */
H5SL_node_t *curr_node; /* Current node in skip list */
H5P_genprop_t *tmp; /* Temporary pointer to properties */
unsigned make_cb=0; /* Operator data for property free callback */
@@ -5120,7 +5120,7 @@ H5P_close(void *_plist)
* already been seen)
*/
if((seen=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL)
- HGOTO_ERROR(H5E_PLIST,H5E_CANTMAKETREE,FAIL,"can't create skip list for seen properties");
+ HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties");
nseen=0;
/* Walk through the changed properties in the list */
diff --git a/test/bittests.c b/test/bittests.c
index a59ea02..6e5f7da 100644
--- a/test/bittests.c
+++ b/test/bittests.c
@@ -174,9 +174,9 @@ test_copy (void)
TESTING("bit copy operations");
for (i=0; i<NTESTS; i++) {
- s_offset = rand() % (8*sizeof v1);
- d_offset = rand() % (8*sizeof v2);
- size = (unsigned)rand() % MIN (8*sizeof(v1), 8*sizeof(v2));
+ s_offset = HDrand() % (8*sizeof v1);
+ d_offset = HDrand() % (8*sizeof v2);
+ size = (unsigned)HDrand() % MIN (8*sizeof(v1), 8*sizeof(v2));
size = MIN3 (size, 8*sizeof(v1)-s_offset, 8*sizeof(v2)-d_offset);
memset (v1, 0xff, sizeof v1);
memset (v2, 0x00, sizeof v2);
@@ -296,8 +296,8 @@ test_set (void)
TESTING("bit set operations");
for (i=0; i<NTESTS; i++) {
- d_offset = rand() % (8*sizeof v2);
- size = (unsigned)rand() % (8*sizeof(v2));
+ d_offset = HDrand() % (8*sizeof v2);
+ size = (unsigned)HDrand() % (8*sizeof(v2));
size = MIN (size, 8*sizeof(v2)-d_offset);
memset (v2, 0x00, sizeof v2);
@@ -413,8 +413,8 @@ test_clear (void)
TESTING("bit clear operations");
for (i=0; i<NTESTS; i++) {
- d_offset = rand() % (8*sizeof v2);
- size = (unsigned)rand() % (8*sizeof(v2));
+ d_offset = HDrand() % (8*sizeof v2);
+ size = (unsigned)HDrand() % (8*sizeof(v2));
size = MIN (size, 8*sizeof(v2)-d_offset);
memset (v2, 0xff, sizeof v2);
diff --git a/test/dsets.c b/test/dsets.c
index ead0c43..c979b4a 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -2398,7 +2398,7 @@ error:
* Failure: -1
*
* Programmer: Kent Yang
- * Wednesday, , 2002 Nov. 13th
+ * Wednesday, Nov. 13th, 2002
*
* Modifications:
*
diff --git a/test/testmeta.c b/test/testmeta.c
index c7edafc..03fd841 100644
--- a/test/testmeta.c
+++ b/test/testmeta.c
@@ -41,8 +41,8 @@
int main(void)
{
hid_t file_id, prop_id, memspace_id, type_id;
- hid_t group_id, access_plist;
- hid_t dataset_id, dataspace_id, s_dataspace_id;
+ hid_t group_id;
+ hid_t dataset_id, dataspace_id;
herr_t status;
hsize_t dims[1];
hsize_t maxdims[1];
@@ -51,7 +51,7 @@ int main(void)
unsigned numdataobj = 0;
unsigned i, j;
char name[80];
- hssize_t start[1] = {0};
+ hsize_t start[1] = {0};
hsize_t stride[1] = {1};
hsize_t count[1] = {1};
diff --git a/tools/gifconv/readhdf.c b/tools/gifconv/readhdf.c
index 4b05ad9..2720d4d 100644
--- a/tools/gifconv/readhdf.c
+++ b/tools/gifconv/readhdf.c
@@ -86,7 +86,7 @@ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size,
return -1;
}
if (H5Tget_size(dtype) != 1) {
- fprintf(stderr , "Data is %d bytes per pixel. Cannot convert to GIF\n",H5Tget_size(dtype));
+ fprintf(stderr , "Data is %d bytes per pixel. Cannot convert to GIF\n",(int)H5Tget_size(dtype));
return -1;
}
@@ -141,7 +141,7 @@ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size,
return -1;
}
if (H5Tget_size(pal_dtype) != 1) {
- fprintf(stderr , "Palette data is %d bytes per pixel. Cannot convert to GIF\n",H5Tget_size(pal_dtype));
+ fprintf(stderr , "Palette data is %d bytes per pixel. Cannot convert to GIF\n",(int)H5Tget_size(pal_dtype));
return -1;
}
diff --git a/tools/gifconv/writehdf.c b/tools/gifconv/writehdf.c
index 7df7f29..d343aae 100644
--- a/tools/gifconv/writehdf.c
+++ b/tools/gifconv/writehdf.c
@@ -25,7 +25,6 @@ static int write_text_attribute(hid_t dataset_id , const char *attr_name,
const char *attr_value, const size_t attr_len)
{
/* variables for the attributes */
- hsize_t attr_dims; /* dimensions for the attribute */
hsize_t attr_size; /* dimensions for the attribute */
hid_t attr_dataspace_id; /* dataspaces needed for the various attributes */
hid_t attr_attr_id; /* attribute id */
@@ -35,8 +34,6 @@ static int write_text_attribute(hid_t dataset_id , const char *attr_name,
if (!attr_name || !attr_value)
return -1;
- attr_dims = 1;
-
/* figure out size of the data */
attr_size = (hsize_t)attr_len;
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 2d34d94..24a68a6 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -310,10 +310,10 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt)
char *
h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5dump_t *info,
hsize_t elmtno, int ndims, hsize_t min_idx[],
- hsize_t max_idx[],h5tools_context_t *ctx)
+ hsize_t max_idx[], h5tools_context_t *ctx)
{
- hsize_t p_prod[H5S_MAX_RANK], p_idx[H5S_MAX_RANK];
- hsize_t n, i = 0;
+ hsize_t p_prod[H5S_MAX_RANK];
+ hsize_t i = 0;
hsize_t curr_pos=elmtno;
h5tools_str_reset(str);
@@ -326,12 +326,6 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5dump_t *info,
for (i = ndims - 1, p_prod[ndims - 1] = 1; i > 0; --i)
p_prod[i - 1] = (max_idx[i] - min_idx[i]) * p_prod[i];
- /* Calculate the index values from the element number. */
- for (i = 0, n = elmtno; i < (hsize_t)ndims; i++) {
- p_idx[i] = n / p_prod[i] + min_idx[i];
- n %= p_prod[i];
- }
-
for ( i = 0; i < (hsize_t)ndims; i++)
{
ctx->pos[i] = curr_pos/ctx->acc[i];
@@ -345,7 +339,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5dump_t *info,
h5tools_str_append(str, "%s", OPT(info->idx_sep, ","));
h5tools_str_append(str, OPT(info->idx_n_fmt, "%lu"),
- (unsigned long) ctx->pos[i]);
+ (unsigned long)ctx->pos[i]);
}
} else {
/* Scalar */