Un-const as necessary to silence compiler warnings

This commit is contained in:
Asanka C. Herath
2010-11-18 20:44:40 -05:00
parent d11917211b
commit 880d728e02
10 changed files with 17 additions and 16 deletions

View File

@@ -99,7 +99,7 @@ static struct getargs args[] = {
&enable_v4_cross_realm, &enable_v4_cross_realm,
"respond to kerberos 4 requests from foreign realms" "respond to kerberos 4 requests from foreign realms"
}, },
{ "ports", 'P', arg_string, &port_str, { "ports", 'P', arg_string, rk_UNCONST(&port_str),
"ports to listen to", "portspec" "ports to listen to", "portspec"
}, },
#ifdef SUPPORT_DETACH #ifdef SUPPORT_DETACH

View File

@@ -125,13 +125,14 @@ v5_prop(krb5_context context, HDB *db, hdb_entry_ex *entry, void *appdata)
struct getargs args[] = { struct getargs args[] = {
{ "master-key", 'm', arg_string, &mkeyfile, "v5 master key file", "file" }, { "master-key", 'm', arg_string, &mkeyfile, "v5 master key file", "file" },
{ "database", 'd', arg_string, &database, "database", "file" }, { "database", 'd', arg_string, rk_UNCONST(&database), "database", "file" },
{ "source", 0, arg_string, &source_type, "type of database to read", { "source", 0, arg_string, &source_type, "type of database to read",
"heimdal" "heimdal"
"|mit-dump" "|mit-dump"
}, },
{ "keytab", 'k', arg_string, &ktname, "keytab to use for authentication", "keytab" }, { "keytab", 'k', arg_string, rk_UNCONST(&ktname),
"keytab to use for authentication", "keytab" },
{ "v5-realm", 'R', arg_string, &local_realm, "v5 realm to use" }, { "v5-realm", 'R', arg_string, &local_realm, "v5 realm to use" },
{ "decrypt", 'D', arg_flag, &decrypt_flag, "decrypt keys" }, { "decrypt", 'D', arg_flag, &decrypt_flag, "decrypt keys" },
{ "encrypt", 'E', arg_flag, &encrypt_flag, "encrypt keys" }, { "encrypt", 'E', arg_flag, &encrypt_flag, "encrypt keys" },

View File

@@ -43,7 +43,7 @@ static char *local_realm;
static char *ktname = NULL; static char *ktname = NULL;
struct getargs args[] = { struct getargs args[] = {
{ "database", 'd', arg_string, &database, "database", "file" }, { "database", 'd', arg_string, rk_UNCONST(&database), "database", "file" },
{ "stdin", 'n', arg_flag, &from_stdin, "read from stdin" }, { "stdin", 'n', arg_flag, &from_stdin, "read from stdin" },
{ "print", 0, arg_flag, &print_dump, "print dump to stdout" }, { "print", 0, arg_flag, &print_dump, "print dump to stdout" },
#ifdef SUPPORT_INETD #ifdef SUPPORT_INETD

View File

@@ -46,7 +46,7 @@ static int random_key_flag;
static const char *enctype_str = "des3-cbc-sha1"; static const char *enctype_str = "des3-cbc-sha1";
static struct getargs args[] = { static struct getargs args[] = {
{ "enctype", 'e', arg_string, &enctype_str, "encryption type" }, { "enctype", 'e', arg_string, rk_UNCONST(&enctype_str), "encryption type" },
{ "key-file", 'k', arg_string, &keyfile, "master key file", "file" }, { "key-file", 'k', arg_string, &keyfile, "master key file", "file" },
{ "convert-file", 0, arg_flag, &convert_flag, { "convert-file", 0, arg_flag, &convert_flag,
"just convert keyfile to new format" }, "just convert keyfile to new format" },

View File

@@ -51,7 +51,7 @@ struct getargs args[] = {
{ "cell", 'c', arg_string, &cell, "AFS cell to use", "cell" }, { "cell", 'c', arg_string, &cell, "AFS cell to use", "cell" },
{ "password", 'w', arg_string, &password, "Password to use", "password" }, { "password", 'w', arg_string, &password, "Password to use", "password" },
{ "principal",'p', arg_string, &principal, "Kerberos v5 principal to use", "principal" }, { "principal",'p', arg_string, &principal, "Kerberos v5 principal to use", "principal" },
{ "keytype", 'k', arg_string, &keytype_str, "Keytype" }, { "keytype", 'k', arg_string, rk_UNCONST(&keytype_str), "Keytype" },
{ "version", 0, arg_flag, &version, "print version" }, { "version", 0, arg_flag, &version, "print version" },
{ "help", 0, arg_flag, &help, NULL } { "help", 0, arg_flag, &help, NULL }
}; };

View File

@@ -44,9 +44,9 @@ static int dest_tkt_flag = 1;
static int all_flag = 0; static int all_flag = 0;
struct getargs args[] = { struct getargs args[] = {
{ "credential", 0, arg_string, &credential, { "credential", 0, arg_string, rk_UNCONST(&credential),
"remove one credential", "principal" }, "remove one credential", "principal" },
{ "cache", 'c', arg_string, &cache, "cache to destroy", "cache" }, { "cache", 'c', arg_string, rk_UNCONST(&cache), "cache to destroy", "cache" },
{ "all", 'A', arg_flag, &all_flag, "destroy all caches" }, { "all", 'A', arg_flag, &all_flag, "destroy all caches" },
#ifndef NO_AFS #ifndef NO_AFS
{ "unlog", 0, arg_negative_flag, &unlog_flag, { "unlog", 0, arg_negative_flag, &unlog_flag,

View File

@@ -733,11 +733,11 @@ static struct getargs args[] = {
{ "keytab", 'k', arg_string, &keytab_str, { "keytab", 'k', arg_string, &keytab_str,
"keytab to get authentication from", "kspec" }, "keytab to get authentication from", "kspec" },
{ "database", 'd', arg_string, &database, "database", "file"}, { "database", 'd', arg_string, &database, "database", "file"},
{ "slave-stats-file", 0, arg_string, &slave_stats_file, { "slave-stats-file", 0, arg_string, rk_UNCONST(&slave_stats_file),
"file for slave status information", "file"}, "file for slave status information", "file"},
{ "time-missing", 0, arg_string, &slave_time_missing, { "time-missing", 0, arg_string, rk_UNCONST(&slave_time_missing),
"time before slave is polled for presence", "time"}, "time before slave is polled for presence", "time"},
{ "time-gone", 0, arg_string, &slave_time_gone, { "time-gone", 0, arg_string, rk_UNCONST(&slave_time_gone),
"time of inactivity after which a slave is considered gone", "time"}, "time of inactivity after which a slave is considered gone", "time"},
{ "port", 0, arg_string, &port_str, { "port", 0, arg_string, &port_str,
"port ipropd will listen to", "port"}, "port ipropd will listen to", "port"},
@@ -745,7 +745,7 @@ static struct getargs args[] = {
{ "detach", 0, arg_flag, &detach_from_console, { "detach", 0, arg_flag, &detach_from_console,
"detach from console" }, "detach from console" },
#endif #endif
{ "hostname", 0, arg_string, &master_hostname, { "hostname", 0, arg_string, rk_UNCONST(&master_hostname),
"hostname of master (if not same as hostname)", "hostname" }, "hostname of master (if not same as hostname)", "hostname" },
{ "version", 0, arg_flag, &version_flag }, { "version", 0, arg_flag, &version_flag },
{ "help", 0, arg_flag, &help_flag } { "help", 0, arg_flag, &help_flag }

View File

@@ -472,7 +472,7 @@ static struct getargs args[] = {
{ "detach", 0, arg_flag, &detach_from_console, { "detach", 0, arg_flag, &detach_from_console,
"detach from console" }, "detach from console" },
#endif #endif
{ "hostname", 0, arg_string, &slave_str, { "hostname", 0, arg_string, rk_UNCONST(&slave_str),
"hostname of slave (if not same as hostname)", "hostname" }, "hostname of slave (if not same as hostname)", "hostname" },
{ "version", 0, arg_flag, &version_flag }, { "version", 0, arg_flag, &version_flag },
{ "help", 0, arg_flag, &help_flag } { "help", 0, arg_flag, &help_flag }

View File

@@ -134,7 +134,7 @@ krb5_cc_register(krb5_context context,
} }
} }
if(i == context->num_cc_ops) { if(i == context->num_cc_ops) {
const krb5_cc_ops **o = realloc(context->cc_ops, const krb5_cc_ops **o = realloc(rk_UNCONST(context->cc_ops),
(context->num_cc_ops + 1) * (context->num_cc_ops + 1) *
sizeof(context->cc_ops[0])); sizeof(context->cc_ops[0]));
if(o == NULL) { if(o == NULL) {

View File

@@ -269,7 +269,7 @@ cc_ops_copy(krb5_context context, const krb5_context src_context)
return KRB5_CC_NOMEM; return KRB5_CC_NOMEM;
} }
memcpy(cc_ops, src_context->cc_ops, memcpy(rk_UNCONST(cc_ops), src_context->cc_ops,
sizeof(cc_ops[0]) * src_context->num_cc_ops); sizeof(cc_ops[0]) * src_context->num_cc_ops);
context->cc_ops = cc_ops; context->cc_ops = cc_ops;
context->num_cc_ops = src_context->num_cc_ops; context->num_cc_ops = src_context->num_cc_ops;
@@ -559,7 +559,7 @@ krb5_free_context(krb5_context context)
krb5_free_host_realm (context, context->default_realms); krb5_free_host_realm (context, context->default_realms);
krb5_config_file_free (context, context->cf); krb5_config_file_free (context, context->cf);
free_error_table (context->et_list); free_error_table (context->et_list);
free(context->cc_ops); free(rk_UNCONST(context->cc_ops));
free(context->kt_types); free(context->kt_types);
krb5_clear_error_message(context); krb5_clear_error_message(context);
if(context->warn_dest != NULL) if(context->warn_dest != NULL)