Fix compiler warnings

This commit is contained in:
Shahram Najm 2015-09-28 16:54:51 +01:00
parent e68a36cdc2
commit e902f74df5
3 changed files with 8 additions and 16 deletions

View File

@ -133,7 +133,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len)
{
grib_accessor_round* self = (grib_accessor_round*)a;
int ret = GRIB_SUCCESS;
size_t replen = 0;
@ -144,7 +143,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len)
const char* oval = NULL;
oval = grib_arguments_get_name(a->parent->h,self->arg,0);
if( (ret = grib_get_double_internal(a->parent->h, oval, &toround)) != 0)
return ret;
@ -152,8 +150,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len)
rounded = floor(rounding_precision * toround + 0.5) / rounding_precision;
*len = replen;
*val = rounded;
@ -163,9 +159,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len)
static int unpack_string(grib_accessor* a, char* val, size_t *len)
{
char result[1024] ;
char result[1024];
int ret = GRIB_SUCCESS;
size_t replen = 1;
@ -186,5 +180,5 @@ static int unpack_string(grib_accessor* a, char* val, size_t *len)
sprintf(val,"%s",result);
return GRIB_SUCCESS;
return ret;
}

View File

@ -265,7 +265,7 @@ static void destroy(grib_context* c,grib_accessor* a)
static int compare(grib_accessor* a, grib_accessor* b)
{
int retval=0;
int retval = GRIB_SUCCESS;
double *aval=0;
double *bval=0;
@ -293,7 +293,6 @@ static int compare(grib_accessor* a, grib_accessor* b)
grib_unpack_double(a,aval,&alen);
grib_unpack_double(b,bval,&blen);
retval = GRIB_SUCCESS;
while (alen != 0) {
if (*bval != *aval) retval = GRIB_DOUBLE_VALUE_MISMATCH;
alen--;
@ -302,7 +301,7 @@ static int compare(grib_accessor* a, grib_accessor* b)
grib_context_free(a->parent->h->context,aval);
grib_context_free(b->parent->h->context,bval);
return GRIB_SUCCESS;
return retval;
}
static int unpack_string(grib_accessor*a , char* v, size_t *len)

View File

@ -536,7 +536,6 @@ int grib_yyerror(const char* msg)
void grib_parser_include(const char* included_fname)
{
FILE *f = NULL;
char path[1204];
char* io_buffer=0;
/* int i; */
Assert(top < MAXINCLUDE);