[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp/src/data casefile.h casefile.c
From: |
Ben Pfaff |
Subject: |
[Pspp-cvs] pspp/src/data casefile.h casefile.c |
Date: |
Wed, 10 May 2006 04:08:25 +0000 |
CVSROOT: /cvsroot/pspp
Module name: pspp
Branch:
Changes by: Ben Pfaff <address@hidden> 06/05/10 04:08:25
Modified files:
src/data : casefile.h casefile.c
Log message:
Convert many uses of `int' to `bool'.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/casefile.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/casefile.c.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
Patches:
Index: pspp/src/data/casefile.c
diff -u pspp/src/data/casefile.c:1.8 pspp/src/data/casefile.c:1.9
--- pspp/src/data/casefile.c:1.8 Wed Apr 26 22:15:43 2006
+++ pspp/src/data/casefile.c Wed May 10 04:08:25 2006
@@ -129,7 +129,7 @@
enum { MEMORY, DISK } storage; /* Where cases are stored. */
enum { WRITE, READ } mode; /* Is writing or reading allowed? */
struct casereader *readers; /* List of our readers. */
- int being_destroyed; /* Does a destructive reader exist? */
+ bool being_destroyed; /* Does a destructive reader exist? */
bool ok; /* False after I/O error. */
/* Memory storage. */
@@ -149,7 +149,7 @@
struct casereader *next, *prev; /* Next, prev in casefile's list. */
struct casefile *cf; /* Our casefile. */
unsigned long case_idx; /* Case number of current case. */
- int destructive; /* Is this a destructive reader? */
+ bool destructive; /* Is this a destructive reader? */
/* Disk storage. */
int fd; /* File descriptor. */
@@ -272,9 +272,9 @@
return !cf->ok;
}
-/* Returns nonzero only if casefile CF is stored in memory (instead of on
- disk). */
-int
+/* Returns true only if casefile CF is stored in memory (instead of on
+ disk), false otherwise. */
+bool
casefile_in_core (const struct casefile *cf)
{
assert (cf != NULL);
@@ -635,13 +635,13 @@
/* Reads a copy of the next case from READER into C.
Caller is responsible for destroying C.
Returns true if successful, false at end of file. */
-int
+bool
casereader_read (struct casereader *reader, struct ccase *c)
{
assert (reader != NULL);
if (!reader->cf->ok || reader->case_idx >= reader->cf->case_cnt)
- return 0;
+ return false;
if (reader->cf->storage == MEMORY)
{
@@ -650,14 +650,14 @@
case_clone (c, &reader->cf->cases[block_idx][case_idx]);
reader->case_idx++;
- return 1;
+ return true;
}
else
{
if (reader->buffer_pos + reader->cf->value_cnt > reader->cf->buffer_size)
{
if (!fill_buffer (reader))
- return 0;
+ return false;
reader->buffer_pos = 0;
}
@@ -667,7 +667,7 @@
reader->case_idx++;
case_clone (c, &reader->c);
- return 1;
+ return true;
}
}
@@ -675,7 +675,7 @@
to the caller. Caller is responsible for destroying C.
Returns true if successful, false at end of file or on I/O
error. */
-int
+bool
casereader_read_xfer (struct casereader *reader, struct ccase *c)
{
assert (reader != NULL);
@@ -692,7 +692,7 @@
case_move (c, read_case);
reader->case_idx++;
- return 1;
+ return true;
}
}
@@ -787,16 +787,14 @@
static void
register_atexit (void)
{
- static int registered = 0;
+ static bool registered = false;
if (!registered)
{
- registered = 1;
+ registered = true;
atexit (exit_handler);
}
}
-
-
/* atexit() handler that closes and deletes our temporary
files. */
static void
Index: pspp/src/data/casefile.h
diff -u pspp/src/data/casefile.h:1.1 pspp/src/data/casefile.h:1.2
--- pspp/src/data/casefile.h:1.1 Sat Mar 4 01:11:57 2006
+++ pspp/src/data/casefile.h Wed May 10 04:08:25 2006
@@ -31,7 +31,7 @@
void casefile_destroy (struct casefile *);
bool casefile_error (const struct casefile *);
-int casefile_in_core (const struct casefile *);
+bool casefile_in_core (const struct casefile *);
bool casefile_to_disk (const struct casefile *);
bool casefile_sleep (const struct casefile *);
@@ -46,8 +46,8 @@
struct casereader *casefile_get_destructive_reader (struct casefile *);
const struct casefile *casereader_get_casefile (const struct casereader *);
-int casereader_read (struct casereader *, struct ccase *);
-int casereader_read_xfer (struct casereader *, struct ccase *);
+bool casereader_read (struct casereader *, struct ccase *);
+bool casereader_read_xfer (struct casereader *, struct ccase *);
void casereader_destroy (struct casereader *);
unsigned long casereader_cnum(const struct casereader *);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] pspp/src/data casefile.h casefile.c,
Ben Pfaff <=