[Kde-cygwin-cvs] CVS: qt-2/src/tools qdir_unix.cpp,1.3,1.4 qfile.cpp,1.5,1.6 qfile_unix.cpp,1.5,1.6
Status: Inactive
Brought to you by:
habacker
From: Ralf H. <hab...@us...> - 2002-07-29 06:52:12
|
Update of /cvsroot/kde-cygwin/qt-2/src/tools In directory usw-pr-cvs1:/tmp/cvs-serv11370/src/tools Modified Files: qdir_unix.cpp qfile.cpp qfile_unix.cpp qfiledefs_p.h Log Message: fixed HANDLE type bug Index: qdir_unix.cpp =================================================================== RCS file: /cvsroot/kde-cygwin/qt-2/src/tools/qdir_unix.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- qdir_unix.cpp 1 Apr 2002 16:55:30 -0000 1.3 +++ qdir_unix.cpp 29 Jul 2002 06:52:09 -0000 1.4 @@ -218,7 +218,7 @@ #endif QFileInfo fi; - HANDLE handle; + NT_HANDLE handle; WIN32_FIND_DATA ep; char *winpath = win32path(dPath.data()); @@ -233,7 +233,7 @@ strcat(winpath,"\\*.*"); handle = FindFirstFileA (winpath, &ep); DWORD lasterr = GetLastError (); - if (handle == INVALID_HANDLE_VALUE && (lasterr != ERROR_NO_MORE_FILES)) { + if (handle == (NT_HANDLE)INVALID_HANDLE_VALUE && (lasterr != ERROR_NO_MORE_FILES)) { #if defined(CHECK_NULL) qWarning( "QDir::readDirEntries: Cannot read the directory: %s", QFile::encodeName(dPath).data() ); Index: qfile.cpp =================================================================== RCS file: /cvsroot/kde-cygwin/qt-2/src/tools/qfile.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- qfile.cpp 1 Apr 2002 16:55:31 -0000 1.5 +++ qfile.cpp 29 Jul 2002 06:52:09 -0000 1.6 @@ -294,7 +294,7 @@ if ( isNative() ) { // native file // optimised line reading for Win32 native. DWORD dwRead; - BOOL success = ReadFile((HANDLE)d, p, maxlen, &dwRead, NULL); + BOOL success = ReadFile((NT_HANDLE)d, p, maxlen, &dwRead, NULL); if (!success) { nread = -1; setStatus(IO_ReadError); Index: qfile_unix.cpp =================================================================== RCS file: /cvsroot/kde-cygwin/qt-2/src/tools/qfile_unix.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- qfile_unix.cpp 1 Apr 2002 16:55:31 -0000 1.5 +++ qfile_unix.cpp 29 Jul 2002 06:52:09 -0000 1.6 @@ -173,17 +173,17 @@ (isWritable() && ((flags() & IO_Truncate) == 0))?OPEN_ALWAYS:0 | !isWritable()?OPEN_EXISTING:0, FILE_ATTRIBUTE_NORMAL, - (HANDLE)NULL); - if ( ((HANDLE)d) != INVALID_HANDLE_VALUE ) { + (NT_HANDLE)NULL); + if ( ((NT_HANDLE)d) != (NT_HANDLE)INVALID_HANDLE_VALUE ) { if (flags() & IO_Append) { - DWORD dwLength = SetFilePointer((HANDLE)d, 0L, NULL, FILE_END); // set the file pointer to the end for append mode + DWORD dwLength = SetFilePointer((NT_HANDLE)d, 0L, NULL, FILE_END); // set the file pointer to the end for append mode if (dwLength == INVALID_SET_FILE_POINTER) { length = INT_MAX; setType( IO_Sequential ); } else length = dwLength; } else { - DWORD dwLength = GetFileSize((HANDLE)d, NULL); + DWORD dwLength = GetFileSize((NT_HANDLE)d, NULL); if (dwLength == INVALID_FILE_SIZE) { length = INT_MAX; setType( IO_Sequential ); @@ -445,7 +445,7 @@ if ( isOpen() ) { #ifdef _OS_CYGWIN_WIN32_ if ( isNative() ) { - DWORD dwLength = GetFileSize((HANDLE)d, NULL); + DWORD dwLength = GetFileSize((NT_HANDLE)d, NULL); return dwLength; } else #endif @@ -494,7 +494,7 @@ bool ok; #ifdef _OS_CYGWIN_WIN32_ if ( isNative() ) { // native file - DWORD dwPos = SetFilePointer((HANDLE)d, pos, NULL, SEEK_SET); + DWORD dwPos = SetFilePointer((NT_HANDLE)d, pos, NULL, SEEK_SET); ok = dwPos != INVALID_SET_FILE_POINTER; } else if ( isRaw() ) { #else @@ -563,7 +563,7 @@ #ifdef _OS_CYGWIN_WIN32_ if ( isNative() ) { // native file DWORD dwRead; - BOOL success = ReadFile((HANDLE)d, p, len-nread, &dwRead, NULL); + BOOL success = ReadFile((NT_HANDLE)d, p, len-nread, &dwRead, NULL); if (!success) { nread = 0; setStatus(IO_ReadError); @@ -629,7 +629,7 @@ #ifdef _OS_CYGWIN_WIN32_ if ( isNative() ) { // native file DWORD dwWritten; - BOOL success = WriteFile((HANDLE)d, p, len, &dwWritten, NULL); + BOOL success = WriteFile((NT_HANDLE)d, p, len, &dwWritten, NULL); nwritten = dwWritten; } else if ( isRaw() ) #else @@ -645,7 +645,7 @@ setStatus( IO_WriteError ); #ifdef _OS_CYGWIN_WIN32_ if ( isNative() ) { - DWORD dwPos = SetFilePointer((HANDLE)d, 0L, NULL, FILE_CURRENT); + DWORD dwPos = SetFilePointer((NT_HANDLE)d, 0L, NULL, FILE_CURRENT); ioIndex = dwPos; } else if ( isRaw() ) #else @@ -715,8 +715,8 @@ bool ok = FALSE; if ( isOpen() ) { // file is not open #ifdef _OS_CYGWIN_WIN32_ - if ( ((HANDLE)d) != INVALID_HANDLE_VALUE) - CloseHandle((HANDLE)d); + if ( ((NT_HANDLE)d) != (NT_HANDLE)INVALID_HANDLE_VALUE) + CloseHandle((NT_HANDLE)d); else if ( fh) { #else if ( fh ) { // buffered file Index: qfiledefs_p.h =================================================================== RCS file: /cvsroot/kde-cygwin/qt-2/src/tools/qfiledefs_p.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- qfiledefs_p.h 1 Apr 2002 16:55:31 -0000 1.4 +++ qfiledefs_p.h 29 Jul 2002 06:52:09 -0000 1.5 @@ -258,7 +258,10 @@ bool isSymLink; }; #ifdef _OS_CYGWIN_WIN32_ +#include <qwindowdefs.h> +#define HANDLE NT_HANDLE #include <windows.h> +#undef HANDLE #include <sys/cygwin.h> #include <stdlib.h> |