[Kst] branches/work/kst/portto4/kst/src/datasources/ascii

Peter Kümmel syntheticpp at gmx.net
Sun Oct 14 12:03:34 UTC 2012


SVN commit 1320486 by kuemmel:

FileBuffer: -1 is gould enough to indicate an invalid value

 M  +4 -4      asciifilebuffer.cpp  
 M  +1 -1      asciifilebuffer.h  


--- branches/work/kst/portto4/kst/src/datasources/ascii/asciifilebuffer.cpp #1320485:1320486
@@ -36,15 +36,15 @@
     delete _array;
     _array = new Array;
   }
-  _begin = -10;
-  _bytesRead = -10;
+  _begin = -1;
+  _bytesRead = -1;
 }
 
 //-------------------------------------------------------------------------------------------
 int AsciiFileBuffer::read(QFile& file, int start, int bytesToRead, int maximalBytes)
 {
-  _begin = -10;
-  _bytesRead = -10;
+  _begin = -1;
+  _bytesRead = -1;
 
   if (maximalBytes == -1) {
     if (!resize(bytesToRead + 1))
--- branches/work/kst/portto4/kst/src/datasources/ascii/asciifilebuffer.h #1320485:1320486
@@ -33,7 +33,7 @@
 
   typedef QVarLengthArray<char, Prealloc> Array;
   
-  inline AsciiFileBuffer() : _begin(-10), _bytesRead(-10), _array(new Array) {}
+  inline AsciiFileBuffer() : _begin(-1), _bytesRead(-1), _array(new Array) {}
   inline ~AsciiFileBuffer() { delete _array; }
 
   inline int begin() const { return _begin; }


More information about the Kst mailing list