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

Add 'const' to an API pointer?

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2004-11-13 18:57:49 CET

I suppose I can't do this because it breaks binary compatibility?

- Julian

Index: subversion/include/svn_io.h
===================================================================
--- subversion/include/svn_io.h (revision 11870)
+++ subversion/include/svn_io.h (working copy)
@@ -149,7 +149,7 @@
  * Set @a dest to the path that the symlink at @a path references.
  * Allocate the string from @a pool.
  */
-svn_error_t *svn_io_read_link (svn_string_t **dest,
+svn_error_t *svn_io_read_link (const svn_string_t **dest,
                                const char *path,
                                apr_pool_t *pool);
 
Index: subversion/libsvn_subr/io.c
===================================================================
--- subversion/libsvn_subr/io.c (revision 11873)
+++ subversion/libsvn_subr/io.c (working copy)
@@ -367,7 +367,7 @@
 }
 
 svn_error_t *
-svn_io_read_link (svn_string_t **dest,
+svn_io_read_link (const svn_string_t **dest,
                   const char *path,
                   apr_pool_t *pool)
 {
@@ -390,9 +390,7 @@
   dest_apr.data = buf;
   dest_apr.len = rv;
 
- /* ### Cast needed, one of these interfaces is wrong */
- SVN_ERR (svn_utf_string_to_utf8 ((const svn_string_t **)dest, &dest_apr,
- pool));
+ SVN_ERR (svn_utf_string_to_utf8 (dest, &dest_apr, pool));
   
   return SVN_NO_ERROR;
 #else

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Nov 13 18:58:04 2004

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.