Fix code analysis warnings

This commit is contained in:
momo5502 2016-09-04 13:06:44 +02:00
parent 4cb707d43d
commit e94d9788d0
11 changed files with 14 additions and 25 deletions

View File

@ -163,7 +163,6 @@ namespace Components
if ((Game::Sys_Milliseconds() - lastCheck) > 1000 * 70)
{
// TODO: Move that elsewhere
if (HANDLE h = OpenProcess(PROCESS_VM_READ, TRUE, GetCurrentProcessId()))
{
#ifdef DEBUG_DETECTIONS

View File

@ -5,7 +5,7 @@ namespace Assets
void IGfxImage::Load(Game::XAssetHeader* header, std::string name, Components::ZoneBuilder::Zone* builder)
{
Game::GfxImage* image = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_IMAGE, name.data()).image;
if (image) return; // TODO: Check for default?
if (image) return;
image = builder->GetAllocator()->Allocate<Game::GfxImage>();
if (!image)

View File

@ -13,8 +13,6 @@ namespace Assets
buffer->PushBlock(Game::XFILE_BLOCK_VIRTUAL);
// TODO: I think we have to write them, even if they are NULL
if (asset->name)
{
buffer->SaveString(builder->GetAssetName(this->GetType(), asset->name));

View File

@ -110,7 +110,6 @@ namespace Components
{
Bans::AccessMutex.lock();
// TODO: Read bans
FileSystem::File bans("bans.json");
if (bans.Exists())

View File

@ -542,13 +542,6 @@ namespace Components
}
else
{
// Utils::Hook(0x5AC6E9, [] ()
// {
// // TODO: Perform moddownload here
//
// Game::CL_DownloadsComplete(0);
// }, HOOK_CALL).Install()->Quick();
QuickPatch::OnFrame([]
{
if (Download::CLDownload.Running)

View File

@ -155,7 +155,6 @@ namespace Components
Localization::Set("MPUI_MOTD_TEXT", data);
}
// TODO: Implement update checks here!
if (!Loader::PerformingUnitTests())
{
while (!News::Terminate)

View File

@ -768,11 +768,6 @@ namespace Components
Node::AddNode(address);
}
}
else
{
// TODO: Implement client handshake stuff
// Nvm, clients can simply ignore that i guess
}
});
Command::Add("listnodes", [] (Command::Params)

View File

@ -45,7 +45,6 @@ namespace Components
}
});
// TODO: Maybe execute that for clients as well, when we use triangular natting.
if (!Dedicated::IsEnabled()) return;
// Load public key

View File

@ -143,7 +143,6 @@ namespace Components
if (Window::CursorVisible)
{
// TODO: Apply custom cursor
SetCursor(LoadCursor(NULL, IDC_ARROW));
while ((value = ShowCursor(TRUE)) < 0);

View File

@ -48,9 +48,9 @@ namespace Utils
return buffer;
}
void CreateDirectory(std::string dir)
bool CreateDirectory(std::string dir)
{
char opath[MAX_PATH];
char opath[MAX_PATH] = { 0 };
char *p;
size_t len;
@ -70,7 +70,10 @@ namespace Utils
if (_access(opath, 0))
{
_mkdir(opath);
if (_mkdir(opath) == -1)
{
return false;
}
}
*p = L'\\';
@ -79,8 +82,13 @@ namespace Utils
if (_access(opath, 0))
{
_mkdir(opath);
if (_mkdir(opath) == -1)
{
return false;
}
}
return true;
}
}
}

View File

@ -5,6 +5,6 @@ namespace Utils
bool FileExists(std::string file);
void WriteFile(std::string file, std::string data);
std::string ReadFile(std::string file);
void CreateDirectory(std::string dir);
bool CreateDirectory(std::string dir);
}
}