From: martin-s Date: Tue, 25 Jan 2011 14:42:54 +0000 (+0000) Subject: Fix:support_win32:MSVC fixes|Thanks chollya X-Git-Tag: navit-0.5.0.5194svn~1182 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74a3e990d269aa574adaff94da4c12922588a192;p=profile%2Fivi%2Fnavit.git Fix:support_win32:MSVC fixes|Thanks chollya git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4013 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/navit/support/win32/serial_io.c b/navit/navit/support/win32/serial_io.c index 643201c..a1cc77f 100644 --- a/navit/navit/support/win32/serial_io.c +++ b/navit/navit/support/win32/serial_io.c @@ -20,6 +20,8 @@ int serial_io_init( const char* port, const char* strsettings ) { HANDLE hCom = NULL; + DCB dcb; + COMMTIMEOUTS sCT; char strport[16]; snprintf( strport, sizeof( strport ), "\\\\.\\%s", port ); @@ -54,8 +56,6 @@ int serial_io_init( const char* port, const char* strsettings ) return -1; } - DCB dcb; - ZeroMemory(&dcb, sizeof(DCB)); GetCommState(hCom, &dcb); @@ -66,8 +66,6 @@ int serial_io_init( const char* port, const char* strsettings ) SetCommState(hCom, &dcb); - COMMTIMEOUTS sCT; - memset(&sCT, 0, sizeof(sCT)); sCT.ReadTotalTimeoutConstant = 10; @@ -94,9 +92,9 @@ int serial_io_init( const char* port, const char* strsettings ) **/ int serial_io_read( int fd, char * buffer, int buffer_size ) { + DWORD dwBytesIn = 0; dbg(1, "serial_io_read fd = %d buffer_size = %d\n", fd, buffer_size); - DWORD dwBytesIn = 0; if (fd <= 0) { @@ -139,9 +137,9 @@ int serial_io_read( int fd, char * buffer, int buffer_size ) **/ int serial_io_write(int fd, const char * buffer) { + DWORD dwBytesOut = 0; dbg(1, "serial_io_write fd = %d buffer = '%s'\n",fd, buffer); - DWORD dwBytesOut = 0; WriteFile((HANDLE)fd, buffer, strlen(buffer), &dwBytesOut, NULL);