X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=conproc.c;h=ccbb849c9c2a44c0183521a988af2dc80b86bc2e;hp=38e031bd7b68333cd66d31fe050765cd91abe8c6;hb=8507719df58bf767983c92ecfa32a70090bf501e;hpb=8dcce44300385b12c46d494c06aadcfa35a8bc14 diff --git a/conproc.c b/conproc.c index 38e031bd..ccbb849c 100644 --- a/conproc.c +++ b/conproc.c @@ -19,9 +19,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // conproc.c +#include "quakedef.h" + #include +#include #include "conproc.h" -#include "quakedef.h" HANDLE heventDone; HANDLE hfileBuffer; @@ -37,7 +39,7 @@ BOOL GetScreenBufferLines (int *piLines); BOOL SetScreenBufferLines (int iLines); BOOL ReadText (LPTSTR pszText, int iBeginLine, int iEndLine); BOOL WriteText (LPCTSTR szText); -int CharToCode (char c); +int CharToCode (int c); BOOL SetConsoleCXCY(HANDLE hStdout, int cx, int cy); @@ -54,11 +56,11 @@ void InitConProc (HANDLE hFile, HANDLE heventParent, HANDLE heventChild) heventChildSend = heventChild; // so we'll know when to go away. - heventDone = CreateEvent (NULL, FALSE, FALSE, NULL); + heventDone = CreateEvent (NULL, false, false, NULL); if (!heventDone) { - Con_SafePrintf ("Couldn't create heventDone\n"); + Con_Print("Couldn't create heventDone\n"); return; } @@ -70,7 +72,7 @@ void InitConProc (HANDLE hFile, HANDLE heventParent, HANDLE heventChild) &dwID)) { CloseHandle (heventDone); - Con_SafePrintf ("Couldn't create QHOST thread\n"); + Con_Print("Couldn't create QHOST thread\n"); return; } @@ -102,7 +104,7 @@ DWORD RequestProc (DWORD dwNichts) while (1) { - dwRet = WaitForMultipleObjects (2, heventWait, FALSE, INFINITE); + dwRet = WaitForMultipleObjects (2, heventWait, false, INFINITE); // heventDone fired, so we're exiting. if (dwRet == WAIT_OBJECT_0 + 1) @@ -113,7 +115,7 @@ DWORD RequestProc (DWORD dwNichts) // hfileBuffer is invalid. Just leave. if (!pBuffer) { - Con_SafePrintf ("Invalid hfileBuffer\n"); + Con_Print("Invalid hfileBuffer\n"); break; } @@ -231,7 +233,7 @@ BOOL WriteText (LPCTSTR szText) upper = toupper(*sz); rec.EventType = KEY_EVENT; - rec.Event.KeyEvent.bKeyDown = TRUE; + rec.Event.KeyEvent.bKeyDown = true; rec.Event.KeyEvent.wRepeatCount = 1; rec.Event.KeyEvent.wVirtualKeyCode = upper; rec.Event.KeyEvent.wVirtualScanCode = CharToCode (*sz); @@ -245,7 +247,7 @@ BOOL WriteText (LPCTSTR szText) 1, &dwWritten); - rec.Event.KeyEvent.bKeyDown = FALSE; + rec.Event.KeyEvent.bKeyDown = false; WriteConsoleInput( hStdin, @@ -256,11 +258,11 @@ BOOL WriteText (LPCTSTR szText) sz++; } - return TRUE; + return true; } -int CharToCode (char c) +int CharToCode (int c) { char upper; @@ -299,7 +301,7 @@ BOOL SetConsoleCXCY(HANDLE hStdout, int cx, int cy) cx = coordMax.X; if (!GetConsoleScreenBufferInfo(hStdout, &info)) - return FALSE; + return false; // height info.srWindow.Left = 0; @@ -309,27 +311,27 @@ BOOL SetConsoleCXCY(HANDLE hStdout, int cx, int cy) if (cy < info.dwSize.Y) { - if (!SetConsoleWindowInfo(hStdout, TRUE, &info.srWindow)) - return FALSE; + if (!SetConsoleWindowInfo(hStdout, true, &info.srWindow)) + return false; info.dwSize.Y = cy; if (!SetConsoleScreenBufferSize(hStdout, info.dwSize)) - return FALSE; + return false; } else if (cy > info.dwSize.Y) { info.dwSize.Y = cy; if (!SetConsoleScreenBufferSize(hStdout, info.dwSize)) - return FALSE; + return false; - if (!SetConsoleWindowInfo(hStdout, TRUE, &info.srWindow)) - return FALSE; + if (!SetConsoleWindowInfo(hStdout, true, &info.srWindow)) + return false; } if (!GetConsoleScreenBufferInfo(hStdout, &info)) - return FALSE; + return false; // width info.srWindow.Left = 0; @@ -339,25 +341,25 @@ BOOL SetConsoleCXCY(HANDLE hStdout, int cx, int cy) if (cx < info.dwSize.X) { - if (!SetConsoleWindowInfo(hStdout, TRUE, &info.srWindow)) - return FALSE; + if (!SetConsoleWindowInfo(hStdout, true, &info.srWindow)) + return false; info.dwSize.X = cx; if (!SetConsoleScreenBufferSize(hStdout, info.dwSize)) - return FALSE; + return false; } else if (cx > info.dwSize.X) { info.dwSize.X = cx; if (!SetConsoleScreenBufferSize(hStdout, info.dwSize)) - return FALSE; + return false; - if (!SetConsoleWindowInfo(hStdout, TRUE, &info.srWindow)) - return FALSE; + if (!SetConsoleWindowInfo(hStdout, true, &info.srWindow)) + return false; } - return TRUE; + return true; }