From 4385cc4c1ac6cf82a28b2990d62f934f4f3038b1 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 19 Aug 2010 13:45:04 +0200 Subject: [PATCH] Fix some MSVC compile errors Some statements has moved up stream of declaratons, which is an error that gcc is forgiving about, but where MSVC is strict. --- backend.c | 2 +- winboard/wchat.c | 5 ++--- winboard/winboard.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/backend.c b/backend.c index d05c721..31d74e2 100644 --- a/backend.c +++ b/backend.c @@ -2206,8 +2206,8 @@ MatchSoughtLine(char *line) int DrawSeekGraph() { - if(!seekGraphUp) return FALSE; int i; + if(!seekGraphUp) return FALSE; h = BOARD_HEIGHT * (squareSize + lineGap) + lineGap; w = BOARD_WIDTH * (squareSize + lineGap) + lineGap; diff --git a/winboard/wchat.c b/winboard/wchat.c index 30b6aa5..80ea286 100644 --- a/winboard/wchat.c +++ b/winboard/wchat.c @@ -389,10 +389,9 @@ void ChatPopDown() void OutputChatMessage(int partner, char *text) { - int j; - if(!chatHandle[partner]) return; + int j, n = strlen(text); - int n = strlen(text); + if(!chatHandle[partner]) return; text[n+1] = 0; text[n] = '\n'; text[n-1] = '\r'; // Needs CR to not lose line breaks on copy-paste InsertIntoMemo(chatHandle[partner], text); if(partner != onTop) for(j=0; j