projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug in val_labs_remove.
[pspp-builds.git]
/
src
/
sel-if.c
diff --git
a/src/sel-if.c
b/src/sel-if.c
index 1df8ed4a8509af10d11f05628b24454031c8b909..10d1030f004f70eb4419c2a1a060482e2519bebf 100644
(file)
--- a/
src/sel-if.c
+++ b/
src/sel-if.c
@@
-14,10
+14,11
@@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
- 0211
1-1307
, USA. */
+ Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA
+ 0211
0-1301
, USA. */
#include <config.h>
#include <config.h>
+#include <stdlib.h>
#include "alloc.h"
#include "command.h"
#include "dictionary.h"
#include "alloc.h"
#include "command.h"
#include "dictionary.h"
@@
-27,10
+28,12
@@
#include "str.h"
#include "var.h"
#include "str.h"
#include "var.h"
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
/* SELECT IF transformation. */
struct select_if_trns
{
/* SELECT IF transformation. */
struct select_if_trns
{
- struct trns_header h;
struct expression *e; /* Test expression. */
};
struct expression *e; /* Test expression. */
};
@@
-56,28
+59,28
@@
cmd_select_if (void)
}
t = xmalloc (sizeof *t);
}
t = xmalloc (sizeof *t);
- t->h.proc = select_if_proc;
- t->h.free = select_if_free;
t->e = e;
t->e = e;
- add_transformation (
(struct trns_header *)
t);
+ add_transformation (
select_if_proc, select_if_free,
t);
return CMD_SUCCESS;
}
/* Performs the SELECT IF transformation T on case C. */
static int
return CMD_SUCCESS;
}
/* Performs the SELECT IF transformation T on case C. */
static int
-select_if_proc (
struct trns_header
*t_, struct ccase *c,
+select_if_proc (
void
*t_, struct ccase *c,
int case_num)
{
int case_num)
{
- struct select_if_trns *t =
(struct select_if_trns *)
t_;
+ struct select_if_trns *t = t_;
return expr_evaluate_num (t->e, c, case_num) == 1.0 ? -1 : -2;
}
/* Frees SELECT IF transformation T. */
static void
return expr_evaluate_num (t->e, c, case_num) == 1.0 ? -1 : -2;
}
/* Frees SELECT IF transformation T. */
static void
-select_if_free (
struct trns_header * t
)
+select_if_free (
void *t_
)
{
{
- expr_free (((struct select_if_trns *) t)->e);
+ struct select_if_trns *t = t_;
+ expr_free (t->e);
+ free (t);
}
/* Parses the FILTER command. */
}
/* Parses the FILTER command. */