From 9f514c2b7de0d07cfcb26d3e2355e070033f7a11 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Wed, 24 Feb 2010 16:08:02 -0500 Subject: [svn-r18331] Description: Update to use H5Gcreate2 instead of H5Gcreate. Remove mis-used type related code. Tested: jam, amani and linew --- tools/h5copy/h5copygentest.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c index c1e21f3..cd17295 100644 --- a/tools/h5copy/h5copygentest.c +++ b/tools/h5copy/h5copygentest.c @@ -410,7 +410,7 @@ static void gent_nested_group(hid_t loc_id) *------------------------------------------------------------------------*/ static herr_t gen_obj_ref(hid_t loc_id) { - hid_t sid=0, tid=0, oid=0; + hid_t sid=0, oid=0; hsize_t dims1[1]={3}; hsize_t dims2[1]={2}; int data[3] = {10,20,30}; @@ -427,15 +427,7 @@ static herr_t gen_obj_ref(hid_t loc_id) goto out; } - tid = H5Tcopy(H5T_NATIVE_INT); - if (tid < 0) - { - fprintf(stderr, "Error: %s %d> H5Tcopy failed.\n", __FUNCTION__, __LINE__); - ret = FAIL; - goto out; - } - - oid = H5Dcreate2 (loc_id, OBJ_REF_DS, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + oid = H5Dcreate2 (loc_id, OBJ_REF_DS, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __FUNCTION__, __LINE__); @@ -443,7 +435,7 @@ static herr_t gen_obj_ref(hid_t loc_id) goto out; } - status = H5Dwrite(oid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); + status = H5Dwrite(oid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __FUNCTION__, __LINE__); @@ -452,15 +444,14 @@ static herr_t gen_obj_ref(hid_t loc_id) } H5Dclose(oid); - H5Tclose(tid); H5Sclose(sid); /*-------------- * add group */ - oid = H5Gcreate (loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + oid = H5Gcreate2 (loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - fprintf(stderr, "Error: %s %d> H5Gcreate failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __FUNCTION__, __LINE__); ret = FAIL; goto out; } @@ -515,8 +506,6 @@ out: H5Dclose(oid); if(sid > 0) H5Sclose(sid); - if(tid > 0) - H5Tclose(tid); return ret; } -- cgit v0.12