[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Clean code to be 64bit clean

From: Jani Averbach <jaa_at_jaa.iki.fi>
Date: 2003-11-30 04:09:05 CET

Hi,

This message is a little bit bogus, only problem seems to be that
there are tree compiler warnings of void * to integer conversion or
vice versa (when orginal data has been integer any way from the start).

Sorry about noise.

BR, Jani

On 2003-11-28 07:11-0700, Jani Averbach wrote:
>
> Hello,
>
> I would like hear some comment before committing this, the first part
> of patch should be ok, and current code is erroneus at the moment.
>
> But what about second portion of patch
> (subversion/libsvn_ra_dav/session.c), is it quaranteed that
> SVN_AUT_SSL_* will never exceed 31 bytes, so is the conversion
> int -> long safe, or is this used a (transparent) way that it doesnt matter?
> Or should those bitfields be unsigned (the return value of
> convert_neon_failures), so bitfield semantic will not change in the
> conversion?
>
> BR, Jani
>
> Log:
>
> Fix two pointer to int errors (in 64bit system), and one warning.
>
>
> * subversion/libsvn_client/ssl_server_trust_providers.c
> (ssl_server_trust_file_first_credentials): Changed variables
> failures, last_failure to long. Conversio was
> void * to int, now it is void * to long.
>
> (ssl_server_trust_prompt_first_cred): Changed failures to long, ditto.
>
> * subversion/libsvn_ra_dav/session.c
> (server_ssl_callback): Conversio was int to void *, now it is
> int to long to void *. This will prevent a compiler warning.
>
>
> Index: subversion/libsvn_client/ssl_server_trust_providers.c
> ===================================================================
> --- subversion/libsvn_client/ssl_server_trust_providers.c (revision 7859)
> +++ subversion/libsvn_client/ssl_server_trust_providers.c (working copy)
> @@ -56,7 +56,7 @@
> apr_pool_t *pool)
> {
> ssl_server_trust_file_provider_baton_t *pb = provider_baton;
> - int failures = (int) apr_hash_get (parameters,
> + long failures = (long) apr_hash_get (parameters,
> SVN_AUTH_PARAM_SSL_SERVER_FAILURES,
> APR_HASH_KEY_STRING);
> const svn_auth_ssl_server_cert_info_t *cert_info =
> @@ -84,7 +84,7 @@
> if (!error && creds_hash)
> {
> svn_string_t *trusted_cert, *this_cert, *failstr;
> - int last_failures;
> + long last_failures;
>
> trusted_cert = apr_hash_get (creds_hash,
> SVN_CLIENT__AUTHFILE_ASCII_CERT_KEY,
> @@ -211,7 +211,7 @@
> apr_pool_t *pool)
> {
> ssl_server_trust_prompt_provider_baton_t *pb = provider_baton;
> - int failures = (int) apr_hash_get (parameters,
> + long failures = (long) apr_hash_get (parameters,
> SVN_AUTH_PARAM_SSL_SERVER_FAILURES,
> APR_HASH_KEY_STRING);
> const svn_auth_ssl_server_cert_info_t *cert_info =
> Index: subversion/libsvn_ra_dav/session.c
> ===================================================================
> --- subversion/libsvn_ra_dav/session.c (revision 7859)
> +++ subversion/libsvn_ra_dav/session.c (working copy)
> @@ -169,7 +169,7 @@
>
> svn_auth_set_parameter(ras->callbacks->auth_baton,
> SVN_AUTH_PARAM_SSL_SERVER_FAILURES,
> - (void*)convert_neon_failures(failures));
> + (void*)((long)convert_neon_failures(failures)));
>
> /* Extract the info from the certificate */
> cert_info.hostname = ne_ssl_cert_identity(cert);
>
>
>
> --
> Jani Averbach
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>

-- 
Jani Averbach                 jaa@iki.fi              +1-303-413-1047 
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Nov 30 04:09:39 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.