- Fixed a bug in napi5.c
This commit is contained in:
8
hmdata.c
8
hmdata.c
@ -320,9 +320,6 @@ static long SumRow(HistInt *iData, int iDataLength, int iStart, int iEnd){
|
||||
for(i = iStart; i < iEnd; i++){
|
||||
lSum += iData[i];
|
||||
}
|
||||
if(lSum < 0){
|
||||
lSum = -lSum;
|
||||
}
|
||||
return lSum;
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@ -332,7 +329,7 @@ long sumHMDataRectangle(pHistMem hist, SConnection *pCon,
|
||||
pHMdata self = hist->pDriv->data;
|
||||
int i, iHistLength, status, iIndex;
|
||||
char pBueffel[256];
|
||||
unsigned long lSum;
|
||||
unsigned long lSum, lRowSum;
|
||||
|
||||
assert(self);
|
||||
|
||||
@ -380,8 +377,9 @@ long sumHMDataRectangle(pHistMem hist, SConnection *pCon,
|
||||
lSum = 0;
|
||||
for(i = iStart[0]; i < iEnd[0]; i++){
|
||||
iIndex = i*self->iDim[1];
|
||||
lSum += SumRow(self->localBuffer,iHistLength,
|
||||
lRowSum = SumRow(self->localBuffer,iHistLength,
|
||||
iIndex+iStart[1], iIndex+iEnd[1]);
|
||||
lSum += lRowSum;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user