Remove compiler warnings (unused-but-set-variable)

This commit is contained in:
Shahram Najm 2016-01-22 15:56:02 +00:00
parent 534a288072
commit 007db04e67
5 changed files with 4 additions and 14 deletions

View File

@ -27,7 +27,6 @@ int main(int argc,char* argv[])
grib_index* index=NULL;
grib_handle* h=NULL;
char* infile=NULL;
char* outfile=NULL;
long *steps,*levels,*numbers; /* arrays */
char** shortName=NULL;
int i,j,k,l;
@ -39,7 +38,6 @@ int main(int argc,char* argv[])
if (argc != 2) usage(argv[0]);
infile=argv[1];
outfile=argv[2];
printf("indexing...\n");

View File

@ -19,7 +19,6 @@ int main(int argc,char* argv[])
grib_index* index=NULL;
grib_handle* h=NULL;
char* infile=NULL;
char* outfile=NULL;
long *steps,*levels,*numbers; /* arrays */
char** shortName=NULL;
int i,j,k,l;
@ -31,7 +30,6 @@ int main(int argc,char* argv[])
if (argc != 2) usage(argv[0]);
infile=argv[1];
outfile=argv[2];
printf("indexing...\n");

View File

@ -15,12 +15,10 @@ void usage(char* prog) {
exit(1);
}
int main(int argc,char* argv[]) {
int main(int argc,char* argv[])
{
grib_index* index=NULL;
grib_handle* h=NULL;
char* infile=NULL;
char* outfile=NULL;
long *step,*level,*number;
char** shortName=NULL;
int i,j,k,l;
@ -31,8 +29,6 @@ int main(int argc,char* argv[]) {
int ret=0,count=0;
if (argc != 2) usage(argv[0]);
infile=argv[1];
outfile=argv[2];
printf("indexing...\n");

View File

@ -558,7 +558,6 @@ static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_han
unsigned char *uval1 = NULL,*uval2 = NULL;
double *dval1 = NULL, *dval2 = NULL;
long *lval1 = NULL, *lval2 = NULL;
int failed=0;
double maxdiff=0;
double packingError1=0,packingError2=0;
double value_tolerance=0;
@ -861,7 +860,6 @@ static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_han
if (verbose) printf(" (%d values) tolerance=%g\n",(int)len1,value_tolerance);
for(i = 0; i < len1; i++) {
if((diff=compare_double(pv1++,pv2++,&value_tolerance))!=0) {
failed=1;
countdiff++;
if (maxdiff < diff) {maxdiff=diff;imaxdiff=i;}
err1 = GRIB_VALUE_MISMATCH;

View File

@ -80,7 +80,7 @@ int grib_tool_init(grib_runtime_options* options) {
size_t size=4;
int ret=0;
double min=0,max=0;
int i=0,idx=0;
int i=0;
char* p=NULL;
if (grib_options_on("j")) {
options->verbose=0;
@ -142,7 +142,7 @@ int grib_tool_init(grib_runtime_options* options) {
options->latlon_idx=-1;
max=options->distances[0];
for (i=0;i<4;i++)
if (max<options->distances[i]) {max=options->distances[i];idx=i;}
if (max<options->distances[i]) {max=options->distances[i];}
min=max;
for (i=0;i<4;i++) {
if ((min >= options->distances[i]) && (options->mask_values[i] >= 0.5)) {