projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Note that gperf is now required.
[pspp]
/
src
/
data
/
por-file-reader.c
diff --git
a/src/data/por-file-reader.c
b/src/data/por-file-reader.c
index b6bad0a00ae974f5e6c26a24f0c835887eb6502c..a9b1de8193f18e34b6b30f3aee0077e8ce85e45d 100644
(file)
--- a/
src/data/por-file-reader.c
+++ b/
src/data/por-file-reader.c
@@
-1,6
+1,5
@@
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
Code for parsing floating-point numbers adapted from GNU C
library.
Code for parsing floating-point numbers adapted from GNU C
library.
@@
-36,6
+35,7
@@
#include "dictionary.h"
#include "file-handle-def.h"
#include "format.h"
#include "dictionary.h"
#include "file-handle-def.h"
#include "format.h"
+#include "missing-values.h"
#include <libpspp/hash.h>
#include <libpspp/magic.h>
#include <libpspp/misc.h>
#include <libpspp/hash.h>
#include <libpspp/magic.h>
#include <libpspp/misc.h>
@@
-282,7
+282,7
@@
read_float (struct pfm_reader *r)
/* Check that we had some digits. */
if (!got_digit)
/* Check that we had some digits. */
if (!got_digit)
- error (r,
"Number expected."
);
+ error (r,
_("Number expected.")
);
/* Get exponent if any. */
if (r->cc == '+' || r->cc == '-')
/* Get exponent if any. */
if (r->cc == '+' || r->cc == '-')
@@
-421,7
+421,7
@@
read_version_data (struct pfm_reader *r, struct pfm_read_info *info)
/* Read file. */
if (!match (r, 'A'))
/* Read file. */
if (!match (r, 'A'))
- error (r,
"Unrecognized version code `%c'."
, r->cc);
+ error (r,
_("Unrecognized version code `%c'.")
, r->cc);
date = read_pool_string (r);
time = read_pool_string (r);
product = match (r, '1') ? read_pool_string (r) : empty_string;
date = read_pool_string (r);
time = read_pool_string (r);
product = match (r, '1') ? read_pool_string (r) : empty_string;
@@
-430,9
+430,9
@@
read_version_data (struct pfm_reader *r, struct pfm_read_info *info)
/* Validate file. */
if (strlen (date) != 8)
/* Validate file. */
if (strlen (date) != 8)
- error (r, _("Bad date string length %d."), strlen (date));
+ error (r, _("Bad date string length %d."),
(int)
strlen (date));
if (strlen (time) != 6)
if (strlen (time) != 6)
- error (r, _("Bad time string length %d."), strlen (time));
+ error (r, _("Bad time string length %d."),
(int)
strlen (time));
/* Save file info. */
if (info != NULL)
/* Save file info. */
if (info != NULL)
@@
-548,7
+548,7
@@
read_variables (struct pfm_reader *r, struct dictionary *dict)
str_uppercase (name);
if (width < 0 || width > 255)
str_uppercase (name);
if (width < 0 || width > 255)
- error (r,
"Bad width %d for variable %s."
, width, name);
+ error (r,
_("Bad width %d for variable %s.")
, width, name);
v = dict_create_var (dict, name, width);
if (v == NULL)
v = dict_create_var (dict, name, width);
if (v == NULL)
@@
-663,7
+663,7
@@
read_value_label (struct pfm_reader *r, struct dictionary *dict)
{
struct variable *var = v[j];
{
struct variable *var = v[j];
- if (!va
l_labs_replace (var->val_labs,
val, label))
+ if (!va
r_add_value_label (var, &
val, label))
continue;
if (var_is_numeric (var))
continue;
if (var_is_numeric (var))
@@
-698,14
+698,14
@@
pfm_read_case (struct pfm_reader *r, struct ccase *c)
if (width == 0)
{
if (width == 0)
{
- case_data_rw (c, idx)->f = read_float (r);
+ case_data_rw
_idx
(c, idx)->f = read_float (r);
idx++;
}
else
{
char string[256];
read_string (r, string);
idx++;
}
else
{
char string[256];
read_string (r, string);
- buf_copy_str_rpad (case_data_rw (c, idx)->s, width, string);
+ buf_copy_str_rpad (case_data_rw
_idx
(c, idx)->s, width, string);
idx += DIV_RND_UP (width, MAX_SHORT_STRING);
}
}
idx += DIV_RND_UP (width, MAX_SHORT_STRING);
}
}