mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
(libxml2) Take out STANDALONE ifdefs
This commit is contained in:
parent
af19546d8d
commit
bd39d4c5fa
@ -1737,49 +1737,6 @@ xmlSchematronValidateDoc(xmlSchematronValidCtxtPtr ctxt, xmlDocPtr instance)
|
|||||||
return(ctxt->nberrors);
|
return(ctxt->nberrors);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef STANDALONE
|
|
||||||
int
|
|
||||||
main(void)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
xmlDocPtr instance;
|
|
||||||
xmlSchematronParserCtxtPtr pctxt;
|
|
||||||
xmlSchematronValidCtxtPtr vctxt;
|
|
||||||
xmlSchematronPtr schema = NULL;
|
|
||||||
|
|
||||||
pctxt = xmlSchematronNewParserCtxt("tst.sct");
|
|
||||||
if (pctxt == NULL) {
|
|
||||||
fprintf(stderr, "failed to build schematron parser\n");
|
|
||||||
} else {
|
|
||||||
schema = xmlSchematronParse(pctxt);
|
|
||||||
if (schema == NULL) {
|
|
||||||
fprintf(stderr, "failed to compile schematron\n");
|
|
||||||
}
|
|
||||||
xmlSchematronFreeParserCtxt(pctxt);
|
|
||||||
}
|
|
||||||
instance = xmlReadFile("tst.sct", NULL,
|
|
||||||
XML_PARSE_NOENT | XML_PARSE_NOCDATA);
|
|
||||||
if (instance == NULL) {
|
|
||||||
fprintf(stderr, "failed to parse instance\n");
|
|
||||||
}
|
|
||||||
if ((schema != NULL) && (instance != NULL)) {
|
|
||||||
vctxt = xmlSchematronNewValidCtxt(schema);
|
|
||||||
if (vctxt == NULL) {
|
|
||||||
fprintf(stderr, "failed to build schematron validator\n");
|
|
||||||
} else {
|
|
||||||
ret = xmlSchematronValidateDoc(vctxt, instance);
|
|
||||||
xmlSchematronFreeValidCtxt(vctxt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
xmlSchematronFree(schema);
|
|
||||||
xmlFreeDoc(instance);
|
|
||||||
|
|
||||||
xmlCleanupParser();
|
|
||||||
xmlMemoryDump();
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#define bottom_schematron
|
#define bottom_schematron
|
||||||
#include "elfgcchack.h"
|
#include "elfgcchack.h"
|
||||||
#endif /* LIBXML_SCHEMATRON_ENABLED */
|
#endif /* LIBXML_SCHEMATRON_ENABLED */
|
||||||
|
@ -761,154 +761,3 @@ TRIO_ARGS1((number),
|
|||||||
|
|
||||||
/** @} SpecialQuantities */
|
/** @} SpecialQuantities */
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
* For test purposes.
|
|
||||||
*
|
|
||||||
* Add the following compiler option to include this test code.
|
|
||||||
*
|
|
||||||
* Unix : -DSTANDALONE
|
|
||||||
* VMS : /DEFINE=(STANDALONE)
|
|
||||||
*/
|
|
||||||
#if defined(STANDALONE)
|
|
||||||
# include <stdio.h>
|
|
||||||
|
|
||||||
static TRIO_CONST char *
|
|
||||||
getClassification
|
|
||||||
TRIO_ARGS1((type),
|
|
||||||
int type)
|
|
||||||
{
|
|
||||||
switch (type) {
|
|
||||||
case TRIO_FP_INFINITE:
|
|
||||||
return "FP_INFINITE";
|
|
||||||
case TRIO_FP_NAN:
|
|
||||||
return "FP_NAN";
|
|
||||||
case TRIO_FP_NORMAL:
|
|
||||||
return "FP_NORMAL";
|
|
||||||
case TRIO_FP_SUBNORMAL:
|
|
||||||
return "FP_SUBNORMAL";
|
|
||||||
case TRIO_FP_ZERO:
|
|
||||||
return "FP_ZERO";
|
|
||||||
default:
|
|
||||||
return "FP_UNKNOWN";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
print_class
|
|
||||||
TRIO_ARGS2((prefix, number),
|
|
||||||
TRIO_CONST char *prefix,
|
|
||||||
double number)
|
|
||||||
{
|
|
||||||
printf("%-6s: %s %-15s %g\n",
|
|
||||||
prefix,
|
|
||||||
trio_signbit(number) ? "-" : "+",
|
|
||||||
getClassification(TRIO_FPCLASSIFY(number)),
|
|
||||||
number);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(TRIO_NOARGS)
|
|
||||||
{
|
|
||||||
double my_nan;
|
|
||||||
double my_pinf;
|
|
||||||
double my_ninf;
|
|
||||||
# if defined(TRIO_PLATFORM_UNIX)
|
|
||||||
void (*signal_handler) TRIO_PROTO((int));
|
|
||||||
# endif
|
|
||||||
|
|
||||||
my_nan = trio_nan();
|
|
||||||
my_pinf = trio_pinf();
|
|
||||||
my_ninf = trio_ninf();
|
|
||||||
|
|
||||||
print_class("Nan", my_nan);
|
|
||||||
print_class("PInf", my_pinf);
|
|
||||||
print_class("NInf", my_ninf);
|
|
||||||
print_class("PZero", 0.0);
|
|
||||||
print_class("NZero", -0.0);
|
|
||||||
print_class("PNorm", 1.0);
|
|
||||||
print_class("NNorm", -1.0);
|
|
||||||
print_class("PSub", 1.01e-307 - 1.00e-307);
|
|
||||||
print_class("NSub", 1.00e-307 - 1.01e-307);
|
|
||||||
|
|
||||||
printf("NaN : %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d)\n",
|
|
||||||
my_nan,
|
|
||||||
((unsigned char *)&my_nan)[0],
|
|
||||||
((unsigned char *)&my_nan)[1],
|
|
||||||
((unsigned char *)&my_nan)[2],
|
|
||||||
((unsigned char *)&my_nan)[3],
|
|
||||||
((unsigned char *)&my_nan)[4],
|
|
||||||
((unsigned char *)&my_nan)[5],
|
|
||||||
((unsigned char *)&my_nan)[6],
|
|
||||||
((unsigned char *)&my_nan)[7],
|
|
||||||
trio_isnan(my_nan), trio_isinf(my_nan));
|
|
||||||
printf("PInf: %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d)\n",
|
|
||||||
my_pinf,
|
|
||||||
((unsigned char *)&my_pinf)[0],
|
|
||||||
((unsigned char *)&my_pinf)[1],
|
|
||||||
((unsigned char *)&my_pinf)[2],
|
|
||||||
((unsigned char *)&my_pinf)[3],
|
|
||||||
((unsigned char *)&my_pinf)[4],
|
|
||||||
((unsigned char *)&my_pinf)[5],
|
|
||||||
((unsigned char *)&my_pinf)[6],
|
|
||||||
((unsigned char *)&my_pinf)[7],
|
|
||||||
trio_isnan(my_pinf), trio_isinf(my_pinf));
|
|
||||||
printf("NInf: %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d)\n",
|
|
||||||
my_ninf,
|
|
||||||
((unsigned char *)&my_ninf)[0],
|
|
||||||
((unsigned char *)&my_ninf)[1],
|
|
||||||
((unsigned char *)&my_ninf)[2],
|
|
||||||
((unsigned char *)&my_ninf)[3],
|
|
||||||
((unsigned char *)&my_ninf)[4],
|
|
||||||
((unsigned char *)&my_ninf)[5],
|
|
||||||
((unsigned char *)&my_ninf)[6],
|
|
||||||
((unsigned char *)&my_ninf)[7],
|
|
||||||
trio_isnan(my_ninf), trio_isinf(my_ninf));
|
|
||||||
|
|
||||||
# if defined(TRIO_PLATFORM_UNIX)
|
|
||||||
signal_handler = signal(SIGFPE, SIG_IGN);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
my_pinf = DBL_MAX + DBL_MAX;
|
|
||||||
my_ninf = -my_pinf;
|
|
||||||
my_nan = my_pinf / my_pinf;
|
|
||||||
|
|
||||||
# if defined(TRIO_PLATFORM_UNIX)
|
|
||||||
signal(SIGFPE, signal_handler);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
printf("NaN : %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d)\n",
|
|
||||||
my_nan,
|
|
||||||
((unsigned char *)&my_nan)[0],
|
|
||||||
((unsigned char *)&my_nan)[1],
|
|
||||||
((unsigned char *)&my_nan)[2],
|
|
||||||
((unsigned char *)&my_nan)[3],
|
|
||||||
((unsigned char *)&my_nan)[4],
|
|
||||||
((unsigned char *)&my_nan)[5],
|
|
||||||
((unsigned char *)&my_nan)[6],
|
|
||||||
((unsigned char *)&my_nan)[7],
|
|
||||||
trio_isnan(my_nan), trio_isinf(my_nan));
|
|
||||||
printf("PInf: %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d)\n",
|
|
||||||
my_pinf,
|
|
||||||
((unsigned char *)&my_pinf)[0],
|
|
||||||
((unsigned char *)&my_pinf)[1],
|
|
||||||
((unsigned char *)&my_pinf)[2],
|
|
||||||
((unsigned char *)&my_pinf)[3],
|
|
||||||
((unsigned char *)&my_pinf)[4],
|
|
||||||
((unsigned char *)&my_pinf)[5],
|
|
||||||
((unsigned char *)&my_pinf)[6],
|
|
||||||
((unsigned char *)&my_pinf)[7],
|
|
||||||
trio_isnan(my_pinf), trio_isinf(my_pinf));
|
|
||||||
printf("NInf: %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d)\n",
|
|
||||||
my_ninf,
|
|
||||||
((unsigned char *)&my_ninf)[0],
|
|
||||||
((unsigned char *)&my_ninf)[1],
|
|
||||||
((unsigned char *)&my_ninf)[2],
|
|
||||||
((unsigned char *)&my_ninf)[3],
|
|
||||||
((unsigned char *)&my_ninf)[4],
|
|
||||||
((unsigned char *)&my_ninf)[5],
|
|
||||||
((unsigned char *)&my_ninf)[6],
|
|
||||||
((unsigned char *)&my_ninf)[7],
|
|
||||||
trio_isnan(my_ninf), trio_isinf(my_ninf));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user