#include <data/value.h>
#include <data/variable.h>
#include <libpspp/array.h>
+#include <libpspp/cast.h>
#include <libpspp/compiler.h>
#include <libpspp/hash-functions.h>
#include <libpspp/hmap.h>
val_labs_replace (struct val_labs *vls, const union value *value,
const char *label)
{
- struct val_lab *vl = (struct val_lab *) val_labs_lookup (vls, value);
+ struct val_lab *vl = val_labs_lookup (vls, value);
if (vl != NULL)
{
atom_destroy (vl->label);
/* Removes LABEL from VLS. */
void
-val_labs_remove (struct val_labs *vls, const struct val_lab *label_)
+val_labs_remove (struct val_labs *vls, struct val_lab *label)
{
- struct val_lab *label = (struct val_lab *) label_;
hmap_delete (&vls->labels, &label->node);
value_destroy (&label->value, vls->width);
atom_destroy (label->label);
/* Searches VLS for a value label for VALUE. If successful,
returns the value label; otherwise, returns a null pointer.
Returns a null pointer if VLS is null. */
-const struct val_lab *
+struct val_lab *
val_labs_lookup (const struct val_labs *vls, const union value *value)
{
if (vls != NULL)