make first argument to mmap_unmap const

master
leitner 11 years ago
parent a451325318
commit 1333904fea

@ -22,7 +22,7 @@ char* mmap_private(const char *filename,size_t* filesize);
char* mmap_shared(const char *filename,size_t* filesize); char* mmap_shared(const char *filename,size_t* filesize);
/* unmap a mapped region */ /* unmap a mapped region */
int mmap_unmap(char* mapped,size_t maplen); int mmap_unmap(const char* mapped,size_t maplen);
#ifdef __cplusplus #ifdef __cplusplus
} }

@ -8,11 +8,11 @@
#include "open.h" #include "open.h"
#include "mmap.h" #include "mmap.h"
int mmap_unmap(char* mapped,size_t maplen) { int mmap_unmap(const char* mapped,size_t maplen) {
#ifdef __MINGW32__ #ifdef __MINGW32__
(void)maplen; (void)maplen;
return UnmapViewOfFile(mapped)?0:-1; return UnmapViewOfFile(mapped)?0:-1;
#else #else
return munmap(mapped,maplen); return munmap((char*)mapped,maplen);
#endif #endif
} }

Loading…
Cancel
Save