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

[PATCH] Clean code to be 64bit clean

From: Jani Averbach <jaa_at_jaa.iki.fi>
Date: 2003-11-28 15:11:57 CET

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
Received on Sun Nov 30 03:47:20 2003

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