summaryrefslogtreecommitdiffstats
path: root/perform
Commit message (Expand)AuthorAgeFilesLines
* [svn-r16969] Updated perf_serial test to work on windows.Allen Byrne2009-05-214-229/+235
* [svn-r16807] Purpose: Fix bug 1533Neil Fortner2009-04-201-1/+1
* [svn-r16792] Description:Mike McGreevy2009-04-201-4/+4
* [svn-r16561] Purpose:Mike McGreevy2009-03-101-3/+3
* [svn-r16560] Description:Quincey Koziol2009-03-105-449/+404
* [svn-r16518] have 2 expected outputs for 2 h5ls runs depending if run on a bi...Pedro Vicente Nunes2009-02-261-0/+1
* [svn-r16489] Fixed bug #1459 by eliminating the macro long_long and replacing...Allen Byrne2009-02-186-93/+56
* [svn-r16340] Description:Frank Baker2009-01-221-1/+1
* [svn-r16170] Code clean up.Albert Cheng2008-12-091-13/+12
* [svn-r16167] Bug fix: 1089Albert Cheng2008-12-091-3/+3
* [svn-r15957] Revised the help page of h5perf.Christian Chilan2008-10-261-27/+49
* [svn-r15942] Purpose: Bug Fixes and Libtool UpgradeMike McGreevy2008-10-241-6/+6
* [svn-r15832] Modified the display of the accumulated times taken to open and ...Christian Chilan2008-10-091-1/+1
* [svn-r15808] Some test produced files were not cleaned by "make clean".Albert Cheng2008-10-082-2/+2
* [svn-r15772] Added feature to display file open and close times.Christian Chilan2008-10-031-4/+39
* [svn-r15665] Bug fix: (ID 1157)Albert Cheng2008-09-191-2/+4
* [svn-r15655] Changed the absolute path of the data file to a relative path.Christian Chilan2008-09-181-3/+7
* [svn-r15649] Included macros for portability of h5perf code among HDF5 versions.Christian Chilan2008-09-171-13/+35
* [svn-r15628] Description:Quincey Koziol2008-09-163-68/+68
* [svn-r15582] Added script to build h5perf_serial in standalone mode.Christian Chilan2008-09-021-0/+28
* [svn-r15563] Added support for serial prefix HDF5_PREFIX.Christian Chilan2008-08-292-20/+14
* [svn-r15397] Update to the h5perf files that includes bug fixes and extensions.Christian Chilan2008-07-233-2158/+2402
* [svn-r15179] Change copyright notice to THG only.Christian Chilan2008-06-097-7/+0
* [svn-r15150] Purpose: Separate Windows function macro definitions to win32defs.hScott Wegner2008-06-051-4/+4
* [svn-r15149] Purpose: Bug FixMike McGreevy2008-06-052-2/+2
* [svn-r15090] Revise copyright notice.Christian Chilan2008-05-292-4/+6
* [svn-r15043] Bug fix.Albert Cheng2008-05-201-2/+4
* [svn-r15041] Purpose: Configure FixMike McGreevy2008-05-192-4/+0
* [svn-r15036] Bug fix.Albert Cheng2008-05-191-4/+4
* [svn-r15023] Revise man page of the serial benchmarking tool.Christian Chilan2008-05-161-3/+3
* [svn-r15009] Revise file of the serial benchmarking tool to include new man p...Christian Chilan2008-05-151-83/+51
* [svn-r15007] Purpose: configure cleanupMike McGreevy2008-05-151-1/+0
* [svn-r15003] Purpose:Albert Cheng2008-05-151-0/+15
* [svn-r14969] Purpose: Bug Fix (Bug 1144)Mike McGreevy2008-05-122-17/+63
* [svn-r14933] Purpose: Updating HDF5 to use automake 1.10.1 and libtool 2.2.2Mike McGreevy2008-05-051-14/+18
* [svn-r14903] Undoing change committed in r14902.Scot Breitenfeld2008-04-309-7/+4424
* [svn-r14902] Merged fortran_1_8 branch changes r14505:14901 into the trunk. N...Scot Breitenfeld2008-04-309-4424/+7
* [svn-r14831] Revise file of the serial benchmarking tool.Christian Chilan2008-04-121-9/+6
* [svn-r14829] Revised files of the serial benchmarking tool.Christian Chilan2008-04-112-8/+6
* [svn-r14827] Makefiles configured to build and test the serial benchmarking t...Christian Chilan2008-04-102-7/+24
* [svn-r14826] Files for the serial benchmarking tool, h5perf_serial.Christian Chilan2008-04-105-0/+4132
* [svn-r14825] Files for the serial benchmarking tool, h5perf_serial.Christian Chilan2008-04-102-0/+273
* [svn-r14402] Description:Quincey Koziol2008-01-131-0/+1
* [svn-r14218] Description:Quincey Koziol2007-10-301-6/+6
* [svn-r14199] Description:Quincey Koziol2007-10-117-73/+69
* [svn-r14193] Description:Quincey Koziol2007-10-084-90/+87
* [svn-r14187] Description:Quincey Koziol2007-10-041-71/+82
* [svn-r13972] Description:Quincey Koziol2007-07-131-0/+1
* [svn-r13971] Description:Quincey Koziol2007-07-121-0/+1
* [svn-r13928] Purpose: 1) Moving H5_CXX_HAVE_OFFSETOF macro to src/H5pubconf.h...Mike McGreevy2007-06-291-3/+2
'ctx'> /*
@@ -183,7 +183,7 @@ nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen)
{
int ret_value = -1;
char *c_name;
- int c_namelen;
+ int_f c_namelen;
hid_t c_loc_id;
htri_t status;
@@ -193,7 +193,7 @@ nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen)
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
- c_name = (char *)HD5f2cstring(dsetname, c_namelen);
+ c_name = (char *)HD5f2cstring(dsetname, (size_t)c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -227,7 +227,7 @@ nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hi
{
int ret_value = -1;
char *c_name;
- int c_namelen;
+ int_f c_namelen;
hid_t c_file_id;
unsigned c_access_flags;
hid_t c_acc_prp;
@@ -249,7 +249,7 @@ nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hi
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
- c_name = (char *)HD5f2cstring(name, c_namelen);
+ c_name = (char *)HD5f2cstring(name, (size_t)c_namelen);
if (c_name == NULL) return ret_value;
/*
@@ -360,14 +360,14 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag)
{
int ret_value = -1;
char *c_name;
- int c_namelen;
+ int_f c_namelen;
htri_t status;
/*
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
- c_name = (char *)HD5f2cstring(name, c_namelen);
+ c_name = (char *)HD5f2cstring(name, (size_t)c_namelen);
if (c_name == NULL) return ret_value;
/*
diff --git a/fortran/src/H5Fff.f90 b/fortran/src/H5Fff.f90
index 4fbeba9..126fde1 100644
--- a/fortran/src/H5Fff.f90
+++ b/fortran/src/H5Fff.f90
@@ -68,8 +68,8 @@
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp
! File access property list
! identifier
- INTEGER :: creation_prp_default
- INTEGER :: access_prp_default
+ INTEGER(HID_T) :: creation_prp_default
+ INTEGER(HID_T) :: access_prp_default
INTEGER :: namelen ! Length of the name character string
! INTEGER, EXTERNAL :: h5fcreate_c
@@ -86,8 +86,8 @@
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER, INTENT(IN) :: access_flags
INTEGER(HID_T), INTENT(OUT) :: file_id
- INTEGER, INTENT(IN) :: creation_prp_default
- INTEGER, INTENT(IN) :: access_prp_default
+ INTEGER(HID_T), INTENT(IN) :: creation_prp_default
+ INTEGER(HID_T), INTENT(IN) :: access_prp_default
INTEGER :: namelen
END FUNCTION h5fcreate_c
END INTERFACE
@@ -223,7 +223,7 @@
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp
! File access property list
! identifier
- INTEGER :: access_prp_default
+ INTEGER(HID_T) :: access_prp_default
INTEGER :: namelen ! Length of the name character string
! INTEGER, EXTERNAL :: h5fmount_c
@@ -360,7 +360,7 @@
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp
! File access property list
! identifier
- INTEGER :: access_prp_default
+ INTEGER(HID_T) :: access_prp_default
INTEGER :: namelen ! Length of the name character string
! INTEGER, EXTERNAL :: h5fopen_c
@@ -377,7 +377,7 @@
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER :: namelen
INTEGER, INTENT(IN) :: access_flags
- INTEGER, INTENT(IN) :: access_prp_default
+ INTEGER(HID_T), INTENT(IN) :: access_prp_default
INTEGER(HID_T), INTENT(OUT) :: file_id
END FUNCTION h5fopen_c
END INTERFACE
diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c
index 910ab89..2b6e8be 100644
--- a/fortran/src/H5Pf.c
+++ b/fortran/src/H5Pf.c
@@ -1646,7 +1646,7 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name,
* Call H5Pget_external function.
*/
c_prp_id = (hid_t)*prp_id;
- c_idx = (unsigned)*idx;
+ c_idx = (unsigned)*idx;
status = H5Pget_external(c_prp_id, c_idx, c_namelen, c_name, &c_offset, &size );
if (status < 0) goto DONE;
diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c
index 8fbcbef..cd1ccd0 100644
--- a/fortran/src/H5Tf.c
+++ b/fortran/src/H5Tf.c
@@ -1397,7 +1397,7 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
hid_t c_type_id;
char* c_name;
int c_namelen;
- int c_value;
+ int_f c_value;
herr_t error;
c_namelen = *namelen;
@@ -1437,11 +1437,11 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen)
char* c_name;
size_t c_namelen;
herr_t error;
- int c_value;
+ int_f c_value;
c_value = *value;
c_namelen = ((size_t)*namelen) +1;
c_name = (char *)malloc(sizeof(char)*c_namelen);
- c_type_id = *type_id;
+ c_type_id = (hid_t)*type_id;
error = H5Tenum_nameof(c_type_id, &c_value, c_name, c_namelen);
HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name));
HDfree(c_name);
@@ -1472,17 +1472,16 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
hid_t c_type_id;
char* c_name;
int c_namelen;
- int c_value;
herr_t error;
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
c_type_id = *type_id;
- error = H5Tenum_valueof(c_type_id, c_name, &c_value);
+ error = H5Tenum_valueof(c_type_id, c_name, value);
HDfree(c_name);
+
if(error < 0) return ret_value;
- *value = (int_f)c_value;
ret_value = 0;
return ret_value;
}
diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c
index 07eff36..8d88667 100644
--- a/fortran/src/H5_f.c
+++ b/fortran/src/H5_f.c
@@ -43,7 +43,22 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype
int ret_value = -1;
hid_t c_type_id;
+ size_t tmp_val;
+
+/* Fortran INTEGER is may not be the same as C in; do all checking to find
+ an appropriate size
+*/
+ if (sizeof(int_f) == sizeof(int)) {
if ((types[0] = (hid_t_f)H5Tcopy(H5T_NATIVE_INT)) < 0) return ret_value;
+ } /*end if */
+ else if (sizeof(int_f) == sizeof(long)) {
+ if ((types[0] = (hid_t_f)H5Tcopy(H5T_NATIVE_LONG)) < 0) return ret_value;
+ } /*end if */
+ else
+ if (sizeof(int_f) == sizeof(long long)) {
+ if ((types[0] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value;
+ } /*end else */
+
/* Accomodate Crays with this check */
if(sizeof(real_f)==sizeof(double)) {
if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value;
@@ -52,11 +67,13 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype
if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value;
} /* end else */
if ((types[2] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value;
+
/*
if ((types[3] = H5Tcopy(H5T_NATIVE_UINT8)) < 0) return ret_value;
*/
if ((c_type_id = H5Tcopy(H5T_FORTRAN_S1)) < 0) return ret_value;
- if(H5Tset_size(c_type_id, 1) < 0) return ret_value;
+ tmp_val = 1;
+ if(H5Tset_size(c_type_id, tmp_val) < 0) return ret_value;
if(H5Tset_strpad(c_type_id, H5T_STR_SPACEPAD) < 0) return ret_value;
types[3] = (hid_t_f)c_type_id;
@@ -188,7 +205,7 @@ int_f
nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags,
int_f *h5fd_flags, hid_t_f *h5fd_hid_flags,
int_f *h5g_flags, int_f *h5i_flags,
- int_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags,
+ hid_t_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags,
int_f *h5t_flags, int_f *h5z_flags)
{
int ret_value = -1;
@@ -317,7 +334,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags,
h5s_flags[3] = H5S_SELECT_SET;
h5s_flags[4] = H5S_SELECT_OR;
h5s_flags[5] = (int_f)H5S_UNLIMITED;
- h5s_flags[6] = H5S_ALL;
+ h5s_flags[6] = (int_f)H5S_ALL;
h5s_flags[7] = H5S_SELECT_NOOP;
h5s_flags[8] = H5S_SELECT_AND;
diff --git a/fortran/src/H5_ff.f90 b/fortran/src/H5_ff.f90
index 1e8d215..4974c9a 100644
--- a/fortran/src/H5_ff.f90
+++ b/fortran/src/H5_ff.f90
@@ -91,9 +91,9 @@
INTEGER i_H5G_flags(H5G_FLAGS_LEN)
INTEGER i_H5D_flags(H5D_FLAGS_LEN)
INTEGER i_H5FD_flags(H5FD_FLAGS_LEN)
- INTEGER i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN)
+ INTEGER(HID_T) i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN)
INTEGER i_H5I_flags(H5I_FLAGS_LEN)
- INTEGER i_H5P_flags(H5P_FLAGS_LEN)
+ INTEGER(HID_T) i_H5P_flags(H5P_FLAGS_LEN)
INTEGER i_H5R_flags(H5R_FLAGS_LEN)
INTEGER i_H5S_flags(H5S_FLAGS_LEN)
INTEGER i_H5T_flags(H5T_FLAGS_LEN)
diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90
index b17680e..ebd3c93 100644
--- a/fortran/src/H5f90global.f90
+++ b/fortran/src/H5f90global.f90
@@ -313,7 +313,7 @@
! H5FD file drivers flags declaration
!
INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 8
- INTEGER H5FD_hid_flags(H5FD_HID_FLAGS_LEN)
+ INTEGER(HID_T) H5FD_hid_flags(H5FD_HID_FLAGS_LEN)
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$ ATTRIBUTES DLLEXPORT :: /H5FD_HID_FLAGS/
!DEC$endif
@@ -369,19 +369,19 @@
! H5P flags declaration
!
INTEGER, PARAMETER :: H5P_FLAGS_LEN = 7
- INTEGER H5P_flags(H5P_FLAGS_LEN)
+ INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN)
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$ ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/
!DEC$endif
COMMON /H5P_FLAGS/ H5P_flags
- INTEGER :: H5P_FILE_CREATE_F
- INTEGER :: H5P_FILE_ACCESS_F
- INTEGER :: H5P_DATASET_CREATE_F
- INTEGER :: H5P_DATASET_XFER_F
- INTEGER :: H5P_MOUNT_F
- INTEGER :: H5P_DEFAULT_F
- INTEGER :: H5P_NO_CLASS_F
+ INTEGER(HID_T) :: H5P_FILE_CREATE_F
+ INTEGER(HID_T) :: H5P_FILE_ACCESS_F
+ INTEGER(HID_T) :: H5P_DATASET_CREATE_F
+ INTEGER(HID_T) :: H5P_DATASET_XFER_F
+ INTEGER(HID_T) :: H5P_MOUNT_F
+ INTEGER(HID_T) :: H5P_DEFAULT_F
+ INTEGER(HID_T) :: H5P_NO_CLASS_F
EQUIVALENCE(H5P_flags(1), H5P_FILE_CREATE_F)
EQUIVALENCE(H5P_flags(2), H5P_FILE_ACCESS_F)
diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h
index 537ae97..6768f19 100644
--- a/fortran/src/H5f90proto.h
+++ b/fortran/src/H5f90proto.h
@@ -50,7 +50,7 @@ H5_FCDLL int_f nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2);
H5_FCDLL int_f nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id);
H5_FCDLL int_f nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id);
H5_FCDLL int_f nh5fget_obj_count_c (hid_t_f *file_id, int_f *obj_type, int_f *obj_count);
-H5_FCDLL int_f nh5fget_obj_ids_c (hid_t_f *file_id, int_f *obj_type, int_f *max_objs, int_f *obj_ids);
+H5_FCDLL int_f nh5fget_obj_ids_c (hid_t_f *file_id, int_f *obj_type, int_f *max_objs, hid_t_f *obj_ids);
H5_FCDLL int_f nh5fget_freespace_c (hid_t_f *file_id, hssize_t_f *free_space);
H5_FCDLL int_f nh5fflush_c (hid_t_f *obj_id, int_f *scope);
H5_FCDLL int_f nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen);
@@ -653,7 +653,7 @@ H5_FCDLL int_f nh5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f * float
H5_FCDLL int_f nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags,
int_f *h5fd_flags, hid_t_f *h5fd_hid_flags,
int_f *h5g_flags, int_f *h5i_flags,
- int_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags,
+ hid_t_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags,
int_f *h5t_flags, int_f *h5z_flags);
H5_FCDLL int_f nh5init1_flags_c(int_f *h5lib_flags);
H5_FCDLL int_f nh5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum);
diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c
index 97dcf33..2edc813 100644
--- a/fortran/src/H5match_types.c
+++ b/fortran/src/H5match_types.c
@@ -221,13 +221,13 @@ int main()
#endif
/* int */
-#if defined H5_FORTRAN_HAS_INTEGER_8 && H5_SIZEOF_INT >= 8
+#if defined H5_FORTRAN_HAS_NATIVE_8
writeToFiles("INT", "int_f", 8);
-#elif defined H5_FORTRAN_HAS_INTEGER_4 && H5_SIZEOF_INT >= 4
+#elif defined H5_FORTRAN_HAS_NATIVE_4
writeToFiles("INT", "int_f", 4);
-#elif defined H5_FORTRAN_HAS_INTEGER_2 && H5_SIZEOF_INT >= 2
+#elif defined H5_FORTRAN_HAS_NATIVE_2
writeToFiles("INT", "int_f", 2);
-#elif defined H5_FORTRAN_HAS_INTEGER_1 && H5_SIZEOF_INT >= 1
+#elif defined H5_FORTRAN_HAS_NATIVE_1
writeToFiles("INT", "int_f", 1);
#else
/* Error: couldn't find a size for int */
diff --git a/fortran/src/H5test_kind.f90 b/fortran/src/H5test_kind.f90
index db2971e..1f5dca3 100644
--- a/fortran/src/H5test_kind.f90
+++ b/fortran/src/H5test_kind.f90
@@ -23,11 +23,36 @@
! Generate a program
write(*,*) "program int_kind"
write(*,*) "write(*,*) "" /*generating header file*/ """
+ j = 0
+ write(*, "("" call i"", i2.2,""()"")") j
do i = 1, ii
j = kind_numbers(i)
write(*, "("" call i"", i2.2,""()"")") j
enddo
write(*,*) "end program int_kind"
+ j = 0
+ write(*, "("" subroutine i"" i2.2,""()"")") j
+ write(*,*)" implicit none"
+ write(*,*)" integer :: a"
+ write(*,*)" integer :: a_size"
+ write(*,*)" a_size = bit_size(a)"
+ write(*,*)" if (a_size .eq. 8) then"
+ write(*,*)" write(*,*) ""#define H5_FORTRAN_HAS_NATIVE_1"" "
+ write(*,*)" endif"
+ write(*,*)" if (a_size .eq. 16) then"
+ write(*,*)" write(*,*) ""#define H5_FORTRAN_HAS_NATIVE_2"" "
+ write(*,*)" endif"
+ write(*,*)" if (a_size .eq. 32) then"
+ write(*,*)" write(*,*) ""#define H5_FORTRAN_HAS_NATIVE_4"" "
+ write(*,*)" endif"
+ write(*,*)" if (a_size .eq. 64) then"
+ write(*,*)" write(*,*) ""#define H5_FORTRAN_HAS_NATIVE_8"" "
+ write(*,*)" endif"
+ write(*,*)" if (a_size .eq. 128) then"
+ write(*,*)" write(*,*) ""#define H5_FORTRAN_HAS_NATIVE_16"" "
+ write(*,*)" endif"
+ write(*,*)" return"
+ write(*,*)" end subroutine"
do i = 1, ii
j = kind_numbers(i)
write(*, "("" subroutine i"" i2.2,""()"")") j
diff --git a/fortran/test/fortranlib_test.f90 b/fortran/test/fortranlib_test.f90
index 6481c8b..b736edf 100644
--- a/fortran/test/fortranlib_test.f90
+++ b/fortran/test/fortranlib_test.f90
@@ -61,7 +61,6 @@
write(*,*) ' ========================== '
write(*,*) ' FORTRAN tests '
write(*,*) ' ========================== '
-
CALL h5get_libversion_f(majnum, minnum, relnum, total_error)
if(total_error .eq. 0) then
@@ -76,7 +75,6 @@
endif
write(*,*)
! CALL h5check_version_f(1,4,4,total_error)
-
! write(*,*) '========================================='
! write(*,*) 'Testing FILE Interface '
! write(*,*) '========================================='
@@ -88,7 +86,6 @@
write(*, fmt = e_format) error_string
total_error = total_error + mounting_total_error
-
error_string = failure
CALL reopentest(cleanup, reopen_total_error)
IF (reopen_total_error == 0) error_string = success
@@ -96,7 +93,6 @@
write(*, fmt = '(58x,a)', advance = 'no') ' '
write(*, fmt = e_format) error_string
total_error = total_error + reopen_total_error
-
error_string = failure
CALL file_close(cleanup, fclose_total_error)
IF (fclose_total_error == 0) error_string = success
@@ -113,7 +109,6 @@
write(*, fmt = e_format) error_string
total_error = total_error + fspace_total_error
-
! write(*,*)
! write(*,*) '========================================='
! write(*,*) 'Testing DATASET Interface '
@@ -126,7 +121,6 @@
write(*, fmt = '(57x,a)', advance = 'no') ' '
write(*, fmt = e_format) error_string
total_error = total_error + dataset_total_error
-
error_string = failure
CALL extenddsettest(cleanup, extend_dataset_total_error)
IF (extend_dataset_total_error == 0) error_string = success
@@ -134,7 +128,6 @@
write(*, fmt = '(46x,a)', advance = 'no') ' '
write(*, fmt = e_format) error_string
total_error = total_error + extend_dataset_total_error
-
! write(*,*)
! write(*,*) '========================================='
! write(*,*) 'Testing DATASPACE Interface '
@@ -204,7 +197,6 @@
! write(*,*) '========================================='
! write(*,*) 'Testing DATATYPE interface '
! write(*,*) '========================================='
-
error_string = failure
CALL basic_data_type_test(cleanup, basic_datatype_total_error)
IF (basic_datatype_total_error == 0) error_string = success
@@ -220,7 +212,6 @@
write(*, fmt = '(47x,a)', advance = 'no') ' '
write(*, fmt = e_format) error_string
total_error = total_error + total_error_compoundtest
-
error_string = failure
CALL enumtest(cleanup, enum_total_error)
IF (enum_total_error == 0) error_string = success
@@ -228,8 +219,6 @@
write(*, fmt = '(51x,a)', advance = 'no') ' '
write(*, fmt = e_format) error_string
total_error = total_error + enum_total_error
-
-
! write(*,*)
! write(*,*) '========================================='
! write(*,*) 'Testing PROPERTY interface '
@@ -251,7 +240,6 @@
write(*, fmt = '(47x,a)', advance = 'no') ' '
write(*, fmt = e_format) error_string
total_error = total_error + multi_file_total_error
-
! write(*,*)
! write(*,*) '========================================='
! write(*,*) 'Testing ATTRIBUTE interface '
@@ -277,7 +265,6 @@
write(*, fmt = '(54x,a)', advance = 'no') ' '
write(*, fmt = e_format) error_string
total_error = total_error + identifier_total_error
-
error_string = failure
CALL filters_test(cleanup, z_total_error)
IF (z_total_error == 0) error_string = success
diff --git a/fortran/test/tH5F.f90 b/fortran/test/tH5F.f90
index d1e0064..46832bb 100644
--- a/fortran/test/tH5F.f90
+++ b/fortran/test/tH5F.f90
@@ -678,8 +678,10 @@
write(*,*) "File should be closed at this point, error"
endif
- if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error)
+ if(cleanup) then
+ CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error)
CALL check("h5_cleanup_f", error, total_error)
+ endif
deallocate(obj_ids)
RETURN
diff --git a/fortran/test/tH5I.f90 b/fortran/test/tH5I.f90
index 8790bc3..6864c4b 100644
--- a/fortran/test/tH5I.f90
+++ b/fortran/test/tH5I.f90
@@ -257,13 +257,14 @@
! Close the file by decrementing the reference count
CALL h5idec_ref_f(file_id, ref_count, error)
- CALL check("h5iinc_ref_f",error,total_error)
+ CALL check("h5idec_ref_f",error,total_error)
CALL verify("get file ref count wrong",ref_count,0,total_error)
-
! Try closing the file again (should fail)
+ CALL h5eset_auto_f(0, error)
CALL h5fclose_f(file_id, error)
CALL verify("file close should fail",error,-1,total_error)
! Clear the error stack from the file close failure
+ CALL h5eset_auto_f(1, error)
CALL h5eclear_f(error)
if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error)
diff --git a/fortran/test/tH5P.f90 b/fortran/test/tH5P.f90
index 19a657f..af301aa 100644
--- a/fortran/test/tH5P.f90
+++ b/fortran/test/tH5P.f90
@@ -44,6 +44,7 @@
!specified dataset
INTEGER(SIZE_T) :: namesize
INTEGER(HSIZE_T) :: size, buf_size
+ INTEGER :: idx
buf_size = 4*1024*1024
@@ -95,10 +96,13 @@
CALL check("h5pclose_f", error, total_error)
CALL h5sclose_f(space_id, error)
CALL check("h5sclose_f", error, total_error)
- ! Read dataset creation information
+ CALL h5fclose_f(file_id, error)
+
+ CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, file_id, error)
CALL h5dopen_f(file_id, "dset1", dataset_id, error)
CALL check("h5dopen_f",error,total_error)
+ ! Read dataset creation information
CALL h5dget_create_plist_f(dataset_id, plist_id, error)
CALL check("h5dget_create_plist_f",error,total_error)
CALL h5pget_external_count_f(plist_id, count, error)
@@ -108,7 +112,8 @@
total_error = total_error + 1
end if
namesize = 10
- CALL h5pget_external_f(plist_id, 0, namesize, name, file_offset, &
+ idx = 0
+ CALL h5pget_external_f(plist_id, idx, namesize, name, file_offset, &
file_bytes, error)
CALL check("h5pget_external_f",error,total_error)
if(file_offset .ne. 0 ) then
@@ -282,7 +287,6 @@
CALL check("h5fclose_f", error, total_error)
CALL h5pclose_f(fapl, error)
CALL check("h5pclose_f", error, total_error)
-
!
! Open the existing file.
!
diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c
index f4c71cb..7d09f10 100755
--- a/hl/fortran/src/H5IMfc.c
+++ b/hl/fortran/src/H5IMfc.c
@@ -16,6 +16,7 @@
#include "H5IM.h"
#include "H5LTf90proto.h"
+#include "../../../fortran/src/H5f90i_gen.h"
/*-------------------------------------------------------------------------
@@ -43,7 +44,7 @@ nh5immake_image_8bit_c (hid_t_f *loc_id,
_fcd name,
hsize_t_f *width,
hsize_t_f *height,
- void *buf)
+ int_f *buf)
{
int ret_value = -1;
herr_t ret;
@@ -54,7 +55,7 @@ nh5immake_image_8bit_c (hid_t_f *loc_id,
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
+ c_namelen = (int)*namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
@@ -62,7 +63,6 @@ nh5immake_image_8bit_c (hid_t_f *loc_id,
* Call H5IMmake_image_8bitf function.
*/
c_loc_id = (hid_t)*loc_id;
-
ret = H5IMmake_image_8bitf(c_loc_id,c_name,*width,*height,buf);
if (ret < 0) return ret_value;
@@ -93,7 +93,7 @@ int_f
nh5imread_image_c (hid_t_f *loc_id,
int_f *namelen,
_fcd name,
- void *buf)
+ int_f *buf)
{
int ret_value = -1;
herr_t ret;
@@ -105,7 +105,7 @@ nh5imread_image_c (hid_t_f *loc_id,
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
+ c_namelen = (int)*namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h
index 2b8e932..e3c36fd 100755
--- a/hl/fortran/src/H5LTf90proto.h
+++ b/hl/fortran/src/H5LTf90proto.h
@@ -245,13 +245,13 @@ nh5immake_image_8bit_c (hid_t_f *loc_id,
_fcd name,
hsize_t_f *width,
hsize_t_f *height,
- void *buf);
+ int_f *buf);
H5_DLL
int_f
nh5imread_image_c (hid_t_f *loc_id,
int_f *namelen,
_fcd name,
- void *buf);
+ int_f *buf);
H5_DLL
int_f
diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c
index d36128f..15733ab 100755
--- a/hl/fortran/src/H5LTfc.c
+++ b/hl/fortran/src/H5LTfc.c
@@ -291,7 +291,7 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id,
c_name = (char *)HD5f2cstring(dsetname, c_namelen);
if (c_name == NULL) return ret_value;
- c_attrnamelen = *attrnamelen;
+ c_attrnamelen = (int)*attrnamelen;
c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen);
if (c_attrname == NULL) return ret_value;
@@ -301,8 +301,15 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id,
c_loc_id = (hid_t)*loc_id;
c_size = (size_t)*size;
- ret = H5LTset_attribute_int(c_loc_id,c_name,c_attrname,buf,c_size);
-
+ if (sizeof(int_f) == sizeof(int))
+ ret = H5LTset_attribute_int(c_loc_id,c_name,c_attrname,buf,c_size);
+ else if (sizeof(int_f) == sizeof(long))
+ ret = H5LTset_attribute_long(c_loc_id,c_name,c_attrname,buf,c_size);
+ else if (sizeof(int_f) == sizeof(long long))
+ ret = H5LTset_attribute_long_long(c_loc_id,c_name,c_attrname,buf,c_size);
+ else
+ return ret_value;
+
if (ret < 0) return ret_value;
ret_value = 0;
return ret_value;
@@ -311,7 +318,7 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id,
/*-------------------------------------------------------------------------
* Function: H5LTset_attribute_float_c
*
- * Purpose: Call H5LTset_attribute_int
+ * Purpose: Call H5LTset_attribute_float
*
* Return: Success: 0, Failure: -1
*
@@ -357,7 +364,7 @@ nh5ltset_attribute_float_c(hid_t_f *loc_id,
if (c_attrname == NULL) return ret_value;
/*
- * Call H5LTset_attribute_int function.
+ * Call H5LTset_attribute_float function.
*/
c_loc_id = (hid_t)*loc_id;
c_size = (size_t)*size;
@@ -373,7 +380,7 @@ nh5ltset_attribute_float_c(hid_t_f *loc_id,
/*-------------------------------------------------------------------------
* Function: H5LTset_attribute_double_c
*
- * Purpose: Call H5LTset_attribute_int
+ * Purpose: Call H5LTset_attribute_double
*
* Return: Success: 0, Failure: -1
*
@@ -419,7 +426,7 @@ nh5ltset_attribute_double_c(hid_t_f *loc_id,
if (c_attrname == NULL) return ret_value;
/*
- * Call H5LTset_attribute_int function.
+ * Call H5LTset_attribute_double function.
*/
c_loc_id = (hid_t)*loc_id;
c_size = (size_t)*size;
@@ -434,7 +441,7 @@ nh5ltset_attribute_double_c(hid_t_f *loc_id,
/*-------------------------------------------------------------------------
* Function: H5LTset_attribute_string_c
*
- * Purpose: Call H5LTset_attribute_int
+ * Purpose: Call H5LTset_attribute_string
*
* Return: Success: 0, Failure: -1
*
@@ -478,7 +485,7 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id,
if (c_attrname == NULL) return ret_value;
/*
- * Call H5LTset_attribute_int function.
+ * Call H5LTset_attribute_string function.
*/
c_loc_id = (hid_t)*loc_id;
@@ -527,11 +534,11 @@ nh5ltget_attribute_int_c(hid_t_f *loc_id,
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
+ c_namelen = (int)*namelen;
c_name = (char *)HD5f2cstring(dsetname, c_namelen);
if (c_name == NULL) return ret_value;
- c_attrnamelen = *attrnamelen;
+ c_attrnamelen = (int)*attrnamelen;
c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen);
if (c_attrname == NULL) return ret_value;
@@ -539,8 +546,15 @@ nh5ltget_attribute_int_c(hid_t_f *loc_id,
* Call H5LTget_attribute_int function.
*/
c_loc_id = (hid_t)*loc_id;
-
- ret = H5LTget_attribute_int(c_loc_id,c_name,c_attrname,buf);
+
+ if(sizeof(int_f) == sizeof(int))
+ ret = H5LTget_attribute_int(c_loc_id,c_name,c_attrname,buf);
+ else if (sizeof(int_f) == sizeof(long))
+ ret = H5LTget_attribute_long(c_loc_id,c_name,c_attrname,buf);
+ else if (sizeof(int_f) == sizeof(long long))
+ ret = H5LTget_attribute_long_long(c_loc_id,c_name,c_attrname,buf);
+ else
+ return ret_value;
if (ret < 0) return ret_value;
ret_value = 0;
@@ -586,11 +600,11 @@ nh5ltget_attribute_float_c(hid_t_f *loc_id,
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
+ c_namelen = (int)*namelen;
c_name = (char *)HD5f2cstring(dsetname, c_namelen);
if (c_name == NULL) return ret_value;
- c_attrnamelen = *attrnamelen;
+ c_attrnamelen = (int)*attrnamelen;
c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen);
if (c_attrname == NULL) return ret_value;
@@ -644,11 +658,11 @@ nh5ltget_attribute_double_c(hid_t_f *loc_id,
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
+ c_namelen = (int)*namelen;
c_name = (char *)HD5f2cstring(dsetname, c_namelen);
if (c_name == NULL) return ret_value;
- c_attrnamelen = *attrnamelen;
+ c_attrnamelen = (int)*attrnamelen;
c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen);
if (c_attrname == NULL) return ret_value;
@@ -702,11 +716,11 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id,
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
+ c_namelen = (int)*namelen;
c_name = (char *)HD5f2cstring(dsetname, c_namelen);
if (c_name == NULL) return ret_value;
- c_attrnamelen = *attrnamelen;
+ c_attrnamelen = (int)*attrnamelen;
c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen);
if (c_attrname == NULL) return ret_value;
@@ -753,11 +767,12 @@ nh5ltget_dataset_ndims_c(hid_t_f *loc_id,
hid_t c_loc_id;
char *c_name;
int c_namelen;
+ int c_rank;
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
+ c_namelen = (int)*namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
@@ -766,9 +781,10 @@ nh5ltget_dataset_ndims_c(hid_t_f *loc_id,
*/
c_loc_id = (hid_t)*loc_id;
- ret = H5LTget_dataset_ndims(c_loc_id, c_name, rank);
+ ret = H5LTget_dataset_ndims(c_loc_id, c_name, &c_rank);
if (ret < 0) return ret_value;
+ *rank = (int_f)c_rank;
ret_value = 0;
return ret_value;
}
@@ -805,7 +821,7 @@ nh5ltfind_dataset_c(hid_t_f *loc_id,
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
+ c_namelen = (int)*namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return -1;
@@ -858,7 +874,7 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id,
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
+ c_namelen = (int)*namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
@@ -915,26 +931,28 @@ nh5ltget_attribute_ndims_c(hid_t_f *loc_id,
char *c_attrname;
int c_namelen;
int c_attrnamelen;
+ int c_rank;
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
+ c_namelen =(int) *namelen;
c_name = (char *)HD5f2cstring(dsetname, c_namelen);
if (c_name == NULL) return ret_value;
- c_attrnamelen = *attrnamelen;
+ c_attrnamelen = (int)*attrnamelen;
c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen);
if (c_attrname == NULL) return ret_value;
/*
- * Call H5LTset_attribute_int function.
+ * Call H5LTset_attribute_ndims function.
*/
c_loc_id = (hid_t)*loc_id;
- ret = H5LTget_attribute_ndims(c_loc_id,c_name,c_attrname,rank);
+ ret = H5LTget_attribute_ndims(c_loc_id,c_name,c_attrname,&c_rank);
if (ret < 0) return ret_value;
+ *rank = (int_f)c_rank;
ret_value = 0;
return ret_value;
}
@@ -984,11 +1002,11 @@ nh5ltget_attribute_info_c(hid_t_f *loc_id,
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
+ c_namelen = (int)*namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
- c_attrnamelen = *attrnamelen;
+ c_attrnamelen = (int)*attrnamelen;
c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen);
if (c_attrname == NULL) return ret_value;
diff --git a/hl/fortran/test/tstimage.f90 b/hl/fortran/test/tstimage.f90
index 42fe52a..d820caf 100755
--- a/hl/fortran/test/tstimage.f90
+++ b/hl/fortran/test/tstimage.f90
@@ -127,12 +127,10 @@ call test_begin(' Make/Read image 8bit ')
! write image.
!
call h5immake_image_8bit_f(file_id,dsetname1,width,height,buf1,errcode)
-
!
! read image.
!
call h5imread_image_f(file_id,dsetname1,bufr1,errcode)
-
!
! compare read and write buffers.
!
diff --git a/hl/fortran/test/tstlite.f90 b/hl/fortran/test/tstlite.f90
index f34053a..f043c8f 100644
--- a/hl/fortran/test/tstlite.f90
+++ b/hl/fortran/test/tstlite.f90
@@ -707,7 +707,6 @@ call test_begin(' Get dataset dimensions ')
!-------------------------------------------------------------------------
call h5ltget_dataset_ndims_f(file_id, dsetname4, rankr, errcode)
-
if ( rankr .ne. rank ) then
print *, 'h5ltget_dataset_ndims_f return error'
stop
@@ -952,4 +951,4 @@ end subroutine test_begin
subroutine passed()
write(*, fmt = '(6a)') 'PASSED'
-end subroutine passed \ No newline at end of file
+end subroutine passed
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c
index b7e8060..a6709c0 100644
--- a/hl/src/H5IM.c
+++ b/hl/src/H5IM.c
@@ -11,6 +11,8 @@
****************************************************************************/
#include "H5IM.h"
+#include "../../fortran/src/H5f90i_gen.h"
+
#include <string.h>
#include <stdlib.h>
@@ -24,7 +26,7 @@ herr_t H5IM_get_palette( hid_t loc_id,
const char *image_name,
int pal_number,
hid_t tid,
- void *pal_data);
+ int_f *pal_data);
/*-------------------------------------------------------------------------
@@ -1292,7 +1294,7 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
const char *dset_name,
hsize_t width,
hsize_t height,
- void *buf )
+ int_f *buf )
{
hid_t did; /* dataset ID */
hid_t sid; /* space ID */
@@ -1313,13 +1315,24 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
return -1;
/* create the dataset as H5T_NATIVE_UCHAR */
- if ((did=H5Dcreate(loc_id,dset_name,H5T_NATIVE_UCHAR,sid,H5P_DEFAULT))<0)
+ if ((did=H5Dcreate(loc_id,dset_name,H5T_NATIVE_UINT8,sid,H5P_DEFAULT))<0)
return -1;
/* write with memory type H5T_NATIVE_INT */
+ /* Use long type if Fortran integer is 8 bytes and C long long is also 8 bytes*/
+ /* Fail if otherwise */
if (buf)
{
+ if (sizeof(int_f) == sizeof(int)) {
if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ return -1;}
+ else if (sizeof(int_f) == sizeof(long)) {
+ if (H5Dwrite(did,H5T_NATIVE_LONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ return -1;}
+ else if (sizeof(int_f) == sizeof(long long)) {
+ if (H5Dwrite(did,H5T_NATIVE_LLONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ return -1;}
+ else
return -1;
}
@@ -1382,7 +1395,7 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
hsize_t width,
hsize_t height,
const char *interlace,
- void *buf)
+ int_f *buf)
{
hid_t did; /* dataset ID */
hid_t sid; /* space ID */
@@ -1425,7 +1438,16 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
/* write with memory type H5T_NATIVE_INT */
if (buf)
{
+ if (sizeof(int_f) == sizeof(int)) {
if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ return -1;}
+ else if (sizeof(int_f) == sizeof(long)) {
+ if (H5Dwrite(did,H5T_NATIVE_LONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ return -1;}
+ else if (sizeof(int_f) == sizeof(long long)) {
+ if (H5Dwrite(did,H5T_NATIVE_LLONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ return -1;}
+ else
return -1;
}
@@ -1484,7 +1506,7 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
herr_t H5IMread_imagef( hid_t loc_id,
const char *dset_name,
- void *buf )
+ int_f *buf )
{
hid_t did;
@@ -1493,13 +1515,21 @@ herr_t H5IMread_imagef( hid_t loc_id,
return -1;
/* read to memory type H5T_NATIVE_INT */
+ if (sizeof(int_f) == sizeof(int)){
if ( H5Dread( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf ) < 0 )
+ goto out;}
+ else if (sizeof(int_f) == sizeof(long)) {
+ if ( H5Dread( did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf ) < 0 )
+ goto out;}
+ else if (sizeof(int_f) == sizeof(long long)) {
+ if ( H5Dread( did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf ) < 0 )
+ goto out;}
+ else
goto out;
/* close */
if ( H5Dclose( did ) )
return -1;
-
return 0;
out:
@@ -1536,7 +1566,7 @@ out:
herr_t H5IMmake_palettef( hid_t loc_id,
const char *pal_name,
const hsize_t *pal_dims,
- void *pal_data )
+ int_f *pal_data )
{
@@ -1567,7 +1597,16 @@ herr_t H5IMmake_palettef( hid_t loc_id,
/* write with memory type H5T_NATIVE_INT */
if (pal_data)
{
+ if (sizeof(int_f) == sizeof(int)) {
if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,pal_data)<0)
+ return -1;}
+ else if (sizeof(int_f) == sizeof(long)) {
+ if (H5Dwrite(did,H5T_NATIVE_LONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,pal_data)<0)
+ return -1;}
+ else if (sizeof(int_f) == sizeof(long long)) {
+ if (H5Dwrite(did,H5T_NATIVE_LLONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,pal_data)<0)
+ return -1;}
+ else
return -1;
}
@@ -1622,9 +1661,17 @@ herr_t H5IMmake_palettef( hid_t loc_id,
herr_t H5IMget_palettef( hid_t loc_id,
const char *image_name,
int pal_number,
- void *pal_data )
+ int_f *pal_data )
{
- return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_INT,pal_data);
+ if(sizeof(int_f) == sizeof(int))
+ return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_INT,pal_data);
+ else if (sizeof(int_f) == sizeof(long))
+ return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_LONG,pal_data);
+ else if (sizeof(int_f) == sizeof(long long))
+ return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_LLONG,pal_data);
+ else
+ return -1;
+
}
/*-------------------------------------------------------------------------
@@ -1659,7 +1706,7 @@ herr_t H5IM_get_palette( hid_t loc_id,
const char *image_name,
int pal_number,
hid_t tid,
- void *pal_data)
+ int_f *pal_data)
{
hid_t image_id;
int has_pal;
diff --git a/hl/src/H5IM.h b/hl/src/H5IM.h