[Kst] kdeextragear-2/kst/kst (silent)

Andrew Walker arwalker at sumusltd.com
Fri Nov 26 19:26:33 CET 2004


CVS commit by arwalker: 

Format changes

CVS_SILENT


  M +39 -22    ksthistogram.cpp   1.38
  M +10 -5     ksthsdialog_i.cpp   1.72


--- kdeextragear-2/kst/kst/ksthistogram.cpp  #1.37:1.38
@@ -112,7 +112,7 @@ void KstHistogram::commonConstructor(con
     MaxX = xmin_in;
   }
-  if (MaxX==MinX) {
-    MaxX+=1;
-    MinX-=1;
+  if (MaxX == MinX) {
+    MaxX += 1.0;
+    MinX -= 1.0;
   }
 
@@ -149,9 +149,10 @@ KstHistogram::~KstHistogram() {
 KstObject::UpdateType KstHistogram::update(int update_counter) {
   int i_bin, i_pt, ns;
-  double y=0;
-  double MaxY;
+  double y = 0.0;
+  double MaxY = 0.0;
 
-  if (KstObject::checkUpdateCounter(update_counter))
+  if (KstObject::checkUpdateCounter(update_counter)) {
     return NO_CHANGE;
+  }
 
   if (update_counter > 0) {
@@ -159,5 +160,7 @@ KstObject::UpdateType KstHistogram::upda
   }
 
-  //do auto-binning if necessary
+  //
+  // do auto-binning if necessary
+  //
   if (_realTimeAutoBin) {
     int temp_NBins;
@@ -184,9 +187,9 @@ KstObject::UpdateType KstHistogram::upda
   }
 
-  MaxY = 0;
-
   for (i_bin=0; i_bin<NBins; i_bin++) {
-    y=Bins[i_bin];
-    if (y>MaxY) MaxY = y;
+    y = Bins[i_bin];
+    if (y > MaxY) {
+      MaxY = y;
+    }
   }
 
@@ -200,10 +203,18 @@ KstObject::UpdateType KstHistogram::upda
         break;
       case KST_HS_FRACTION:
-        if (ns>0) Normalization = 1.0/(double)ns;
-        else Normalization = 1.0;
+        if (ns > 0) {
+          Normalization = 1.0/(double)ns;
+        }
+        else {
+          Normalization = 1.0;
+        }
         break;
       case KST_HS_MAX_ONE:
-        if (MaxY>0) Normalization = 1.0/MaxY;
-        else Normalization = 1.0;
+        if (MaxY > 0) {
+          Normalization = 1.0/MaxY;
+        }
+        else {
+          Normalization = 1.0;
+        }
         break;
       default:
@@ -216,5 +227,5 @@ KstObject::UpdateType KstHistogram::upda
 
   for ( i_bin = 0; i_bin<NBins; i_bin++ ) {
-    bins[i_bin] = ( double( i_bin )+ 0.5 )*W + MinX;
+    bins[i_bin] = ( double( i_bin ) + 0.5 )*W + MinX;
     hist[i_bin] = Bins[i_bin]*Normalization;
   }
@@ -228,7 +239,7 @@ KstObject::UpdateType KstHistogram::upda
 void KstHistogram::point(int i, double &x, double &y) {
   x = (i+1)/3 * W + MinX;
-  if (i%3==0) {
+  if (i % 3 == 0) {
     y = 0;
-  } else if ((i>=0) && (i<NS)) {
+  } else if (i >= 0 && i < NS) {
     y = Bins[i/3]*Normalization;
   } else {
@@ -260,5 +271,7 @@ void KstHistogram::setNBins(int in_n_bin
   NBins = in_n_bins;
 
-  if (NBins<2) NBins = 2;
+  if (NBins < 2) {
+    NBins = 2;
+  }
   Bins = new unsigned long[in_n_bins];
   W = (MaxX - MinX)/(double)NBins;
@@ -372,6 +385,10 @@ void KstHistogram::AutoBin(KstVectorPtr 
   // this has not been done yet, you will notice...
   *n /= 50;
-  if (*n < 6) *n = 6;
-  if (*n > 60) *n = 60;
+  if (*n < 6) {
+    *n = 6;
+  }
+  if (*n > 60) {
+    *n = 60;
+  }
 
   m = (*max - *min)/(100.0*double(*n));

--- kdeextragear-2/kst/kst/ksthsdialog_i.cpp  #1.71:1.72
@@ -318,8 +318,13 @@ bool KstHsDialogI::edit_I() {
   DP->setRealTimeAutoBin(_realTimeAutoBin->isChecked());
 
-  if (NormIsPercent->isChecked()) DP->setIsNormPercent();
-  else if (NormIsFraction->isChecked()) DP->setIsNormFraction();
-  else if (PeakIs1->isChecked()) DP->setIsNormOne();
-  else DP->setIsNormNum();
+  if (NormIsPercent->isChecked()) {
+    DP->setIsNormPercent();
+  } else if (NormIsFraction->isChecked()) {
+    DP->setIsNormFraction();
+  } else if (PeakIs1->isChecked()) {
+    DP->setIsNormOne();
+  } else {
+    DP->setIsNormNum();
+  }
 
   DP->update(-1);





More information about the Kst mailing list