From 9ee6c42f56d0820d52f612c9325d2134229913ce Mon Sep 17 00:00:00 2001 From: Ben Nikula Date: Fri, 31 Jan 2020 23:23:55 +0000 Subject: [PATCH] Change types to fix errors-1 --- pifm.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pifm.cpp b/pifm.cpp index 9aa8c53..2d63f84 100644 --- a/pifm.cpp +++ b/pifm.cpp @@ -84,18 +84,18 @@ struct GPCTL { void getRealMemPage(void** vAddr, void** pAddr) { - void* a = valloc(4096); + int* a = (int*)valloc(4096); - ((int*)a)[0] = 1; // use page to force allocation. + a[0] = 1; // use page to force allocation. - mlock(a, 4096); // lock into ram. + mlock((void*)a, 4096); // lock into ram. *vAddr = a; // yay - we know the virtual address unsigned long long frameinfo; int fp = open("/proc/self/pagemap", O_RDONLY); - lseek(fp, ((int)a)/4096*8, SEEK_SET); + lseek(fp, a/4096*8, SEEK_SET); read(fp, &frameinfo, sizeof(frameinfo)); *pAddr = (void*)((int)(frameinfo*4096));