1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

Fix a couple of warnings in dict.c and threads.c

Only visible on Windows.
This commit is contained in:
Nick Wellnhofer 2017-10-09 16:50:57 +02:00
parent 8575c1170b
commit 6472dfe337
2 changed files with 9 additions and 6 deletions

4
dict.c
View File

@ -249,7 +249,7 @@ xmlDictAddString(xmlDictPtr dict, const xmlChar *name, unsigned int namelen) {
#endif
pool = dict->strings;
while (pool != NULL) {
if (pool->end - pool->free > namelen)
if ((size_t)(pool->end - pool->free) > namelen)
goto found_pool;
if (pool->size > size) size = pool->size;
limit += pool->size;
@ -317,7 +317,7 @@ xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix, unsigned int plen,
#endif
pool = dict->strings;
while (pool != NULL) {
if (pool->end - pool->free > namelen + plen + 1)
if ((size_t)(pool->end - pool->free) > namelen + plen + 1)
goto found_pool;
if (pool->size > size) size = pool->size;
limit += pool->size;

View File

@ -139,7 +139,7 @@ static DWORD globalkey = TLS_OUT_OF_INDEXES;
static DWORD mainthread;
static struct {
DWORD done;
DWORD control;
LONG control;
} run_once = { 0, 0};
static volatile LPCRITICAL_SECTION global_init_lock = NULL;
@ -439,7 +439,8 @@ __xmlGlobalInitMutexLock(void)
/* Swap it into the global_init_lock */
#ifdef InterlockedCompareExchangePointer
InterlockedCompareExchangePointer(&global_init_lock, cs, NULL);
InterlockedCompareExchangePointer((void **) &global_init_lock,
cs, NULL);
#else /* Use older void* version */
InterlockedCompareExchange((void **) &global_init_lock,
(void *) cs, NULL);
@ -981,10 +982,12 @@ xmlOnceInit(void)
#elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
#if defined(LIBXML_STATIC_FOR_DLL)
BOOL XMLCALL
xmlDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
xmlDllMain(ATTRIBUTE_UNUSED HINSTANCE hinstDLL, DWORD fdwReason,
ATTRIBUTE_UNUSED LPVOID lpvReserved)
#else
BOOL WINAPI
DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
DllMain(ATTRIBUTE_UNUSED HINSTANCE hinstDLL, DWORD fdwReason,
ATTRIBUTE_UNUSED LPVOID lpvReserved)
#endif
{
switch (fdwReason) {