Fix a shitload of warnings in 64 bits mode

Former-commit-id: c7792a7d5b1f85ab934da25324831b9daa3f47ff [formerly 3469974c48432be1f65808bff0ea39d9e22f5b50]
Former-commit-id: 5080815e9e1a3aebe237ff9a291b908ce0292eca
This commit is contained in:
Lynix
2016-06-13 21:09:55 +02:00
parent f36eec7346
commit 819b46f5fc
39 changed files with 191 additions and 188 deletions

View File

@@ -96,7 +96,7 @@ namespace Nz
//UInt64 oldCursorPos = GetCursorPos();
DWORD read = 0;
if (ReadFile(m_handle, buffer, size, &read, nullptr))
if (ReadFile(m_handle, buffer, static_cast<DWORD>(size), &read, nullptr))
{
m_endOfFile = (read != size);
m_endOfFileUpdated = true;
@@ -191,9 +191,9 @@ namespace Nz
LARGE_INTEGER cursorPos;
cursorPos.QuadPart = GetCursorPos();
LockFile(m_handle, cursorPos.LowPart, cursorPos.HighPart, size, 0);
WriteFile(m_handle, buffer, size, &written, nullptr);
UnlockFile(m_handle, cursorPos.LowPart, cursorPos.HighPart, size, 0);
LockFile(m_handle, cursorPos.LowPart, cursorPos.HighPart, static_cast<DWORD>(size), 0);
WriteFile(m_handle, buffer, static_cast<DWORD>(size), &written, nullptr);
UnlockFile(m_handle, cursorPos.LowPart, cursorPos.HighPart, static_cast<DWORD>(size), 0);
m_endOfFileUpdated = false;

View File

@@ -24,7 +24,7 @@ namespace Nz
}
#endif
s_workerCount = workerCount;
s_workerCount = static_cast<DWORD>(workerCount);
s_doneEvents.reset(new HANDLE[workerCount]);
s_workers.reset(new Worker[workerCount]);
s_workerThreads.reset(new HANDLE[workerCount]);
@@ -64,7 +64,7 @@ namespace Nz
// On s'assure que des tâches ne sont pas déjà en cours
WaitForMultipleObjects(s_workerCount, &s_doneEvents[0], true, INFINITE);
std::ldiv_t div = std::ldiv(count, s_workerCount); // Division et modulo en une opération, y'a pas de petit profit
std::lldiv_t div = std::lldiv(count, s_workerCount); // Division et modulo en une opération, y'a pas de petit profit
for (std::size_t i = 0; i < s_workerCount; ++i)
{
// On va maintenant répartir les tâches entre chaque worker et les envoyer dans la queue de chacun
@@ -78,7 +78,7 @@ namespace Nz
}
// On les lance une fois qu'ils sont tous initialisés (pour éviter qu'un worker ne passe en pause détectant une absence de travaux)
for (unsigned int i = 0; i < s_workerCount; ++i)
for (std::size_t i = 0; i < s_workerCount; ++i)
{
ResetEvent(s_doneEvents[i]);
SetEvent(s_workers[i].wakeEvent);
@@ -244,5 +244,5 @@ namespace Nz
std::unique_ptr<HANDLE[]> TaskSchedulerImpl::s_doneEvents; // Doivent être contigus
std::unique_ptr<TaskSchedulerImpl::Worker[]> TaskSchedulerImpl::s_workers;
std::unique_ptr<HANDLE[]> TaskSchedulerImpl::s_workerThreads; // Doivent être contigus
std::size_t TaskSchedulerImpl::s_workerCount;
DWORD TaskSchedulerImpl::s_workerCount;
}

View File

@@ -44,7 +44,7 @@ namespace Nz
static std::unique_ptr<HANDLE[]> s_doneEvents; // Doivent être contigus
static std::unique_ptr<Worker[]> s_workers;
static std::unique_ptr<HANDLE[]> s_workerThreads; // Doivent être contigus
static std::size_t s_workerCount;
static DWORD s_workerCount;
};
}