From 59dcb3ecff6261a4cf29e6837a04fd98b52aafd3 Mon Sep 17 00:00:00 2001 From: Evan Miller Date: Wed, 4 Aug 2021 10:10:01 -0400 Subject: [PATCH] SAV writer: Missing ranges for all numeric types Closes #251 --- src/spss/readstat_sav_write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spss/readstat_sav_write.c b/src/spss/readstat_sav_write.c index af088b55..2df793b6 100644 --- a/src/spss/readstat_sav_write.c +++ b/src/spss/readstat_sav_write.c @@ -243,7 +243,7 @@ static int sav_n_missing_string_values(readstat_variable_t *r_variable) { static readstat_error_t sav_n_missing_values(int *out_n_missing_values, readstat_variable_t *r_variable) { int n_missing_values = 0; - if (r_variable->type == READSTAT_TYPE_DOUBLE) { + if (readstat_variable_get_type_class(r_variable) == READSTAT_TYPE_CLASS_NUMERIC) { n_missing_values = sav_n_missing_double_values(r_variable); } else if (readstat_variable_get_storage_width(r_variable) <= 8) { n_missing_values = sav_n_missing_string_values(r_variable); @@ -344,7 +344,7 @@ static readstat_error_t sav_emit_variable_missing_double_values(readstat_writer_ } static readstat_error_t sav_emit_variable_missing_values(readstat_writer_t *writer, readstat_variable_t *r_variable) { - if (r_variable->type == READSTAT_TYPE_DOUBLE) { + if (readstat_variable_get_type_class(r_variable) == READSTAT_TYPE_CLASS_NUMERIC) { return sav_emit_variable_missing_double_values(writer, r_variable); } else if (readstat_variable_get_storage_width(r_variable) <= 8) { return sav_emit_variable_missing_string_values(writer, r_variable);