summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5B.c5
-rw-r--r--src/H5Bprivate.h2
-rw-r--r--src/H5C.c2
-rw-r--r--src/H5D.c6
-rw-r--r--src/H5Dproto.h1
-rw-r--r--src/H5F.c2
-rw-r--r--src/H5G.c2
-rw-r--r--src/H5H.c3
-rw-r--r--src/H5O.c1
-rw-r--r--src/hdf5port.h7
10 files changed, 19 insertions, 12 deletions
diff --git a/src/H5B.c b/src/H5B.c
index 7182f10..d700a7c 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -158,11 +158,11 @@ static interface_initialize_g = FALSE;
*-------------------------------------------------------------------------
*/
haddr_t
-H5B_new (hdf5_file_t *f, const H5B_class_t *type, size_t sizeof_rkey)
+H5B_new (hdf5_file_t *f, const H5B_class_t *type)
{
H5B_t *bt=NULL;
haddr_t addr;
- size_t size;
+ size_t size, sizeof_rkey;
size_t total_native_keysize;
intn offset, i;
@@ -178,6 +178,7 @@ H5B_new (hdf5_file_t *f, const H5B_class_t *type, size_t sizeof_rkey)
/*
* Allocate file and memory data structures.
*/
+ sizeof_rkey = (type->get_sizeof_rkey)(f);
size = H5B_nodesize (f, type, &total_native_keysize, sizeof_rkey);
if ((addr = H5MF_alloc (f, size))<0) {
HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL);
diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h
index 4364203..92c2985 100644
--- a/src/H5Bprivate.h
+++ b/src/H5Bprivate.h
@@ -86,7 +86,7 @@ typedef struct H5B_t {
*/
herr_t H5B_debug (hdf5_file_t *f, haddr_t addr, FILE *stream, intn indent,
intn fwidth, const H5B_class_t *type);
-haddr_t H5B_new (hdf5_file_t *f, const H5B_class_t *type, size_t sizeof_rkey);
+haddr_t H5B_new (hdf5_file_t *f, const H5B_class_t *type);
herr_t H5B_find (hdf5_file_t *f, const H5B_class_t *type, haddr_t addr,
void *udata);
haddr_t H5B_insert (hdf5_file_t *f, const H5B_class_t *type, haddr_t addr,
diff --git a/src/H5C.c b/src/H5C.c
index 501b873..1ed0c31 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -48,9 +48,9 @@ static intn interface_initialize_g = FALSE;
/* Define the library's default file creation template (constants in hdf5lims.h) */
const file_create_temp_t default_file_create={
HDF5_USERBLOCK_DEFAULT, /* Default user-block size */
+ HDF5_BTREEPAGE_DEFAULT, /* Default B-tree page size */
HDF5_OFFSETSIZE_DEFAULT, /* Default offset size */
HDF5_LENGTHSIZE_DEFAULT, /* Default length size */
- HDF5_BTREEPAGE_DEFAULT, /* Default B-tree page size */
HDF5_BOOTBLOCK_VERSION, /* Current Boot-Block version # */
HDF5_SMALLOBJECT_VERSION, /* Current Small-Object heap version # */
HDF5_FREESPACE_VERSION, /* Current Free-Space info version # */
diff --git a/src/H5D.c b/src/H5D.c
index 2ff5582..f9ace29 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -193,7 +193,9 @@ done:
herr_t H5Dwrite(hatom_t oid, hatom_t did, VOIDP buf)
{
H5D_dataset_t *dataset; /* dataset object to release */
+#if 0
uintn towrite; /* number of bytes to write out */
+#endif
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5Dwrite, H5D_init_interface, FAIL);
@@ -214,7 +216,9 @@ herr_t H5Dwrite(hatom_t oid, hatom_t did, VOIDP buf)
if(dataset->type==0 || dataset->dim==0)
HGOTO_ERROR(H5E_FUNC, H5E_UNINITIALIZED, FAIL);
-/* towrite=H5Tsize(dataset->type)*H5Pnelem(did); */
+#if 0
+ towrite=H5Tsize(dataset->type)*H5Pnelem(did);
+#endif
/* Check memory to disk datatype conversions, etc. */
/* data out */
diff --git a/src/H5Dproto.h b/src/H5Dproto.h
index 362d323..d7114c8 100644
--- a/src/H5Dproto.h
+++ b/src/H5Dproto.h
@@ -28,6 +28,7 @@ extern "C"
hatom_t H5D_create(hatom_t owner_id, hobjtype_t type, const char *name);
herr_t H5Dset_info(hatom_t oid, hatom_t tid, hatom_t did);
herr_t H5D_release(hatom_t oid);
+herr_t H5Dwrite(hatom_t oid, hatom_t did, VOIDP buf);
#if defined c_plusplus || defined __cplusplus
}
diff --git a/src/H5F.c b/src/H5F.c
index fe950c5..38eb17c 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -433,7 +433,7 @@ hatom_t H5Fcreate(const char *filename, uintn flags, hatom_t create_temp, hatom_
H5ECLEAR;
if(filename==NULL) /* check for valid filename */
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL);
- if(flags&(~H5ACC_OVERWRITE)!=0) /* check for valid flags */
+ if((flags&~H5ACC_OVERWRITE)!=0) /* check for valid flags */
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL);
/* See if this file is already open */
diff --git a/src/H5G.c b/src/H5G.c
index 172b946..458792b 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -286,7 +286,7 @@ H5G_stab_insert (hdf5_file_t *f, H5G_entry_t *self, const char *name,
}
if (stab.btree<=0 || stab.heap<=0) {
if (stab.btree<=0 &&
- (stab.btree = H5B_new (f, H5B_SNODE, sizeof(H5G_node_key_t)))<0) {
+ (stab.btree = H5B_new (f, H5B_SNODE))<0) {
HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL);
}
if (stab.heap<=0) {
diff --git a/src/H5H.c b/src/H5H.c
index 2a92dee..8c90095 100644
--- a/src/H5H.c
+++ b/src/H5H.c
@@ -573,8 +573,7 @@ H5H_insert (hdf5_file_t *f, haddr_t addr, size_t buf_size, const void *buf)
*/
if (offset<0) {
- need_more = MAX (2*heap->mem_alloc, H5H_SIZEOF_FREE(f));
- need_more = MAX (need_more, need);
+ need_more = MAX3 (need, heap->mem_alloc, H5H_SIZEOF_FREE(f));
if (max_fl && max_fl->offset+max_fl->size==heap->mem_alloc) {
/*
diff --git a/src/H5O.c b/src/H5O.c
index 6e899fc..1b259ba 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -1038,7 +1038,6 @@ H5O_alloc (hdf5_file_t *f, H5O_t *oh, const H5O_class_t *type, size_t size)
/* check args */
assert (oh);
assert (type);
- assert (size>=0);
H5O_ALIGN (size, oh->alignment);
/* look for a null message which is large enough */
diff --git a/src/hdf5port.h b/src/hdf5port.h
index 5b7c848..3f3a5c2 100644
--- a/src/hdf5port.h
+++ b/src/hdf5port.h
@@ -24,10 +24,13 @@
* Generally useful macro definitions
**************************************************************************/
#ifndef MIN
-#define MIN(a,b) (((a)<(b)) ? (a) : (b))
+# define MIN(a,b) (((a)<(b)) ? (a) : (b))
#endif
#ifndef MAX
-#define MAX(a,b) (((a)>(b)) ? (a) : (b))
+# define MAX(a,b) (((a)>(b)) ? (a) : (b))
+#endif
+#ifndef MAX3
+# define MAX3(a,b,c) MAX(MAX(a,b),c)
#endif
/**************************************************************************