[Freeswitch-svn] [commit] r2916 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Sun Oct 1 17:29:04 EDT 2006


Author: mikej
Date: Sun Oct  1 17:29:03 2006
New Revision: 2916

Modified:
   freeswitch/trunk/src/switch_xml.c

Log:
type tweak

Modified: freeswitch/trunk/src/switch_xml.c
==============================================================================
--- freeswitch/trunk/src/switch_xml.c	(original)
+++ freeswitch/trunk/src/switch_xml.c	Sun Oct  1 17:29:03 2006
@@ -118,7 +118,7 @@
 
 	if (str) {
 		for(x = 0; x < strlen(str); x++) {
-			buf[x] = (char)tolower(str[x]);
+			buf[x] = (char)tolower((int)str[x]);
 		}
 		for(x = 0;;x++) {
 			if (!SECTIONS[x].name) {
@@ -296,7 +296,7 @@
     }
     
     for (s = r; ; ) {
-        while (*s && *s != '&' && (*s != '%' || t != '%') && !isspace(*s)) s++;
+        while (*s && *s != '&' && (*s != '%' || t != '%') && !isspace((int)(*s))) s++;
 
         if (! *s) break;
         else if (t != 'c' && ! strncmp(s, "&#", 2)) { // character reference
@@ -331,7 +331,7 @@
             }
             else s++; // not a known entity
         }
-        else if ((t == ' ' || t == '*') && isspace(*s)) *(s++) = ' ';
+        else if ((t == ' ' || t == '*') && isspace((int)(*s))) *(s++) = ' ';
         else s++; // no decoding needed
     }
 
@@ -616,12 +616,12 @@
         attr = (char **)SWITCH_XML_NIL;
         d = ++s;
         
-        if (isalpha(*s) || *s == '_' || *s == ':' || (int8_t) *s < '\0') { // new tag
+        if (isalpha((int)(*s)) || *s == '_' || *s == ':' || (int8_t) *s < '\0') { // new tag
             if (! root->cur)
                 return switch_xml_err(root, d, "markup outside of root element");
 
             s += strcspn(s, SWITCH_XML_WS "/>");
-            while (isspace(*s)) *(s++) = '\0'; // null terminate tag name
+            while (isspace((int)(*s))) *(s++) = '\0'; // null terminate tag name
   
             if (*s && *s != '/' && *s != '>') // find tag in default attr list
                 for (i = 0; (a = root->attr[i]) && strcmp(a[0], d); i++);
@@ -637,7 +637,7 @@
                 attr[l] = s; // set attribute name
 
                 s += strcspn(s, SWITCH_XML_WS "=/>");
-                if (*s == '=' || isspace(*s)) { 
+                if (*s == '=' || isspace((int)(*s))) { 
                     *(s++) = '\0'; // null terminate tag attribute name
                     q = *(s += strspn(s, SWITCH_XML_WS "="));
                     if (q == '"' || q == '\'') { // attribute value
@@ -656,7 +656,7 @@
                             attr[l + 3][l / 2] = SWITCH_XML_TXTM; // value malloced
                     }
                 }
-                while (isspace(*s)) s++;
+                while (isspace((int)(*s))) s++;
             }
 
             if (*s == '/') { // self closing tag
@@ -683,7 +683,7 @@
             if (! (q = *s) && e != '>') return switch_xml_err(root, d, "missing >");
             *s = '\0'; // temporarily null terminate tag name
             if (switch_xml_close_tag(root, d, s)) return &root->xml;
-            if (isspace(*s = q)) s += strspn(s, SWITCH_XML_WS);
+            if (isspace((int)(*s = q))) s += strspn(s, SWITCH_XML_WS);
         }
         else if (! strncmp(s, "!--", 3)) { // comment
             if (! (s = strstr(s + 3, "--")) || (*(s += 2) != '>' && *s) ||



More information about the Freeswitch-svn mailing list