diff options
author | ntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-12-13 12:44:39 +0000 |
---|---|---|
committer | ntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-12-13 12:44:39 +0000 |
commit | 0cba0d4df3fe120f08945703506f8405760325c9 (patch) | |
tree | e5db80cbe83e58a1f1fb1be3d66a4730353f3842 /src/jtag/gw16012.c | |
parent | 846a2589a4161dc1e8e3730c9510a54381c26a5e (diff) |
- remove target specific variant and use target->variant member
- fix build warning in cortex_m3
- code cleanup - remove trailing lf and convert c++ comments
git-svn-id: svn://svn.berlios.de/openocd/trunk@1238 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/jtag/gw16012.c')
-rw-r--r-- | src/jtag/gw16012.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/jtag/gw16012.c b/src/jtag/gw16012.c index 60ad5699..e03cea93 100644 --- a/src/jtag/gw16012.c +++ b/src/jtag/gw16012.c @@ -438,26 +438,26 @@ int gw16012_execute_queue(void) #if PARPORT_USE_GIVEIO == 1 int gw16012_get_giveio_access() { - HANDLE h; - OSVERSIONINFO version; - - version.dwOSVersionInfoSize = sizeof version; - if (!GetVersionEx( &version )) { - errno = EINVAL; - return -1; - } - if (version.dwPlatformId != VER_PLATFORM_WIN32_NT) - return 0; + HANDLE h; + OSVERSIONINFO version; - h = CreateFile( "\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); - if (h == INVALID_HANDLE_VALUE) { - errno = ENODEV; - return -1; - } + version.dwOSVersionInfoSize = sizeof version; + if (!GetVersionEx( &version )) { + errno = EINVAL; + return -1; + } + if (version.dwPlatformId != VER_PLATFORM_WIN32_NT) + return 0; - CloseHandle( h ); + h = CreateFile( "\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); + if (h == INVALID_HANDLE_VALUE) { + errno = ENODEV; + return -1; + } - return 0; + CloseHandle( h ); + + return 0; } #endif |