Skip to content

Commit b6be78f

Browse files
author
devsh
committed
fix phmap_deserialization.h and phmap_serialization.h after API changes in phmap
1 parent 3357c41 commit b6be78f

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

include/nbl/asset/utils/CDirQuantCacheBase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ class CDirQuantCacheBase : public virtual core::IReferenceCounted, public impl::
282282
backup.swap(particularCache);
283283

284284
CBufferPhmapInputArchive buffWrap(buffer);
285-
bool loadingSuccess = particularCache.load(buffWrap);
285+
bool loadingSuccess = particularCache.phmap_load(buffWrap);
286286

287287
if (!replaceCurrentContents || !loadingSuccess)
288288
particularCache.merge(std::move(backup));
@@ -333,7 +333,7 @@ class CDirQuantCacheBase : public virtual core::IReferenceCounted, public impl::
333333
return false;
334334

335335
CBufferPhmapOutputArchive buffWrap(buffer);
336-
return std::get<cache_type_t<CacheFormat>>(cache).dump(buffWrap);
336+
return std::get<cache_type_t<CacheFormat>>(cache).phmap_dump(buffWrap);
337337
}
338338

339339
//!

include/nbl/asset/utils/phmap_deserialization.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine".
33
// For conditions of distribution and use, see copyright notice in nabla.h
4-
5-
#ifndef __NBL_ASSET_PHMAP_DESERIALIZATION_H_INCLUDED__
6-
#define __NBL_ASSET_PHMAP_DESERIALIZATION_H_INCLUDED__
4+
#ifndef _NBL_ASSET_PHMAP_DESERIALIZATION_H_INCLUDED_
5+
#define _NBL_ASSET_PHMAP_DESERIALIZATION_H_INCLUDED_
76

87
#include "nbl/core/declarations.h"
98
#include "nbl/asset/ICPUBuffer.h"
@@ -20,7 +19,7 @@ class CBufferPhmapInputArchive
2019
}
2120

2221
// TODO: protect against reading out of the buffer range
23-
bool load(char* p, size_t sz)
22+
bool loadBinary(void* p, size_t sz)
2423
{
2524
memcpy(p, buffPtr, sz);
2625
buffPtr += sz;
@@ -29,7 +28,7 @@ class CBufferPhmapInputArchive
2928
}
3029

3130
template<typename V>
32-
typename std::enable_if<phmap::type_traits_internal::IsTriviallyCopyable<V>::value,bool>::type load(V* v)
31+
typename std::enable_if<phmap::type_traits_internal::IsTriviallyCopyable<V>::value,bool>::type loadBinary(V* v)
3332
{
3433
memcpy(reinterpret_cast<uint8_t*>(v), buffPtr, sizeof(V));
3534
buffPtr += sizeof(V);

include/nbl/asset/utils/phmap_serialization.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine".
33
// For conditions of distribution and use, see copyright notice in nabla.h
4-
5-
#ifndef __NBL_ASSET_PHMAP_SERIALIZATION_H_INCLUDED__
6-
#define __NBL_ASSET_PHMAP_SERIALIZATION_H_INCLUDED__
4+
#ifndef _NBL_ASSET_PHMAP_SERIALIZATION_H_INCLUDED_
5+
#define _NBL_ASSET_PHMAP_SERIALIZATION_H_INCLUDED_
76

87
#include "nbl/core/declarations.h"
98
#include "nbl/asset/ICPUBuffer.h"
@@ -20,7 +19,7 @@ class CBufferPhmapOutputArchive
2019
}
2120

2221
// TODO: protect against writing out of bounds as defined by SBufferRange
23-
bool dump(const char* p, size_t sz)
22+
bool saveBinary(const void* p, size_t sz)
2423
{
2524
memcpy(bufferPtr, p, sz);
2625
bufferPtr += sz;
@@ -29,7 +28,7 @@ class CBufferPhmapOutputArchive
2928
}
3029

3130
template<typename V>
32-
typename std::enable_if<phmap::type_traits_internal::IsTriviallyCopyable<V>::value,bool>::type dump(const V& v)
31+
typename std::enable_if<phmap::type_traits_internal::IsTriviallyCopyable<V>::value,bool>::type saveBinary(const V& v)
3332
{
3433
memcpy(bufferPtr, reinterpret_cast<const uint8_t*>(&v), sizeof(V));
3534
bufferPtr += sizeof(V);

0 commit comments

Comments
 (0)