diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-06-30 14:44:35 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-06-30 14:44:35 (GMT) |
commit | 1f5defbdcfd2f9e04267398c581376f57020fcf7 (patch) | |
tree | 497edec3b77023543c30acf369177e81f05b9e8f | |
parent | ef76ed76f8a31f706ee675160e5c57c34b608516 (diff) | |
download | CMake-1f5defbdcfd2f9e04267398c581376f57020fcf7.zip CMake-1f5defbdcfd2f9e04267398c581376f57020fcf7.tar.gz CMake-1f5defbdcfd2f9e04267398c581376f57020fcf7.tar.bz2 |
ERR: Remove warnings on Windows
-rw-r--r-- | Source/kwsys/Base64.c | 10 | ||||
-rw-r--r-- | Source/kwsys/ProcessFwd9x.c | 5 | ||||
-rw-r--r-- | Source/kwsys/ProcessWin32.c | 25 |
3 files changed, 24 insertions, 16 deletions
diff --git a/Source/kwsys/Base64.c b/Source/kwsys/Base64.c index 53d7c46..3a0b17e 100644 --- a/Source/kwsys/Base64.c +++ b/Source/kwsys/Base64.c @@ -62,9 +62,9 @@ static const unsigned char kwsysBase64DecodeTable[256] = }; /*--------------------------------------------------------------------------*/ -static unsigned char kwsysBase64EncodeChar(unsigned char c) +static unsigned char kwsysBase64EncodeChar(int c) { - return kwsysBase64EncodeTable[c]; + return kwsysBase64EncodeTable[(unsigned char)c]; } /*--------------------------------------------------------------------------*/ @@ -176,9 +176,9 @@ int kwsysBase64_Decode3(const unsigned char *src, unsigned char *dest) /* Decode the 3 bytes */ - dest[0] = ((d0 << 2) & 0xFC) | ((d1 >> 4) & 0x03); - dest[1] = ((d1 << 4) & 0xF0) | ((d2 >> 2) & 0x0F); - dest[2] = ((d2 << 6) & 0xC0) | ((d3 >> 0) & 0x3F); + dest[0] = (unsigned char)(((d0 << 2) & 0xFC) | ((d1 >> 4) & 0x03)); + dest[1] = (unsigned char)(((d1 << 4) & 0xF0) | ((d2 >> 2) & 0x0F)); + dest[2] = (unsigned char)(((d2 << 6) & 0xC0) | ((d3 >> 0) & 0x3F)); /* Return the number of bytes actually decoded */ diff --git a/Source/kwsys/ProcessFwd9x.c b/Source/kwsys/ProcessFwd9x.c index a6a428a..0b88054 100644 --- a/Source/kwsys/ProcessFwd9x.c +++ b/Source/kwsys/ProcessFwd9x.c @@ -21,6 +21,9 @@ PURPOSE. See the above copyright notices for more information. Win32 implementation file for details. */ +#ifdef _MSC_VER +#pragma warning (push, 1) +#endif #include <windows.h> #include <stdio.h> @@ -121,7 +124,7 @@ int main() if(waitResult == WAIT_OBJECT_0) { /* We were asked to kill the child. */ - TerminateProcess(pi.hProcess, -1); + TerminateProcess(pi.hProcess, 255); WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); return 1; diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c index 7d11393..488570b 100644 --- a/Source/kwsys/ProcessWin32.c +++ b/Source/kwsys/ProcessWin32.c @@ -35,10 +35,18 @@ Q190351 and Q150956. */ +#ifdef _MSC_VER +#pragma warning (push, 1) +#endif #include <windows.h> /* Windows API */ #include <string.h> /* strlen, strdup */ #include <stdio.h> /* sprintf */ #include <io.h> /* _unlink */ +#ifdef _MSC_VER +#pragma warning (pop) +#pragma warning (disable: 4514) +#pragma warning (disable: 4706) +#endif /* The number of pipes for the child's output. The standard stdout and stderr pipes are the first two. One more pipe is used on Win9x @@ -63,7 +71,7 @@ static void kwsysProcessCleanupHandle(PHANDLE h); static void kwsysProcessCleanup(kwsysProcess* cp, int error); static int kwsysProcessGetTimeoutTime(kwsysProcess* cp, double* userTimeout, kwsysProcessTime* timeoutTime); -static int kwsysProcessGetTimeoutLeft(kwsysProcess* cp, kwsysProcessTime* timeoutTime, +static int kwsysProcessGetTimeoutLeft(kwsysProcessTime* timeoutTime, kwsysProcessTime* timeoutLength); static kwsysProcessTime kwsysProcessTimeGetCurrent(); static DWORD kwsysProcessTimeToDWORD(kwsysProcessTime t); @@ -156,7 +164,7 @@ struct kwsysProcess_s int ExitException; /* The process exit code. */ - int ExitCode; + DWORD ExitCode; /* The process return code, if any. */ int ExitValue; @@ -744,7 +752,7 @@ int kwsysProcess_WaitForData(kwsysProcess* cp, int pipes, char** data, int* leng int pipeId = 0; DWORD w; HANDLE events[2]; - + /* Make sure we are executing a process. */ if(cp->State != kwsysProcess_State_Executing || cp->Killed || cp->TimeoutExpired) @@ -758,10 +766,7 @@ int kwsysProcess_WaitForData(kwsysProcess* cp, int pipes, char** data, int* leng events[1] = cp->ProcessInformation.hProcess; /* Record the time at which user timeout period starts. */ - if(userTimeout) - { - userStartTime = kwsysProcessTimeGetCurrent(); - } + userStartTime = kwsysProcessTimeGetCurrent(); /* Calculate the time at which a timeout will expire, and whether it is the user or process timeout. */ @@ -779,7 +784,7 @@ int kwsysProcess_WaitForData(kwsysProcess* cp, int pipes, char** data, int* leng } /* Setup a timeout if required. */ - if(kwsysProcessGetTimeoutLeft(cp, &timeoutTime, &timeoutLength)) + if(kwsysProcessGetTimeoutLeft(&timeoutTime, &timeoutLength)) { /* Timeout has already expired. */ expired = 1; @@ -1082,7 +1087,7 @@ void kwsysProcess_Kill(kwsysProcess* cp) else { /* Not Windows 9x. Just terminate the child. */ - TerminateProcess(cp->ProcessInformation.hProcess, -1); + TerminateProcess(cp->ProcessInformation.hProcess, 255); } } @@ -1225,7 +1230,7 @@ int kwsysProcessGetTimeoutTime(kwsysProcess* cp, double* userTimeout, /*--------------------------------------------------------------------------*/ /* Get the length of time before the given timeout time arrives. Returns 1 if the time has already arrived, and 0 otherwise. */ -int kwsysProcessGetTimeoutLeft(kwsysProcess* cp, kwsysProcessTime* timeoutTime, +int kwsysProcessGetTimeoutLeft(kwsysProcessTime* timeoutTime, kwsysProcessTime* timeoutLength) { if(timeoutTime->QuadPart < 0) |