mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-07 21:38:01 -05:00
fix: linux build
This commit is contained in:
parent
b92e85dc14
commit
35cb6636a1
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
const void* ContentLoaderBase::PTR_FOLLOWING = reinterpret_cast<void*>(-1);
|
||||||
|
const void* ContentLoaderBase::PTR_INSERT = reinterpret_cast<void*>(-2);
|
||||||
|
|
||||||
ContentLoaderBase::ContentLoaderBase(Zone& zone)
|
ContentLoaderBase::ContentLoaderBase(Zone& zone)
|
||||||
: varXString(nullptr),
|
: varXString(nullptr),
|
||||||
m_zone(zone),
|
m_zone(zone),
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
class ContentLoaderBase
|
class ContentLoaderBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
static constexpr auto PTR_FOLLOWING = reinterpret_cast<void*>(-1);
|
static const void* PTR_FOLLOWING;
|
||||||
static constexpr auto PTR_INSERT = reinterpret_cast<void*>(-2);
|
static const void* PTR_INSERT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~ContentLoaderBase() = default;
|
virtual ~ContentLoaderBase() = default;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class IHashProvider
|
class IHashProvider
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class ILoadingStream
|
class ILoadingStream
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cstring>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
class ProcessorAuthedBlocks final : public StreamProcessor
|
class ProcessorAuthedBlocks final : public StreamProcessor
|
||||||
@ -49,7 +50,7 @@ public:
|
|||||||
sizeToWrite = std::min(sizeToWrite, m_current_chunk_size - m_current_chunk_offset);
|
sizeToWrite = std::min(sizeToWrite, m_current_chunk_size - m_current_chunk_offset);
|
||||||
|
|
||||||
assert(length - loadedSize >= sizeToWrite);
|
assert(length - loadedSize >= sizeToWrite);
|
||||||
memcpy(&static_cast<uint8_t*>(buffer)[loadedSize], &m_chunk_buffer[m_current_chunk_offset], sizeToWrite);
|
std::memcpy(&static_cast<uint8_t*>(buffer)[loadedSize], &m_chunk_buffer[m_current_chunk_offset], sizeToWrite);
|
||||||
loadedSize += sizeToWrite;
|
loadedSize += sizeToWrite;
|
||||||
m_current_chunk_offset += sizeToWrite;
|
m_current_chunk_offset += sizeToWrite;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@ -25,7 +26,7 @@ namespace
|
|||||||
|
|
||||||
auto loadedSize = m_base_stream->Load(&m_data[m_captured_data_size], dataToCapture);
|
auto loadedSize = m_base_stream->Load(&m_data[m_captured_data_size], dataToCapture);
|
||||||
assert(length >= loadedSize);
|
assert(length >= loadedSize);
|
||||||
memcpy(buffer, &m_data[m_captured_data_size], loadedSize);
|
std::memcpy(buffer, &m_data[m_captured_data_size], loadedSize);
|
||||||
|
|
||||||
m_captured_data_size += loadedSize;
|
m_captured_data_size += loadedSize;
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
|
#include <cstring>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
@ -164,14 +165,14 @@ namespace
|
|||||||
if (sizeToRead > bytesLeftInCurrentChunk)
|
if (sizeToRead > bytesLeftInCurrentChunk)
|
||||||
{
|
{
|
||||||
assert(sizeToRead >= bytesLeftInCurrentChunk);
|
assert(sizeToRead >= bytesLeftInCurrentChunk);
|
||||||
memcpy(bufferPos, &m_current_chunk[m_current_chunk_offset], bytesLeftInCurrentChunk);
|
std::memcpy(bufferPos, &m_current_chunk[m_current_chunk_offset], bytesLeftInCurrentChunk);
|
||||||
loadedSize += bytesLeftInCurrentChunk;
|
loadedSize += bytesLeftInCurrentChunk;
|
||||||
|
|
||||||
NextStream();
|
NextStream();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memcpy(bufferPos, &m_current_chunk[m_current_chunk_offset], sizeToRead);
|
std::memcpy(bufferPos, &m_current_chunk[m_current_chunk_offset], sizeToRead);
|
||||||
loadedSize += sizeToRead;
|
loadedSize += sizeToRead;
|
||||||
m_current_chunk_offset += sizeToRead;
|
m_current_chunk_offset += sizeToRead;
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "Loading/Exception/InvalidHashException.h"
|
#include "Loading/Exception/InvalidHashException.h"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "Utils/Alignment.h"
|
#include "Utils/Alignment.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cstring>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user