From fd97cdc9bec307716857b255ce0c36ee23bca971 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 3 Sep 2002 19:29:37 +0000 Subject: [PATCH] protoize git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14816 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ChangeLog | 20 ++++++++++++++++++ src/lib/krb5/os/accessor.c | 4 +--- src/lib/krb5/os/an_to_ln.c | 38 +++++++--------------------------- src/lib/krb5/os/c_ustime.c | 5 +---- src/lib/krb5/os/ccdefname.c | 7 ++----- src/lib/krb5/os/changepw.c | 9 +------- src/lib/krb5/os/def_realm.c | 12 +++-------- src/lib/krb5/os/free_hstrl.c | 4 +--- src/lib/krb5/os/free_krbhs.c | 4 +--- src/lib/krb5/os/full_ipadr.c | 7 ++----- src/lib/krb5/os/gen_port.c | 6 +----- src/lib/krb5/os/gen_rname.c | 6 +----- src/lib/krb5/os/genaddrs.c | 6 +----- src/lib/krb5/os/get_krbhst.c | 5 +---- src/lib/krb5/os/gmt_mktime.c | 3 +-- src/lib/krb5/os/hostaddr.c | 5 +---- src/lib/krb5/os/hst_realm.c | 15 +++++--------- src/lib/krb5/os/init_os_ctx.c | 33 +++++++++-------------------- src/lib/krb5/os/krbfileio.c | 8 ++----- src/lib/krb5/os/ktdefname.c | 5 +---- src/lib/krb5/os/kuserok.c | 5 +---- src/lib/krb5/os/localaddr.c | 12 +++++------ src/lib/krb5/os/locate_kdc.c | 26 +++++++---------------- src/lib/krb5/os/lock_file.c | 7 ++----- src/lib/krb5/os/mk_faddr.c | 6 +----- src/lib/krb5/os/net_read.c | 6 +----- src/lib/krb5/os/net_write.c | 6 +----- src/lib/krb5/os/port2ip.c | 6 +----- src/lib/krb5/os/prompter.c | 10 +++------ src/lib/krb5/os/promptusr.c | 11 +++------- src/lib/krb5/os/read_msg.c | 5 +---- src/lib/krb5/os/read_pwd.c | 10 ++------- src/lib/krb5/os/realm_dom.c | 5 +---- src/lib/krb5/os/realm_iter.c | 17 ++++----------- src/lib/krb5/os/sendto_kdc.c | 11 +++------- src/lib/krb5/os/sn2princ.c | 7 +------ src/lib/krb5/os/t_an_to_ln.c | 4 +--- src/lib/krb5/os/t_gifconf.c | 2 +- src/lib/krb5/os/t_locate_kdc.c | 2 +- src/lib/krb5/os/t_realm_iter.c | 6 ++---- src/lib/krb5/os/t_std_conf.c | 37 +++++++++------------------------ src/lib/krb5/os/timeofday.c | 8 +------ src/lib/krb5/os/toffset.c | 19 +++++------------ src/lib/krb5/os/unlck_file.c | 4 +--- src/lib/krb5/os/ustime.c | 5 +---- src/lib/krb5/os/write_msg.c | 5 +---- 46 files changed, 124 insertions(+), 320 deletions(-) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index e9063add7..02952e965 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,23 @@ +2002-09-03 Ken Raeburn + + * accessor.c, an_to_ln.c, c_ustime.c, ccdefname.c, changepw.c, + def_realm.c, free_hstrl.c, free_krbhs.c, full_ipadr.c, gen_port.c, + gen_rname.c, genaddrs.c, get_krbhst.c, gmt_mktime.c, hostaddr.c, + hst_realm.c, init_os_ctx.c, krbfileio.c, ktdefname.c, kuserok.c, + localaddr.c, locate_kdc.c, lock_file.c, mk_faddr.c, net_read.c, + net_write.c, port2ip.c, prompter.c, promptusr.c, read_msg.c, + read_pwd.c, realm_dom.c, realm_iter.c, sendto_kdc.c, sn2princ.c, + t_an_to_ln.c, t_gifconf.c, t_locate_kdc.c, t_realm_iter.c, + t_std_conf.c, timeofday.c, toffset.c, unlck_file.c, ustime.c, + write_msg.c: Use prototype-style function definitions. + + * c_ustime.c, timeofday.c: Don't declare errno. + * hst_realm.c (krb5_try_realm_txt_rr), locate_kdc.c + (krb5_locate_srv_dns_1): Avoid variable name "class". + * lock_file.c (krb5_lock_file): Initialize flock_zero. + * sendto_kdc.c (enum conn_states): Define separately from + conn_state 'state' field declaration. + 2002-08-29 Ken Raeburn * Makefile.in: Revert $(S)=>/ change, for Windows support. diff --git a/src/lib/krb5/os/accessor.c b/src/lib/krb5/os/accessor.c index 60f0262fe..400892405 100644 --- a/src/lib/krb5/os/accessor.c +++ b/src/lib/krb5/os/accessor.c @@ -30,9 +30,7 @@ #include "os-proto.h" krb5_error_code KRB5_CALLCONV -krb5int_accessor(internals, version) - krb5int_access* internals; - krb5_int32 version; +krb5int_accessor(krb5int_access *internals, krb5_int32 version) { if (version == KRB5INT_ACCESS_VERSION) { diff --git a/src/lib/krb5/os/an_to_ln.c b/src/lib/krb5/os/an_to_ln.c index 2a8db64ff..426399e14 100644 --- a/src/lib/krb5/os/an_to_ln.c +++ b/src/lib/krb5/os/an_to_ln.c @@ -63,8 +63,7 @@ * Find the portion of the flattened principal name that we use for mapping. */ static char * -aname_full_to_mapping_name(fprincname) - char *fprincname; +aname_full_to_mapping_name(char *fprincname) { char *atp; size_t mlen; @@ -196,9 +195,7 @@ db_an_to_ln(context, dbname, aname, lnsize, lname) * If no re_comp() or regcomp(), then always return a match. */ static krb5_error_code -aname_do_match(string, contextp) - char *string; - char **contextp; +aname_do_match(char *string, char **contextp) { krb5_error_code kret; char *regexp, *startp, *endp = 0; @@ -274,12 +271,7 @@ aname_do_match(string, contextp) * string. */ static void -do_replacement(regexp, repl, doall, in, out) - char *regexp; - char *repl; - int doall; - char *in; - char *out; +do_replacement(char *regexp, char *repl, int doall, char *in, char *out) { #if HAVE_REGCOMP regex_t match_exp; @@ -357,10 +349,7 @@ do_replacement(regexp, repl, doall, in, out) * This routine enforces the "s///[g]" syntax. */ static krb5_error_code -aname_replacer(string, contextp, result) - char *string; - char **contextp; - char **result; +aname_replacer(char *string, char **contextp, char **result) { krb5_error_code kret; char *in; @@ -463,12 +452,7 @@ aname_replacer(string, contextp, result) * the principal name. */ static krb5_error_code -rule_an_to_ln(context, rule, aname, lnsize, lname) - krb5_context context; - char * rule; - krb5_const_principal aname; - const unsigned int lnsize; - char * lname; +rule_an_to_ln(krb5_context context, char *rule, krb5_const_principal aname, const unsigned int lnsize, char *lname) { krb5_error_code kret; char *current; @@ -594,11 +578,7 @@ rule_an_to_ln(context, rule, aname, lnsize, lname) * that name is returned as the lname. */ static krb5_error_code -default_an_to_ln(context, aname, lnsize, lname) - krb5_context context; - krb5_const_principal aname; - const unsigned int lnsize; - char *lname; +default_an_to_ln(krb5_context context, krb5_const_principal aname, const unsigned int lnsize, char *lname) { krb5_error_code retval; char *def_realm; @@ -654,11 +634,7 @@ default_an_to_ln(context, aname, lnsize, lname) */ krb5_error_code KRB5_CALLCONV -krb5_aname_to_localname(context, aname, lnsize_in, lname) - krb5_context context; - krb5_const_principal aname; - const int lnsize_in; - char *lname; +krb5_aname_to_localname(krb5_context context, krb5_const_principal aname, const int lnsize_in, char *lname) { krb5_error_code kret; char *realm; diff --git a/src/lib/krb5/os/c_ustime.c b/src/lib/krb5/os/c_ustime.c index 02205014c..e099f6a8c 100644 --- a/src/lib/krb5/os/c_ustime.c +++ b/src/lib/krb5/os/c_ustime.c @@ -175,13 +175,10 @@ register krb5_int32 *seconds, *microseconds; /* We're a Unix machine -- do Unix time things. */ -extern int errno; - static struct timeval last_tv = {0, 0}; krb5_error_code -krb5_crypto_us_timeofday(seconds, microseconds) - register krb5_int32 *seconds, *microseconds; +krb5_crypto_us_timeofday(register krb5_int32 *seconds, register krb5_int32 *microseconds) { struct timeval tv; diff --git a/src/lib/krb5/os/ccdefname.c b/src/lib/krb5/os/ccdefname.c index fb6af2fb5..743145d75 100644 --- a/src/lib/krb5/os/ccdefname.c +++ b/src/lib/krb5/os/ccdefname.c @@ -231,9 +231,7 @@ static krb5_error_code get_from_os(char *name_buf, int name_size) #endif krb5_error_code KRB5_CALLCONV -krb5_cc_set_default_name(context, name) - krb5_context context; - const char *name; +krb5_cc_set_default_name(krb5_context context, const char *name) { char name_buf[1024]; char *new_name; @@ -277,8 +275,7 @@ krb5_cc_set_default_name(context, name) const char * KRB5_CALLCONV -krb5_cc_default_name(context) - krb5_context context; +krb5_cc_default_name(krb5_context context) { krb5_os_context os_ctx; diff --git a/src/lib/krb5/os/changepw.c b/src/lib/krb5/os/changepw.c index 6ef9badb5..ce9ca122f 100644 --- a/src/lib/krb5/os/changepw.c +++ b/src/lib/krb5/os/changepw.c @@ -71,14 +71,7 @@ krb5_locate_kpasswd(krb5_context context, const krb5_data *realm, krb5_error_code KRB5_CALLCONV -krb5_change_password(context, creds, newpw, result_code, - result_code_string, result_string) - krb5_context context; - krb5_creds *creds; - char *newpw; - int *result_code; - krb5_data *result_code_string; - krb5_data *result_string; +krb5_change_password(krb5_context context, krb5_creds *creds, char *newpw, int *result_code, krb5_data *result_code_string, krb5_data *result_string) { krb5_auth_context auth_context; krb5_data ap_req, chpw_req, chpw_rep; diff --git a/src/lib/krb5/os/def_realm.c b/src/lib/krb5/os/def_realm.c index 0f0a40ad8..d63f1af63 100644 --- a/src/lib/krb5/os/def_realm.c +++ b/src/lib/krb5/os/def_realm.c @@ -69,9 +69,7 @@ */ krb5_error_code KRB5_CALLCONV -krb5_get_default_realm(context, lrealm) - krb5_context context; - char **lrealm; +krb5_get_default_realm(krb5_context context, char **lrealm) { char *realm = 0; char *cp; @@ -164,9 +162,7 @@ krb5_get_default_realm(context, lrealm) } krb5_error_code KRB5_CALLCONV -krb5_set_default_realm(context, lrealm) - krb5_context context; - const char *lrealm; +krb5_set_default_realm(krb5_context context, const char *lrealm) { if (!context || (context->magic != KV5M_CONTEXT)) return KV5M_CONTEXT; @@ -191,9 +187,7 @@ krb5_set_default_realm(context, lrealm) } void KRB5_CALLCONV -krb5_free_default_realm(context, lrealm) - krb5_context context; - char *lrealm; +krb5_free_default_realm(krb5_context context, char *lrealm) { free (lrealm); } diff --git a/src/lib/krb5/os/free_hstrl.c b/src/lib/krb5/os/free_hstrl.c index 026cb28b8..4900fce9b 100644 --- a/src/lib/krb5/os/free_hstrl.c +++ b/src/lib/krb5/os/free_hstrl.c @@ -35,9 +35,7 @@ */ krb5_error_code KRB5_CALLCONV -krb5_free_host_realm(context, realmlist) - krb5_context context; - char * const *realmlist; +krb5_free_host_realm(krb5_context context, char *const *realmlist) { /* same format, so why duplicate code? */ return krb5_free_krbhst(context, realmlist); diff --git a/src/lib/krb5/os/free_krbhs.c b/src/lib/krb5/os/free_krbhs.c index ceb37650d..a10db910c 100644 --- a/src/lib/krb5/os/free_krbhs.c +++ b/src/lib/krb5/os/free_krbhs.c @@ -34,9 +34,7 @@ */ krb5_error_code -krb5_free_krbhst(context, hostlist) - krb5_context context; - char * const *hostlist; +krb5_free_krbhst(krb5_context context, char *const *hostlist) { register char * const *cp; diff --git a/src/lib/krb5/os/full_ipadr.c b/src/lib/krb5/os/full_ipadr.c index c22ac1bd6..b3da60866 100644 --- a/src/lib/krb5/os/full_ipadr.c +++ b/src/lib/krb5/os/full_ipadr.c @@ -35,11 +35,8 @@ #include "os-proto.h" krb5_error_code -krb5_make_full_ipaddr(context, adr, port, outaddr) - krb5_context context; - krb5_int32 adr; - krb5_int16 port; - krb5_address ** outaddr; +krb5_make_full_ipaddr(krb5_context context, krb5_int32 adr, + /*krb5_int16*/int port, krb5_address **outaddr) { unsigned long smushaddr = (unsigned long) adr; /* already in net order */ unsigned short smushport = (unsigned short) port; /* ditto */ diff --git a/src/lib/krb5/os/gen_port.c b/src/lib/krb5/os/gen_port.c index 09c83fb71..4832cec19 100644 --- a/src/lib/krb5/os/gen_port.c +++ b/src/lib/krb5/os/gen_port.c @@ -31,11 +31,7 @@ #include "os-proto.h" krb5_error_code -krb5_gen_portaddr(context, addr, ptr, outaddr) - krb5_context context; - const krb5_address *addr; - krb5_const_pointer ptr; - krb5_address **outaddr; +krb5_gen_portaddr(krb5_context context, const krb5_address *addr, krb5_const_pointer ptr, krb5_address **outaddr) { #ifdef HAVE_NETINET_IN_H krb5_int32 adr; diff --git a/src/lib/krb5/os/gen_rname.c b/src/lib/krb5/os/gen_rname.c index 84b35503f..d5669cf37 100644 --- a/src/lib/krb5/os/gen_rname.c +++ b/src/lib/krb5/os/gen_rname.c @@ -33,11 +33,7 @@ #include "os-proto.h" krb5_error_code -krb5_gen_replay_name(context, address, uniq, string) - krb5_context context; - const krb5_address * address; - const char * uniq; - char ** string; +krb5_gen_replay_name(krb5_context context, const krb5_address *address, const char *uniq, char **string) { char * tmp; int i; diff --git a/src/lib/krb5/os/genaddrs.c b/src/lib/krb5/os/genaddrs.c index efd5762bd..b85d9d8e5 100644 --- a/src/lib/krb5/os/genaddrs.c +++ b/src/lib/krb5/os/genaddrs.c @@ -81,11 +81,7 @@ static void *cvtaddr (struct sockaddr_storage *a, struct addrpair *ap) } krb5_error_code KRB5_CALLCONV -krb5_auth_con_genaddrs(context, auth_context, infd, flags) - krb5_context context; - krb5_auth_context auth_context; - int infd; - int flags; +krb5_auth_con_genaddrs(krb5_context context, krb5_auth_context auth_context, int infd, int flags) { krb5_error_code retval; krb5_address * laddr; diff --git a/src/lib/krb5/os/get_krbhst.c b/src/lib/krb5/os/get_krbhst.c index 75f4c56af..31c77af6f 100644 --- a/src/lib/krb5/os/get_krbhst.c +++ b/src/lib/krb5/os/get_krbhst.c @@ -58,10 +58,7 @@ */ krb5_error_code -krb5_get_krbhst(context, realm, hostlist) - krb5_context context; - const krb5_data *realm; - char ***hostlist; +krb5_get_krbhst(krb5_context context, const krb5_data *realm, char ***hostlist) { char **values, **cpp, *cp; const char *realm_kdc_names[4]; diff --git a/src/lib/krb5/os/gmt_mktime.c b/src/lib/krb5/os/gmt_mktime.c index d0053adfd..3d10e1a4e 100644 --- a/src/lib/krb5/os/gmt_mktime.c +++ b/src/lib/krb5/os/gmt_mktime.c @@ -36,8 +36,7 @@ static const int days_in_month[12] = { #define hasleapday(year) (year%400?(year%100?(year%4?0:1):0):1) -time_t gmt_mktime(t) - struct tm* t; +time_t gmt_mktime(struct tm *t) { time_t accum; diff --git a/src/lib/krb5/os/hostaddr.c b/src/lib/krb5/os/hostaddr.c index 55f46bdfa..8dcc05758 100644 --- a/src/lib/krb5/os/hostaddr.c +++ b/src/lib/krb5/os/hostaddr.c @@ -33,10 +33,7 @@ #include "fake-addrinfo.h" krb5_error_code -krb5_os_hostaddr(context, name, ret_addrs) - krb5_context context; - const char *name; - krb5_address ***ret_addrs; +krb5_os_hostaddr(krb5_context context, const char *name, krb5_address ***ret_addrs) { krb5_error_code retval; krb5_address **addrs; diff --git a/src/lib/krb5/os/hst_realm.c b/src/lib/krb5/os/hst_realm.c index a53bed908..5c89c310e 100644 --- a/src/lib/krb5/os/hst_realm.c +++ b/src/lib/krb5/os/hst_realm.c @@ -105,9 +105,7 @@ */ krb5_error_code -krb5_try_realm_txt_rr(prefix, name, realm) - const char *prefix, *name; - char **realm; +krb5_try_realm_txt_rr(const char *prefix, const char *name, char **realm) { union { unsigned char bytes[2048]; @@ -116,7 +114,7 @@ krb5_try_realm_txt_rr(prefix, name, realm) unsigned char *p; char host[MAX_DNS_NAMELEN], *h; int size; - int type, class, numanswers, numqueries, rdlen, len; + int type, rrclass, numanswers, numqueries, rdlen, len; /* * Form our query, and send it via DNS @@ -197,7 +195,7 @@ krb5_try_realm_txt_rr(prefix, name, realm) /* Next is the query class; also skip over 4 byte TTL */ CHECK(p,6); - class = NTOHSP(p,6); + rrclass = NTOHSP(p,6); /* Record data length - make sure we aren't truncated */ @@ -213,7 +211,7 @@ krb5_try_realm_txt_rr(prefix, name, realm) */ /* XXX What about flagging multiple TXT records as an error? */ - if (class == C_IN && type == T_TXT) { + if (rrclass == C_IN && type == T_TXT) { len = *p++; if (p + len > answer.bytes + size) return KRB5_ERR_HOST_REALM_UNKNOWN; @@ -268,10 +266,7 @@ krb5int_get_fq_local_hostname (char *buf, size_t bufsiz) } krb5_error_code KRB5_CALLCONV -krb5_get_host_realm(context, host, realmsp) - krb5_context context; - const char *host; - char ***realmsp; +krb5_get_host_realm(krb5_context context, const char *host, char ***realmsp) { char **retrealms; char *default_realm, *realm, *cp, *temp_realm; diff --git a/src/lib/krb5/os/init_os_ctx.c b/src/lib/krb5/os/init_os_ctx.c index a7dba4ead..793a8f2c0 100644 --- a/src/lib/krb5/os/init_os_ctx.c +++ b/src/lib/krb5/os/init_os_ctx.c @@ -165,8 +165,7 @@ get_from_registry( #endif /* _WIN32 */ static void -free_filespecs(files) - profile_filespec_t *files; +free_filespecs(profile_filespec_t *files) { #if !TARGET_OS_MAC char **cp; @@ -181,9 +180,7 @@ free_filespecs(files) } static krb5_error_code -os_get_default_config_files(pfiles, secure) - profile_filespec_t ** pfiles; - krb5_boolean secure; +os_get_default_config_files(profile_filespec_t **pfiles, krb5_boolean secure) { profile_filespec_t* files; #if defined(_WIN32) @@ -281,8 +278,7 @@ os_get_default_config_files(pfiles, secure) do not include user paths (from environment variables, etc.) */ static krb5_error_code -os_init_paths(ctx) - krb5_context ctx; +os_init_paths(krb5_context ctx) { krb5_error_code retval = 0; profile_filespec_t *files = 0; @@ -328,8 +324,7 @@ os_init_paths(ctx) } krb5_error_code -krb5_os_init_context(ctx) - krb5_context ctx; +krb5_os_init_context(krb5_context ctx) { krb5_os_context os_ctx; krb5_error_code retval = 0; @@ -364,9 +359,7 @@ krb5_os_init_context(ctx) } krb5_error_code KRB5_CALLCONV -krb5_get_profile (ctx, profile) - krb5_context ctx; - profile_t* profile; +krb5_get_profile (krb5_context ctx, profile_t *profile) { krb5_error_code retval = 0; profile_filespec_t *files = 0; @@ -396,9 +389,7 @@ krb5_get_profile (ctx, profile) krb5_error_code -krb5_set_config_files(ctx, filenames) - krb5_context ctx; - const char **filenames; +krb5_set_config_files(krb5_context ctx, const char **filenames) { krb5_error_code retval; profile_t profile; @@ -415,8 +406,7 @@ krb5_set_config_files(ctx, filenames) } krb5_error_code KRB5_CALLCONV -krb5_get_default_config_files(pfilenames) - char ***pfilenames; +krb5_get_default_config_files(char ***pfilenames) { if (!pfilenames) return EINVAL; @@ -424,16 +414,14 @@ krb5_get_default_config_files(pfilenames) } void KRB5_CALLCONV -krb5_free_config_files(filenames) - char **filenames; +krb5_free_config_files(char **filenames) { free_filespecs(filenames); } krb5_error_code -krb5_secure_config_files(ctx) - krb5_context ctx; +krb5_secure_config_files(krb5_context ctx) { /* Obsolete interface; always return an error. @@ -455,8 +443,7 @@ krb5_secure_config_files(ctx) } void -krb5_os_free_context(ctx) - krb5_context ctx; +krb5_os_free_context(krb5_context ctx) { krb5_os_context os_ctx; diff --git a/src/lib/krb5/os/krbfileio.c b/src/lib/krb5/os/krbfileio.c index 14e086d20..57b659e54 100644 --- a/src/lib/krb5/os/krbfileio.c +++ b/src/lib/krb5/os/krbfileio.c @@ -53,9 +53,7 @@ static char *VersionID = "@(#)krbfileio.c 2 - 08/22/91"; #endif krb5_error_code -krb5_create_secure_file(context, pathname) - krb5_context context; - const char * pathname; +krb5_create_secure_file(krb5_context context, const char *pathname) { int fd; @@ -92,9 +90,7 @@ krb5_create_secure_file(context, pathname) } krb5_error_code -krb5_sync_disk_file(context, fp) - krb5_context context; - FILE *fp; +krb5_sync_disk_file(krb5_context context, FILE *fp) { fflush(fp); #if !defined(MSDOS_FILESYSTEM) && !defined(macintosh) diff --git a/src/lib/krb5/os/ktdefname.c b/src/lib/krb5/os/ktdefname.c index 18ae376c6..62465f102 100644 --- a/src/lib/krb5/os/ktdefname.c +++ b/src/lib/krb5/os/ktdefname.c @@ -37,10 +37,7 @@ extern char *krb5_defkeyname; char *krb5_overridekeyname = NULL; krb5_error_code KRB5_CALLCONV -krb5_kt_default_name(context, name, namesize) - krb5_context context; - char *name; - int namesize; +krb5_kt_default_name(krb5_context context, char *name, int namesize) { char *cp = 0; char *retval; diff --git a/src/lib/krb5/os/kuserok.c b/src/lib/krb5/os/kuserok.c index b34727cf4..bc4f82412 100644 --- a/src/lib/krb5/os/kuserok.c +++ b/src/lib/krb5/os/kuserok.c @@ -60,10 +60,7 @@ */ krb5_boolean KRB5_CALLCONV -krb5_kuserok(context, principal, luser) - krb5_context context; - krb5_principal principal; - const char *luser; +krb5_kuserok(krb5_context context, krb5_principal principal, const char *luser) { struct stat sbuf; struct passwd *pwd; diff --git a/src/lib/krb5/os/localaddr.c b/src/lib/krb5/os/localaddr.c index 76b1a18a6..6a4f33725 100644 --- a/src/lib/krb5/os/localaddr.c +++ b/src/lib/krb5/os/localaddr.c @@ -244,7 +244,7 @@ krb5_os_localaddr_profile (krb5_context context, struct localaddr_data *datap) return 0; for (iter = values; *iter; iter++) { - char *cp = *iter, *next, *this; + char *cp = *iter, *next, *current; int i, count; #ifdef DEBUG @@ -260,7 +260,7 @@ krb5_os_localaddr_profile (krb5_context context, struct localaddr_data *datap) #ifdef DEBUG fprintf (stderr, " addr found in '%s'\n", cp); #endif - this = cp; + current = cp; while (*cp != 0 && !isspace((int) *cp) && *cp != ',') cp++; if (*cp != 0) { @@ -270,10 +270,10 @@ krb5_os_localaddr_profile (krb5_context context, struct localaddr_data *datap) next = cp; /* Got a single address, process it. */ #ifdef DEBUG - fprintf (stderr, " processing '%s'\n", this); + fprintf (stderr, " processing '%s'\n", current); #endif newaddrs = 0; - err = krb5_os_hostaddr (context, this, &newaddrs); + err = krb5_os_hostaddr (context, current, &newaddrs); if (err) continue; for (i = 0; newaddrs[i]; i++) { @@ -309,9 +309,7 @@ krb5_os_localaddr_profile (krb5_context context, struct localaddr_data *datap) } krb5_error_code KRB5_CALLCONV -krb5_os_localaddr(context, addr) - krb5_context context; - krb5_address ***addr; +krb5_os_localaddr(krb5_context context, krb5_address ***addr) { return get_localaddrs(context, addr, 1); } diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c index ac64ce04f..bcf20912a 100644 --- a/src/lib/krb5/os/locate_kdc.c +++ b/src/lib/krb5/os/locate_kdc.c @@ -64,10 +64,7 @@ #endif static int -maybe_use_dns (context, name, defalt) - krb5_context context; - const char *name; - int defalt; +maybe_use_dns (krb5_context context, const char *name, int defalt) { krb5_error_code code; char * value = NULL; @@ -90,15 +87,13 @@ maybe_use_dns (context, name, defalt) } int -_krb5_use_dns_kdc(context) - krb5_context context; +_krb5_use_dns_kdc(krb5_context context) { return maybe_use_dns (context, "dns_lookup_kdc", DEFAULT_LOOKUP_KDC); } int -_krb5_use_dns_realm(context) - krb5_context context; +_krb5_use_dns_realm(krb5_context context) { return maybe_use_dns (context, "dns_lookup_realm", DEFAULT_LOOKUP_REALM); } @@ -464,14 +459,7 @@ krb5_locate_srv_conf_1(krb5_context context, const krb5_data *realm, #ifdef TEST static krb5_error_code -krb5_locate_srv_conf(context, realm, name, al, get_masters, - udpport, sec_udpport) - krb5_context context; - const krb5_data *realm; - const char * name; - struct addrlist *al; - int get_masters; - int udpport, sec_udpport; +krb5_locate_srv_conf(krb5_context context, const krb5_data *realm, const char *name, struct addrlist *al, int get_masters, int udpport, int sec_udpport) { krb5_error_code ret; @@ -503,7 +491,7 @@ krb5_locate_srv_dns_1 (const krb5_data *realm, } answer; unsigned char *p=NULL; char host[MAX_DNS_NAMELEN], *h; - int type, class; + int type, rrclass; int priority, weight, size, len, numanswers, numqueries, rdlen; unsigned short port; const int hdrsize = sizeof(HEADER); @@ -620,7 +608,7 @@ krb5_locate_srv_dns_1 (const krb5_data *realm, /* Next is the query class; also skip over 4 byte TTL */ CHECK(p, 6); - class = NTOHSP(p,6); + rrclass = NTOHSP(p,6); /* Record data length */ @@ -636,7 +624,7 @@ krb5_locate_srv_dns_1 (const krb5_data *realm, * Server name */ - if (class == C_IN && type == T_SRV) { + if (rrclass == C_IN && type == T_SRV) { CHECK(p,2); priority = NTOHSP(p,2); CHECK(p, 2); diff --git a/src/lib/krb5/os/lock_file.c b/src/lib/krb5/os/lock_file.c index 49dcc08dc..32155c47f 100644 --- a/src/lib/krb5/os/lock_file.c +++ b/src/lib/krb5/os/lock_file.c @@ -62,16 +62,13 @@ /*ARGSUSED*/ krb5_error_code -krb5_lock_file(context, fd, mode) - krb5_context context; - int fd; - int mode; +krb5_lock_file(krb5_context context, int fd, int mode) { int lock_flag = -1; krb5_error_code retval = 0; #ifdef POSIX_FILE_LOCKS int lock_cmd = F_SETLKW; - static const struct flock flock_zero; + static const struct flock flock_zero = { 0 }; struct flock lock_arg; lock_arg = flock_zero; diff --git a/src/lib/krb5/os/mk_faddr.c b/src/lib/krb5/os/mk_faddr.c index d40e42ca4..fd081af58 100644 --- a/src/lib/krb5/os/mk_faddr.c +++ b/src/lib/krb5/os/mk_faddr.c @@ -39,11 +39,7 @@ #endif krb5_error_code -krb5_make_fulladdr(context, kaddr, kport, raddr) - krb5_context context; - krb5_address * kaddr; - krb5_address * kport; - krb5_address * raddr; +krb5_make_fulladdr(krb5_context context, krb5_address *kaddr, krb5_address *kport, krb5_address *raddr) { register krb5_octet * marshal; krb5_int32 tmp32; diff --git a/src/lib/krb5/os/net_read.c b/src/lib/krb5/os/net_read.c index bea2b7bba..372609d86 100644 --- a/src/lib/krb5/os/net_read.c +++ b/src/lib/krb5/os/net_read.c @@ -40,11 +40,7 @@ */ int -krb5_net_read(context, fd, buf, len) - krb5_context context; - int fd; - register char *buf; - register int len; +krb5_net_read(krb5_context context, int fd, register char *buf, register int len) { int cc, len2 = 0; diff --git a/src/lib/krb5/os/net_write.c b/src/lib/krb5/os/net_write.c index e3c2eeceb..9d932a453 100644 --- a/src/lib/krb5/os/net_write.c +++ b/src/lib/krb5/os/net_write.c @@ -39,11 +39,7 @@ */ int -krb5_net_write(context, fd, buf, len) - krb5_context context; - int fd; - register const char *buf; - int len; +krb5_net_write(krb5_context context, int fd, register const char *buf, int len) { int cc; register int wrlen = len; diff --git a/src/lib/krb5/os/port2ip.c b/src/lib/krb5/os/port2ip.c index ba3fb9bd0..e5e8b68ae 100644 --- a/src/lib/krb5/os/port2ip.c +++ b/src/lib/krb5/os/port2ip.c @@ -34,11 +34,7 @@ #include "os-proto.h" krb5_error_code -krb5_unpack_full_ipaddr(context, inaddr, adr, port) - krb5_context context; - const krb5_address *inaddr; - krb5_int32 *adr; - krb5_int16 *port; +krb5_unpack_full_ipaddr(krb5_context context, const krb5_address *inaddr, krb5_int32 *adr, krb5_int16 *port) { unsigned long smushaddr; unsigned short smushport; diff --git a/src/lib/krb5/os/prompter.c b/src/lib/krb5/os/prompter.c index f3e3e20d8..21292944e 100644 --- a/src/lib/krb5/os/prompter.c +++ b/src/lib/krb5/os/prompter.c @@ -15,8 +15,7 @@ static jmp_buf pwd_jump; static krb5_sigtype -intr_routine(signo) - int signo; +intr_routine(int signo) { longjmp(pwd_jump, 1); /*NOTREACHED*/ @@ -243,17 +242,14 @@ krb5_prompter_posix(krb5_context context, #endif /* Windows or Mac */ void -krb5int_set_prompt_types(context, types) - krb5_context context; - krb5_prompt_type *types; +krb5int_set_prompt_types(krb5_context context, krb5_prompt_type *types) { context->prompt_types = types; } krb5_prompt_type* KRB5_CALLCONV -krb5_get_prompt_types(context) - krb5_context context; +krb5_get_prompt_types(krb5_context context) { return context->prompt_types; } diff --git a/src/lib/krb5/os/promptusr.c b/src/lib/krb5/os/promptusr.c index 1e862b525..b32cdff0d 100644 --- a/src/lib/krb5/os/promptusr.c +++ b/src/lib/krb5/os/promptusr.c @@ -29,17 +29,14 @@ typedef struct _krb5_uio { static jmp_buf pwd_jump; static krb5_sigtype -intr_routine(signo) - int signo; +intr_routine(int signo) { longjmp(pwd_jump, 1); /*NOTREACHED*/ } krb5_error_code -krb5_os_get_tty_uio(context, uio) - krb5_context context; - krb5_uio uio; +krb5_os_get_tty_uio(krb5_context context, krb5_uio uio) { volatile krb5_error_code retval; krb5_sigtype (*volatile ointrfunc)(); @@ -126,9 +123,7 @@ krb5_os_get_tty_uio(context, uio) } void -krb5_free_uio(context, uio) - krb5_context context; - krb5_uio uio; +krb5_free_uio(krb5_context context, krb5_uio uio) { krb5_uio p, next; diff --git a/src/lib/krb5/os/read_msg.c b/src/lib/krb5/os/read_msg.c index 524996fa9..4eb5b2e2a 100644 --- a/src/lib/krb5/os/read_msg.c +++ b/src/lib/krb5/os/read_msg.c @@ -32,10 +32,7 @@ #include krb5_error_code -krb5_read_message(context, fdp, inbuf) - krb5_context context; - krb5_pointer fdp; - krb5_data *inbuf; +krb5_read_message(krb5_context context, krb5_pointer fdp, krb5_data *inbuf) { krb5_int32 len; int len2, ilen; diff --git a/src/lib/krb5/os/read_pwd.c b/src/lib/krb5/os/read_pwd.c index 557e3b65c..4b60bafbf 100644 --- a/src/lib/krb5/os/read_pwd.c +++ b/src/lib/krb5/os/read_pwd.c @@ -43,20 +43,14 @@ static jmp_buf pwd_jump; static krb5_sigtype -intr_routine(signo) - int signo; +intr_routine(int signo) { longjmp(pwd_jump, 1); /*NOTREACHED*/ } krb5_error_code -krb5_read_password(context, prompt, prompt2, return_pwd, size_return) - krb5_context context; - const char *prompt; - const char *prompt2; - char *return_pwd; - unsigned int *size_return; +krb5_read_password(krb5_context context, const char *prompt, const char *prompt2, char *return_pwd, unsigned int *size_return) { /* adapted from Kerberos v4 des/read_password.c */ /* readin_string is used after a longjmp, so must be volatile */ diff --git a/src/lib/krb5/os/realm_dom.c b/src/lib/krb5/os/realm_dom.c index 2300e15c2..d7a4be7db 100644 --- a/src/lib/krb5/os/realm_dom.c +++ b/src/lib/krb5/os/realm_dom.c @@ -46,10 +46,7 @@ #include krb5_error_code KRB5_CALLCONV -krb5_get_realm_domain(context, realm, domain) - krb5_context context; - const char *realm; - char **domain; +krb5_get_realm_domain(krb5_context context, const char *realm, char **domain) { krb5_error_code retval; char *temp_domain = 0; diff --git a/src/lib/krb5/os/realm_iter.c b/src/lib/krb5/os/realm_iter.c index 82d97337e..26b22248e 100644 --- a/src/lib/krb5/os/realm_iter.c +++ b/src/lib/krb5/os/realm_iter.c @@ -31,9 +31,7 @@ #include krb5_error_code KRB5_CALLCONV -krb5_realm_iterator_create(context, iter_p) - krb5_context context; - void **iter_p; +krb5_realm_iterator_create(krb5_context context, void **iter_p) { static const char *names[] = { "realms", 0 }; @@ -44,26 +42,19 @@ krb5_realm_iterator_create(context, iter_p) } krb5_error_code KRB5_CALLCONV -krb5_realm_iterator(context, iter_p, ret_realm) - krb5_context context; - void **iter_p; - char **ret_realm; +krb5_realm_iterator(krb5_context context, void **iter_p, char **ret_realm) { return profile_iterator(iter_p, ret_realm, 0); } void KRB5_CALLCONV -krb5_realm_iterator_free(context, iter_p) - krb5_context context; - void **iter_p; +krb5_realm_iterator_free(krb5_context context, void **iter_p) { profile_iterator_free(iter_p); } void KRB5_CALLCONV -krb5_free_realm_string(context, str) - krb5_context context; - char *str; +krb5_free_realm_string(krb5_context context, char *str) { profile_release_string(str); } diff --git a/src/lib/krb5/os/sendto_kdc.c b/src/lib/krb5/os/sendto_kdc.c index fff77c1df..47103464c 100644 --- a/src/lib/krb5/os/sendto_kdc.c +++ b/src/lib/krb5/os/sendto_kdc.c @@ -227,13 +227,7 @@ merge_addrlists (struct addrlist *dest, struct addrlist *src) */ krb5_error_code -krb5_sendto_kdc (context, message, realm, reply, use_master, tcp_only) - krb5_context context; - const krb5_data * message; - const krb5_data * realm; - krb5_data * reply; - int use_master; - int tcp_only; +krb5_sendto_kdc (krb5_context context, const krb5_data *message, const krb5_data *realm, krb5_data *reply, int use_master, int tcp_only) { krb5_error_code retval; struct addrlist addrs; @@ -353,10 +347,11 @@ static char *bogus_strerror (int xerr) static const char *state_strings[] = { "INITIALIZING", "CONNECTING", "WRITING", "READING", "FAILED" }; +enum conn_states { INITIALIZING, CONNECTING, WRITING, READING, FAILED }; struct conn_state { SOCKET fd; krb5_error_code err; - enum { INITIALIZING, CONNECTING, WRITING, READING, FAILED } state; + enum conn_states state; unsigned int is_udp : 1; struct addrinfo *addr; struct { diff --git a/src/lib/krb5/os/sn2princ.c b/src/lib/krb5/os/sn2princ.c index ccbc52c5b..240f14e90 100644 --- a/src/lib/krb5/os/sn2princ.c +++ b/src/lib/krb5/os/sn2princ.c @@ -37,12 +37,7 @@ #endif krb5_error_code KRB5_CALLCONV -krb5_sname_to_principal(context, hostname, sname, type, ret_princ) - krb5_context context; - const char * hostname; - const char * sname; - krb5_int32 type; - krb5_principal * ret_princ; +krb5_sname_to_principal(krb5_context context, const char *hostname, const char *sname, krb5_int32 type, krb5_principal *ret_princ) { char **hrealms, *realm, *remote_host; krb5_error_code retval; diff --git a/src/lib/krb5/os/t_an_to_ln.c b/src/lib/krb5/os/t_an_to_ln.c index a1569e948..93933a477 100644 --- a/src/lib/krb5/os/t_an_to_ln.c +++ b/src/lib/krb5/os/t_an_to_ln.c @@ -3,9 +3,7 @@ #include int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { krb5_error_code kret; krb5_context kcontext; diff --git a/src/lib/krb5/os/t_gifconf.c b/src/lib/krb5/os/t_gifconf.c index d33dddc98..92a49123a 100644 --- a/src/lib/krb5/os/t_gifconf.c +++ b/src/lib/krb5/os/t_gifconf.c @@ -76,7 +76,7 @@ #define INIT 0xc3 -int main () { +int main (void) { char buffer[2048]; int i, sock, t, olen = -9, omod = -9; struct ifconf ifc; diff --git a/src/lib/krb5/os/t_locate_kdc.c b/src/lib/krb5/os/t_locate_kdc.c index 39340e7ec..734411b18 100644 --- a/src/lib/krb5/os/t_locate_kdc.c +++ b/src/lib/krb5/os/t_locate_kdc.c @@ -43,7 +43,7 @@ const char *stypename (int stype) } } -void print_addrs () +void print_addrs (void) { int i; diff --git a/src/lib/krb5/os/t_realm_iter.c b/src/lib/krb5/os/t_realm_iter.c index c9281a89c..b39693594 100644 --- a/src/lib/krb5/os/t_realm_iter.c +++ b/src/lib/krb5/os/t_realm_iter.c @@ -2,7 +2,7 @@ #include -void test_realm_iterator(ctx) +void test_realm_iterator(int ctx) { krb5_error_code retval; char *realm; @@ -25,9 +25,7 @@ void test_realm_iterator(ctx) } } -int main(argc, argv) - int argc; - char **argv; +int main(int argc, char **argv) { krb5_context ctx; krb5_error_code retval; diff --git a/src/lib/krb5/os/t_std_conf.c b/src/lib/krb5/os/t_std_conf.c index 8eae312d8..407d44cab 100644 --- a/src/lib/krb5/os/t_std_conf.c +++ b/src/lib/krb5/os/t_std_conf.c @@ -17,8 +17,7 @@ #include "os-proto.h" -static void test_get_default_realm(ctx) - krb5_context ctx; +static void test_get_default_realm(krb5_context ctx) { char *realm; krb5_error_code retval; @@ -32,9 +31,7 @@ static void test_get_default_realm(ctx) free(realm); } -static void test_set_default_realm(ctx, realm) - krb5_context ctx; - char *realm; +static void test_set_default_realm(krb5_context ctx, char *realm) { krb5_error_code retval; @@ -46,8 +43,7 @@ static void test_set_default_realm(ctx, realm) printf("krb5_set_default_realm(%s)\n", realm); } -static void test_get_default_ccname(ctx) - krb5_context ctx; +static void test_get_default_ccname(krb5_context ctx) { const char *ccname; @@ -58,9 +54,7 @@ static void test_get_default_ccname(ctx) printf("krb5_cc_default_name() returned NULL\n"); } -static void test_set_default_ccname(ctx, ccname) - krb5_context ctx; - char *ccname; +static void test_set_default_ccname(krb5_context ctx, char *ccname) { krb5_error_code retval; @@ -72,9 +66,7 @@ static void test_set_default_ccname(ctx, ccname) printf("krb5_set_default_ccname(%s)\n", ccname); } -static void test_get_krbhst(ctx, realm) - krb5_context ctx; - char *realm; +static void test_get_krbhst(krb5_context ctx, char *realm) { char **hostlist, **cpp; krb5_data rlm; @@ -104,9 +96,7 @@ static void test_get_krbhst(ctx, realm) printf("\n"); } -static void test_locate_kdc(ctx, realm) - krb5_context ctx; - char *realm; +static void test_locate_kdc(krb5_context ctx, char *realm) { struct addrlist addrs; int i; @@ -157,9 +147,7 @@ static void test_locate_kdc(ctx, realm) printf("\n"); } -static void test_get_host_realm(ctx, host) - krb5_context ctx; - char *host; +static void test_get_host_realm(krb5_context ctx, char *host) { char **realms, **cpp; krb5_error_code retval; @@ -187,9 +175,7 @@ static void test_get_host_realm(ctx, host) printf("\n"); } -static void test_get_realm_domain(ctx, realm) - krb5_context ctx; - char *realm; +static void test_get_realm_domain(krb5_context ctx, char *realm) { krb5_error_code retval; char *domain; @@ -203,17 +189,14 @@ static void test_get_realm_domain(ctx, realm) free(domain); } -static void usage(progname) - char *progname; +static void usage(char *progname) { fprintf(stderr, "%s: Usage: %s [-dc] [-k realm] [-r host] [-C ccname] [-D realm]\n", progname, progname); exit(1); } -int main(argc, argv) - int argc; - char **argv; +int main(int argc, char **argv) { int c; krb5_context ctx; diff --git a/src/lib/krb5/os/timeofday.c b/src/lib/krb5/os/timeofday.c index f9945ecbf..fb3b92756 100644 --- a/src/lib/krb5/os/timeofday.c +++ b/src/lib/krb5/os/timeofday.c @@ -32,14 +32,8 @@ #include -#ifndef HAVE_ERRNO -extern int errno; -#endif - krb5_error_code KRB5_CALLCONV -krb5_timeofday(context, timeret) - krb5_context context; - register krb5_int32 *timeret; +krb5_timeofday(krb5_context context, register krb5_int32 *timeret) { krb5_os_context os_ctx = context->os_context; time_t tval; diff --git a/src/lib/krb5/os/toffset.c b/src/lib/krb5/os/toffset.c index 59c72527d..aad995a18 100644 --- a/src/lib/krb5/os/toffset.c +++ b/src/lib/krb5/os/toffset.c @@ -36,9 +36,7 @@ * routine */ krb5_error_code -krb5_set_real_time(context, seconds, microseconds) - krb5_context context; - krb5_int32 seconds, microseconds; +krb5_set_real_time(krb5_context context, krb5_int32 seconds, krb5_int32 microseconds) { krb5_os_context os_ctx = context->os_context; krb5_int32 sec, usec; @@ -60,9 +58,7 @@ krb5_set_real_time(context, seconds, microseconds) * is useful for running the krb5 routines through test suites */ krb5_error_code -krb5_set_debugging_time(context, seconds, microseconds) - krb5_context context; - krb5_int32 seconds, microseconds; +krb5_set_debugging_time(krb5_context context, krb5_int32 seconds, krb5_int32 microseconds) { krb5_os_context os_ctx = context->os_context; @@ -78,8 +74,7 @@ krb5_set_debugging_time(context, seconds, microseconds) * routines return the "natural" time. */ krb5_error_code -krb5_use_natural_time(context) - krb5_context context; +krb5_use_natural_time(krb5_context context) { krb5_os_context os_ctx = context->os_context; @@ -92,9 +87,7 @@ krb5_use_natural_time(context) * This routine returns the current time offsets in use. */ krb5_error_code KRB5_CALLCONV -krb5_get_time_offsets(context, seconds, microseconds) - krb5_context context; - krb5_int32 *seconds, *microseconds; +krb5_get_time_offsets(krb5_context context, krb5_int32 *seconds, krb5_int32 *microseconds) { krb5_os_context os_ctx = context->os_context; @@ -110,9 +103,7 @@ krb5_get_time_offsets(context, seconds, microseconds) * This routine sets the time offsets directly. */ krb5_error_code -krb5_set_time_offsets(context, seconds, microseconds) - krb5_context context; - krb5_int32 seconds, microseconds; +krb5_set_time_offsets(krb5_context context, krb5_int32 seconds, krb5_int32 microseconds) { krb5_os_context os_ctx = context->os_context; diff --git a/src/lib/krb5/os/unlck_file.c b/src/lib/krb5/os/unlck_file.c index 886196d3e..0bbf7ce31 100644 --- a/src/lib/krb5/os/unlck_file.c +++ b/src/lib/krb5/os/unlck_file.c @@ -31,9 +31,7 @@ #include krb5_error_code -krb5_unlock_file(context, fd) - krb5_context context; - int fd; +krb5_unlock_file(krb5_context context, int fd) { return krb5_lock_file(context, fd, KRB5_LOCKMODE_UNLOCK); } diff --git a/src/lib/krb5/os/ustime.c b/src/lib/krb5/os/ustime.c index e407e8d95..65e92a043 100644 --- a/src/lib/krb5/os/ustime.c +++ b/src/lib/krb5/os/ustime.c @@ -34,10 +34,7 @@ #include "k5-int.h" krb5_error_code KRB5_CALLCONV -krb5_us_timeofday(context, seconds, microseconds) - krb5_context context; - krb5_int32 *seconds; - krb5_int32 *microseconds; +krb5_us_timeofday(krb5_context context, krb5_int32 *seconds, krb5_int32 *microseconds) { krb5_os_context os_ctx = context->os_context; krb5_int32 sec, usec; diff --git a/src/lib/krb5/os/write_msg.c b/src/lib/krb5/os/write_msg.c index 7f1bc242a..dc72fc760 100644 --- a/src/lib/krb5/os/write_msg.c +++ b/src/lib/krb5/os/write_msg.c @@ -32,10 +32,7 @@ #include krb5_error_code -krb5_write_message(context, fdp, outbuf) - krb5_context context; - krb5_pointer fdp; - krb5_data *outbuf; +krb5_write_message(krb5_context context, krb5_pointer fdp, krb5_data *outbuf) { krb5_int32 len; int fd = *( (int *) fdp); -- 2.26.2