From 9e2ec24e31652338b29fa9ccc069216f07df6bf4 Mon Sep 17 00:00:00 2001 From: Simon Wagner Date: Sun, 21 Dec 2014 21:02:34 +0100 Subject: [PATCH] Fix casts with const pointers --- nacl_irt_interfaces.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nacl_irt_interfaces.h b/nacl_irt_interfaces.h index 70a2199..add31cf 100644 --- a/nacl_irt_interfaces.h +++ b/nacl_irt_interfaces.h @@ -100,21 +100,21 @@ static inline int nacl_startup_argc(const uint32_t info[]) { return info[NACL_STARTUP_ARGC]; } -static inline char **nacl_startup_argv(const uint32_t *info) { - return (char **) &info[NACL_STARTUP_ARGV]; +static inline char* const *nacl_startup_argv(const uint32_t *info) { + return (char* const*) &info[NACL_STARTUP_ARGV]; } static inline int nacl_startup_envc(const uint32_t info[]) { return info[NACL_STARTUP_ENVC]; } -static inline char **nacl_startup_envp(const uint32_t *info) { +static inline char* const *nacl_startup_envp(const uint32_t *info) { return &nacl_startup_argv(info)[nacl_startup_argc(info) + 1]; } -static inline Elf32_auxv_t *nacl_startup_auxv(const uint32_t *info) { - char **envend = &nacl_startup_envp(info)[nacl_startup_envc(info) + 1]; - return (Elf32_auxv_t *) envend; +static inline const Elf32_auxv_t *nacl_startup_auxv(const uint32_t *info) { + char* const* envend = &nacl_startup_envp(info)[nacl_startup_envc(info) + 1]; + return (const Elf32_auxv_t *) envend; } #endif