From: <br...@us...> - 2012-05-01 05:38:43
|
Revision: 4288 http://openvrml.svn.sourceforge.net/openvrml/?rev=4288&view=rev Author: braden Date: 2012-05-01 05:38:37 +0000 (Tue, 01 May 2012) Log Message: ----------- Suppress various warnings from the Microsoft compiler version 16.00.40219.01. Modified Paths: -------------- branches/0.18/ChangeLog branches/0.18/src/libopenvrml/openvrml/basetypes.h branches/0.18/src/libopenvrml/openvrml/local/component.cpp branches/0.18/src/libopenvrml/openvrml/local/component.h branches/0.18/src/libopenvrml/openvrml/local/error.cpp branches/0.18/src/libopenvrml/openvrml/scene.cpp branches/0.18/src/libopenvrml-gl/openvrml/gl/viewer.cpp Property Changed: ---------------- branches/0.18/ branches/0.18/src/libopenvrml/openvrml/scene.cpp Property changes on: branches/0.18 ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757,3759-3760,3764,3766,3824,3828,3836 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688,3736-3801 /trunk:3958,3965,3967,3969,3971,3973,3975-3976,3979,3981,3983,3985,3987,3989,3991,3997,3999,4001,4003,4005,4011,4013-4014,4017,4019,4021,4024,4026,4028,4030,4032,4041,4043,4045,4047,4053,4055,4057,4059,4061,4063,4065,4067,4069,4071,4073,4075,4077,4079,4081,4083,4085,4087,4089,4091,4093,4095,4097,4099,4101,4107-4108,4113,4115,4117,4119-4120,4122,4124,4129,4131,4133,4135,4137,4139,4141,4143,4145,4147-4148,4150,4156,4159-4160,4162,4164,4169,4171,4174,4178-4179,4181,4183,4186,4188,4190,4192,4194,4196,4198-4199,4201,4203,4206,4208,4210,4212,4214,4216,4218,4220,4222,4224,4226,4228,4230,4232,4236,4243,4245,4247,4249,4251,4253,4255,4257,4259,4261,4264,4266,4268,4270,4272,4274,4276,4278,4280-4281,4283,4285 + /branches/0.17:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757,3759-3760,3764,3766,3824,3828,3836 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688,3736-3801 /trunk:3958,3965,3967,3969,3971,3973,3975-3976,3979,3981,3983,3985,3987,3989,3991,3997,3999,4001,4003,4005,4011,4013-4014,4017,4019,4021,4024,4026,4028,4030,4032,4041,4043,4045,4047,4053,4055,4057,4059,4061,4063,4065,4067,4069,4071,4073,4075,4077,4079,4081,4083,4085,4087,4089,4091,4093,4095,4097,4099,4101,4107-4108,4113,4115,4117,4119-4120,4122,4124,4129,4131,4133,4135,4137,4139,4141,4143,4145,4147-4148,4150,4156,4159-4160,4162,4164,4169,4171,4174,4178-4179,4181,4183,4186,4188,4190,4192,4194,4196,4198-4199,4201,4203,4206,4208,4210,4212,4214,4216,4218,4220,4222,4224,4226,4228,4230,4232,4236,4243,4245,4247,4249,4251,4253,4255,4257,4259,4261,4264,4266,4268,4270,4272,4274,4276,4278,4280-4281,4283,4285,4287 Modified: branches/0.18/ChangeLog =================================================================== --- branches/0.18/ChangeLog 2012-05-01 05:36:38 UTC (rev 4287) +++ branches/0.18/ChangeLog 2012-05-01 05:38:37 UTC (rev 4288) @@ -1,5 +1,17 @@ 2012-05-01 Braden McDaniel <br...@en...> + Suppress various warnings from the Microsoft compiler + version 16.00.40219.01. + + * src/libopenvrml/openvrml/basetypes.h + * src/libopenvrml/openvrml/scene.cpp + * src/libopenvrml/openvrml/local/component.cpp + * src/libopenvrml/openvrml/local/component.h + * src/libopenvrml/openvrml/local/error.cpp + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + +2012-05-01 Braden McDaniel <br...@en...> + * src/local/libopenvrml-dl/openvrml/local/dl.cpp (foreachfile(const std::vector<boost::filesystem::path> &, int (*)(const std::string &, void *), void *)): Boost.Filesystem 3 Modified: branches/0.18/src/libopenvrml/openvrml/basetypes.h =================================================================== --- branches/0.18/src/libopenvrml/openvrml/basetypes.h 2012-05-01 05:36:38 UTC (rev 4287) +++ branches/0.18/src/libopenvrml/openvrml/basetypes.h 2012-05-01 05:38:37 UTC (rev 4288) @@ -69,7 +69,7 @@ inline const float & color::operator[](const std::size_t index) const OPENVRML_NOTHROW { - assert(index < 3); + assert(index < 3UL); return this->rgb[index]; } @@ -145,7 +145,7 @@ inline const float & color_rgba::operator[](const std::size_t index) const OPENVRML_NOTHROW { - assert(index < 4); + assert(index < 4ul); return this->rgba[index]; } @@ -240,7 +240,7 @@ inline const float & vec2f::operator[](const std::size_t index) const OPENVRML_NOTHROW { - assert(index < 2); + assert(index < 2ul); return this->vec[index]; } @@ -325,7 +325,7 @@ inline const double & vec2d::operator[](const std::size_t index) const OPENVRML_NOTHROW { - assert(index < 2); + assert(index < 2ul); return this->vec[index]; } @@ -425,7 +425,7 @@ inline const float & vec3f::operator[](const std::size_t index) const OPENVRML_NOTHROW { - assert(index < 3); + assert(index < 3ul); return this->vec[index]; } @@ -538,7 +538,7 @@ inline const double & vec3d::operator[](const std::size_t index) const OPENVRML_NOTHROW { - assert(index < 3); + assert(index < 3ul); return this->vec[index]; } @@ -644,7 +644,7 @@ inline const float & rotation::operator[](const std::size_t index) const OPENVRML_NOTHROW { - assert(index < 4); + assert(index < 4ul); return this->rot[index]; } @@ -734,13 +734,13 @@ inline float (&mat4f::operator[](std::size_t index) OPENVRML_NOTHROW)[4] { - assert(index < 4); + assert(index < 4ul); return this->mat[index]; } inline const float (&mat4f::operator[](std::size_t index) const OPENVRML_NOTHROW)[4] { - assert(index < 4); + assert(index < 4ul); return this->mat[index]; } @@ -813,13 +813,13 @@ inline const float & quatf::operator[](std::size_t index) const OPENVRML_NOTHROW { - assert(index < 4); + assert(index < 4ul); return this->quat[index]; } inline float & quatf::operator[](std::size_t index) OPENVRML_NOTHROW { - assert(index < 4); + assert(index < 4ul); return this->quat[index]; } Modified: branches/0.18/src/libopenvrml/openvrml/local/component.cpp =================================================================== --- branches/0.18/src/libopenvrml/openvrml/local/component.cpp 2012-05-01 05:36:38 UTC (rev 4287) +++ branches/0.18/src/libopenvrml/openvrml/local/component.cpp 2012-05-01 05:38:37 UTC (rev 4288) @@ -379,11 +379,11 @@ void openvrml::local::profile:: -add_component(const std::string & name, const int level) +add_component(const std::string & name, const size_t level) OPENVRML_THROW1(std::bad_alloc) { //get the existing/new support level - int & comp_level = components_[name]; + size_t & comp_level = components_[name]; //update the support level. comp_level = std::max(level, comp_level); Modified: branches/0.18/src/libopenvrml/openvrml/local/component.h =================================================================== --- branches/0.18/src/libopenvrml/openvrml/local/component.h 2012-05-01 05:36:38 UTC (rev 4287) +++ branches/0.18/src/libopenvrml/openvrml/local/component.h 2012-05-01 05:38:37 UTC (rev 4288) @@ -108,11 +108,11 @@ class OPENVRML_LOCAL profile { - typedef std::map<std::string, int> map_t; + typedef std::map<std::string, size_t> map_t; map_t components_; protected: - void add_component(const std::string & name, int level) + void add_component(const std::string & name, size_t level) OPENVRML_THROW1(std::bad_alloc); public: Modified: branches/0.18/src/libopenvrml/openvrml/local/error.cpp =================================================================== --- branches/0.18/src/libopenvrml/openvrml/local/error.cpp 2012-05-01 05:36:38 UTC (rev 4287) +++ branches/0.18/src/libopenvrml/openvrml/local/error.cpp 2012-05-01 05:38:37 UTC (rev 4288) @@ -25,7 +25,7 @@ void openvrml::local::throw_runtime_error_from_win32_system_error(LONG result) OPENVRML_THROW1(std::runtime_error) { - static const LPCVOID source; + static const LPCVOID source = 0; LPTSTR buf = 0; BOOST_SCOPE_EXIT((&buf)) { LocalFree(buf); @@ -33,10 +33,10 @@ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, source, - result, + static_cast<DWORD>(result), LANG_USER_DEFAULT, - reinterpret_cast< LPTSTR >(&buf), - DWORD(0), + reinterpret_cast<LPTSTR>(&buf), + static_cast<DWORD>(0), 0); throw std::runtime_error(buf); Modified: branches/0.18/src/libopenvrml/openvrml/scene.cpp =================================================================== --- branches/0.18/src/libopenvrml/openvrml/scene.cpp 2012-05-01 05:36:38 UTC (rev 4287) +++ branches/0.18/src/libopenvrml/openvrml/scene.cpp 2012-05-01 05:38:37 UTC (rev 4288) @@ -423,7 +423,9 @@ const resource_istream::int_type c = this->in_->get(); if (c != resource_istream::traits_type::eof()) { data.push_back( - resource_istream::traits_type::to_char_type(c)); + static_cast<unsigned char>( + resource_istream::traits_type:: + to_char_type(c))); } else { break; } Property changes on: branches/0.18/src/libopenvrml/openvrml/scene.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757,3759-3760,3764,3766,3824,3828,3836 /branches/node-modules/src/libopenvrml/openvrml/scene.cpp:3736-3801 /trunk/src/libopenvrml/openvrml/scene.cpp:3958,3965,3967,3969,3971,3973,3975-3976,3979,3981,3983,3985,3987,3989,3991,3997,3999,4001,4003,4005,4011,4013-4014,4017,4019,4021,4024,4026,4028,4030,4032,4041,4043,4045,4053,4055,4057,4059,4061,4063,4065,4067,4069,4071,4073,4075,4077,4079,4081,4083,4085,4087,4089,4091,4093,4095,4097,4099,4101,4107-4108,4113,4115,4117,4119-4120,4122,4124,4129,4131,4133,4135,4137,4139,4141,4143,4145,4147-4148,4150,4156,4159-4160,4162,4164,4169,4171,4174,4178-4179,4181,4183,4186,4188,4190,4192,4194,4196,4198-4199,4201,4203,4206,4208,4210,4212,4214,4216,4218,4220,4222,4224,4226,4228,4230,4232,4236,4243,4245 + /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757,3759-3760,3764,3766,3824,3828,3836 /branches/node-modules/src/libopenvrml/openvrml/scene.cpp:3736-3801 /trunk/src/libopenvrml/openvrml/scene.cpp:3958,3965,3967,3969,3971,3973,3975-3976,3979,3981,3983,3985,3987,3989,3991,3997,3999,4001,4003,4005,4011,4013-4014,4017,4019,4021,4024,4026,4028,4030,4032,4041,4043,4045,4053,4055,4057,4059,4061,4063,4065,4067,4069,4071,4073,4075,4077,4079,4081,4083,4085,4087,4089,4091,4093,4095,4097,4099,4101,4107-4108,4113,4115,4117,4119-4120,4122,4124,4129,4131,4133,4135,4137,4139,4141,4143,4145,4147-4148,4150,4156,4159-4160,4162,4164,4169,4171,4174,4178-4179,4181,4183,4186,4188,4190,4192,4194,4196,4198-4199,4201,4203,4206,4208,4210,4212,4214,4216,4218,4220,4222,4224,4226,4228,4230,4232,4236,4243,4245,4287 Modified: branches/0.18/src/libopenvrml-gl/openvrml/gl/viewer.cpp =================================================================== --- branches/0.18/src/libopenvrml-gl/openvrml/gl/viewer.cpp 2012-05-01 05:36:38 UTC (rev 4287) +++ branches/0.18/src/libopenvrml-gl/openvrml/gl/viewer.cpp 2012-05-01 05:38:37 UTC (rev 4288) @@ -74,12 +74,6 @@ const double pi_4 = 0.78539816339744830962; const double inv_pi = 0.31830988618379067154; - template <typename Float> - OPENVRML_GL_LOCAL inline Float fabs(const Float f) - { - return f < 0.0 ? -f : f; - } - struct OPENVRML_GL_LOCAL fequal_t { template <typename Float> bool operator()(Float a, Float b) const @@ -2138,7 +2132,7 @@ GLdouble v[3]; // Mesa tesselator doesn;t like closed polys - size_t j = equalEndpts ? 1 : 0; + size_t j = equalEndpts ? 1ul : 0ul; for (; j < cs.size(); ++j) { v[0] = c[j + n].x(); v[1] = c[j + n].y(); @@ -2525,7 +2519,8 @@ spine_point->x(), spine_point->y(), spine_point->z(), 1.0); const vector<vec3f>::size_type spine_index = - std::distance(spine.begin(), spine_point); + static_cast<std::size_t>(std::distance(spine.begin(), + spine_point)); if (!orientation.empty()) { const vector<rotation>::size_type index = @@ -2704,8 +2699,8 @@ glBegin(GL_LINE_STRIP); if (!color.empty() && color_per_face) { const size_t color_index = !colorIndex.empty() - ? colorIndex.front() - : 0; + ? static_cast<std::size_t>(colorIndex.front()) + : 0ul; glColor3fv(&color[color_index][0]); } @@ -2720,7 +2715,7 @@ ? int32(colorIndex[nl]) : int32(nl); if (size_t(index) < color.size()) { - glColor3fv(&color[index][0]); + glColor3fv(&color[static_cast<std::size_t>(index)][0]); } } } else { @@ -2729,11 +2724,12 @@ ? colorIndex[i] : coordIndex[i]; if (size_t(index) < color.size()) { - glColor3fv(&color[index][0]); + glColor3fv(&color[static_cast<std::size_t>(index)][0]); } } if (size_t(coordIndex[i]) < coord.size()) { - glVertex3fv(&coord[coordIndex[i]][0]); + glVertex3fv( + &coord[static_cast<std::size_t>(coordIndex[i])][0]); } } } @@ -2887,10 +2883,12 @@ && s->coordIndex[i1] >= 0 && s->coordIndex[i1 + 1] >= 0 && s->coordIndex[i1 + 2] >= 0) { - N = indexFaceNormal(s->coordIndex[i1], - s->coordIndex[i1 + 1], - s->coordIndex[i1 + 2], - s->coord); + N = + indexFaceNormal( + static_cast<std::size_t>(s->coordIndex[i1]), + static_cast<std::size_t>(s->coordIndex[i1 + 1]), + static_cast<std::size_t>(s->coordIndex[i1 + 2]), + s->coord); // Flip normal if primitiv-orientation is clockwise if (!(s->mask & viewer::mask_ccw)) { N = -N; } @@ -2903,18 +2901,20 @@ if (s->coordIndex[i] >= 0) { // Per-vertex attributes - const size_t color_index = (i < s->colorIndex.size()) - ? s->colorIndex[i] - : s->coordIndex[i]; + const size_t color_index = + static_cast<std::size_t>( + (i < s->colorIndex.size()) ? s->colorIndex[i] + : s->coordIndex[i]); if (color_index < s->color.size() && (s->mask & viewer::mask_color_per_vertex)) { glColor3fv(&s->color[color_index][0]); } if (s->mask & viewer::mask_normal_per_vertex) { - const size_t normal_index = (i < s->normalIndex.size()) - ? s->normalIndex[i] - : s->coordIndex[i]; + const size_t normal_index = + static_cast<std::size_t>( + (i < s->normalIndex.size()) ? s->normalIndex[i] + : s->coordIndex[i]); if (normal_index < s->normal.size()) { glNormal3fv(&s->normal[normal_index][0]); } else { @@ -2922,17 +2922,21 @@ } } - const vec3f & v = s->coord[s->coordIndex[i]]; - const size_t tex_coord_index = (i < s->texCoordIndex.size()) - ? s->texCoordIndex[i] - : s->coordIndex[i]; + const vec3f & v = + s->coord[static_cast<std::size_t>(s->coordIndex[i])]; + const size_t tex_coord_index = + static_cast<std::size_t>( + (i < s->texCoordIndex.size()) ? s->texCoordIndex[i] + : s->coordIndex[i]); if (tex_coord_index < s->texCoord.size()) { glTexCoord2fv(&s->texCoord[tex_coord_index][0]); } else { float c0, c1; - c0 = (v[s->texAxes[0]] - s->texParams[0]) + c0 = (v[static_cast<std::size_t>(s->texAxes[0])] + - s->texParams[0]) * s->texParams[1]; - c1 = (v[s->texAxes[1]] - s->texParams[2]) + c1 = (v[static_cast<std::size_t>(s->texAxes[1])] + - s->texParams[2]) * s->texParams[3]; glTexCoord2f(c0, c1); } @@ -3011,11 +3015,14 @@ // while (coord_index[i + 1] != -1) { ++i; } } else if (coord_index[i] != -1) { - gluTessVertex(&tessobj, - const_cast<GLdouble *>( - vertices[coord_index[i]].coord), - &const_cast<vertex_data &>( - vertices[coord_index[i]])); + gluTessVertex( + &tessobj, + const_cast<GLdouble *>( + vertices[ + static_cast<std::size_t>(coord_index[i])].coord), + &const_cast<vertex_data &>( + vertices[ + static_cast<std::size_t>(coord_index[i])])); } else { gluTessEndContour(&tessobj); gluTessEndPolygon(&tessobj); @@ -3143,7 +3150,8 @@ ++i) { if (color_index[i] < 0) { continue; } if (!(size_t(coord_index[i]) < coord.size())) { continue; } - vertices[coord_index[i]].color = &color[color_index[i]]; + vertices[static_cast<std::size_t>(coord_index[i])].color = + &color[static_cast<std::size_t>(color_index[i])]; } } } @@ -3160,7 +3168,8 @@ ++i) { if (normal_index[i] < 0) { continue; } if (!(size_t(coord_index[i]) < coord.size())) { continue; } - vertices[coord_index[i]].normal = &normal[normal_index[i]]; + vertices[static_cast<std::size_t>(coord_index[i])].normal = + &normal[static_cast<std::size_t>(normal_index[i])]; } } } @@ -3176,8 +3185,10 @@ i < tex_coord_index.size(); ++i) { if (tex_coord_index[i] < 0) { continue; } - vertices[tex_coord_index[i]].tex_coord = - &tex_coord[tex_coord_index[i]]; + vertices[static_cast<std::size_t>(tex_coord_index[i])] + .tex_coord = + &tex_coord[static_cast<std::size_t>( + tex_coord_index[i])]; } } @@ -3698,7 +3709,7 @@ const texture_map_t::const_iterator texture = this->texture_map_.find(&n); if (texture != this->texture_map_.end()) { // Enable blending if needed. - const int32 comp = n.image().comp(); + const int32 comp = static_cast<int32>(n.image().comp()); if (this->blend && (comp == 2 || comp == 4)) { glEnable(GL_BLEND); } glBindTexture(GL_TEXTURE_2D, texture->second); return; @@ -3718,8 +3729,8 @@ if (width > max_texture_size) { width = max_texture_size; } if (height > max_texture_size) { height = max_texture_size; } - while (!power_of_2(width)) { --width; } - while (!power_of_2(height)) { --height; } + while (!power_of_2(static_cast<std::size_t>(width))) { --width; } + while (!power_of_2(static_cast<std::size_t>(height))) { --height; } vector<GLubyte> rescaled_pixels; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |