From: H.G. Muller Date: Thu, 19 Aug 2010 11:45:04 +0000 (+0200) Subject: Fix some MSVC compile errors X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=4385cc4c1ac6cf82a28b2990d62f934f4f3038b1;p=xboard.git 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. --- 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