Commit 3006d239 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Change internal checksums to uint32_t.

parent e1b85556
#include <inttypes.h>
#include "cdi_cksum.h"
double cdiCheckSum(int type, int count, void * buffer)
uint32_t cdiCheckSum(int type, int count, void * buffer)
{
return 0.0;
return 0U;
}
#ifndef CDI_CKSUM_H_
#define CDI_CKSUM_H_
double cdiCheckSum(int type, int count, void *data);
#include <inttypes.h>
uint32_t cdiCheckSum(int type, int count, void *data);
#endif
......@@ -717,7 +717,7 @@ streamGetPackSize(void * voidP, void *context)
stream_t * streamP = ( stream_t * ) voidP;
int packBufferSize
= serializeGetSize(streamNint, DATATYPE_INT, context)
+ serializeGetSize(2, DATATYPE_FLT64, context)
+ serializeGetSize(2, DATATYPE_UINT32, context)
+ serializeGetSize((int)strlen(streamP->filename) + 1,
DATATYPE_TXT, context)
+ serializeGetSize(1, DATATYPE_FLT64, context);
......@@ -731,7 +731,6 @@ streamPack(void * streamptr, void * packBuffer, int packBufferSize,
{
stream_t * streamP = ( stream_t * ) streamptr;
int intBuffer[streamNint];
double d;
intBuffer[0] = streamP->self;
intBuffer[1] = streamP->filetype;
......@@ -746,13 +745,13 @@ streamPack(void * streamptr, void * packBuffer, int packBufferSize,
intBuffer[10] = cdiHaveMissval;
serializePack(intBuffer, streamNint, DATATYPE_INT, packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_INT, streamNint, intBuffer);
serializePack(&d, 1, DATATYPE_FLT64, packBuffer, packBufferSize, packBufferPos, context);
uint32_t d = cdiCheckSum(DATATYPE_INT, streamNint, intBuffer);
serializePack(&d, 1, DATATYPE_UINT32, packBuffer, packBufferSize, packBufferPos, context);
serializePack(&cdiDefaultMissval, 1, DATATYPE_FLT64, packBuffer, packBufferSize, packBufferPos, context);
serializePack(streamP->filename, intBuffer[2], DATATYPE_TXT, packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_TXT, intBuffer[2], &streamP->filename);
serializePack(&d, 1, DATATYPE_FLT64, packBuffer, packBufferSize, packBufferPos, context);
serializePack(&d, 1, DATATYPE_UINT32, packBuffer, packBufferSize, packBufferPos, context);
}
struct streamAssoc
......@@ -760,13 +759,13 @@ streamUnpack(char * unpackBuffer, int unpackBufferSize,
int * unpackBufferPos, int nspTarget, void *context)
{
int intBuffer[streamNint], streamID;
double d;
uint32_t d;
char filename[CDI_MAX_NAME];
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
intBuffer, streamNint, DATATYPE_INT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_INT, streamNint, intBuffer) == d);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
......@@ -774,7 +773,7 @@ streamUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&filename, intBuffer[2], DATATYPE_TXT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(d == cdiCheckSum(DATATYPE_TXT, intBuffer[2], filename));
streamID = streamOpenWrite ( filename, intBuffer[1] );
xassert ( streamID >= 0 &&
......
......@@ -4398,7 +4398,7 @@ gridTxCode ()
}
enum { gridNint = 27,
gridNdouble = 25,
gridNdouble = 24,
gridNstrings= 8,
gridHasMaskFlag = 1 << 0,
gridHasGMEMaskFlag = 1 << 1,
......@@ -4435,13 +4435,13 @@ gridGetPackSize(void * voidP, void *context)
int packBuffSize = 0, count;
packBuffSize += serializeGetSize(gridNint, DATATYPE_INT, context)
+ serializeGetSize(1, DATATYPE_FLT64, context);
+ serializeGetSize(1, DATATYPE_UINT32, context);
if (gridP->rowlon)
{
xassert(gridP->nrowlon);
packBuffSize += serializeGetSize(gridP->nrowlon, DATATYPE_INT, context)
+ serializeGetSize( 1, DATATYPE_FLT64, context);
+ serializeGetSize( 1, DATATYPE_UINT32, context);
}
packBuffSize += serializeGetSize(gridNdouble, DATATYPE_FLT64, context);
......@@ -4453,7 +4453,8 @@ gridGetPackSize(void * voidP, void *context)
else
count = gridP->xsize;
xassert(count);
packBuffSize += serializeGetSize(count + 1, DATATYPE_FLT64, context);
packBuffSize += serializeGetSize(count, DATATYPE_FLT64, context)
+ serializeGetSize(1, DATATYPE_UINT32, context);
}
if (gridP->yvals)
......@@ -4463,14 +4464,16 @@ gridGetPackSize(void * voidP, void *context)
else
count = gridP->ysize;
xassert(count);
packBuffSize += serializeGetSize(count + 1, DATATYPE_FLT64, context);
packBuffSize += serializeGetSize(count, DATATYPE_FLT64, context)
+ serializeGetSize(1, DATATYPE_UINT32, context);
}
if (gridP->area)
{
xassert(gridP->size);
packBuffSize +=
serializeGetSize(gridP->size + 1, DATATYPE_FLT64, context);
serializeGetSize(gridP->size, DATATYPE_FLT64, context)
+ serializeGetSize(1, DATATYPE_UINT32, context);
}
if (gridP->xbounds)
......@@ -4482,7 +4485,8 @@ gridGetPackSize(void * voidP, void *context)
count = gridP->xsize;
xassert(count);
packBuffSize
+= serializeGetSize(gridP->nvertex * count + 1, DATATYPE_FLT64, context);
+= (serializeGetSize(gridP->nvertex * count, DATATYPE_FLT64, context)
+ serializeGetSize(1, DATATYPE_UINT32, context));
}
if (gridP->ybounds)
......@@ -4494,18 +4498,19 @@ gridGetPackSize(void * voidP, void *context)
count = gridP->ysize;
xassert(count);
packBuffSize
+= serializeGetSize(gridP->nvertex * count + 1, DATATYPE_FLT64, context);
+= (serializeGetSize(gridP->nvertex * count, DATATYPE_FLT64, context)
+ serializeGetSize(1, DATATYPE_UINT32, context));
}
packBuffSize +=
serializeGetSize(gridNstrings * CDI_MAX_NAME , DATATYPE_TXT, context)
+ serializeGetSize(1, DATATYPE_FLT64, context);
+ serializeGetSize(1, DATATYPE_UINT32, context);
if (gridP->reference)
{
packBuffSize += serializeGetSize(1, DATATYPE_INT, context)
+ serializeGetSize(strlen(gridP->reference) + 1, DATATYPE_TXT, context)
+ serializeGetSize(1, DATATYPE_FLT64, context);
+ serializeGetSize(1, DATATYPE_UINT32, context);
}
if (gridP->mask)
......@@ -4513,14 +4518,14 @@ gridGetPackSize(void * voidP, void *context)
xassert(gridP->size);
packBuffSize
+= serializeGetSize(gridP->size, DATATYPE_UCHAR, context)
+ serializeGetSize(1, DATATYPE_FLT64, context);
+ serializeGetSize(1, DATATYPE_UINT32, context);
}
if (gridP->mask_gme)
{
xassert(gridP->size);
packBuffSize += serializeGetSize(gridP->size, DATATYPE_UCHAR, context)
+ serializeGetSize( 1, DATATYPE_FLT64, context);
+ serializeGetSize(1, DATATYPE_UINT32, context);
}
return packBuffSize;
......@@ -4532,8 +4537,8 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
int * unpackBufferPos, int nspTarget, void *context)
{
grid_t * gridP;
uint32_t d;
int memberMask, size;
double d;
char charBuffer[gridNstrings * CDI_MAX_NAME];
gridInit();
......@@ -4545,7 +4550,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
intBuffer, gridNint, DATATYPE_INT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_INT, gridNint, intBuffer) == d);
xassert(namespaceAdaptKey(intBuffer[0], nspTarget) == gridP->self);
......@@ -4585,7 +4590,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
gridP->rowlon, gridP->nrowlon , DATATYPE_INT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_INT, gridP->nrowlon, gridP->rowlon) == d);
}
......@@ -4593,8 +4598,9 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
double doubleBuffer[gridNdouble];
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
doubleBuffer, gridNdouble, DATATYPE_FLT64, context);
xassert(doubleBuffer[24]
== cdiCheckSum(DATATYPE_FLT, gridNdouble, doubleBuffer));
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_UINT32, context);
xassert(d == cdiCheckSum(DATATYPE_FLT, gridNdouble, doubleBuffer));
gridP->xfirst = doubleBuffer[0];
gridP->yfirst = doubleBuffer[1];
......@@ -4633,7 +4639,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
gridP->xvals, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_FLT, size, gridP->xvals) == d );
}
......@@ -4648,7 +4654,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
gridP->yvals, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_FLT, size, gridP->yvals) == d);
}
......@@ -4659,7 +4665,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
gridP->area, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_FLT, size, gridP->area) == d);
}
......@@ -4675,7 +4681,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
gridP->xbounds, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_FLT, size, gridP->xbounds) == d);
}
......@@ -4691,14 +4697,14 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
gridP->ybounds, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_FLT, size, gridP->ybounds) == d);
}
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
charBuffer, gridNstrings * CDI_MAX_NAME, DATATYPE_TXT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(d == cdiCheckSum(DATATYPE_TXT, gridNstrings * CDI_MAX_NAME, charBuffer));
......@@ -4720,7 +4726,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
gridP->reference, referenceSize, DATATYPE_TXT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_TXT, referenceSize, gridP->reference) == d);
}
......@@ -4731,7 +4737,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
gridP->mask, gridP->size, DATATYPE_UCHAR, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_TXT, gridP->size, gridP->mask) == d);
}
......@@ -4742,7 +4748,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
gridP->mask_gme, gridP->size, DATATYPE_UCHAR, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_TXT, gridP->size, gridP->mask_gme) == d);
}
}
......@@ -4754,7 +4760,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
{
grid_t * gridP = ( grid_t * ) voidP;
int size;
double d;
uint32_t d;
char charBuffer[gridNstrings * CDI_MAX_NAME];
{
......@@ -4791,7 +4797,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(intBuffer, gridNint, DATATYPE_INT,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_INT, gridNint, intBuffer);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -4801,7 +4807,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->rowlon, size, DATATYPE_INT,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_INT , size, gridP->rowlon);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -4832,10 +4838,12 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
doubleBuffer[21] = gridP->xpole;
doubleBuffer[22] = gridP->ypole;
doubleBuffer[23] = gridP->angle;
doubleBuffer[24] = cdiCheckSum(DATATYPE_FLT, gridNdouble - 1, doubleBuffer);
serializePack(doubleBuffer, gridNdouble, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_FLT, gridNdouble, doubleBuffer);
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
if (gridP->xvals)
......@@ -4849,7 +4857,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->xvals, size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_FLT, size, gridP->xvals);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -4863,7 +4871,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->yvals, size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_FLT, size, gridP->yvals);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -4874,7 +4882,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->area, gridP->size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_FLT, gridP->size, gridP->area);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -4890,7 +4898,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->xbounds, size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_FLT, size, gridP->xbounds);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -4906,7 +4914,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->ybounds, size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_FLT, size, gridP->ybounds);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -4922,7 +4930,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack( charBuffer, gridNstrings * CDI_MAX_NAME, DATATYPE_TXT,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_TXT, gridNstrings * CDI_MAX_NAME, charBuffer);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
if ( gridP->reference )
......@@ -4933,7 +4941,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->reference, size, DATATYPE_TXT,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_TXT, size, gridP->reference);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -4943,7 +4951,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->mask, size, DATATYPE_UCHAR,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_TXT, size, gridP->mask);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -4954,7 +4962,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->mask_gme, size, DATATYPE_UCHAR,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_TXT, size, gridP->mask);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
}
......
......@@ -1312,7 +1312,7 @@ taxisGetPackSize(void *p, void *context)
taxis_t *taxisptr = p;
int packBufferSize
= serializeGetSize(taxisNint, DATATYPE_INT, context)
+ serializeGetSize(1, DATATYPE_FLT64, context)
+ serializeGetSize(1, DATATYPE_UINT32, context)
+ (taxisptr->name ?
serializeGetSize(strlen(taxisptr->name), DATATYPE_TXT, context) : 0)
+ (taxisptr->longname ?
......@@ -1327,12 +1327,12 @@ taxisUnpack(char * unpackBuffer, int unpackBufferSize, int * unpackBufferPos,
{
taxis_t * taxisP;
int intBuffer[taxisNint];
double d;
uint32_t d;
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
intBuffer, taxisNint, DATATYPE_INT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_INT, taxisNint, intBuffer) == d);
......@@ -1389,7 +1389,7 @@ taxisPack(void * voidP, void * packBuffer, int packBufferSize, int * packBufferP
{
taxis_t *taxisP = (taxis_t *)voidP;
int intBuffer[taxisNint];
double d;
uint32_t d;
intBuffer[0] = taxisP->self;
intBuffer[1] = taxisP->used;
......@@ -1413,7 +1413,7 @@ taxisPack(void * voidP, void * packBuffer, int packBufferSize, int * packBufferP
serializePack(intBuffer, taxisNint, DATATYPE_INT,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_INT, taxisNint, intBuffer);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
if (taxisP->name)
serializePack(taxisP->name, intBuffer[15], DATATYPE_TXT,
......
......@@ -1649,31 +1649,36 @@ zaxisGetPackSize(void * voidP, void *context)
{
zaxis_t * zaxisP = ( zaxis_t * ) voidP;
int packBufferSize = serializeGetSize(zaxisNint, DATATYPE_INT, context)
+ serializeGetSize(1, DATATYPE_FLT64, context);
+ serializeGetSize(1, DATATYPE_UINT32, context);
if (zaxisP->vals || zaxisP->lbounds || zaxisP->ubounds || zaxisP->weights)
xassert(zaxisP->size);
if ( zaxisP->vals )
packBufferSize += serializeGetSize( zaxisP->size + 1, DATATYPE_FLT64, context);
packBufferSize += serializeGetSize(zaxisP->size, DATATYPE_FLT64, context)
+ serializeGetSize(1, DATATYPE_UINT32, context);
if ( zaxisP->lbounds )
packBufferSize += serializeGetSize(zaxisP->size + 1, DATATYPE_FLT64, context);
packBufferSize += serializeGetSize(zaxisP->size, DATATYPE_FLT64, context)
+ serializeGetSize(1, DATATYPE_UINT32, context);
if ( zaxisP->ubounds )
packBufferSize += serializeGetSize(zaxisP->size + 1, DATATYPE_FLT64, context);
packBufferSize += serializeGetSize(zaxisP->size, DATATYPE_FLT64, context)
+ serializeGetSize(1, DATATYPE_UINT32, context);
if ( zaxisP->weights )
packBufferSize += serializeGetSize(zaxisP->size + 1, DATATYPE_FLT64, context);
packBufferSize += serializeGetSize(zaxisP->size, DATATYPE_FLT64, context)
+ serializeGetSize(1, DATATYPE_UINT32, context);
if ( zaxisP->vct )
{
xassert ( zaxisP->vctsize );
packBufferSize += serializeGetSize(zaxisP->vctsize + 1, DATATYPE_FLT64, context);
packBufferSize += serializeGetSize(zaxisP->vctsize, DATATYPE_FLT64, context)
+ serializeGetSize(1, DATATYPE_UINT32, context);
}
packBufferSize += serializeGetSize(zaxisNstrings * CDI_MAX_NAME, DATATYPE_TXT, context)
+ serializeGetSize(1, DATATYPE_FLT64, context)
+ serializeGetSize(1, DATATYPE_UINT32, context)
+ serializeGetSize(1, DATATYPE_UCHAR, context);
return packBufferSize;
}
......@@ -1685,13 +1690,13 @@ zaxisUnpack(char * unpackBuffer, int unpackBufferSize,
{
zaxis_t * zaxisP;
int intBuffer[zaxisNint], memberMask;
double d;
uint32_t d;
char charBuffer[zaxisNstrings * CDI_MAX_NAME];
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
intBuffer, zaxisNint, DATATYPE_INT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_INT, zaxisNint, intBuffer) == d);
......@@ -1719,7 +1724,7 @@ zaxisUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
zaxisP->vals, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_FLT, size, zaxisP->vals) == d);
}
......@@ -1732,7 +1737,7 @@ zaxisUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
zaxisP->lbounds, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_FLT, size, zaxisP->lbounds) == d);
}
......@@ -1745,7 +1750,7 @@ zaxisUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
zaxisP->ubounds, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_FLT, size, zaxisP->ubounds) == d);
}
......@@ -1758,7 +1763,7 @@ zaxisUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
zaxisP->weights, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_FLT, size, zaxisP->weights) == d);
}
......@@ -1771,14 +1776,14 @@ zaxisUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
zaxisP->vct, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(cdiCheckSum(DATATYPE_FLT, size, zaxisP->vct) == d);
}
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
charBuffer, zaxisNstrings * CDI_MAX_NAME, DATATYPE_TXT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context);
&d, 1, DATATYPE_UINT32, context);
xassert(d == cdiCheckSum(DATATYPE_TXT, zaxisNstrings * CDI_MAX_NAME, charBuffer));
......@@ -1797,7 +1802,7 @@ zaxisPack(void * voidP, void * packBuffer, int packBufferSize,
{
zaxis_t * zaxisP = ( zaxis_t * ) voidP;
int intBuffer[zaxisNint];
double d;
uint32_t d;
char charBuffer[zaxisNstrings * CDI_MAX_NAME];
intBuffer[0] = zaxisP->self;
......@@ -1812,7 +1817,7 @@ zaxisPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(intBuffer, zaxisNint, DATATYPE_INT,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_INT, zaxisNint, intBuffer);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
......@@ -1822,7 +1827,7 @@ zaxisPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(zaxisP->vals, zaxisP->size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_FLT, zaxisP->size, zaxisP->vals );
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -1832,7 +1837,7 @@ zaxisPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(zaxisP->lbounds, zaxisP->size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_FLT, zaxisP->size, zaxisP->lbounds);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -1843,7 +1848,7 @@ zaxisPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(zaxisP->ubounds, zaxisP->size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_FLT, zaxisP->size, zaxisP->ubounds);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -1854,7 +1859,7 @@ zaxisPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(zaxisP->weights, zaxisP->size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context);
d = cdiCheckSum(DATATYPE_FLT, zaxisP->size, zaxisP->weights);
serializePack(&d, 1, DATATYPE_FLT64,
serializePack(&d, 1, DATATYPE_UINT32,
packBuffer, packBufferSize, packBufferPos, context);
}
......@@ -1865,7 +1870,7 @@ zaxisPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(zaxisP->vct, zaxisP->vctsize, DATATYPE_FLT64,