summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-05-16 12:47:44 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-05-16 12:47:44 +0000
commit88d54cd78bf73348e4f207ab3f741aa374f28b1c (patch)
treed9310acf36b480d31f0c1527520fe7376f7953ca /test
parent36546824762618bbe76d4ac72b632ca9927acd9f (diff)
Massive update to use strlcpy() and strlcat() instead of strncpy()
and strncat() in almost all places (there are still a few strncpy's that need to be used...) Added configure check for strlcat() and strlcpy(). Added emulation code for strlcat() and strlcpy(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2239 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test')
-rw-r--r--test/checkers.cxx20
-rw-r--r--test/makedepend24
2 files changed, 15 insertions, 29 deletions
diff --git a/test/checkers.cxx b/test/checkers.cxx
index 0aba83082..65b33a4ca 100644
--- a/test/checkers.cxx
+++ b/test/checkers.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: checkers.cxx,v 1.9.2.7.2.1 2002/01/01 15:11:32 easysw Exp $"
+// "$Id: checkers.cxx,v 1.9.2.7.2.2 2002/05/16 12:47:43 easysw Exp $"
//
// Checkers game for the Fast Light Tool Kit (FLTK).
//
@@ -56,11 +56,10 @@ const char* copyright =
#define FLTK
//#define VT100
-#include <string.h>
+#include "../src/flstring.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
-#include <ctype.h>
#include <time.h>
////////////////////////////////////////////////////////////////
@@ -1057,15 +1056,6 @@ void Board::animate(node* move, int backwards) {
int busy; // causes pop-up abort menu
-void message(const char* m, ...) {
- char buffer[2048];
- va_list a;
- va_start(a,m);
- vsprintf(buffer, m, a);
- va_end(a);
- fl_message(buffer);
-}
-
void Board::computer_move(int help) {
if (!playing) return;
cursor(FL_CURSOR_WAIT);
@@ -1075,7 +1065,7 @@ void Board::computer_move(int help) {
busy = 0;
if (move) {
if (!help && move->value <= -30000) {
- message("%s resigns", move->who ? "White" : "Black");
+ fl_message("%s resigns", move->who ? "White" : "Black");
playing = autoplay = 0;
cursor(FL_CURSOR_DEFAULT);
return;
@@ -1085,7 +1075,7 @@ void Board::computer_move(int help) {
}
expandnode(root);
if (!root->son) {
- message("%s has no move", root->who ? "Black" : "White");
+ fl_message("%s has no move", root->who ? "Black" : "White");
playing = autoplay = 0;
}
if (!autoplay) cursor(FL_CURSOR_DEFAULT);
@@ -1365,5 +1355,5 @@ int main(int argc, char **argv) {
}
//
-// End of "$Id: checkers.cxx,v 1.9.2.7.2.1 2002/01/01 15:11:32 easysw Exp $".
+// End of "$Id: checkers.cxx,v 1.9.2.7.2.2 2002/05/16 12:47:43 easysw Exp $".
//
diff --git a/test/makedepend b/test/makedepend
index 1c748b81e..86b02c0a9 100644
--- a/test/makedepend
+++ b/test/makedepend
@@ -32,15 +32,15 @@ buttons.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H ../FL/Fl_Button.H
buttons.o: ../FL/Fl_Repeat_Button.H ../FL/Fl.H ../FL/Fl_Check_Button.H
buttons.o: ../FL/Fl_Light_Button.H ../FL/Fl_Light_Button.H
buttons.o: ../FL/Fl_Round_Button.H ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H
-checkers.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
-checkers.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-checkers.o: ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/x.H
-checkers.o: ../FL/fl_draw.H ../FL/Fl_Menu_Item.H ../FL/fl_ask.H black_1.xbm
-checkers.o: black_2.xbm black_3.xbm black_4.xbm white_1.xbm white_2.xbm
-checkers.o: white_3.xbm white_4.xbm blackking_1.xbm blackking_2.xbm
-checkers.o: blackking_3.xbm blackking_4.xbm whiteking_1.xbm whiteking_2.xbm
-checkers.o: whiteking_3.xbm whiteking_4.xbm ../FL/Fl_Box.H ../FL/Fl_Slider.H
-checkers.o: ../FL/Fl_Valuator.H ../FL/Fl_Value_Output.H
+checkers.o: ../src/flstring.h ../config.h ../FL/Fl.H ../FL/Enumerations.H
+checkers.o: ../FL/Fl_Export.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H
+checkers.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+checkers.o: ../FL/Fl_Image.H ../FL/x.H ../FL/fl_draw.H ../FL/Fl_Menu_Item.H
+checkers.o: ../FL/fl_ask.H black_1.xbm black_2.xbm black_3.xbm black_4.xbm
+checkers.o: white_1.xbm white_2.xbm white_3.xbm white_4.xbm blackking_1.xbm
+checkers.o: blackking_2.xbm blackking_3.xbm blackking_4.xbm whiteking_1.xbm
+checkers.o: whiteking_2.xbm whiteking_3.xbm whiteking_4.xbm ../FL/Fl_Box.H
+checkers.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Value_Output.H
clock.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H
clock.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Clock.H
clock.o: ../FL/Fl_Round_Clock.H ../FL/Fl_Clock.H
@@ -320,11 +320,7 @@ tabs.o: tabs.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
tabs.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Tabs.H
tabs.o: ../FL/Fl_Group.H ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Button.H
tabs.o: ../FL/Fl_Clock.H ../FL/Fl_Return_Button.H ../FL/Fl_Button.H
-threads.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
-threads.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
-threads.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
-threads.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Value_Output.H
-threads.o: threads.h
+threads.o: ../config.h ../FL/fl_ask.H ../FL/Enumerations.H ../FL/Fl_Export.H
tile.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
tile.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H
tile.o: ../FL/Fl_Widget.H ../FL/Fl_Tile.H ../FL/Fl_Box.H