extern HWND hwndMain; /* root window*/\r
extern BOOLEAN alwaysOnTop;\r
extern RECT boardRect;\r
-extern COLORREF lightSquareColor, darkSquareColor, whitePieceColor, \r
+extern COLORREF lightSquareColor, darkSquareColor, whitePieceColor,\r
blackPieceColor, highlightSquareColor, premoveHighlightColor;\r
extern HPALETTE hPal;\r
extern BoardSize boardSize;\r
LRESULT CALLBACK TimeControl(HWND, UINT, WPARAM, LPARAM);\r
VOID ChangeBoardSize(BoardSize newSize);\r
VOID PaintSampleSquare(\r
- HWND hwnd, \r
- int ctrlid, \r
- COLORREF squareColor, \r
+ HWND hwnd,\r
+ int ctrlid,\r
+ COLORREF squareColor,\r
COLORREF pieceColor,\r
COLORREF squareOutlineColor,\r
COLORREF pieceDetailColor,\r
BOOL isWhitePiece,\r
BOOL isMono,\r
- HBITMAP pieces[3] \r
+ HBITMAP pieces[3]\r
);\r
VOID PaintColorBlock(HWND hwnd, int ctrlid, COLORREF color);\r
VOID SetBoardOptionEnables(HWND hDlg);\r
appData.icsActive || !appData.noChessProgram);\r
EnableWindow(GetDlgItem(hDlg, OPT_PonderNextMove),\r
!appData.noChessProgram);\r
- EnableWindow(GetDlgItem(hDlg, OPT_PeriodicUpdates), \r
+ EnableWindow(GetDlgItem(hDlg, OPT_PeriodicUpdates),\r
!appData.noChessProgram && !appData.icsActive);\r
- EnableWindow(GetDlgItem(hDlg, OPT_ShowThinking), \r
+ EnableWindow(GetDlgItem(hDlg, OPT_ShowThinking),\r
!appData.noChessProgram);\r
return TRUE;\r
\r
switch (LOWORD(wParam)) {\r
case IDOK:\r
/* Read changed options from the dialog box */\r
- \r
+\r
#define IS_CHECKED(x) (Boolean)IsDlgButtonChecked(hDlg, (x))\r
\r
alwaysOnTop = IS_CHECKED(OPT_AlwaysOnTop);\r
ClearHighlights();\r
DrawPosition(FALSE, NULL);\r
}\r
- /* \r
+ /*\r
* for some reason the redraw seems smoother when we invalidate\r
* the board rect after the call to EndDialog()\r
*/\r
InitDrawingSizes(boardSize, 0);\r
} else if (oldShowButtonBar != appData.showButtonBar) {\r
InitDrawingSizes(boardSize, 0);\r
- } else if ((oldShowCoords != appData.showCoords) || \r
+ } else if ((oldShowCoords != appData.showCoords) ||\r
(oldBlindfold != appData.blindfold)) {\r
InvalidateRect(hwndMain, &boardRect, FALSE);\r
}\r
return FALSE;\r
}\r
\r
-VOID \r
+VOID\r
GeneralOptionsPopup(HWND hwnd)\r
{\r
FARPROC lpProc;\r
\r
VOID\r
PaintSampleSquare(\r
- HWND hwnd, \r
- int ctrlid, \r
- COLORREF squareColor, \r
+ HWND hwnd,\r
+ int ctrlid,\r
+ COLORREF squareColor,\r
COLORREF pieceColor,\r
COLORREF squareOutlineColor,\r
COLORREF pieceDetailColor,\r
BOOL isWhitePiece,\r
BOOL isMono,\r
- HBITMAP pieces[3] \r
+ HBITMAP pieces[3]\r
)\r
{\r
HBRUSH brushSquare;\r
brushPiece = CreateSolidBrush(pieceColor);\r
brushPieceDetail = CreateSolidBrush(pieceDetailColor);\r
\r
- /* \r
- * first draw the rectangle \r
+ /*\r
+ * first draw the rectangle\r
*/\r
pen = CreatePen(PS_SOLID, BORDER, squareOutlineColor);\r
oldPen = (HPEN) SelectObject(hdcMem, pen);\r
oldBrushSquare = (HBRUSH)SelectObject(hdcMem, brushSquare);\r
Rectangle(hdcMem, rect.left, rect.top, rect.right, rect.bottom);\r
\r
- /* \r
+ /*\r
* now draw the piece\r
*/\r
if (isMono) {\r
if (isWhitePiece) {\r
oldBitmapTemp = SelectObject(hdcTemp, pieces[WHITE]);\r
oldBrushPiece = SelectObject(hdcMem, brushPiece);\r
- BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE, \r
+ BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE,\r
hdcTemp, 0, 0, 0x00B8074A);\r
/* Use black for outline of white pieces */\r
SelectObject(hdcTemp, pieces[OUTLINE]);\r
- BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE, \r
+ BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE,\r
hdcTemp, 0, 0, SRCAND);\r
} else {\r
/* Use square color for details of black pieces */\r
oldBitmapTemp = SelectObject(hdcTemp, pieces[SOLID]);\r
oldBrushPiece = SelectObject(hdcMem, brushPiece);\r
- BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE, \r
+ BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE,\r
hdcTemp, 0, 0, 0x00B8074A);\r
}\r
SelectObject(hdcMem, oldBrushPiece);\r
SelectObject(hdcTemp, oldBitmapTemp);\r
}\r
- /* \r
+ /*\r
* copy the memory dc to the screen\r
*/\r
SelectObject(hdcMem, bufferBitmap);\r
rect.bottom - rect.top,\r
hdcMem, rect.left, rect.top, SRCCOPY);\r
SelectObject(hdcMem, oldBitmapMem);\r
- /* \r
+ /*\r
* clean up\r
*/\r
SelectObject(hdcMem, oldBrushPiece);\r
}\r
}\r
\r
-BoardSize \r
+BoardSize\r
BoardOptionsWhichRadio(HWND hDlg)\r
{\r
return (IsDlgButtonChecked(hDlg, OPT_SizeTiny) ? SizeTiny :\r
pieces[0] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "s");\r
pieces[1] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "w");\r
pieces[2] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "o");\r
- \r
+\r
lsc = lightSquareColor;\r
dsc = darkSquareColor;\r
wpc = whitePieceColor;\r
case WM_COMMAND: /* message: received a command */\r
switch (LOWORD(wParam)) {\r
case IDOK:\r
- /* \r
+ /*\r
* if we call EndDialog() after the call to ChangeBoardSize(),\r
* then ChangeBoardSize() does not take effect, although the new\r
* boardSize is saved. Go figure...\r
return TRUE;\r
\r
case OPT_ChooseLightSquareColor:\r
- if (ChangeColor(hDlg, &lsc)) \r
+ if (ChangeColor(hDlg, &lsc))\r
PaintColorBlock(hDlg, OPT_LightSquareColor, lsc);\r
PaintSampleSquare(hDlg, OPT_SampleLightSquare, lsc, wpc, hsc, bpc,\r
TRUE, mono, pieces);\r
break;\r
\r
case OPT_ChooseDarkSquareColor:\r
- if (ChangeColor(hDlg, &dsc)) \r
+ if (ChangeColor(hDlg, &dsc))\r
PaintColorBlock(hDlg, OPT_DarkSquareColor, dsc);\r
PaintSampleSquare(hDlg, OPT_SampleDarkSquare, dsc, bpc, phc, wpc,\r
FALSE, mono, pieces);\r
break;\r
\r
case OPT_ChooseWhitePieceColor:\r
- if (ChangeColor(hDlg, &wpc)) \r
+ if (ChangeColor(hDlg, &wpc))\r
PaintColorBlock(hDlg, OPT_WhitePieceColor, wpc);\r
PaintSampleSquare(hDlg, OPT_SampleLightSquare, lsc, wpc, hsc, bpc,\r
TRUE, mono, pieces);\r
break;\r
\r
case OPT_ChooseBlackPieceColor:\r
- if (ChangeColor(hDlg, &bpc)) \r
+ if (ChangeColor(hDlg, &bpc))\r
PaintColorBlock(hDlg, OPT_BlackPieceColor, bpc);\r
PaintSampleSquare(hDlg, OPT_SampleDarkSquare, dsc, bpc, phc, wpc,\r
FALSE, mono, pieces);\r
break;\r
\r
case OPT_ChooseHighlightSquareColor:\r
- if (ChangeColor(hDlg, &hsc)) \r
+ if (ChangeColor(hDlg, &hsc))\r
PaintColorBlock(hDlg, OPT_HighlightSquareColor, hsc);\r
PaintSampleSquare(hDlg, OPT_SampleLightSquare, lsc, wpc, hsc, bpc,\r
TRUE, mono, pieces);\r
break;\r
\r
case OPT_ChoosePremoveHighlightColor:\r
- if (ChangeColor(hDlg, &phc)) \r
+ if (ChangeColor(hDlg, &phc))\r
PaintColorBlock(hDlg, OPT_PremoveHighlightColor, phc);\r
PaintSampleSquare(hDlg, OPT_SampleDarkSquare, dsc, bpc, phc, wpc,\r
FALSE, mono, pieces);\r
case WM_COMMAND: /* message: received a command */\r
switch (LOWORD(wParam)) {\r
case IDOK:\r
- /* \r
+ /*\r
* if we call EndDialog() after the call to ChangeBoardSize(),\r
* then ChangeBoardSize() does not take effect, although the new\r
* boardSize is saved. Go figure...\r
EndDialog(hDlg, TRUE);\r
\r
v = VariantWhichRadio(hDlg);\r
- if(!appData.noChessProgram) { char *name = VariantName(v), buf[MSG_SIZ];\r
+ if(!appData.noChessProgram) {\r
+ char *name = VariantName(v), buf[MSG_SIZ];\r
if (first.protocolVersion > 1 && StrStr(first.variants, name) == NULL) {\r
- /* [HGM] in protocol 2 we check if variant is suported by engine */\r
- sprintf(buf, _("Variant %s not supported by %s"), name, first.tidy);\r
- DisplayError(buf, 0);\r
- return TRUE; /* treat as _("Cancel") if first engine does not support it */\r
+ /* [HGM] in protocol 2 we check if variant is suported by engine */\r
+ snprintf(buf, MSG_SIZ, _("Variant %s not supported by %s"), name, first.tidy);\r
+ DisplayError(buf, 0);\r
+ return TRUE; /* treat as _("Cancel") if first engine does not support it */\r
} else\r
if (second.initDone && second.protocolVersion > 1 && StrStr(second.variants, name) == NULL) {\r
- sprintf(buf, _("Warning: second engine (%s) does not support this!"), second.tidy);\r
- DisplayError(buf, 0); /* use of second engine is optional; only warn user */\r
+ snprintf(buf, MSG_SIZ, _("Warning: second engine (%s) does not support this!"), second.tidy);\r
+ DisplayError(buf, 0); /* use of second engine is optional; only warn user */\r
}\r
}\r
\r
{\r
CHARFORMAT cf;\r
cf.cbSize = sizeof(CHARFORMAT);\r
- cf.dwMask = \r
+ cf.dwMask =\r
CFM_COLOR|CFM_CHARSET|CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_STRIKEOUT|CFM_FACE|CFM_SIZE;\r
cf.crTextColor = mca->color;\r
cf.dwEffects = mca->effects;\r
safeStrCpy(cf.szFaceName, font[boardSize][CONSOLE_FONT]->mfp.faceName, sizeof(cf.szFaceName)/sizeof(cf.szFaceName[0]) );\r
- /* \r
+ /*\r
* The 20.0 below is in fact documented. yHeight is expressed in twips.\r
* A twip is 1/20 of a font's point size. See documentation of CHARFORMAT.\r
* --msw\r
CheckDlgButton(hDlg, OPT_Strikeout, (mca.effects & CFE_STRIKEOUT) != 0);\r
\r
/* get the current background color from the parent window */\r
- SendMessage(GetWindow(hDlg, GW_OWNER),WM_COMMAND, \r
- (WPARAM)WM_USER_GetConsoleBackground, \r
+ SendMessage(GetWindow(hDlg, GW_OWNER),WM_COMMAND,\r
+ (WPARAM)WM_USER_GetConsoleBackground,\r
(LPARAM)&background);\r
\r
/* set the background color */\r
cf.cbSize = sizeof(CHARFORMAT);\r
cf.dwMask = CFM_COLOR;\r
cf.crTextColor = mca.color;\r
- SendDlgItemMessage(hwndConsole, OPT_ConsoleInput, \r
+ SendDlgItemMessage(hwndConsole, OPT_ConsoleInput,\r
EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf);\r
}\r
EndDialog(hDlg, TRUE);\r
\r
#undef CHECK_BOX\r
\r
- sprintf(buf, "%d", appData.icsAlarmTime / 1000);\r
+ snprintf(buf, MSG_SIZ, "%d", appData.icsAlarmTime / 1000);\r
SetDlgItemText(hDlg, OPT_IcsAlarmTime, buf);\r
SetDlgItemText(hDlg, OPT_PremoveWhiteText, appData.premoveWhiteText);\r
SetDlgItemText(hDlg, OPT_PremoveBlackText, appData.premoveBlackText);\r
case WM_COMMAND: /* message: received a command */\r
switch (LOWORD(wParam)) {\r
\r
- case WM_USER_GetConsoleBackground: \r
+ case WM_USER_GetConsoleBackground:\r
/* the ColorizeTextDialog needs the current background color */\r
colorref = (COLORREF *)lParam;\r
*colorref = cbc;\r
cf.dwMask = CFM_COLOR;\r
cf.crTextColor = ParseColorName(COLOR_NORMAL);\r
\r
- SendDlgItemMessage(hwndConsole, OPT_ConsoleInput, \r
+ SendDlgItemMessage(hwndConsole, OPT_ConsoleInput,\r
EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf);\r
- SendDlgItemMessage(hwndConsole, OPT_ConsoleText, \r
+ SendDlgItemMessage(hwndConsole, OPT_ConsoleText,\r
EM_SETBKGNDCOLOR, FALSE, background);\r
- SendDlgItemMessage(hwndConsole, OPT_ConsoleInput, \r
+ SendDlgItemMessage(hwndConsole, OPT_ConsoleInput,\r
EM_SETBKGNDCOLOR, FALSE, background);\r
}\r
\r
if (cbc != consoleBackgroundColor) {\r
consoleBackgroundColor = cbc;\r
if (appData.colorize) {\r
- SendDlgItemMessage(hwndConsole, OPT_ConsoleText, \r
+ SendDlgItemMessage(hwndConsole, OPT_ConsoleText,\r
EM_SETBKGNDCOLOR, FALSE, consoleBackgroundColor);\r
- SendDlgItemMessage(hwndConsole, OPT_ConsoleInput, \r
+ SendDlgItemMessage(hwndConsole, OPT_ConsoleInput,\r
EM_SETBKGNDCOLOR, FALSE, consoleBackgroundColor);\r
}\r
}\r
\r
case OPT_ChooseChannel1Color:\r
ColorizeTextPopup(hDlg, ColorChannel1);\r
- UpdateSampleText(hDlg, OPT_SampleChannel1, \r
+ UpdateSampleText(hDlg, OPT_SampleChannel1,\r
&colorizeAttribs[ColorChannel1]);\r
break;\r
\r
\r
case OPT_DefaultColors:\r
for (i=0; i < NColorClasses - 1; i++)\r
- ParseAttribs(&mca[i].color, \r
+ ParseAttribs(&mca[i].color,\r
&mca[i].effects,\r
defaultTextAttribs[i]);\r
\r
POINT center;\r
int len;\r
\r
- len = sprintf(buf, "%.0f pt. %s%s%s\n",\r
- mf->mfp.pointSize, mf->mfp.faceName,\r
- mf->mfp.bold ? " bold" : "",\r
- mf->mfp.italic ? " italic" : "");\r
+ len = snprintf(buf, MSG_SIZ, "%.0f pt. %s%s%s\n",\r
+ mf->mfp.pointSize, mf->mfp.faceName,\r
+ mf->mfp.bold ? " bold" : "",\r
+ mf->mfp.italic ? " italic" : "");\r
SetDlgItemText(hwnd, id, buf);\r
\r
hControl = GetDlgItem(hwnd, id);\r
hdc = GetDC(hControl);\r
SetMapMode(hdc, MM_TEXT); /* 1 pixel == 1 logical unit */\r
oldFont = SelectObject(hdc, mf->hf);\r
- \r
+\r
/* get number of logical units necessary to display font name */\r
GetTextExtentPoint32(hdc, buf, len, &size);\r
\r
- /* calculate formatting rectangle in the rich edit control. \r
+ /* calculate formatting rectangle in the rich edit control.\r
* May be larger or smaller than the actual control.\r
*/\r
GetClientRect(hControl, &rectClient);\r
dest->mfp.underline = src->mfp.underline;\r
dest->mfp.strikeout = src->mfp.strikeout;\r
dest->mfp.charset = src->mfp.charset;\r
- lsafeStrCpy(dest->mfp.faceName, src->mfp.faceName, sizeof(dest->mfp.faceName)/sizeof(dest->mfp.faceName[0]) );\r
+ safeStrCpy(dest->mfp.faceName, src->mfp.faceName, sizeof(dest->mfp.faceName)/sizeof(dest->mfp.faceName[0]) );\r
CreateFontInMF(dest);\r
}\r
\r
\r
if (commentDialog) {\r
SendDlgItemMessage(commentDialog, OPT_CommentText,\r
- WM_SETFONT, (WPARAM)font[boardSize][COMMENT_FONT]->hf, \r
+ WM_SETFONT, (WPARAM)font[boardSize][COMMENT_FONT]->hf,\r
MAKELPARAM(TRUE, 0));\r
GetClientRect(GetDlgItem(commentDialog, OPT_CommentText), &rect);\r
InvalidateRect(commentDialog, &rect, TRUE);\r
\r
if (editTagsDialog) {\r
SendDlgItemMessage(editTagsDialog, OPT_TagsText,\r
- WM_SETFONT, (WPARAM)font[boardSize][EDITTAGS_FONT]->hf, \r
+ WM_SETFONT, (WPARAM)font[boardSize][EDITTAGS_FONT]->hf,\r
MAKELPARAM(TRUE, 0));\r
GetClientRect(GetDlgItem(editTagsDialog, OPT_TagsText), &rect);\r
InvalidateRect(editTagsDialog, &rect, TRUE);\r
\r
if( moveHistoryDialog != NULL ) {\r
SendDlgItemMessage(moveHistoryDialog, IDC_MoveHistory,\r
- WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, \r
+ WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf,\r
MAKELPARAM(TRUE, 0));\r
SendMessage( moveHistoryDialog, WM_INITDIALOG, 0, 0 );\r
// InvalidateRect(editTagsDialog, NULL, TRUE); // [HGM] this ws improperly cloned?\r
\r
if( engineOutputDialog != NULL ) {\r
SendDlgItemMessage(engineOutputDialog, IDC_EngineMemo1,\r
- WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, \r
+ WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf,\r
MAKELPARAM(TRUE, 0));\r
SendDlgItemMessage(engineOutputDialog, IDC_EngineMemo2,\r
- WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, \r
+ WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf,\r
MAKELPARAM(TRUE, 0));\r
}\r
\r
while (scd->label) {\r
err = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) T_(scd->label));\r
if (err != cnt++) {\r
- sprintf(buf, "InitSoundCombo(): err '%d', cnt '%d'\n",\r
+ snprintf(buf, MSG_SIZ, "InitSoundCombo(): err '%d', cnt '%d'\n",\r
(int)err, (int)cnt);\r
MessageBox(NULL, buf, NULL, MB_OK);\r
}\r
DisplaySelectedSound(HWND hDlg, HWND hCombo, const char *name)\r
{\r
int radio;\r
- /* \r
+ /*\r
* I think it's best to clear the combo and edit boxes. It looks stupid\r
* to have a value from another sound event sitting there grayed out.\r
*/\r
radio = OPT_NoSound;\r
} else {\r
radio = OPT_BuiltInSound;\r
- if (SendMessage(hCombo, CB_SELECTSTRING, (WPARAM) -1, \r
+ if (SendMessage(hCombo, CB_SELECTSTRING, (WPARAM) -1,\r
(LPARAM) (name + 1)) == CB_ERR) {\r
SendMessage(hCombo, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0);\r
SendMessage(hCombo, WM_SETTEXT, (WPARAM) 0, (LPARAM) (name + 1));\r
SoundDialogSetEnables(hDlg, radio);\r
CheckRadioButton(hDlg, OPT_NoSound, OPT_WavFile, radio);\r
}\r
- \r
+\r
\r
char *builtInSoundNames[] = BUILT_IN_SOUND_NAMES;\r
\r
\r
case WM_COMMAND: /* message: received a command */\r
\r
- if (((HWND)lParam == hSoundCombo) && \r
+ if (((HWND)lParam == hSoundCombo) &&\r
(HIWORD(wParam) == CBN_SELCHANGE)) {\r
- /* \r
+ /*\r
* the user has selected a new sound event. We must store the name for\r
* the previously selected event, then retrieve the name for the\r
- * newly selected event and update the dialog. \r
+ * newly selected event and update the dialog.\r
*/\r
radio = SoundDialogWhichRadio(hDlg);\r
newName = strdup(SoundDialogGetName(hDlg, radio));\r
- \r
+\r
if (strcmp(newName, soundComboData[index].name) != 0) {\r
free(soundComboData[index].name);\r
soundComboData[index].name = newName;\r
/* now get the settings for the newly selected event */\r
index = SendMessage(hSoundCombo, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);\r
DisplaySelectedSound(hDlg, hBISN, soundComboData[index].name);\r
- \r
+\r
return TRUE;\r
}\r
switch (LOWORD(wParam)) {\r
case IDOK:\r
- /* \r
- * save the name for the currently selected sound event \r
+ /*\r
+ * save the name for the currently selected sound event\r
*/\r
radio = SoundDialogWhichRadio(hDlg);\r
newName = strdup(SoundDialogGetName(hDlg, radio));\r
}\r
for ( cc = (ColorClass)0; cc < NColorClasses - 2; cc++) {\r
index = (int)cc + (int)NSoundClasses;\r
- if (strcmp(soundComboData[index].name, \r
+ if (strcmp(soundComboData[index].name,\r
textAttribs[cc].sound.name) != 0) {\r
free(textAttribs[cc].sound.name);\r
textAttribs[cc].sound.name = strdup(soundComboData[index].name);\r
{\r
char *flow = "??", *parity = "??", *stopBits = "??";\r
ComboData *cd;\r
- \r
+\r
cd = cdParity;\r
while (cd->label != NULL) {\r
if (dcb->Parity == cd->value) {\r
\r
hwndCombo = GetDlgItem(hDlg, OPT_DataRate);\r
InitCombo(hwndCombo, cdDataRate);\r
- sprintf(buf, "%u", (int)dcb.BaudRate);\r
+ snprintf(buf, MSG_SIZ, "%u", (int)dcb.BaudRate);\r
if (SendMessage(hwndCombo, CB_SELECTSTRING, (WPARAM) -1, (LPARAM) buf) == CB_ERR) {\r
SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0);\r
SendMessage(hwndCombo, WM_SETTEXT, (WPARAM) 0, (LPARAM) buf);\r
}\r
if (!SetCommState(hCommPort, (LPDCB) &dcb)) {\r
err = GetLastError();\r
- switch(MessageBox(hDlg, \r
+ switch(MessageBox(hDlg,\r
"Failed to set comm port state;\r\ninvalid options?",\r
_("Option Error"), MB_ABORTRETRYIGNORE|MB_ICONQUESTION)) {\r
case IDABORT:\r
/* Initialize the dialog items */\r
if (appData.timeDelay >= 0.0) {\r
CheckDlgButton(hDlg, OPT_Autostep, TRUE);\r
- sprintf(buf, "%.2g", appData.timeDelay);\r
+ snprintf(buf, MSG_SIZ, "%.2g", appData.timeDelay);\r
SetDlgItemText(hDlg, OPT_ASTimeDelay, buf);\r
} else {\r
CheckDlgButton(hDlg, OPT_Autostep, FALSE);\r
}\r
\r
\r
-VOID \r
+VOID\r
LoadOptionsPopup(HWND hwnd)\r
{\r
FARPROC lpProc = MakeProcInstance((FARPROC)LoadOptions, hInst);\r
return TRUE;\r
\r
case OPT_AVBrowse:\r
- f = OpenFileDialog(hDlg, "a", NULL, \r
- appData.oldSaveStyle ? "gam" : "pgn", \r
- GAME_FILT, _("Browse for Auto Save File"), \r
+ f = OpenFileDialog(hDlg, "a", NULL,\r
+ appData.oldSaveStyle ? "gam" : "pgn",\r
+ GAME_FILT, _("Browse for Auto Save File"),\r
NULL, NULL, buf);\r
if (f != NULL) {\r
fclose(f);\r
\r
case IDC_BrowseForBook:\r
{\r
- char filter[] = { \r
+ char filter[] = {\r
'A','l','l',' ','F','i','l','e','s', 0,\r
'*','.','*', 0,\r
'B','I','N',' ','F','i','l','e','s', 0,\r