Skip to content

Commit

Permalink
for issue #80 : remove some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
NevilClavain committed Jul 17, 2023
1 parent 6dcdfe5 commit 232fc23
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 20 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ set(CMAKE_CXX_STANDARD 17)
# disable ZERO_CHECK project generation
set(CMAKE_SUPPRESS_REGENERATION true)

add_definitions(-D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS)

# 3rd-parts localisations
set(physfs_include_dir ${CMAKE_SOURCE_DIR}/thirdparts/physfs-2.0.3/sdk/include)
set(physfs_lib_dir ${CMAKE_SOURCE_DIR}/thirdparts/physfs-2.0.3/sdk/lib/x86)
Expand Down
9 changes: 5 additions & 4 deletions lua_core/src/luaclass_entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1066,8 +1066,9 @@ int LuaClass_Entity::LUA_readmeshesfiledescription(lua_State* p_L)
{
LUA_ERROR("Entity::read_meshesfiledescription : argument(s) missing");
}
int index = luaL_checkint(p_L, 1);
dsstring section = luaL_checkstring(p_L, 2);

size_t index{ (size_t)luaL_checkint(p_L, 1) };
const dsstring section{ luaL_checkstring(p_L, 2) };

ResourcesAspect* resources_aspect = m_entity.GetAspect<ResourcesAspect>();
if (!resources_aspect)
Expand Down Expand Up @@ -1112,7 +1113,7 @@ int LuaClass_Entity::LUA_readmeshesfiledescription(lua_State* p_L)
LUA_ERROR("Entity::read_meshesfiledescription : argument(s) missing");
}

int index = luaL_checkint(p_L, 3) - 1; // lua-style index [1 to n]
const size_t index{ (size_t)luaL_checkint(p_L, 3) - 1 }; // lua-style index [1 to n]

if (index >= 0 && index < mesheFileDescription.meshes_descriptions.size())
{
Expand Down Expand Up @@ -1153,7 +1154,7 @@ int LuaClass_Entity::LUA_readmeshesfiledescription(lua_State* p_L)
LUA_ERROR("Entity::read_meshesfiledescription : argument(s) missing");
}

int index = luaL_checkint(p_L, 3) - 1; // lua-style index [1 to n]
size_t index = { (size_t)luaL_checkint(p_L, 3) - 1 }; // lua-style index [1 to n]

if (index >= 0 && index < mesheFileDescription.anims_descriptions.size())
{
Expand Down
2 changes: 1 addition & 1 deletion lua_extensions/planets_luaext/src/lod_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void Layer::build_meshe(float* p_heightmap, DrawSpace::Core::Meshe& p_patchmeshe
}
}

for (long i = 0; i < p_patchmeshe.GetTrianglesListSize(); i++)
for (size_t i = 0; i < p_patchmeshe.GetTrianglesListSize(); i++)
{
TrianglePrimitive<unsigned int> t;
p_patchmeshe.GetTriangles(i, t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void LuaClass_PlanetRendering::configure_from_renderlayer(lua_State* p_L, LuaCla
layers_fx.resize(rcfg_list_size);
layers_textures.resize(rcfg_list_size);

for (int k = 0; k < rcfg_list_size; k++)
for (size_t k = 0; k < rcfg_list_size; k++)
{
const auto render_config{ p_lua_renderlayer->GetRenderConfig(k) };
const auto rc_list_size{ render_config.second.render_contexts.size() };
Expand All @@ -192,7 +192,7 @@ void LuaClass_PlanetRendering::configure_from_renderlayer(lua_State* p_L, LuaCla
const auto textures_set_size = render_context.textures_sets.size();
// les N jeux de 32 textures stages
std::vector<std::array<Texture*, RenderingNode::NbMaxTextures>> textures;
for (int texture_face_index = 0; texture_face_index < textures_set_size; texture_face_index++)
for (size_t texture_face_index = 0; texture_face_index < textures_set_size; texture_face_index++)
{
std::array<Texture*, RenderingNode::NbMaxTextures> textures_set = { nullptr };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,6 @@ void PlanetsRenderingAspectImpl::init_rendering_objects(void)

if (LOD::cst::SurfaceLayer == layer)
{
std::array<PlanetDetailsBinder*, 6> details_binders;
std::array<LOD::Binder*, 6> details_binders_2;

for (int orientation = 0; orientation < 6; orientation++)
Expand All @@ -1082,7 +1081,6 @@ void PlanetsRenderingAspectImpl::init_rendering_objects(void)
}
else if (LOD::cst::AtmosphereLayer == layer)
{
std::array<PlanetDetailsBinder*, 6> atmo_binders;
std::array<LOD::Binder*, 6> atmo_binders_2;

for (int orientation = 0; orientation < 6; orientation++)
Expand All @@ -1096,7 +1094,6 @@ void PlanetsRenderingAspectImpl::init_rendering_objects(void)
}
else if (LOD::cst::FlatCloudsLayer == layer)
{
std::array<PlanetDetailsBinder*, 6> flatclouds_binders;
std::array<LOD::Binder*, 6> flatclouds_binders_2;

for (int orientation = 0; orientation < 6; orientation++)
Expand All @@ -1116,7 +1113,6 @@ void PlanetsRenderingAspectImpl::init_rendering_objects(void)
}
else if (LOD::cst::OceansLayer == layer)
{
std::array<PlanetDetailsBinder*, 6> oceans_binders;
std::array<LOD::Binder*, 6> oceans_binders_2;

for (int orientation = 0; orientation < 6; orientation++)
Expand Down
4 changes: 2 additions & 2 deletions plugins/d3d11/src/d3d11renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ bool D3D11Renderer::CreateLineMeshe(DrawSpace::Core::LineMeshe* p_meshe, void**
// vertex buffer creation
const auto v{ new d3d11vertex[nb_vertices] };

for (long i = 0; i < nb_vertices; i++)
for (size_t i = 0; i < nb_vertices; i++)
{
Core::Vertex vertex;
meshe->GetVertex(i, vertex);
Expand Down Expand Up @@ -1036,7 +1036,7 @@ bool D3D11Renderer::CreateLineMeshe(DrawSpace::Core::LineMeshe* p_meshe, void**

const auto t{ new d3d11line[nb_lines] };

for (long i = 0; i < nb_lines; i++)
for (size_t i = 0; i < nb_lines; i++)
{
Core::LinePrimitive<unsigned int> line;
meshe->GetLine(i, line);
Expand Down
2 changes: 1 addition & 1 deletion plugins/d3d11/src/errors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#pragma warning( disable : 4005 )

#include <unordered_map>
#include <drawspace_commons.h>
#include <ds_types.h>
#include <d3dx11.h>

void TranslateD3DD11Error( HRESULT p_hRes, dsstring &p_str )
Expand Down
4 changes: 2 additions & 2 deletions src/buildemeshetask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void BuildMesheTask::build_meshe(Core::Entity* p_entity, aiNode* p_ai_node, aiMe
//////////// transformation des normales
auto n_transf { p_destination->GetNormalesTransf() };

for (long j = 0; j < p_destination->GetVertexListSize(); j++)
for (size_t j = 0; j < p_destination->GetVertexListSize(); j++)
{
DrawSpace::Core::Vertex vertex;
p_destination->GetVertex(j, vertex);
Expand Down Expand Up @@ -294,7 +294,7 @@ void BuildMesheTask::build_meshe(Core::Entity* p_entity, aiNode* p_ai_node, aiMe

//////

for (long j = 0; j < p_destination->GetVertexListSize(); j++)
for (size_t j = 0; j < p_destination->GetVertexListSize(); j++)
{
DrawSpace::Core::Vertex vertex;
p_destination->GetVertex(j, vertex);
Expand Down
1 change: 1 addition & 0 deletions src/collisionaspect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
/* -*-LIC_END-*- */

#include "ds_types.h"
#include "collisionaspect.h"
#include "physicsaspect.h"
#include "transformaspect.h"
Expand Down
2 changes: 1 addition & 1 deletion src/ds_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <string>
#include <exception>

#pragma warning( disable : 4231 4996 4311 4800 4244 4305 4477 )
#pragma warning( disable : 4231 4996 4311 4800 4244 4305 4477 5033)

using dsstring = std::string;
using dswstring = std::wstring;
Expand Down
8 changes: 5 additions & 3 deletions src/hub.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ namespace DrawSpace
{
namespace Systems
{

class Hub : public Interface::System
{
public:
Expand Down Expand Up @@ -76,7 +77,7 @@ class Hub : public Interface::System
dsstring GetSystemId(void) const { return "HubSystem"; };

template<typename T>
inline T& GetSystem(const dsstring& p_id) const
T& GetSystem(const dsstring& p_id) const
{
for (const auto& e : m_systems)
{
Expand All @@ -85,14 +86,15 @@ class Hub : public Interface::System
try
{
return dynamic_cast<T&>(*e);

}
catch (std::bad_cast& p_bc)
{
_DSEXCEPTION("bad cast : " << dsstring( p_bc.what() ) << " " << p_id.c_str());
}
}
}
}

_DSEXCEPTION("Unknown systrm id ");
}

void EnableGUI( bool p_state );
Expand Down
1 change: 1 addition & 0 deletions src/physicsaspect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
/* -*-LIC_END-*- */

#include "ds_types.h"
#include "physicsaspect.h"
#include "vector.h"
#include "timemanager.h"
Expand Down
1 change: 1 addition & 0 deletions src/rigidbodytransformaspectimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
/* -*-LIC_END-*- */

#include "ds_types.h"
#include "physicsaspect.h"
#include "transformaspect.h"
#include "matrix.h"
Expand Down

0 comments on commit 232fc23

Please sign in to comment.