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

Peter Kümmel syntheticpp at gmx.net
Sat Oct 13 14:13:43 UTC 2012


SVN commit 1320327 by kuemmel:

be sure we pass by reference

 M  +4 -6      asciisource.cpp  
 M  +4 -4      asciisource.h  


--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.cpp #1320326:1320327
@@ -428,7 +428,7 @@
 }
 
 template<class Buffer, typename IsLineBreak, typename CommentDelimiter>
-bool AsciiSource::findDataRows(const Buffer buffer, int bufstart, int bufread, const IsLineBreak& isLineBreak, const CommentDelimiter& comment_del)
+bool AsciiSource::findDataRows(const Buffer& buffer, int bufstart, int bufread, const IsLineBreak& isLineBreak, const CommentDelimiter& comment_del)
 {
   const IsWhiteSpace isWhiteSpace;
   
@@ -611,13 +611,11 @@
   return 0;
 }
 
-
 //-------------------------------------------------------------------------------------------
 template<class Buffer, typename ColumnDelimiter>
-int AsciiSource::readColumns(double* v, const Buffer buffer, int bufstart, int bufread, int col, int s, int n,
+int AsciiSource::readColumns(double* v, const Buffer& buffer, int bufstart, int bufread, int col, int s, int n,
                               const LineEndingType& lineending, const ColumnDelimiter& column_del)
 {
-
   if (_config._delimiters.value().size() == 0) {
     const NoDelimiter comment_del;
     return readColumns(v, buffer, bufstart, bufread, col, s, n, lineending, column_del, comment_del);
@@ -633,7 +631,7 @@
 }
 
 template<class Buffer, typename ColumnDelimiter, typename CommentDelimiter>
-int AsciiSource::readColumns(double* v, const Buffer buffer, int bufstart, int bufread, int col, int s, int n,
+int AsciiSource::readColumns(double* v, const Buffer& buffer, int bufstart, int bufread, int col, int s, int n,
                               const LineEndingType& lineending, const ColumnDelimiter& column_del, const CommentDelimiter& comment_del)
 {
   if (_config._columnWidthIsConst) {
@@ -655,7 +653,7 @@
 
 
 template<class Buffer, typename IsLineBreak, typename ColumnDelimiter, typename CommentDelimiter, typename ColumnWidthsAreConst>
-int AsciiSource::readColumns(double* v, const Buffer buffer, int bufstart, int bufread, int col, int s, int n,
+int AsciiSource::readColumns(double* v, const Buffer& buffer, int bufstart, int bufread, int col, int s, int n,
                               const IsLineBreak& isLineBreak,
                               const ColumnDelimiter& column_del, const CommentDelimiter& comment_del,
                               const ColumnWidthsAreConst& are_column_widths_const)
--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.h #1320326:1320327
@@ -260,19 +260,19 @@
 
 
     template<class Buffer, typename ColumnDelimiter>
-    int readColumns(double* v, const Buffer buffer, int bufstart, int bufread, int col, int s, int n,
+    int readColumns(double* v, const Buffer& buffer, int bufstart, int bufread, int col, int s, int n,
                     const LineEndingType&, const ColumnDelimiter&);
 
     template<class Buffer, typename ColumnDelimiter, typename CommentDelimiter>
-    int readColumns(double* v, const Buffer buffer, int bufstart, int bufread, int col, int s, int n,
+    int readColumns(double* v, const Buffer& buffer, int bufstart, int bufread, int col, int s, int n,
                     const LineEndingType&, const ColumnDelimiter&, const CommentDelimiter&);
 
     template<class Buffer, typename IsLineBreak, typename ColumnDelimiter, typename CommentDelimiter, typename ColumnWidthsAreConst>
-    int readColumns(double* v, const Buffer buffer, int bufstart, int bufread, int col, int s, int n,
+    int readColumns(double* v, const Buffer& buffer, int bufstart, int bufread, int col, int s, int n,
                     const IsLineBreak&, const ColumnDelimiter&, const CommentDelimiter&, const ColumnWidthsAreConst&);
 
     template<class Buffer, typename IsLineBreak, typename CommentDelimiter>
-    bool findDataRows(const Buffer buffer, int bufstart, int bufread, const IsLineBreak&, const CommentDelimiter&);
+    bool findDataRows(const Buffer& buffer, int bufstart, int bufread, const IsLineBreak&, const CommentDelimiter&);
 
     void toDouble(const LexicalCast& lexc, const char* buffer, int bufread, int ch, double* v, int row);
 


More information about the Kst mailing list