r18225 - gnucash/trunk/src - Fix some signed vs. unsigned char pointer type conflicts.

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


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

Modified:
   gnucash/trunk/src/backend/xml/io-example-account.c
   gnucash/trunk/src/backend/xml/sixtp-dom-parsers.c
   gnucash/trunk/src/backend/xml/sixtp-dom-parsers.h
   gnucash/trunk/src/backend/xml/sixtp-utils.c
   gnucash/trunk/src/backend/xml/sixtp.c
   gnucash/trunk/src/calculation/expression_parser.c
   gnucash/trunk/src/gnome-utils/gnc-date-edit.c
   gnucash/trunk/src/gnome-utils/gnc-dense-cal.h
   gnucash/trunk/src/gnome-utils/gnc-menu-extensions.c
   gnucash/trunk/src/libqof/backend/file/qsf-xml-map.c
   gnucash/trunk/src/libqof/qof/gnc-date.c
   gnucash/trunk/src/libqof/qof/guid.c
   gnucash/trunk/src/libqof/qof/qofutil.c
   gnucash/trunk/src/libqof/qof/qofutil.h
Log:
Fix some signed vs. unsigned char pointer type conflicts.

This patch chooses the correct char type to resolve the type conflict.

Patch by J. Alex Aycinena.

Modified: gnucash/trunk/src/backend/xml/io-example-account.c
===================================================================
--- gnucash/trunk/src/backend/xml/io-example-account.c	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/backend/xml/io-example-account.c	2009-07-24 20:07:14 UTC (rev 18225)
@@ -172,7 +172,7 @@
 }
 
 static char*
-squash_extra_whitespace(unsigned char *text)
+squash_extra_whitespace(char *text)
 {
     int spot;
     int length = strlen(text);

Modified: gnucash/trunk/src/backend/xml/sixtp-dom-parsers.c
===================================================================
--- gnucash/trunk/src/backend/xml/sixtp-dom-parsers.c	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/backend/xml/sixtp-dom-parsers.c	2009-07-24 20:07:14 UTC (rev 18225)
@@ -852,7 +852,7 @@
 }
 
 gboolean
-dom_tree_valid_timespec (Timespec *ts, const gchar *name)
+dom_tree_valid_timespec (Timespec *ts, const xmlChar *name)
 {
 
   if (ts->tv_sec || ts->tv_nsec)

Modified: gnucash/trunk/src/backend/xml/sixtp-dom-parsers.h
===================================================================
--- gnucash/trunk/src/backend/xml/sixtp-dom-parsers.h	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/backend/xml/sixtp-dom-parsers.h	2009-07-24 20:07:14 UTC (rev 18225)
@@ -41,7 +41,7 @@
 Recurrence* dom_tree_to_recurrence(xmlNodePtr node);
 
 Timespec dom_tree_to_timespec(xmlNodePtr node);
-gboolean dom_tree_valid_timespec(Timespec *ts, const gchar *name);
+gboolean dom_tree_valid_timespec(Timespec *ts, const xmlChar *name);
 GDate* dom_tree_to_gdate(xmlNodePtr node);
 gnc_numeric* dom_tree_to_gnc_numeric(xmlNodePtr node);
 gchar * dom_tree_to_text(xmlNodePtr tree);

Modified: gnucash/trunk/src/backend/xml/sixtp-utils.c
===================================================================
--- gnucash/trunk/src/backend/xml/sixtp-utils.c	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/backend/xml/sixtp-utils.c	2009-07-24 20:07:14 UTC (rev 18225)
@@ -51,7 +51,7 @@
 gboolean
 isspace_str(const gchar *str, int nomorethan)
 {
-  const guchar *cursor = str;
+  const gchar *cursor = str;
   while(*cursor && (nomorethan != 0)) {
     if(!isspace(*cursor)) {
       return(FALSE);
@@ -273,7 +273,7 @@
 hex_string_to_binary(const gchar *str,  void **v, guint64 *data_len)
 {
   /* Convert a hex string to binary.  No whitespace allowed. */
-  const guchar *cursor = str;
+  const gchar *cursor = str;
   guint64 str_len;
   gboolean error = FALSE;
   

Modified: gnucash/trunk/src/backend/xml/sixtp.c
===================================================================
--- gnucash/trunk/src/backend/xml/sixtp.c	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/backend/xml/sixtp.c	2009-07-24 20:07:14 UTC (rev 18225)
@@ -810,7 +810,7 @@
 
 /***********************************************************************/
 static gboolean
-eat_whitespace(unsigned char **cursor)
+eat_whitespace(char **cursor)
 {
     while(**cursor && isspace(**cursor))
     {
@@ -828,7 +828,7 @@
 }
 
 static gboolean
-search_for(unsigned char marker, unsigned char **cursor)
+search_for(unsigned char marker, char **cursor)
 {
     while(**cursor && **cursor != marker)
     {
@@ -879,7 +879,7 @@
 gnc_is_our_first_xml_chunk(char *chunk, const char *first_tag,
                            gboolean *with_encoding)
 {
-  unsigned char* cursor = NULL;
+  char *cursor = NULL;
 
   if (with_encoding) {
     *with_encoding = FALSE;

Modified: gnucash/trunk/src/calculation/expression_parser.c
===================================================================
--- gnucash/trunk/src/calculation/expression_parser.c	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/calculation/expression_parser.c	2009-07-24 20:07:14 UTC (rev 18225)
@@ -764,7 +764,7 @@
 next_token (parser_env_ptr pe)
 {
   char *nstr;
-  const unsigned char *str_parse = pe->parse_str;
+  const char *str_parse = pe->parse_str;
   void *number;
 
   while (isspace (*str_parse))

Modified: gnucash/trunk/src/gnome-utils/gnc-date-edit.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-date-edit.c	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/gnome-utils/gnc-date-edit.c	2009-07-24 20:07:14 UTC (rev 18225)
@@ -985,7 +985,7 @@
 {
 	struct tm tm = {0};
 	char *str;
-	unsigned char *flags = NULL;
+	gchar *flags = NULL;
 
 	/* Assert, because we're just hosed if it's NULL */
 	g_assert(gde != NULL);
@@ -1004,7 +1004,7 @@
 
 	if (gde->flags & GNC_DATE_EDIT_SHOW_TIME) {
 		char *tokp = NULL;
-		unsigned char *temp;
+		gchar *temp;
 
 		str = g_strdup (gtk_entry_get_text
                                 (GTK_ENTRY (gde->time_entry)));

Modified: gnucash/trunk/src/gnome-utils/gnc-dense-cal.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-dense-cal.h	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/gnome-utils/gnc-dense-cal.h	2009-07-24 20:07:14 UTC (rev 18225)
@@ -88,7 +88,7 @@
 
     guint label_width;
     guint label_height;
-    guint dayLabelHeight;
+    gint dayLabelHeight;
 
     GncDenseCalModel *model;
 

Modified: gnucash/trunk/src/gnome-utils/gnc-menu-extensions.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-menu-extensions.c	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/gnome-utils/gnc-menu-extensions.c	2009-07-24 20:07:14 UTC (rev 18225)
@@ -187,8 +187,8 @@
 static gchar*
 gnc_ext_gen_action_name (const gchar *name)
 {
-  //gchar *extName;
-  const guchar *extChar;
+
+  const gchar *extChar;
   GString *actionName;
 
   actionName = g_string_sized_new( strlen( name ) + 7 );

Modified: gnucash/trunk/src/libqof/backend/file/qsf-xml-map.c
===================================================================
--- gnucash/trunk/src/libqof/backend/file/qsf-xml-map.c	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/libqof/backend/file/qsf-xml-map.c	2009-07-24 20:07:14 UTC (rev 18225)
@@ -77,7 +77,7 @@
 	xmlChar *qof_version, *match;
 	GString *buff;
 	xmlNodePtr child_node;
-	QofIdType obj_type;
+	xmlChar *obj_type;
 
 	if (qsf_is_element(child, ns, MAP_DEFINITION_TAG)) {
 		qof_version = xmlGetProp(child, BAD_CAST MAP_QOF_VERSION);

Modified: gnucash/trunk/src/libqof/qof/gnc-date.c
===================================================================
--- gnucash/trunk/src/libqof/qof/gnc-date.c	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/libqof/qof/gnc-date.c	2009-07-24 20:07:14 UTC (rev 18225)
@@ -821,10 +821,10 @@
         return locale_separator;
       else
       { /* Make a guess */
-        unsigned char string[256];
+        gchar string[256];
         struct tm tm;
         time_t secs;
-        unsigned char *s;
+        gchar *s;
 
         secs = time(NULL);
         localtime_r(&secs, &tm);

Modified: gnucash/trunk/src/libqof/qof/guid.c
===================================================================
--- gnucash/trunk/src/libqof/qof/guid.c	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/libqof/qof/guid.c	2009-07-24 20:07:14 UTC (rev 18225)
@@ -589,7 +589,7 @@
  * a hex number. returns false otherwise. Decoded number
  * is packed into data in little endian order. */
 static gboolean
-decode_md5_string(const unsigned char *string, unsigned char *data)
+decode_md5_string(const gchar *string, unsigned char *data)
 {
   unsigned char n1, n2;
   size_t count = -1;

Modified: gnucash/trunk/src/libqof/qof/qofutil.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofutil.c	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/libqof/qof/qofutil.c	2009-07-24 20:07:14 UTC (rev 18225)
@@ -177,7 +177,7 @@
 /* =================================================================== */
 
 gboolean
-gnc_strisnum(const guchar *s)
+gnc_strisnum(const gchar *s)
 {
   if (s == NULL) return FALSE;
   if (*s == 0) return FALSE;

Modified: gnucash/trunk/src/libqof/qof/qofutil.h
===================================================================
--- gnucash/trunk/src/libqof/qof/qofutil.h	2009-07-23 16:38:09 UTC (rev 18224)
+++ gnucash/trunk/src/libqof/qof/qofutil.h	2009-07-24 20:07:14 UTC (rev 18225)
@@ -218,7 +218,7 @@
 
 /** Returns true if string s is a number, possibly surrounded by
  * whitespace. */
-gboolean gnc_strisnum(const guchar *s);
+gboolean gnc_strisnum(const gchar *s);
 
 #ifndef HAVE_STPCPY
 #define stpcpy g_stpcpy



More information about the gnucash-changes mailing list