Author: matt
Date: 2010-10-28 11:10:17 -0700 (Thu, 28 Oct 2010)
New Revision: 7766
Log:
Removing compiler warnings in test apps

Modified:
   branches/branch-1.3/test/checkers.cxx
   branches/branch-1.3/test/colbrowser.cxx
   branches/branch-1.3/test/navigation.cxx

Modified: branches/branch-1.3/test/checkers.cxx
===================================================================
--- branches/branch-1.3/test/checkers.cxx       2010-10-28 18:02:20 UTC (rev 
7765)
+++ branches/branch-1.3/test/checkers.cxx       2010-10-28 18:10:17 UTC (rev 
7766)
@@ -195,14 +195,14 @@
   piece aa = tb[target]; piece bb = tb[src];
   tb[target] = EMPTY; tb[src] = EMPTY;
   int safe =
-    (tb[src-4]&FRIEND && tb[src-8]&ENEMY
-     ||tb[src-5]&FRIEND && tb[src-10]&ENEMY
-     ||tb[dst-4]&ENEMY && !tb[dst+4]
-     ||tb[dst-5]&ENEMY && !tb[dst+5]
-     ||tb[src+4]&FRIEND && tb[src+8]==ENEMYKING
-     ||tb[src+5]&FRIEND && tb[src+10]==ENEMYKING
-     ||tb[dst+4]==ENEMYKING && !tb[dst-4]
-     ||tb[dst+5]==ENEMYKING && !tb[dst-5]);
+    (   (tb[src-4]&FRIEND && tb[src-8]&ENEMY)
+     || (tb[src-5]&FRIEND && tb[src-10]&ENEMY)
+     || (tb[dst-4]&ENEMY && !tb[dst+4])
+     || (tb[dst-5]&ENEMY && !tb[dst+5])
+     || (tb[src+4]&FRIEND && tb[src+8]==ENEMYKING)
+     || (tb[src+5]&FRIEND && tb[src+10]==ENEMYKING)
+     || (tb[dst+4]==ENEMYKING && !tb[dst-4])
+     || (tb[dst+5]==ENEMYKING && !tb[dst-5]));
   tb[target] = aa; tb[src] = bb;
   return(safe);
 }
@@ -290,7 +290,7 @@
   for (i=9; i<40; i++) {
     int x = (gradient[i-4]+gradient[i-5])/2;
     if (tb[i]==FRIEND) total += x;
-    gradient[i] = (tb[i]&FRIEND || !tb[i] && !is_protected[i]) ? x : 0;
+    gradient[i] = (tb[i]&FRIEND || (!tb[i] && !is_protected[i])) ? x : 0;
   }
   n->gradient = total;
 
@@ -1012,7 +1012,7 @@
 
 // drag the piece on square i to dx dy, or undo drag if i is zero:
 void Board::drag_piece(int j, int dx, int dy) {
-  dy = (dy&-2) | dx&1; // make halftone shadows line up
+  dy = (dy&-2) | (dx&1); // make halftone shadows line up
   if (j != erase_this) drop_piece(erase_this); // should not happen
   if (!erase_this) { // pick up old piece
     dragx = squarex(j); dragy = squarey(j);

Modified: branches/branch-1.3/test/colbrowser.cxx
===================================================================
--- branches/branch-1.3/test/colbrowser.cxx     2010-10-28 18:02:20 UTC (rev 
7765)
+++ branches/branch-1.3/test/colbrowser.cxx     2010-10-28 18:10:17 UTC (rev 
7766)
@@ -117,8 +117,11 @@
     if (!fgets(buf, sizeof(buf) - 1, fp))
       return 0;
 
-    if(buf[0] == '!')
-      fgets(buf,sizeof(buf)-1,fp);
+    if(buf[0] == '!') {
+      if (fgets(buf,sizeof(buf)-1,fp)==0) {
+        /* ignore */
+      }
+    }
 
     if(sscanf(buf, " %d %d %d %n", r, g, b, &n) < 3)
        return 0;

Modified: branches/branch-1.3/test/navigation.cxx
===================================================================
--- branches/branch-1.3/test/navigation.cxx     2010-10-28 18:02:20 UTC (rev 
7765)
+++ branches/branch-1.3/test/navigation.cxx     2010-10-28 18:10:17 UTC (rev 
7766)
@@ -57,7 +57,8 @@
       Fl_Widget *o = window.child(n);
       if (x<o->x()+o->w() && x+w>o->x() &&
          y<o->y()+o->h() && y+h>o->y()) break;
-      if (!j && (y < o->y() || y == o->y() && x < o->x())) j = o;
+      if (   (!j && (y < o->y())
+          || (y == o->y() && x < o->x())) ) j = o;
     }
     // skip if intersection:
     if (n < window.children()) continue;

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to