summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-09-15 19:27:23 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-09-15 19:27:23 (GMT)
commit8656a64d002335cdb40b846dd8eb9013cc295226 (patch)
tree031cfb619394dc14a59887c3318de2cd3d52dd98 /src
parent0cd492bb8e5fb8db0d227ad1fc6073be14e36b44 (diff)
downloadhdf5-8656a64d002335cdb40b846dd8eb9013cc295226.zip
hdf5-8656a64d002335cdb40b846dd8eb9013cc295226.tar.gz
hdf5-8656a64d002335cdb40b846dd8eb9013cc295226.tar.bz2
[svn-r83] Bug fixed in H5G_namei().
Arg type changes in H5Bprivate.h Sorted Makefile.in
Diffstat (limited to 'src')
-rw-r--r--src/H5Bprivate.h4
-rw-r--r--src/H5C.c28
-rw-r--r--src/H5G.c5
-rw-r--r--src/H5public.h8
-rw-r--r--src/Makefile.in9
5 files changed, 36 insertions, 18 deletions
diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h
index 597c79f..457c8af 100644
--- a/src/H5Bprivate.h
+++ b/src/H5Bprivate.h
@@ -55,8 +55,8 @@ typedef struct H5B_class_t {
haddr_t (*new)(hdf5_file_t*,void*,void*,void*);
intn (*cmp)(hdf5_file_t*,void*,void*,void*);
herr_t (*found)(hdf5_file_t*,haddr_t,const void*,void*,const void*);
- haddr_t (*insert)(hdf5_file_t*,haddr_t,int*,void*,int*,void*,void*,
- void*,int*);
+ haddr_t (*insert)(hdf5_file_t*,haddr_t,int*,void*,hbool_t*,void*,void*,
+ void*,hbool_t*);
herr_t (*list)(hdf5_file_t*,haddr_t,void*);
herr_t (*decode)(hdf5_file_t*,uint8*,void*);
herr_t (*encode)(hdf5_file_t*,uint8*,void*);
diff --git a/src/H5C.c b/src/H5C.c
index d80acde..23a0450 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -399,12 +399,20 @@ done:
Robb Matzke, 26 Aug 1997
Changed `hash_size' to `val' in two places.
+
+ Robb Matzke, 15 Sep 1997
+ The H5_OFFSET_SIZE and H5_LENGTH_SIZE parameters should be passed
+ a uint8 pointer for the BUF value.
+
+ Robb Matzke, 15 Sep 1997
+ Fixed the power-of-two test to work with any size integer.
--------------------------------------------------------------------------*/
herr_t H5Csetparm(hatom_t tid, file_create_param_t parm, const VOIDP buf)
{
file_create_temp_t *template; /* template to query */
herr_t ret_value = SUCCEED;
uintn val;
+ intn i;
FUNC_ENTER(H5Csetparm, H5C_init_interface, FAIL);
@@ -423,27 +431,25 @@ herr_t H5Csetparm(hatom_t tid, file_create_param_t parm, const VOIDP buf)
{
case H5_USERBLOCK_SIZE:
val = *(const uintn *)buf;
- /* If anyone knows a faster test for a power of two, please change this silly code -QAK */
- if (val!=0 && !(val==512 || val==1024 || val==2048 || val==4096
- || val==8192 || val==16374 || val==32768 || val==65536
- || val==131072 || val==262144 || val==524288 || val==1048576
- || val==2097152 || val==4194304 || val==8388608
- || val==16777216 || val==33554432 || val==67108864
- || val==134217728 || val==268435456)) {
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL);
- }
+ for (i=8; i<8*sizeof(int); i++) {
+ uintn p2 = 8==i ? 0 :1<<i;
+ if (val==p2) break;
+ }
+ if (i>=8*sizeof(int)) {
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL);
+ }
template->userblock_size=val;
break;
case H5_OFFSET_SIZE:
- val = *(const uintn *)buf;
+ val = *(const uint8 *)buf;
if(!(val==2 || val==4 || val==8 || val==16 || val==32 || val==64 || val==128 || val==256))
HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL);
template->offset_size=val;
break;
case H5_LENGTH_SIZE:
- val = *(const uintn *)buf;
+ val = *(const uint8 *)buf;
if(!(val==2 || val==4 || val==8 || val==16 || val==32 || val==64 || val==128 || val==256))
HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL);
template->length_size=val;
diff --git a/src/H5G.c b/src/H5G.c
index 1cffed5..8096daf 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -263,6 +263,11 @@ H5G_namei (hdf5_file_t *f, H5G_entry_t *cwd, const char *name,
H5O_reset (H5O_NAME, &mesg);
*base = *dir;
aside = TRUE;
+ } else {
+ /* component not found */
+ H5O_reset (H5O_NAME, &mesg);
+ if (dir_ent) *dir_ent = *dir;
+ HRETURN_ERROR (H5E_DIRECTORY, H5E_NOTFOUND, -2);
}
H5O_reset (H5O_NAME, &mesg);
} else {
diff --git a/src/H5public.h b/src/H5public.h
index 1cc190c..7a5ed05 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -43,9 +43,15 @@ typedef unsigned int uint32;
#elif SIZEOF_LONG==4
typedef long int32;
typedef unsigned long uint32;
+#else
+typedef int int32; /*not really*/
+typedef unsigned uint32; /*not really*/
#endif
-#if SIZEOF_LONG==8
+#if SIZEOF_INT==8
+typedef int int64;
+typedef unsigned uint64;
+#elif SIZEOF_LONG==8
typedef long int64;
typedef unsigned long uint64;
#elif SIZEOF_LONG_LONG==8
diff --git a/src/Makefile.in b/src/Makefile.in
index 4136a0c..d77a356 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,4 +1,4 @@
-# HDF5 Library Makefile(.in) -*- makefile -*-
+# HDF5 Library Makefile(.in)
#
# Copyright (C) 1997 National Center for Supercomputing Applications.
# All rights reserved.
@@ -14,9 +14,10 @@ LIB=libhdf5.a
PROGS=debug
# Source and object files for the library (lexicographically)...
-LIB_SRC=H5.c H5A.c H5AC.c H5B.c H5C.c H5D.c H5E.c H5F.c H5G.c H5Gnode.c \
- H5H.c H5M.c H5MF.c H5MM.c H5O.c H5Ocont.c H5Oname.c H5Onull.c \
- H5Ostab.c H5Osdtyp.c H5Osdim.c H5P.c H5T.c H5Ostdst.c H5Dconv.c
+LIB_SRC=H5.c H5A.c H5AC.c H5B.c H5C.c H5D.c H5Dconv.c H5E.c H5F.c H5G.c \
+ H5Gnode.c H5H.c H5M.c H5MF.c H5MM.c H5O.c H5Ocont.c H5Oname.c \
+ H5Onull.c H5Osdtyp.c H5Osdim.c H5Ostab.c H5Ostdst.c H5P.c H5T.c
+
LIB_OBJ=$(LIB_SRC:.c=.o)
# Source and object files for programs...