Author: brane
Date: Sun May 18 18:00:03 2025
New Revision: 1925680

URL: http://svn.apache.org/viewvc?rev=1925680&view=rev
Log:
Change the order of the arguments of svn_stream_span() to be consistent
with the other generic stream functions.

* subversion/include/svn_io.h
  (svn_stream_span): Put the 'stream' argument first.

* subversion/tests/libsvn_subr/stream-test.c,
  subversion/libsvn_subr/stream.c,
  subversion/libsvn_subr/subst.c: : Update implementations and usage.

Modified:
    subversion/branches/patch-from-stream/subversion/include/svn_io.h
    subversion/branches/patch-from-stream/subversion/libsvn_subr/stream.c
    subversion/branches/patch-from-stream/subversion/libsvn_subr/subst.c
    
subversion/branches/patch-from-stream/subversion/tests/libsvn_subr/stream-test.c

Modified: subversion/branches/patch-from-stream/subversion/include/svn_io.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/patch-from-stream/subversion/include/svn_io.h?rev=1925680&r1=1925679&r2=1925680&view=diff
==============================================================================
--- subversion/branches/patch-from-stream/subversion/include/svn_io.h (original)
+++ subversion/branches/patch-from-stream/subversion/include/svn_io.h Sun May 
18 18:00:03 2025
@@ -1475,7 +1475,7 @@ svn_stream_seek(svn_stream_t *stream, co
  * @since New in 1.15
  */
 svn_error_t *
-svn_stream_span(apr_off_t *offset, svn_stream_t *stream,
+svn_stream_span(svn_stream_t *stream, apr_off_t *offset,
                 const svn_stream_mark_t *first_mark,
                 const svn_stream_mark_t *second_mark);
 

Modified: subversion/branches/patch-from-stream/subversion/libsvn_subr/stream.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/patch-from-stream/subversion/libsvn_subr/stream.c?rev=1925680&r1=1925679&r2=1925680&view=diff
==============================================================================
--- subversion/branches/patch-from-stream/subversion/libsvn_subr/stream.c 
(original)
+++ subversion/branches/patch-from-stream/subversion/libsvn_subr/stream.c Sun 
May 18 18:00:03 2025
@@ -281,8 +281,8 @@ svn_stream_seek(svn_stream_t *stream, co
 }
 
 svn_error_t *
-svn_stream_span(apr_off_t *offset,
-                svn_stream_t *stream,
+svn_stream_span(svn_stream_t *stream,
+                apr_off_t *offset,
                 const svn_stream_mark_t *first_mark,
                 const svn_stream_mark_t *second_mark)
 {
@@ -683,7 +683,7 @@ span_handler_disown(void *baton, apr_off
                     const svn_stream_mark_t *first_mark,
                     const svn_stream_mark_t *second_mark)
 {
-  return svn_error_trace(svn_stream_span(offset, baton,
+  return svn_error_trace(svn_stream_span(baton, offset,
                                          first_mark, second_mark));
 }
 
@@ -2227,7 +2227,7 @@ span_handler_lazyopen(void *baton, apr_o
   lazyopen_baton_t *b = baton;
 
   SVN_ERR(lazyopen_if_unopened(b));
-  SVN_ERR(svn_stream_span(offset, b->real_stream,
+  SVN_ERR(svn_stream_span(b->real_stream, offset,
                           first_mark, second_mark));
 
   return SVN_NO_ERROR;

Modified: subversion/branches/patch-from-stream/subversion/libsvn_subr/subst.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/patch-from-stream/subversion/libsvn_subr/subst.c?rev=1925680&r1=1925679&r2=1925680&view=diff
==============================================================================
--- subversion/branches/patch-from-stream/subversion/libsvn_subr/subst.c 
(original)
+++ subversion/branches/patch-from-stream/subversion/libsvn_subr/subst.c Sun 
May 18 18:00:03 2025
@@ -1444,7 +1444,7 @@ translated_stream_span(void *baton, apr_
   const mark_translated_t *mt1 = (const mark_translated_t *)first_mark;
   const mark_translated_t *mt2 = (const mark_translated_t *)second_mark;
   return svn_error_trace(
-      svn_stream_span(offset, b->stream,
+      svn_stream_span(b->stream, offset,
                       mt1 != NULL ? mt1->mark : NULL,
                       mt2 != NULL ? mt2->mark : NULL));
 }

Modified: 
subversion/branches/patch-from-stream/subversion/tests/libsvn_subr/stream-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/patch-from-stream/subversion/tests/libsvn_subr/stream-test.c?rev=1925680&r1=1925679&r2=1925680&view=diff
==============================================================================
--- 
subversion/branches/patch-from-stream/subversion/tests/libsvn_subr/stream-test.c
 (original)
+++ 
subversion/branches/patch-from-stream/subversion/tests/libsvn_subr/stream-test.c
 Sun May 18 18:00:03 2025
@@ -300,7 +300,7 @@ test_stream_seek_file(apr_pool_t *pool)
   SVN_TEST_ASSERT(! eof && strcmp(line->data, file_data[1]) == 0);
   /* Check how far we read before seeking. */
   SVN_ERR(svn_stream_mark(stream, &mark2, pool));
-  SVN_ERR(svn_stream_span(&offset, stream, mark, mark2));
+  SVN_ERR(svn_stream_span(stream, &offset, mark, mark2));
   SVN_TEST_ASSERT(offset == strlen(line->data) + strlen(NL));
   /* Ok, carry on... */
   SVN_ERR(svn_stream_seek(stream, mark));
@@ -359,7 +359,7 @@ test_stream_seek_stringbuf(apr_pool_t *p
   SVN_ERR(svn_stream_skip(stream, 2));
   /* Check that we actually skipped that far. */
   SVN_ERR(svn_stream_mark(stream, &mark2, pool));
-  SVN_ERR(svn_stream_span(&offset, stream, mark, mark2));
+  SVN_ERR(svn_stream_span(stream, &offset, mark, mark2));
   SVN_TEST_ASSERT(offset == 2);
   /* The remaining line should be empty */
   len = 3;
@@ -401,7 +401,7 @@ test_stream_seek_translated(apr_pool_t *
   SVN_TEST_STRING_ASSERT(buf, "One$MyKeyword: my keyword");
   SVN_ERR(svn_stream_mark(translated_stream, &mark, pool));
   SVN_ERR(svn_stream_reset(translated_stream));
-  SVN_ERR(svn_stream_span(&offset, translated_stream, mark, mark2));
+  SVN_ERR(svn_stream_span(translated_stream, &offset, mark, mark2));
   /* This is the distance in the untranslated stream, so the length of
      that "One$MyKeyword$Two" that was read from there. */
   SVN_TEST_ASSERT(offset == -17);


Reply via email to