gnumeric-reader: Add cast to suppress warning.
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 26 Sep 2012 00:09:47 +0000 (17:09 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 26 Sep 2012 04:20:52 +0000 (21:20 -0700)
This suppresses a GCC warning for a mismatch between
xmlInputCloseCallback, which takes a "void *" parameter, and
gzclose(), which takes a "gzFile" (which is "struct gzFile_s *").

This came up with an upgrade from "squeeze" to "wheezy".  I assume
that a gzclose prototype became visible or that gzFile changed away
from "void *".

An alternative would be to write a trampoline to just transform one
pointer type to the other, but the xmlReaderForIO() invocation
already has one function cast so a second cast doesn't make it much
worse.

src/data/gnumeric-reader.c

index 56ebc3062aed3090ccf26748b8d96a105bac85dc..b9def31cb6d7ee9c9b728cb1a76125f08716ec18 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -294,7 +294,8 @@ gnumeric_open_reader (struct spreadsheet_read_info *gri, struct dictionary **dic
 
   r = xzalloc (sizeof *r);
 
-  r->xtr = xmlReaderForIO ((xmlInputReadCallback) gzread, gzclose, gz,
+  r->xtr = xmlReaderForIO ((xmlInputReadCallback) gzread,
+                           (xmlInputCloseCallback) gzclose, gz,
                           NULL, NULL, 0);
 
   if ( r->xtr == NULL)