X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=ccl%2Fccltoken.c;h=31c272b708e80c82fe0e4700716b961bfa88e2c6;hp=6994ced17ccf7703ff1a78bd3aab72bdc7a41001;hb=3a14421799597d61196e2bb07bdd83396000cb45;hpb=88e45d920d4fedb9557e896cf9448f9ab9cfb422 diff --git a/ccl/ccltoken.c b/ccl/ccltoken.c index 6994ced..31c272b 100644 --- a/ccl/ccltoken.c +++ b/ccl/ccltoken.c @@ -45,7 +45,13 @@ * Europagate, 1995 * * $Log: ccltoken.c,v $ - * Revision 1.8 1997-09-29 08:56:38 adam + * Revision 1.10 1998-07-07 15:49:41 adam + * Added braces to avoid warning. + * + * Revision 1.9 1998/02/11 11:53:33 adam + * Changed code so that it compiles as C++. + * + * Revision 1.8 1997/09/29 08:56:38 adam * Changed CCL parser to be thread safe. New type, CCL_parser, declared * and a create/destructers ccl_parser_create/ccl_parser/destory has * been added. @@ -118,6 +124,7 @@ static int token_cmp (CCL_parser cclp, const char *kw, struct ccl_token *token) while ((cp2 = strchr (cp1, ' '))) { if (token->len == (size_t) (cp2-cp1)) + { if (cclp->ccl_case_sensitive) { if (!memcmp (cp1, token->name, token->len)) @@ -128,6 +135,7 @@ static int token_cmp (CCL_parser cclp, const char *kw, struct ccl_token *token) if (!ccl_memicmp (cp1, token->name, token->len)) return 1; } + } cp1 = cp2+1; } if (cclp->ccl_case_sensitive) @@ -155,13 +163,13 @@ struct ccl_token *ccl_token_simple (const char *command) } if (!first) { - first = last = malloc (sizeof (*first)); + first = last = (struct ccl_token *)malloc (sizeof (*first)); assert (first); last->prev = NULL; } else { - last->next = malloc (sizeof(*first)); + last->next = (struct ccl_token *)malloc (sizeof(*first)); assert (last->next); last->next->prev = last; last = last->next; @@ -218,13 +226,13 @@ struct ccl_token *ccl_parser_tokenize (CCL_parser cclp, const char *command) } if (!first) { - first = last = malloc (sizeof (*first)); + first = last = (struct ccl_token *)malloc (sizeof (*first)); assert (first); last->prev = NULL; } else { - last->next = malloc (sizeof(*first)); + last->next = (struct ccl_token *)malloc (sizeof(*first)); assert (last->next); last->next->prev = last; last = last->next; @@ -333,7 +341,7 @@ void ccl_token_del (struct ccl_token *list) CCL_parser ccl_parser_create (void) { - CCL_parser p = malloc (sizeof(*p)); + CCL_parser p = (CCL_parser)malloc (sizeof(*p)); if (!p) return p; p->look_token = NULL;