diff options
author | Derrell Lipman <derrell@samba.org> | 2005-03-30 04:40:24 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:56:24 -0500 |
commit | 934d41d23956c663406ff9d68e5a8ba9d81b5096 (patch) | |
tree | 5680eab3013a7e2f364d8ca8782bfb32d285ab99 | |
parent | 7387dab585dadf710dbb72ddd211db1a1ba725c7 (diff) | |
download | samba-934d41d23956c663406ff9d68e5a8ba9d81b5096.tar.gz samba-934d41d23956c663406ff9d68e5a8ba9d81b5096.tar.bz2 samba-934d41d23956c663406ff9d68e5a8ba9d81b5096.zip |
r6127: Eliminated all compiler warnings pertaining to mismatched "qualifiers". The
whole of samba comiles warning-free with the default compiler flags.
Temporarily defined -Wall to locate other potential problems. Found an
unused static function (#ifdefed out rather than deleted, in case it's
needed for something in progress).
There are also a number of uses of undeclared functions, mostly krb5_*.
Files with these problems need to have appropriate header files included,
but they are not fixed in this update.
oplock_linux.c.c has undefined functions capget() and capset(), which need
to have "#undef _POSIX_SOURCE" specified before including <sys/capability.h>,
but that could potentially have other side effects, so that remains uncorrected
as well.
The flag -Wall should be added permanently to CFLAGS, and all warnings then
generated should be eliminated.
(This used to be commit 5b19ede88ed80318e392f8017f4573fbb2ecbe0f)
-rw-r--r-- | source3/include/smb_macros.h | 2 | ||||
-rw-r--r-- | source3/lib/smbldap.c | 4 | ||||
-rw-r--r-- | source3/libads/kerberos.c | 3 | ||||
-rw-r--r-- | source3/libsmb/spnego.c | 12 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_acct.c | 2 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_nss.h | 2 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_rpc.c | 3 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_util.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_svcctl_nt.c | 4 | ||||
-rw-r--r-- | source3/tdb/tdb.c | 2 | ||||
-rw-r--r-- | source3/tdb/tdbutil.c | 4 | ||||
-rw-r--r-- | source3/utils/net_ads.c | 2 | ||||
-rw-r--r-- | source3/utils/net_lookup.c | 2 | ||||
-rw-r--r-- | source3/utils/smbcontrol.c | 2 |
14 files changed, 26 insertions, 20 deletions
diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 68a80ec402..9a78718605 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -43,7 +43,7 @@ * @note You are explicitly allowed to pass NULL pointers -- they will * always be ignored. **/ -#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0) +#define SAFE_FREE(x) do { if ((x) != NULL) {free((void *) (x)); x=NULL;} } while(0) #endif /* zero a structure */ diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c index 68084b0404..78ec249717 100644 --- a/source3/lib/smbldap.c +++ b/source3/lib/smbldap.c @@ -1066,7 +1066,7 @@ int smbldap_search(struct smbldap_state *ldap_state, while (another_ldap_try(ldap_state, &rc, &attempts, endtime)) rc = ldap_search_s(ldap_state->ldap_struct, base, scope, - utf8_filter, attrs, attrsonly, res); + utf8_filter, (char **) attrs, attrsonly, res); SAFE_FREE(utf8_filter); return rc; @@ -1471,7 +1471,7 @@ static BOOL smbldap_check_root_dse(struct smbldap_state *ldap_state, const char } rc = ldap_search_s(ldap_state->ldap_struct, "", LDAP_SCOPE_BASE, - "(objectclass=*)", attrs, 0 , &msg); + "(objectclass=*)", (char **) attrs, 0 , &msg); if (rc != LDAP_SUCCESS) { DEBUG(3,("smbldap_check_root_dse: Could not search rootDSE\n")); diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index 4c9997e080..43ccb18b5a 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -88,7 +88,8 @@ int kerberos_kinit_password(const char *principal, return code; } - if ((code = krb5_get_init_creds_password(ctx, &my_creds, me, password, + if ((code = krb5_get_init_creds_password(ctx, &my_creds, me, + (char *) password, kerb_prompter, NULL, 0, NULL, NULL))) { krb5_free_principal(ctx, me); diff --git a/source3/libsmb/spnego.c b/source3/libsmb/spnego.c index a0f5565d4f..090148d415 100644 --- a/source3/libsmb/spnego.c +++ b/source3/libsmb/spnego.c @@ -42,12 +42,12 @@ static BOOL read_negTokenInit(ASN1_DATA *asn1, negTokenInit_t *token) asn1_start_tag(asn1, ASN1_CONTEXT(0)); asn1_start_tag(asn1, ASN1_SEQUENCE(0)); - token->mechTypes = SMB_MALLOC_P(char *); + token->mechTypes = SMB_MALLOC_P(const char *); for (i = 0; !asn1->has_error && 0 < asn1_tag_remaining(asn1); i++) { token->mechTypes = - SMB_REALLOC_ARRAY(token->mechTypes, char *, i + 2); - asn1_read_OID(asn1, token->mechTypes + i); + SMB_REALLOC_ARRAY(token->mechTypes, const char *, i + 2); + asn1_read_OID(asn1, (char **) (token->mechTypes + i)); } token->mechTypes[i] = NULL; @@ -182,7 +182,7 @@ static BOOL read_negTokenTarg(ASN1_DATA *asn1, negTokenTarg_t *token) break; case ASN1_CONTEXT(1): asn1_start_tag(asn1, ASN1_CONTEXT(1)); - asn1_read_OID(asn1, &token->supportedMech); + asn1_read_OID(asn1, (char **) &token->supportedMech); asn1_end_tag(asn1); break; case ASN1_CONTEXT(2): @@ -317,7 +317,7 @@ BOOL free_spnego_data(SPNEGO_DATA *spnego) if (spnego->negTokenInit.mechTypes) { int i; for (i = 0; spnego->negTokenInit.mechTypes[i]; i++) { - free(spnego->negTokenInit.mechTypes[i]); + free((void *) spnego->negTokenInit.mechTypes[i]); } free(spnego->negTokenInit.mechTypes); } @@ -326,7 +326,7 @@ BOOL free_spnego_data(SPNEGO_DATA *spnego) break; case SPNEGO_NEG_TOKEN_TARG: if (spnego->negTokenTarg.supportedMech) { - free(spnego->negTokenTarg.supportedMech); + free((void *) spnego->negTokenTarg.supportedMech); } data_blob_free(&spnego->negTokenTarg.responseToken); data_blob_free(&spnego->negTokenTarg.mechListMIC); diff --git a/source3/nsswitch/winbindd_acct.c b/source3/nsswitch/winbindd_acct.c index 2c8b7cae28..cd0b5b7e06 100644 --- a/source3/nsswitch/winbindd_acct.c +++ b/source3/nsswitch/winbindd_acct.c @@ -222,7 +222,7 @@ static WINBINDD_GR* string2group( char *string ) gr_members = SMB_XMALLOC_ARRAY(char*, num_gr_members+1); i = 0; - while ( next_token(&str, buffer, ",", sizeof(buffer)) && i<num_gr_members ) { + while ( next_token((const char **) &str, buffer, ",", sizeof(buffer)) && i<num_gr_members ) { gr_members[i++] = smb_xstrdup(buffer); } diff --git a/source3/nsswitch/winbindd_nss.h b/source3/nsswitch/winbindd_nss.h index 88e3254d24..838ba1e211 100644 --- a/source3/nsswitch/winbindd_nss.h +++ b/source3/nsswitch/winbindd_nss.h @@ -11,7 +11,7 @@ */ #ifndef SAFE_FREE -#define SAFE_FREE(x) do { if(x) {free(x); x=NULL;} } while(0) +#define SAFE_FREE(x) do { if(x) {free((void *) (x)); x=NULL;} } while(0) #endif #ifndef _WINBINDD_NTDOM_H diff --git a/source3/nsswitch/winbindd_rpc.c b/source3/nsswitch/winbindd_rpc.c index 99d12563c6..5e974736e3 100644 --- a/source3/nsswitch/winbindd_rpc.c +++ b/source3/nsswitch/winbindd_rpc.c @@ -788,7 +788,8 @@ static int get_ldap_seq(const char *server, int port, uint32 *seq) to.tv_sec = 10; to.tv_usec = 0; - if (ldap_search_st(ldp, "", LDAP_SCOPE_BASE, "(objectclass=*)", &attrs[0], 0, &to, &res)) + if (ldap_search_st(ldp, "", LDAP_SCOPE_BASE, "(objectclass=*)", + (char **) &attrs[0], 0, &to, &res)) goto done; if (ldap_count_entries(ldp, res) != 1) diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index 11da05ac3b..3d03d6f4cc 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -636,7 +636,7 @@ BOOL parse_domain_user(const char *domuser, fstring domain, fstring user) */ void fill_domain_username(fstring name, const char *domain, const char *user) { - strlower_m( user ); + strlower_m( (char *) user ); if (assume_domain(domain)) { strlcpy(name, user, sizeof(fstring)); diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c index 19244d2208..cb04ef1d10 100644 --- a/source3/rpc_server/srv_svcctl_nt.c +++ b/source3/rpc_server/srv_svcctl_nt.c @@ -34,6 +34,8 @@ static TDB_CONTEXT *svcctl_tdb; /* used for share security descriptors */ /******************************************************************** ********************************************************************/ +#if 0 /* unused static function */ + static BOOL init_svcctl_db( void ) { static pid_t local_pid; @@ -69,6 +71,8 @@ static BOOL init_svcctl_db( void ) return True; } +#endif + /******************************************************************** TODO (a) get and set security descriptors on services diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c index b3d596f442..0644b64da0 100644 --- a/source3/tdb/tdb.c +++ b/source3/tdb/tdb.c @@ -128,7 +128,7 @@ /* free memory if the pointer is valid and zero the pointer */ #ifndef SAFE_FREE -#define SAFE_FREE(x) do { if ((x) != NULL) {free((x)); (x)=NULL;} } while(0) +#define SAFE_FREE(x) do { if ((x) != NULL) {free((void *) (x)); (x)=NULL;} } while(0) #endif #define BUCKET(hash) ((hash) % tdb->header.hash_size) diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c index 682f8cc68e..29fbd25904 100644 --- a/source3/tdb/tdbutil.c +++ b/source3/tdb/tdbutil.c @@ -43,7 +43,7 @@ static void gotalarm_sig(void) TDB_DATA make_tdb_data(const char *dptr, size_t dsize) { TDB_DATA ret; - ret.dptr = dptr; + ret.dptr = (char *) dptr; ret.dsize = dsize; return ret; } @@ -62,7 +62,7 @@ static int tdb_chainlock_with_timeout_internal( TDB_CONTEXT *tdb, TDB_DATA key, /* Allow tdb_chainlock to be interrupted by an alarm. */ int ret; gotalarm = 0; - tdb_set_lock_alarm(&gotalarm); + tdb_set_lock_alarm((sig_atomic_t *) &gotalarm); if (timeout) { CatchSignal(SIGALRM, SIGNAL_CAST gotalarm_sig); diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 9c00f05bfb..83fdb08a9a 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -81,7 +81,7 @@ static int net_ads_lookup(int argc, const char **argv) d_printf("Didn't find the cldap server!\n"); return -1; } if (!ads->config.realm) { - ads->config.realm = opt_target_workgroup; + ads->config.realm = (char *) opt_target_workgroup; ads->ldap_port = 389; } diff --git a/source3/utils/net_lookup.c b/source3/utils/net_lookup.c index 7e5f12da45..7f7a88c66d 100644 --- a/source3/utils/net_lookup.c +++ b/source3/utils/net_lookup.c @@ -209,7 +209,7 @@ static int net_lookup_kdc(int argc, const char **argv) realm.length = strlen(realm.data); } - rc = krb5_locate_kdc(ctx, &realm, &addrs, &num_kdcs, 0); + rc = krb5_locate_kdc(ctx, &realm, (struct sockaddr **) &addrs, &num_kdcs, 0); if (rc) { DEBUG(1, ("krb5_locate_kdc failed (%s)\n", error_message(rc))); return -1; diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c index 2eb661c8b6..154bc5b1ae 100644 --- a/source3/utils/smbcontrol.c +++ b/source3/utils/smbcontrol.c @@ -428,7 +428,7 @@ static BOOL do_printnotify(const pid_t pid, const int argc, const char **argv) return False; } - notify_printer_byname(argv[2], attribute, argv[4]); + notify_printer_byname(argv[2], attribute, (char *) argv[4]); goto send; } |