X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fautorecode.c;h=b2c4d4844c5c6cd083b54f0055d5a204c72baa7c;hb=8870ca57b746c93b91fb740927fcda45643499d2;hp=c3ab81c93dabebf6967f9cf952e8cc22d3ce19da;hpb=1a25b1d47d0f8d25830b8331f53749b887c075ce;p=pspp diff --git a/src/language/stats/autorecode.c b/src/language/stats/autorecode.c index c3ab81c93d..b2c4d4844c 100644 --- a/src/language/stats/autorecode.c +++ b/src/language/stats/autorecode.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2009, 2010, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,9 +37,10 @@ #include "libpspp/str.h" #include "gl/xalloc.h" -#include "gl/vasnprintf.h" +#include "gl/c-xvasprintf.h" #include "gl/mbiter.h" + #include "gettext.h" #define _(msgid) gettext (msgid) @@ -134,7 +135,6 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds) size_t n_dsts = 0; enum arc_direction direction = ASCENDING; - bool print = true; struct casereader *input; struct ccase *c; @@ -185,7 +185,9 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds) if (lex_match_id (lexer, "DESCENDING")) direction = DESCENDING; else if (lex_match_id (lexer, "PRINT")) - print = true; + { + /* Not yet implemented. */ + } else if (lex_match_id (lexer, "GROUP")) { arc->global_items = xmalloc (sizeof (*arc->global_items)); @@ -294,7 +296,6 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds) for (j = 0; j < n_items; j++) { const union value *from = &items[j]->from; - size_t len; char *recoded_value = NULL; char *c; const int src_width = items[j]->width; @@ -314,7 +315,7 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds) recoded_value = recode_string (UTF8, dict_get_encoding (arc->dict), str, src_width); } else - recoded_value = asnprintf (NULL, &len, "%g", from->f); + recoded_value = c_xasprintf ("%g", from->f); /* Remove trailing whitespace */ for (c = recoded_value; *c != '\0'; c++)