X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fcql2pqf.c;h=ac2a4577091f2a928c082114873d469ffe6172e3;hb=dedba382ec4773d8abdf244290020f3da42113b6;hp=02a0bc51cede62c317437da3e003c1fe9784e005;hpb=fa1dff894130765cb4a8fed41c42fc7125702c9c;p=yaz-moved-to-github.git diff --git a/util/cql2pqf.c b/util/cql2pqf.c index 02a0bc5..ac2a457 100644 --- a/util/cql2pqf.c +++ b/util/cql2pqf.c @@ -1,11 +1,7 @@ -/* $Id: cql2pqf.c,v 1.4 2004-03-16 13:22:16 adam Exp $ - Copyright (C) 2002-2004 - Index Data Aps - -This file is part of the YAZ toolkit. - -See the file LICENSE. -*/ +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2008 Index Data + * See the file LICENSE for details. + */ #include #include @@ -13,7 +9,7 @@ See the file LICENSE. #include #include -static void usage() +static void usage(void) { fprintf (stderr, "usage\n cql2pqf [-n ] []\n"); exit (1); @@ -22,7 +18,7 @@ static void usage() int main(int argc, char **argv) { cql_transform_t ct; - int r; + int r = 0; int i, iterations = 1; CQL_parser cp = cql_parser_create(); char *query = 0; @@ -36,20 +32,20 @@ int main(int argc, char **argv) switch (ret) { case 0: - if (!fname) - fname = arg; - else - query = arg; + if (!fname) + fname = arg; + else + query = arg; break; - case 'n': - iterations = atoi(arg); - break; - default: - usage(); - } + case 'n': + iterations = atoi(arg); + break; + default: + usage(); + } } if (!fname) - usage(); + usage(); ct = cql_transform_open_fname(fname); if (!ct) { @@ -59,33 +55,41 @@ int main(int argc, char **argv) if (query) { - for (i = 0; i