From: Ben Pfaff Date: Wed, 2 Jan 2019 22:22:54 +0000 (-0800) Subject: ods-reader: Use proper function type for xml read callback. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=9d277177e824de0170e1afd3c1db326175e3cfb0 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. --- 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)