* sizeof *proto->long_strings);
n = 0;
for (i = 0; i < proto->n_widths; i++)
- if (proto->widths[i] >= MIN_LONG_STRING)
+ if (proto->widths[i] > MAX_SHORT_STRING)
proto->long_strings[n++] = i;
assert (n == proto->n_long_strings);
}
n = 0;
for (i = 0; i < count; i++)
- n += proto->widths[idx + i] >= MIN_LONG_STRING;
+ n += proto->widths[idx + i] > MAX_SHORT_STRING;
return n;
}
void caseproto_refresh_long_string_cache__ (const struct caseproto *);
/* Returns the number of long string widths in PROTO; that is,
- the number of widths in PROTO that are greater than or equal
- to MIN_LONG_STRING. */
+ the number of widths in PROTO that are greater than to
+ MAX_SHORT_STRING. */
static inline size_t
caseproto_get_n_long_strings (const struct caseproto *proto)
{
/* Given long string width IDX1, returns a value IDX2 for which
caseproto_get_width(PROTO, IDX2) will return a value greater
- than or equal to MIN_LONG_STRING. IDX1 must be less than
+ than MAX_SHORT_STRING. IDX1 must be less than
caseproto_get_n_long_strings(PROTO), and IDX2 will be less
than caseproto_get_n_widths(PROTO). */
static inline size_t
anyway in hopes of saving memory.) */
return (old_width != new_width
&& (new_width > old_width
- || old_width >= MIN_LONG_STRING
- || new_width >= MIN_LONG_STRING));
+ || old_width > MAX_SHORT_STRING
+ || new_width > MAX_SHORT_STRING));
}
/* Same as value_init, except that memory for VALUE (if
#include "xalloc.h"
\f
#define MAX_SHORT_STRING 8
-#define MIN_LONG_STRING (MAX_SHORT_STRING + 1)
/* A numeric or string value.
value_str (const union value *v, int width)
{
assert (width > 0);
- return (width >= MIN_LONG_STRING ? v->long_string : v->short_string);
+ return (width > MAX_SHORT_STRING ? v->long_string : v->short_string);
}
/* Returns the string value in V, which must have width WIDTH.
value_str_rw (union value *v, int width)
{
assert (width > 0);
- return (width >= MIN_LONG_STRING ? v->long_string : v->short_string);
+ return (width > MAX_SHORT_STRING ? v->long_string : v->short_string);
}
/* Copies SRC to DST, given that they both contain data of the