1
0
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:
Nick Wellnhofer
2022-09-01 07:48:38 +02:00
parent 43055d7e3d
commit a0623d9f7a
7 changed files with 24 additions and 14 deletions

View File

@ -274,7 +274,7 @@ xsltAddUseAttrSetList(xsltUseAttrSetPtr list, const xmlChar *ncname,
* Returns the newly allocated xsltAttrSetPtr or NULL in case of error.
*/
static xsltAttrSetPtr
xsltNewAttrSet() {
xsltNewAttrSet(void) {
xsltAttrSetPtr cur;
cur = (xsltAttrSetPtr) xmlMalloc(sizeof(xsltAttrSet));

View File

@ -310,8 +310,10 @@ xsltFlagRVTs(xsltTransformContextPtr ctxt, xmlXPathObjectPtr obj, int val) {
* document() function?
*/
#ifdef WITH_XSLT_DEBUG_VARIABLE
XSLT_TRACE(ctxt,XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext,
"Flagging RVT %p: %d -> %d\n", doc, doc->compression, val));
XSLT_TRACE(ctxt, XSLT_TRACE_VARIABLES,
xsltGenericDebug(xsltGenericDebugContext,
"Flagging RVT %p: %d -> %d\n",
(void *) doc, doc->compression, val));
#endif
if (val == XSLT_RVT_LOCAL) {

View File

@ -348,6 +348,8 @@ xsltFreeLocale(xsltLocale locale) {
#ifdef XSLT_LOCALE_POSIX
if (locale != NULL)
freelocale(locale);
#else
(void) locale;
#endif
}
@ -383,6 +385,7 @@ xsltStrxfrm(xsltLocale locale, const xmlChar *string)
#endif
#ifdef XSLT_LOCALE_WINAPI
(void) locale;
xstrlen = MultiByteToWideChar(CP_UTF8, 0, (char *) string, -1, NULL, 0);
if (xstrlen == 0) {
xsltTransformError(NULL, NULL, NULL, "xsltStrxfrm : MultiByteToWideChar check failed\n");
@ -454,7 +457,7 @@ xsltLocaleStrcmp(xsltLocale locale, const xsltLocaleChar *str1, const xsltLocale
*
* Returns TRUE
*/
BOOL CALLBACK
static BOOL CALLBACK
xsltCountSupportedLocales(LPSTR lcid) {
(void) lcid;
++xsltLocaleListSize;
@ -469,7 +472,7 @@ xsltCountSupportedLocales(LPSTR lcid) {
*
* Returns TRUE if not at the end of the array
*/
BOOL CALLBACK
static BOOL CALLBACK
xsltIterateSupportedLocales(LPSTR lcid) {
static int count = 0;
xmlChar iso639lang [XSLTMAX_ISO639LANGLEN +1];
@ -477,7 +480,7 @@ xsltIterateSupportedLocales(LPSTR lcid) {
int k, l;
xsltRFC1766Info *p = xsltLocaleList + count;
k = sscanf(lcid, "%lx", (long*)&p->lcid);
k = sscanf(lcid, "%lx", (unsigned long*)&p->lcid);
if (k < 1) goto end;
/*don't count terminating null character*/
k = GetLocaleInfoA(p->lcid, LOCALE_SISO639LANGNAME,

View File

@ -18,7 +18,7 @@
</function>
<function name='xsltGetLoaderFunc' file='python'>
<info>Get the function for controlling document loading</info>
<return type='pythonObject *' info='the function'/>
<return type='pythonObject' info='the function'/>
</function>
<function name='xsltNewTransformContext' file='python'>
<info>Create a new XSLT TransformContext</info>

View File

@ -58,7 +58,11 @@ __inline int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_lis
/* #define DEBUG_EXTENSIONS */
/* #define DEBUG_EXTENSIONS */
#if PY_MAJOR_VERSION >= 3
PyObject* PyInit_libxsltmod(void);
#else
void initlibxsltmod(void);
#endif
/************************************************************************
* *
@ -623,7 +627,8 @@ libxslt_xsltSetLoaderFunc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
}
PyObject *
libxslt_xsltGetLoaderFunc(void) {
libxslt_xsltGetLoaderFunc(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args ATTRIBUTE_UNUSED) {
PyObject *py_retval;
py_retval = pythonDocLoaderObject;
@ -1229,9 +1234,9 @@ static PyMethodDef libxsltMethods[] = {
#ifdef MERGED_MODULES
#if PY_MAJOR_VERSION >= 3
extern PyObject* PyInit_libxml2mod(void);
PyObject* PyInit_libxml2mod(void);
#else
extern void initlibxml2mod(void);
void initlibxml2mod(void);
#endif
#endif

View File

@ -9,7 +9,7 @@
#include "fuzz.h"
#include <libxml/globals.h>
int
static int
testXPath(int argc, char **argv) {
xmlXPathObjectPtr obj;
const char expr[] = "count(//node())";
@ -36,7 +36,7 @@ testXPath(int argc, char **argv) {
return ret;
}
int
static int
testXslt(int argc, char **argv) {
xmlChar *result;
const char styleBuf[] =

View File

@ -100,7 +100,7 @@ threadRoutine1(void *data)
xmlChar *result;
int len;
xsltStylesheetPtr cur;
int id = (int)(unsigned long) data;
int id = (int) (size_t) data;
input = xmlReadMemory(doc, strlen(doc), "doc.xml", NULL, 0);
if (input == NULL) {
@ -205,7 +205,7 @@ main(void)
for (i = 0; i < num_threads; i++) {
ret = pthread_create(&tid[i], NULL, threadRoutine1,
(void *) (unsigned long) i);
(void *) (size_t) i);
if (ret != 0) {
perror("pthread_create");
exit(1);