@func{value_destroy} are actually required for the given @var{width}.
@end deftypefun
-@deftypefun double value_num (const union value *@var{value})
-Returns the numeric value in @var{value}, which must have been
-initialized as a numeric value. Equivalent to @code{@var{value}->f}.
-@end deftypefun
-
-@deftypefun {const char *} value_str (const union value *@var{value}, int @var{width})
-@deftypefunx {char *} value_str_rw (union value *@var{value}, int @var{width})
-Returns the string value in @var{value}, which must have been
-initialized with positive width @var{width}. The string returned is
-not null-terminated. Only @var{width} bytes of returned data may be
-accessed.
-
-The two different functions exist only for @code{const}-correctness.
-Otherwise they are identical.
-
-It is important that @var{width} be the correct value that was passed
-to @func{value_init}. Passing a smaller or larger value (e.g.@:
-because that number of bytes will be accessed) will not always work
-and should be avoided.
-@end deftypefun
-
@deftypefun void value_copy (union value *@var{dst}, @
const union value *@var{src}, @
int @var{width})
const char *p = SvPV (scalar, len);
int width = var_get_width (var);
value_set_missing (val, width);
- memcpy (value_str_rw (val, width), p, len);
+ memcpy (val->s, p, len);
}
}
else
{
int width = var_get_width (var);
- return newSVpvn (value_str (val, width), width);
+ return newSVpvn (val->s, width);
}
}
if (width == 0)
return &value->f;
else
- return value_str_rw (value, width);
+ return value->s;
}
/* Creates and returns a new case_tmpfile that will store cases
case_str (const struct ccase *c, const struct variable *v)
{
assert_variable_matches_case (c, v);
- size_t idx = var_get_case_index (v);
- return value_str (&c->values[idx], caseproto_get_width (c->proto, idx));
+ return c->values[var_get_case_index (v)].s;
}
/* Returns the string value of the `union value' in C numbered
case_str_idx (const struct ccase *c, size_t idx)
{
assert (idx < c->proto->n_widths);
- return value_str (&c->values[idx], caseproto_get_width (c->proto, idx));
+ return c->values[idx].s;
}
/* Returns the string value of the `union value' in C for
assert_variable_matches_case (c, v);
size_t idx = var_get_case_index (v);
assert (!case_is_shared (c));
- return value_str_rw (&c->values[idx], caseproto_get_width (c->proto, idx));
+ return c->values[idx].s;
}
/* Returns the string value of the `union value' in C numbered
{
assert (idx < c->proto->n_widths);
assert (!case_is_shared (c));
- return value_str_rw (&c->values[idx], caseproto_get_width (c->proto, idx));
+ return c->values[idx].s;
}
/* Compares the values of the N_VARS variables in VP
{
/* This is equivalent to buf_copy_rpad, except that we posibly
do a character set recoding in the middle. */
- uint8_t *dst = value_str_rw (i->output, i->width);
+ uint8_t *dst = i->output->s;
size_t dst_size = i->width;
const char *src = ss_data (i->input);
size_t src_size = ss_length (i->input);
static char *
parse_AHEX (struct data_in *i)
{
- uint8_t *s = value_str_rw (i->output, i->width);
+ uint8_t *s = i->output->s;
size_t j;
for (j = 0; ; j++)
default_result (struct data_in *i)
{
if (fmt_is_string (i->format))
- memset (value_str_rw (i->output, i->width), ' ', i->width);
+ memset (i->output->s, ' ', i->width);
else
i->output->f = settings_get_blanks ();
}
assert (fmt_check_output (format));
if (format->type == FMT_A)
{
- char *in = CHAR_CAST (char *, value_str (input, format->w));
+ char *in = CHAR_CAST (char *, input->s);
char *out = recode_string (output_encoding, input_encoding,
in, format->w);
ds_put_cstr (output, out);
assert (fmt_check_output (format));
if (format->type == FMT_A)
{
- char *in = CHAR_CAST (char *, value_str (input, format->w));
+ char *in = CHAR_CAST (char *, input->s);
return recode_string_pool (UTF8, input_encoding, in, format->w, pool);
}
else if (fmt_get_category (format->type) == FMT_CAT_BINARY)
output_AHEX (const union value *input, const struct fmt_spec *format,
char *output)
{
- output_hex (value_str (input, format->w / 2), format->w / 2, output);
+ output_hex (input->s, format->w / 2, output);
}
\f
/* Decimal and scientific formatting. */
if (width == 0)
return &value->f;
else
- return value_str_rw (value, width);
+ return value->s;
}
/* Returns the number of bytes needed to store all the values in
const union value *value = val_lab_get_value (vl);
if (width)
{
- char *s = xmemdup0 (value_str (value, width), width);
+ char *s = xmemdup0 (value->s, width);
xmlTextWriterWriteAttribute (writer, _xml ("value"), _xml (s));
free (s);
}
int i;
for (i = MV_MAX_STRING; i < width; i++)
- if (value_str (value, width)[i] != ' ')
+ if (value->s[i] != ' ')
return false;
return true;
}
return false;
value_init (&v, mv->width);
- buf_copy_rpad (CHAR_CAST (char *, value_str_rw (&v, mv->width)), mv->width,
+ buf_copy_rpad (CHAR_CAST (char *, v.s), mv->width,
CHAR_CAST (char *, s), len, ' ');
ok = mv_add_value (mv, &v);
value_destroy (&v, mv->width);
case MVT_NONE:
return false;
case MVT_1:
- return !memcmp (value_str (&v[0], mv->width), s, mv->width);
+ return !memcmp (v[0].s, s, mv->width);
case MVT_2:
- return (!memcmp (value_str (&v[0], mv->width), s, mv->width)
- || !memcmp (value_str (&v[1], mv->width), s, mv->width));
+ return (!memcmp (v[0].s, s, mv->width)
+ || !memcmp (v[1].s, s, mv->width));
case MVT_3:
- return (!memcmp (value_str (&v[0], mv->width), s, mv->width)
- || !memcmp (value_str (&v[1], mv->width), s, mv->width)
- || !memcmp (value_str (&v[2], mv->width), s, mv->width));
+ return (!memcmp (v[0].s, s, mv->width)
+ || !memcmp (v[1].s, s, mv->width)
+ || !memcmp (v[2].s, s, mv->width));
case MVT_RANGE:
case MVT_RANGE_1:
NOT_REACHED ();
{
return (mv->width == 0
? mv_is_num_missing (mv, v->f, class)
- : mv_is_str_missing (mv, value_str (v, mv->width), class));
+ : mv_is_str_missing (mv, v->s, class));
}
/* Returns true if D is a missing value in the given CLASS in MV,
else
{
char *mvs = recode_string (
- "UTF-8", encoding,
- CHAR_CAST (char *, value_str (value, mv->width)),
+ "UTF-8", encoding, CHAR_CAST (char *, value->s),
MIN (mv->width, MV_MAX_STRING));
ds_put_format (&s, "\"%s\"", mvs);
free (mvs);
if (var_is_numeric (var))
value.f = parse_float (rec->val_labs[i].value);
else
- memcpy (value_str_rw (&value, rec->width),
- rec->val_labs[i].value, rec->width);
+ memcpy (value.s, rec->val_labs[i].value, rec->width);
utf8_label = recode_string ("UTF-8", dict_encoding,
rec->val_labs[i].label, -1);
if (var->width == 0)
retval = read_case_number (r, &v->f);
else
- retval = read_case_string (r, value_str_rw (v, var->width),
- var->width);
+ retval = read_case_string (r, v->s, var->width);
if (retval != 1)
{
{
width = MIN (width, MAX_POR_WIDTH);
write_int (w, width);
- buf_write (w, value_str (v, width), width);
+ buf_write (w, v->s, width);
}
}
case VARCHAROID:
case BPCHAROID:
case BYTEAOID:
- memcpy (value_str_rw (val, var_width), vptr,
- MIN (length, var_width));
+ memcpy (val->s, vptr, MIN (length, var_width));
break;
case NUMERICOID:
if (width == 0)
value.f = parse_float (r, label->value, 0);
else
- memcpy (value_str_rw (&value, width), label->value, width);
+ memcpy (value.s, label->value, width);
if (!var_add_value_label (var, &value, utf8_labels[j]))
{
else
sys_warn (r, record->pos,
_("Duplicate value label for `%.*s' on %s."),
- width, value_str (&value, width),
- var_get_name (var));
+ width, value.s, var_get_name (var));
}
value_destroy (&value, width);
if (!skip)
{
if (value_length == width)
- memcpy (value_str_rw (&value, width),
- (const uint8_t *) record->data + ofs, width);
+ memcpy (value.s, (const uint8_t *) record->data + ofs, width);
else
{
sys_warn (r, record->pos + ofs,
if (!var_add_value_label (var, &value, label))
sys_warn (r, record->pos + ofs,
_("Duplicate value label for `%.*s' on %s."),
- width, value_str (&value, width),
- var_get_name (var));
+ width, value.s, var_get_name (var));
pool_free (r->pool, label);
}
ofs += label_length;
retval = read_case_number (r, &v->f);
else
{
- uint8_t *s = value_str_rw (v, sv->var_width);
- retval = read_case_string (r, s + sv->offset, sv->segment_width);
+ retval = read_case_string (r, v->s + sv->offset, sv->segment_width);
if (retval == 1)
{
retval = skip_whole_strings (r, ROUND_DOWN (sv->padding, 8));
if (mrset->width == 0)
counted = xasprintf ("%.0f", mrset->counted.f);
else
- counted = xmemdup0 (value_str (&mrset->counted, mrset->width),
- mrset->width);
+ counted = xmemdup0 (mrset->counted.s, mrset->width);
ds_put_format (&s, "%zu %s", strlen (counted), counted);
free (counted);
}
size_t len;
write_int (w, width);
- write_bytes (w, value_str (val_lab_get_value (val_lab), width),
- width);
+ write_bytes (w, val_lab_get_value (val_lab)->s, width);
label = recode_string (var_get_encoding (var), "UTF-8",
val_lab_get_escaped_label (val_lab), -1);
const union value *value = mv_get_value (mv, j);
write_int (w, 8);
- write_bytes (w, value_str (value, width), 8);
+ write_bytes (w, value->s, 8);
}
}
}
write_float (w, value->f);
else
{
- write_bytes (w, value_str (value, width), width);
+ write_bytes (w, value->s, width);
write_zeros (w, 8 - width);
}
}
const union value *src, int src_width,
char pad)
{
- u8_buf_copy_rpad (value_str_rw (dst, dst_width), dst_width,
- value_str (src, src_width), src_width,
- pad);
+ u8_buf_copy_rpad (dst->s, dst_width, src->s, src_width, pad);
}
/* Copies the contents of null-terminated string SRC to string
value_copy_buf_rpad (union value *dst, int dst_width,
const uint8_t *src, size_t src_len, char pad)
{
- u8_buf_copy_rpad (value_str_rw (dst, dst_width), dst_width, src, src_len, pad);
+ u8_buf_copy_rpad (dst->s, dst_width, src, src_len, pad);
}
/* Sets V to the system-missing value for data of the given
if (width == 0)
v->f = SYSMIS;
else
- memset (value_str_rw (v, width), ' ', width);
+ memset (v->s, ' ', width);
}
}
{
return (width == -1 ? 0
: width == 0 ? (a->f < b->f ? -1 : a->f > b->f)
- : memcmp (value_str (a, width), value_str (b, width), width));
+ : memcmp (a->s, b->s, width));
}
/* Returns true if A and B, which must both have the given WIDTH,
{
return (width == -1 ? true
: width == 0 ? a->f == b->f
- : !memcmp (value_str (a, width), value_str (b, width), width));
+ : !memcmp (a->s, b->s, width));
}
/* Returns a hash of the data in VALUE, which must have the given
{
return (width == -1 ? basis
: width == 0 ? hash_double (value->f, basis)
- : hash_bytes (value_str (value, width), width, basis));
+ : hash_bytes (value->s, width, basis));
}
/* Tests whether VALUE may be resized from OLD_WIDTH to
return false;
else
{
- const uint8_t *str = value_str (value, old_width);
+ const uint8_t *str = value->s;
int i;
for (i = new_width; i < old_width; i++)
bool
value_is_spaces (const union value *value, int width)
{
- const uint8_t *s = value_str (value, width);
int i;
for (i = 0; i < width; i++)
- if (s[i] != ' ')
+ if (value->s[i] != ' ')
return false;
return true;
if (new_width > old_width)
{
uint8_t *new_string = pool_alloc_unaligned (pool, new_width);
- memcpy (new_string, value_str (value, old_width), old_width);
+ memcpy (new_string, value->s, old_width);
value->s = new_string;
- memset (value_str_rw (value, new_width) + old_width, ' ',
- new_width - old_width);
+ memset (value->s + old_width, ' ', new_width - old_width);
}
}
static inline bool value_try_init (union value *, int width);
static inline void value_destroy (union value *, int width);
-static inline double value_num (const union value *);
-static inline const uint8_t *value_str (const union value *, int width);
-static inline uint8_t *value_str_rw (union value *, int width);
-
static inline void value_copy (union value *, const union value *, int width);
void value_copy_rpad (union value *, int dst_width,
const union value *, int src_width,
free (v->s);
}
-/* Returns the numeric value in V, which must have width 0. */
-static inline double
-value_num (const union value *v)
-{
- return v->f;
-}
-
-/* Returns the string value in V, which must have width WIDTH.
-
- The returned value is not null-terminated.
-
- It is important that WIDTH be the actual value that was passed
- to value_init. Passing, e.g., a smaller value because only
- that number of bytes will be accessed will not always work. */
-static inline const uint8_t *
-value_str (const union value *v, int width)
-{
- assert (width > 0);
- return v->s;
-}
-
-/* Returns the string value in V, which must have width WIDTH.
-
- The returned value is not null-terminated.
-
- It is important that WIDTH be the actual value that was passed
- to value_init. Passing, e.g., a smaller value because only
- that number of bytes will be accessed will not always work. */
-static inline uint8_t *
-value_str_rw (union value *v, int width)
-{
- assert (width > 0);
- return v->s;
-}
-
/* Copies SRC to DST, given that they both contain data of the
given WIDTH. */
static inline void
const char *str)
{
int len = var_get_width (vname);
- uint8_t *s = value_str_rw (case_data_rw (outcase, vname), len);
+ uint8_t *s = case_str_rw (outcase, vname);
- strncpy ((char *) s, str, len);
+ strncpy (CHAR_CAST (char *, s), str, len);
}
static void
blank_varname_column (struct ccase *outcase, const struct variable *vname)
{
int len = var_get_width (vname);
- uint8_t *s = value_str_rw (case_data_rw (outcase, vname), len);
+ uint8_t *s = case_str_rw (outcase, vname);
memset (s, ' ', len);
}
if (mformat->triangle == UPPER && mformat->diagonal == NO_DIAGONAL)
c_offset++;
const union value *v = case_data (c, mformat->rowtype);
- const char *val = (const char *) value_str (v, ROWTYPE_WIDTH);
+ const char *val = CHAR_CAST (const char *, v->s);
if (0 == strncasecmp (val, "corr ", ROWTYPE_WIDTH) ||
0 == strncasecmp (val, "cov ", ROWTYPE_WIDTH))
{
int col;
struct ccase *outcase = case_create (proto);
union value *v = case_data_rw (outcase, mformat->rowtype);
- uint8_t *n = value_str_rw (v, ROWTYPE_WIDTH);
- memcpy (n, "N ", ROWTYPE_WIDTH);
+ memcpy (v->s, "N ", ROWTYPE_WIDTH);
blank_varname_column (outcase, mformat->varname);
for (col = 0; col < mformat->n_continuous_vars; ++col)
{
case_unref (prev_case);
const union value *v = case_data (c, mformat->rowtype);
- const char *val = (const char *) value_str (v, ROWTYPE_WIDTH);
+ const char *val = CHAR_CAST (const char *, v->s);
if (mformat->n >= 0)
{
if (0 == strncasecmp (val, "n ", ROWTYPE_WIDTH) ||
struct ccase *c;
for ( ; (c = casereader_read (group) ); case_unref (c))
{
- const union value *uv = case_data (c, mr->rowtype);
+ const union value *uv = case_data (c, mr->rowtype);
+ const char *row_type = CHAR_CAST (const char *, uv->s);
int col, row;
for (col = 0; col < n_vars; ++col)
{
const struct variable *cv = vars[col];
double x = case_data (c, cv)->f;
- if (0 == strncasecmp ((char *)value_str (uv, 8), "N ", 8))
+ if (0 == strncasecmp (row_type, "N ", 8))
for (row = 0; row < n_vars; ++row)
gsl_matrix_set (mr->n_vectors, row, col, x);
- else if (0 == strncasecmp ((char *) value_str (uv, 8), "MEAN ", 8))
+ else if (0 == strncasecmp (row_type, "MEAN ", 8))
for (row = 0; row < n_vars; ++row)
gsl_matrix_set (mr->mean_vectors, row, col, x);
- else if (0 == strncasecmp ((char *) value_str (uv, 8), "STDDEV ", 8))
+ else if (0 == strncasecmp (row_type, "STDDEV ", 8))
for (row = 0; row < n_vars; ++row)
gsl_matrix_set (mr->var_vectors, row, col, x * x);
}
if (mrow == -1)
continue;
- if (0 == strncasecmp ((char *) value_str (uv, 8), "CORR ", 8))
+ if (0 == strncasecmp (row_type, "CORR ", 8))
{
matrix_fill_row (&mm->corr, c, mrow, vars, n_vars);
}
- else if (0 == strncasecmp ((char *) value_str (uv, 8), "COV ", 8))
+ else if (0 == strncasecmp (row_type, "COV ", 8))
{
matrix_fill_row (&mm->cov, c, mrow, vars, n_vars);
}
value_destroy (&mrset->counted, mrset->width);
value_init (&mrset->counted, width);
- memcpy (value_str_rw (&mrset->counted, width), s, width);
+ memcpy (mrset->counted.s, s, width);
mrset->width = width;
free (s);
break;
case MAX | FSTRING:
/* Need to do some kind of Unicode collation thingy here */
- if (memcmp (iter->string, value_str (v, src_width), src_width) < 0)
- memcpy (iter->string, value_str (v, src_width), src_width);
+ if (memcmp (iter->string, v->s, src_width) < 0)
+ memcpy (iter->string, v->s, src_width);
iter->int1 = 1;
break;
case MIN:
iter->int1 = 1;
break;
case MIN | FSTRING:
- if (memcmp (iter->string, value_str (v, src_width), src_width) > 0)
- memcpy (iter->string, value_str (v, src_width), src_width);
+ if (memcmp (iter->string, v->s, src_width) > 0)
+ memcpy (iter->string, v->s, src_width);
iter->int1 = 1;
break;
case FGT:
break;
case FGT | FSTRING:
case PGT | FSTRING:
- if (memcmp (iter->arg[0].c,
- value_str (v, src_width), src_width) < 0)
+ if (memcmp (iter->arg[0].c, v->s, src_width) < 0)
iter->dbl[0] += weight;
iter->dbl[1] += weight;
break;
break;
case FLT | FSTRING:
case PLT | FSTRING:
- if (memcmp (iter->arg[0].c,
- value_str (v, src_width), src_width) > 0)
+ if (memcmp (iter->arg[0].c, v->s, src_width) > 0)
iter->dbl[0] += weight;
iter->dbl[1] += weight;
break;
break;
case FIN | FSTRING:
case PIN | FSTRING:
- if (memcmp (iter->arg[0].c,
- value_str (v, src_width), src_width) <= 0
- && memcmp (iter->arg[1].c,
- value_str (v, src_width), src_width) >= 0)
+ if (memcmp (iter->arg[0].c, v->s, src_width) <= 0
+ && memcmp (iter->arg[1].c, v->s, src_width) >= 0)
iter->dbl[0] += weight;
iter->dbl[1] += weight;
break;
break;
case FOUT | FSTRING:
case POUT | FSTRING:
- if (memcmp (iter->arg[0].c,
- value_str (v, src_width), src_width) > 0
- || memcmp (iter->arg[1].c,
- value_str (v, src_width), src_width) < 0)
+ if (memcmp (iter->arg[0].c, v->s, src_width) > 0
+ || memcmp (iter->arg[1].c, v->s, src_width) < 0)
iter->dbl[0] += weight;
iter->dbl[1] += weight;
break;
case FIRST | FSTRING:
if (iter->int1 == 0)
{
- memcpy (iter->string, value_str (v, src_width), src_width);
+ memcpy (iter->string, v->s, src_width);
iter->int1 = 1;
}
break;
iter->int1 = 1;
break;
case LAST | FSTRING:
- memcpy (iter->string, value_str (v, src_width), src_width);
+ memcpy (iter->string, v->s, src_width);
iter->int1 = 1;
break;
case NMISS:
case MAX | FSTRING:
case MIN | FSTRING:
if (i->int1)
- memcpy (value_str_rw (v, width), i->string, width);
+ memcpy (v->s, i->string, width);
else
value_set_missing (v, width);
break;
case FIRST | FSTRING:
case LAST | FSTRING:
if (i->int1)
- memcpy (value_str_rw (v, width), i->string, width);
+ memcpy (v->s, i->string, width);
else
value_set_missing (v, width);
break;
value_is_blank (const union value *val, int width, const struct dictionary *dict)
{
mbi_iterator_t iter;
- const char *str = CHAR_CAST_BUG (const char*, value_str (val, width));
+ const char *str = CHAR_CAST_BUG (const char *, val->s);
char *text = recode_string (UTF8, dict_get_encoding (dict), str, width);
for (mbi_init (iter, text, width); mbi_avail (iter); mbi_advance (iter))
the source value from whence the new value comes. */
if (src_width > 0)
{
- const char *str = CHAR_CAST_BUG (const char*, value_str (from, src_width));
+ const char *str = CHAR_CAST_BUG (const char *, from->s);
recoded_value = recode_string (UTF8, dict_get_encoding (dict),
str, src_width);
if ( width_b == 0 && width_a != 0)
return +1;
- return buf_compare_rpad (CHAR_CAST_BUG (const char *, value_str (&(*a)->from, width_a)), width_a,
- CHAR_CAST_BUG (const char *, value_str (&(*b)->from, width_b)), width_b);
+ return buf_compare_rpad (CHAR_CAST_BUG (const char *, (*a)->from.s), width_a,
+ CHAR_CAST_BUG (const char *, (*b)->from.s), width_b);
}
static int
out->copy_input = false;
value_init_pool (pool, &out->value, length);
- memcpy (value_str_rw (&out->value, length), string, length);
+ memcpy (out->value.s, string, length);
out->width = length;
}
switch (in->type)
{
case MAP_SINGLE:
- match = !memcmp (value, value_str (&in->x, trns->max_src_width),
- width);
+ match = !memcmp (value, in->x.s, width);
break;
case MAP_ELSE:
match = true;
if (out != NULL)
{
if (!out->copy_input)
- memcpy (dst, value_str (&out->value, trns->max_dst_width),
- var_get_width (dst_var));
+ memcpy (dst, out->value.s, var_get_width (dst_var));
else if (trns->src_vars != trns->dst_vars)
{
union value *dst_data = case_data_rw (*c, dst_var);
struct pivot_value *pv = xzalloc (sizeof *pv);
if (width > 0)
{
- char *s = recode_string (UTF8, encoding,
- CHAR_CAST (char *, value_str (value, width)),
+ char *s = recode_string (UTF8, encoding, CHAR_CAST (char *, value->s),
width);
size_t n = strlen (s);
while (n > 0 && s[n - 1] == ' ')
}
else
{
- value_str_rw (&act->cut_point, width)[0] = '\0';
- value_str_rw (&act->grp_val[0], width)[0] = '\0';
- value_str_rw (&act->grp_val[1], width)[0] = '\0';
+ act->cut_point.s[0] = '\0';
+ act->grp_val[0].s[0] = '\0';
+ act->grp_val[1].s[0] = '\0';
}
}
else
{
char *ss = xzalloc (width + 1);
- memcpy (ss, value_str (val, width), width);
+ memcpy (ss, val->s, width);
printf ("%s ", ss);
free (ss);
if (width == 0)
syntax_gen_number (output, value->f, format);
else
- {
- char *s = CHAR_CAST_BUG (char *, value_str (value, width));
- syntax_gen_string (output, ss_buffer (s, width));
- }
+ syntax_gen_string (output,
+ ss_buffer (CHAR_CAST (const char *, value->s), width));
}
/* Appends <low> THRU <high> to OUTPUT. If LOW is LOWEST, then
"'%.*s' != '%.*s'",
row, col, n_rows, n_columns,
width, case_str_idx (c, col),
- width, value_str (&array[row][col], width));
+ width, array[row][col].s);
}
}
mc_error (mc, "element %zu,%zu (of %zu,%zu) differs: "
"'%.*s' != '%.*s'",
row, col, n_rows, n_columns,
- width, value_str (&v, width),
- width, value_str (av, width));
+ width, v.s,
+ width, v.s);
difference = true;
}
value_destroy (&v, width);
if (width == 0)
ds_put_format (&s, " %g", v->f);
else
- ds_put_format (&s, " '%.*s'", width, value_str (v, width));
+ ds_put_format (&s, " '%.*s'", width, v->s);
}
mc_error (mc, "%s", ds_cstr (&s));
}
if (width == 0)
ds_put_format (&s, " %g", v.f);
else
- ds_put_format (&s, " '%.*s'",
- width, value_str (&v, width));
+ ds_put_format (&s, " '%.*s'", width, v.s);
}
mc_error (mc, "%s", ds_cstr (&s));
}
else
{
unsigned int hash = hash_int (idx, 0);
- uint8_t *string = value_str_rw (value, width);
int offset;
assert (width < 32);
for (offset = 0; offset < width; offset++)
- string[offset] = "ABCDEFGHIJ"[(hash >> offset) % 10];
+ value->s[offset] = "ABCDEFGHIJ"[(hash >> offset) % 10];
}
}