summaryrefslogtreecommitdiffstats
path: root/hl/src
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2007-02-06 15:31:22 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2007-02-06 15:31:22 (GMT)
commitd648e5c1a7cc0a4a50367b952b052071858504e6 (patch)
tree8354e2576bef3eace8d32581b5a55f94515febcf /hl/src
parent0e276af04c8c9f26df995d32d840e33263b74502 (diff)
downloadhdf5-d648e5c1a7cc0a4a50367b952b052071858504e6.zip
hdf5-d648e5c1a7cc0a4a50367b952b052071858504e6.tar.gz
hdf5-d648e5c1a7cc0a4a50367b952b052071858504e6.tar.bz2
[svn-r13244]
bug fix on H5TBwrite_fields_index and name functions, the space on the H5Dwrite call was all selected
Diffstat (limited to 'hl/src')
-rw-r--r--hl/src/H5TA.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/hl/src/H5TA.c b/hl/src/H5TA.c
index 6d85237..4d12703 100644
--- a/hl/src/H5TA.c
+++ b/hl/src/H5TA.c
@@ -541,8 +541,9 @@ herr_t H5TBwrite_fields_name( hid_t loc_id,
hid_t member_type_id;
hid_t nmtype_id;
hsize_t count[1];
- hsize_t offset[1];
- hid_t sid=-1;
+ hsize_t offset[1];
+ hid_t mem_space_id=-1;
+ hid_t file_space_id=-1;
char *member_name;
hssize_t nfields;
hssize_t i, j;
@@ -625,35 +626,35 @@ herr_t H5TBwrite_fields_name( hid_t loc_id,
}
- /* Get the dataspace handle */
- if ( (sid = H5Dget_space( did )) < 0 )
+ /* Get the dataspace handles */
+ if ( (file_space_id = H5Dget_space( did )) < 0 )
+ goto out;
+ if ( (mem_space_id = H5Screate_simple(1, &nrecords, NULL)) < 0 )
goto out;
/* Define a hyperslab in the dataset */
offset[0] = start;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if ( H5Sselect_hyperslab(file_space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
goto out;
/* Write */
- if ( H5Dwrite( did, write_type_id, H5S_ALL, sid, PRESERVE, data ) < 0 )
+ if ( H5Dwrite( did, write_type_id, mem_space_id, file_space_id, PRESERVE, data ) < 0 )
goto out;
- /* End access to the write id */
+ /* close */
if ( H5Tclose( write_type_id ) )
goto out;
-
- /* Release the datatype. */
if ( H5Tclose( tid ) < 0 )
return -1;
-
- /* End access to the dataset */
if ( H5Dclose( did ) < 0 )
return -1;
-
- /* End access to the property list */
if ( H5Pclose( PRESERVE ) < 0 )
return -1;
+ if ( H5Sclose( file_space_id ) < 0 )
+ return -1;
+ if ( H5Sclose( mem_space_id ) < 0 )
+ return -1;
return 0;
@@ -662,7 +663,8 @@ out:
H5E_BEGIN_TRY {
H5Pclose(PRESERVE);
H5Dclose(did);
- H5Sclose(sid);
+ H5Sclose(file_space_id);
+ H5Sclose(mem_space_id);
H5Tclose(write_type_id);
H5Tclose(tid);
} H5E_END_TRY;
@@ -712,7 +714,8 @@ herr_t H5TBwrite_fields_index( hid_t loc_id,
hid_t nmtype_id;
hsize_t count[1];
hsize_t offset[1];
- hid_t sid=-1;
+ hid_t mem_space_id=-1;
+ hid_t file_space_id=-1;
char *member_name;
hsize_t i, j;
hid_t PRESERVE;
@@ -788,35 +791,35 @@ herr_t H5TBwrite_fields_index( hid_t loc_id,
}
- /* Get the dataspace handle */
- if ( (sid = H5Dget_space( did )) < 0 )
+ /* Get the dataspace handles */
+ if ( (file_space_id = H5Dget_space( did )) < 0 )
+ goto out;
+ if ( (mem_space_id = H5Screate_simple(1, &nrecords, NULL)) < 0 )
goto out;
/* Define a hyperslab in the dataset */
offset[0] = start;
count[0] = nrecords;
- if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
+ if ( H5Sselect_hyperslab( file_space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
goto out;
/* Write */
- if ( H5Dwrite( did, write_type_id, H5S_ALL, sid, PRESERVE, data ) < 0 )
+ if ( H5Dwrite( did, write_type_id, mem_space_id, file_space_id, PRESERVE, data ) < 0 )
goto out;
- /* End access to the write id */
+ /* close */
if ( H5Tclose( write_type_id ) )
goto out;
-
- /* Release the datatype. */
if ( H5Tclose( tid ) < 0 )
return -1;
-
- /* End access to the dataset */
if ( H5Dclose( did ) < 0 )
return -1;
-
- /* End access to the property list */
if ( H5Pclose( PRESERVE ) < 0 )
return -1;
+ if ( H5Sclose( file_space_id ) < 0 )
+ return -1;
+ if ( H5Sclose( mem_space_id ) < 0 )
+ return -1;
return 0;
@@ -825,7 +828,8 @@ out:
H5E_BEGIN_TRY {
H5Pclose(PRESERVE);
H5Dclose(did);
- H5Sclose(sid);
+ H5Sclose(file_space_id);
+ H5Sclose(mem_space_id);
H5Tclose(write_type_id);
H5Tclose(tid);
} H5E_END_TRY;