X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fexpressions%2Fparse.c;h=b841953b7ea5125e3308975dab36efbda6d6d928;hb=ad01fea350354a7df11790a561e935a8bffd3636;hp=15efe00bed59f56a8bddeeee0b3ef6fe374fb8cd;hpb=1339492699ce7e12c9bf9fa17f9d60a66024cbd1;p=pspp-builds.git diff --git a/src/expressions/parse.c b/src/expressions/parse.c index 15efe00b..b841953b 100644 --- a/src/expressions/parse.c +++ b/src/expressions/parse.c @@ -86,6 +86,19 @@ expr_parse (struct dictionary *dict, enum expr_type type) } } +/* Parses and returns an expression of the given TYPE, as + expr_parse(), and sets up so that destroying POOL will free + the expression as well. */ +struct expression * +expr_parse_pool (struct pool *pool, + struct dictionary *dict, enum expr_type type) +{ + struct expression *e = expr_parse (dict, type); + if (e != NULL) + pool_add_subpool (pool, e->expr_pool); + return e; +} + /* Free expression E. */ void expr_free (struct expression *e) @@ -881,14 +894,14 @@ word_matches (const char **test, const char **name) size_t name_len = strcspn (*name, "."); if (test_len == name_len) { - if (mm_case_compare (*test, *name, test_len)) + if (buf_compare_case (*test, *name, test_len)) return false; } else if (test_len < 3 || test_len > name_len) return false; else { - if (mm_case_compare (*test, *name, test_len)) + if (buf_compare_case (*test, *name, test_len)) return false; } @@ -1033,7 +1046,7 @@ validate_function_args (const struct operation *f, int arg_cnt, int min_valid) { assert ((f->flags & OPF_MIN_VALID) == 0); msg (SE, _("%s function does not accept a minimum valid " - "argument count.")); + "argument count."), f->prototype); return false; } else @@ -1042,7 +1055,7 @@ validate_function_args (const struct operation *f, int arg_cnt, int min_valid) if (array_arg_cnt < f->array_min_elems) { msg (SE, _("%s requires at least %d valid arguments in list."), - f->prototype); + f->prototype, f->array_min_elems); return false; } else if (min_valid > array_arg_cnt) @@ -1158,8 +1171,8 @@ parse_function (struct expression *e) if (token == T_ID && lex_look_ahead () == 'T') { struct variable **vars; - int var_cnt; - int i; + size_t var_cnt; + size_t i; if (!parse_variables (default_dict, &vars, &var_cnt, PV_SINGLE)) goto fail;