mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-07-31 02:43:06 +03:00
Fix various compiler warnings
This commit is contained in:
@ -274,7 +274,7 @@ xsltAddUseAttrSetList(xsltUseAttrSetPtr list, const xmlChar *ncname,
|
|||||||
* Returns the newly allocated xsltAttrSetPtr or NULL in case of error.
|
* Returns the newly allocated xsltAttrSetPtr or NULL in case of error.
|
||||||
*/
|
*/
|
||||||
static xsltAttrSetPtr
|
static xsltAttrSetPtr
|
||||||
xsltNewAttrSet() {
|
xsltNewAttrSet(void) {
|
||||||
xsltAttrSetPtr cur;
|
xsltAttrSetPtr cur;
|
||||||
|
|
||||||
cur = (xsltAttrSetPtr) xmlMalloc(sizeof(xsltAttrSet));
|
cur = (xsltAttrSetPtr) xmlMalloc(sizeof(xsltAttrSet));
|
||||||
|
@ -310,8 +310,10 @@ xsltFlagRVTs(xsltTransformContextPtr ctxt, xmlXPathObjectPtr obj, int val) {
|
|||||||
* document() function?
|
* document() function?
|
||||||
*/
|
*/
|
||||||
#ifdef WITH_XSLT_DEBUG_VARIABLE
|
#ifdef WITH_XSLT_DEBUG_VARIABLE
|
||||||
XSLT_TRACE(ctxt,XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext,
|
XSLT_TRACE(ctxt, XSLT_TRACE_VARIABLES,
|
||||||
"Flagging RVT %p: %d -> %d\n", doc, doc->compression, val));
|
xsltGenericDebug(xsltGenericDebugContext,
|
||||||
|
"Flagging RVT %p: %d -> %d\n",
|
||||||
|
(void *) doc, doc->compression, val));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (val == XSLT_RVT_LOCAL) {
|
if (val == XSLT_RVT_LOCAL) {
|
||||||
|
@ -348,6 +348,8 @@ xsltFreeLocale(xsltLocale locale) {
|
|||||||
#ifdef XSLT_LOCALE_POSIX
|
#ifdef XSLT_LOCALE_POSIX
|
||||||
if (locale != NULL)
|
if (locale != NULL)
|
||||||
freelocale(locale);
|
freelocale(locale);
|
||||||
|
#else
|
||||||
|
(void) locale;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -383,6 +385,7 @@ xsltStrxfrm(xsltLocale locale, const xmlChar *string)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef XSLT_LOCALE_WINAPI
|
#ifdef XSLT_LOCALE_WINAPI
|
||||||
|
(void) locale;
|
||||||
xstrlen = MultiByteToWideChar(CP_UTF8, 0, (char *) string, -1, NULL, 0);
|
xstrlen = MultiByteToWideChar(CP_UTF8, 0, (char *) string, -1, NULL, 0);
|
||||||
if (xstrlen == 0) {
|
if (xstrlen == 0) {
|
||||||
xsltTransformError(NULL, NULL, NULL, "xsltStrxfrm : MultiByteToWideChar check failed\n");
|
xsltTransformError(NULL, NULL, NULL, "xsltStrxfrm : MultiByteToWideChar check failed\n");
|
||||||
@ -454,7 +457,7 @@ xsltLocaleStrcmp(xsltLocale locale, const xsltLocaleChar *str1, const xsltLocale
|
|||||||
*
|
*
|
||||||
* Returns TRUE
|
* Returns TRUE
|
||||||
*/
|
*/
|
||||||
BOOL CALLBACK
|
static BOOL CALLBACK
|
||||||
xsltCountSupportedLocales(LPSTR lcid) {
|
xsltCountSupportedLocales(LPSTR lcid) {
|
||||||
(void) lcid;
|
(void) lcid;
|
||||||
++xsltLocaleListSize;
|
++xsltLocaleListSize;
|
||||||
@ -469,7 +472,7 @@ xsltCountSupportedLocales(LPSTR lcid) {
|
|||||||
*
|
*
|
||||||
* Returns TRUE if not at the end of the array
|
* Returns TRUE if not at the end of the array
|
||||||
*/
|
*/
|
||||||
BOOL CALLBACK
|
static BOOL CALLBACK
|
||||||
xsltIterateSupportedLocales(LPSTR lcid) {
|
xsltIterateSupportedLocales(LPSTR lcid) {
|
||||||
static int count = 0;
|
static int count = 0;
|
||||||
xmlChar iso639lang [XSLTMAX_ISO639LANGLEN +1];
|
xmlChar iso639lang [XSLTMAX_ISO639LANGLEN +1];
|
||||||
@ -477,7 +480,7 @@ xsltIterateSupportedLocales(LPSTR lcid) {
|
|||||||
int k, l;
|
int k, l;
|
||||||
xsltRFC1766Info *p = xsltLocaleList + count;
|
xsltRFC1766Info *p = xsltLocaleList + count;
|
||||||
|
|
||||||
k = sscanf(lcid, "%lx", (long*)&p->lcid);
|
k = sscanf(lcid, "%lx", (unsigned long*)&p->lcid);
|
||||||
if (k < 1) goto end;
|
if (k < 1) goto end;
|
||||||
/*don't count terminating null character*/
|
/*don't count terminating null character*/
|
||||||
k = GetLocaleInfoA(p->lcid, LOCALE_SISO639LANGNAME,
|
k = GetLocaleInfoA(p->lcid, LOCALE_SISO639LANGNAME,
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
</function>
|
</function>
|
||||||
<function name='xsltGetLoaderFunc' file='python'>
|
<function name='xsltGetLoaderFunc' file='python'>
|
||||||
<info>Get the function for controlling document loading</info>
|
<info>Get the function for controlling document loading</info>
|
||||||
<return type='pythonObject *' info='the function'/>
|
<return type='pythonObject' info='the function'/>
|
||||||
</function>
|
</function>
|
||||||
<function name='xsltNewTransformContext' file='python'>
|
<function name='xsltNewTransformContext' file='python'>
|
||||||
<info>Create a new XSLT TransformContext</info>
|
<info>Create a new XSLT TransformContext</info>
|
||||||
|
@ -58,7 +58,11 @@ __inline int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_lis
|
|||||||
/* #define DEBUG_EXTENSIONS */
|
/* #define DEBUG_EXTENSIONS */
|
||||||
/* #define DEBUG_EXTENSIONS */
|
/* #define DEBUG_EXTENSIONS */
|
||||||
|
|
||||||
|
#if PY_MAJOR_VERSION >= 3
|
||||||
|
PyObject* PyInit_libxsltmod(void);
|
||||||
|
#else
|
||||||
void initlibxsltmod(void);
|
void initlibxsltmod(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -623,7 +627,8 @@ libxslt_xsltSetLoaderFunc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyObject *
|
PyObject *
|
||||||
libxslt_xsltGetLoaderFunc(void) {
|
libxslt_xsltGetLoaderFunc(PyObject *self ATTRIBUTE_UNUSED,
|
||||||
|
PyObject *args ATTRIBUTE_UNUSED) {
|
||||||
PyObject *py_retval;
|
PyObject *py_retval;
|
||||||
|
|
||||||
py_retval = pythonDocLoaderObject;
|
py_retval = pythonDocLoaderObject;
|
||||||
@ -1229,9 +1234,9 @@ static PyMethodDef libxsltMethods[] = {
|
|||||||
|
|
||||||
#ifdef MERGED_MODULES
|
#ifdef MERGED_MODULES
|
||||||
#if PY_MAJOR_VERSION >= 3
|
#if PY_MAJOR_VERSION >= 3
|
||||||
extern PyObject* PyInit_libxml2mod(void);
|
PyObject* PyInit_libxml2mod(void);
|
||||||
#else
|
#else
|
||||||
extern void initlibxml2mod(void);
|
void initlibxml2mod(void);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "fuzz.h"
|
#include "fuzz.h"
|
||||||
#include <libxml/globals.h>
|
#include <libxml/globals.h>
|
||||||
|
|
||||||
int
|
static int
|
||||||
testXPath(int argc, char **argv) {
|
testXPath(int argc, char **argv) {
|
||||||
xmlXPathObjectPtr obj;
|
xmlXPathObjectPtr obj;
|
||||||
const char expr[] = "count(//node())";
|
const char expr[] = "count(//node())";
|
||||||
@ -36,7 +36,7 @@ testXPath(int argc, char **argv) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
testXslt(int argc, char **argv) {
|
testXslt(int argc, char **argv) {
|
||||||
xmlChar *result;
|
xmlChar *result;
|
||||||
const char styleBuf[] =
|
const char styleBuf[] =
|
||||||
|
@ -100,7 +100,7 @@ threadRoutine1(void *data)
|
|||||||
xmlChar *result;
|
xmlChar *result;
|
||||||
int len;
|
int len;
|
||||||
xsltStylesheetPtr cur;
|
xsltStylesheetPtr cur;
|
||||||
int id = (int)(unsigned long) data;
|
int id = (int) (size_t) data;
|
||||||
|
|
||||||
input = xmlReadMemory(doc, strlen(doc), "doc.xml", NULL, 0);
|
input = xmlReadMemory(doc, strlen(doc), "doc.xml", NULL, 0);
|
||||||
if (input == NULL) {
|
if (input == NULL) {
|
||||||
@ -205,7 +205,7 @@ main(void)
|
|||||||
|
|
||||||
for (i = 0; i < num_threads; i++) {
|
for (i = 0; i < num_threads; i++) {
|
||||||
ret = pthread_create(&tid[i], NULL, threadRoutine1,
|
ret = pthread_create(&tid[i], NULL, threadRoutine1,
|
||||||
(void *) (unsigned long) i);
|
(void *) (size_t) i);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
perror("pthread_create");
|
perror("pthread_create");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Reference in New Issue
Block a user