From: srn Date: Thu, 18 Aug 2005 10:59:59 +0000 (+0000) Subject: BugID: IPAL9619, modified a way to get the size of a dataset in case if the dataset... X-Git-Tag: T_3_0_2a1~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a18a17e772a91fd72384ef1fe02db7995bc2ec32;p=modules%2Fkernel.git BugID: IPAL9619, modified a way to get the size of a dataset in case if the dataset has a type HDF_INT32 --- diff --git a/src/HDFPersist/HDFdatasetWrite.c b/src/HDFPersist/HDFdatasetWrite.c index 07dbefdd9..e3727a812 100644 --- a/src/HDFPersist/HDFdatasetWrite.c +++ b/src/HDFPersist/HDFdatasetWrite.c @@ -44,7 +44,7 @@ hdf_err HDFdatasetWrite(hdf_idt id, void *val) hdf_err ret; #ifdef PCLINUX int isI32BE = 0; - int size; + int size = 0; #endif if ((datatype = H5Dget_type(id)) < 0) @@ -53,10 +53,21 @@ hdf_err HDFdatasetWrite(hdf_idt id, void *val) #ifdef PCLINUX if((H5Tget_class(datatype) == H5T_INTEGER) && (H5Tget_size(datatype) == 4)) { isI32BE = 1; /* See HDFdatasetCreate */ - size = (int)HDFdatasetGetSize(id) / 4; + + /*SRN : bug IPAL9619: replaced the method of getting the size of INT32 dataset */ + int i, ndim = HDFdatasetGetnDim(id); + if(ndim < 0) return -1; + + hdf_size *dim = (hdf_size *) malloc(sizeof(hdf_size)*ndim); + if ((ret == HDFdatasetGetDim(id, dim)) < 0) return -1; + + for(i=0; i