projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleaned up GUI, by objectifying the data editor. Removed a number of global variables.
[pspp]
/
src
/
libpspp
/
pool.c
diff --git
a/src/libpspp/pool.c
b/src/libpspp/pool.c
index 0e6c9358fc828cd10f027c32d9f5750c7ffd5c23..2a6a6b54017a6285815266ff50da32c126028725 100644
(file)
--- a/
src/libpspp/pool.c
+++ b/
src/libpspp/pool.c
@@
-1,6
+1,5
@@
/* PSPP - computes sample statistics.
Copyright (C) 2000 Free Software Foundation, Inc.
/* PSPP - computes sample statistics.
Copyright (C) 2000 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@
-21,6
+20,7
@@
#include "pool.h"
#include <stdlib.h>
#include "alloc.h"
#include "pool.h"
#include <stdlib.h>
#include "alloc.h"
+#include <libpspp/assertion.h>
#include "message.h"
#include "size_max.h"
#include "str.h"
#include "message.h"
#include "size_max.h"
#include "str.h"
@@
-699,8
+699,8
@@
pool_fopen (struct pool *pool, const char *file_name, const char *mode)
assert (pool && file_name && mode);
f = fopen (file_name, mode);
assert (pool && file_name && mode);
f = fopen (file_name, mode);
- if (f
=
= NULL)
-
return NULL
;
+ if (f
!
= NULL)
+
pool_attach_file (pool, f)
;
return f;
}
return f;
}
@@
-776,8
+776,8
@@
pool_register (struct pool *pool, void (*free) (void *), void *p)
}
/* Unregisters previously registered P from POOL.
}
/* Unregisters previously registered P from POOL.
- Returns
nonzero
only if P was found to be registered in POOL. */
-int
+ Returns
true
only if P was found to be registered in POOL. */
+bool
pool_unregister (struct pool *pool, void *p)
{
assert (pool && p);
pool_unregister (struct pool *pool, void *p)
{
assert (pool && p);
@@
-789,11
+789,11
@@
pool_unregister (struct pool *pool, void *p)
if (g->type == POOL_GIZMO_REGISTERED && g->p.registered.p == p)
{
delete_gizmo (pool, g);
if (g->type == POOL_GIZMO_REGISTERED && g->p.registered.p == p)
{
delete_gizmo (pool, g);
- return
1
;
+ return
true
;
}
}
}
}
- return
0
;
+ return
false
;
}
\f
/* Partial freeing. */
}
\f
/* Partial freeing. */
@@
-915,7
+915,7
@@
free_gizmo (struct pool_gizmo *gizmo)
gizmo->p.registered.free (gizmo->p.registered.p);
break;
default:
gizmo->p.registered.free (gizmo->p.registered.p);
break;
default:
-
assert (0
);
+
NOT_REACHED (
);
}
}
}
}