Fix Clang compilation
This commit is contained in:
@@ -166,7 +166,7 @@ void NetworkReplicator::AddSerializer(const ScriptingTypeHandle& typeHandle, con
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// This assumes that C# glue code passed static method pointer (via Marshal.GetFunctionPointerForDelegate)
|
// This assumes that C# glue code passed static method pointer (via Marshal.GetFunctionPointerForDelegate)
|
||||||
const Serializer serializer{ INetworkSerializable_Managed, INetworkSerializable_Managed, *(SerializeFunc*)&serialize, *(SerializeFunc*)&deserialize };
|
const Serializer serializer{ INetworkSerializable_Managed, INetworkSerializable_Managed, *(SerializeFunc*)(void*)&serialize, *(SerializeFunc*)(void*)&deserialize };
|
||||||
SerializersTable.Add(typeHandle, serializer);
|
SerializersTable.Add(typeHandle, serializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,8 +171,10 @@ public:
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
typename TEnableIf<TIsBaseOf<ScriptingObject, T>::Value>::Type Write(const T* data)
|
typename TEnableIf<TIsBaseOf<ScriptingObject, T>::Value>::Type Write(const T* data)
|
||||||
{
|
{
|
||||||
const Guid id = data ? data->GetID() : Guid::Empty;
|
uint32 id[4] = { 0 };
|
||||||
WriteBytes(&id, sizeof(Guid));
|
if (data)
|
||||||
|
Platform::MemoryCopy(id, &data->GetID(), sizeof(id));
|
||||||
|
WriteBytes(id, sizeof(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename AllocationType = HeapAllocation>
|
template<typename T, typename AllocationType = HeapAllocation>
|
||||||
@@ -183,7 +185,7 @@ public:
|
|||||||
if (size > 0)
|
if (size > 0)
|
||||||
{
|
{
|
||||||
if (TIsPODType<T>::Value && !TIsPointer<T>::Value)
|
if (TIsPODType<T>::Value && !TIsPointer<T>::Value)
|
||||||
WriteBytes(data.Get(), size * sizeof(T));
|
WriteBytes(data.Get(), size * sizeof(T));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < size; i++)
|
for (int32 i = 0; i < size; i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user