subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bl...@apache.org
Subject svn commit: r1068519 - in /subversion/trunk/subversion: include/svn_io.h libsvn_subr/stream.c libsvn_subr/subst.c
Date Tue, 08 Feb 2011 18:45:41 GMT
Author: blair
Date: Tue Feb  8 18:45:41 2011
New Revision: 1068519

URL: http://svn.apache.org/viewvc?rev=1068519&view=rev
Log:
Constify svn_io_seek_fn_t and svn_stream_seek().

* subversion/include/svn_io.h
  (svn_io_seek_fn_t),
  (svn_stream_seek):
    Constify the input svn_stream_mark_t * argument.

* subversion/libsvn_subr/stream.c
  (svn_stream_seek),
  (seek_handler_empty),
  (seek_handler_disown),
  (seek_handler_apr):
    Constify the input svn_stream_mark_t * argument.

* subversion/libsvn_subr/subst.c
  (translated_stream_seek):
    Constify the input svn_stream_mark_t * argument.

Modified:
    subversion/trunk/subversion/include/svn_io.h
    subversion/trunk/subversion/libsvn_subr/stream.c
    subversion/trunk/subversion/libsvn_subr/subst.c

Modified: subversion/trunk/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_io.h?rev=1068519&r1=1068518&r2=1068519&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_io.h (original)
+++ subversion/trunk/subversion/include/svn_io.h Tue Feb  8 18:45:41 2011
@@ -779,7 +779,7 @@ typedef svn_error_t *(*svn_io_mark_fn_t)
  * @since New in 1.7.
  */
 typedef svn_error_t *(*svn_io_seek_fn_t)(void *baton,
-                                         svn_stream_mark_t *mark);
+                                         const svn_stream_mark_t *mark);
 
 /** Create a generic stream.  @see svn_stream_t. */
 svn_stream_t *
@@ -1060,7 +1060,7 @@ svn_stream_mark(svn_stream_t *stream,
  * @since New in 1.7.
  */
 svn_error_t *
-svn_stream_seek(svn_stream_t *stream, svn_stream_mark_t *mark);
+svn_stream_seek(svn_stream_t *stream, const svn_stream_mark_t *mark);
 
 /** Return a writable stream which, when written to, writes to both of the
  * underlying streams.  Both of these streams will be closed upon closure of

Modified: subversion/trunk/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/stream.c?rev=1068519&r1=1068518&r2=1068519&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/stream.c (original)
+++ subversion/trunk/subversion/libsvn_subr/stream.c Tue Feb  8 18:45:41 2011
@@ -145,7 +145,7 @@ svn_stream_mark(svn_stream_t *stream, sv
 }
 
 svn_error_t *
-svn_stream_seek(svn_stream_t *stream, svn_stream_mark_t *mark)
+svn_stream_seek(svn_stream_t *stream, const svn_stream_mark_t *mark)
 {
   if (stream->seek_fn == NULL)
     return svn_error_create(SVN_ERR_STREAM_SEEK_NOT_SUPPORTED, NULL, NULL);
@@ -432,7 +432,7 @@ mark_handler_empty(void *baton, svn_stre
 }
 
 static svn_error_t *
-seek_handler_empty(void *baton, svn_stream_mark_t *mark)
+seek_handler_empty(void *baton, const svn_stream_mark_t *mark)
 {
   return SVN_NO_ERROR;
 }
@@ -531,7 +531,7 @@ mark_handler_disown(void *baton, svn_str
 }
 
 static svn_error_t *
-seek_handler_disown(void *baton, svn_stream_mark_t *mark)
+seek_handler_disown(void *baton, const svn_stream_mark_t *mark)
 {
   return svn_stream_seek(baton, mark);
 }
@@ -608,7 +608,7 @@ mark_handler_apr(void *baton, svn_stream
 }
 
 static svn_error_t *
-seek_handler_apr(void *baton, svn_stream_mark_t *mark)
+seek_handler_apr(void *baton, const svn_stream_mark_t *mark)
 {
   struct baton_apr *btn = baton;
   apr_off_t offset = (mark != NULL) ? ((const struct mark_apr *)mark)->off : 0;
@@ -1232,15 +1232,15 @@ mark_handler_stringbuf(void *baton, svn_
 }
 
 static svn_error_t *
-seek_handler_stringbuf(void *baton, svn_stream_mark_t *mark)
+seek_handler_stringbuf(void *baton, const svn_stream_mark_t *mark)
 {
   struct stringbuf_stream_baton *btn = baton;
 
   if (mark != NULL)
     {
-      struct stringbuf_stream_mark *stringbuf_stream_mark;
+      const struct stringbuf_stream_mark *stringbuf_stream_mark;
 
-      stringbuf_stream_mark = (struct stringbuf_stream_mark *)mark;
+      stringbuf_stream_mark = (const struct stringbuf_stream_mark *)mark;
       btn->amt_read = stringbuf_stream_mark->pos;
     }
   else
@@ -1308,15 +1308,15 @@ mark_handler_string(void *baton, svn_str
 }
 
 static svn_error_t *
-seek_handler_string(void *baton, svn_stream_mark_t *mark)
+seek_handler_string(void *baton, const svn_stream_mark_t *mark)
 {
   struct string_stream_baton *btn = baton;
 
   if (mark != NULL)
     {
-      struct string_stream_mark *marker;
+      const struct string_stream_mark *marker;
 
-      marker = (struct string_stream_mark *)mark;
+      marker = (const struct string_stream_mark *)mark;
       btn->amt_read = marker->pos;
     }
   else

Modified: subversion/trunk/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/subst.c?rev=1068519&r1=1068518&r2=1068519&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/subst.c (original)
+++ subversion/trunk/subversion/libsvn_subr/subst.c Tue Feb  8 18:45:41 2011
@@ -1316,13 +1316,13 @@ translated_stream_mark(void *baton, svn_
 
 /* Implements svn_io_seek_fn_t. */
 static svn_error_t *
-translated_stream_seek(void *baton, svn_stream_mark_t *mark)
+translated_stream_seek(void *baton, const svn_stream_mark_t *mark)
 {
   struct translated_stream_baton *b = baton;
 
   if (mark != NULL)
     {
-      mark_translated_t *mt = (mark_translated_t *)mark;
+      const mark_translated_t *mt = (const mark_translated_t *)mark;
 
       /* Flush output buffer if necessary. */
       if (b->written)



Mime
View raw message