Fix some warnings

This commit is contained in:
SirLynix
2023-06-27 19:31:24 +02:00
parent b01ee18eaf
commit 96618cbb5b
11 changed files with 28 additions and 23 deletions

View File

@@ -1,8 +1,10 @@
#include <ShaderNode/Previews/QuadPreview.hpp>
#include <cassert>
PreviewValues QuadPreview::GetPreview(InputRole role, std::size_t roleIndex) const
PreviewValues QuadPreview::GetPreview(InputRole role, [[maybe_unused]] std::size_t roleIndex) const
{
assert(roleIndex == 0);
if (role != InputRole::TexCoord)
{
PreviewValues dummy(1, 1);

View File

@@ -60,10 +60,12 @@ StructMemberInfo StructMemberEditDialog::GetMemberInfo() const
StructMemberInfo inputInfo;
inputInfo.name = m_memberName->text().toStdString();
if (m_typeList->currentIndex() < PrimitiveTypeCount)
inputInfo.type = static_cast<PrimitiveType>(m_typeList->currentIndex());
std::size_t index = Nz::SafeCast<std::size_t>(m_typeList->currentIndex());
if (index < PrimitiveTypeCount)
inputInfo.type = static_cast<PrimitiveType>(index);
else
inputInfo.type = static_cast<std::size_t>(m_typeList->currentIndex() - PrimitiveTypeCount);
inputInfo.type = Nz::SafeCast<std::size_t>(index - PrimitiveTypeCount);
return inputInfo;
}