]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix other warnings from MSVC
authorMikko Rasa <tdb@tdb.fi>
Tue, 5 Sep 2023 10:33:27 +0000 (13:33 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 5 Sep 2023 10:33:27 +0000 (13:33 +0300)
source/backends/opengl/vertexsetup_backend.cpp
source/builders/sequencetemplate.h
source/glsl/optimize.cpp
source/glsl/syntax.h
source/materials/splatmaterial.cpp
source/render/renderer.h
tools/viewer.cpp

index 6dc97411113a21bd0d3d9aae9ca0292415c7d243..59b5c66ed1c172c075a415c45c426b2b9a791d86 100644 (file)
@@ -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);
index 9da7693c4526224ed7ae1656fd784b9310c49a31..fce22d871de3fe59f85d71e8227951d805be347c 100644 (file)
@@ -175,6 +175,9 @@ private:
        static TemplateRegistry<T> &get_registry();
 };
 
+template<> SequenceTemplate::TemplateRegistry<PostProcessor> &SequenceTemplate::get_registry<PostProcessor>();
+template<> SequenceTemplate::TemplateRegistry<Effect> &SequenceTemplate::get_registry<Effect>();
+
 template<typename T>
 void SequenceTemplate::register_effect(const std::string &kw)
 {
index bb5ba6ce8a025ea09c8c059d87236a4d336b186d..e914ad03f7f2d775f30689561523fc3123af3d2c 100644 (file)
@@ -891,7 +891,7 @@ void ConstantFolder::visit(UnaryExpression &unary)
                if(r_constant_value.has_type<int>())
                        set_result(-r_constant_value.value<int>());
                else if(r_constant_value.has_type<unsigned>())
-                       set_result(-r_constant_value.value<unsigned>());
+                       set_result(-static_cast<int>(r_constant_value.value<unsigned>()));
                else if(r_constant_value.has_type<float>())
                        set_result(-r_constant_value.value<float>());
        }
index 9b3d1954604fa4eb4fc3321d6fc2a9fd64cb1231..1f2a5182bee1b95b089f7bba8ba152d9ab9f12a0 100644 (file)
@@ -57,7 +57,7 @@ enum
        GENERATED_SOURCE = 0
 };
 
-struct NodeVisitor;
+class NodeVisitor;
 
 struct Node
 {
index 3a051147e74bfd354302e0ac9efb286cb88673b6..a1295bbaea82bf7f5a688195addf6dbce7ae9c09 100644 (file)
@@ -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<<l;
+                       layer_mask |= 1ULL<<l;
        }
 
        unsigned lowest_free_bit = (~layer_mask)&(layer_mask+1);
index b8ab02443961fd12aa693102a21eb9a0d4f40c14..e9c15fdc525db90ab885eb625a3fbb1c53867944 100644 (file)
@@ -14,11 +14,11 @@ namespace Msp {
 namespace GL {
 
 class Batch;
-class Blend;
+struct Blend;
 class Buffer;
 class Camera;
 union ClearValue;
-class DepthTest;
+struct DepthTest;
 class Material;
 class Mesh;
 class Lighting;
@@ -27,7 +27,7 @@ class QueryPool;
 struct Rect;
 class Renderable;
 class Sampler;
-class StencilTest;
+struct StencilTest;
 class Texture;
 class VertexSetup;
 
index 97685163cf716eeb10cccd16f3ae9e0821a25143..7d562397b9e0819305e625948dbd36d77c3e2dc2 100644 (file)
@@ -301,12 +301,12 @@ void Viewer::button_press(unsigned btn)
        }
        else if(btn==4)
        {
-               distance *= 0.9;
+               distance *= 0.9f;
                update_camera();
        }
        else if(btn==5)
        {
-               distance *= 1.1;
+               distance *= 1.1f;
                update_camera();
        }
 }