[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Wed Nov 23 02:33:06 CET 2005


SVN commit 482470 by staikos:

add a bunch of warning flags commented out for use later and fix a number of
them in kst2dplot.  Too overwhelming to do more, but some actually need
investigation.  Post 1.2 item.


 M  +2 -0      Makefile.am  
 M  +45 -45    kst2dplot.cpp  


--- trunk/extragear/graphics/kst/kst/Makefile.am #482469:482470
@@ -2,6 +2,8 @@
 AM_YFLAGS = -d
 AM_LFLAGS = 
 
+#AM_CXXFLAGS = -Wold-style-cast -Wredundant-decls -Wunused-macros -Wfloat-equal -Wno-multichar
+
 if include_libkstkmdi
 KMDI_SUBDIR=libkstkmdi
 endif
--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #482469:482470
@@ -207,13 +207,13 @@
       } else if (el.tagName() == "pos_y") {
         _pos_y = el.text().toDouble();
       } else if (el.tagName() == "xscalemode") {
-        xscale_in = (KstScaleModeType)el.text().toInt();
+        xscale_in = KstScaleModeType(el.text().toInt());
       } else if (el.tagName() == "yscalemode") {
-        yscale_in = (KstScaleModeType)el.text().toInt();
+        yscale_in = KstScaleModeType(el.text().toInt());
       } else if (el.tagName() == "xscalemodedefault") {
-        _xScaleModeDefault = (KstScaleModeType)el.text().toInt();
+        _xScaleModeDefault = KstScaleModeType(el.text().toInt());
       } else if (el.tagName() == "yscalemodedefault") {
-        _yScaleModeDefault = (KstScaleModeType)el.text().toInt();
+        _yScaleModeDefault = KstScaleModeType(el.text().toInt());
       } else if (el.tagName() == "xmin") {
         xmin_in = el.text().toDouble();
       } else if (el.tagName() == "xmax") {
@@ -266,17 +266,17 @@
       } else if (el.tagName() == "curvetomarkersname") {
         in_curveToMarkersName = el.text();
       } else if (el.tagName() == "curvetomarkersrisingdetect") {
-        in_curveToMarkersRisingDetect = (el.text() != "0");
+        in_curveToMarkersRisingDetect = el.text() != "0";
       } else if (el.tagName() == "curvetomarkersfallingdetect") {
-        in_curveToMarkersFallingDetect = (el.text() != "0");
+        in_curveToMarkersFallingDetect = el.text() != "0";
       } else if (el.tagName() == "xmajorgrid") {
-        _xMajorGrid = (el.text() != "0");
+        _xMajorGrid = el.text() != "0";
       } else if (el.tagName() == "ymajorgrid") {
-        _yMajorGrid = (el.text() != "0");
+        _yMajorGrid = el.text() != "0";
       } else if (el.tagName() == "xminorgrid") {
-        _xMinorGrid = (el.text() != "0");
+        _xMinorGrid = el.text() != "0";
       } else if (el.tagName() == "yminorgrid") {
-        _yMinorGrid = (el.text() != "0");
+        _yMinorGrid = el.text() != "0";
       } else if (el.tagName() == "majorgridcolor") {
         _majorGridColor.setNamedColor(el.text());
       } else if (el.tagName() == "minorgridcolor") {
@@ -286,61 +286,61 @@
       } else if (el.tagName() == "xminorticks") {
         _reqXMinorTicks = el.text().toInt();
       } else if (el.tagName() == "majorgridcolordefault") {
-        _majorGridColorDefault = (el.text() != "0");
+        _majorGridColorDefault = el.text() != "0";
       } else if (el.tagName() == "minorgridcolordefault") {
-        _minorGridColorDefault = (el.text() != "0");
+        _minorGridColorDefault = el.text() != "0";
       } else if (el.tagName() == "xinterpret") {
-        _isXAxisInterpreted = (el.text() != "0");
+        _isXAxisInterpreted = el.text() != "0";
       } else if (el.tagName() == "xinterpretas") {
-        _xAxisInterpretation = (KstAxisInterpretation)el.text().toInt();
+        _xAxisInterpretation = KstAxisInterpretation(el.text().toInt());
       } else if (el.tagName() == "xdisplayas") {
-        _xAxisDisplay = (KstAxisDisplay)el.text().toInt();
+        _xAxisDisplay = KstAxisDisplay(el.text().toInt());
       } else if (el.tagName() == "yinterpret") {
-        _isYAxisInterpreted = (el.text() != "0");
+        _isYAxisInterpreted = el.text() != "0";
       } else if (el.tagName() == "yinterpretas") {
-        _yAxisInterpretation = (KstAxisInterpretation)el.text().toInt();
+        _yAxisInterpretation = KstAxisInterpretation(el.text().toInt());
       } else if (el.tagName() == "ydisplayas") {
-        _yAxisDisplay = (KstAxisDisplay)el.text().toInt();
-      } else if ( el.tagName() == "xoffsetmode") {
-        _xOffsetMode = (el.text() != "0");
-      } else if ( el.tagName() == "yoffsetmode") {
-        _yOffsetMode = (el.text() != "0");
+        _yAxisDisplay = KstAxisDisplay(el.text().toInt());
+      } else if (el.tagName() == "xoffsetmode") {
+        _xOffsetMode = el.text() != "0";
+      } else if (el.tagName() == "yoffsetmode") {
+        _yOffsetMode = el.text() != "0";
       } else if (el.tagName() == "xminexp") {
-        xminexp_in = (el.text());
+        xminexp_in = el.text();
       } else if (el.tagName() == "xmaxexp") {
-        xmaxexp_in = (el.text());
+        xmaxexp_in = el.text();
       } else if (el.tagName() == "yminexp") {
-        yminexp_in = (el.text());
+        yminexp_in = el.text();
       } else if (el.tagName() == "ymaxexp") {
-        ymaxexp_in = (el.text());
+        ymaxexp_in = el.text();
       } else if (el.tagName() == "xticksinplot") {
-        _xTicksInPlot = (el.text() != "0");
+        _xTicksInPlot = el.text() != "0";
       } else if (el.tagName() == "xticksoutplot") {
-        _xTicksOutPlot = (el.text() != "0");
+        _xTicksOutPlot = el.text() != "0";
       } else if (el.tagName() == "yticksinplot") {
-        _yTicksInPlot = (el.text() != "0");
+        _yTicksInPlot = el.text() != "0";
       } else if (el.tagName() == "yticksoutplot") {
-        _yTicksOutPlot = (el.text() != "0");
+        _yTicksOutPlot = el.text() != "0";
       } else if (el.tagName() == "suppresstop") {
-        _suppressTop = (el.text() != "0");
+        _suppressTop = el.text() != "0";
       } else if (el.tagName() == "suppressbottom") {
-        _suppressBottom = (el.text() != "0");
+        _suppressBottom = el.text() != "0";
       } else if (el.tagName() == "suppressleft") {
-        _suppressLeft = (el.text() != "0");
+        _suppressLeft = el.text() != "0";
       } else if (el.tagName() == "suppressright") {
-        _suppressRight = (el.text() != "0");
+        _suppressRight = el.text() != "0";
       } else if (el.tagName() == "xtransformed") {
-        _xTransformed = (el.text() != "0");
+        _xTransformed = el.text() != "0";
       } else if (el.tagName() == "ytransformed") {
-        _yTransformed = (el.text() != "0");
+        _yTransformed = el.text() != "0";
       } else if (el.tagName() == "xtransformedexp") {
         _xTransformedExp = el.text();
       } else if (el.tagName() == "ytransformedexp") {
         _yTransformedExp = el.text();
       } else if (el.tagName() == "xreversed") {
-        _xReversed = (el.text() != "0");
+        _xReversed = el.text() != "0";
       } else if (el.tagName() == "yreversed") {
-        _yReversed = (el.text() != "0");
+        _yReversed = el.text() != "0";
       }
 
     }
@@ -932,7 +932,7 @@
           XMin = 0.0;
           XMax = 1.0;
         }
-        mid /= (double)count;
+        mid /= double(count);
         delta = XMax - XMin;
         XMin = mid - delta / 2.0;
         XMax = mid + delta / 2.0;
@@ -1319,9 +1319,9 @@
   // check how many decimal places we need based on the scale
   getLScale(xmin,ymin,xmax,ymax);
   if (isXLog()) {
-    xdelta = (pow(10.0,xmax)-pow(10.0,xmin))/(double)pr.width();
+    xdelta = (pow(10.0,xmax)-pow(10.0,xmin))/double(pr.width());
   } else {
-    xdelta = (xmax-xmin)/(double)pr.width();
+    xdelta = (xmax-xmin)/double(pr.width());
   }
   xdelta = convertTimeDiffValueToDays(axisInterpretation, xdelta);
   xdelta *= 24.0 * 60.0 * 60.0;
@@ -1361,8 +1361,8 @@
 
   // get time of day from day fraction
   int hour   = int(dDayFraction*24.0);
-  int minute = int((dDayFraction*24.0 - (double)hour)*60.0);
-  double second = ((dDayFraction*24.0 - (double)hour)*60.0 - (double)minute)*60.0;
+  int minute = int((dDayFraction*24.0 - double(hour))*60.0);
+  double second = ((dDayFraction*24.0 - double(hour))*60.0 - double(minute))*60.0;
 
   if (accuracy >= 0) {
     second *= pow(10.0,accuracy);
@@ -1418,10 +1418,10 @@
   }
 
   if (accuracy == 0) {
-    if ((int)second % 10 != 0) {
+    if (int(second) % 10 != 0) {
       length += 6;
     }
-    else if ((int)second != 0) {
+    else if (int(second) != 0) {
       length += 5;
     }
     else if (minute % 10 != 0) {


More information about the Kst mailing list