From: srn Date: Thu, 8 Sep 2005 09:37:06 +0000 (+0000) Subject: Modified the way a size of INT32 dataset is calculated X-Git-Tag: T2_2_5b~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=77c2ec41cf1f72adbd11771ef0900e4edbec31f7;p=modules%2Fkernel.git Modified the way a size of INT32 dataset is calculated --- diff --git a/src/HDFPersist/HDFdatasetWrite.c b/src/HDFPersist/HDFdatasetWrite.c index 07dbefdd9..5bcb60585 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 : 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