fix cppcheck warnings
This commit is contained in:
parent
e2a5a7a12e
commit
738402e089
4
fp2bit.c
4
fp2bit.c
|
@ -12,7 +12,7 @@
|
|||
int main(int argc, char** argv)
|
||||
{
|
||||
struct fpga_model model;
|
||||
FILE* fp, *fbits;
|
||||
FILE *fbits, *fp = 0;
|
||||
int rc = -1;
|
||||
|
||||
fbits = 0;
|
||||
|
@ -45,9 +45,11 @@ int main(int argc, char** argv)
|
|||
|
||||
if ((rc = read_floorplan(&model, fp))) goto fail;
|
||||
if ((rc = write_bitfile(fbits, &model))) goto fail;
|
||||
fclose(fp);
|
||||
fclose(fbits);
|
||||
return EXIT_SUCCESS;
|
||||
fail:
|
||||
if (fp) fclose(fp);
|
||||
if (fbits) fclose(fbits);
|
||||
return rc;
|
||||
}
|
||||
|
|
|
@ -106,5 +106,6 @@ int main(int argc, char** argv)
|
|||
fclose(fp);
|
||||
return EXIT_SUCCESS;
|
||||
xout:
|
||||
if (fp) fclose(fp);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
|
|
@ -197,7 +197,9 @@ int main(int argc, char** argv)
|
|||
if (rc) goto xout;
|
||||
rc = print_nets(nets, &connpt_names);
|
||||
if (rc) goto xout;
|
||||
fclose(fp);
|
||||
return EXIT_SUCCESS;
|
||||
xout:
|
||||
if(fp) fclose(fp);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
|
|
@ -419,7 +419,9 @@ int main(int argc, char** argv)
|
|||
} else
|
||||
s_numlines = 0;
|
||||
}
|
||||
fclose(fp);
|
||||
return EXIT_SUCCESS;
|
||||
xout:
|
||||
if(fp) fclose(fp);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user