projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Suppress GCC 4.7 warnings by changes to code that make it less clear.
[pspp]
/
src
/
language
/
data-io
/
print.c
diff --git
a/src/language/data-io/print.c
b/src/language/data-io/print.c
index 7b795f1ade5c8365e5a4bf68e7cd039c6a9a14c6..cffa3bd49fdd29f480798c311ba796ae791ff1da 100644
(file)
--- a/
src/language/data-io/print.c
+++ b/
src/language/data-io/print.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011
, 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
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
@@
-136,6
+136,7
@@
internal_cmd_print (struct lexer *lexer, struct dataset *ds,
bool print_table = 0;
struct print_trns *trns;
struct file_handle *fh = NULL;
bool print_table = 0;
struct print_trns *trns;
struct file_handle *fh = NULL;
+ char *encoding = NULL;
struct pool *tmp_pool;
/* Fill in prt to facilitate error-handling. */
struct pool *tmp_pool;
/* Fill in prt to facilitate error-handling. */
@@
-160,6
+161,17
@@
internal_cmd_print (struct lexer *lexer, struct dataset *ds,
if (fh == NULL)
goto error;
}
if (fh == NULL)
goto error;
}
+ else if (lex_match_id (lexer, "ENCODING"))
+ {
+ lex_match (lexer, T_EQUALS);
+ if (!lex_force_string (lexer))
+ goto error;
+
+ free (encoding);
+ encoding = ss_xstrdup (lex_tokss (lexer));
+
+ lex_get (lexer);
+ }
else if (lex_match_id (lexer, "RECORDS"))
{
lex_match (lexer, T_EQUALS);
else if (lex_match_id (lexer, "RECORDS"))
{
lex_match (lexer, T_EQUALS);
@@
-194,10
+206,10
@@
internal_cmd_print (struct lexer *lexer, struct dataset *ds,
if (fh != NULL)
{
if (fh != NULL)
{
- trns->writer = dfm_open_writer (fh);
+ trns->writer = dfm_open_writer (fh
, encoding
);
if (trns->writer == NULL)
goto error;
if (trns->writer == NULL)
goto error;
- trns->encoding = dfm_writer_get_
legacy_
encoding (trns->writer);
+ trns->encoding = dfm_writer_get_encoding (trns->writer);
}
else
trns->encoding = UTF8;
}
else
trns->encoding = UTF8;
@@
-325,7
+337,7
@@
parse_variable_argument (struct lexer *lexer, const struct dictionary *dict,
if (lex_is_number (lexer) || lex_token (lexer) == T_LPAREN)
{
if (lex_is_number (lexer) || lex_token (lexer) == T_LPAREN)
{
- if (!parse_var_placements (lexer, tmp_pool, var_cnt,
false
,
+ if (!parse_var_placements (lexer, tmp_pool, var_cnt,
FMT_FOR_OUTPUT
,
&formats, &format_cnt))
return false;
add_space = false;
&formats, &format_cnt))
return false;
add_space = false;