From d1f91f7c723733113b4e9792042101c80dfc064c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 3 Dec 2005 06:46:46 +0000 Subject: r12043: It's amazing the warnings you find when compiling on a 64-bit box with gcc4 and -O6... Fix a bunch of C99 dereferencing type-punned pointer will break strict-aliasing rules errors. Also added prs_int32 (not uint32...) as it's needed in one place. Find places where prs_uint32 was being used to marshall/unmarshall a time_t (a big no no on 64-bits). More warning fixes to come. Thanks to Volker for nudging me to compile like this. Jeremy. (This used to be commit c65b752604f8f58abc4e7ae8514dc2c7f086271c) --- source3/libads/ads_ldap.c | 2 +- source3/libads/ldap.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/libads') diff --git a/source3/libads/ads_ldap.c b/source3/libads/ads_ldap.c index ae86ef0b76..fea4cd0fd0 100644 --- a/source3/libads/ads_ldap.c +++ b/source3/libads/ads_ldap.c @@ -56,7 +56,7 @@ ADS_STATUS ads_sid_to_dn(ADS_STRUCT *ads, goto done; } - rc = ads_search_retry(ads, (void **)&msg, ldap_exp, attr); + rc = ads_search_retry(ads, (void **)(void *)&msg, ldap_exp, attr); if (!ADS_ERR_OK(rc)) { DEBUG(1,("ads_sid_to_dn ads_search: %s\n", ads_errstr(rc))); diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index e4cfc456a2..fa2a8b5ea5 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -1162,7 +1162,7 @@ uint32 ads_get_kvno(ADS_STRUCT *ads, const char *machine_name) if (asprintf(&filter, "(samAccountName=%s$)", machine_name) == -1) { return kvno; } - ret = ads_search(ads, (void**) &res, filter, attrs); + ret = ads_search(ads, (void**)(void *)&res, filter, attrs); SAFE_FREE(filter); if (!ADS_ERR_OK(ret) && ads_count_replies(ads, res)) { DEBUG(1,("ads_get_kvno: Computer Account For %s not found.\n", machine_name)); @@ -1216,7 +1216,7 @@ ADS_STATUS ads_clear_service_principal_names(ADS_STRUCT *ads, const char *machin ADS_STATUS ret = ADS_ERROR(LDAP_SUCCESS); char *dn_string = NULL; - ret = ads_find_machine_acct(ads, (void **)&res, machine_name); + ret = ads_find_machine_acct(ads, (void **)(void *)&res, machine_name); if (!ADS_ERR_OK(ret) || ads_count_replies(ads, res) != 1) { DEBUG(5,("ads_clear_service_principal_names: WARNING: Host Account for %s not found... skipping operation.\n", machine_name)); DEBUG(5,("ads_clear_service_principal_names: WARNING: Service Principals for %s have NOT been cleared.\n", machine_name)); @@ -1284,7 +1284,7 @@ ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_n char *dn_string = NULL; const char *servicePrincipalName[4] = {NULL, NULL, NULL, NULL}; - ret = ads_find_machine_acct(ads, (void **)&res, machine_name); + ret = ads_find_machine_acct(ads, (void **)(void *)&res, machine_name); if (!ADS_ERR_OK(ret) || ads_count_replies(ads, res) != 1) { DEBUG(1,("ads_add_service_principal_name: WARNING: Host Account for %s not found... skipping operation.\n", machine_name)); @@ -1398,7 +1398,7 @@ static ADS_STATUS ads_add_machine_acct(ADS_STRUCT *ads, const char *machine_name name_to_fqdn(my_fqdn, machine_name); - status = ads_find_machine_acct(ads, (void **)&res, machine_name); + status = ads_find_machine_acct(ads, (void **)(void *)&res, machine_name); if (ADS_ERR_OK(status) && ads_count_replies(ads, res) == 1) { char *dn_string = ads_get_dn(ads, res); if (!dn_string) { @@ -1771,7 +1771,7 @@ ADS_STATUS ads_join_realm(ADS_STRUCT *ads, const char *machine_name, return status; } - status = ads_find_machine_acct(ads, (void **)&res, machine); + status = ads_find_machine_acct(ads, (void **)(void *)&res, machine); if (!ADS_ERR_OK(status)) { DEBUG(0, ("ads_join_realm: Host account test failed for machine %s\n", machine)); SAFE_FREE(machine); -- cgit