projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Apply UNUSED and include additional headers to avoid complaints from
[pspp]
/
src
/
language
/
stats
/
flip.c
diff --git
a/src/language/stats/flip.c
b/src/language/stats/flip.c
index 594596c07550143938ae22e5ed443fe632bcb3da..866ea2f742599c4eedf8699ebf2b2f4e45f89f29 100644
(file)
--- a/
src/language/stats/flip.c
+++ b/
src/language/stats/flip.c
@@
-83,7
+83,7
@@
struct flip_pgm
};
static void destroy_flip_pgm (struct flip_pgm *);
};
static void destroy_flip_pgm (struct flip_pgm *);
-static struct case_sink *flip_sink_create (struct d
ictionary *d
, struct flip_pgm *);
+static struct case_sink *flip_sink_create (struct d
ataset *ds
, struct flip_pgm *);
static struct case_source *flip_source_create (struct flip_pgm *);
static bool flip_file (struct flip_pgm *);
static int build_dictionary (struct dictionary *, struct flip_pgm *);
static struct case_source *flip_source_create (struct flip_pgm *);
static bool flip_file (struct flip_pgm *);
static int build_dictionary (struct dictionary *, struct flip_pgm *);
@@
-158,7
+158,7
@@
cmd_flip (struct lexer *lexer, struct dataset *ds)
/* Read the active file into a flip_sink. */
flip->case_cnt = 0;
proc_make_temporary_transformations_permanent (ds);
/* Read the active file into a flip_sink. */
flip->case_cnt = 0;
proc_make_temporary_transformations_permanent (ds);
- sink = flip_sink_create (d
ict
, flip);
+ sink = flip_sink_create (d
s
, flip);
if (sink == NULL)
goto error;
proc_set_sink (ds, sink);
if (sink == NULL)
goto error;
proc_set_sink (ds, sink);
@@
-289,7
+289,7
@@
build_dictionary (struct dictionary *dict, struct flip_pgm *flip)
/* Creates a flip sink based on FLIP. */
static struct case_sink *
/* Creates a flip sink based on FLIP. */
static struct case_sink *
-flip_sink_create (struct d
ictionary *dict
, struct flip_pgm *flip)
+flip_sink_create (struct d
ataset *ds
, struct flip_pgm *flip)
{
size_t i;
{
size_t i;
@@
-316,7
+316,10
@@
flip_sink_create (struct dictionary *dict, struct flip_pgm *flip)
flip->case_cnt = 1;
flip->case_cnt = 1;
- return create_case_sink (&flip_sink_class, dict, flip);
+ return create_case_sink (&flip_sink_class,
+ dataset_dict (ds),
+ dataset_get_casefile_factory (ds),
+ flip);
}
/* Writes case C to the FLIP sink.
}
/* Writes case C to the FLIP sink.
@@
-445,7
+448,10
@@
flip_file (struct flip_pgm *flip)
if (read_cases != fread (input_buf, case_bytes, read_cases, input_file))
{
if (read_cases != fread (input_buf, case_bytes, read_cases, input_file))
{
- msg (SE, _("Error reading FLIP file: %s."), strerror (errno));
+ if (ferror (input_file))
+ msg (SE, _("Error reading FLIP file: %s."), strerror (errno));
+ else
+ msg (SE, _("Unexpected end of file reading FLIP file."));
return false;
}
return false;
}