Remove devind output driver.
[pspp] / src / missing-values.c
index 09192179f1f69da6e9008884659f5b4ac37a998d..2a5b8fa4df6be4b8fff78c34462f4f358572223f 100644 (file)
@@ -89,7 +89,7 @@ mv_add_value (struct missing_values *mv, const union value *v)
    missing values.  (Long string variables never accept missing
    values.) */
 bool
-mv_add_str (struct missing_values *mv, const unsigned char s[]) 
+mv_add_str (struct missing_values *mv, const char s[]) 
 {
   assert (mv->width > 0);
   return mv_add_value (mv, (union value *) s);
@@ -107,11 +107,13 @@ mv_add_num (struct missing_values *mv, double d)
 
 /* Attempts to add range [LOW, HIGH] to the set of numeric
    missing values MV.  Returns true if successful, false if MV
-   has no room for a range. */
+   has no room for a range, or if LOW > HIGH. */
 bool
 mv_add_num_range (struct missing_values *mv, double low, double high) 
 {
   assert (mv->width == 0);
+  if (low > high)
+    return false;
   switch (mv->type) 
     {
     case MV_NONE:
@@ -223,7 +225,7 @@ using_element (unsigned type, int idx)
    NEW_WIDTH (inclusive) and OLD_WIDTH (exclusive),
    false otherwise. */
 static bool
-can_resize_string (const unsigned char *s, int old_width, int new_width) 
+can_resize_string (const char *s, int old_width, int new_width) 
 {
   int i;
 
@@ -302,8 +304,7 @@ mv_is_num_missing (const struct missing_values *mv, double d)
    MV must be a set of string missing values. 
    S[] must contain exactly as many characters as MV's width. */
 bool
-mv_is_str_missing (const struct missing_values *mv,
-                   const unsigned char s[])
+mv_is_str_missing (const struct missing_values *mv, const char s[])
 {
   return mv_is_str_user_missing (mv, s);
 }
@@ -348,7 +349,7 @@ mv_is_num_user_missing (const struct missing_values *mv, double d)
    S[] must contain exactly as many characters as MV's width. */
 bool
 mv_is_str_user_missing (const struct missing_values *mv,
-                        const unsigned char s[])
+                        const char s[])
 {
   const union value *v = mv->values;
   assert (mv->width > 0);