[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegames/kpat
From:       Parker Coates <parker.coates () gmail ! com>
Date:       2009-08-13 21:30:01
Message-ID: 1250199001.733797.9315.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1011066 by coates:

Converted all instances of double to qreal.

I'm told this is generally a good idea.

 M  +1 -1      card.cpp  
 M  +1 -1      card.h  
 M  +2 -2      dealer.cpp  
 M  +1 -1      patsolve/gypsy.cpp  
 M  +2 -2      patsolve/patsolve.cpp  
 M  +1 -1      patsolve/patsolve.h  
 M  +1 -1      pile.cpp  
 M  +4 -4      pile.h  
 M  +1 -1      view.cpp  


--- trunk/KDE/kdegames/kpat/card.cpp #1011065:1011066
@@ -182,7 +182,7 @@
 // middle of a destination pile.
 qreal  Card::Hz = 0;
 
-void Card::setZValue(double z)
+void Card::setZValue(qreal z)
 {
     QGraphicsPixmapItem::setZValue(z);
     if (z > Hz)
--- trunk/KDE/kdegames/kpat/card.h #1011065:1011066
@@ -90,7 +90,7 @@
 
     void         moveTo( qreal x2, qreal y2, qreal z, int duration);
     void         flipTo( qreal x, qreal y, int duration );
-    void         setZValue(double z);
+    void         setZValue(qreal z);
     void         getUp();
 
     qreal        realX() const;
--- trunk/KDE/kdegames/kpat/dealer.cpp #1011065:1011066
@@ -1361,7 +1361,7 @@
             CardList cards = mh->card()->source()->cards();
             while (cards.count() && cards.first() != t)
                 cards.erase(cards.begin());
-            QList<double> xs, ys;
+            QList<qreal> xs, ys;
             for ( CardList::Iterator it2 = cards.begin(); it2 != cards.end(); ++it2 )
             {
                 QPointF p = ( *it2 )->pos();
@@ -1369,7 +1369,7 @@
                 ys.append( p.y() );
             }
 
-            double z = mh->pile()->zValue() + 1;
+            qreal z = mh->pile()->zValue() + 1;
             if ( mh->pile()->top() )
                 z = mh->pile()->top()->zValue() + 1;
             t->source()->moveCards(cards, mh->pile());
--- trunk/KDE/kdegames/kpat/patsolve/gypsy.cpp #1011065:1011066
@@ -372,7 +372,7 @@
                     }
                     if ( o > -1 )
                         continue;
-                    mp->pri = ( int )qMin( 127., params[1] + double( l ) * params[5] / 10 );
+                    mp->pri = ( int )qMin( 127., params[1] + qreal( l ) * params[5] / 10 );
                 }
                 n++;
                 mp++;
--- trunk/KDE/kdegames/kpat/patsolve/patsolve.cpp #1011065:1011066
@@ -780,8 +780,8 @@
 
         int nout = getOuts();
 
-        static double Yparam[] = { 0.0032, 0.32, -3.0 };
-	double x = (Yparam[0] * nout + Yparam[1]) * nout + Yparam[2];
+        static qreal Yparam[] = { 0.0032, 0.32, -3.0 };
+	qreal x = (Yparam[0] * nout + Yparam[1]) * nout + Yparam[2];
 	pri += (int)floor(x + .5);
 
 	if (pri < 0) {
--- trunk/KDE/kdegames/kpat/patsolve/patsolve.h #1011065:1011066
@@ -128,7 +128,7 @@
 
     bool m_newer_piles_first;
     unsigned long Total_generated, Total_positions;
-    double depth_sum;
+    qreal depth_sum;
 
     POSITION *Stack;
     QMap<qint32,bool> recu_pos;
--- trunk/KDE/kdegames/kpat/pile.cpp #1011065:1011066
@@ -132,7 +132,7 @@
     delete m_relayoutTimer;
 }
 
-void Pile::setPilePos( double x,  double y )
+void Pile::setPilePos( qreal x,  qreal y )
 {
     _pilePos = QPointF( x, y );
     rescale();
--- trunk/KDE/kdegames/kpat/pile.h #1011065:1011066
@@ -122,10 +122,10 @@
 
 
     // The spread properties.
-    double spread() const    { return _spread; }
-    void setSpread(double s)  { _spread = s; }
+    qreal spread() const    { return _spread; }
+    void setSpread(qreal s)  { _spread = s; }
 
-    void setPilePos( double x, double y);
+    void setPilePos( qreal x, qreal y);
     QPointF pilePos() const;
 
     void rescale();
@@ -160,7 +160,7 @@
 private:
     PileType  _atype;
     PileType  _rtype;
-    double    _spread;
+    qreal    _spread;
 
     int _checkIndex;
     int myIndex;
--- trunk/KDE/kdegames/kpat/view.cpp #1011065:1011066
@@ -93,7 +93,7 @@
 {
     if ( e->modifiers() & Qt::ControlModifier )
     {
-        qreal scaleFactor = pow((double)2, -e->delta() / (10*120.0));
+        qreal scaleFactor = pow((qreal)2, -e->delta() / (10*120.0));
         cardMap::self()->setCardWidth( int( cardMap::self()->cardWidth() / scaleFactor ) );
     }
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic