OSDN Git Service

I changed it from the char to the int to fit the argument of isspace and ispunct...
authortsntsumi <tsntsumi@users.sourceforge.jp>
Tue, 24 Aug 2010 21:15:22 +0000 (21:15 +0000)
committertsntsumi <tsntsumi@users.sourceforge.jp>
Tue, 24 Aug 2010 21:15:22 +0000 (21:15 +0000)
src/ccunit/CCUnitReadSuite.c

index 65efab8..9b59b8d 100644 (file)
@@ -356,7 +356,7 @@ static char* readDocCommentContents ()
     {
       ccunit_dbg ("read from:%lu: \"%s\"", line.lno, start);
       /* skip white spaces */
-      for (; *start && isspace (*start); start ++)
+      for (; *start && isspace ((int)*start); start ++)
        ;
       /* skip leading block comment '*'<WSP>... */
       if (*start != '*')
@@ -364,7 +364,7 @@ static char* readDocCommentContents ()
       else if (start[1] == '/')                        /* eoc */
        ;
       else                                     /* skip white spaces */
-       for (start ++; *start && isspace (*start); start ++)
+       for (start ++; *start && isspace ((int)*start); start ++)
          ;
       /* skip doxygen command line */
       if (*start == '@')
@@ -389,7 +389,7 @@ static char* readDocCommentContents ()
          }
       /* trim trailing white space */
       for (end --; start < end; end --)
-       if (!isspace (*end))
+       if (!isspace ((int)*end))
          {
            end ++;
            break;
@@ -464,7 +464,7 @@ static const char* getTestName (CCUnitTestType_t type, const char* str)
   if (strncasecmp (str, prefix, prefixLen) == 0)
     {
       for (name = str + prefixLen; *name; name ++)
-       if (!isspace (*name))
+       if (!isspace ((int)*name))
          break;
       if (!*name)
        {
@@ -498,7 +498,7 @@ getEndOfTest (CCUnitTestType_t type, const char* str)
   if (strncasecmp (str, prefix, prefixLen) == 0)
     {
       name = str + prefixLen;
-      if (*name && !isspace (*name) && !ispunct (*name))
+      if (*name && !isspace ((int)*name) && !ispunct ((int)*name))
        {
          name = NULL;
          ccunit_dbg ("not a end of test %s: %s", testType, str);
@@ -506,7 +506,7 @@ getEndOfTest (CCUnitTestType_t type, const char* str)
       else
        {
          for (; *name; name ++)
-           if (!isspace (*name))
+           if (!isspace ((int)*name))
              break;
          if (!*name)
            ;
@@ -536,14 +536,14 @@ static _CCUnitFuncDef* readTestFunc (const char* type,
   char* name;
   ccunit_dbg ("read func: %s %s... from '%s'", type, prefix, line.str);
   for (typ = line.str; *typ; typ ++)
-    if (!isspace (*typ))
+    if (!isspace ((int)*typ))
       break;
   if (strncmp (typ, scope, strlen (scope)) != 0)
     scope = "extern";
   else
     {
       typ += strlen (scope);
-      if (*typ && !isspace (*typ))
+      if (*typ && !isspace ((int)*typ))
        {
          ccunit_dbg ("type mismatch: %s %s", type, typ);
          return NULL;
@@ -551,7 +551,7 @@ static _CCUnitFuncDef* readTestFunc (const char* type,
       for (;;)
        {
          for (; *typ; typ ++)
-           if (!isspace (*typ))
+           if (!isspace ((int)*typ))
              break;
          if (*typ)
            break;
@@ -569,7 +569,7 @@ static _CCUnitFuncDef* readTestFunc (const char* type,
       return NULL;
     }
   name = typ + strlen (type);
-  if (*name && !isspace (*name))
+  if (*name && !isspace ((int)*name))
     {
       ccunit_dbg ("type mismatch: %s %s", type, name);
       return NULL;
@@ -577,7 +577,7 @@ static _CCUnitFuncDef* readTestFunc (const char* type,
   for (;;)
     {
       for (; *name; name ++)
-       if (!isspace (*name))
+       if (!isspace ((int)*name))
          break;
       if (*name)
        break;
@@ -592,7 +592,7 @@ static _CCUnitFuncDef* readTestFunc (const char* type,
     {
       char* tail;
       for (tail = name + 1; *tail; tail ++)
-       if (isspace (*tail) || *tail == '(')
+       if (isspace ((int)*tail) || *tail == '(')
          {
            *tail = '\0';
            break;