Add assertions

This commit is contained in:
Shahram Najm 2015-08-14 14:42:45 +01:00
parent ceb3451386
commit f2ceeff029
1 changed files with 6 additions and 2 deletions

View File

@ -23,7 +23,9 @@ int grib_nearest_find(
double* outlats,double* outlons,
double* values, double* distances, int* indexes, size_t *len)
{
grib_nearest_class *c = nearest->cclass;
grib_nearest_class *c = NULL;
Assert(nearest);
c = nearest->cclass;
Assert( flags <= (GRIB_NEAREST_SAME_GRID|GRIB_NEAREST_SAME_DATA|GRIB_NEAREST_SAME_POINT) );
while(c)
@ -73,7 +75,9 @@ int grib_nearest_init(grib_nearest* i, grib_handle *h, grib_arguments* args)
int grib_nearest_delete(grib_nearest *i)
{
grib_nearest_class *c = i->cclass;
grib_nearest_class *c = NULL;
Assert(i);
c = i->cclass;
while(c)
{
grib_nearest_class *s = c->super ? *(c->super) : NULL;