r18752 - gnucash/trunk/src/backend/xml - MSVC compatiblity: Use a char* pointer for the memcpy() input argument.

Christian Stimming cstim at code.gnucash.org
Sat Feb 27 13:40:46 EST 2010


Author: cstim
Date: 2010-02-27 13:40:46 -0500 (Sat, 27 Feb 2010)
New Revision: 18752
Trac: http://svn.gnucash.org/trac/changeset/18752

Modified:
   gnucash/trunk/src/backend/xml/io-gncxml-v1.c
Log:
MSVC compatiblity: Use a char* pointer for the memcpy() input argument.

This is required by MSVC because we do some pointer arithmetic
in the memcpy() argument, but in order to do this, MSVC wants to
know the pointed-to type of the pointer because pointer arithmetic
increases the pointer not by a number a bytes but a number of
sizeof(type). MSVC thinks for void* it doesn't count bytes. We
achieve the desired effect by using a char* pointer so that bytes
are counted.

Modified: gnucash/trunk/src/backend/xml/io-gncxml-v1.c
===================================================================
--- gnucash/trunk/src/backend/xml/io-gncxml-v1.c	2010-02-27 18:40:23 UTC (rev 18751)
+++ gnucash/trunk/src/backend/xml/io-gncxml-v1.c	2010-02-27 18:40:46 UTC (rev 18752)
@@ -720,7 +720,7 @@
                              gpointer parent_data, gpointer global_data,
                              gpointer *result, const gchar *tag)
 {
-    void *data;
+    char *data;
     guint64 total_size;
     guint64 pos;
     kvp_value *kvpv;



More information about the gnucash-changes mailing list