mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 15:29:55 +00:00
Use correct assertion for the file implementation
This commit is contained in:
parent
4a15fae588
commit
c6bc264b35
3 changed files with 9 additions and 2 deletions
|
@ -7,11 +7,14 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
namespace Platform::File {
|
namespace Platform::File {
|
||||||
|
|
||||||
static auto getNativeHandle(Handle handle)
|
static auto getNativeHandle(Handle handle)
|
||||||
{
|
{
|
||||||
|
assert(handle != Handle::Invalid);
|
||||||
|
|
||||||
return static_cast<int>(handle);
|
return static_cast<int>(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,14 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
namespace Platform::File {
|
namespace Platform::File {
|
||||||
|
|
||||||
static auto getNativeHandle(Handle handle)
|
static auto getNativeHandle(Handle handle)
|
||||||
{
|
{
|
||||||
|
assert(handle != Handle::Invalid);
|
||||||
|
|
||||||
return reinterpret_cast<FILE*>(static_cast<intptr_t>(handle));
|
return reinterpret_cast<FILE*>(static_cast<intptr_t>(handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,14 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <boost/locale.hpp>
|
#include <boost/locale.hpp>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
namespace Platform::File {
|
namespace Platform::File {
|
||||||
|
|
||||||
static auto getNativeHandle(Handle handle)
|
static auto getNativeHandle(Handle handle)
|
||||||
{
|
{
|
||||||
|
assert(handle != Handle::Invalid);
|
||||||
|
|
||||||
return reinterpret_cast<HANDLE>(static_cast<intptr_t>(handle));
|
return reinterpret_cast<HANDLE>(static_cast<intptr_t>(handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,8 +61,6 @@ namespace Platform::File {
|
||||||
{
|
{
|
||||||
auto nativeHandle = getNativeHandle(handle);
|
auto nativeHandle = getNativeHandle(handle);
|
||||||
|
|
||||||
assert(isValidHandle(mHandle));
|
|
||||||
|
|
||||||
BY_HANDLE_FILE_INFORMATION info;
|
BY_HANDLE_FILE_INFORMATION info;
|
||||||
|
|
||||||
if (!GetFileInformationByHandle(nativeHandle, &info))
|
if (!GetFileInformationByHandle(nativeHandle, &info))
|
||||||
|
|
Loading…
Reference in a new issue