From 318a837c354c2bea632df7efe0fd5fd2fc7ee099 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 00:58:16 +0000 Subject: [PATCH] last fixes for crt. Those are messing with handles and casting between 32 and 64 bit. I'm not sure if it's correct, probably not... crt and libcntpr now compile warning free on amd64 svn path=/branches/ros-amd64-bringup/; revision=34719 --- reactos/lib/sdk/crt/conio/getch.c | 4 ++-- reactos/lib/sdk/crt/stdio/file.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/lib/sdk/crt/conio/getch.c b/reactos/lib/sdk/crt/conio/getch.c index aee3cf5a46d..e167878ea66 100644 --- a/reactos/lib/sdk/crt/conio/getch.c +++ b/reactos/lib/sdk/crt/conio/getch.c @@ -31,7 +31,7 @@ int _getch(void) * ENABLE_ECHO_INPUT and ENABLE_LINE_INPUT if they're currently * switched on. */ - ConsoleHandle = (HANDLE) _get_osfhandle(stdin->_file); + ConsoleHandle = (HANDLE)(ULONG_PTR) _get_osfhandle(stdin->_file); RestoreMode = GetConsoleMode(ConsoleHandle, &ConsoleMode) && (0 != (ConsoleMode & (ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT))); @@ -39,7 +39,7 @@ int _getch(void) SetConsoleMode(ConsoleHandle, ConsoleMode & (~ (ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT))); } - ReadConsoleA((HANDLE)_get_osfhandle(stdin->_file), + ReadConsoleA((HANDLE)(ULONG_PTR)_get_osfhandle(stdin->_file), &c, 1, &NumberOfCharsRead, diff --git a/reactos/lib/sdk/crt/stdio/file.c b/reactos/lib/sdk/crt/stdio/file.c index 3c26ac9a0ae..383a9f10e86 100644 --- a/reactos/lib/sdk/crt/stdio/file.c +++ b/reactos/lib/sdk/crt/stdio/file.c @@ -1291,7 +1291,7 @@ long CDECL _get_osfhandle(int fd) HANDLE hand = fdtoh(fd); TRACE(":fd (%d) handle (%p)\n",fd,hand); - return (long)hand; + return (long)(LONG_PTR)hand; } /********************************************************************* @@ -1654,7 +1654,7 @@ int CDECL _open_osfhandle(long handle, int oflags) if (!(oflags & (_O_BINARY | _O_TEXT))) oflags |= _O_BINARY; - fd = alloc_fd((HANDLE)handle, split_oflags(oflags)); + fd = alloc_fd((HANDLE)(LONG_PTR)handle, split_oflags(oflags)); TRACE(":handle (%ld) fd (%d) flags 0x%08x\n", handle, fd, oflags); return fd; }