diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2007-03-09 18:16:19 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2007-03-09 18:16:19 (GMT) |
commit | 56b7fd71a3ccf6b5e200cd5fc0669302c309b73e (patch) | |
tree | 12391af3d066e9616035f8c00567e8981a620149 /tools/h5repack/h5repacktst.c | |
parent | d7c3cc41397ca858f91f14480a26b22fb171f01c (diff) | |
download | hdf5-56b7fd71a3ccf6b5e200cd5fc0669302c309b73e.zip hdf5-56b7fd71a3ccf6b5e200cd5fc0669302c309b73e.tar.gz hdf5-56b7fd71a3ccf6b5e200cd5fc0669302c309b73e.tar.bz2 |
[svn-r13483]
Bug fix
Some data was declared as char and saved with H5T_NATIVE_CHAR type. But the data have negative values
Solution : declared data as signed char and used H5T_NATIVE_SCHAR
Diffstat (limited to 'tools/h5repack/h5repacktst.c')
-rw-r--r-- | tools/h5repack/h5repacktst.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index cbe6a69..04c9a67 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -2579,8 +2579,8 @@ int make_big(hid_t loc_id, int set_chunk) hsize_t hs_start[1]; size_t size; size_t nelmts=(size_t)GBLL/1024; - char fillvalue=-1; - char *buf=NULL; + signed char fillvalue=-1; + signed char *buf=NULL; int i, j, s; char c; char name[20]; @@ -2590,7 +2590,7 @@ int make_big(hid_t loc_id, int set_chunk) /* create */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) goto out; - if (H5Pset_fill_value(dcpl, H5T_NATIVE_CHAR, &fillvalue)<0) + if (H5Pset_fill_value(dcpl, H5T_NATIVE_SCHAR, &fillvalue)<0) goto out; if (set_chunk) @@ -2601,7 +2601,7 @@ int make_big(hid_t loc_id, int set_chunk) } if ((f_sid = H5Screate_simple(1,dims,NULL))<0) goto out; - if ((did = H5Dcreate(loc_id,name,H5T_NATIVE_CHAR,f_sid,dcpl))<0) + if ((did = H5Dcreate(loc_id,name,H5T_NATIVE_SCHAR,f_sid,dcpl))<0) goto out; if ((m_sid = H5Screate_simple(1, hs_size, hs_size))<0) goto out; @@ -2626,7 +2626,7 @@ int make_big(hid_t loc_id, int set_chunk) hs_start[0] = i * GBLL/1024; if (H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size, NULL)<0) goto out; - if (H5Dwrite (did,H5T_NATIVE_CHAR,m_sid,f_sid,H5P_DEFAULT,buf)<0) + if (H5Dwrite (did,H5T_NATIVE_SCHAR,m_sid,f_sid,H5P_DEFAULT,buf)<0) goto out; /* write only one hyperslab */ @@ -2660,7 +2660,6 @@ out: } - /*------------------------------------------------------------------------- * Function: write_dset_in * |