From 81adb9603618ab1ae5c2364e5280b75ef322b4d6 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 29 Jul 2014 16:50:33 +0100 Subject: [PATCH] Indentation and spelling --- tests/index.c | 218 +++++++++++++++++++++++++------------------------- 1 file changed, 108 insertions(+), 110 deletions(-) diff --git a/tests/index.c b/tests/index.c index 2317b67bc..fcee5648b 100644 --- a/tests/index.c +++ b/tests/index.c @@ -10,131 +10,129 @@ #include "grib_api.h" void usage(char* prog) { - printf("usage: %s infile\n",prog); - exit(1); + printf("usage: %s infile\n",prog); + exit(1); } -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,iii; - size_t stepSize,levelSize,shortNameSize,numberSize; - long ostep,olevel,onumber; - char oshortName[200]; - size_t lenshortName=200; - int ret=0,count=0; +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,iii; + size_t stepSize,levelSize,shortNameSize,numberSize; + long ostep,olevel,onumber; + char oshortName[200]; + size_t lenshortName=200; + int ret=0,count=0; - if (argc != 2) usage(argv[0]); - infile=argv[1]; - outfile=argv[2]; + if (argc != 2) usage(argv[0]); + infile=argv[1]; + outfile=argv[2]; - printf("indexing...\n"); + printf("indexing...\n"); - for (iii=0;iii<1;iii++) { - /* Create an index given set of keys*/ - index=grib_index_new(0,"shortName,level,number,step",&ret); - if (ret) {printf("error: %s\n",grib_get_error_message(ret)); exit(ret);} + for (iii=0;iii<1;iii++) { + /* Create an index given set of keys*/ + index=grib_index_new(0,"shortName,level,number,step",&ret); + if (ret) {printf("error: %s\n",grib_get_error_message(ret)); exit(ret);} - /* Indexes a file */ - ret=grib_index_add_file(index,infile); - if (ret) {printf("error: %s\n",grib_get_error_message(ret)); exit(ret);} - printf("end indexing...\n"); + /* Indexes a file */ + ret=grib_index_add_file(index,infile); + if (ret) {printf("error: %s\n",grib_get_error_message(ret)); exit(ret);} + printf("end indexing...\n"); - /* get the number of distinct values of "step" in the index */ - GRIB_CHECK(grib_index_get_size(index,"step",&stepSize),0); - step=malloc(sizeof(long)*stepSize); - if (!step) exit(1); - /* get the list of distinct steps from the index */ - /* the list is in ascending order */ - GRIB_CHECK(grib_index_get_long(index,"step",step,&stepSize),0); - printf("stepSize=%ld\n",(long)stepSize); - for (i=0;i