From: John Darrington Date: Sat, 26 Nov 2005 22:49:57 +0000 (+0000) Subject: Fixed bug in val_labs_remove. X-Git-Tag: v0.6.0~1135 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6950df40513e606e6be42fa83a36a281f654d553;p=pspp-builds.git Fixed bug in val_labs_remove. Added return value to data_out. --- diff --git a/src/ChangeLog b/src/ChangeLog index 44d6ce61..a99cdc8c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +Sun Nov 27 06:43:46 WST 2005 John Darrington + + * data-out.c format.h: Added return value to data_out function. + + * value-labels.c: Fixed bug in val_labs_remove. + Sat Nov 5 18:37:26 2005 Ben Pfaff * Makefile.am: Remove devind.c, devind.h from list of source diff --git a/src/data-out.c b/src/data-out.c index 2600ccb8..d26215a9 100644 --- a/src/data-out.c +++ b/src/data-out.c @@ -56,7 +56,7 @@ static string_converter convert_A, convert_AHEX; /* Converts binary value V into printable form in the exactly FP->W character in buffer S according to format specification FP. No null terminator is appended to the buffer. */ -void +bool data_out (char *s, const struct fmt_spec *fp, const union value *v) { int cat = formats[fp->type].cat; @@ -73,7 +73,7 @@ data_out (char *s, const struct fmt_spec *fp, const union value *v) { memset (s, ' ', fp->w); s[fp->w - fp->d - 1] = '.'; - return; + return true; } /* Handle decimal shift. */ @@ -189,6 +189,8 @@ data_out (char *s, const struct fmt_spec *fp, const union value *v) /* Error handling. */ if (!ok) strncpy (s, "ERROR", fp->w); + + return ok; } /* Converts V into S in F format with width W and D decimal places, diff --git a/src/format.h b/src/format.h index 988c8f8c..1f6f3fb9 100644 --- a/src/format.h +++ b/src/format.h @@ -119,7 +119,7 @@ int get_format_var_width (const struct fmt_spec *); int parse_string_as_format (const char *s, int len, const struct fmt_spec *fp, int fc, union value *v); int translate_fmt (int spss); -void data_out (char *s, const struct fmt_spec *fp, const union value *v); +bool data_out (char *s, const struct fmt_spec *fp, const union value *v); char *fmt_to_string (const struct fmt_spec *); void num_to_string (double v, char *s, int w, int d); struct fmt_spec make_input_format (int type, int w, int d); diff --git a/src/value-labels.c b/src/value-labels.c index 8dfbb10e..cff267f0 100644 --- a/src/value-labels.c +++ b/src/value-labels.c @@ -220,7 +220,7 @@ val_labs_remove (struct val_labs *vls, union value value) if (vls->labels != NULL) { struct int_val_lab *ivl = create_int_val_lab (vls, value, ""); - int deleted = hsh_delete (vls->labels, &ivl); + int deleted = hsh_delete (vls->labels, ivl); free (ivl); return deleted; }