[Expat-checkins] expat/tests chardata.c,1.3,1.4 chardata.h,1.1,1.2
fdrake@users.sourceforge.net
fdrake@users.sourceforge.net
Tue May 21 14:40:02 2002
Update of /cvsroot/expat/expat/tests
In directory usw-pr-cvs1:/tmp/cvs-serv27699
Modified Files:
chardata.c chardata.h
Log Message:
Remove the use of C99's stdbool.h and the bool type; not all compilers
support this (gcc 2.8.1 on IRIX 6.5 bit this time).
Index: chardata.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/chardata.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- chardata.c 29 Apr 2002 17:10:26 -0000 1.3
+++ chardata.c 21 May 2002 21:39:18 -0000 1.4
@@ -70,7 +70,7 @@
}
}
-bool
+int
CharData_CheckString(CharData *storage, const char *expected)
{
char buffer[1280];
@@ -90,16 +90,16 @@
"wrong number of data characters: got %d, expected %d",
count, len);
fail(buffer);
- return false;
+ return 0;
}
if (memcmp(expected, storage->data, len) != 0) {
fail("got bad data bytes");
- return false;
+ return 0;
}
- return true;
+ return 1;
}
-bool
+int
CharData_CheckXMLChars(CharData *storage, const XML_Char *expected)
{
char buffer[1024];
@@ -112,11 +112,11 @@
sprintf(buffer, "wrong number of data characters: got %d, expected %d",
count, len);
fail(buffer);
- return false;
+ return 0;
}
if (memcmp(expected, storage->data, len * sizeof(storage->data[0])) != 0) {
fail("got bad data bytes");
- return false;
+ return 0;
}
- return true;
+ return 1;
}
Index: chardata.h
===================================================================
RCS file: /cvsroot/expat/expat/tests/chardata.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- chardata.h 25 Apr 2002 04:04:42 -0000 1.1
+++ chardata.h 21 May 2002 21:39:18 -0000 1.2
@@ -10,8 +10,6 @@
#include "expat.h" /* need XML_Char */
#endif
-#include <stdbool.h>
-
typedef struct {
int count; /* # of chars, < 0 if not set */
@@ -25,9 +23,9 @@
void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len);
-bool CharData_CheckString(CharData *storage, const char *s);
+int CharData_CheckString(CharData *storage, const char *s);
-bool CharData_CheckXMLChars(CharData *storage, const XML_Char *s);
+int CharData_CheckXMLChars(CharData *storage, const XML_Char *s);
#endif /* XML_CHARDATA_H */