projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change union value type to contain uint8_t types instead of char.
[pspp-builds.git]
/
src
/
data
/
data-in.c
diff --git
a/src/data/data-in.c
b/src/data/data-in.c
index e7a83f25b44a5f7a55d2c46e20aed4dc7785e40e..7e7d087d51dcfa1ab9811715ff7354f106081bae 100644
(file)
--- a/
src/data/data-in.c
+++ b/
src/data/data-in.c
@@
-37,6
+37,7
@@
#include <libpspp/assertion.h>
#include <libpspp/legacy-encoding.h>
#include <libpspp/assertion.h>
#include <libpspp/legacy-encoding.h>
+#include <libpspp/i18n.h>
#include <libpspp/compiler.h>
#include <libpspp/integer-format.h>
#include <libpspp/message.h>
#include <libpspp/compiler.h>
#include <libpspp/integer-format.h>
#include <libpspp/message.h>
@@
-124,9
+125,12
@@
data_in (struct substring input, const char *encoding,
}
else
{
}
else
{
+ char *s;
ss_alloc_uninit (&i.input, ss_length (input));
ss_alloc_uninit (&i.input, ss_length (input));
- legacy_recode (encoding, ss_data (input), LEGACY_NATIVE,
- ss_data (i.input), ss_length (input));
+
+ s = recode_string (LEGACY_NATIVE, encoding, ss_data (input), ss_length (input));
+ memcpy (ss_data (i.input), s, ss_length (input));
+ free (s);
i.encoding = LEGACY_NATIVE;
copy = ss_data (i.input);
}
i.encoding = LEGACY_NATIVE;
copy = ss_data (i.input);
}
@@
-608,12
+612,14
@@
parse_A (struct data_in *i)
{
/* This is equivalent to buf_copy_rpad, except that we posibly
do a character set recoding in the middle. */
{
/* This is equivalent to buf_copy_rpad, except that we posibly
do a character set recoding in the middle. */
-
char
*dst = value_str_rw (i->output, i->width);
+
uint8_t
*dst = value_str_rw (i->output, i->width);
size_t dst_size = i->width;
const char *src = ss_data (i->input);
size_t src_size = ss_length (i->input);
size_t dst_size = i->width;
const char *src = ss_data (i->input);
size_t src_size = ss_length (i->input);
- legacy_recode (i->encoding, src, LEGACY_NATIVE, dst, MIN (src_size, dst_size));
+ char *s = recode_string (LEGACY_NATIVE, i->encoding, src, MIN (src_size, dst_size));
+ memcpy (dst, s, dst_size);
+ free (s);
if (dst_size > src_size)
memset (&dst[src_size], ' ', dst_size - src_size);
if (dst_size > src_size)
memset (&dst[src_size], ' ', dst_size - src_size);
@@
-624,7
+630,7
@@
parse_A (struct data_in *i)
static bool
parse_AHEX (struct data_in *i)
{
static bool
parse_AHEX (struct data_in *i)
{
-
char
*s = value_str_rw (i->output, i->width);
+
uint8_t
*s = value_str_rw (i->output, i->width);
size_t j;
for (j = 0; ; j++)
size_t j;
for (j = 0; ; j++)