Skip to content
Permalink
Browse files

Fix compile warnings and messages

  • Loading branch information...
ccw808 committed Oct 27, 2019
1 parent c2138f2 commit 3184a774adc2fe8090081c2317daa5ee2e4a5553
@@ -1,4 +1,3 @@
#pragma message("Compiling precompiled header.\n")

// Pragmas
#pragma warning (disable:4995)
@@ -1130,7 +1130,7 @@ void CModelInfoSA::RestoreColModel()
call func
add esp, 8
}
#pragma message(__LOC__ "(IJs) Document this function some time.")
// (IJs) Document this function some time
}
}

@@ -523,10 +523,10 @@ void CWaterManagerSA::GetZonesIntersecting(const CVector& startPos, const CVecto
float minY = Clamp<float>(-3000.0f, std::min<float>(startPos.fY, endPos.fY), 3000.0f);
float maxY = Clamp<float>(-3000.0f, std::max<float>(startPos.fY, endPos.fY), 3000.0f);

int lowXZone = Clamp<int>(0, (minX + 3000.0f) / 500.0f, 11);
int lowYZone = Clamp<int>(0, (minY + 3000.0f) / 500.0f, 11);
int highXZone = Clamp<int>(0, (maxX + 3000.0f) / 500.0f, 11);
int highYZone = Clamp<int>(0, (maxY + 3000.0f) / 500.0f, 11);
int lowXZone = Clamp<int>(0, static_cast<int>((minX + 3000.0f) / 500.0f), 11);
int lowYZone = Clamp<int>(0, static_cast<int>((minY + 3000.0f) / 500.0f), 11);
int highXZone = Clamp<int>(0, static_cast<int>((maxX + 3000.0f) / 500.0f), 11);
int highYZone = Clamp<int>(0, static_cast<int>((maxY + 3000.0f) / 500.0f), 11);

if (lowXZone == highXZone)
{
@@ -1,4 +1,3 @@
#pragma message("Compiling precompiled header.\n")

// Pragmas
#pragma warning (disable:4409)
@@ -1,4 +1,3 @@
#pragma message("Compiling precompiled header.\n")

#include <CEGUI.h>
#include <windows.h>
@@ -17,6 +17,10 @@ project "GUI"
pchheader "StdInc.h"
pchsource "StdInc.cpp"

defines {
"_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING"
}

links {
"CEGUI", "DirectX9GUIRenderer", "Falagard",
"../../vendor/cegui-0.4.0-custom/lib/freetype2412ST.lib", -- Todo: Select Debug variant, also move freetype to vendor
@@ -1525,8 +1525,8 @@ int GetFileAge(const SString& strPathFilename)
FindClose(hFind);
FILETIME ftNow;
GetSystemTimeAsFileTime(&ftNow);
LARGE_INTEGER creationTime = {findFileData.ftCreationTime.dwLowDateTime, findFileData.ftCreationTime.dwHighDateTime};
LARGE_INTEGER timeNow = {ftNow.dwLowDateTime, ftNow.dwHighDateTime};
LARGE_INTEGER creationTime = {findFileData.ftCreationTime.dwLowDateTime, static_cast<LONG>(findFileData.ftCreationTime.dwHighDateTime)};
LARGE_INTEGER timeNow = {ftNow.dwLowDateTime, static_cast<LONG>(ftNow.dwHighDateTime)};
return static_cast<int>((timeNow.QuadPart - creationTime.QuadPart) / (LONGLONG)10000000);
}
return 0;
@@ -2153,7 +2153,7 @@ BOOL CALLBACK MyEnumThreadWndProc(HWND hwnd, LPARAM lParam)
WINDOWINFO windowInfo;
if (GetWindowInfo(hwnd, &windowInfo))
{
if (windowInfo.atomWindowType == (WORD)WC_DIALOG)
if (windowInfo.atomWindowType == reinterpret_cast<uint>(WC_DIALOG))
{
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
return false;
@@ -1,4 +1,3 @@
#pragma message("Compiling precompiled header.\n")

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -12,7 +12,7 @@

// Generated by MTA10\utils\gentable\gentable_objmodels.cpp
// (Currently excludes peds (below 300) and vehicles)
static const unsigned int g_uiValidObjectModels[] = {
static const int g_iValidObjectModels[] = {
2, 0, 0, 0, 0, 0, 0, 0, 0, -4096, -1053185, 4194303, 16127, 0,
0, 0, 0, 0, 0, -128, -515899393, -134217729, -1, -1, 33554431, -1, -1, -1,
-14337, -1, -1, -129, -1, 1073741823, -1, -1, -1, -8387585, -1, -1, -1, -1,
@@ -149,7 +149,7 @@ bool CClientObjectManager::IsValidModel(unsigned long ulObjectModel)
unsigned int uiChunk = ulObjectModel / (sizeof(unsigned int) * 8);
unsigned int shift = ulObjectModel - (uiChunk * sizeof(unsigned int) * 8);
unsigned int bit = 1 << shift;
bIsValid = !!(g_uiValidObjectModels[uiChunk] & bit);
bIsValid = !!(g_iValidObjectModels[uiChunk] & bit);

// Return whether we can grab the model information or not
if (bIsValid && !g_pGame->GetModelInfo(ulObjectModel))
@@ -1442,7 +1442,7 @@ bool CStaticFunctionDefinitions::SetElementModel(CClientEntity& Entity, unsigned
{
// Grab the model
CClientPed& Ped = static_cast<CClientPed&>(Entity);
const unsigned short usCurrentModel = Ped.GetModel();
const unsigned short usCurrentModel = static_cast<ushort>(Ped.GetModel());

if (usCurrentModel == usModel)
return false;
@@ -18,8 +18,6 @@
// Prevent the warning issued when doing unsigned short -> void*
#pragma warning(disable:4312)

#pragma message(__LOC__"Use RTTI/dynamic_casting here for safety?")

CClientEntity* lua_toelement(lua_State* luaVM, int iArgument)
{
if (lua_type(luaVM, iArgument) == LUA_TLIGHTUSERDATA)
@@ -436,7 +436,7 @@ void CElementRPCs::SetElementModel(CClientEntity* pSource, NetBitStreamInterface
case CCLIENTPLAYER:
{
CClientPed* pPed = static_cast<CClientPed*>(pSource);
const unsigned short usCurrentModel = pPed->GetModel();
const unsigned short usCurrentModel = static_cast<ushort>(pPed->GetModel());

if (usCurrentModel != usModel)
{
@@ -1,4 +1,3 @@
#pragma message("Compiling precompiled header.\n")

// Pragmas
#pragma warning (disable:4250)
@@ -1,5 +1,4 @@
#ifdef WIN32
#pragma message("Compiling precompiled header.\n")

#include <windows.h>
#include <mmsystem.h>
@@ -1,5 +1,4 @@
#ifdef WIN32
#pragma message("Compiling precompiled header.\n")

#include <winsock2.h>
#include <windows.h>
@@ -13,7 +13,7 @@

// Generated by MTA10\utils\gentable\gentable_objmodels.cpp
// (Currently excludes peds (below 300) and vehicles)
static unsigned int g_uiValidObjectModels[] = {
static int g_iValidObjectModels[] = {
2, 0, 0, 0, 0, 0, 0, 0, 0, -4096, -1053185, 4194303, 16127, 0,
0, 0, 0, 0, 0, -128, -515899393, -134217729, -1, -1, 33554431, -1, -1, -1,
-14337, -1, -1, -129, -1, 1073741823, -1, -1, -1, -8387585, -1, -1, -1, -1,
@@ -138,7 +138,7 @@ bool CObjectManager::IsValidModel(unsigned long ulObjectModel)
unsigned int uiChunk = ulObjectModel / (sizeof(unsigned int) * 8);
unsigned int shift = ulObjectModel - (uiChunk * sizeof(unsigned int) * 8);
unsigned int bit = 1 << shift;
bIsValid = !!(g_uiValidObjectModels[uiChunk] & bit);
bIsValid = !!(g_iValidObjectModels[uiChunk] & bit);
}

return bIsValid;
@@ -887,8 +887,8 @@ bool CEntityAddPacket::Write(NetBitStreamInterface& BitStream) const
const SPlayerClothing* pClothing = pClothes->GetClothing(ucType);
if (pClothing)
{
unsigned char ucTextureLength = strlen(pClothing->szTexture);
unsigned char ucModelLength = strlen(pClothing->szModel);
unsigned char ucTextureLength = static_cast<uchar>(strlen(pClothing->szTexture));
unsigned char ucModelLength = static_cast<uchar>(strlen(pClothing->szModel));

BitStream.Write(ucTextureLength);
BitStream.Write(pClothing->szTexture, ucTextureLength);
@@ -40,8 +40,8 @@ bool CPlayerClothesPacket::Write(NetBitStreamInterface& BitStream) const
{
char* szTexture = (*iter)->szTexture;
char* szModel = (*iter)->szModel;
unsigned char ucTextureLength = strlen(szTexture);
unsigned char ucModelLength = strlen(szModel);
unsigned char ucTextureLength = static_cast<uchar>(strlen(szTexture));
unsigned char ucModelLength = static_cast<uchar>(strlen(szModel));
BitStream.Write(ucTextureLength);
BitStream.Write(szTexture, ucTextureLength);
BitStream.Write(ucModelLength);
@@ -1,6 +1,5 @@

#ifdef WIN32
#pragma message("Compiling precompiled header.\n")
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#else
@@ -12,7 +12,8 @@ project "CEGUI"
}

defines {
"CEGUIBASE_EXPORTS"
"CEGUIBASE_EXPORTS",
"_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING"
}

vpaths {

0 comments on commit 3184a77

Please sign in to comment.
You can’t perform that action at this time.