projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sys-file-reader: Really enable warnings for invalid variable formats.
[pspp]
/
src
/
ui
/
syntax-gen.c
diff --git
a/src/ui/syntax-gen.c
b/src/ui/syntax-gen.c
index 229e478161299794664b7048eb464fb69b7bfb81..35de44da0dc9dfe71e1ba9cb3ae2a19883b47192 100644
(file)
--- a/
src/ui/syntax-gen.c
+++ b/
src/ui/syntax-gen.c
@@
-38,8
+38,8
@@
syntax_gen_hex_digits (struct string *output, struct substring in)
for (i = 0; i < in.length; i++)
{
unsigned char c = in.string[i];
for (i = 0; i < in.length; i++)
{
unsigned char c = in.string[i];
- ds_put_
char
(output, "0123456789ABCDEF"[c >> 4]);
- ds_put_
char
(output, "0123456789ABCDEF"[c & 0xf]);
+ ds_put_
byte
(output, "0123456789ABCDEF"[c >> 4]);
+ ds_put_
byte
(output, "0123456789ABCDEF"[c & 0xf]);
}
}
}
}
@@
-59,13
+59,13
@@
has_control_chars (struct substring in)
static bool
has_single_quote (struct substring str)
{
static bool
has_single_quote (struct substring str)
{
- return (SIZE_MAX != ss_find_
char
(str, '\''));
+ return (SIZE_MAX != ss_find_
byte
(str, '\''));
}
static bool
has_double_quote (struct substring str)
{
}
static bool
has_double_quote (struct substring str)
{
- return (SIZE_MAX != ss_find_
char
(str, '"'));
+ return (SIZE_MAX != ss_find_
byte
(str, '"'));
}
/* Appends to OUTPUT valid PSPP syntax for a quoted string that
}
/* Appends to OUTPUT valid PSPP syntax for a quoted string that
@@
-84,7
+84,7
@@
syntax_gen_string (struct string *output, struct substring in)
{
ds_put_cstr (output, "X'");
syntax_gen_hex_digits (output, in);
{
ds_put_cstr (output, "X'");
syntax_gen_hex_digits (output, in);
- ds_put_
char
(output, '\'');
+ ds_put_
byte
(output, '\'');
}
else
{
}
else
{
@@
-99,15
+99,15
@@
syntax_gen_string (struct string *output, struct substring in)
assert (is_basic ('\''));
quote = has_double_quote (in) && !has_single_quote (in) ? '\'' : '"';
assert (is_basic ('\''));
quote = has_double_quote (in) && !has_single_quote (in) ? '\'' : '"';
- ds_put_
char
(output, quote);
+ ds_put_
byte
(output, quote);
for (i = 0; i < in.length; i++)
{
char c = in.string[i];
if (c == quote)
for (i = 0; i < in.length; i++)
{
char c = in.string[i];
if (c == quote)
- ds_put_
char
(output, quote);
- ds_put_
char
(output, c);
+ ds_put_
byte
(output, quote);
+ ds_put_
byte
(output, c);
}
}
- ds_put_
char
(output, quote);
+ ds_put_
byte
(output, quote);
}
}
}
}
@@
-147,16
+147,18
@@
syntax_gen_number (struct string *output,
& (FMT_CAT_DATE | FMT_CAT_TIME | FMT_CAT_DATE_COMPONENT)))
{
union value v_in, v_out;
& (FMT_CAT_DATE | FMT_CAT_TIME | FMT_CAT_DATE_COMPONENT)))
{
union value v_in, v_out;
- char *s;
+ char *s
, *error
;
bool ok;
v_in.f = number;
s = data_out (&v_in, "FIXME", format);
bool ok;
v_in.f = number;
s = data_out (&v_in, "FIXME", format);
- msg_disable ();
+
/* FIXME: UTF8 encoded strings will fail here */
/* FIXME: UTF8 encoded strings will fail here */
- ok = data_in (ss_cstr (s), LEGACY_NATIVE,
- format->type, false, 0, 0, NULL, &v_out, 0);
- msg_enable ();
+ error = data_in (ss_cstr (s), LEGACY_NATIVE,
+ format->type, &v_out, 0, NULL);
+ ok = error == NULL;
+ free (error);
+
if (ok && v_out.f == number)
{
syntax_gen_string (output, ss_cstr (s));
if (ok && v_out.f == number)
{
syntax_gen_string (output, ss_cstr (s));
@@
-284,7
+286,7
@@
syntax_gen_pspp_valist (struct string *output, const char *format,
}
case '%':
}
case '%':
- ds_put_
char
(output, '%');
+ ds_put_
byte
(output, '%');
break;
default:
break;
default: