summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2010-10-28 18:10:17 +0000
committerMatthias Melcher <fltk@matthiasm.com>2010-10-28 18:10:17 +0000
commit1b6dae10bff9e86977f7293e14d48fb8b619a1c9 (patch)
treeea229cfa2181cc5c4155fd522981c278edaf05d1
parent291faee430b13248a1b97e1ef254b9a468a67ad1 (diff)
Removing compiler warnings in test apps
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7766 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--test/checkers.cxx20
-rw-r--r--test/colbrowser.cxx7
-rw-r--r--test/navigation.cxx3
3 files changed, 17 insertions, 13 deletions
diff --git a/test/checkers.cxx b/test/checkers.cxx
index c5e116d6a..988542763 100644
--- a/test/checkers.cxx
+++ b/test/checkers.cxx
@@ -195,14 +195,14 @@ char check(int target,int direction) {
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 @@ void evaluateboard(node *n,int print) {
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 @@ void Board::draw() {
// 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);
diff --git a/test/colbrowser.cxx b/test/colbrowser.cxx
index f90559eb9..53018eb2e 100644
--- a/test/colbrowser.cxx
+++ b/test/colbrowser.cxx
@@ -117,8 +117,11 @@ read_entry(FILE * fp, int *r, int *g, int *b, char *name)
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;
diff --git a/test/navigation.cxx b/test/navigation.cxx
index 66a4b7885..eb0959575 100644
--- a/test/navigation.cxx
+++ b/test/navigation.cxx
@@ -57,7 +57,8 @@ int main(int argc, char **argv) {
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;