From b9436ff2f2aa53a85f70cb86e70dae4a70882891 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sun, 1 Feb 2009 19:09:15 +0100 Subject: [PATCH] Strings do not have a elttype field. --- src/c/file.d | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/c/file.d b/src/c/file.d index 2547d24f1..a5ffc11cf 100644 --- a/src/c/file.d +++ b/src/c/file.d @@ -510,15 +510,17 @@ generic_close(cl_object strm) static cl_index generic_write_vector(cl_object strm, cl_object data, cl_index start, cl_index end) { + cl_elttype elttype; const struct ecl_file_ops *ops; if (start >= end) return start; ops = stream_dispatch_table(strm); - if (data->vector.elttype == aet_bc || + elttype = ecl_array_elttype(data); + if (elttype == aet_bc || #ifdef ECL_UNICODE - data->vector.elttype == aet_ch || + elttype == aet_ch || #endif - (data->vector.elttype == aet_object && CHARACTERP(ecl_elt(data, 0)))) { + (elttype == aet_object && CHARACTERP(ecl_elt(data, 0)))) { int (*write_char)(cl_object, int) = ops->write_char; for (; start < end; start++) { write_char(strm, ecl_char_code(ecl_elt(data, start))); @@ -2730,7 +2732,7 @@ io_file_close(cl_object strm) static cl_index io_file_read_vector(cl_object strm, cl_object data, cl_index start, cl_index end) { - cl_elttype t = data->vector.elttype; + cl_elttype t = ecl_array_elttype(data); if (start >= end) return start; if (t == aet_b8 || t == aet_i8 || t == aet_bc) { @@ -2752,7 +2754,7 @@ io_file_read_vector(cl_object strm, cl_object data, cl_index start, cl_index end static cl_index io_file_write_vector(cl_object strm, cl_object data, cl_index start, cl_index end) { - cl_elttype t = data->vector.elttype; + cl_elttype t = ecl_array_elttype(data); if (start >= end) return start; if (t == aet_b8 || t == aet_i8 || t == aet_bc) {