diff options
author | Ran Benita <ran234@gmail.com> | 2015-11-19 00:44:27 +0200 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2015-11-19 00:44:27 +0200 |
commit | 2cca028906b6484af25e9e04f3273e854b70cb24 (patch) | |
tree | 3700a4dfba5df2fbcb9ec6c0208ef8ee79d289c5 /src/utils.h | |
parent | c7e2e6d7b4eddac87191f433efd8c34149b96986 (diff) | |
download | xorg-lib-libxkbcommon-2cca028906b6484af25e9e04f3273e854b70cb24.tar.gz |
src/utils: change map_file to not take const string argument
map_file() uses PROT_READ, so const seems fitting; however unmap_file
calls munmap/free, which do not take const, so an UNCONSTIFY is needed.
To avoid the UNCONSTIFY hack, which is likely undefined behavior or some
such, just remove the const.
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils.h b/src/utils.h index 508435d..4b7e81c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -179,10 +179,10 @@ msb_pos(uint32_t mask) } bool -map_file(FILE *file, const char **string_out, size_t *size_out); +map_file(FILE *file, char **string_out, size_t *size_out); void -unmap_file(const char *str, size_t size); +unmap_file(char *string, size_t size); #define ARRAY_SIZE(arr) ((sizeof(arr) / sizeof(*(arr)))) |