From 364586d3f0acbca929d5e1b041d3ece607ffb43c Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 5 Sep 2023 13:33:27 +0300 Subject: [PATCH] Fix other warnings from MSVC --- source/backends/opengl/vertexsetup_backend.cpp | 2 +- source/builders/sequencetemplate.h | 3 +++ source/glsl/optimize.cpp | 2 +- source/glsl/syntax.h | 2 +- source/materials/splatmaterial.cpp | 2 +- source/render/renderer.h | 6 +++--- tools/viewer.cpp | 4 ++-- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/source/backends/opengl/vertexsetup_backend.cpp b/source/backends/opengl/vertexsetup_backend.cpp index 6dc97411..59b5c66e 100644 --- a/source/backends/opengl/vertexsetup_backend.cpp +++ b/source/backends/opengl/vertexsetup_backend.cpp @@ -85,7 +85,7 @@ void OpenGLVertexSetup::update_vertex_array(const VertexArray &array, unsigned b glVertexArrayBindingDivisor(id, binding, divisor); } - unsigned offset = array.get_offset(); + uintptr_t offset = array.get_offset(); for(VertexAttribute a: fmt) { unsigned sem = get_attribute_semantic(a); diff --git a/source/builders/sequencetemplate.h b/source/builders/sequencetemplate.h index 9da7693c..fce22d87 100644 --- a/source/builders/sequencetemplate.h +++ b/source/builders/sequencetemplate.h @@ -175,6 +175,9 @@ private: static TemplateRegistry &get_registry(); }; +template<> SequenceTemplate::TemplateRegistry &SequenceTemplate::get_registry(); +template<> SequenceTemplate::TemplateRegistry &SequenceTemplate::get_registry(); + template void SequenceTemplate::register_effect(const std::string &kw) { diff --git a/source/glsl/optimize.cpp b/source/glsl/optimize.cpp index bb5ba6ce..e914ad03 100644 --- a/source/glsl/optimize.cpp +++ b/source/glsl/optimize.cpp @@ -891,7 +891,7 @@ void ConstantFolder::visit(UnaryExpression &unary) if(r_constant_value.has_type()) set_result(-r_constant_value.value()); else if(r_constant_value.has_type()) - set_result(-r_constant_value.value()); + set_result(-static_cast(r_constant_value.value())); else if(r_constant_value.has_type()) set_result(-r_constant_value.value()); } diff --git a/source/glsl/syntax.h b/source/glsl/syntax.h index 9b3d1954..1f2a5182 100644 --- a/source/glsl/syntax.h +++ b/source/glsl/syntax.h @@ -57,7 +57,7 @@ enum GENERATED_SOURCE = 0 }; -struct NodeVisitor; +class NodeVisitor; struct Node { diff --git a/source/materials/splatmaterial.cpp b/source/materials/splatmaterial.cpp index 3a051147..a1295bba 100644 --- a/source/materials/splatmaterial.cpp +++ b/source/materials/splatmaterial.cpp @@ -115,7 +115,7 @@ void SplatMaterial::upload_sub_map(DataFile::Collection &coll, unsigned index, S { int l = (s.*map).layer; if(l>=0) - layer_mask |= 1<