libgpo: apply some const.
authorGünther Deschner <gd@samba.org>
Tue, 27 Sep 2016 16:18:51 +0000 (18:18 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 6 Jan 2017 11:28:19 +0000 (12:28 +0100)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
libgpo/gpo_ini.c
libgpo/gpo_ini.h
source3/libgpo/gpext/scripts.c
source3/libgpo/gpext/security.c

index 8166bcb977e797b53c68f0586ca7b0bc068f8d65..603d30441719d0dd079831ed3906f98b432cfbb6 100644 (file)
@@ -150,7 +150,7 @@ static NTSTATUS convert_file_from_ucs2(TALLOC_CTX *mem_ctx,
 /****************************************************************
 ****************************************************************/
 
-NTSTATUS gp_inifile_getstring(struct gp_inifile_context *ctx, const char *key, char **ret)
+NTSTATUS gp_inifile_getstring(struct gp_inifile_context *ctx, const char *key, const char **ret)
 {
        int i;
 
@@ -170,7 +170,7 @@ NTSTATUS gp_inifile_getstring(struct gp_inifile_context *ctx, const char *key, c
 
 NTSTATUS gp_inifile_getint(struct gp_inifile_context *ctx, const char *key, int *ret)
 {
-       char *value;
+       const char *value;
        NTSTATUS result;
 
        result = gp_inifile_getstring(ctx,key, &value);
@@ -189,7 +189,7 @@ NTSTATUS gp_inifile_getint(struct gp_inifile_context *ctx, const char *key, int
 
 NTSTATUS gp_inifile_getbool(struct gp_inifile_context *ctx, const char *key, bool *ret)
 {
-       char *value;
+       const char *value;
        NTSTATUS result;
 
        result = gp_inifile_getstring(ctx,key, &value);
@@ -415,7 +415,7 @@ NTSTATUS parse_gpt_ini(TALLOC_CTX *mem_ctx,
        NTSTATUS result;
        int rv;
        int v = 0;
-       char *name = NULL;
+       const char *name = NULL;
        struct gp_inifile_context *ctx;
 
        if (!filename) {
index 7c945f85620d40d55a2bf7d563d4eeffacda826c..0bfe5b1df0763eda78c3a8715a8add5a816bd031 100644 (file)
@@ -18,8 +18,8 @@
  */
 
 struct keyval_pair {
-       char *key;
-       char *val;
+       const char *key;
+       const char *val;
 };
 
 struct gp_inifile_context {
@@ -42,7 +42,7 @@ NTSTATUS parse_gpt_ini(TALLOC_CTX *ctx,
                       const char *filename,
                       uint32_t *version,
                       char **display_name);
-NTSTATUS gp_inifile_getstring(struct gp_inifile_context *ctx, const char *key, char **ret);
+NTSTATUS gp_inifile_getstring(struct gp_inifile_context *ctx, const char *key, const char **ret);
 NTSTATUS gp_inifile_getint(struct gp_inifile_context *ctx, const char *key, int *ret);
 NTSTATUS gp_inifile_getbool(struct gp_inifile_context *ctx, const char *key, bool *ret);
 
index 12e17b1e0a8be86c59d9f544deb901c6992e1b1b..7471fb85fc479f2451168ba2971bfa79a07ac21c 100644 (file)
@@ -138,9 +138,9 @@ static NTSTATUS scripts_parse_ini_section(struct gp_inifile_context *ini_ctx,
        while (1) {
 
                const char *key = NULL;
-               char *script = NULL;
+               const char *script = NULL;
                const char *count = NULL;
-               char *parameters = NULL;
+               const char *parameters = NULL;
 
                count = talloc_asprintf(ini_ctx->mem_ctx, "%d", i);
                NT_STATUS_HAVE_NO_MEMORY(count);
index 2f461847b924a38ed7e0c355008a5240195e0d1e..dda58d383dbd3c4cc59879b2fe9548164a8f29ef 100644 (file)
@@ -62,7 +62,7 @@ struct gpttmpl_table {
 static NTSTATUS gpttmpl_parse_header(struct gp_inifile_context *ini_ctx,
                                     uint32_t *version_out)
 {
-       char *signature = NULL;
+       const char *signature = NULL;
        NTSTATUS result;
        int version;
        bool is_unicode = false;