Skip to content

Commit f335834

Browse files
committed
Vulkan: fix cast-user-defined warnings
1 parent 094e2f3 commit f335834

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/Vulkan/Glass/VulkanGlass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ struct IModelPass
150150
protected:
151151
void drawMesh(pvrvk::SecondaryCommandBuffer& command, const pvr::assets::ModelHandle& modelHandle, const ModelBuffers& modelBuffers, uint32_t nodeIndex)
152152
{
153-
drawMesh((pvrvk::CommandBufferBase&)command, modelHandle, modelBuffers, nodeIndex);
153+
drawMesh(*reinterpret_cast<pvrvk::CommandBufferBase *>(&command), modelHandle, modelBuffers, nodeIndex);
154154
}
155155

156156
void drawMesh(pvrvk::CommandBuffer& command, const pvr::assets::ModelHandle& modelHandle, const ModelBuffers& modelBuffers, uint32_t nodeIndex)
157157
{
158-
drawMesh((pvrvk::CommandBufferBase&)command, modelHandle, modelBuffers, nodeIndex);
158+
drawMesh(*reinterpret_cast<pvrvk::CommandBufferBase *>(&command), modelHandle, modelBuffers, nodeIndex);
159159
}
160160
};
161161

framework/PVRVk/pvrvk_vulkan_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8951,7 +8951,7 @@ struct PerformanceValueINTEL: private VkPerformanceValueINTEL
89518951
}
89528952
inline const PerformanceValueTypeINTEL& getType() const { return (PerformanceValueTypeINTEL&)type; }
89538953
inline void setType(const PerformanceValueTypeINTEL& inType) { memcpy(&this->type, &inType, sizeof(this->type)); }
8954-
inline const PerformanceValueDataINTEL& getData() const { return (PerformanceValueDataINTEL&)data; }
8954+
inline const PerformanceValueDataINTEL& getData() const { return *reinterpret_cast<const PerformanceValueDataINTEL *>(&data); }
89558955
inline void setData(const PerformanceValueDataINTEL& inData) { memcpy(&this->data, &inData, sizeof(this->data)); }
89568956
inline VkPerformanceValueINTEL& get() { return *this; }
89578957
inline const VkPerformanceValueINTEL& get() const { return *this; }

0 commit comments

Comments
 (0)