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

[PATCH] Eliminate three poor type casts.

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-04-06 14:10:32 CEST

Could someone review and run "make check" over RA-DAV for me, please? (I know
I ought to have another go at getting RA-DAV running here...)

[[[
Eliminate three poor type casts.

* subversion/mod_dav_svn/deadprops.c
   (dav_svn_db_output_value, dav_svn_db_store): Don't cast away "const".

* subversion/mod_dav_svn/version.c
   (send_get_locations_report): Don't cast away "const".
]]]

- Julian

Eliminate three poor type casts.

* subversion/mod_dav_svn/deadprops.c
  (dav_svn_db_output_value, dav_svn_db_store): Don't cast away "const".

* subversion/mod_dav_svn/version.c
  (send_get_locations_report): Don't cast away "const".

Index: subversion/mod_dav_svn/deadprops.c
===================================================================
--- subversion/mod_dav_svn/deadprops.c (revision 13967)
+++ subversion/mod_dav_svn/deadprops.c (working copy)
@@ -286,8 +286,7 @@ static dav_error *dav_svn_db_output_valu
          across the wire. */
       if (! svn_xml_is_xml_safe(propval->data, propval->len))
         {
- propval = (svn_string_t *)svn_base64_encode_string(propval, pool);
- xml_safe = propval->data;
+ xml_safe = svn_base64_encode_string(propval, pool)->data;
           encoding = apr_pstrcat(pool, " V:encoding=\"base64\"", NULL);
         }
       else
@@ -325,7 +324,7 @@ static dav_error *dav_svn_db_store(dav_d
                                    const apr_xml_elem *elem,
                                    dav_namespace_map *mapping)
 {
- svn_string_t *propval;
+ const svn_string_t *propval;
   apr_pool_t *pool = db->p;
   apr_xml_attr *attr = elem->attr;
 
@@ -347,7 +346,7 @@ static dav_error *dav_svn_db_store(dav_d
 
           /* Handle known encodings here. */
           if (enc_type && (strcmp (enc_type, "base64") == 0))
- propval = (svn_string_t *)svn_base64_decode_string(propval, pool);
+ propval = svn_base64_decode_string(propval, pool);
           else
             return dav_new_error (pool, HTTP_INTERNAL_SERVER_ERROR, 0,
                                   "Unknown property encoding");
Index: subversion/mod_dav_svn/version.c
===================================================================
--- subversion/mod_dav_svn/version.c (revision 13959)
+++ subversion/mod_dav_svn/version.c (working copy)
@@ -1206,7 +1206,7 @@ static apr_status_t send_get_locations_r
       path_quoted = apr_xml_quote_string(pool, value, 1);
       apr_err = ap_fprintf(output, bb, "<S:location "
                            "rev=\"%ld\" path=\"%s\"/>" DEBUG_CR,
- *(svn_revnum_t *)key, path_quoted);
+ *(const svn_revnum_t *)key, path_quoted);
       if (apr_err)
         return apr_err;
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 6 20:59:16 2005

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