[svn-r24] ./src/H5B.c

./src/H5Bprivate.h
./src/H5G.c
	H5B_new() only takes two arguments.

./src/H5C.c
	Fixed initializer for default_file_create to be the same order
	as it's definition.

./src/H5D.c
	Changed commented-out code to #if 0/#endif.  #if'd out a
	variable that was unused because of #if'd out code.

./src/H5Dproto.c
	Added a prototype for H5Dwrite().

./src/H5F.c
	Changed parentheses to fix precedence problems from:

		flags & (~H5AC_OVERWRITE) != 0
	to
		(flags & ~H5AC_OVERWRITE) != 0

./src/H5H.c
	Heap reallocation doubles the heap size instead of tripling it.

./src/H5O.c
	Got rid of a statement with no effect.

./src/hdf5port.h
	Indented a few #defines.  Added a defn for MAX3().
This commit is contained in:
Robb Matzke 1997-08-11 17:49:59 -05:00
parent eec23941ab
commit 326981f421
10 changed files with 19 additions and 12 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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 # */

View File

@ -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 */

View File

@ -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
}

View File

@ -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 */

View File

@ -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) {

View File

@ -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) {
/*

View File

@ -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 */

View File

@ -29,6 +29,9 @@
#ifndef MAX
# define MAX(a,b) (((a)>(b)) ? (a) : (b))
#endif
#ifndef MAX3
# define MAX3(a,b,c) MAX(MAX(a,b),c)
#endif
/**************************************************************************
* Macros to work around ANSI C portability problems.