Author: brane
Date: Fri Mar 13 12:56:03 2015
New Revision: 1666432

URL: http://svn.apache.org/r1666432
Log:
Revert r1665853 and take a different approach to silencing
the warning it tried to fix.

* subversion/libsvn_diff/diff_file.c
  (struct svn_diff3__file_output_baton_t): Change context_size back to int.
  (context_saver_t): Rename total_written to total_writes and make it signed.
   The former name and type were misleading; it's not counting the amount of
   written data, but how many times the context_saver_stream_write function
   was called.
  (context_saver_stream_write, output_conflict_with_context):
   Adjust for the renamed context_saver_t field.

Modified:
    subversion/trunk/subversion/libsvn_diff/diff_file.c

Modified: subversion/trunk/subversion/libsvn_diff/diff_file.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/diff_file.c?rev=1666432&r1=1666431&r2=1666432&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/trunk/subversion/libsvn_diff/diff_file.c Fri Mar 13 12:56:03 2015
@@ -1956,7 +1956,7 @@ typedef struct context_saver_t {
   const char **data; /* const char *data[context_size] */
   apr_size_t *len;   /* apr_size_t len[context_size] */
   apr_size_t next_slot;
-  apr_size_t total_written;
+  apr_ssize_t total_writes;
 } context_saver_t;
 
 
@@ -1972,7 +1972,7 @@ context_saver_stream_write(void *baton,
       cs->data[cs->next_slot] = data;
       cs->len[cs->next_slot] = *len;
       cs->next_slot = (cs->next_slot + 1) % cs->context_size;
-      cs->total_written++;
+      cs->total_writes++;
     }
   return SVN_NO_ERROR;
 }
@@ -1998,7 +1998,7 @@ typedef struct svn_diff3__file_output_ba
   const char *marker_eol;
 
   svn_diff_conflict_display_style_t conflict_style;
-  apr_size_t context_size;
+  int context_size;
 
   /* cancel support */
   svn_cancel_func_t cancel_func;
@@ -2252,7 +2252,7 @@ output_conflict_with_context(svn_diff3__
      trailing context)?  If so, flush it. */
   if (btn->output_stream == btn->context_saver->stream)
     {
-      if (btn->context_saver->total_written > btn->context_size)
+      if (btn->context_saver->total_writes > btn->context_size)
         SVN_ERR(svn_stream_puts(btn->real_output_stream, "@@\n"));
       SVN_ERR(flush_context_saver(btn->context_saver, 
btn->real_output_stream));
     }


Reply via email to