[REACTOS] Fix a number of MSVC warnings

This commit is contained in:
Timo Kreuzer 2021-06-29 18:50:15 +02:00
parent b1c6c91d1f
commit 5d8e834897
43 changed files with 175 additions and 86 deletions

View file

@ -140,7 +140,7 @@ struct UnicodeString : public RtlUnicodeString {
UnicodeString(size_t len, LPWSTR buffer)
{
alloc_len = len;
alloc_len = (WORD)len;
string_ptr = buffer;
}

View file

@ -233,7 +233,7 @@ extern "C" int wmain (int argc, wchar_t **argv)
// Now set back to the beginning
ScreenInfo.dwCursorPosition.X = 0;
ScreenInfo.dwCursorPosition.Y -= Drives.size();
ScreenInfo.dwCursorPosition.Y -= (USHORT)Drives.size();
SetConsoleCursorPosition (Screen, ScreenInfo.dwCursorPosition);
for (size_t d = 0; d < Drives.size (); d++)

View file

@ -182,10 +182,10 @@ private:
}
string present_value( DWORD type, const char *data, DWORD len ) {
switch( type ) {
default:
//switch( type ) {
//default:
return bindump( data, len );
}
//}
}
void process_valid_request( HKEY open_reg_key, string key_name ) {

View file

@ -67,7 +67,7 @@ public:
virtual BOOL Stop();
virtual LPCServerClientSocket OnGetSocket(LPCServerSocket lpServerSocket);
virtual LPCServerClientThread OnGetThread(LPCServerClientSocket Socket);
virtual void OnAccept(const LPCServerClientThread lpThread);
virtual void OnAccept(LPCServerClientThread lpThread);
private:
HTTPdState State;
};

View file

@ -44,25 +44,25 @@ WriteStringAt(LPWSTR lpString,
WORD wColor)
{
DWORD cWritten = 0;
WORD wLen;
DWORD dwLen;
if (!lpString || *lpString == 0) return;
wLen = wcslen(lpString);
dwLen = (DWORD)wcslen(lpString);
/* Don't bother writing text when erasing */
if (wColor)
{
WriteConsoleOutputCharacterW(ScreenBuffer,
lpString,
wLen,
dwLen,
xy,
&cWritten);
}
FillConsoleOutputAttribute(ScreenBuffer,
wColor,
wLen,
dwLen,
xy,
&cWritten);
}
@ -103,7 +103,7 @@ DisplayTitle(VOID)
LPWSTR szTitle = L"ReactOS Coders Console Parade";
COORD xy;
xy.X = (ScreenBufferInfo.dwSize.X - wcslen(szTitle)) / 2;
xy.X = (ScreenBufferInfo.dwSize.X - (USHORT)wcslen(szTitle)) / 2;
xy.Y = ScreenBufferInfo.dwSize.Y / 2;
WriteStringAt(szTitle, xy,

View file

@ -106,8 +106,8 @@ void DrawScene(HWND hwnd, HDC dc, int ticks)
angle += ticks * 0.01;
colorh += ticks * 0.003;
if (colorh > 360.0) colorh -= 360.0;
HLStoRGB(colorh, 1.0, 0.7, &rval, &gval, &bval);
DrawCylinder(lvls, angle, 0.2);
HLStoRGB(colorh, 1.0f, 0.7f, &rval, &gval, &bval);
DrawCylinder(lvls, angle, 0.2f);
SwapBuffers(dc);
EndPaint(hwnd, &ps);
}
@ -134,7 +134,7 @@ void MyPixelFormat(HDC dc)
void InitGL(HWND hwnd)
{
GLfloat lightpos[4] = {2.0, 2.0, -2.0, 0.7};
GLfloat lightpos[4] = {2.0f, 2.0f, -2.0f, 0.7f};
GLfloat ca = 1.0;
dc = GetDC(hwnd);
MyPixelFormat(dc);

View file

@ -8,6 +8,7 @@
#ifdef HAVE_APITEST
#include <apitest.h>
#define ATLASSUME(x) /*empty*/
#undef ATLASSERT
#define ATLASSERT(x) /*empty*/
#else
#include "atltest.h"