From 9d277177e824de0170e1afd3c1db326175e3cfb0 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 2 Jan 2019 14:22:54 -0800 Subject: [PATCH] ods-reader: Use proper function type for xml read callback. The difference between size_t and int is not important on 32-bit, but it makes a bit difference on 64-bit. --- src/data/ods-reader.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/data/ods-reader.c b/src/data/ods-reader.c index 212598637a..457edeb4fc 100644 --- a/src/data/ods-reader.c +++ b/src/data/ods-reader.c @@ -507,6 +507,12 @@ convert_xml_to_value (struct ccase *c, const struct variable *var, } } +static int +xml_reader_for_zip_member (void *zm_, char *buffer, int len) +{ + struct zip_member *zm = zm_; + return zip_member_read (zm, buffer, len); +} /* Try to find out how many sheets there are in the "workbook" */ static int @@ -519,9 +525,7 @@ get_sheet_count (struct zip_reader *zreader) if ( meta == NULL) return -1; - mxtr = xmlReaderForIO ((xmlInputReadCallback) zip_member_read, - (xmlInputCloseCallback) NULL, - meta, NULL, NULL, 0); + mxtr = xmlReaderForIO (xml_reader_for_zip_member, NULL, meta, NULL, NULL, 0); while (1 == xmlTextReaderRead (mxtr)) { @@ -570,9 +574,7 @@ init_reader (struct ods_reader *r, bool report_errors) if ( content == NULL) return NULL; - xtr = xmlReaderForIO ((xmlInputReadCallback) zip_member_read, - (xmlInputCloseCallback) NULL, - content, NULL, NULL, + xtr = xmlReaderForIO (xml_reader_for_zip_member, NULL, content, NULL, NULL, report_errors ? 0 : (XML_PARSE_NOERROR | XML_PARSE_NOWARNING) ); if ( xtr == NULL) -- 2.30.2