X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fvalue.h;h=d4978989044040933f328fd02e4fd9829d485285;hb=338fb2a2e84df6427a2fdee6769421f57d5666d8;hp=fccd8a98cd4e0093928f1bf5178aa4f42ea5f9ff;hpb=946282d65fa0142e38d10f78d2c699dacf95300e;p=pspp-builds.git diff --git a/src/data/value.h b/src/data/value.h index fccd8a98..d4978989 100644 --- a/src/data/value.h +++ b/src/data/value.h @@ -21,26 +21,17 @@ #define value_h 1 #include - -#include +#include +#include "minmax.h" /* Values. */ -/* Max length of a short string value, generally 8 chars. */ -#define MAX_SHORT_STRING ( (SIZEOF_DOUBLE)>=8 ? (SIZEOF_DOUBLE + 1)/2 * 2 : 8 ) - +/* "Short" strings, which are generally those no more than 8 + characters wide, can participate in more operations than + longer strings. */ +#define MAX_SHORT_STRING (MAX (ROUND_UP (SIZEOF_DOUBLE, 2), 8)) #define MIN_LONG_STRING (MAX_SHORT_STRING + 1) - -/* Max string length. */ -#define MAX_LONG_STRING 255 - -/* This nonsense is required for SPSS compatibility */ -#define EFFECTIVE_LONG_STRING_LENGTH (MAX_LONG_STRING - 3) - -#define MAX_VERY_LONG_STRING 32767 - -#define MAX_STRING MAX_VERY_LONG_STRING - +#define MAX_STRING 32767 /* Special values. */ #define SYSMIS (-DBL_MAX) @@ -55,14 +46,8 @@ union value char s[MAX_SHORT_STRING]; }; -/* Maximum number of `union value's in a single number or string - value. */ -#define MAX_ELEMS_PER_VALUE (MAX_STRING / sizeof (union value) + 1) - -int compare_values (const union value *a, const union value *b, int width); - -unsigned hash_value(const union value *v, int width); - - +union value *value_dup (const union value *, int width); +int compare_values (const union value *, const union value *, int width); +unsigned hash_value (const union value *, int width); #endif /* !value.h */