Rewrite formatted data input routines to conform to SPSS data formats
[pspp-builds.git] / src / data / format.c
index 06042d0e7009d67f9cc1f61d307521b524eb9905..2a0092fc7d98adf6526534557632515a2ae6fc86 100644 (file)
@@ -60,10 +60,15 @@ fmt_init (void)
     }
 }
 
+static struct fmt_number_style *styles[FMT_NUMBER_OF_FORMATS];
+
 /* Deinitialize the format module. */
 void
 fmt_done (void)
 {
+  int t;
+  for (t = 0 ; t < FMT_NUMBER_OF_FORMATS ; ++t )
+         fmt_number_style_destroy (styles[t]);
 }
 
 /* Returns an input format specification with type TYPE, width W,
@@ -560,13 +565,13 @@ fmt_date_template (enum fmt_type type)
     case FMT_QYR:
       return "q Q yy";
     case FMT_MOYR:
-      return "mmm yy";
+      return "mmmXyy";
     case FMT_WKYR:
       return "ww WK yy";
     case FMT_DATETIME:
       return "dd-mmm-yyyy HH:MM";
     case FMT_TIME:
-      return "h:MM";
+      return "H:MM";
     case FMT_DTIME:
       return "D HH:MM";
     default:
@@ -745,7 +750,6 @@ max_digits_for_bytes (int bytes)
   return map[bytes - 1];
 }
 \f
-static struct fmt_number_style *styles[FMT_NUMBER_OF_FORMATS];
 
 /* Creates and returns a new struct fmt_number_style,
    initializing all affixes to empty strings. */