Attached is a simple patch that uses int instead of short for line
length. This was already prepared by the authors and works for me.
Unfortunately, upstream seems dead/unresponsive, so perhaps carry this
as a Debian patch?
Best,
Norbert
diff -r 14649b36ff19 -r 75340556b680 src/buffer.cpp
--- a/src/buffer.cpp Thu Jul 08 16:13:07 2010 -0700
+++ b/src/buffer.cpp Thu Jul 08 16:16:07 2010 -0700
@@ -433,7 +433,7 @@
_index.push_back( ii + 1 );
#ifdef XX_ENABLED_BUFFER_LINE_LENGTHS
_lengths.push_back( ii - prev );
- prev = static_cast<short>( ii + 1 );
+ prev = static_cast<int>( ii + 1 );
#endif
}
}
@@ -457,7 +457,7 @@
std::swap( _index, oldIndex );
#ifdef XX_ENABLED_BUFFER_LINE_LENGTHS
- std::vector<short> oldLengths;
+ std::vector<int> oldLengths;
std::swap( _lengths, oldLengths );
#endif
diff -r 14649b36ff19 -r 75340556b680 src/buffer.h
--- a/src/buffer.h Thu Jul 08 16:13:07 2010 -0700
+++ b/src/buffer.h Thu Jul 08 16:16:07 2010 -0700
@@ -268,16 +268,11 @@
#define XX_ENABLED_BUFFER_LINE_LENGTHS
#ifdef XX_ENABLED_BUFFER_LINE_LENGTHS
- // Important note: due to the use of the short datatype to record line
- // lengths, xxdiff is limited to lines of length up to 64k characters. We
- // consider this reasonable for all purposes. However, this could be easily
- // changed to int below if necessary.
- //
// We had to introduce an explicit vector of lengths because since the
// unmerge feature was introduced, we're sharing the very text buffer that
// the multiple buffers use we cannot anymore rely on buffer lines appearing
// next to each other in the data array.
- std::vector<short> _lengths;
+ std::vector<int> _lengths;
#endif
// Indirection index for reindexed files. This array contains the line