[XML-SIG] PyXML 0.5.5.1 extensions/wstrop.c conversion warnings

Albert Chin-A-Young china@thewrittenword.com
Sat, 2 Sep 2000 19:53:02 -0500


The following patch fixes some problems assigning char * to unsigned
char * and vice versa.

-- 
albert chin (china@thewrittenword.com)

-- snip snip
--- extensions/wstrop.c.orig	Sat Sep  2 19:44:05 2000
+++ extensions/wstrop.c	Sat Sep  2 19:44:15 2000
@@ -89,7 +89,7 @@
 /* Converts a single wide character to a sequence of utf8 bytes.
    Returns the number of bytes, or 0 on error. */
 static int
-to_utf8(unicode_t c,unsigned char* buf)
+to_utf8(unicode_t c,char* buf)
 {
   if(c<0x80){
     if(buf)buf[0]=c;
@@ -148,7 +148,7 @@
 /* Decodes a sequence of utf8 bytes into a single wide character.
    Returns the number of bytes consumed, or 0 on error */
 static int
-from_utf8(const unsigned char* str,unicode_t *c)
+from_utf8(const char* str,unicode_t *c)
 {
   int l=0,i;
   if(*str<0x80){
@@ -265,7 +265,7 @@
    Returns the length of the UTF-7 string, or -1 on error.
    If the destination buffer is 0, it only counts the length. */
 static int
-ucs2_to_utf7(char* utf7,unsigned char* ucs2,int len2,enum utf7_type optionals)
+ucs2_to_utf7(char* utf7,char* ucs2,int len2,enum utf7_type optionals)
 {
   int len7=0;
   int carry=0,ccount=0;
@@ -331,7 +331,7 @@
    Returns the length of the UCS-2 string in shorts.
    On error, raises exception and returns -1. */
 static int
-utf7_to_ucs2(unsigned char* ucs2,unsigned char* utf7,int len2,int flags)
+utf7_to_ucs2(char* ucs2,unsigned char* utf7,int len2,int flags)
 {
   int quoted=0;
   int len=0;
@@ -883,7 +883,7 @@
 {
   int flags=0;
   PyObject* result;
-  unsigned char *s;
+  char *s;
   int i;
   /* this flags are ignored, anyways */
   if(!PyArg_ParseTuple(args,"|i",&flags))return 0;