Commit e1b85556 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Move checksumming frontend to new files.

parent d71ee84f
...@@ -189,6 +189,8 @@ src/cdi.h -text ...@@ -189,6 +189,8 @@ src/cdi.h -text
src/cdi.inc -text src/cdi.inc -text
src/cdiFortran.c -text src/cdiFortran.c -text
src/cdiFortran.h -text src/cdiFortran.h -text
src/cdi_cksum.c -text
src/cdi_cksum.h -text
src/cdi_error.c -text src/cdi_error.c -text
src/cdi_int.c -text src/cdi_int.c -text
src/cdi_int.h -text src/cdi_int.h -text
......
...@@ -36,6 +36,8 @@ libcdi_la_SOURCES = \ ...@@ -36,6 +36,8 @@ libcdi_la_SOURCES = \
dmemory.h \ dmemory.h \
cksum.c \ cksum.c \
cksum.h \ cksum.h \
cdi_cksum.c \
cdi_cksum.h \
pio_util.c \ pio_util.c \
pio_util.h \ pio_util.h \
dtypes.h \ dtypes.h \
......
...@@ -117,9 +117,9 @@ LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) ...@@ -117,9 +117,9 @@ LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
libcdi_la_DEPENDENCIES = libcdi_la_DEPENDENCIES =
am_libcdi_la_OBJECTS = basetime.lo binary.lo calendar.lo cdf.lo \ am_libcdi_la_OBJECTS = basetime.lo binary.lo calendar.lo cdf.lo \
cdf_int.lo cdi_error.lo cdi_util.lo cdiFortran.lo \ cdf_int.lo cdi_error.lo cdi_util.lo cdiFortran.lo \
cgribexlib.lo dmemory.lo cksum.lo pio_util.lo error.lo \ cgribexlib.lo dmemory.lo cksum.lo cdi_cksum.lo pio_util.lo \
extralib.lo file.lo gaussgrid.lo gribapi.lo grid.lo ieglib.lo \ error.lo extralib.lo file.lo gaussgrid.lo gribapi.lo grid.lo \
institution.lo model.lo namespace.lo serialize.lo \ ieglib.lo institution.lo model.lo namespace.lo serialize.lo \
resource_handle.lo servicelib.lo stream_cdf.lo \ resource_handle.lo servicelib.lo stream_cdf.lo \
stream_cgribex.lo stream_ext.lo stream_grb.lo \ stream_cgribex.lo stream_ext.lo stream_grb.lo \
stream_gribapi.lo stream_history.lo stream_ieg.lo cdi_int.lo \ stream_gribapi.lo stream_history.lo stream_ieg.lo cdi_int.lo \
...@@ -384,6 +384,8 @@ libcdi_la_SOURCES = \ ...@@ -384,6 +384,8 @@ libcdi_la_SOURCES = \
dmemory.h \ dmemory.h \
cksum.c \ cksum.c \
cksum.h \ cksum.h \
cdi_cksum.c \
cdi_cksum.h \
pio_util.c \ pio_util.c \
pio_util.h \ pio_util.h \
dtypes.h \ dtypes.h \
...@@ -609,6 +611,7 @@ distclean-compile: ...@@ -609,6 +611,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdf.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdf_int.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdf_int.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdiFortran.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdiFortran.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_cksum.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_error.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_int.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_int.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_util.Plo@am__quote@
......
#include "cdi_cksum.h"
double cdiCheckSum(int type, int count, void * buffer)
{
return 0.0;
}
#ifndef CDI_CKSUM_H_
#define CDI_CKSUM_H_
double cdiCheckSum(int type, int count, void *data);
#endif
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "dmemory.h" #include "dmemory.h"
#include "cdi.h" #include "cdi.h"
#include "cdi_cksum.h"
#include "cdi_int.h" #include "cdi_int.h"
#include "gribapi.h" #include "gribapi.h"
#ifdef HAVE_LIBNETCDF #ifdef HAVE_LIBNETCDF
...@@ -745,12 +746,12 @@ streamPack(void * streamptr, void * packBuffer, int packBufferSize, ...@@ -745,12 +746,12 @@ streamPack(void * streamptr, void * packBuffer, int packBufferSize,
intBuffer[10] = cdiHaveMissval; intBuffer[10] = cdiHaveMissval;
serializePack(intBuffer, streamNint, DATATYPE_INT, packBuffer, packBufferSize, packBufferPos, context); serializePack(intBuffer, streamNint, DATATYPE_INT, packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_INT, streamNint, intBuffer); d = cdiCheckSum(DATATYPE_INT, streamNint, intBuffer);
serializePack(&d, 1, DATATYPE_FLT64, packBuffer, packBufferSize, packBufferPos, context); serializePack(&d, 1, DATATYPE_FLT64, packBuffer, packBufferSize, packBufferPos, context);
serializePack(&cdiDefaultMissval, 1, DATATYPE_FLT64, packBuffer, packBufferSize, packBufferPos, context); serializePack(&cdiDefaultMissval, 1, DATATYPE_FLT64, packBuffer, packBufferSize, packBufferPos, context);
serializePack(streamP->filename, intBuffer[2], DATATYPE_TXT, packBuffer, packBufferSize, packBufferPos, context); serializePack(streamP->filename, intBuffer[2], DATATYPE_TXT, packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_TXT, intBuffer[2], &streamP->filename); d = cdiCheckSum(DATATYPE_TXT, intBuffer[2], &streamP->filename);
serializePack(&d, 1, DATATYPE_FLT64, packBuffer, packBufferSize, packBufferPos, context); serializePack(&d, 1, DATATYPE_FLT64, packBuffer, packBufferSize, packBufferPos, context);
} }
...@@ -766,7 +767,7 @@ streamUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -766,7 +767,7 @@ streamUnpack(char * unpackBuffer, int unpackBufferSize,
intBuffer, streamNint, DATATYPE_INT, context); intBuffer, streamNint, DATATYPE_INT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(xchecksum(DATATYPE_INT, streamNint, intBuffer ) == d); xassert(cdiCheckSum(DATATYPE_INT, streamNint, intBuffer) == d);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&cdiDefaultMissval, 1, DATATYPE_FLT64, context); &cdiDefaultMissval, 1, DATATYPE_FLT64, context);
...@@ -774,7 +775,7 @@ streamUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -774,7 +775,7 @@ streamUnpack(char * unpackBuffer, int unpackBufferSize,
&filename, intBuffer[2], DATATYPE_TXT, context); &filename, intBuffer[2], DATATYPE_TXT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(d == xchecksum(DATATYPE_TXT, intBuffer[2], filename)); xassert(d == cdiCheckSum(DATATYPE_TXT, intBuffer[2], filename));
streamID = streamOpenWrite ( filename, intBuffer[1] ); streamID = streamOpenWrite ( filename, intBuffer[1] );
xassert ( streamID >= 0 && xassert ( streamID >= 0 &&
namespaceAdaptKey ( intBuffer[0], nspTarget ) == streamID ); namespaceAdaptKey ( intBuffer[0], nspTarget ) == streamID );
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "dmemory.h" #include "dmemory.h"
#include "cdi.h" #include "cdi.h"
#include "cdi_cksum.h"
#include "cdi_int.h" #include "cdi_int.h"
#include "grid.h" #include "grid.h"
#include "gaussgrid.h" #include "gaussgrid.h"
...@@ -4546,7 +4547,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -4546,7 +4547,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(xchecksum(DATATYPE_INT, gridNint, intBuffer) == d); xassert(cdiCheckSum(DATATYPE_INT, gridNint, intBuffer) == d);
xassert(namespaceAdaptKey(intBuffer[0], nspTarget) == gridP->self); xassert(namespaceAdaptKey(intBuffer[0], nspTarget) == gridP->self);
gridP->type = intBuffer[1]; gridP->type = intBuffer[1];
...@@ -4585,7 +4586,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -4585,7 +4586,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
gridP->rowlon, gridP->nrowlon , DATATYPE_INT, context); gridP->rowlon, gridP->nrowlon , DATATYPE_INT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(xchecksum(DATATYPE_INT, gridP->nrowlon, gridP->rowlon) == d); xassert(cdiCheckSum(DATATYPE_INT, gridP->nrowlon, gridP->rowlon) == d);
} }
{ {
...@@ -4593,7 +4594,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -4593,7 +4594,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
doubleBuffer, gridNdouble, DATATYPE_FLT64, context); doubleBuffer, gridNdouble, DATATYPE_FLT64, context);
xassert(doubleBuffer[24] xassert(doubleBuffer[24]
== xchecksum(DATATYPE_FLT, gridNdouble, doubleBuffer)); == cdiCheckSum(DATATYPE_FLT, gridNdouble, doubleBuffer));
gridP->xfirst = doubleBuffer[0]; gridP->xfirst = doubleBuffer[0];
gridP->yfirst = doubleBuffer[1]; gridP->yfirst = doubleBuffer[1];
...@@ -4633,7 +4634,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -4633,7 +4634,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
gridP->xvals, size, DATATYPE_FLT64, context); gridP->xvals, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(xchecksum(DATATYPE_FLT, size, gridP->xvals) == d ); xassert(cdiCheckSum(DATATYPE_FLT, size, gridP->xvals) == d );
} }
if (memberMask & gridHasYValsFlag) if (memberMask & gridHasYValsFlag)
...@@ -4648,7 +4649,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -4648,7 +4649,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
gridP->yvals, size, DATATYPE_FLT64, context); gridP->yvals, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(xchecksum(DATATYPE_FLT, size, gridP->yvals ) == d); xassert(cdiCheckSum(DATATYPE_FLT, size, gridP->yvals) == d);
} }
if (memberMask & gridHasAreaFlag) if (memberMask & gridHasAreaFlag)
...@@ -4659,7 +4660,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -4659,7 +4660,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
gridP->area, size, DATATYPE_FLT64, context); gridP->area, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(xchecksum(DATATYPE_FLT, size, gridP->area) == d); xassert(cdiCheckSum(DATATYPE_FLT, size, gridP->area) == d);
} }
if (memberMask & gridHasXBoundsFlag) if (memberMask & gridHasXBoundsFlag)
...@@ -4675,7 +4676,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -4675,7 +4676,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
gridP->xbounds, size, DATATYPE_FLT64, context); gridP->xbounds, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(xchecksum(DATATYPE_FLT, size, gridP->xbounds ) == d); xassert(cdiCheckSum(DATATYPE_FLT, size, gridP->xbounds) == d);
} }
if (memberMask & gridHasYBoundsFlag) if (memberMask & gridHasYBoundsFlag)
...@@ -4691,7 +4692,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -4691,7 +4692,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
gridP->ybounds, size, DATATYPE_FLT64, context); gridP->ybounds, size, DATATYPE_FLT64, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(xchecksum(DATATYPE_FLT, size, gridP->ybounds ) == d); xassert(cdiCheckSum(DATATYPE_FLT, size, gridP->ybounds) == d);
} }
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
...@@ -4699,7 +4700,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -4699,7 +4700,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(d == xchecksum(DATATYPE_TXT, gridNstrings * CDI_MAX_NAME, charBuffer)); xassert(d == cdiCheckSum(DATATYPE_TXT, gridNstrings * CDI_MAX_NAME, charBuffer));
memcpy ( gridP->xname , &charBuffer[CDI_MAX_NAME * 0], CDI_MAX_NAME ); memcpy ( gridP->xname , &charBuffer[CDI_MAX_NAME * 0], CDI_MAX_NAME );
memcpy ( gridP->yname , &charBuffer[CDI_MAX_NAME * 1], CDI_MAX_NAME ); memcpy ( gridP->yname , &charBuffer[CDI_MAX_NAME * 1], CDI_MAX_NAME );
...@@ -4720,7 +4721,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -4720,7 +4721,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
gridP->reference, referenceSize, DATATYPE_TXT, context); gridP->reference, referenceSize, DATATYPE_TXT, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(xchecksum(DATATYPE_TXT, referenceSize, gridP->reference ) == d ); xassert(cdiCheckSum(DATATYPE_TXT, referenceSize, gridP->reference) == d);
} }
if (memberMask & gridHasMaskFlag) if (memberMask & gridHasMaskFlag)
...@@ -4731,7 +4732,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -4731,7 +4732,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
gridP->mask, gridP->size, DATATYPE_UCHAR, context); gridP->mask, gridP->size, DATATYPE_UCHAR, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(xchecksum(DATATYPE_TXT, gridP->size, gridP->mask ) == d); xassert(cdiCheckSum(DATATYPE_TXT, gridP->size, gridP->mask) == d);
} }
if (memberMask & gridHasGMEMaskFlag) if (memberMask & gridHasGMEMaskFlag)
...@@ -4742,7 +4743,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -4742,7 +4743,7 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
gridP->mask_gme, gridP->size, DATATYPE_UCHAR, context); gridP->mask_gme, gridP->size, DATATYPE_UCHAR, context);
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(xchecksum(DATATYPE_TXT, gridP->size, gridP->mask_gme ) == d); xassert(cdiCheckSum(DATATYPE_TXT, gridP->size, gridP->mask_gme) == d);
} }
} }
...@@ -4789,7 +4790,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize, ...@@ -4789,7 +4790,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(intBuffer, gridNint, DATATYPE_INT, serializePack(intBuffer, gridNint, DATATYPE_INT,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_INT, gridNint, intBuffer); d = cdiCheckSum(DATATYPE_INT, gridNint, intBuffer);
serializePack(&d, 1, DATATYPE_FLT64, serializePack(&d, 1, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
} }
...@@ -4799,7 +4800,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize, ...@@ -4799,7 +4800,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
xassert((size = gridP->nrowlon)); xassert((size = gridP->nrowlon));
serializePack(gridP->rowlon, size, DATATYPE_INT, serializePack(gridP->rowlon, size, DATATYPE_INT,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_INT , size, gridP->rowlon); d = cdiCheckSum(DATATYPE_INT , size, gridP->rowlon);
serializePack(&d, 1, DATATYPE_FLT64, serializePack(&d, 1, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
} }
...@@ -4831,7 +4832,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize, ...@@ -4831,7 +4832,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
doubleBuffer[21] = gridP->xpole; doubleBuffer[21] = gridP->xpole;
doubleBuffer[22] = gridP->ypole; doubleBuffer[22] = gridP->ypole;
doubleBuffer[23] = gridP->angle; doubleBuffer[23] = gridP->angle;
doubleBuffer[24] = xchecksum(DATATYPE_FLT, gridNdouble - 1, doubleBuffer); doubleBuffer[24] = cdiCheckSum(DATATYPE_FLT, gridNdouble - 1, doubleBuffer);
serializePack(doubleBuffer, gridNdouble, DATATYPE_FLT64, serializePack(doubleBuffer, gridNdouble, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
...@@ -4847,7 +4848,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize, ...@@ -4847,7 +4848,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->xvals, size, DATATYPE_FLT64, serializePack(gridP->xvals, size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_FLT, size, gridP->xvals); d = cdiCheckSum(DATATYPE_FLT, size, gridP->xvals);
serializePack(&d, 1, DATATYPE_FLT64, serializePack(&d, 1, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
} }
...@@ -4861,7 +4862,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize, ...@@ -4861,7 +4862,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
xassert(size); xassert(size);
serializePack(gridP->yvals, size, DATATYPE_FLT64, serializePack(gridP->yvals, size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_FLT, size, gridP->yvals); d = cdiCheckSum(DATATYPE_FLT, size, gridP->yvals);
serializePack(&d, 1, DATATYPE_FLT64, serializePack(&d, 1, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
} }
...@@ -4872,7 +4873,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize, ...@@ -4872,7 +4873,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->area, gridP->size, DATATYPE_FLT64, serializePack(gridP->area, gridP->size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_FLT, gridP->size, gridP->area); d = cdiCheckSum(DATATYPE_FLT, gridP->size, gridP->area);
serializePack(&d, 1, DATATYPE_FLT64, serializePack(&d, 1, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
} }
...@@ -4888,7 +4889,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize, ...@@ -4888,7 +4889,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->xbounds, size, DATATYPE_FLT64, serializePack(gridP->xbounds, size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_FLT, size, gridP->xbounds); d = cdiCheckSum(DATATYPE_FLT, size, gridP->xbounds);
serializePack(&d, 1, DATATYPE_FLT64, serializePack(&d, 1, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
} }
...@@ -4904,7 +4905,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize, ...@@ -4904,7 +4905,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->ybounds, size, DATATYPE_FLT64, serializePack(gridP->ybounds, size, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_FLT, size, gridP->ybounds); d = cdiCheckSum(DATATYPE_FLT, size, gridP->ybounds);
serializePack(&d, 1, DATATYPE_FLT64, serializePack(&d, 1, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
} }
...@@ -4920,7 +4921,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize, ...@@ -4920,7 +4921,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack( charBuffer, gridNstrings * CDI_MAX_NAME, DATATYPE_TXT, serializePack( charBuffer, gridNstrings * CDI_MAX_NAME, DATATYPE_TXT,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_TXT, gridNstrings * CDI_MAX_NAME, charBuffer); d = cdiCheckSum(DATATYPE_TXT, gridNstrings * CDI_MAX_NAME, charBuffer);
serializePack(&d, 1, DATATYPE_FLT64, serializePack(&d, 1, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
...@@ -4931,7 +4932,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize, ...@@ -4931,7 +4932,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
serializePack(gridP->reference, size, DATATYPE_TXT, serializePack(gridP->reference, size, DATATYPE_TXT,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_TXT, size, gridP->reference); d = cdiCheckSum(DATATYPE_TXT, size, gridP->reference);
serializePack(&d, 1, DATATYPE_FLT64, serializePack(&d, 1, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
} }
...@@ -4941,7 +4942,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize, ...@@ -4941,7 +4942,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
xassert((size = gridP->size)); xassert((size = gridP->size));
serializePack(gridP->mask, size, DATATYPE_UCHAR, serializePack(gridP->mask, size, DATATYPE_UCHAR,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_TXT, size, gridP->mask); d = cdiCheckSum(DATATYPE_TXT, size, gridP->mask);
serializePack(&d, 1, DATATYPE_FLT64, serializePack(&d, 1, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
} }
...@@ -4952,7 +4953,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize, ...@@ -4952,7 +4953,7 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack(gridP->mask_gme, size, DATATYPE_UCHAR, serializePack(gridP->mask_gme, size, DATATYPE_UCHAR,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_TXT, size, gridP->mask); d = cdiCheckSum(DATATYPE_TXT, size, gridP->mask);
serializePack(&d, 1, DATATYPE_FLT64, serializePack(&d, 1, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
} }
......
...@@ -95,6 +95,7 @@ EOR ...@@ -95,6 +95,7 @@ EOR
c="dmemory.c \ c="dmemory.c \
dmemory.h \ dmemory.h \
cksum.c \ cksum.c \
cdi_cksum.c \
taxis.c \ taxis.c \
timebase.c \ timebase.c \
calendar.c \ calendar.c \
...@@ -142,7 +143,7 @@ c="dmemory.c \ ...@@ -142,7 +143,7 @@ c="dmemory.c \
h="cdi_limits.h resource_handle.h taxis.h dtypes.h file.h service.h extra.h \ h="cdi_limits.h resource_handle.h taxis.h dtypes.h file.h service.h extra.h \
ieg.h cdi.h timebase.h calendar.h basetime.h datetime.h namespace.h \ ieg.h cdi.h timebase.h calendar.h basetime.h datetime.h namespace.h \
cksum.h error.c error.h cdi_int.h cgribex.h gribapi.h \ cksum.h cdi_cksum.h error.c error.h cdi_int.h cgribex.h gribapi.h \
stream_cgribex.h stream_gribapi.h stream_grb.h stream_cdf.h \ stream_cgribex.h stream_gribapi.h stream_grb.h stream_cdf.h \
tablepar.h table.h gaussgrid.h grid.h zaxis.h varscan.h binary.h swap.h \ tablepar.h table.h gaussgrid.h grid.h zaxis.h varscan.h binary.h swap.h \
service.h stream_srv.h stream_ext.h stream_ieg.h cdf_int.h \ service.h stream_srv.h stream_ext.h stream_ieg.h cdf_int.h \
......
...@@ -171,14 +171,6 @@ void pcdiDebugMsg2 ( const char *filename, const char *functionname, int line, ...@@ -171,14 +171,6 @@ void pcdiDebugMsg2 ( const char *filename, const char *functionname, int line,
#endif #endif
/****************************************************/
double xchecksum ( int type, int count, void * buffer )
{
return 0.0;
}
/****************************************************/ /****************************************************/
void printArray ( const char * cdiPioDebugString, char * ps, const void * array, int n, void printArray ( const char * cdiPioDebugString, char * ps, const void * array, int n,
......
...@@ -125,8 +125,6 @@ sum_int(size_t n, int *a) ...@@ -125,8 +125,6 @@ sum_int(size_t n, int *a)
} }
double xchecksum ( int, int, void * );
void printArray ( const char *, char *, const void *, int, int, const char *, const char *, int ); void printArray ( const char *, char *, const void *, int, int, const char *, const char *, int );
#define xprintArray(ps,array,n,datatype) \ #define xprintArray(ps,array,n,datatype) \
if ( ddebug ) \ if ( ddebug ) \
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "cdi.h" #include "cdi.h"
#include "error.h" #include "error.h"
#include "taxis.h" #include "taxis.h"
#include "cdi_cksum.h"
#include "cdi_int.h" #include "cdi_int.h"
#include "calendar.h" #include "calendar.h"
#include "pio_util.h" #include "pio_util.h"
...@@ -1333,7 +1334,7 @@ taxisUnpack(char * unpackBuffer, int unpackBufferSize, int * unpackBufferPos, ...@@ -1333,7 +1334,7 @@ taxisUnpack(char * unpackBuffer, int unpackBufferSize, int * unpackBufferPos,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert(xchecksum(DATATYPE_INT, taxisNint, intBuffer) == d); xassert(cdiCheckSum(DATATYPE_INT, taxisNint, intBuffer) == d);
taxisInit(); taxisInit();
...@@ -1411,7 +1412,7 @@ taxisPack(void * voidP, void * packBuffer, int packBufferSize, int * packBufferP ...@@ -1411,7 +1412,7 @@ taxisPack(void * voidP, void * packBuffer, int packBufferSize, int * packBufferP
serializePack(intBuffer, taxisNint, DATATYPE_INT, serializePack(intBuffer, taxisNint, DATATYPE_INT,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
d = xchecksum(DATATYPE_INT, taxisNint, intBuffer); d = cdiCheckSum(DATATYPE_INT, taxisNint, intBuffer);
serializePack(&d, 1, DATATYPE_FLT64, serializePack(&d, 1, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context); packBuffer, packBufferSize, packBufferPos, context);
if (taxisP->name) if (taxisP->name)
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "dmemory.h" #include "dmemory.h"
#include "cdi.h" #include "cdi.h"
#include "cdi_cksum.h"
#include "cdi_int.h" #include "cdi_int.h"
#include "pio_util.h" #include "pio_util.h"
#include "resource_handle.h" #include "resource_handle.h"
...@@ -1692,7 +1693,7 @@ zaxisUnpack(char * unpackBuffer, int unpackBufferSize, ...@@ -1692,7 +1693,7 @@ zaxisUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos, serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
&d, 1, DATATYPE_FLT64, context); &d, 1, DATATYPE_FLT64, context);
xassert ( xchecksum ( DATATYPE_INT, zaxisNint, intBuffer ) == d ); xassert(cdiCheckSum(DATATYPE_INT, zaxisNint, intBuffer) == d);
zaxisInit (); zaxisInit ();