diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/checkers.cxx | 30 | ||||
| -rw-r--r-- | test/colbrowser.cxx | 12 | ||||
| -rw-r--r-- | test/forms.cxx | 10 | ||||
| -rw-r--r-- | test/mandelbrot.cxx | 20 | ||||
| -rw-r--r-- | test/porsche.xpm | 2 |
5 files changed, 37 insertions, 37 deletions
diff --git a/test/checkers.cxx b/test/checkers.cxx index 40c4e7694..21a9a7f74 100644 --- a/test/checkers.cxx +++ b/test/checkers.cxx @@ -1,5 +1,5 @@ // -// "$Id: checkers.cxx,v 1.9.2.6 2001/01/22 15:13:41 easysw Exp $" +// "$Id: checkers.cxx,v 1.9.2.7 2001/04/13 19:07:40 easysw Exp $" // // Checkers game for the Fast Light Tool Kit (FLTK). // @@ -966,8 +966,8 @@ void Board::draw() { fl_rectf(x*BOXSIZE,0,BORDER,h()); fl_rectf(0,x*BOXSIZE,w(),BORDER); } - for (int i = 5; i < 40; i++) if (i != erase_this) { - draw_piece(b[i], squarex(i), squarey(i)); + for (int j = 5; j < 40; j++) if (j != erase_this) { + draw_piece(b[j], squarex(j), squarey(j)); } if (showlegal) { fl_color(FL_WHITE); @@ -1004,13 +1004,13 @@ void Board::draw() { } // drag the piece on square i to dx dy, or undo drag if i is zero: -void Board::drag_piece(int i, int dx, int dy) { +void Board::drag_piece(int j, int dx, int dy) { dy = (dy&-2) | dx&1; // make halftone shadows line up - if (i != erase_this) drop_piece(erase_this); // should not happen + if (j != erase_this) drop_piece(erase_this); // should not happen if (!erase_this) { // pick up old piece - dragx = squarex(i); dragy = squarey(i); - erase_this = i; - dragging = b[i]; + dragx = squarex(j); dragy = squarey(j); + erase_this = j; + dragging = b[j]; } if (dx != dragx || dy != dragy) { damage(FL_DAMAGE_ALL, dragx, dragy, ISIZE, ISIZE); @@ -1021,12 +1021,12 @@ void Board::drag_piece(int i, int dx, int dy) { } // drop currently dragged piece on square i -void Board::drop_piece(int i) { +void Board::drop_piece(int j) { if (!erase_this) return; // should not happen! erase_this = 0; dragging = 0; - int x = squarex(i); - int y = squarey(i); + int x = squarex(j); + int y = squarey(j); if (x != dragx || y != dragy) { damage(4, dragx, dragy, ISIZE, ISIZE); damage(4, x, y, ISIZE, ISIZE); @@ -1045,9 +1045,9 @@ void Board::animate(node* move, int backwards) { int x2 = squarex(t); int y2 = squarey(t); const int STEPS=35; - for (int i=0; i<STEPS; i++) { - int x = x1+(x2-x1)*i/STEPS; - int y = y1+(y2-y1)*i/STEPS; + for (int j=0; j<STEPS; j++) { + int x = x1+(x2-x1)*j/STEPS; + int y = y1+(y2-y1)*j/STEPS; drag_piece(move->from,x,y); Fl::flush(); } @@ -1365,5 +1365,5 @@ int main(int argc, char **argv) { } // -// End of "$Id: checkers.cxx,v 1.9.2.6 2001/01/22 15:13:41 easysw Exp $". +// End of "$Id: checkers.cxx,v 1.9.2.7 2001/04/13 19:07:40 easysw Exp $". // diff --git a/test/colbrowser.cxx b/test/colbrowser.cxx index 99de569b6..af751925a 100644 --- a/test/colbrowser.cxx +++ b/test/colbrowser.cxx @@ -1,5 +1,5 @@ // -// "$Id: colbrowser.cxx,v 1.5.2.3 2001/01/22 15:13:41 easysw Exp $" +// "$Id: colbrowser.cxx,v 1.5.2.4 2001/04/13 19:07:40 easysw Exp $" // // Forms test program for the Fast Light Tool Kit (FLTK). // @@ -44,15 +44,15 @@ static int load_browser(char *); /* the RGB data file does not have a standard location on unix. */ #ifdef __VMS - static char *rgbfile = "SYS$MANAGER:DECW$RGB.DAT"; + static const char *rgbfile = "SYS$MANAGER:DECW$RGB.DAT"; #else #ifdef __EMX__ /* OS2 */ - static char *rgbfile = "/XFree86/lib/X11/rgb.txt"; + static const char *rgbfile = "/XFree86/lib/X11/rgb.txt"; #else #ifdef __FreeBSD__ - static char *rgbfile = "/usr/X11R6/lib/X11/rgb.txt"; + static const char *rgbfile = "/usr/X11R6/lib/X11/rgb.txt"; #else - static char *rgbfile = "/usr/lib/X11/rgb.txt"; + static const char *rgbfile = "/usr/lib/X11/rgb.txt"; #endif #endif #endif @@ -340,5 +340,5 @@ create_form_cl(void) } // -// End of "$Id: colbrowser.cxx,v 1.5.2.3 2001/01/22 15:13:41 easysw Exp $". +// End of "$Id: colbrowser.cxx,v 1.5.2.4 2001/04/13 19:07:40 easysw Exp $". // diff --git a/test/forms.cxx b/test/forms.cxx index f1c3c5fe0..6fb547d95 100644 --- a/test/forms.cxx +++ b/test/forms.cxx @@ -1,5 +1,5 @@ // -// "$Id: forms.cxx,v 1.4.2.3 2001/01/22 15:13:41 easysw Exp $" +// "$Id: forms.cxx,v 1.4.2.4 2001/04/13 19:07:40 easysw Exp $" // // Another forms demo for the Fast Light Tool Kit (FLTK). // @@ -34,7 +34,7 @@ static int border = 1; // changed from FL_TRANSIENT for fltk // (this is so the close box and Esc work to close the window) -typedef struct { int val; char *name; } VN_struct; +typedef struct { int val; const char *name; } VN_struct; #define VN(a) {a,#a} // static VN_struct gmode[] = @@ -165,7 +165,7 @@ create_the_forms (void) /*************** Main Routine ***********************/ -char *browserlines[] = { +const char *browserlines[] = { " ", "@C1@c@l@bObjects Demo", " ", "This demo shows you all", "objects that currently", "exist in the Forms Library.", " ", @@ -184,7 +184,7 @@ int main (int argc, char *argv[]) { FL_COLOR c = FL_BLACK; - char **p; + const char **p; VN_struct *vn; fl_initialize(&argc, argv, "FormDemo", 0, 0); @@ -229,5 +229,5 @@ main (int argc, char *argv[]) } // -// End of "$Id: forms.cxx,v 1.4.2.3 2001/01/22 15:13:41 easysw Exp $". +// End of "$Id: forms.cxx,v 1.4.2.4 2001/04/13 19:07:40 easysw Exp $". // diff --git a/test/mandelbrot.cxx b/test/mandelbrot.cxx index e2ea87f43..67c866818 100644 --- a/test/mandelbrot.cxx +++ b/test/mandelbrot.cxx @@ -1,5 +1,5 @@ // -// "$Id: mandelbrot.cxx,v 1.8.2.3 2001/01/22 15:13:41 easysw Exp $" +// "$Id: mandelbrot.cxx,v 1.8.2.4 2001/04/13 19:07:40 easysw Exp $" // // Mandelbrot set demo for the Fast Light Tool Kit (FLTK). // @@ -171,9 +171,9 @@ int Drawing_Area::handle(int event) { } jbrot.d->jX = X + (ix-x()-W/2)*scale/W; jbrot.d->jY = Y + (H/2-iy+y())*scale/W; - static char buffer[128]; - sprintf(buffer, "Julia %.7f %.7f",jbrot.d->jX,jbrot.d->jY); - jbrot.window->label(buffer); + static char s[128]; + sprintf(s, "Julia %.7f %.7f",jbrot.d->jX,jbrot.d->jY); + jbrot.window->label(s); jbrot.window->show(); jbrot.d->new_display(); } @@ -187,15 +187,15 @@ void Drawing_Area::new_display() { set_idle(); } -void Drawing_Area::resize(int X,int Y,int W,int H) { - if (W != w() || H != h()) { - this->W = W-6; - this->H = H-8; +void Drawing_Area::resize(int XX,int YY,int WW,int HH) { + if (WW != w() || HH != h()) { + W = WW-6; + H = HH-8; if (buffer) {delete[] buffer; buffer = 0; new_display();} } - Fl_Box::resize(X,Y,W,H); + Fl_Box::resize(XX,YY,WW,HH); } // -// End of "$Id: mandelbrot.cxx,v 1.8.2.3 2001/01/22 15:13:41 easysw Exp $". +// End of "$Id: mandelbrot.cxx,v 1.8.2.4 2001/04/13 19:07:40 easysw Exp $". // diff --git a/test/porsche.xpm b/test/porsche.xpm index 1dc60e9b6..be33073ff 100644 --- a/test/porsche.xpm +++ b/test/porsche.xpm @@ -1,5 +1,5 @@ /* XPM */ -static char * porsche_xpm[] = { +static const char * porsche_xpm[] = { "64 64 4 1", " c #background", ". c #000000000000", |
