Remove "Written by Ben Pfaff <blp@gnu.org>" lines everywhere.
[pspp-builds.git] / src / data / missing-values.c
index 6940c6cf124d37ff5f0d674578da55ab32dc8c0a..fac56d0257bed1cf82b9d70895b96ed6f2103b9a 100644 (file)
@@ -1,6 +1,5 @@
 /* PSPP - computes sample statistics.
    Copyright (C) 2005 Free Software Foundation, Inc.
-   Written by Ben Pfaff <blp@gnu.org>.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -21,7 +20,8 @@
 #include "missing-values.h"
 #include <assert.h>
 #include <stdlib.h>
-#include "str.h"
+#include <libpspp/assertion.h>
+#include <libpspp/str.h>
 
 
 /* Initializes MV as a set of missing values for a variable of
@@ -90,7 +90,7 @@ mv_add_value (struct missing_values *mv, const union value *v)
     case MV_RANGE_1:
       return false;
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Attempts to add S to the set of string missing values MV.  S
@@ -139,7 +139,7 @@ mv_add_num_range (struct missing_values *mv, double low, double high)
     case MV_RANGE_1:
       return false;
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Returns true if MV contains an individual value,
@@ -159,7 +159,7 @@ mv_has_value (const struct missing_values *mv)
     case MV_RANGE:
       return false;
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Removes one individual value from MV and stores it in *V.
@@ -224,7 +224,7 @@ mv_has_range (const struct missing_values *mv)
     case MV_3:
       return false;
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Removes the numeric range from MV and stores it in *LOW and
@@ -275,7 +275,7 @@ using_element (unsigned type, int idx)
     case MV_RANGE_1:
       return true;
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Returns true if S contains only spaces between indexes
@@ -302,7 +302,7 @@ can_resize_string (const char *s, int old_width, int new_width)
    contains only spaces in the characters that will be
    trimmed. */
 bool
-mv_is_resizable (struct missing_values *mv, int width) 
+mv_is_resizable (const struct missing_values *mv, int width) 
 {
   assert ((width == 0) == (mv->width == 0));
   if (width > MAX_SHORT_STRING && mv->type != MV_NONE)
@@ -327,7 +327,7 @@ void
 mv_resize (struct missing_values *mv, int width) 
 {
   assert (mv_is_resizable (mv, width));
-  if (width > mv->width) 
+  if (width > mv->width && mv->type != MV_NONE
     {
       int i;
       
@@ -398,7 +398,7 @@ mv_is_num_user_missing (const struct missing_values *mv, double d)
     case MV_RANGE_1:
       return v[0].f == d || (v[1].f <= d && d <= v[2].f);
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Returns true if S[] is a missing value in MV, false otherwise.
@@ -425,9 +425,9 @@ mv_is_str_user_missing (const struct missing_values *mv,
               || !memcmp (v[2].s, s, mv->width));
     case MV_RANGE:
     case MV_RANGE_1:
-      abort ();
+      NOT_REACHED ();
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Returns true if MV is a set of numeric missing values and V is
@@ -436,5 +436,5 @@ bool
 mv_is_value_system_missing (const struct missing_values *mv,
                             const union value *v)
 {
-  return mv->width == 0 ? v->f == SYSMIS : false;
+  return mv->width == 0 && v->f == SYSMIS;
 }