[Kst] extragear/graphics/kst/src/datasources/ascii

George Staikos staikos at kde.org
Mon Jun 19 09:35:01 CEST 2006


SVN commit 552809 by staikos:

use NOPOINT instead of 0 for missing data
CCBUG: 128436


 M  +4 -8      ascii.cpp  


--- trunk/extragear/graphics/kst/src/datasources/ascii/ascii.cpp #552808:552809
@@ -497,15 +497,15 @@
   file.readBlock(_tmpBuf, bufread);
 
   if (_config->_columnType == AsciiSource::Config::Fixed) {
-    for (int i = 0; i < n; i++, s++) {
+    for (int i = 0; i < n; ++i, ++s) {
       // Read appropriate column and convert to double
       v[i] = atof(_tmpBuf + _rowIndex[i] - _rowIndex[0] + _config->_columnWidth * (col - 1));
     }
   } else if (_config->_columnType == AsciiSource::Config::Custom) {
-    for (int i = 0; i < n; i++, s++) {
+    for (int i = 0; i < n; ++i, ++s) {
       bool incol = false;
       uint i_col = 0;
-      v[i] = 0.0;
+      v[i] = KST::NOPOINT;
       for (int ch = _rowIndex[s] - bufstart; ch < bufread; ++ch) {
         if (_config->_columnDelimiter.contains(_tmpBuf[ch])) {
           incol = false;
@@ -523,8 +523,6 @@
               } else if (ch + 2 < bufread && tolower(_tmpBuf[ch]) == 'i' &&
                   tolower(_tmpBuf[ch + 1]) == 'n' && tolower(_tmpBuf[ch + 2]) == 'f') {
                 v[i] = INF;
-              } else {
-                v[i] = NAN;
               }
               break;
             }
@@ -537,7 +535,7 @@
       bool incol = false;
       uint i_col = 0;
       
-      v[i] = 0.0;
+      v[i] = KST::NOPOINT;
       for (int ch = _rowIndex[s] - bufstart; ch < bufread; ++ch) {     
         if (isspace(_tmpBuf[ch])) {
           if (_tmpBuf[ch] == '\n' || _tmpBuf[ch] == '\r') {
@@ -557,8 +555,6 @@
               } else if (ch + 2 < bufread && tolower(_tmpBuf[ch]) == 'i' &&
                   tolower(_tmpBuf[ch + 1]) == 'n' && tolower(_tmpBuf[ch + 2]) == 'f') {
                 v[i] = INF;
-              } else {
-                v[i] = NAN;
               }
               break;
             }


More information about the Kst mailing list