From: John Darrington Date: Fri, 14 Aug 2009 18:43:48 +0000 (+0200) Subject: Remove const qualifier. X-Git-Tag: sid-i386-build98~1 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfc7fb690935c5ef3a3f3c927d8a82b21085fdfc;p=pspp-builds.git Remove const qualifier. Remove inappropriate const qualifier and the const_casts that it caused. --- diff --git a/src/data/value-labels.c b/src/data/value-labels.c index 34223955..0fe829ce 100644 --- a/src/data/value-labels.c +++ b/src/data/value-labels.c @@ -170,8 +170,7 @@ void val_labs_replace (struct val_labs *vls, const union value *value, const char *label) { - struct val_lab *vl = CONST_CAST (struct val_lab *, - val_labs_lookup (vls, value)); + struct val_lab *vl = val_labs_lookup (vls, value); if (vl != NULL) { atom_destroy (vl->label); @@ -183,9 +182,8 @@ val_labs_replace (struct val_labs *vls, const union value *value, /* 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 = CONST_CAST (struct val_lab *, label_); hmap_delete (&vls->labels, &label->node); value_destroy (&label->value, vls->width); atom_destroy (label->label); @@ -205,7 +203,7 @@ val_labs_find (const struct val_labs *vls, const union value *value) /* 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) diff --git a/src/data/value-labels.h b/src/data/value-labels.h index 53d13a38..460ab84c 100644 --- a/src/data/value-labels.h +++ b/src/data/value-labels.h @@ -70,7 +70,7 @@ size_t val_labs_count (const struct val_labs *); /* Looking up value labels. */ const char *val_labs_find (const struct val_labs *, const union value *); -const struct val_lab *val_labs_lookup (const struct val_labs *, +struct val_lab *val_labs_lookup (const struct val_labs *, const union value *); /* Basic properties. */ @@ -82,7 +82,7 @@ void val_labs_set_width (struct val_labs *, int new_width); /* Adding value labels. */ bool val_labs_add (struct val_labs *, const union value *, const char *); void val_labs_replace (struct val_labs *, const union value *, const char *); -void val_labs_remove (struct val_labs *, const struct val_lab *); +void val_labs_remove (struct val_labs *, struct val_lab *); /* Iterating through value labels. */ const struct val_lab *val_labs_first (const struct val_labs *); diff --git a/src/ui/gui/val-labs-dialog.c b/src/ui/gui/val-labs-dialog.c index 14eacabf..5f43ff49 100644 --- a/src/ui/gui/val-labs-dialog.c +++ b/src/ui/gui/val-labs-dialog.c @@ -324,7 +324,7 @@ on_remove (GtkWidget *w, gpointer data) struct val_labs_dialog *dialog = data; union value value; - const struct val_lab *vl; + struct val_lab *vl; get_selected_tuple (dialog, &value, NULL); vl = val_labs_lookup (dialog->labs, &value);