X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fvariable.c;h=05edc57e2db85a3c02df4fbe3a16a6747d92c4bc;hb=b7cbf7cfbfa9de06ac8017c88b602477654c79a9;hp=a60adcafcd8d25422f7be32d8f870059c2c028f3;hpb=f15c854d8500105766b2f5666bb62b983ff24f88;p=pspp-builds.git diff --git a/src/data/variable.c b/src/data/variable.c index a60adcaf..05edc57e 100644 --- a/src/data/variable.c +++ b/src/data/variable.c @@ -494,7 +494,7 @@ var_is_num_missing (const struct variable *v, double d, enum mv_class class) S[] must contain exactly as many characters as V's width. V must be a string variable. */ bool -var_is_str_missing (const struct variable *v, const char s[], +var_is_str_missing (const struct variable *v, const uint8_t s[], enum mv_class class) { return mv_is_str_missing (&v->miss, s, class); @@ -590,9 +590,10 @@ var_append_value_name (const struct variable *v, const union value *value, struct string *str) { const char *name = var_lookup_value_label (v, value); + const struct dictionary *dict = var_get_vardict (v)->dict; if (name == NULL) { - char *s = data_out (value, &v->print); + char *s = data_out (value, dict_get_encoding (dict), &v->print); ds_put_cstr (str, s); free (s); } @@ -956,7 +957,7 @@ void * var_attach_aux (const struct variable *v_, void *aux, void (*aux_dtor) (struct variable *)) { - struct variable *v = (struct variable *) v_ ; /* cast away const */ + struct variable *v = CONST_CAST (struct variable *, v_); assert (v->aux == NULL); assert (aux != NULL); v->aux = aux; @@ -1014,7 +1015,7 @@ var_get_obs_vals (const struct variable *v) void var_set_obs_vals (const struct variable *v_, struct cat_vals *cat_vals) { - struct variable *v = (struct variable *) v_ ; /* cast away const */ + struct variable *v = CONST_CAST (struct variable *, v_ ); cat_stored_values_destroy (v->obs_vals); v->obs_vals = cat_vals; } @@ -1034,7 +1035,7 @@ var_has_obs_vals (const struct variable *v) struct attrset * var_get_attributes (const struct variable *v) { - return (struct attrset *) &v->attributes; + return CONST_CAST (struct attrset *, &v->attributes); } /* Replaces variable V's attributes set by a copy of ATTRS. */