Run C examples thru cppcheck and clean up

This commit is contained in:
Shahram Najm 2015-02-06 13:34:28 +00:00
parent 8cca8d1102
commit 358f1da3b7
5 changed files with 2 additions and 16 deletions

View File

@ -31,8 +31,6 @@ int main(int argc,char* argv[])
codes_handle* h=NULL;
double *values = NULL;
long longVal;
double doubleVal;
size_t values_len=0;
int i, err=0;
int cnt=0;

View File

@ -24,7 +24,6 @@ void usage(char* prog) {
int main(int argc,char* argv[])
{
char* filename = NULL;
FILE* in = NULL;
/* message handle. Required in all the eccodes calls acting on a message.*/

View File

@ -24,16 +24,13 @@ void usage(char* prog) {
int main(int argc,char* argv[])
{
char* filename = NULL;
FILE* in = NULL;
/* message handle. Required in all the eccodes calls acting on a message.*/
codes_handle* h=NULL;
double *values = NULL;
long longVal;
double doubleVal;
size_t values_len=0;
int err=0;
int cnt=0;
char* infile = "../../data/bufr/syno_multi.bufr";

View File

@ -29,11 +29,8 @@ int main(int argc,char* argv[])
/* message handle. Required in all the eccodes calls acting on a message.*/
codes_handle* h=NULL;
long *desc = NULL;
long longVal;
size_t len=0;
int err=0, i, cnt=0;
int err=0, cnt=0;
if (argc!=2) usage(argv[0]);

View File

@ -24,22 +24,17 @@ void usage(char* prog) {
int main(int argc,char* argv[])
{
char* filename = NULL;
FILE* in = NULL;
/* message handle. Required in all the eccodes calls acting on a message.*/
codes_handle* h=NULL;
double *values = NULL;
long numberOfSubsets=0;
long longVal;
double doubleVal;
size_t values_len=0;
int i,err=0;
int cnt=0;
char* infile = "../../data/bufr/synop_multi_subset.bufr";
in=fopen(infile,"r");
if (!in) {
printf("ERROR: unable to open file %s\n", infile);