r18226 - gnucash/trunk/src - Fix more signed vs. unsigned char pointer type conflicts.

Christian Stimming cstim at code.gnucash.org
Fri Jul 24 16:07:27 EDT 2009


Author: cstim
Date: 2009-07-24 16:07:26 -0400 (Fri, 24 Jul 2009)
New Revision: 18226
Trac: http://svn.gnucash.org/trac/changeset/18226

Modified:
   gnucash/trunk/src/backend/xml/gnc-budget-xml-v2.c
   gnucash/trunk/src/backend/xml/gnc-recurrence-xml-v2.c
   gnucash/trunk/src/backend/xml/gnc-schedxaction-xml-v2.c
   gnucash/trunk/src/html/gnc-html-graph-gog-webkit.c
   gnucash/trunk/src/libqof/backend/file/qsf-xml-map.c
   gnucash/trunk/src/register/register-gnome/gnucash-item-edit.c
Log:
Fix more signed vs. unsigned char pointer type conflicts.

This patch contains those cases where a cast was unavoidable.

Patch by J. Alex Aycinena. Detailed explanation follows:

1 - src/register/register-gnome/gnucash-item-edit.c
The variable 'sel' is set with 'gtk_selection_data_get_text' which
returns a 'guchar *'; 'sel' is then used by functions
'gtk_editable_insert_text' and 'strlen' which require 'gchar *', so
there is no alternative but to cast.

2 - src/backend/xml/gnc-budget-xml-v2.c
The functions 'xmlNewNode'and 'xmlSetProp' require arguments that are
of type 'const xmlChar *' but the arguments are string literals (char
*). Can string literals be set up as type 'const xmlChar *'? The
patchfile has them being cast. BAD_CAST is defined for this purpose.

3 - src/backend/xml/gnc-schedxaction-xml-v2.c
Like above, the function 'xmlNewNode' requires arguments that are of
type 'const xmlChar *' but the arguments are string literals (char *).
In the three other changes the type 'const xmlChar *' needs to be
changed to 'char *' to be used by 'strcmp'.

4 - src/backend/xml/gnc-recurrence-xml-v2.c
Like above for the functions 'xmlNewNode'and 'xmlSetProp'.

5 - src/html/gnc-html-graph-gog-webkit.c
The function 'g_base64_encode' requires type 'guchar *' for the
argument and changing the variable to this caused other problems so
used casting instead.

6 - src/libqof/backend/file/qsf-xml-map.c (6 occurances)
The first occurance was solved by changing the type declaration, but
the other 5 required casting.



More information about the gnucash-patches mailing list