X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fautorecode.c;h=77385783549029af27c4e3ced65ba07c30e03482;hb=086322fd8c85a303ba6f552950d6f057f2867add;hp=a18a94c6bd5fa5514a7fb69e43ac5a58e4f1697c;hpb=8f40c87f9db239685a174ffc526cb91f0c76ee97;p=pspp-builds.git diff --git a/src/language/stats/autorecode.c b/src/language/stats/autorecode.c index a18a94c6..77385783 100644 --- a/src/language/stats/autorecode.c +++ b/src/language/stats/autorecode.c @@ -113,13 +113,13 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds) /* Parse variable lists. */ lex_match_id (lexer, "VARIABLES"); - lex_match (lexer, '='); + lex_match (lexer, T_EQUALS); if (!parse_variables_const (lexer, dict, &src_vars, &n_srcs, PV_NO_DUPLICATE)) goto error; if (!lex_force_match_id (lexer, "INTO")) goto error; - lex_match (lexer, '='); + lex_match (lexer, T_EQUALS); if (!parse_DATA_LIST_vars (lexer, &dst_names, &n_dsts, PV_NO_DUPLICATE)) goto error; if (n_dsts != n_srcs) @@ -143,7 +143,7 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds) } /* Parse options. */ - while (lex_match (lexer, '/')) + while (lex_match (lexer, T_SLASH)) { if (lex_match_id (lexer, "DESCENDING")) direction = DESCENDING; @@ -156,7 +156,7 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds) } } - if (lex_token (lexer) != '.') + if (lex_token (lexer) != T_ENDCMD) { lex_error (lexer, _("expecting end of command")); goto error; @@ -248,7 +248,7 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds) the source value from whence the new value comes. */ if (src_width > 0) { - const char *str = (const char *) value_str (from, src_width); + const char *str = CHAR_CAST_BUG (const char*, value_str (from, src_width)); recoded_value = recode_string (UTF8, dict_get_encoding (dict), str, src_width); } @@ -294,13 +294,12 @@ arc_free (struct autorecode_pgm *arc) for (i = 0; i < arc->n_specs; i++) { struct arc_spec *spec = &arc->specs[i]; - int width = var_get_width (spec->src); struct arc_item *item, *next; HMAP_FOR_EACH_SAFE (item, next, struct arc_item, hmap_node, spec->items) { - value_destroy (&item->from, width); + value_destroy (&item->from, item->width); hmap_delete (spec->items, &item->hmap_node); free (item); } @@ -357,8 +356,8 @@ compare_arc_items (const void *a_, const void *b_, const void *aux UNUSED) if ( width_b == 0 && width_a != 0) return +1; - return buf_compare_rpad ((const char *) value_str (&(*a)->from, width_a), width_a, - (const char *) value_str (&(*b)->from, width_b), width_b); + return buf_compare_rpad (CHAR_CAST_BUG (const char *, value_str (&(*a)->from, width_a)), width_a, + CHAR_CAST_BUG (const char *, value_str (&(*b)->from, width_b)), width_b); } static int