From 27a6dc15aef8b81f365bb0d87ee73ef4651e00d1 Mon Sep 17 00:00:00 2001 From: Eric Mullins Date: Sat, 11 Jul 2009 16:54:53 -0600 Subject: [PATCH] several small fixes uptracked winboard.ini Cleanup: moved "Some definitions required..." from winboard.c to config.h, and combined some definitions from borland w/ MS. Changed internal HtmlHelp return type and 4th argument to facilitate various compilers. These changes, while not strictly adhering to HtmlHelp() conventions, won't impact anything since the function modified is internal only. Modified HtmlHelp return values to integer to silence warnings. Added help.c to the project in makefile.gcc & makefile.ms. Fixed duplicate resource in winboard.rc. --- winboard/config.h | 15 ++- winboard/help.c | 14 +- winboard/makefile.gcc | 2 +- winboard/makefile.ms | 2 +- winboard/winboard.c | 6 +- winboard/winboard.h | 9 -- winboard/winboard.ini | 330 ------------------------------------------------- winboard/winboard.rc | 2 +- 8 files changed, 26 insertions(+), 354 deletions(-) delete mode 100644 winboard/winboard.ini diff --git a/winboard/config.h b/winboard/config.h index a219a96..b1a8f72 100644 --- a/winboard/config.h +++ b/winboard/config.h @@ -126,6 +126,17 @@ #define _strdup(x) strdup(x) #define STRICT #define _winmajor 3 /* windows 95 */ -#define SCF_DEFAULT 0x0000 -#define SCF_ALL 0x0004 +#endif + +/* Some definitions required by MSVC 4.1 */ +#ifndef WM_MOUSEWHEEL +#define WM_MOUSEWHEEL 0x020A +#endif +#ifndef SCF_DEFAULT +#define SCF_DEFAULT 0x0000 +#define SCF_ALL 0x0004 +#endif + +#ifdef _MSC_VER +#define snprintf _snprintf #endif diff --git a/winboard/help.c b/winboard/help.c index a8cebd6..febd0e6 100644 --- a/winboard/help.c +++ b/winboard/help.c @@ -27,8 +27,8 @@ FILE *debugFP; -HWND WINAPI -HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD_PTR data ) +int +HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD data ) { PROCESS_INFORMATION helpProcInfo; STARTUPINFO siStartInfo; @@ -36,13 +36,13 @@ HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD_PTR data ) static int status = 0; FILE *f; - if(status < 0) return NULL; + if(status < 0) return 0; if(!status) { f = fopen(helpFile, "r"); if(f == NULL) { status = -1; - return NULL; + return 0; } status = 1; fclose(f); @@ -76,18 +76,18 @@ HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD_PTR data ) //HWND WINAPI int -MyHelp(HWND hwnd, LPSTR helpFile, UINT action, DWORD_PTR data) +MyHelp(HWND hwnd, LPSTR helpFile, UINT action, DWORD data) { static int status = 0; FILE *f; - if(status < 0) return NULL; + if(status < 0) return 0; if(!status) { f = fopen(helpFile, "r"); if(f == NULL) { status = -1; - return NULL; + return 0; } status = 1; fclose(f); diff --git a/winboard/makefile.gcc b/winboard/makefile.gcc index 5bd49dd..94d67b9 100644 --- a/winboard/makefile.gcc +++ b/winboard/makefile.gcc @@ -7,7 +7,7 @@ PROJ=winboard OBJS=backend.o book.o gamelist.o lists.o moves.o pgntags.o uci.o zippy.o\ parser.o wbres.o wclipbrd.o wedittags.o wengineo.o wevalgraph.o\ wgamelist.o whistory.o winboard.o wlayout.o woptions.o wsnap.o\ - wsockerr.o + wsockerr.o help.o # make compiling less spammy diff --git a/winboard/makefile.ms b/winboard/makefile.ms index d406aef..1e2a2d3 100644 --- a/winboard/makefile.ms +++ b/winboard/makefile.ms @@ -9,7 +9,7 @@ PROJ = winboard OBJS=backend.obj book.obj gamelist.obj lists.obj moves.obj pgntags.obj uci.obj zippy.obj\ parser.obj wclipbrd.obj wedittags.obj wengineo.obj wevalgraph.obj wgamelist.obj\ - whistory.obj winboard.obj wlayout.obj woptions.obj wsnap.obj wsockerr.obj + whistory.obj winboard.obj wlayout.obj woptions.obj wsnap.obj wsockerr.obj help.obj # Debugging? diff --git a/winboard/winboard.c b/winboard/winboard.c index e2d0c81..15ac962 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -106,7 +106,7 @@ int FinishMove P((ChessMove moveType, int fromX, int fromY, int toX, int toY, void AnimateAtomicCapture(int fromX, int fromY, int toX, int toY, int nFrames); void DisplayMove P((int moveNumber)); Boolean ParseFEN P((Board board, int *blackPlaysFirst, char *fen)); -HWND WINAPI HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD_PTR data ); +int HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD data ); typedef struct { ChessSquare piece; @@ -6196,7 +6196,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case IDM_HELPCONTENTS: if (!MyHelp (hwnd, "winboard.hlp", HELP_KEY,(DWORD)(LPSTR)"CONTENTS") && - !HtmlHelp(hwnd, "winboard.chm", 0, NULL) ) { + !HtmlHelp(hwnd, "winboard.chm", 0, 0)) { MessageBox (GetFocus(), "Unable to activate help", szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND); @@ -6205,7 +6205,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case IDM_HELPSEARCH: if (!MyHelp (hwnd, "winboard.hlp", HELP_PARTIALKEY, (DWORD)(LPSTR)"") && - !HtmlHelp(hwnd, "winboard.chm", 0, NULL) ) { + !HtmlHelp(hwnd, "winboard.chm", 0, 0) ) { MessageBox (GetFocus(), "Unable to activate help", szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND); diff --git a/winboard/winboard.h b/winboard/winboard.h index a16496c..b5cd602 100644 --- a/winboard/winboard.h +++ b/winboard/winboard.h @@ -166,15 +166,6 @@ extern MyFont *font[NUM_SIZES][NUM_FONTS]; #define OUTLINE_PIECE 1 #define WHITE_PIECE 2 -/* Some definitions required by MSVC 4.1 */ -#ifndef WM_MOUSEWHEEL -#define WM_MOUSEWHEEL 0x020A -#endif -#ifndef SCF_DEFAULT -#define SCF_DEFAULT 0x0000 -#define SCF_ALL 0x0004 -#endif - #define COPY_TMP "wbcopy.tmp" #define PASTE_TMP "wbpaste.tmp" diff --git a/winboard/winboard.ini b/winboard/winboard.ini deleted file mode 100644 index 5b69f1c..0000000 --- a/winboard/winboard.ini +++ /dev/null @@ -1,330 +0,0 @@ -; -; WinBoard 4.3.15k Save Settings file -; -; You can edit the values of options that are already set in this file, -; but if you add other options, the next Save Settings will not save them. -; Use a shortcut, an @indirection file, or a .bat file instead. -; -/whitePieceColor=#ffffcc -/blackPieceColor=#202020 -/lightSquareColor=#c8c365 -/darkSquareColor=#77a26d -/highlightSquareColor=#ffff00 -/premoveHighlightColor=#ff0000 -/movesPerSession=40 -/timeDelay=1 -/timeControl="5" -/timeIncrement=-1 -/saveGameFile="" -/autoSaveGames=false -/monoMode=false -/showCoords=false -/showThinking=false -/ponderNextMove=true -/periodicUpdates=true -/popupExitMessage=true -/popupMoveErrors=false -/size=tiny /clockFont="Arial:9 b" -/size=teeny /clockFont="Arial:9 b" -/size=dinky /clockFont="Arial:10 b" -/size=petite /clockFont="Arial:10 b" -/size=slim /clockFont="Arial:12 b" -/size=small /clockFont="Arial:14 b" -/size=mediocre /clockFont="Arial:14 b" -/size=middling /clockFont="Arial:14 b" -/size=average /clockFont="Arial:15 b" -/size=moderate /clockFont="Arial:16 b" -/size=medium /clockFont="Arial:16 b" -/size=bulky /clockFont="Arial:17 b" -/size=large /clockFont="Arial:19 b" -/size=big /clockFont="Arial:20 b" -/size=huge /clockFont="Arial:21 b" -/size=giant /clockFont="Arial:22 b" -/size=colossal /clockFont="Arial:23 b" -/size=titanic /clockFont="Arial:24 b" -/size=tiny /messageFont="Small Fonts:6" -/size=teeny /messageFont="Small Fonts:6" -/size=dinky /messageFont="Small Fonts:7" -/size=petite /messageFont="Small Fonts:7" -/size=slim /messageFont="Arial:8 b" -/size=small /messageFont="Arial:9 b" -/size=mediocre /messageFont="Arial:9 b" -/size=middling /messageFont="Arial:9 b" -/size=average /messageFont="Arial:10 b" -/size=moderate /messageFont="Arial:10 b" -/size=medium /messageFont="Arial:10 b" -/size=bulky /messageFont="Arial:10 b" -/size=large /messageFont="Arial:10 b" -/size=big /messageFont="Arial:11 b" -/size=huge /messageFont="Arial:11 b" -/size=giant /messageFont="Arial:11 b" -/size=colossal /messageFont="Arial:12 b" -/size=titanic /messageFont="Arial:12 b" -/size=tiny /coordFont="Small Fonts:4" -/size=teeny /coordFont="Small Fonts:4" -/size=dinky /coordFont="Small Fonts:5" -/size=petite /coordFont="Small Fonts:5" -/size=slim /coordFont="Small Fonts:6" -/size=small /coordFont="Small Fonts:7" -/size=mediocre /coordFont="Small Fonts:7" -/size=middling /coordFont="Small Fonts:7" -/size=average /coordFont="Arial:7 b" -/size=moderate /coordFont="Arial:7 b" -/size=medium /coordFont="Arial:7 b" -/size=bulky /coordFont="Arial:7 b" -/size=large /coordFont="Arial:7 b" -/size=big /coordFont="Arial:8 b" -/size=huge /coordFont="Arial:8 b" -/size=giant /coordFont="Arial:8 b" -/size=colossal /coordFont="Arial:9 b" -/size=titanic /coordFont="Arial:9 b" -/size=tiny /tagsFont="Courier New:8" -/size=teeny /tagsFont="Courier New:8" -/size=dinky /tagsFont="Courier New:8" -/size=petite /tagsFont="Courier New:8" -/size=slim /tagsFont="Courier New:8" -/size=small /tagsFont="Courier New:8" -/size=mediocre /tagsFont="Courier New:8" -/size=middling /tagsFont="Courier New:8" -/size=average /tagsFont="Courier New:8" -/size=moderate /tagsFont="Courier New:8" -/size=medium /tagsFont="Courier New:8" -/size=bulky /tagsFont="Courier New:8" -/size=large /tagsFont="Courier New:8" -/size=big /tagsFont="Courier New:8" -/size=huge /tagsFont="Courier New:8" -/size=giant /tagsFont="Courier New:8" -/size=colossal /tagsFont="Courier New:8" -/size=titanic /tagsFont="Courier New:8" -/size=tiny /commentFont="Arial:9" -/size=teeny /commentFont="Arial:9" -/size=dinky /commentFont="Arial:9" -/size=petite /commentFont="Arial:9" -/size=slim /commentFont="Arial:9" -/size=small /commentFont="Arial:9" -/size=mediocre /commentFont="Arial:9" -/size=middling /commentFont="Arial:9" -/size=average /commentFont="Arial:9" -/size=moderate /commentFont="Arial:9" -/size=medium /commentFont="Arial:9" -/size=bulky /commentFont="Arial:9" -/size=large /commentFont="Arial:9" -/size=big /commentFont="Arial:9" -/size=huge /commentFont="Arial:9" -/size=giant /commentFont="Arial:9" -/size=colossal /commentFont="Arial:9" -/size=titanic /commentFont="Arial:9" -/size=tiny /icsFont="Courier New:8" -/size=teeny /icsFont="Courier New:8" -/size=dinky /icsFont="Courier New:8" -/size=petite /icsFont="Courier New:8" -/size=slim /icsFont="Courier New:8" -/size=small /icsFont="Courier New:8" -/size=mediocre /icsFont="Courier New:8" -/size=middling /icsFont="Courier New:8" -/size=average /icsFont="Courier New:8" -/size=moderate /icsFont="Courier New:8" -/size=medium /icsFont="Courier New:8" -/size=bulky /icsFont="Courier New:8" -/size=large /icsFont="Courier New:8" -/size=big /icsFont="Courier New:8" -/size=huge /icsFont="Courier New:8" -/size=giant /icsFont="Courier New:8" -/size=colossal /icsFont="Courier New:8" -/size=titanic /icsFont="Courier New:8" -/size=tiny /moveHistoryFont="MS Sans Serif:8" -/size=teeny /moveHistoryFont="MS Sans Serif:8" -/size=dinky /moveHistoryFont="MS Sans Serif:8" -/size=petite /moveHistoryFont="MS Sans Serif:8" -/size=slim /moveHistoryFont="MS Sans Serif:8" -/size=small /moveHistoryFont="MS Sans Serif:8" -/size=mediocre /moveHistoryFont="MS Sans Serif:8" -/size=middling /moveHistoryFont="MS Sans Serif:8" -/size=average /moveHistoryFont="MS Sans Serif:8" -/size=moderate /moveHistoryFont="MS Sans Serif:8" -/size=medium /moveHistoryFont="MS Sans Serif:8" -/size=bulky /moveHistoryFont="MS Sans Serif:8" -/size=large /moveHistoryFont="MS Sans Serif:8" -/size=big /moveHistoryFont="MS Sans Serif:8" -/size=huge /moveHistoryFont="MS Sans Serif:8" -/size=giant /moveHistoryFont="MS Sans Serif:8" -/size=colossal /moveHistoryFont="MS Sans Serif:8" -/size=titanic /moveHistoryFont="MS Sans Serif:8" -/boardSize=bulky -/alwaysOnTop=false -/autoCallFlag=false -/autoComment=false -/autoObserve=false -/autoFlipView=true -/autoRaiseBoard=true -/alwaysPromoteToQueen=false -/oldSaveStyle=false -/quietPlay=false -/getMoveList=true -/testLegality=true -/premove=true -/premoveWhite=false -/premoveWhiteText="" -/premoveBlack=false -/premoveBlackText="" -/icsAlarm=true -/icsAlarmTime=5000 -/animateMoving=true -/animateSpeed=10 -/animateDragging=true -/blindfold=false -/highlightLastMove=true -/highlightDragging=false -/colorizeMessages=true -/colorShout="#209000" -/colorSShout="b #289808" -/colorChannel1="#2020e0" -/colorChannel="b #4040ff" -/colorKibitz="b #ff00ff" -/colorTell="b #ff0000" -/colorChallenge="bi #ff0000" -/colorRequest="bi #ff0000" -/colorSeek="#980808" -/colorNormal="#000000" -/colorBackground=#ffffff -/soundShout="" -/soundSShout="" -/soundChannel1="" -/soundChannel="" -/soundKibitz="" -/soundTell="" -/soundChallenge="" -/soundRequest="" -/soundSeek="" -/soundMove="" -/soundBell="$" -/soundIcsWin="" -/soundIcsLoss="" -/soundIcsDraw="" -/soundIcsUnfinished="" -/soundIcsAlarm="" -/comPortSettings=9600,7,Space,1,None -/x=10 -/y=30 -/icsX=-2147483648 -/icsY=-2147483648 -/icsW=-2147483648 -/icsH=-2147483648 -/analysisX=-2147483648 -/analysisY=-2147483648 -/analysisW=-2147483648 -/analysisH=-2147483648 -/commentX=-2147483648 -/commentY=-2147483648 -/commentW=-2147483648 -/commentH=-2147483648 -/tagsX=-2147483648 -/tagsY=-2147483648 -/tagsW=-2147483648 -/tagsH=-2147483648 -/gameListX=-2147483648 -/gameListY=-2147483648 -/gameListW=-2147483648 -/gameListH=-2147483648 -/saveSettingsOnExit=true -/icsMenu={- -&Who,who,0,1 -Playe&rs,players,0,1 -&Games,games,0,1 -&Sought,sought,0,1 -|&Tell (name),tell,1,0 -M&essage (name),message,1,0 -- -&Finger (name),finger,1,1 -&Vars (name),vars,1,1 -&Observe (name),observe,1,1 -&Match (name),match,1,1 -Pl&ay (name),play,1,1 -} -/icsNames={chessclub.com /icsport=5000 /icshelper=timestamp -freechess.org /icsport=5000 /icshelper=timeseal -global.chessparlor.com /icsport=6000 /icshelper=timeseal -chessanytime.com /icsport=5000 -chess.net /icsport=5000 -zics.org /icsport=5000 -jogo.cex.org.br /icsport=5000 -ajedrez.cec.uchile.cl /icsport=5000 -fly.cc.fer.hr /icsport=7890 -freechess.nl /icsport=5000 /icshelper=timeseal -jeu.echecs.com /icsport=5000 -chess.unix-ag.uni-kl.de /icsport=5000 /icshelper=timeseal -chess.mds.mdh.se /icsport=5000 -} -/firstChessProgramNames={GNUChess -"GNUChes5 xboard" -} -/secondChessProgramNames={GNUChess -"GNUChes5 xboard" -} -/showButtonBar=true -/pgnExtendedInfo=false -/hideThinkingFromHuman=false -/liteBackTextureFile="" -/darkBackTextureFile="" -/liteBackTextureMode=1 -/darkBackTextureMode=1 -/renderPiecesWithFont="" -/fontPieceToCharTable="" -/fontPieceBackColorWhite=#000000 -/fontPieceForeColorWhite=#000000 -/fontPieceBackColorBlack=#000000 -/fontPieceForeColorBlack=#000000 -/fontPieceSize=80 -/overrideLineGap=1 -/adjudicateLossThreshold=0 -/delayBeforeQuit=0 -/delayAfterQuit=0 -/pgnEventHeader="Computer Chess Game" -/defaultFrcPosition=-1 -/gameListTags="eprd" -/saveOutOfBookInfo=true -/showEvalInMoveHistory=true -/evalHistColorWhite=#ffffb0 -/evalHistColorBlack=#ad5d3d -/highlightMoveWithArrow=false -/highlightArrowColor=#ffff80 -/stickyWindows=true -/adjudicateDrawMoves=0 -/autoDisplayComment=true -/autoDisplayTags=true -/polyglotDir="" -/usePolyglotBook=false -/polyglotBook="" -/defaultHashSize=64 -/defaultCacheSizeEGTB=4 -/defaultPathEGTB="c:\egtb" -/moveHistoryUp=false -/moveHistoryX=136 -/moveHistoryY=224 -/moveHistoryW=346 -/moveHistoryH=237 -/evalGraphUp=false -/evalGraphX=136 -/evalGraphY=224 -/evalGraphW=332 -/evalGraphH=148 -/engineOutputUp=false -/engineOutputX=136 -/engineOutputY=224 -/engineOutputW=407 -/engineOutputH=297 -/boardWidth=-1 -/boardHeight=-1 -/holdingsSize=-1 -/matchPause=10000 -/flipBlack=false -/allWhite=false -/testClaims=false -/checkMates=false -/materialDraws=false -/trivialDraws=false -/ruleMoves=51 -/repeatsToDraw=6 -/smpCores=1 -/egtFormats="" -/timeOddsMode=0 diff --git a/winboard/winboard.rc b/winboard/winboard.rc index 1d61fd2..5050deb 100644 --- a/winboard/winboard.rc +++ b/winboard/winboard.rc @@ -645,7 +645,7 @@ BEGIN 50,10 CONTROL "&bughouse",OPT_VariantBughouse,"Button",BS_AUTORADIOBUTTON,70,24,50, 10 - CONTROL "&Twilight",OPT_VariantBughouse,"Button",BS_AUTORADIOBUTTON,70,34,50, + CONTROL "&Twilight",OPT_VariantTwilight,"Button",BS_AUTORADIOBUTTON,70,34,50, 10 CONTROL "&shogi",OPT_VariantShogi,"Button",BS_AUTORADIOBUTTON,70, 44,50,10 -- 1.7.0.4