summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-12-14 00:39:59 +0000
committermidipix <writeonce@midipix.org>2016-12-13 20:55:10 -0500
commit6d59028454b4823e7f1a2eab12119ddd507d49f0 (patch)
tree7a7290ef08c2af6b577e2742f05d3dcb922492b4
parentba674246fed3192414135a3336fde7a75f5680ba (diff)
downloaddalist-6d59028454b4823e7f1a2eab12119ddd507d49f0.tar.bz2
dalist-6d59028454b4823e7f1a2eab12119ddd507d49f0.tar.xz
dalist_alloc(): provide a smoother foreign toolchain support.
-rw-r--r--src/dalist_memfn.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dalist_memfn.c b/src/dalist_memfn.c
index e1fa9f0..0b3199d 100644
--- a/src/dalist_memfn.c
+++ b/src/dalist_memfn.c
@@ -160,7 +160,7 @@ static void * __cdecl dalist_alloc(struct dalist_ex * dlist)
/* pmemfn */
if (dlist->memfn_method == DALIST_MEMFN_CUSTOM)
- pmemfn = (dalist_memfn_custom *)dlist->memfn_ptr;
+ pmemfn = (dalist_memfn_custom *)(uintptr_t)dlist->memfn_ptr;
else
pmemfn = dalist_memfn_internal;
@@ -204,7 +204,7 @@ static int __cdecl dalist_memfn_internal(
size = (size_t)((struct dalist_node_ex *)0)->dblock
+ dlist->dblock_size;
- pfn_malloc = (memfn_malloc * )dlist->memfn_ptr;
+ pfn_malloc = (memfn_malloc *)(uintptr_t)dlist->memfn_ptr;
addr = pfn_malloc(size);
if (addr) {
@@ -218,7 +218,7 @@ static int __cdecl dalist_memfn_internal(
break;
case DALIST_MEMFN_MMAP:
- pfn_mmap = (memfn_mmap * )dlist->memfn_ptr;
+ pfn_mmap = (memfn_mmap * )(uintptr_t)dlist->memfn_ptr;
addr = pfn_mmap(
(void *)0,
@@ -240,7 +240,7 @@ static int __cdecl dalist_memfn_internal(
case DALIST_MEMFN_NT_ALLOCATE_VIRTUAL_MEMORY:
addr = (void *)0;
size = dlist->lblock_size;
- pfn_allocvm = (memfn_allocvm * )dlist->memfn_ptr;
+ pfn_allocvm = (memfn_allocvm *)(uintptr_t)dlist->memfn_ptr;
dlist->memfn_status = pfn_allocvm(
NT_CURRENT_PROCESS_HANDLE,