Commit 57ed9e57 authored by Sébastien Timmermans's avatar Sébastien Timmermans
Browse files

Suppressions of warning, still warning with M_PI

parent 6a893361
......@@ -6,6 +6,11 @@ cmake_minimum_required(VERSION 2.8.7)
project(MBsysC_loadXML)
# Preprocessor definition, in order to suppress the warnings : (ST)
# "Avertissement C4996 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details."
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
# project configuration
set( CMAKE_C_FLAGS_RELEASE "-O3" )
set( CMAKE_CXX_FLAGS_RELEASE "-O3" )
......
......@@ -6,6 +6,11 @@ cmake_minimum_required(VERSION 2.8.7)
project(MBsysC_module)
# Preprocessor definition, in order to suppress the warnings : (ST)
# "Avertissement C4996 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details."
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
# project configuration
set( CMAKE_C_FLAGS_RELEASE "-O3" )
set( CMAKE_CXX_FLAGS_RELEASE "-O3" )
......
......@@ -353,11 +353,11 @@ void mbs_dirdyn_init(MbsDirdyn* dd, MbsData* mbs_data)
// set the buffer size if not specified
if (dd->options->buffersize<1){
// compute size assuming a constant time step size
dd->options->buffersize = (int)(dd->options->tf - dd->options->t0)/
dd->options->buffersize = (int) ( (dd->options->tf - dd->options->t0)/
(dd->dt * dd->options->saveperiod)
+ 1;
+ 1 ) ;
// add some extra space
dd->options->buffersize *= 1.1;
dd->options->buffersize = (int) (dd->options->buffersize * 1.1);
dd->options->buffersize += 10;
}
......
......@@ -6,6 +6,11 @@ cmake_minimum_required(VERSION 2.8.7)
project(MBsysC_realtime)
# Preprocessor definition, in order to suppress the warnings : (ST)
# "Avertissement C4996 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details."
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
# project configuration
set( CMAKE_C_FLAGS_RELEASE "-O3" )
set( CMAKE_CXX_FLAGS_RELEASE "-O3" )
......
......@@ -74,7 +74,7 @@ AnimReader::AnimReader(const char* anim_filename)
f.close();
// time vector size
t_size = t_vec.size();
t_size = (int) t_vec.size();
if (t_size <= 0)
{
......@@ -214,7 +214,7 @@ void AnimReader::FillQ(double target_t, int nb_q, double *q_vec)
else
{
alpha = (target_t - t_vec[i0]) / diff_t_vec;
alpha = limit_range(alpha, 0.0, 1.0);
alpha = limit_range((int) alpha, 0, 1);
alpha_comp = 1.0 - alpha;
for(int i=0; i<nb_q; i++)
......@@ -274,7 +274,7 @@ void AnimReader::IndexTime(double target_t, int &i0, int &i1)
}
// initial guess
guess_i = my_round(((target_t - init_t) / diff_t) * t_size);
guess_i = (int) my_round(((target_t - init_t) / diff_t) * t_size);
// bound guess
guess_i = limit_range(guess_i, 0, t_size-1);
......
......@@ -1179,7 +1179,7 @@ void opengl_win_send_ok_pipe()
strcpy(pipe_msg, "ok");
// write to standard output
bSuccess = WriteFile(hdl_in_wr, pipe_msg, BUFSIZE, &dwWritten, NULL);
bSuccess = (bool) WriteFile(hdl_in_wr, pipe_msg, BUFSIZE, &dwWritten, NULL);
if (!bSuccess)
{
......@@ -1198,7 +1198,7 @@ void opengl_win_send_pipe_msg(std::string msg)
strcpy(pipe_msg, msg.c_str());
// write to standard output
bSuccess = WriteFile(hdl_in_wr, pipe_msg, BUFSIZE, &dwWritten, NULL);
bSuccess = (bool) WriteFile(hdl_in_wr, pipe_msg, BUFSIZE, &dwWritten, NULL);
if (!bSuccess)
{
......@@ -1218,7 +1218,7 @@ bool opengl_win_continue_pipe_answer()
std::string pipe_str;
// read child answer
bSuccess = ReadFile( hdl_out_rd, pipe_msg, BUFSIZE, &dwRead, NULL);
bSuccess = (bool) ReadFile( hdl_out_rd, pipe_msg, BUFSIZE, &dwRead, NULL);
if (!bSuccess)
{
......
......@@ -23,7 +23,7 @@ int int_node(xmlNodePtr node, xmlDocPtr doc)
if (node == NULL)
{
std::cout << "shader_multisample warning : cannot read integer from node" << std::endl;
return 0.;
return 0;
}
elem_val = xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
......
......@@ -59,7 +59,7 @@ std::ostream& operator<<(std::ostream& str, VrmlNode const& node) {
// VrmlGroup
VrmlGroup::~VrmlGroup(){
for(int i = children.size()-1; i>=0; i--){
for(int i = (int) children.size()-1; i>=0; i--){
delete children[i];
}
children.clear();
......@@ -230,7 +230,7 @@ inline glm::vec3 CoordTransform(glm::mat4& abs_transform, glm::vec3 coords){
void StandardPushVertices(std::vector<glm::vec3> &vert, std::vector<glm::vec3> &col,
glm::mat4& abs_transform, glm::vec3 curColor,
float* shape_vert, int* shape_coord, int nb_tri,
double* shape_vert, int* shape_coord, int nb_tri,
float sx, float sy, float sz){
for(int i=0; i<nb_tri; i++){
......
......@@ -113,7 +113,7 @@ class VrmlGroup : public VrmlSFNode{
std::vector<VrmlNode*> GetChildren() const{ return children; }
int GetNbChildren(){
return children.size();
return (int) children.size();
}
virtual std::ostream& ToString(std::ostream& str) const;
......
......@@ -17,7 +17,7 @@
#define NB_TRIANGLES_INIT_SPHERE 480 ///< initial number of triangles
// temporary vertices
float vrml_vert_sphere[3*NB_VERTICES_INIT_SPHERE] = {
double vrml_vert_sphere[3*NB_VERTICES_INIT_SPHERE] = {
-0.195090, 0.980785, 0.000000,
-0.382683, 0.923880, 0.000000,
-0.555570, 0.831470, 0.000000,
......@@ -755,7 +755,7 @@ int vrml_coord_sphere[3*NB_TRIANGLES_INIT_SPHERE] = {
#define NB_TRIANGLES_INIT_CONE 62 ///< initial number of triangles
// temporary vertices
float vrml_vert_cone[3*NB_VERTICES_INIT_CONE] = {
double vrml_vert_cone[3*NB_VERTICES_INIT_CONE] = {
0.000000, -1.0, -1.000000,
0.000000, 1.0, 0.000000,
0.195090, -1.0, -0.980785,
......@@ -867,7 +867,7 @@ int vrml_coord_cone[3*NB_TRIANGLES_INIT_CONE] = {
#define NB_TRIANGLES_INIT_CYLINDER 124 ///< initial number of triangles
// temporary vertices
float vrml_vert_cylinder[3*NB_VERTICES_INIT_CYLINDER] = {
double vrml_vert_cylinder[3*NB_VERTICES_INIT_CYLINDER] = {
0.000000, -1.0, -1.000000,
0.000000, 1.0, -1.000000,
0.195090, -1.0, -0.980785,
......@@ -1072,7 +1072,7 @@ int vrml_coord_cylinder[3*NB_TRIANGLES_INIT_CYLINDER] = {
#define NB_TRIANGLES_INIT_BOX 12 ///< initial number of triangles
// temporary vertices
float vrml_vert_box[3*NB_VERTICES_INIT_BOX] = {
double vrml_vert_box[3*NB_VERTICES_INIT_BOX] = {
-1.0, -1.0, 1.0,
-1.0, -1.0, -1.0,
1.0, -1.0, -1.0,
......
......@@ -167,7 +167,7 @@ float MbsRead::FloatNode(xmlNodePtr node, xmlDocPtr doc)
}
elem_val = xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
result = atof((const char*) elem_val);
result = (float) atof((const char*) elem_val);
xmlFree(elem_val);
return result;
......@@ -192,7 +192,7 @@ float MbsRead::FloatAttr(xmlAttr* attr, xmlDocPtr doc)
}
elem_val = xmlNodeListGetString(doc, attr->xmlChildrenNode, 1);
result = atof((const char*) elem_val);
result = (float) atof((const char*) elem_val);
xmlFree(elem_val);
return result;
......@@ -938,7 +938,7 @@ MbsPointLight* MbsRead::PointLightExtract(xmlNodePtr light_node, xmlDocPtr doc,
// ambient
cur_node = FirstNode(light_node->children, "ambient");
ambient = (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.05;
ambient = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.05 ) ;
if (cur_node == NULL)
{
......@@ -968,7 +968,7 @@ MbsPointLight* MbsRead::PointLightExtract(xmlNodePtr light_node, xmlDocPtr doc,
// shadowBias
cur_node = FirstNode(light_node->children, "shadowBias");
shadow_bias = (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.0;
shadow_bias = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.0 ) ;
if (cur_node == NULL)
{
......@@ -992,7 +992,7 @@ MbsPointLight* MbsRead::PointLightExtract(xmlNodePtr light_node, xmlDocPtr doc,
// depth near
cur_node = FirstNode(light_node->children, "depthNear");
depth_near = (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.1;
depth_near = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.1 ) ;
if (cur_node == NULL)
{
......@@ -1002,7 +1002,7 @@ MbsPointLight* MbsRead::PointLightExtract(xmlNodePtr light_node, xmlDocPtr doc,
// depth far
cur_node = FirstNode(light_node->children, "depthFar");
depth_far = (cur_node != NULL) ? FloatNode(cur_node, doc) : 100.0;
depth_far = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 100.0 ) ;
if (cur_node == NULL)
{
......@@ -1012,7 +1012,7 @@ MbsPointLight* MbsRead::PointLightExtract(xmlNodePtr light_node, xmlDocPtr doc,
// depth FoV
cur_node = FirstNode(light_node->children, "depthFovRad");
depth_FoV_rad = (cur_node != NULL) ? FloatNode(cur_node, doc) : 1.0;
depth_FoV_rad = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 1.0 ) ;
if (cur_node == NULL)
{
......@@ -1162,7 +1162,7 @@ MbsSpotLight* MbsRead::SpotLightExtract(xmlNodePtr light_node, xmlDocPtr doc, Ba
// ambient
cur_node = FirstNode(light_node->children, "ambient");
ambient = (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.05;
ambient = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.05 ) ;
if (cur_node == NULL)
{
......@@ -1192,7 +1192,7 @@ MbsSpotLight* MbsRead::SpotLightExtract(xmlNodePtr light_node, xmlDocPtr doc, Ba
// shadowBias
cur_node = FirstNode(light_node->children, "shadowBias");
shadow_bias = (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.0;
shadow_bias = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.0 ) ;
if (cur_node == NULL)
{
......@@ -1216,7 +1216,7 @@ MbsSpotLight* MbsRead::SpotLightExtract(xmlNodePtr light_node, xmlDocPtr doc, Ba
// depth near
cur_node = FirstNode(light_node->children, "depthNear");
depth_near = (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.1;
depth_near = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.1 ) ;
if (cur_node == NULL)
{
......@@ -1226,7 +1226,7 @@ MbsSpotLight* MbsRead::SpotLightExtract(xmlNodePtr light_node, xmlDocPtr doc, Ba
// depth far
cur_node = FirstNode(light_node->children, "depthFar");
depth_far = (cur_node != NULL) ? FloatNode(cur_node, doc) : 100.0;
depth_far = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 100.0 ) ;
if (cur_node == NULL)
{
......@@ -1236,7 +1236,7 @@ MbsSpotLight* MbsRead::SpotLightExtract(xmlNodePtr light_node, xmlDocPtr doc, Ba
// depth FoV
cur_node = FirstNode(light_node->children, "depthFovRad");
depth_FoV_rad = (cur_node != NULL) ? FloatNode(cur_node, doc) : 1.0;
depth_FoV_rad = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 1.0 );
if (cur_node == NULL)
{
......@@ -1402,7 +1402,7 @@ MbsDirLight* MbsRead::DirLightExtract(xmlNodePtr light_node, xmlDocPtr doc, Base
// ambient
cur_node = FirstNode(light_node->children, "ambient");
ambient = (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.05;
ambient = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.05);
if (cur_node == NULL)
{
......@@ -1432,7 +1432,7 @@ MbsDirLight* MbsRead::DirLightExtract(xmlNodePtr light_node, xmlDocPtr doc, Base
// shadowBias
cur_node = FirstNode(light_node->children, "shadowBias");
shadow_bias = (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.0;
shadow_bias = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.0 );
if (cur_node == NULL)
{
......@@ -1456,7 +1456,7 @@ MbsDirLight* MbsRead::DirLightExtract(xmlNodePtr light_node, xmlDocPtr doc, Base
// depth near
cur_node = FirstNode(light_node->children, "depthNear");
depth_near = (cur_node != NULL) ? FloatNode(cur_node, doc) : -10.0;
depth_near = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : -10.0);
if (cur_node == NULL)
{
......@@ -1466,7 +1466,7 @@ MbsDirLight* MbsRead::DirLightExtract(xmlNodePtr light_node, xmlDocPtr doc, Base
// depth far
cur_node = FirstNode(light_node->children, "depthFar");
depth_far = (cur_node != NULL) ? FloatNode(cur_node, doc) : 20.0;
depth_far = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 20.0);
if (cur_node == NULL)
{
......@@ -1476,7 +1476,7 @@ MbsDirLight* MbsRead::DirLightExtract(xmlNodePtr light_node, xmlDocPtr doc, Base
// depth scale
cur_node = FirstNode(light_node->children, "depthScale");
depth_scale = (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.0015;
depth_scale = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 0.0015 ) ;
if (cur_node == NULL)
{
......@@ -1635,7 +1635,7 @@ MbsShape3D* MbsRead::ShapeExtract(xmlNodePtr shape_node, xmlDocPtr doc,
return NULL;
}
transp = 1.0 - FloatNode(cur_node, doc);
transp = (float) ( 1.0 - FloatNode(cur_node, doc) ) ;
// specular color
cur_node = FirstNode(shape_node->children, "specularColor");
......@@ -1655,7 +1655,7 @@ MbsShape3D* MbsRead::ShapeExtract(xmlNodePtr shape_node, xmlDocPtr doc,
// shininess
cur_node = FirstNode(shape_node->children, "shininess");
shiny_mat = (cur_node != NULL) ? FloatNode(cur_node, doc) : 250.0;
shiny_mat = (float) ( (cur_node != NULL) ? FloatNode(cur_node, doc) : 250.0 ) ;
// color
......@@ -1669,7 +1669,6 @@ MbsShape3D* MbsRead::ShapeExtract(xmlNodePtr shape_node, xmlDocPtr doc,
RGBAttr(cur_node, doc, R_col, G_col, B_col);
// select correct shape
if(!strcmp((const char*)shape_node->name, "box"))
{
......
......@@ -61,9 +61,9 @@ MbsInline::MbsInline(std::string cad_file, glm::vec3 const& color,
else if (!ext_cad.compare("wrl"))
{
VrmlLoader loader;
load_success = loader.ParseVRML(cad_file);
load_success = (bool) loader.ParseVRML(cad_file);
if(load_success){
load_success = loader.PushVertices(temp_vertices, temp_colors);
load_success = (bool) loader.PushVertices(temp_vertices, temp_colors);
}
}
// STL file
......@@ -83,7 +83,7 @@ MbsInline::MbsInline(std::string cad_file, glm::vec3 const& color,
// set the number of triangles in case loading is successful
if (load_success)
{
SetNbTriangles(temp_vertices.size() / 3);
SetNbTriangles((int) (temp_vertices.size() / 3) );
}
else
{
......@@ -172,7 +172,7 @@ bool MbsInline::LoadOBJ(std::string cad_file, std::string dir_cad)
}
// number of vertices
nb_vertices = attrib.vertices.size() / 3;
nb_vertices = (int) (attrib.vertices.size() / 3);
// loop on all the shapes
for(unsigned int i=0; i<shapes.size(); i++)
......
......@@ -62,22 +62,22 @@ class MbsWorld3D
double GetT() const { return t; }
/// get the number of mbs in this world 3D
int GetNbMbs() const { return mbs_list.size(); }
int GetNbMbs() const { return (int) mbs_list.size(); }
/// get the number of nodes
int GetNbModels() const { return model_list.size(); }
int GetNbModels() const { return (int)model_list.size(); }
/// get the number of lights
int GetNbLights() const { return light_list.size(); }
int GetNbLights() const { return (int) light_list.size(); }
/// get the number of viewpoints
int GetNbViews() const { return view_list.size(); }
int GetNbViews() const { return (int) view_list.size(); }
/// get the number of joints
int GetNbJoints(int i) const { return joint_tab[i].size(); }
int GetNbJoints(int i) const { return (int) joint_tab[i].size(); }
/// get the shader flag
int GetShaderFlag() const { return shader_flag; }
int GetShaderFlag() const { return (int) shader_flag; }
/// get a requested model
MbsShape3D* GetModel(int i) { return model_list[i]; }
......
......@@ -6,6 +6,11 @@ cmake_minimum_required(VERSION 2.8.7)
project(MBsysC_utilities)
# Preprocessor definition, in order to suppress the warnings : (ST)
# "Avertissement C4996 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details."
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
# project configuration
set( CMAKE_C_FLAGS_RELEASE "-O3" )
set( CMAKE_CXX_FLAGS_RELEASE "-O3" )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment