Make MAX_SHORT_STRING an implementation detail of the "value" code.
[pspp-builds.git] / src / data / value.h
index 8f1746337ea37ceaefa3523fa73ff0c2666b63f8..a28b1855bb1ee2acc0fae1a28e2660ac9330ab3d 100644 (file)
 #include <string.h>
 #include "xalloc.h"
 \f
+/* Maximum length of a "short" string, that is represented in
+   "union value" without a separate pointer.
+
+   This is an implementation detail of the "union value" code.
+   There is little reason for client code to use it. */
 #define MAX_SHORT_STRING 8
-#define MIN_LONG_STRING (MAX_SHORT_STRING + 1)
 
 /* A numeric or string value.
 
@@ -148,7 +152,7 @@ static inline const char *
 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.
@@ -162,7 +166,7 @@ static inline char *
 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