summaryrefslogtreecommitdiffstats
path: root/doc/SaveResult.3
Commit message (Expand)AuthorAgeFilesLines
* merged tcl 8.1 branch back into the main trunkstanton1999-04-161-0/+65
div class='hunk'>@@ -115,8 +115,8 @@ H5AC_dest(H5F_t *f)
}
#ifdef H5AC_DEBUG
{
- intn i;
- for (i = 0; i < cache->nslots; i++) {
+ uintn i;
+ for (i=0; i<cache->nslots; i++) {
cache->slot[i].prot = H5MM_xfree(cache->slot[i].prot);
cache->slot[i].aprots = 0;
cache->slot[i].nprots = 0;
@@ -345,7 +345,7 @@ H5AC_flush(H5F_t *f, const H5AC_class_t *type, const haddr_t *addr,
void *) = NULL;
H5AC_slot_t *slot;
intn *map = NULL;
- intn nslots;
+ uintn nslots;
H5AC_t *cache = NULL;
FUNC_ENTER(H5AC_flush, FAIL);
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index b17bf33..ec17bd4e 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -92,7 +92,7 @@ typedef struct H5AC_slot_t {
} H5AC_slot_t;
typedef struct H5AC_t {
- intn nslots; /*number of cache slots */
+ uintn nslots; /*number of cache slots */
H5AC_slot_t *slot; /*the cache slots */
intn nprots; /*number of protected objects */
struct {
diff --git a/src/H5D.c b/src/H5D.c
index 8df99c0..8d29685 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -749,7 +749,7 @@ H5D_create(H5G_t *loc, const char *name, const H5T_t *type, const H5S_t *space,
/* Total raw data size */
new_dset->layout.type = new_dset->create_parms->layout;
new_dset->layout.ndims = H5S_get_ndims(space) + 1;
- assert(new_dset->layout.ndims <= NELMTS(new_dset->layout.dim));
+ assert((unsigned)(new_dset->layout.ndims) <= NELMTS(new_dset->layout.dim));
new_dset->layout.dim[new_dset->layout.ndims - 1] = H5T_get_size(type);
switch (new_dset->create_parms->layout) {
diff --git a/src/H5Distore.c b/src/H5Distore.c
index c75a3b7..c737d9d 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -119,7 +119,7 @@ H5B_class_t H5B_ISTORE[1] = {{
*-------------------------------------------------------------------------
*/
static size_t
-H5F_istore_sizeof_rkey(H5F_t *f, const void *_udata)
+H5F_istore_sizeof_rkey(H5F_t *f __attribute__((unused)), const void *_udata)
{
const H5F_istore_ud1_t *udata = (const H5F_istore_ud1_t *) _udata;
size_t nbytes;
@@ -245,7 +245,8 @@ H5F_istore_encode_key(H5F_t *f, H5B_t *bt, uint8 *raw, void *_key)
*-------------------------------------------------------------------------
*/
static intn
-H5F_istore_cmp2(H5F_t *f, void *_lt_key, void *_udata, void *_rt_key)
+H5F_istore_cmp2(H5F_t *f __attribute__((unused)), void *_lt_key,
+ void *_udata, void *_rt_key)
{
H5F_istore_key_t *lt_key = (H5F_istore_key_t *) _lt_key;
H5F_istore_key_t *rt_key = (H5F_istore_key_t *) _rt_key;
@@ -296,7 +297,8 @@ H5F_istore_cmp2(H5F_t *f, void *_lt_key, void *_udata, void *_rt_key)
*-------------------------------------------------------------------------
*/
static intn
-H5F_istore_cmp3(H5F_t *f, void *_lt_key, void *_udata, void *_rt_key)
+H5F_istore_cmp3(H5F_t *f __attribute__((unused)),
+ void *_lt_key, void *_udata, void *_rt_key)
{
H5F_istore_key_t *lt_key = (H5F_istore_key_t *) _lt_key;
H5F_istore_key_t *rt_key = (H5F_istore_key_t *) _rt_key;
@@ -422,7 +424,7 @@ H5F_istore_new_node(H5F_t *f, H5B_ins_t op,
*/
static herr_t
H5F_istore_found(H5F_t *f, const haddr_t *addr, const void *_lt_key,
- void *_udata, const void *_rt_key)
+ void *_udata, const void *_rt_key __attribute__((unused)))
{
H5F_istore_ud1_t *udata = (H5F_istore_ud1_t *) _udata;
const H5F_istore_key_t *lt_key = (const H5F_istore_key_t *) _lt_key;
diff --git a/src/H5E.c b/src/H5E.c
index d8952fd..afe031a 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -374,7 +374,7 @@ H5Ewalk_cb(int n, H5E_error_t *err_desc, void *client_data)
const char *
H5Eget_major (H5E_major_t n)
{
- int i;
+ uintn i;
/*
* WARNING: Do not call the FUNC_ENTER() or FUNC_LEAVE() macros since
@@ -413,7 +413,7 @@ H5Eget_major (H5E_major_t n)
const char *
H5Eget_minor (H5E_minor_t n)
{
- int i;
+ uintn i;
/*
* WARNING: Do not call the FUNC_ENTER() or FUNC_LEAVE() macros since
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h
index 885ad44..819a401 100644
--- a/src/H5Eprivate.h
+++ b/src/H5Eprivate.h
@@ -96,7 +96,7 @@ typedef struct H5E_minor_mesg_t {
/* An error stack */
typedef struct H5E_t {
- uintn nused; /*num slots currently used in stack */
+ intn nused; /*num slots currently used in stack */
H5E_error_t slot[H5E_NSLOTS]; /*array of error records */
} H5E_t;
diff --git a/src/H5F.c b/src/H5F.c
index ae9254c..e6d649a 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -213,10 +213,10 @@ H5F_encode_length_unusual(const H5F_t *f, uint8 **p, uint8 *l)
/*
* For non-little-endian platforms, encode each byte in memory backwards.
*/
- for (; i >= 0; i--, (*p)++) *(*p) = *(l + i);
+ for (/*void*/; i>=0; i--, (*p)++)*(*p) = *(l+i);
#else
/* platform has little-endian integers */
- HDmemcpy(*p,l,i+1);
+ HDmemcpy(*p,l,(size_t)(i+1));
*p+=(i+1);
#endif
@@ -914,7 +914,7 @@ H5F_open(const char *name, uintn flags,
/* nothing to check for consistency flags */
- assert(p - buf == fixed_size);
+ assert((size_t)(p-buf) == fixed_size);
/* Read the variable length part of the boot block... */
variable_size = H5F_SIZEOF_ADDR(f) + /*base address */
@@ -1275,13 +1275,13 @@ H5F_flush(H5F_t *f, hbool_t invalidate)
/* update file length if necessary */
if (!H5F_addr_defined(&(f->shared->hdf5_eof))) {
H5F_addr_reset(&(f->shared->hdf5_eof));
- H5F_addr_inc(&(f->shared->hdf5_eof), p - buf);
+ H5F_addr_inc(&(f->shared->hdf5_eof), (size_t)(p-buf));
H5F_low_seteof(f->shared->lf, &(f->shared->hdf5_eof));
}
/* write the boot block to disk */
if (H5F_low_write(f->shared->lf, &(f->shared->access_parms),
- &(f->shared->boot_addr), p-buf, buf)<0) {
+ &(f->shared->boot_addr), (size_t)(p-buf), buf)<0) {
HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "can't write header");
}
diff --git a/src/H5Farray.c b/src/H5Farray.c
index eb7d7b1..08aeac4 100644
--- a/src/H5Farray.c
+++ b/src/H5Farray.c
@@ -195,7 +195,7 @@ H5F_arr_read (H5F_t *f, const struct H5O_layout_t *layout,
/* Decrement indices and advance pointers */
for (j=ndims-1, carray=TRUE; j>=0 && carray; --j) {
- H5F_addr_inc (&addr, file_stride[j]);
+ H5F_addr_adj (&addr, file_stride[j]);
buf += mem_stride[j];
if (--idx[j]) carray = FALSE;
@@ -346,7 +346,7 @@ H5F_arr_write (H5F_t *f, const struct H5O_layout_t *layout,
/* Decrement indices and advance pointers */
for (j=ndims-1, carray=TRUE; j>=0 && carray; --j) {
- H5F_addr_inc (&addr, file_stride[j]);
+ H5F_addr_adj (&addr, file_stride[j]);
buf += mem_stride[j];
if (--idx[j]) carray = FALSE;
diff --git a/src/H5Fcore.c b/src/H5Fcore.c
index d274422..9ff3c44 100644
--- a/src/H5Fcore.c
+++ b/src/H5Fcore.c
@@ -69,8 +69,10 @@ const H5F_low_class_t H5F_LOW_CORE_g[1] = {{
*-------------------------------------------------------------------------
*/
static hbool_t
-H5F_core_access(const char *name, const H5F_access_t *access_parms,
- int mode, H5F_search_t *key/*out*/)
+H5F_core_access(const char *name __attribute__((unused)),
+ const H5F_access_t *access_parms __attribute__((unused)),
+ int mode __attribute__((unused)),
+ H5F_search_t *key/*out*/ __attribute__((unused)))
{
FUNC_ENTER(H5F_core_access, FAIL);
FUNC_LEAVE(FALSE);
@@ -99,7 +101,8 @@ H5F_core_access(const char *name, const H5F_access_t *access_parms,
*-------------------------------------------------------------------------
*/
static H5F_low_t *
-H5F_core_open(const char *name, const H5F_access_t *access_parms,
+H5F_core_open(const char *name __attribute__((unused)),
+ const H5F_access_t *access_parms __attribute__((unused)),
uintn flags, H5F_search_t *key/*out*/)
{
H5F_low_t *lf = NULL;
@@ -146,7 +149,8 @@ H5F_core_open(const char *name, const H5F_access_t *access_parms,
*-------------------------------------------------------------------------
*/
static herr_t
-H5F_core_close(H5F_low_t *lf, const H5F_access_t *access_parms)
+H5F_core_close(H5F_low_t *lf,
+ const H5F_access_t *access_parms __attribute__((unused)))
{
FUNC_ENTER(H5F_core_close, FAIL);
@@ -179,7 +183,8 @@ H5F_core_close(H5F_low_t *lf, const H5F_access_t *access_parms)
*-------------------------------------------------------------------------
*/
static herr_t
-H5F_core_read(H5F_low_t *lf, const H5F_access_t *access_parms,
+H5F_core_read(H5F_low_t *lf,
+ const H5F_access_t *access_parms __attribute__((unused)),
const haddr_t *addr, size_t size, uint8 *buf)
{
size_t n;
diff --git a/src/H5Ffamily.c b/src/H5Ffamily.c
index e9596b8..0458d38 100644
--- a/src/H5Ffamily.c
+++ b/src/H5Ffamily.c
@@ -298,7 +298,7 @@ H5F_fam_read(H5F_low_t *lf, const H5F_access_t *access_parms,
{
size_t nbytes;
haddr_t cur_addr;
- uintn membno;
+ intn membno;
off_t offset;
size_t member_size;
@@ -361,7 +361,7 @@ H5F_fam_write(H5F_low_t *lf, const H5F_access_t *access_parms,
{
size_t nbytes;
haddr_t cur_addr, max_addr;
- uintn membno;
+ intn membno;
off_t offset;
H5F_low_t *member = NULL;
char member_name[4096];
diff --git a/src/H5Fistore.c b/src/H5Fistore.c
index c75a3b7..c737d9d 100644
--- a/src/H5Fistore.c
+++ b/src/H5Fistore.c
@@ -119,7 +119,7 @@ H5B_class_t H5B_ISTORE[1] = {{
*-------------------------------------------------------------------------
*/
static size_t
-H5F_istore_sizeof_rkey(H5F_t *f, const void *_udata)
+H5F_istore_sizeof_rkey(H5F_t *f __attribute__((unused)), const void *_udata)
{
const H5F_istore_ud1_t *udata = (const H5F_istore_ud1_t *) _udata;
size_t nbytes;
@@ -245,7 +245,8 @@ H5F_istore_encode_key(H5F_t *f, H5B_t *bt, uint8 *raw, void *_key)
*-------------------------------------------------------------------------
*/
static intn
-H5F_istore_cmp2(H5F_t *f, void *_lt_key, void *_udata, void *_rt_key)
+H5F_istore_cmp2(H5F_t *f __attribute__((unused)), void *_lt_key,
+ void *_udata, void *_rt_key)
{
H5F_istore_key_t *lt_key = (H5F_istore_key_t *) _lt_key;
H5F_istore_key_t *rt_key = (H5F_istore_key_t *) _rt_key;
@@ -296,7 +297,8 @@ H5F_istore_cmp2(H5F_t *f, void *_lt_key, void *_udata, void *_rt_key)
*-------------------------------------------------------------------------
*/
static intn
-H5F_istore_cmp3(H5F_t *f, void *_lt_key, void *_udata, void *_rt_key)
+H5F_istore_cmp3(H5F_t *f __attribute__((unused)),
+ void *_lt_key, void *_udata, void *_rt_key)
{
H5F_istore_key_t *lt_key = (H5F_istore_key_t *) _lt_key;
H5F_istore_key_t *rt_key = (H5F_istore_key_t *) _rt_key;
@@ -422,7 +424,7 @@ H5F_istore_new_node(H5F_t *f, H5B_ins_t op,
*/
static herr_t
H5F_istore_found(H5F_t *f, const haddr_t *addr, const void *_lt_key,
- void *_udata, const void *_rt_key)
+ void *_udata, const void *_rt_key __attribute__((unused)))
{
H5F_istore_ud1_t *udata = (H5F_istore_ud1_t *) _udata;
const H5F_istore_key_t *lt_key = (const H5F_istore_key_t *) _lt_key;
diff --git a/src/H5Flow.c b/src/H5Flow.c
index 545659a..f29b7d3 100644
--- a/src/H5Flow.c
+++ b/src/H5Flow.c
@@ -587,7 +587,7 @@ H5F_addr_undef(haddr_t *addr /*out */ )
{
assert(addr);
- addr->offset = -1;
+ addr->offset = (uint64)(-1);
}
/*-------------------------------------------------------------------------
@@ -676,7 +676,7 @@ H5F_addr_zerop(const haddr_t *addr)
void
H5F_addr_encode(H5F_t *f, uint8 **pp, const haddr_t *addr)
{
- int i;
+ uint i;
haddr_t tmp;
assert(f);
@@ -685,14 +685,14 @@ H5F_addr_encode(H5F_t *f, uint8 **pp, const haddr_t *addr)
if (addr_defined(addr)) {
tmp = *addr;
- for (i = 0; i < H5F_SIZEOF_ADDR(f); i++) {
+ for (i=0; i<H5F_SIZEOF_ADDR(f); i++) {
*(*pp)++ = (uint8)(tmp.offset & 0xff);
tmp.offset >>= 8;
}
assert("overflow" && 0 == tmp.offset);
} else {
- for (i = 0; i < H5F_SIZEOF_ADDR(f); i++) {
+ for (i=0; i<H5F_SIZEOF_ADDR(f); i++) {
*(*pp)++ = 0xff;
}
}
@@ -720,7 +720,7 @@ H5F_addr_encode(H5F_t *f, uint8 **pp, const haddr_t *addr)
void
H5F_addr_decode(H5F_t *f, const uint8 **pp, haddr_t *addr/*out*/)
{
- int i;
+ uint i;
haddr_t tmp;
uint8 c;
hbool_t all_zero = TRUE;
@@ -731,12 +731,11 @@ H5F_addr_decode(H5F_t *f, const uint8 **pp, haddr_t *addr/*out*/)
addr->offset = 0;
- for (i = 0; i < H5F_SIZEOF_ADDR(f); i++) {
+ for (i=0; i<H5F_SIZEOF_ADDR(f); i++) {
c = *(*pp)++;
- if (c != 0xff)
- all_zero = FALSE;
+ if (c != 0xff) all_zero = FALSE;
- if (i < sizeof(addr->offset)) {
+ if (i<sizeof(addr->offset)) {
tmp.offset = c;
tmp.offset <<= i * 8; /*use tmp to get casting right */
addr->offset |= tmp.offset;
@@ -744,8 +743,7 @@ H5F_addr_decode(H5F_t *f, const uint8 **pp, haddr_t *addr/*out*/)
assert(0 == **pp); /*overflow */
}
}
- if (all_zero)
- H5F_addr_undef(addr);
+ if (all_zero) H5F_addr_undef(addr);
}
/*-------------------------------------------------------------------------
@@ -830,12 +828,44 @@ H5F_addr_pow2(uintn n, haddr_t *addr /*out */ )
*-------------------------------------------------------------------------
*/
void
-H5F_addr_inc(haddr_t *addr /*in,out */ , size_t inc)
+H5F_addr_inc(haddr_t *addr/*in,out */, size_t inc)
{
assert(addr && addr_defined(addr));
assert(addr->offset <= addr->offset + inc);
+
addr->offset += inc;
}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5F_addr_adj
+ *
+ * Purpose: Adjusts an address by adding or subtracting some amount.
+ *
+ * Return: void
+ *
+ * Programmer: Robb Matzke
+ * Monday, April 6, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+void
+H5F_addr_adj(haddr_t *addr/*in,out */, ssize_t adj)
+{
+#ifndef NDEBUG
+ assert(addr && addr_defined(addr));
+ if (adj>=0) {
+ assert(addr->offset <= addr->offset + adj);
+ } else {
+ assert (addr->offset > addr->offset + adj);
+ }
+#endif
+
+ addr->offset += adj;
+}
+
/*-------------------------------------------------------------------------
* Function: H5F_addr_add
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index c4e1fc0..23046b0 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -55,9 +55,9 @@
/*
* Private file open flags.
*/
-#define H5F_ACC_PUBLIC_FLAGS 0x00ff
+#define H5F_ACC_PUBLIC_FLAGS 0x00ffu
-#define H5F_ACC_CREAT 0x0100 /* Create non-existing files */
+#define H5F_ACC_CREAT 0x0100u /* Create non-existing files */
/*
* Encode and decode macros for file meta-data.
@@ -351,7 +351,7 @@ typedef struct H5F_low_t {
#ifdef HAVE_FSEEK64
int64 cur; /* Current file position */
#else
- off_t cur; /* Current file position */
+ long cur; /* Current file position */
#endif
} stdio;
@@ -537,7 +537,8 @@ void H5F_addr_encode(H5F_t *, uint8 **, const haddr_t *);
void H5F_addr_decode(H5F_t *, const uint8 **, haddr_t *);
void H5F_addr_print(FILE *, const haddr_t *);
void H5F_addr_pow2(uintn, haddr_t *);
-void H5F_addr_inc(haddr_t *, size_t);
+void H5F_addr_inc(haddr_t *addr/*in,out*/, size_t inc);
+void H5F_addr_adj(haddr_t *addr/*in,out*/, ssize_t adj);
void H5F_addr_add(haddr_t *, const haddr_t *);
uintn H5F_addr_hash(const haddr_t *, uintn mod);
diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h
index 1fb72af..f0fb3f2 100644
--- a/src/H5Fpublic.h
+++ b/src/H5Fpublic.h
@@ -25,11 +25,11 @@
* H5Fcreate() and H5Fopen(). Use the bit-wise OR operator (|) to combine
* them as needed.
*/
-#define H5F_ACC_RDONLY 0x0000 /*absence of write implies read only */
-#define H5F_ACC_RDWR 0x0001 /*open file for reading and writing */
-#define H5F_ACC_TRUNC 0x0002 /*overwrite existing files during create*/
-#define H5F_ACC_EXCL 0x0004 /*create fails if file already exists */
-#define H5F_ACC_DEBUG 0x0008 /*print debug info */
+#define H5F_ACC_RDONLY 0x0000u /*absence of write implies read only */
+#define H5F_ACC_RDWR 0x0001u /*open file for reading and writing */
+#define H5F_ACC_TRUNC 0x0002u /*overwrite existing files during create*/
+#define H5F_ACC_EXCL 0x0004u /*create fails if file already exists */
+#define H5F_ACC_DEBUG 0x0008u /*print debug info */
#ifdef LATER
diff --git a/src/H5Fsec2.c b/src/H5Fsec2.c
index 57dd7a6..16395dd 100644
--- a/src/H5Fsec2.c
+++ b/src/H5Fsec2.c
@@ -69,10 +69,11 @@ const H5F_low_class_t H5F_LOW_SEC2_g[1] = {{
*-------------------------------------------------------------------------
*/
static H5F_low_t *
-H5F_sec2_open(const char *name, const H5F_access_t *access_parms, uintn flags,
- H5F_search_t *key/*out*/)
+H5F_sec2_open(const char *name,
+ const H5F_access_t *access_parms __attribute__((unused)),
+ uintn flags, H5F_search_t *key/*out*/)
{
- uintn oflags;
+ intn oflags;
H5F_low_t *lf = NULL;
int fd;
struct stat sb;
@@ -121,7 +122,8 @@ H5F_sec2_open(const char *name, const H5F_access_t *access_parms, uintn flags,
*-------------------------------------------------------------------------
*/
static herr_t
-H5F_sec2_close(H5F_low_t *lf, const H5F_access_t *access_parms)
+H5F_sec2_close(H5F_low_t *lf,
+ const H5F_access_t *access_parms __attribute__((unused)))
{
FUNC_ENTER(H5F_sec2_close, FAIL);
@@ -156,7 +158,8 @@ H5F_sec2_close(H5F_low_t *lf, const H5F_access_t *access_parms)
*-------------------------------------------------------------------------
*/
static herr_t
-H5F_sec2_read(H5F_low_t *lf, const H5F_access_t *access_parms,
+H5F_sec2_read(H5F_low_t *lf,
+ const H5F_access_t *access_parms __attribute__((unused)),
const haddr_t *addr, size_t size, uint8 *buf)
{
ssize_t n;
@@ -184,7 +187,7 @@ H5F_sec2_read(H5F_low_t *lf, const H5F_access_t *access_parms,
/* Check easy cases */
if (0 == size) HRETURN(SUCCEED);
- if (offset >= lf->eof.offset) {
+ if ((uint64)offset >= lf->eof.offset) {
HDmemset(buf, 0, size);
HRETURN(SUCCEED);
}
@@ -224,7 +227,7 @@ H5F_sec2_read(H5F_low_t *lf, const H5F_access_t *access_parms,
if ((n = read(lf->u.sec2.fd, buf, size)) < 0) {
lf->u.sec2.op = H5F_OP_UNKNOWN;
HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "read failed");
- } else if (n < size) {
+ } else if ((size_t)n < size) {
HDmemset(buf + n, 0, size - n);
}
@@ -260,7 +263,8 @@ H5F_sec2_read(H5F_low_t *lf, const H5F_access_t *access_parms,
*-------------------------------------------------------------------------
*/
static herr_t
-H5F_sec2_write(H5F_low_t *lf, const H5F_access_t *access_parms,
+H5F_sec2_write(H5F_low_t *lf,
+ const H5F_access_t *access_parms __attribute__((unused)),
const haddr_t *addr, size_t size, const uint8 *buf)
{
uint64 mask;
diff --git a/src/H5Fstdio.c b/src/H5Fstdio.c
index 6224dd6..7e45878 100644
--- a/src/H5Fstdio.c
+++ b/src/H5Fstdio.c
@@ -70,7 +70,8 @@ const H5F_low_class_t H5F_LOW_STDIO_g[1] = {{
*-------------------------------------------------------------------------
*/
static H5F_low_t *
-H5F_stdio_open(const char *name, const H5F_access_t *access_parms,
+H5F_stdio_open(const char *name,
+ const H5F_access_t *access_parms __attribute__((unused)),
uintn flags, H5F_search_t *key/*out*/)
{
H5F_low_t *lf = NULL;
@@ -112,7 +113,9 @@ H5F_stdio_open(const char *name, const H5F_access_t *access_parms,
if (fseek(lf->u.stdio.f, 0, SEEK_END) < 0) {
lf->u.stdio.op = H5F_OP_UNKNOWN;
} else {
- H5F_addr_inc(&(lf->eof), ftell(lf->u.stdio.f));
+ ssize_t x = ftell (lf->u.stdio.f);
+ assert (x>=0);
+ H5F_addr_inc(&(lf->eof), (size_t)x);
}
/* The unique key */
@@ -144,7 +147,8 @@ H5F_stdio_open(const char *name, const H5F_access_t *access_parms,
*-------------------------------------------------------------------------
*/
static herr_t
-H5F_stdio_close(H5F_low_t *lf, const H5F_access_t *access_parms)
+H5F_stdio_close(H5F_low_t *lf,
+ const H5F_access_t *access_parms __attribute__((unused)))
{
FUNC_ENTER(H5F_stdio_close, FAIL);
@@ -179,7 +183,8 @@ H5F_stdio_close(H5F_low_t *lf, const H5F_access_t *access_parms)
*-------------------------------------------------------------------------
*/
static herr_t
-H5F_stdio_read(H5F_low_t *lf, const H5F_access_t *access_parms,
+H5F_stdio_read(H5F_low_t *lf,
+ const H5F_access_t *access_parms __attribute__((unused)),
const haddr_t *addr, size_t size, uint8 *buf/*out*/)
{
size_t n;
@@ -187,7 +192,7 @@ H5F_stdio_read(H5F_low_t *lf, const H5F_access_t *access_parms,
#ifdef HAVE_FSEEK64
int64 offset;
#else
- off_t offset;
+ long offset;
#endif
FUNC_ENTER(H5F_stdio_read, FAIL);
@@ -202,12 +207,12 @@ H5F_stdio_read(H5F_low_t *lf, const H5F_access_t *access_parms,
#ifdef HAVE_FSEEK64
offset = (int64)(addr->offset); /*checked for overflow*/
#else
- offset = (off_t)(addr->offset); /*checked for overflow*/
+ offset = (long)(addr->offset); /*checked for overflow*/
#endif
/* Check easy cases */
if (0 == size) HRETURN(SUCCEED);
- if (offset >= lf->eof.offset) {
+ if ((uint64)offset >= lf->eof.offset) {
HDmemset(buf, 0, size);
HRETURN(SUCCEED);
}
@@ -287,16 +292,18 @@ H5F_stdio_read(H5F_low_t *lf, const H5F_access_t *access_parms,
*-------------------------------------------------------------------------
*/
static herr_t
-H5F_stdio_write(H5F_low_t *lf, const H5F_access_t *access_parms,
+H5F_stdio_write(H5F_low_t *lf,
+ const H5F_access_t *access_parms __attribute__((unused)),
const haddr_t *addr, size_t size,
const uint8 *buf)
{
- ssize_t n;
uint64 mask;
#ifdef HAVE_FSEEK64
int64 offset;
+ uint64 n;
#else
- off_t offset;
+ long offset;
+ size_t n;
#endif
FUNC_ENTER(H5F_stdio_write, FAIL);
@@ -310,10 +317,10 @@ H5F_stdio_write(H5F_low_t *lf, const H5F_access_t *access_parms,
}
#ifdef HAVE_FSEEK64
offset = (int64)(addr->offset); /*checked for overflow*/
- n = (int64)size; /*checked for overflow*/
+ n = size; /*checked for overflow*/
#else
offset = (long)(addr->offset); /*checked for overflow*/
- n = (off_t)size; /*checked for overflow*/
+ n = size; /*checked for overflow*/
#endif
/*
@@ -333,6 +340,7 @@ H5F_stdio_write(H5F_low_t *lf, const H5F_access_t *access_parms,
#endif
lf->u.stdio.cur = offset;
}
+
/*
* Write the buffer. On successful return, the file position will be
* advanced by the number of bytes read. Otherwise nobody knows where it
@@ -342,11 +350,12 @@ H5F_stdio_write(H5F_low_t *lf, const H5F_access_t *access_parms,
lf->u.stdio.op = H5F_OP_UNKNOWN;
HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "fwrite failed");
}
+
/*
* Update seek optimizing data.
*/
lf->u.stdio.op = H5F_OP_WRITE;
- lf->u.stdio.cur = offset + n;
+ lf->u.stdio.cur = offset + (int64)n;
FUNC_LEAVE(SUCCEED);
}
@@ -371,7 +380,8 @@ H5F_stdio_write(H5F_low_t *lf, const H5F_access_t *access_parms,
*-------------------------------------------------------------------------
*/
static herr_t
-H5F_stdio_flush(H5F_low_t *lf, const H5F_access_t *access_parms)
+H5F_stdio_flush(H5F_low_t *lf,
+ const H5F_access_t *access_parms __attribute__((unused)))
{
FUNC_ENTER(H5F_stdio_flush, FAIL);
diff --git a/src/H5G.c b/src/H5G.c
index 293e3ab..d93cb8e 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -492,6 +492,131 @@ H5Giterate (hid_t loc_id, const char *name, int *idx,
FUNC_LEAVE (ret_value);
}
+
+/*-------------------------------------------------------------------------
+ * Function: H5Gmove
+ *
+ * Purpose: Renames an object within an HDF5 file. The original name SRC
+ * is unlinked from the group graph and the new name DST is
+ * inserted as an atomic operation. Both names are interpreted
+ * relative to LOC_ID which is either a file ID or a group ID.
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Robb Matzke
+ * Monday, April 6, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Gmove (hid_t loc_id __attribute__((unused)),
+ const char *src __attribute__((unused)),
+ const char *dst __attribute__((unused)))
+{
+ FUNC_ENTER (H5Gmove, FAIL);
+
+ HRETURN_ERROR (H5E_SYM, H5E_UNSUPPORTED, FAIL,
+ "unable to rename object (not implemented yet)");
+
+ FUNC_LEAVE (SUCCEED);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Glink
+ *
+ * Purpose: Creates a link of the specified type from NEW_NAME to
+ * CUR_NAME.
+ *
+ * If TYPE is H5G_LINK_HARD then CUR_NAME must name an existing
+ * object and both names are interpreted relative to LOC_ID
+ * which is either a file ID or a group ID.
+ *
+ * If TYPE is H5G_LINK_SOFT then CUR_NAME can be anything and is
+ * interpreted at lookup time relative to the group which
+ * contains the final component of NEW_NAME. For instance, if
+ * CUR_NAME is `./foo' and NEW_NAME is `./x/y/bar' and a request
+ * is made for `./x/y/bar' then the actual object looked up is
+ * `./x/y/./foo'.
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Robb Matzke
+ * Monday, April 6, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Glink (hid_t loc_id, H5G_link_t type, const char *cur_name,
+ const char *new_name)
+{
+ H5G_t *loc = NULL;
+
+ FUNC_ENTER (H5Glink, FAIL);
+
+ if (NULL==(loc=H5G_loc (loc_id))) {
+ HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location");
+ }
+ if (type!=H5G_LINK_HARD && type!=H5G_LINK_SOFT) {
+ HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "unrecognized link type");
+ }
+ if (!cur_name || !*cur_name) {
+ HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,
+ "no current name specified");
+ }
+ if (!new_name || !*new_name) {
+ HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,
+ "no new name specified");
+ }
+ if (H5G_link (loc, type, cur_name, new_name)<0) {
+ HRETURN_ERROR (H5E_SYM, H5E_LINK, FAIL, "unable to create link");
+ }
+
+ FUNC_LEAVE (SUCCEED);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Gunlink
+ *
+ * Purpose: Removes the specified NAME from the group graph and
+ * decrements the link count for the object to which NAME
+ * points. If the link count reaches zero then all file-space
+ * associated with the object will be reclaimed (but if the
+ * object is open, then the reclamation of the file space is
+ * delayed until all handles to the object are closed).
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Robb Matzke
+ * Monday, April 6, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Gunlink (hid_t loc_id __attribute__((unused)),
+ const char *name __attribute__((unused)))
+{
+ FUNC_ENTER (H5Gunlink, FAIL);
+
+ HRETURN_ERROR (H5E_SYM, H5E_UNSUPPORTED, FAIL,
+ "unable to unlink name (not implemented yet)");
+
+ FUNC_LEAVE (SUCCEED);
+}
+
/*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
@@ -1385,3 +1510,58 @@ H5G_loc (hid_t loc_id)
FUNC_LEAVE (ret_value);
}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5G_link
+ *
+ * Purpose: Creates a link from NEW_NAME to CUR_NAME. See H5Glink() for
+ * full documentation.
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Robb Matzke
+ * Monday, April 6, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5G_link (H5G_t *loc, H5G_type_t type, const char *cur_name,
+ const char *new_name)
+{
+ H5G_entry_t cur_obj;
+
+ FUNC_ENTER (H5G_link, FAIL);
+
+ /* Check args */
+ assert (loc);
+ assert (cur_name && *cur_name);
+ assert (new_name && *new_name);
+
+ switch (type) {
+ case H5G_LINK_SOFT:
+ HRETURN_ERROR (H5E_SYM, H5E_UNSUPPORTED, FAIL,
+ "unable to create soft link (not implemented yet)");
+
+ case H5G_LINK_HARD:
+ if (H5G_find (loc, cur_name, NULL, &cur_obj)<0) {
+ HRETURN_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL,
+ "source object not found");
+ }
+ if (H5G_insert (loc, new_name, &cur_obj)<0) {
+ HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL,
+ "unable to create new name/link for object");
+ }
+ break;
+
+ default:
+ HRETURN_ERROR (H5E_SYM, H5E_BADVALUE, FAIL,
+ "unrecognized link type");
+ }
+
+ FUNC_LEAVE (SUCCEED);
+}
diff --git a/src/H5Gent.c b/src/H5Gent.c
index 8c67810..2a95778 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -102,8 +102,7 @@ H5G_ent_modified(H5G_entry_t *ent, H5G_type_t cache_type)
{
FUNC_ENTER(H5G_ent_modified, FAIL);
assert(ent);
- if (H5G_NO_CHANGE != ent->type)
- ent->type = cache_type;
+ if (H5G_NO_CHANGE != ent->type) ent->type = cache_type;
ent->dirty = TRUE;
FUNC_LEAVE(SUCCEED);
}
@@ -350,8 +349,8 @@ H5G_ent_encode(H5F_t *f, uint8 **pp, H5G_entry_t *ent)
*-------------------------------------------------------------------------
*/
herr_t
-H5G_ent_debug(H5F_t *f, H5G_entry_t *ent, FILE * stream, intn indent,
- intn fwidth)
+H5G_ent_debug(H5F_t *f __attribute__((unused)), H5G_entry_t *ent,
+ FILE * stream, intn indent, intn fwidth)
{
FUNC_ENTER(H5G_ent_debug, FAIL);
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index e447742..5292607 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -132,7 +132,8 @@ H5G_node_sizeof_rkey(H5F_t *f, const void *udata __attribute__((unused)))
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_decode_key(H5F_t *f, H5B_t *bt, uint8 *raw, void *_key)
+H5G_node_decode_key(H5F_t *f, H5B_t *bt __attribute__((unused)), uint8 *raw,
+ void *_key)
{
H5G_node_key_t *key = (H5G_node_key_t *) _key;
@@ -166,7 +167,8 @@ H5G_node_decode_key(H5F_t *f, H5B_t *bt, uint8 *raw, void *_key)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_encode_key(H5F_t *f, H5B_t *bt, uint8 *raw, void *_key)
+H5G_node_encode_key(H5F_t *f, H5B_t *bt __attribute__((unused)),
+ uint8 *raw, void *_key)
{
H5G_node_key_t *key = (H5G_node_key_t *) _key;
@@ -230,7 +232,8 @@ H5G_node_size(H5F_t *f)
*/
static herr_t
H5G_node_create(H5F_t *f, H5B_ins_t op,
- void *_lt_key, void *_udata, void *_rt_key,
+ void *_lt_key, void *_udata __attribute__((unused)),
+ void *_rt_key,
haddr_t *addr/*out*/)
{
H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key;
@@ -254,7 +257,7 @@ H5G_node_create(H5F_t *f, H5B_ins_t op,
"unable to allocate file space");
}
sym->dirty = TRUE;
- sym->entry = H5MM_xcalloc(2 * H5G_NODE_K(f), sizeof(H5G_entry_t));
+ sym->entry = H5MM_xcalloc((intn)(2*H5G_NODE_K(f)), sizeof(H5G_entry_t));
if (H5AC_set(f, H5AC_SNODE, addr, sym) < 0) {
H5MM_xfree(sym->entry);
H5MM_xfree(sym);
@@ -403,7 +406,7 @@ H5G_node_load(H5F_t *f, const haddr_t *addr, const void *_udata1,
size = H5G_node_size(f);
p = buf = H5MM_xmalloc(size);
sym = H5MM_xcalloc(1, sizeof(H5G_node_t));
- sym->entry = H5MM_xcalloc(2 * H5G_NODE_K(f), sizeof(H5G_entry_t));
+ sym->entry = H5MM_xcalloc((intn)(2*H5G_NODE_K(f)), sizeof(H5G_entry_t));
if (H5F_block_read(f, addr, size, buf) < 0) {
HGOTO_ERROR(H5E_SYM, H5E_READERROR, NULL,
@@ -586,8 +589,9 @@ H5G_node_cmp3(H5F_t *f, void *_lt_key, void *_udata, void *_rt_key)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_found(H5F_t *f, const haddr_t *addr, const void *_lt_key,
- void *_udata, const void *_rt_key)
+H5G_node_found(H5F_t *f, const haddr_t *addr,
+ const void *_lt_key __attribute__((unused)),
+ void *_udata, const void *_rt_key __attribute__((unused)))
{
H5G_bt_ud1_t *bt_udata = (H5G_bt_ud1_t *) _udata;
H5G_node_t *sn = NULL;
@@ -696,9 +700,10 @@ H5G_node_found(H5F_t *f, const haddr_t *addr, const void *_lt_key,
*/
static H5B_ins_t
H5G_node_insert(H5F_t *f, const haddr_t *addr,
- void *_lt_key, hbool_t *lt_key_changed,
+ void *_lt_key __attribute__((unused)),
+ hbool_t *lt_key_changed __attribute__((unused)),
void *_md_key, void *_udata,
- void *_rt_key, hbool_t *rt_key_changed,
+ void *_rt_key, hbool_t *rt_key_changed __attribute__((unused)),
haddr_t *new_node)
{
H5G_node_key_t *md_key = (H5G_node_key_t *) _md_key;
@@ -767,7 +772,7 @@ H5G_node_insert(H5F_t *f, const haddr_t *addr,
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5B_INS_ERROR,
"unable to insert symbol name into heap");
}
- if (sn->nsyms >= 2 * H5G_NODE_K(f)) {
+ if ((size_t)(sn->nsyms) >= 2*H5G_NODE_K(f)) {
/*
* The node is full. Split it into a left and right
* node and return the address of the new right node (the
@@ -800,14 +805,14 @@ H5G_node_insert(H5F_t *f, const haddr_t *addr,
md_key->offset = sn->entry[sn->nsyms - 1].name_off;
/* Where to insert the new entry? */
- if (idx <= H5G_NODE_K(f)) {
+ if (idx <= (intn)H5G_NODE_K(f)) {
insert_into = sn;
- if (idx == H5G_NODE_K(f))
+ if (idx == (intn)H5G_NODE_K(f))
md_key->offset = offset;
} else {
idx -= H5G_NODE_K(f);
insert_into = snrt;
- if (idx == H5G_NODE_K (f)) {
+ if (idx == (intn)H5G_NODE_K (f)) {
rt_key->offset = offset;
*rt_key_changed = TRUE;
}
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index f78071a..3b449fd 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -21,7 +21,7 @@
#define H5G_NODE_VERS 1 /*symbol table node version number */
#define H5G_SIZE_HINT 1024 /*default root grp size hint */
-#define H5G_NODE_K(F) ((F)->shared->create_parms.sym_leaf_k)
+#define H5G_NODE_K(F) ((unsigned)((F)->shared->create_parms.sym_leaf_k))
#define H5G_NODE_SIZEOF_HDR(F) (H5G_NODE_SIZEOF_MAGIC + 4)
#define H5G_DEFAULT_ROOT_SIZE 32
diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h
index b79d1e2..2d49e99 100644
--- a/src/H5Gprivate.h
+++ b/src/H5Gprivate.h
@@ -51,10 +51,11 @@
* symbol table entry.
*/
typedef enum H5G_type_t {
- H5G_NOTHING_CACHED = 0, /*nothing is cached, must be 0 */
- H5G_CACHED_STAB = 1, /*symbol table, `stab' */
+ H5G_CACHED_ERROR = -1, /*force enum to be signed */
+ H5G_NOTHING_CACHED = 0, /*nothing is cached, must be 0 */
+ H5G_CACHED_STAB = 1, /*symbol table, `stab' */
- H5G_NCACHED = 2 /*THIS MUST BE LAST */
+ H5G_NCACHED = 2 /*THIS MUST BE LAST */
} H5G_type_t;
/*
@@ -103,6 +104,8 @@ herr_t H5G_set (H5G_t *grp);
herr_t H5G_push (H5G_t *grp);
herr_t H5G_pop (H5F_t *f);
H5G_t *H5G_getcwg(H5F_t *f);
+herr_t H5G_link (H5G_t *loc, H5G_type_t type, const char *cur_name,
+ const char *new_name);
herr_t H5G_insert (H5G_t *cwg, const char *name, H5G_entry_t *ent);
herr_t H5G_find (H5G_t *cwg, const char *name, H5G_entry_t *grp_ent/*out*/,
H5G_entry_t *ent/*out*/);
diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h
index 435d384..8c6e7c6 100644
--- a/src/H5Gpublic.h
+++ b/src/H5Gpublic.h
@@ -27,6 +27,12 @@
extern "C" {
#endif
+typedef enum H5G_link_t {
+ H5G_LINK_ERROR = -1,
+ H5G_LINK_HARD = 0,
+ H5G_LINK_SOFT = 1
+} H5G_link_t;
+
typedef herr_t (*H5G_iterate_t)(hid_t group, const char *group_name,
void *op_data);
@@ -38,6 +44,10 @@ herr_t H5Gpush (hid_t file, const char *name);
herr_t H5Gpop (hid_t file);
herr_t H5Giterate (hid_t file, const char *name, int *idx, H5G_iterate_t op,
void *op_data);
+herr_t H5Gmove (hid_t loc_id, const char *src, const char *dst);
+herr_t H5Glink (hid_t loc_id, H5G_link_t type, const char *cur_name,
+ const char *new_name);
+herr_t H5Gunlink (hid_t loc_id, const char *name);
#ifdef __cplusplus
}
diff --git a/src/H5HG.c b/src/H5HG.c
index 176c687..f457839 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -131,7 +131,7 @@ H5HG_create (H5F_t *f, size_t size)
UINT16ENCODE (p, 0); /*object ID*/
UINT16ENCODE (p, 0); /*reference count*/
H5F_encode_length (f, p, heap->obj[0].size);
- HDmemset (p, 0, (heap->chunk+heap->nalloc) - p);
+ HDmemset (p, 0, (size_t)((heap->chunk+heap->nalloc) - p));
/* Add the heap to the cache */
if (H5AC_set (f, H5AC_GHEAP, &addr, heap)<0) {
@@ -845,7 +845,8 @@ herr_t
H5HG_debug(H5F_t *f, const haddr_t *addr, FILE *stream, intn indent,
intn fwidth)
{
- int i, j, k, nused, maxobj;
+ int i, nused, maxobj;
+ uintn j, k;
H5HG_heap_t *h = NULL;
char buf[64];
size_t size;
@@ -855,7 +856,7 @@ H5HG_debug(H5F_t *f, const haddr_t *addr, FILE *stream, intn indent,
/* check arguments */
assert(f);
- if (addr && H5F_addr_defined (addr));
+ assert(addr && H5F_addr_defined (addr));
assert(stream);
assert(indent >= 0);
assert(fwidth >= 0);
diff --git a/src/H5HL.c b/src/H5HL.c
index d7f83c0..82cfd31 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -889,7 +889,7 @@ H5HL_debug(H5F_t *f, const haddr_t *addr, FILE * stream, intn indent,
* the heap and that no two free blocks point to the same region of
* the heap.
*/
- marker = H5MM_xcalloc(h->mem_alloc, 1);
+ marker = H5MM_xcalloc(1, h->mem_alloc);
for (freelist = h->freelist; freelist; freelist = freelist->next) {
fprintf(stream, "%*s%-*s %8lu, %8lu\n", indent, "", fwidth,
"Free Block (offset,size):",
@@ -898,7 +898,7 @@ H5HL_debug(H5F_t *f, const haddr_t *addr, FILE * stream, intn indent,
if (freelist->offset + freelist->size > h->mem_alloc) {
fprintf(stream, "***THAT FREE BLOCK IS OUT OF BOUNDS!\n");
} else {
- for (i = overlap = 0; i < freelist->size; i++) {
+ for (i=overlap=0; i<(intn)(freelist->size); i++) {
if (marker[freelist->offset + i])
overlap++;
marker[freelist->offset + i] = 1;
@@ -923,10 +923,10 @@ H5HL_debug(H5F_t *f, const haddr_t *addr, FILE * stream, intn indent,
*/
fprintf(stream, "%*sData follows (`__' indicates free region)...\n",
indent, "");
- for (i = 0; i < h->disk_alloc; i += 16) {
+ for (i=0; i<(intn)(h->disk_alloc); i+=16) {
fprintf(stream, "%*s %8d: ", indent, "", i);
for (j = 0; j < 16; j++) {
- if (i + j < h->disk_alloc) {
+ if (i+j<(intn)(h->disk_alloc)) {
if (marker[i + j]) {
fprintf(stream, "__ ");
} else {
@@ -941,7 +941,7 @@ H5HL_debug(H5F_t *f, const haddr_t *addr, FILE * stream, intn indent,
}
for (j = 0; j < 16; j++) {
- if (i + j < h->disk_alloc) {
+ if (i+j < (intn)(h->disk_alloc)) {
if (marker[i + j]) {
HDfputc(' ', stream);
} else {
diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h
index b1af51a..da8c257 100644
--- a/src/H5HLprivate.h
+++ b/src/H5HLprivate.h
@@ -34,7 +34,7 @@
#define H5HL_MAGIC "HEAP" /*heap magic number */
#define H5HL_SIZEOF_MAGIC 4
-#define H5HL_ALIGN(X) (((X)+7)&~0x07) /*align on 8-byte boundary */
+#define H5HL_ALIGN(X) (((X)+7)&(unsigned)(~0x07)) /*align on 8-byte boundary */
#define H5HL_SIZEOF_HDR(F) \
H5HL_ALIGN(H5HL_SIZEOF_MAGIC + /*heap signature */ \
diff --git a/src/H5I.c b/src/H5I.c