Win64: Fix a bunch of warnings

Fix invalid casts.
Use printf("%z") where appropriate.
Fix unused variables warnings.

Thanks vtorri for the patch.

@fix
This commit is contained in:
Jean-Philippe Andre 2014-05-29 19:54:22 +09:00
parent f62b612797
commit f4a0c8054f
5 changed files with 12 additions and 10 deletions

View File

@ -1492,11 +1492,7 @@ _ecore_con_url_read_cb(void *ptr, size_t size, size_t nitems, void *stream)
fclose((FILE *)stream);
return 0;
}
#ifdef _WIN32
INF("*** We read %Iu bytes from file", retcode);
#else
INF("*** We read %zu bytes from file", retcode);
#endif
return retcode;
}

View File

@ -85,7 +85,7 @@ _eina_thread_tls_keys_clean(Eina_Thread_Win32 *tw)
EINA_LIST_FREE(tw->tls_keys, data)
{
Eina_TLS key = data;
Eina_TLS key = (Eina_TLS)(uintptr_t)data;
cb = _eina_thread_tls_cb_find(key);
if (cb)
cb->cb(eina_tls_get(key));
@ -129,7 +129,7 @@ _eina_thread_tls_key_add(Eina_TLS key)
EINA_LIST_FOREACH(_thread_running, l, tw)
if (tw->thread == t)
{
void *data = key;
void *data = (void *)(uintptr_t)key;
if (!eina_list_data_find(tw->tls_keys, data))
tw->tls_keys = eina_list_append(tw->tls_keys, data);
return EINA_TRUE;

View File

@ -202,7 +202,7 @@ _eio_monitor_win32_watcher_new(Eio_Monitor *monitor,
if (!w) return NULL;
if (!monitor_parent)
monitored = current;
monitored = (char *)current;
else
{
char *tmp;

View File

@ -324,6 +324,8 @@ _eo_call_stack_mem_resize(void **ptr EINA_UNUSED, size_t newsize, size_t maxsize
MEM_PAGE_SIZE);
madvise(((unsigned char *)*ptr) + addr, maxsize - addr, MADV_DONTNEED);
#else
(void)newsize;
(void)maxsize;
// just grow in regular cases
#endif
}
@ -335,6 +337,7 @@ _eo_call_stack_mem_free(void *ptr, size_t maxsize)
// free mmaped memory
munmap(ptr, maxsize);
#else
(void)maxsize;
// free regular memory
free(ptr);
#endif
@ -723,7 +726,7 @@ _eo_api_desc_get(const void *api_func, const _Eo_Class *klass, const _Eo_Class *
* them. We fallback to plain string comparison based on the
* function name itself. Slow, but this should rarely happen.
*/
for (int i = 0; i < cur_klass->desc->ops.count; i++)
for (unsigned int i = 0; i < cur_klass->desc->ops.count; i++)
if (op_descs[i].api_name && !strcmp(api_name, op_descs[i].api_name))
{
if (op_descs[i].api_func == NULL || op_descs[i].api_func == ((void (*)())-1))
@ -1649,7 +1652,7 @@ _eo_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj)
#endif
if (obj->datarefcount == 0)
{
ERR("Data for object %lx (%s) is already not referenced.", (unsigned long) _eo_id_get(obj), obj->klass->desc->name);
ERR("Data for object %zx (%s) is already not referenced.", (size_t)_eo_id_get(obj), obj->klass->desc->name);
}
else
{
@ -1670,7 +1673,7 @@ _eo_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj)
}
else
{
ERR("ref_obj (0x%lx) does not reference data (%p) of obj (0x%lx).", (unsigned long) _eo_id_get(ref_obj), data, (unsigned long)_eo_id_get(obj));
ERR("ref_obj (0x%zx) does not reference data (%p) of obj (0x%zx).", (size_t)_eo_id_get(ref_obj), data, (size_t)_eo_id_get(obj));
}
#else
(void) ref_obj;

View File

@ -192,6 +192,9 @@ _evas_common_rgba_image_surface_munmap(void *data, unsigned int w, unsigned int
else
munmap(data, siz);
#else
(void)w;
(void)h;
(void)cspace;
free(data);
#endif
}