Use correct assertion for the file implementation

LTO-timing^2
Matt 2 years ago committed by psi29a
parent 4a15fae588
commit c6bc264b35

@ -7,11 +7,14 @@
#include <string.h>
#include <stdexcept>
#include <string>
#include <cassert>
namespace Platform::File {
static auto getNativeHandle(Handle handle)
{
assert(handle != Handle::Invalid);
return static_cast<int>(handle);
}

@ -4,11 +4,14 @@
#include <string.h>
#include <string>
#include <stdexcept>
#include <cassert>
namespace Platform::File {
static auto getNativeHandle(Handle handle)
{
assert(handle != Handle::Invalid);
return reinterpret_cast<FILE*>(static_cast<intptr_t>(handle));
}

@ -4,11 +4,14 @@
#include <string>
#include <stdexcept>
#include <boost/locale.hpp>
#include <cassert>
namespace Platform::File {
static auto getNativeHandle(Handle handle)
{
assert(handle != Handle::Invalid);
return reinterpret_cast<HANDLE>(static_cast<intptr_t>(handle));
}
@ -58,8 +61,6 @@ namespace Platform::File {
{
auto nativeHandle = getNativeHandle(handle);
assert(isValidHandle(mHandle));
BY_HANDLE_FILE_INFORMATION info;
if (!GetFileInformationByHandle(nativeHandle, &info))

Loading…
Cancel
Save