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
/
utilities
/
include.c
diff --git
a/src/language/utilities/include.c
b/src/language/utilities/include.c
index e802abecc49ed4b3129c38ede93024eaaa76430c..a05456e2a2e8ff7366556865d1eb1e40b023f239 100644
(file)
--- a/
src/language/utilities/include.c
+++ b/
src/language/utilities/include.c
@@
-22,8
+22,9
@@
#include <string.h>
#include <unistd.h>
#include <string.h>
#include <unistd.h>
+#include "data/dataset.h"
#include "data/file-name.h"
#include "data/file-name.h"
-#include "data/
procedure
.h"
+#include "data/
session
.h"
#include "language/command.h"
#include "language/lexer/include-path.h"
#include "language/lexer/lexer.h"
#include "language/command.h"
#include "language/lexer/include-path.h"
#include "language/lexer/lexer.h"
@@
-58,12
+59,8
@@
do_insert (struct lexer *lexer, struct dataset *ds, enum variant variant)
if (lex_match_id (lexer, "FILE"))
lex_match (lexer, T_EQUALS);
if (lex_match_id (lexer, "FILE"))
lex_match (lexer, T_EQUALS);
- /* File name can be identifier or string. */
- if (lex_token (lexer) != T_ID && !lex_is_string (lexer))
- {
- lex_error (lexer, _("expecting file name"));
- return CMD_FAILURE;
- }
+ if (!lex_force_string_or_id (lexer))
+ return CMD_FAILURE;
relative_name = utf8_to_filename (lex_tokcstr (lexer));
filename = include_path_search (relative_name);
relative_name = utf8_to_filename (lex_tokcstr (lexer));
filename = include_path_search (relative_name);
@@
-81,7
+78,8
@@
do_insert (struct lexer *lexer, struct dataset *ds, enum variant variant)
error_mode = LEX_ERROR_CONTINUE;
cd = false;
status = CMD_FAILURE;
error_mode = LEX_ERROR_CONTINUE;
cd = false;
status = CMD_FAILURE;
- encoding = xstrdup (dataset_get_default_syntax_encoding (ds));
+ encoding = xstrdup (session_get_default_syntax_encoding (
+ dataset_session (ds)));
while ( T_ENDCMD != lex_token (lexer))
{
if (lex_match_id (lexer, "ENCODING"))
while ( T_ENDCMD != lex_token (lexer))
{
if (lex_match_id (lexer, "ENCODING"))
@@
-104,8
+102,8
@@
do_insert (struct lexer *lexer, struct dataset *ds, enum variant variant)
syntax_mode = LEX_SYNTAX_AUTO;
else
{
syntax_mode = LEX_SYNTAX_AUTO;
else
{
- lex_error
(lexer, _("expecting %s, %s, or %s after %s")
,
-
"BATCH", "INTERACTIVE", "AUTO", "SYNTAX"
);
+ lex_error
_expecting (lexer, "BATCH", "INTERACTIVE", "AUTO"
,
+
NULL_SENTINEL
);
goto exit;
}
}
goto exit;
}
}
@@
-122,8
+120,7
@@
do_insert (struct lexer *lexer, struct dataset *ds, enum variant variant)
}
else
{
}
else
{
- lex_error (lexer, _("expecting %s or %s after %s"),
- "YES", "NO", "CD");
+ lex_error_expecting (lexer, "YES", "NO", NULL_SENTINEL);
goto exit;
}
}
goto exit;
}
}
@@
-140,8
+137,7
@@
do_insert (struct lexer *lexer, struct dataset *ds, enum variant variant)
}
else
{
}
else
{
- lex_error (lexer, _("expecting %s or %s after %s"),
- "CONTINUE", "STOP", "ERROR");
+ lex_error_expecting (lexer, "CONTINUE", "STOP", NULL_SENTINEL);
goto exit;
}
}
goto exit;
}
}