Browse Source

make first argument to mmap_unmap const

master
Felix von Leitner 8 years ago
parent
commit
395dd4c416
  1. 2
      mmap.h
  2. 4
      mmap/mmap_unmap.c

2
mmap.h

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

4
mmap/mmap_unmap.c

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