diff --git a/code/nel/include/nel/3d/animation_set.h b/code/nel/include/nel/3d/animation_set.h index 72f389e7b..e9013d3d3 100644 --- a/code/nel/include/nel/3d/animation_set.h +++ b/code/nel/include/nel/3d/animation_set.h @@ -103,7 +103,7 @@ public: */ uint getNumAnimation () const { - return _Animation.size(); + return (uint)_Animation.size(); } /** @@ -138,7 +138,7 @@ public: */ uint getNumSkeletonWeight () const { - return _SkeletonWeight.size(); + return (uint)_SkeletonWeight.size(); } /** diff --git a/code/nel/include/nel/3d/cluster.h b/code/nel/include/nel/3d/cluster.h index f12a669ce..07ccc7d7e 100644 --- a/code/nel/include/nel/3d/cluster.h +++ b/code/nel/include/nel/3d/cluster.h @@ -111,7 +111,7 @@ public: void link (CPortal* portal); void unlink (CPortal* portal); - uint32 getNbPortals() {return _Portals.size();} + uint32 getNbPortals() {return (uint32)_Portals.size();} CPortal* getPortal(uint32 pos) {return _Portals[pos];} /// Serial diff --git a/code/nel/include/nel/3d/computed_string.h b/code/nel/include/nel/3d/computed_string.h index 7b026bc6d..0ce2092f9 100644 --- a/code/nel/include/nel/3d/computed_string.h +++ b/code/nel/include/nel/3d/computed_string.h @@ -98,7 +98,7 @@ public: uint size() const { - return _indexedColors.size(); + return (uint)_indexedColors.size(); } uint getIndex(uint i) const diff --git a/code/nel/include/nel/3d/fast_ptr_list.h b/code/nel/include/nel/3d/fast_ptr_list.h index 5beff4266..d9e279d75 100644 --- a/code/nel/include/nel/3d/fast_ptr_list.h +++ b/code/nel/include/nel/3d/fast_ptr_list.h @@ -84,7 +84,7 @@ public: /// Get the head on the array of elements. NULL if none void **begin() { if(_Elements.empty()) return NULL; else return &_Elements[0];} /// get the number of elements - uint size() const {return _Elements.size();} + uint size() const {return (uint)_Elements.size();} bool empty() const {return _Elements.empty();} /// clear the list diff --git a/code/nel/include/nel/3d/hls_color_texture.h b/code/nel/include/nel/3d/hls_color_texture.h index da27da70d..11cbeacbc 100644 --- a/code/nel/include/nel/3d/hls_color_texture.h +++ b/code/nel/include/nel/3d/hls_color_texture.h @@ -78,7 +78,7 @@ public: void addMask(const NLMISC::CBitmap &bmp, uint threshold= 15); /// get num of masks - uint getNumMasks() const {return _Masks.size();} + uint getNumMasks() const {return (uint)_Masks.size();} /** build a texture with a HLS Color Delta * \param colDelta array of delta to apply to the bitmap (must be of numMasks entries) diff --git a/code/nel/include/nel/3d/hls_texture_manager.h b/code/nel/include/nel/3d/hls_texture_manager.h index f007b0f05..d39d55354 100644 --- a/code/nel/include/nel/3d/hls_texture_manager.h +++ b/code/nel/include/nel/3d/hls_texture_manager.h @@ -58,7 +58,7 @@ public: bool buildTexture(sint textId, NLMISC::CBitmap &out) const; /// Texture name access - uint getNumTextures() const {return _Instances.size();} + uint getNumTextures() const {return (uint)_Instances.size();} const char *getTextureName(uint i) const; private: diff --git a/code/nel/include/nel/3d/lod_character_shape.h b/code/nel/include/nel/3d/lod_character_shape.h index b8aa8a9b2..c1cdb424b 100644 --- a/code/nel/include/nel/3d/lod_character_shape.h +++ b/code/nel/include/nel/3d/lod_character_shape.h @@ -178,7 +178,7 @@ public: uint getNumTriangles() const {return _NumTriangles;} /// get the number of bones - uint getNumBones() const {return _Bones.size();} + uint getNumBones() const {return (uint)_Bones.size();} /// get a bone id, according to its name. -1 if not found sint getBoneIdByName(const std::string &name) const; diff --git a/code/nel/include/nel/3d/mesh.h b/code/nel/include/nel/3d/mesh.h index f4c6f6987..d5a462918 100644 --- a/code/nel/include/nel/3d/mesh.h +++ b/code/nel/include/nel/3d/mesh.h @@ -392,12 +392,12 @@ public: const CVertexBuffer &getVertexBuffer() const { return _VBuffer ; } /// get the number of matrix block - uint getNbMatrixBlock() const { return _MatrixBlocks.size() ; } + uint getNbMatrixBlock() const { return (uint)_MatrixBlocks.size() ; } /** get the number of rendering pass for a given matrix block * \param matrixBlockIndex the index of the matrix block the rendering passes belong to */ - uint getNbRdrPass(uint matrixBlockIndex) const { return _MatrixBlocks[matrixBlockIndex].RdrPass.size() ; } + uint getNbRdrPass(uint matrixBlockIndex) const { return (uint)_MatrixBlocks[matrixBlockIndex].RdrPass.size() ; } /** get the primitive block associated with a rendering pass of a matrix block * \param matrixBlockIndex the index of the matrix block the renderin pass belong to @@ -418,7 +418,7 @@ public: } /// get the number of BlendShapes - uint getNbBlendShapes() const { if(_MeshMorpher) return _MeshMorpher->BlendShapes.size(); return 0; } + uint getNbBlendShapes() const { if(_MeshMorpher) return (uint)_MeshMorpher->BlendShapes.size(); return 0; } /** Tool function to retrieve vector geometry only of the mesh. * return false if the vbuffer cannot be read (resident) diff --git a/code/nel/include/nel/3d/mesh_base.h b/code/nel/include/nel/3d/mesh_base.h index b576a02e7..0925d21d6 100644 --- a/code/nel/include/nel/3d/mesh_base.h +++ b/code/nel/include/nel/3d/mesh_base.h @@ -185,7 +185,7 @@ public: /// Get the number of materials in the mesh uint getNbMaterial() const { - return _Materials.size(); + return (uint)_Materials.size(); } /// Get a material diff --git a/code/nel/include/nel/3d/mesh_mrm.h b/code/nel/include/nel/3d/mesh_mrm.h index 9e1608a3d..24c64cb81 100644 --- a/code/nel/include/nel/3d/mesh_mrm.h +++ b/code/nel/include/nel/3d/mesh_mrm.h @@ -175,13 +175,13 @@ public: /** get the number of LOD. */ - uint getNbLod() const { return _Lods.size() ; } + uint getNbLod() const { return (uint)_Lods.size() ; } /** get the number of rendering pass of a LOD. * \param lodId the id of the LOD. */ - uint getNbRdrPass(uint lodId) const { return _Lods[lodId].RdrPass.size() ; } + uint getNbRdrPass(uint lodId) const { return (uint)_Lods[lodId].RdrPass.size() ; } /** get the primitive block associated with a rendering pass of a LOD. @@ -211,7 +211,7 @@ public: } /// get the number of BlendShapes - uint getNbBlendShapes() const { return _MeshMorpher.BlendShapes.size(); } + uint getNbBlendShapes() const { return (uint)_MeshMorpher.BlendShapes.size(); } /** Build a geometry copy for the given Lod. The VBuffer/IndexBuffer must not be resident. false if bad lodId * The process ensure there is no hole in the resulting vertices array. Hence VB num Verts != vertices.size(). diff --git a/code/nel/include/nel/3d/mesh_mrm_skinned.h b/code/nel/include/nel/3d/mesh_mrm_skinned.h index 1470a1c38..6df2699e4 100644 --- a/code/nel/include/nel/3d/mesh_mrm_skinned.h +++ b/code/nel/include/nel/3d/mesh_mrm_skinned.h @@ -152,13 +152,13 @@ public: /** get the number of LOD. */ - uint getNbLod() const { return _Lods.size() ; } + uint getNbLod() const { return (uint)_Lods.size() ; } /** get the number of rendering pass of a LOD. * \param lodId the id of the LOD. */ - uint getNbRdrPass(uint lodId) const { return _Lods[lodId].RdrPass.size() ; } + uint getNbRdrPass(uint lodId) const { return (uint)_Lods[lodId].RdrPass.size() ; } /** get the primitive block associated with a rendering pass of a LOD. @@ -294,7 +294,7 @@ private: // Get num triangle uint getNumTriangle () const { - return PBlock.size()/3; + return (uint)PBlock.size()/3; } }; @@ -476,7 +476,7 @@ public: // Acces it uint getNumVertices() const { - return _PackedBuffer.size(); + return (uint)_PackedBuffer.size(); } // Decompact position diff --git a/code/nel/include/nel/3d/mesh_multi_lod.h b/code/nel/include/nel/3d/mesh_multi_lod.h index 3a6235125..5e891b7b2 100644 --- a/code/nel/include/nel/3d/mesh_multi_lod.h +++ b/code/nel/include/nel/3d/mesh_multi_lod.h @@ -142,7 +142,7 @@ public: /// Get slot mesh count. uint getNumSlotMesh () const { - return _MeshVector.size(); + return (uint)_MeshVector.size(); } /// Get a slot mesh. diff --git a/code/nel/include/nel/3d/particle_system.h b/code/nel/include/nel/3d/particle_system.h index 9bc61e1db..e22bd20b9 100644 --- a/code/nel/include/nel/3d/particle_system.h +++ b/code/nel/include/nel/3d/particle_system.h @@ -263,7 +263,7 @@ public: void remove(CParticleSystemProcess *process); /// get the number of process that are attached to the system - uint32 getNbProcess(void) const { return _ProcessVect.size(); } + uint32 getNbProcess(void) const { return (uint32)_ProcessVect.size(); } /** * Get a pointer to the nth process. diff --git a/code/nel/include/nel/3d/particle_system_shape.h b/code/nel/include/nel/3d/particle_system_shape.h index 2dcae74e9..6f5f84e42 100644 --- a/code/nel/include/nel/3d/particle_system_shape.h +++ b/code/nel/include/nel/3d/particle_system_shape.h @@ -131,7 +131,7 @@ public: bool isShared() const { return _Sharing; } // Get the number of cached textures - uint getNumCachedTextures() const { return _CachedTex.size(); } + uint getNumCachedTextures() const { return (uint)_CachedTex.size(); } // Get a cached texture ITexture *getCachedTexture(uint index) const { return _CachedTex[index]; } diff --git a/code/nel/include/nel/3d/ps_attrib.h b/code/nel/include/nel/3d/ps_attrib.h index a745fb676..fc17dc787 100644 --- a/code/nel/include/nel/3d/ps_attrib.h +++ b/code/nel/include/nel/3d/ps_attrib.h @@ -294,7 +294,7 @@ public: void resize(uint32 nbInstances); /// return the number of instance in the container - uint32 getSize(void) const { return _Tab.size(); } + uint32 getSize(void) const { return (uint32)_Tab.size(); } /// return the max number of instance in the container uint32 getMaxSize(void) const { return _MaxSize; } @@ -411,7 +411,7 @@ sint32 CPSAttrib::insert(const T &t) return -1; } _Tab.push_back(t); - return _Tab.size() - 1; + return (sint32)_Tab.size() - 1; } @@ -455,7 +455,7 @@ void CPSAttrib::serial(NLMISC::IStream &f) throw(NLMISC::EStream) } else { - uint32 size = _Tab.size(); + uint32 size = (uint32)_Tab.size(); f.serial(size); f.serial(_MaxSize); f.serial(size); @@ -537,7 +537,7 @@ void CPSAttrib::serial(NLMISC::IStream &f) throw(NLMISC::EStream) } else { - uint32 size = _Tab.size(), capacity = _Tab.capacity(); + uint32 size = (uint32)_Tab.size(), capacity = (uint32)_Tab.capacity(); if (ver == 3) { f.serial(size, capacity); diff --git a/code/nel/include/nel/3d/ps_attrib_maker_template.h b/code/nel/include/nel/3d/ps_attrib_maker_template.h index f29fd5790..8e84c5abd 100644 --- a/code/nel/include/nel/3d/ps_attrib_maker_template.h +++ b/code/nel/include/nel/3d/ps_attrib_maker_template.h @@ -466,7 +466,7 @@ void CPSValueGradientFunc::setValues(const T *valueTab, uint32 numValues, uin computeGradient(valueTab, numValues, nbStages, _Tab, _MinValue, _MaxValue); // _NbStages = nbStages; - _NbValues = _Tab.size() - 1; + _NbValues = (uint32)_Tab.size() - 1; } diff --git a/code/nel/include/nel/3d/ps_face.h b/code/nel/include/nel/3d/ps_face.h index c06bc4a08..1d6239064 100644 --- a/code/nel/include/nel/3d/ps_face.h +++ b/code/nel/include/nel/3d/ps_face.h @@ -104,7 +104,7 @@ public: { min = _MinAngularVelocity; max = _MaxAngularVelocity; - return _PrecompBasis.size(); + return (uint32)_PrecompBasis.size(); } /// from CPSParticle : return true if there are lightable faces in the object diff --git a/code/nel/include/nel/3d/ps_float.h b/code/nel/include/nel/3d/ps_float.h index ddb5c2659..20878de27 100644 --- a/code/nel/include/nel/3d/ps_float.h +++ b/code/nel/include/nel/3d/ps_float.h @@ -121,7 +121,7 @@ class CPSFloatCurveFunctor void addControlPoint(const CCtrlPoint &ctrlPoint); /// retrieve the number of control points - uint getNumCtrlPoints(void) const { return _CtrlPoints.size(); } + uint getNumCtrlPoints(void) const { return (uint)_CtrlPoints.size(); } /** get a control point. * \return a std::pair diff --git a/code/nel/include/nel/3d/ps_located.h b/code/nel/include/nel/3d/ps_located.h index 92bea18de..cc6106897 100644 --- a/code/nel/include/nel/3d/ps_located.h +++ b/code/nel/include/nel/3d/ps_located.h @@ -151,7 +151,7 @@ public: /** * count the number of bound objects */ - uint32 getNbBoundObjects(void) const { NL_PS_FUNC(getNbBoundObjects); return _LocatedBoundCont.size(); } + uint32 getNbBoundObjects(void) const { NL_PS_FUNC(getNbBoundObjects); return (uint32)_LocatedBoundCont.size(); } /** * get a pointer to a bound object (const version) @@ -989,7 +989,7 @@ public: */ virtual void releaseAllRef(); /// return the number of targets - uint32 getNbTargets(void) const { return _Targets.size(); } + uint32 getNbTargets(void) const { return (uint32)_Targets.size(); } /// Return a ptr on a target. Invalid range -> nlassert CPSLocated *getTarget(uint32 index) { diff --git a/code/nel/include/nel/3d/ps_mesh.h b/code/nel/include/nel/3d/ps_mesh.h index d93e82cab..c4e54929e 100644 --- a/code/nel/include/nel/3d/ps_mesh.h +++ b/code/nel/include/nel/3d/ps_mesh.h @@ -266,7 +266,7 @@ public: { min = _MinAngularVelocity; max = _MaxAngularVelocity; - return _PrecompBasis.size(); + return (uint32)_PrecompBasis.size(); } diff --git a/code/nel/include/nel/3d/ps_ribbon.h b/code/nel/include/nel/3d/ps_ribbon.h index 2b08d9e58..2ec490b22 100644 --- a/code/nel/include/nel/3d/ps_ribbon.h +++ b/code/nel/include/nel/3d/ps_ribbon.h @@ -132,7 +132,7 @@ public: // See if shape is in brace mode (rather then in closed loop mode) bool getBraceMode() const { return _BraceMode; } /// get the number of vertice in the shape used for ribbons - uint32 getNbVerticesInShape(void) const { return _Shape.size(); } + uint32 getNbVerticesInShape(void) const { return (uint32)_Shape.size(); } /** Get a copy of the shape used for ribbon * \param dest a table of cvector that has the right size, it will be filled with vertices diff --git a/code/nel/include/nel/3d/quad_grid.h b/code/nel/include/nel/3d/quad_grid.h index 9e7a63467..28ec3ed64 100644 --- a/code/nel/include/nel/3d/quad_grid.h +++ b/code/nel/include/nel/3d/quad_grid.h @@ -802,7 +802,7 @@ template void CQuadGrid::buildSelectionShape(TSelectionShape &dest, { dest.clear(); sint minY; - uint numVerts = poly.Vertices.size(); + uint numVerts = (uint)poly.Vertices.size(); _ScaledPoly.Vertices.resize(numVerts); nlassert(_EltSize != 0.f); float invScale = 1.f / _EltSize; @@ -814,7 +814,7 @@ template void CQuadGrid::buildSelectionShape(TSelectionShape &dest, _ScaledPoly.computeOuterBorders(_PolyBorders, minY); if (_PolyBorders.empty()) return; initSelectStamps(); - sint numSegs = _PolyBorders.size(); + sint numSegs = (sint)_PolyBorders.size(); for (sint y = 0; y < numSegs; ++y) { sint currIndex = ((minY + y) & (_Size - 1)) << _SizePower; diff --git a/code/nel/include/nel/3d/scene.h b/code/nel/include/nel/3d/scene.h index f3c68ddc4..b003314af 100644 --- a/code/nel/include/nel/3d/scene.h +++ b/code/nel/include/nel/3d/scene.h @@ -419,7 +419,7 @@ public: /// get the number of light group. uint getNumLightGroup () const { - return _LightGroupColor.size (); + return (uint)_LightGroupColor.size (); } /// get the color of a lightmap group. NLMISC::CRGBA getLightmapGroupColor(uint lightGroup) const diff --git a/code/nel/include/nel/3d/scene_group.h b/code/nel/include/nel/3d/scene_group.h index b4828ff6b..9b4f8d792 100644 --- a/code/nel/include/nel/3d/scene_group.h +++ b/code/nel/include/nel/3d/scene_group.h @@ -341,7 +341,7 @@ public: const std::vector &getPointLightList() const {return _PointLightArray.getPointLights();} /// Get the number of point lights - uint getNumPointLights() const { return _PointLightArray.getPointLights().size(); } + uint getNumPointLights() const { return (uint)_PointLightArray.getPointLights().size(); } /// Get a mutable ref on a point light named CPointLightNamed &getPointLightNamed(uint index) diff --git a/code/nel/include/nel/3d/seg_remanence_shape.h b/code/nel/include/nel/3d/seg_remanence_shape.h index 395032bdf..510c7ac2a 100644 --- a/code/nel/include/nel/3d/seg_remanence_shape.h +++ b/code/nel/include/nel/3d/seg_remanence_shape.h @@ -97,7 +97,7 @@ public: */ void setNumCorners(uint numCorners); // get the number of corners - uint32 getNumCorners() const { return _Corners.size(); } + uint32 getNumCorners() const { return (uint32)_Corners.size(); } // Set a corner void setCorner(uint corner, const NLMISC::CVector &value); // Get a corner diff --git a/code/nel/include/nel/3d/skeleton_model.h b/code/nel/include/nel/3d/skeleton_model.h index 9bf16b192..b2f13d256 100644 --- a/code/nel/include/nel/3d/skeleton_model.h +++ b/code/nel/include/nel/3d/skeleton_model.h @@ -199,7 +199,7 @@ public: bool forceComputeBone(uint boneId); /// return the number of bones currently animated/computed (because of bindSkin()/stickObject() / Lod system). - uint getNumBoneComputed() const {return _BoneToCompute.size();} + uint getNumBoneComputed() const {return (uint)_BoneToCompute.size();} /** change the Lod Bone interpolation distance (in meters). If 0, interpolation is disabled. * The smaller this value is, the more Lod skeleton system will "pop". Default is 0.5 meters. diff --git a/code/nel/include/nel/3d/skeleton_shape.h b/code/nel/include/nel/3d/skeleton_shape.h index 9997a7357..5a2d36dbe 100644 --- a/code/nel/include/nel/3d/skeleton_shape.h +++ b/code/nel/include/nel/3d/skeleton_shape.h @@ -108,7 +108,7 @@ public: /// get lod information. const CLod &getLod(uint lod) const {return _Lods[lod];} - uint getNumLods() const {return _Lods.size();} + uint getNumLods() const {return (uint)_Lods.size();} // *************************** private: diff --git a/code/nel/include/nel/3d/texture_multi_file.h b/code/nel/include/nel/3d/texture_multi_file.h index 579d9cf63..bcd3dba28 100644 --- a/code/nel/include/nel/3d/texture_multi_file.h +++ b/code/nel/include/nel/3d/texture_multi_file.h @@ -51,7 +51,7 @@ public: */ void setFileName(uint index, const char *); // - uint getNumFileName() const { return _FileNames.size(); } + uint getNumFileName() const { return (uint)_FileNames.size(); } /** * get the name of the file containing the texture for the given index * \return name of the file diff --git a/code/nel/include/nel/3d/tile_bank.h b/code/nel/include/nel/3d/tile_bank.h index 30ad4d9a5..ca7e2f22d 100644 --- a/code/nel/include/nel/3d/tile_bank.h +++ b/code/nel/include/nel/3d/tile_bank.h @@ -331,7 +331,7 @@ public: } sint getNumTile256 () const { - return _Tile256.size(); + return (sint)_Tile256.size(); } sint32 getTile128 (sint index) const { @@ -494,40 +494,40 @@ public: // Get sint getLandCount () const { - return _LandVector.size(); - }; + return (sint)_LandVector.size(); + } const CTileLand* getLand (int landIndex) const { return &_LandVector[landIndex]; - }; + } CTileLand* getLand (int landIndex) { return &_LandVector[landIndex]; - }; + } sint getTileSetCount () const { - return _TileSetVector.size(); - }; + return (sint)_TileSetVector.size(); + } const CTileSet* getTileSet (int tileIndex) const { return &_TileSetVector[tileIndex]; - }; + } CTileSet* getTileSet (int tileIndex) { return &_TileSetVector[tileIndex]; - }; + } sint getTileCount () const { - return _TileVector.size(); - }; + return (sint)_TileVector.size(); + } const CTile* getTile (int tileIndex) const { return &_TileVector[tileIndex]; - }; + } CTile* getTile (int tileIndex) { return &_TileVector[tileIndex]; - }; + } sint addLand (const std::string& name); void removeLand (sint landIndex); sint addTileSet (const std::string& name); diff --git a/code/nel/include/nel/3d/tile_far_bank.h b/code/nel/include/nel/3d/tile_far_bank.h index e1d6261f0..76070dcde 100644 --- a/code/nel/include/nel/3d/tile_far_bank.h +++ b/code/nel/include/nel/3d/tile_far_bank.h @@ -79,7 +79,7 @@ public: /// Return the pixel array size. Should be 0 for empty, 64 for a 128x128 tile and 256 for a 256x256 tile. uint getSize (TFarType type, TFarOrder order) const { - return _Pixels[type][order].size(); + return (uint)_Pixels[type][order].size(); } /// Set the pixel array of a far Tile diff --git a/code/nel/include/nel/3d/track_bezier.h b/code/nel/include/nel/3d/track_bezier.h index d907592d1..9835e3b30 100644 --- a/code/nel/include/nel/3d/track_bezier.h +++ b/code/nel/include/nel/3d/track_bezier.h @@ -155,7 +155,7 @@ protected: ITrackKeyFramer::compile(); // makeclosest quaternions, Tangents Precompute. - sint nKeys= _MapKey.size(); + sint nKeys= (sint)_MapKey.size(); if(nKeys<=1) return; diff --git a/code/nel/include/nel/3d/track_tcb.h b/code/nel/include/nel/3d/track_tcb.h index 032ae3a76..8daf5cc2a 100644 --- a/code/nel/include/nel/3d/track_tcb.h +++ b/code/nel/include/nel/3d/track_tcb.h @@ -246,7 +246,7 @@ protected: // Tangents Precompute. - sint nKeys= this->_MapKey.size(); + sint nKeys= (sint)this->_MapKey.size(); if(nKeys<=1) return; @@ -458,7 +458,7 @@ public: } // Tangents Precompute. - sint nKeys= _MapKey.size(); + sint nKeys= (sint)_MapKey.size(); if(nKeys<=1) return; diff --git a/code/nel/include/nel/3d/transform.h b/code/nel/include/nel/3d/transform.h index 288b0b059..fd551f93d 100644 --- a/code/nel/include/nel/3d/transform.h +++ b/code/nel/include/nel/3d/transform.h @@ -236,7 +236,7 @@ public: // unlink from all parent clip void clipUnlinkFromAll(); // get Parents links. NB: indices are no more valid after a clipDelChild() - uint clipGetNumParents() const {return _ClipParents.size();} + uint clipGetNumParents() const {return (uint)_ClipParents.size();} CTransform *clipGetParent(uint index) const; // get Sons links. NB: indices are no more valid after a clipDelChild() uint clipGetNumChildren() const {return _ClipSons.size();} diff --git a/code/nel/include/nel/3d/zone.h b/code/nel/include/nel/3d/zone.h index 4b1dc93b6..29c87104c 100644 --- a/code/nel/include/nel/3d/zone.h +++ b/code/nel/include/nel/3d/zone.h @@ -490,7 +490,7 @@ public: float getPatchScale() const {return PatchScale;} bool compiled() const {return Compiled;} uint16 getZoneId() const {return ZoneId;} - sint getNumPatchs() const {return Patchs.size();} + sint getNumPatchs() const {return (sint)Patchs.size();} // Return the Bounding Box of the zone. const CAABBoxExt &getZoneBB() const {return ZoneBB;} diff --git a/code/nel/include/nel/3d/zone_lighter.h b/code/nel/include/nel/3d/zone_lighter.h index 632e1d8f5..f096fe130 100644 --- a/code/nel/include/nel/3d/zone_lighter.h +++ b/code/nel/include/nel/3d/zone_lighter.h @@ -331,7 +331,7 @@ public: void addWaterShape(CWaterShape *shape, const NLMISC::CMatrix &MT); /// get the number of water shapes added - uint getNumWaterShape() const {return _WaterShapes.size();} + uint getNumWaterShape() const {return (uint)_WaterShapes.size();} /// check whether a shape is lightable. static bool isLightableShape(IShape &shape); diff --git a/code/nel/include/nel/georges/load_form.h b/code/nel/include/nel/georges/load_form.h index c3ba283c8..b0767cade 100644 --- a/code/nel/include/nel/georges/load_form.h +++ b/code/nel/include/nel/georges/load_form.h @@ -363,8 +363,8 @@ void loadForm (const std::vector &sheetFilters, const std::string & { uint dicIndex; // add a new dictionnary entry - dicIndex = dictionnary.size(); - dictionnaryIndex.insert(std::make_pair(filename, dictionnary.size())); + dicIndex = (uint)dictionnary.size(); + dictionnaryIndex.insert(std::make_pair(filename, (uint)dictionnary.size())); dictionnary.push_back(filename); // add the dependecy index @@ -430,7 +430,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & ofile.serialCont(dictionnary); // write the dependencies data - uint32 depSize = dependencies.size(); + uint32 depSize = (uint32)dependencies.size(); ofile.serial(depSize); std::map >::iterator first(dependencies.begin()), last(dependencies.end()); for (; first != last; ++first) @@ -448,7 +448,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & ofile.seek(endBlockSize, NLMISC::IStream::begin); // write the sheet data - uint32 nbEntries = sheetIds.size(); + uint32 nbEntries = (uint32)sheetIds.size(); uint32 ver = T::getVersion (); ofile.serial (nbEntries); ofile.serial (ver); @@ -1086,8 +1086,8 @@ void loadForm (const std::vector &sheetFilters, const std::string & if (dictionnaryIndex.find(filename) == dictionnaryIndex.end()) { // add a new dictionnary entry - dicIndex = dictionnary.size(); - dictionnaryIndex.insert(std::make_pair(filename, dictionnary.size())); + dicIndex = (uint)dictionnary.size(); + dictionnaryIndex.insert(std::make_pair(filename, (uint)dictionnary.size())); dictionnary.push_back(filename); } else @@ -1157,7 +1157,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & ofile.serialCont(dictionnary); // write the dependencies data - uint32 depSize = dependencies.size(); + uint32 depSize = (uint32)dependencies.size(); ofile.serial(depSize); std::map >::iterator first(dependencies.begin()), last(dependencies.end()); for (; first != last; ++first) @@ -1175,7 +1175,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & ofile.seek(endBlockSize, NLMISC::IStream::begin); // write the sheet data - uint32 nbEntries = sheetNames.size(); + uint32 nbEntries = (uint32)sheetNames.size(); uint32 ver = T::getVersion (); ofile.serial (nbEntries); ofile.serial (ver); diff --git a/code/nel/include/nel/ligo/primitive.h b/code/nel/include/nel/ligo/primitive.h index e131a89e5..733834722 100644 --- a/code/nel/include/nel/ligo/primitive.h +++ b/code/nel/include/nel/ligo/primitive.h @@ -211,7 +211,7 @@ public: /** Get the children primitive count */ uint getNumChildren () const { - return _Children.size (); + return (uint)_Children.size (); } /** Get a child primitive */ diff --git a/code/nel/include/nel/misc/algo.h b/code/nel/include/nel/misc/algo.h index 66321b5c7..a718e3e53 100644 --- a/code/nel/include/nel/misc/algo.h +++ b/code/nel/include/nel/misc/algo.h @@ -127,7 +127,7 @@ uint searchLowerBound(const T *array, uint arraySize, const T &key) template uint searchLowerBound(const std::vector &array, const T &key) { - uint size= array.size(); + uint size= (uint)array.size(); if(size==0) return 0; else diff --git a/code/nel/include/nel/misc/block_memory.h b/code/nel/include/nel/misc/block_memory.h index ec817794f..606ff6c32 100644 --- a/code/nel/include/nel/misc/block_memory.h +++ b/code/nel/include/nel/misc/block_memory.h @@ -71,7 +71,7 @@ public: { _BlockSize= other._BlockSize; // if other block is rebinded, don't copy its rebinded size. - _EltSize= std::max(sizeof(T), sizeof(void*)); + _EltSize= (uint)std::max(sizeof(T), sizeof(void*)); // No elts allocated _NextFreeElt= NULL; _NAllocatedElts= 0; diff --git a/code/nel/include/nel/misc/buf_fifo.h b/code/nel/include/nel/misc/buf_fifo.h index 7f5b2b1e7..697d5411f 100644 --- a/code/nel/include/nel/misc/buf_fifo.h +++ b/code/nel/include/nel/misc/buf_fifo.h @@ -68,7 +68,7 @@ public: ~CBufFIFO (); /// Push 'buffer' in the head of the FIFO - void push (const std::vector &buffer) { push (&buffer[0], buffer.size()); } + void push (const std::vector &buffer) { push (&buffer[0], (uint32)buffer.size()); } void push (const NLMISC::CMemStream &buffer) { push (buffer.buffer(), buffer.length()); } diff --git a/code/nel/include/nel/misc/common.h b/code/nel/include/nel/misc/common.h index f72a4dd3b..4f5bacb75 100644 --- a/code/nel/include/nel/misc/common.h +++ b/code/nel/include/nel/misc/common.h @@ -298,7 +298,7 @@ void nlSleep( uint32 ms ); #endif /// Returns Thread Id (note: on Linux, Process Id is the same as the Thread Id) -uint getThreadId(); +size_t getThreadId(); /// Returns a readable string from a vector of bytes. unprintable char are replaced by '?' std::string stringFromVector( const std::vector& v, bool limited = true ); diff --git a/code/nel/include/nel/misc/debug.h b/code/nel/include/nel/misc/debug.h index 6343e5523..8a7626fbd 100644 --- a/code/nel/include/nel/misc/debug.h +++ b/code/nel/include/nel/misc/debug.h @@ -374,19 +374,19 @@ extern bool _assertex_stop_1(bool &ignoreNextTime); // Linux set of asserts is reduced due to that there is no message box displayer #define nlassert(exp) \ -{ \ +do { \ if (!(exp)) { \ NLMISC::createDebug (); \ NLMISC::INelContext::getInstance().getAssertLog()->setPosition (__LINE__, __FILE__, __FUNCTION__); \ NLMISC::INelContext::getInstance().getAssertLog()->displayNL ("\"%s\" ", #exp); \ NLMISC_BREAKPOINT; \ } \ -} +} while(0) #define nlassertonce(exp) nlassert(exp) #define nlassertex(exp, str) \ -{ \ +do { \ if (!(exp)) { \ NLMISC::createDebug (); \ NLMISC::INelContext::getInstance().getAssertLog()->setPosition (__LINE__, __FILE__, __FUNCTION__); \ @@ -394,7 +394,7 @@ extern bool _assertex_stop_1(bool &ignoreNextTime); NLMISC::INelContext::getInstance().getAssertLog()->displayRawNL str; \ NLMISC_BREAKPOINT; \ } \ -} +} while(0) #define nlverify(exp) nlassert(exp) #define nlverifyonce(exp) nlassert(exp) @@ -403,7 +403,7 @@ extern bool _assertex_stop_1(bool &ignoreNextTime); # else // NL_OS_UNIX #define nlassert(exp) \ -{ \ +do { \ static bool ignoreNextTime = false; \ bool _expResult_ = (exp) ? true : false; \ if (!ignoreNextTime && !_expResult_) { \ @@ -411,20 +411,20 @@ extern bool _assertex_stop_1(bool &ignoreNextTime); NLMISC_BREAKPOINT; \ } \ ASSERT_THROW_EXCEPTION_CODE_EX(_expResult_, #exp) \ -} +} while(0) #define nlassertonce(exp) \ -{ \ +do { \ static bool ignoreNextTime = false; \ if (!ignoreNextTime && !(exp)) { \ ignoreNextTime = true; \ if(NLMISC::_assert_stop(ignoreNextTime, __LINE__, __FILE__, __FUNCTION__, #exp)) \ NLMISC_BREAKPOINT; \ } \ -} +} while(0) #define nlassertex(exp, str) \ -{ \ +do { \ static bool ignoreNextTime = false; \ bool _expResult_ = (exp) ? true : false; \ if (!ignoreNextTime && !_expResult_) { \ @@ -434,10 +434,10 @@ extern bool _assertex_stop_1(bool &ignoreNextTime); NLMISC_BREAKPOINT; \ } \ ASSERT_THROW_EXCEPTION_CODE_EX(_expResult_, #exp) \ -} +} while(0) #define nlverify(exp) \ -{ \ +do { \ static bool ignoreNextTime = false; \ bool _expResult_ = (exp) ? true : false; \ if (!_expResult_ && !ignoreNextTime) { \ @@ -445,10 +445,10 @@ extern bool _assertex_stop_1(bool &ignoreNextTime); NLMISC_BREAKPOINT; \ } \ ASSERT_THROW_EXCEPTION_CODE_EX(_expResult_, #exp) \ -} +} while(0) #define nlverifyonce(exp) \ -{ \ +do { \ static bool ignoreNextTime = false; \ bool _expResult_ = (exp) ? true : false; \ if (!_expResult_ && !ignoreNextTime) { \ @@ -456,10 +456,10 @@ extern bool _assertex_stop_1(bool &ignoreNextTime); if(NLMISC::_assert_stop(ignoreNextTime, __LINE__, __FILE__, __FUNCTION__, #exp)) \ NLMISC_BREAKPOINT; \ } \ -} +} while(0) #define nlverifyex(exp, str) \ -{ \ +do { \ static bool ignoreNextTime = false; \ bool _expResult_ = (exp) ? true : false; \ if (!_expResult_ && !ignoreNextTime) { \ @@ -469,7 +469,7 @@ extern bool _assertex_stop_1(bool &ignoreNextTime); NLMISC_BREAKPOINT; \ } \ ASSERT_THROW_EXCEPTION_CODE_EX(_expResult_, #exp) \ -} +} while(0) # endif // NL_OS_UNIX @@ -478,28 +478,28 @@ extern bool _assertex_stop_1(bool &ignoreNextTime); #define nlunreferenced(identifier) (identifier) #define nlstop \ -{ \ +do { \ static bool ignoreNextTime = false; \ if (!ignoreNextTime) { \ if(NLMISC::_assert_stop(ignoreNextTime, __LINE__, __FILE__, __FUNCTION__, NULL)) \ NLMISC_BREAKPOINT; \ } \ ASSERT_THROW_EXCEPTION_CODE(false) \ -} +} while(0) #define nlstoponce \ -{ \ +do { \ static bool ignoreNextTime = false; \ if (!ignoreNextTime) { \ ignoreNextTime = true; \ if(NLMISC::_assert_stop(ignoreNextTime, __LINE__, __FILE__, __FUNCTION__, NULL)) \ NLMISC_BREAKPOINT; \ } \ -} +} while(0) #define nlstopex(str) \ -{ \ +do { \ static bool ignoreNextTime = false; \ if (!ignoreNextTime) { \ NLMISC::_assertex_stop_0(ignoreNextTime, __LINE__, __FILE__, __FUNCTION__, NULL); \ @@ -507,7 +507,7 @@ extern bool _assertex_stop_1(bool &ignoreNextTime); if(NLMISC::_assertex_stop_1(ignoreNextTime)) \ NLMISC_BREAKPOINT; \ } \ -} +} while(0) struct EFatalError : public Exception diff --git a/code/nel/include/nel/misc/diff_tool.h b/code/nel/include/nel/misc/diff_tool.h index 42fb5c859..b8a8db327 100644 --- a/code/nel/include/nel/misc/diff_tool.h +++ b/code/nel/include/nel/misc/diff_tool.h @@ -145,7 +145,7 @@ namespace STRING_MANAGER uint size() const { - return Data.size(); + return (uint)Data.size(); } void insertColumn(uint colIndex) @@ -230,7 +230,7 @@ namespace STRING_MANAGER // Return the first column for which the title does not begin with '*' if ( columnTitle[0] != '*' ) { - colIndex = (it - Data[0].begin()); + colIndex = (uint)(it - Data[0].begin()); return true; } } @@ -246,7 +246,7 @@ namespace STRING_MANAGER if (it == Data[0].end()) return false; - colIndex = it - Data[0].begin(); + colIndex = (uint)(it - Data[0].begin()); return true; } @@ -261,7 +261,7 @@ namespace STRING_MANAGER // resize the rows void resize(uint numRows) { - uint oldSize= Data.size(); + uint oldSize= (uint)Data.size(); Data.resize(numRows); // alloc good Column count for new lines for(uint i= oldSize;ioperator[](colIndex) == colValue) { - rowIndex = first - Data.begin(); + rowIndex = (uint)(first - Data.begin()); return true; } @@ -497,7 +497,7 @@ namespace STRING_MANAGER else { // nlassert(it != context.Reference.begin()+refCount); - uint index = find_if(context.Reference.begin(), context.Reference.end(), TestItem(getIdentifier(context.Addition, addCount))) - context.Reference.begin(); + uint index = (uint)(find_if(context.Reference.begin(), context.Reference.end(), TestItem(getIdentifier(context.Addition, addCount))) - context.Reference.begin()); // callback->onSwap(it - context.Reference.begin(), refCount, context); callback->onSwap(index, refCount, context); diff --git a/code/nel/include/nel/misc/event_emitter_multi.h b/code/nel/include/nel/misc/event_emitter_multi.h index 23ad2b8d4..b2350fc7f 100644 --- a/code/nel/include/nel/misc/event_emitter_multi.h +++ b/code/nel/include/nel/misc/event_emitter_multi.h @@ -41,7 +41,7 @@ public: /// test whether e is in the emitter list bool isEmitter(IEventEmitter *e) const; // Get the number of registered emitters - uint getNumEmitters() const { return _Emitters.size(); } + uint getNumEmitters() const { return (uint)_Emitters.size(); } // Get an emitter IEventEmitter *getEmitter(uint index); const IEventEmitter *getEmitter(uint index) const; diff --git a/code/nel/include/nel/misc/historic.h b/code/nel/include/nel/misc/historic.h index a35e703cb..5cf215fb5 100644 --- a/code/nel/include/nel/misc/historic.h +++ b/code/nel/include/nel/misc/historic.h @@ -46,7 +46,7 @@ public: // Set number of entries in the historic. Oldest entries are removed inline void setMaxSize(uint maxSize); // Get current size of historic - uint getSize() const { return _Historic.size(); } + uint getSize() const { return (uint)_Historic.size(); } // Access to an element in history, 0 being the oldest, size - 1 being the lastest added element const T &operator[](uint index) const { return _Historic[index]; /* let STL do out of range check */ } // Clear historic diff --git a/code/nel/include/nel/misc/input_device_server.h b/code/nel/include/nel/misc/input_device_server.h index e8688180b..ced6c07a8 100644 --- a/code/nel/include/nel/misc/input_device_server.h +++ b/code/nel/include/nel/misc/input_device_server.h @@ -43,7 +43,7 @@ public: /// remove a device from this server (but does not delete it). void removeDevice(IInputDevice *device); // returns the number of registered devices - uint getNumDevices() const { return _Devices.size(); } + uint getNumDevices() const { return (uint)_Devices.size(); } // return a device IInputDevice *getDevice(uint index) { return _Devices[index]; } /// Test whether the given device is handled by this server. diff --git a/code/nel/include/nel/misc/log.h b/code/nel/include/nel/misc/log.h index 49f42d1aa..8f07700f4 100644 --- a/code/nel/include/nel/misc/log.h +++ b/code/nel/include/nel/misc/log.h @@ -53,7 +53,7 @@ public: time_t Date; TLogType LogType; std::string ProcessName; - uint ThreadId; + size_t ThreadId; const char *FileName; sint Line; const char *FuncName; diff --git a/code/nel/include/nel/misc/mem_stream.h b/code/nel/include/nel/misc/mem_stream.h index e55a7afda..2102129dd 100644 --- a/code/nel/include/nel/misc/mem_stream.h +++ b/code/nel/include/nel/misc/mem_stream.h @@ -570,7 +570,7 @@ protected: #define writenumber(src,format,digits) \ char number_as_cstring [digits+1]; \ sprintf( number_as_cstring, format, src ); \ - serialSeparatedBufferOut( (uint8*)number_as_cstring, strlen(number_as_cstring) ); + serialSeparatedBufferOut( (uint8*)number_as_cstring, (uint)strlen(number_as_cstring) ); /* * atoihex diff --git a/code/nel/include/nel/misc/polygon.h b/code/nel/include/nel/misc/polygon.h index b92c276a2..212782cfa 100644 --- a/code/nel/include/nel/misc/polygon.h +++ b/code/nel/include/nel/misc/polygon.h @@ -52,7 +52,7 @@ public: /// Constructor. Init with a triangle. CPolygon(const CVector &a, const CVector &b, const CVector &c); - sint getNumVertices() const {return Vertices.size();} + sint getNumVertices() const {return (sint)Vertices.size();} // build a triangle fan from this polygon, appending resulting tris to 'dest' void toTriFan(std::vector &dest) const; diff --git a/code/nel/include/nel/misc/stream.h b/code/nel/include/nel/misc/stream.h index e3d4a538d..a0fdc63d9 100644 --- a/code/nel/include/nel/misc/stream.h +++ b/code/nel/include/nel/misc/stream.h @@ -1057,7 +1057,7 @@ private: } else { - len= cont.size(); + len= (sint32)cont.size(); serial(len); } @@ -1116,7 +1116,7 @@ protected: } else { - len= cont.size(); + len = (sint32)cont.size(); serial(len); // Close the node header @@ -1238,7 +1238,7 @@ private: } else { - len= cont.size(); + len= (sint32)cont.size(); serial(len); } @@ -1393,7 +1393,7 @@ private: } else { - len= cont.size(); + len= (sint32)cont.size(); serial(len); } @@ -1587,7 +1587,7 @@ private: } else { - len= cont.size(); + len= (sint32)cont.size(); serial(len); __iterator it= cont.begin(); diff --git a/code/nel/include/nel/misc/string_conversion.h b/code/nel/include/nel/misc/string_conversion.h index 5214c1f66..5d5540358 100644 --- a/code/nel/include/nel/misc/string_conversion.h +++ b/code/nel/include/nel/misc/string_conversion.h @@ -97,7 +97,7 @@ public: const std::string &toString(const TDestType &value) const; // nb of pairs in the map - inline uint16 getNbPairs() const { return _String2DestType.size(); } + inline uint16 getNbPairs() const { return (uint16)_String2DestType.size(); } // Check a value against the list a value, return true if the value exist in the container bool isValid(const DestType &value) const; diff --git a/code/nel/include/nel/misc/string_id_array.h b/code/nel/include/nel/misc/string_id_array.h index 3e344d381..1a0ec1eb3 100644 --- a/code/nel/include/nel/misc/string_id_array.h +++ b/code/nel/include/nel/misc/string_id_array.h @@ -71,7 +71,7 @@ public: nlassert (!str.empty()); // add at the end - addString (str, _StringArray.size ()); + addString (str, (TStringId)_StringArray.size ()); } /** Returns the id associated to string str. If the id is not found, the string will be added in @@ -138,7 +138,7 @@ public: /// Returns the size of the _StringArray TStringId size () const { - return _StringArray.size (); + return (TStringId)_StringArray.size (); } /// Returns all string in the _NeedToAskStringArray diff --git a/code/nel/include/nel/misc/value_smoother.h b/code/nel/include/nel/misc/value_smoother.h index 351ec195a..aea9e5ad3 100644 --- a/code/nel/include/nel/misc/value_smoother.h +++ b/code/nel/include/nel/misc/value_smoother.h @@ -87,7 +87,7 @@ public: _CurFrame++; // _CurFrame%=_LastFrames.size(); if (_CurFrame >= _LastFrames.size()) - _CurFrame -= _LastFrames.size(); + _CurFrame -= (uint)_LastFrames.size(); // update the number of frames added. _NumFrame++; diff --git a/code/nel/include/nel/net/buf_server.h b/code/nel/include/nel/net/buf_server.h index 8d74babb6..613754a9d 100644 --- a/code/nel/include/nel/net/buf_server.h +++ b/code/nel/include/nel/net/buf_server.h @@ -420,7 +420,7 @@ public: uint nb; { NLMISC::CSynchronized::CAccessor connectionssync( &_Connections ); - nb = connectionssync.value().size(); + nb = (uint)connectionssync.value().size(); } return nb; } diff --git a/code/nel/include/nel/sound/audio_mixer_user.h b/code/nel/include/nel/sound/audio_mixer_user.h index e36b3c872..be5dfb356 100644 --- a/code/nel/include/nel/sound/audio_mixer_user.h +++ b/code/nel/include/nel/sound/audio_mixer_user.h @@ -237,9 +237,9 @@ public: /// Return the names of the sounds (call this method after loadSounds()) virtual void getSoundNames( std::vector &names ) const; /// Return the number of mixing tracks (voices) - virtual uint getPolyphony() const { return _Tracks.size(); } + virtual uint getPolyphony() const { return (uint)_Tracks.size(); } /// Return the number of sources instance. - virtual uint getSourcesInstanceCount() const { return _Sources.size(); } + virtual uint getSourcesInstanceCount() const { return (uint)_Sources.size(); } /// Return the number of playing sources (slow) virtual uint getPlayingSourcesCount() const; /// Return the number of available tracks diff --git a/code/nel/include/nel/sound/sound_animation.h b/code/nel/include/nel/sound/sound_animation.h index 276eb50d0..162f87c5d 100644 --- a/code/nel/include/nel/sound/sound_animation.h +++ b/code/nel/include/nel/sound/sound_animation.h @@ -54,7 +54,7 @@ public: /** Return the number of markers in this track */ - virtual uint32 countMarkers() { return _Markers.size(); } + virtual uint32 countMarkers() { return (uint32)_Markers.size(); } /** Return a marker of this track given its index */ virtual CSoundAnimMarker* getMarker(uint32 i) { return _Markers[i]; } diff --git a/code/nel/src/3d/animation.cpp b/code/nel/src/3d/animation.cpp index ac495f818..551387bb1 100644 --- a/code/nel/src/3d/animation.cpp +++ b/code/nel/src/3d/animation.cpp @@ -189,7 +189,7 @@ TAnimationTime CAnimation::getBeginTime () const if (_BeginTimeTouched) { // Track count - uint trackCount=_TrackVector.size(); + uint trackCount=(uint)_TrackVector.size(); // Track count empty ? if (trackCount==0) @@ -220,7 +220,7 @@ TAnimationTime CAnimation::getEndTime () const if (_EndTimeTouched) { // Track count - uint trackCount=_TrackVector.size(); + uint trackCount=(uint)_TrackVector.size(); // Track count empty ? if (trackCount==0) @@ -254,7 +254,7 @@ bool CAnimation::allTrackLoop() const if(_AnimLoopTouched) { // Track count - uint trackCount=_TrackVector.size(); + uint trackCount=(uint)_TrackVector.size(); // Default is true _AnimLoop= true; @@ -393,7 +393,7 @@ void CAnimation::applyTrackQuatHeaderCompression() _TrackSamplePack= new CTrackSamplePack; // just copy the built track headers - _TrackSamplePack->TrackHeaders.resize(sampleCounter.TrackHeaders.size()); + _TrackSamplePack->TrackHeaders.resize((uint32)sampleCounter.TrackHeaders.size()); for(i=0;i<_TrackSamplePack->TrackHeaders.size();i++) { _TrackSamplePack->TrackHeaders[i]= sampleCounter.TrackHeaders[i]; diff --git a/code/nel/src/3d/animation_optimizer.cpp b/code/nel/src/3d/animation_optimizer.cpp index 46dafe868..f69b1af62 100644 --- a/code/nel/src/3d/animation_optimizer.cpp +++ b/code/nel/src/3d/animation_optimizer.cpp @@ -319,7 +319,7 @@ void CAnimationOptimizer::sampleQuatTrack(const ITrack *trackIn, float beginTim // *************************************************************************** bool CAnimationOptimizer::testConstantQuatTrack() { - uint numSamples= _QuatKeyList.size(); + uint numSamples= (uint)_QuatKeyList.size(); nlassert(numSamples>0); // Get the first sample as the reference quaternion, and test others from this one. @@ -339,7 +339,7 @@ bool CAnimationOptimizer::testConstantQuatTrack() // *************************************************************************** void CAnimationOptimizer::optimizeQuatTrack() { - uint numSamples= _QuatKeyList.size(); + uint numSamples= (uint)_QuatKeyList.size(); nlassert(numSamples>0); // <=2 key? => no opt possible.. @@ -477,7 +477,7 @@ void CAnimationOptimizer::sampleVectorTrack(const ITrack *trackIn, float beginT // *************************************************************************** bool CAnimationOptimizer::testConstantVectorTrack() { - uint numSamples= _VectorKeyList.size(); + uint numSamples= (uint)_VectorKeyList.size(); nlassert(numSamples>0); // Get the first sample as the reference Vectorer, and test others from this one. @@ -497,7 +497,7 @@ bool CAnimationOptimizer::testConstantVectorTrack() // *************************************************************************** void CAnimationOptimizer::optimizeVectorTrack() { - uint numSamples= _VectorKeyList.size(); + uint numSamples= (uint)_VectorKeyList.size(); nlassert(numSamples>0); // <=2 key? => no opt possible.. diff --git a/code/nel/src/3d/animation_set.cpp b/code/nel/src/3d/animation_set.cpp index cebe14893..1b0c54760 100644 --- a/code/nel/src/3d/animation_set.cpp +++ b/code/nel/src/3d/animation_set.cpp @@ -54,7 +54,7 @@ CAnimationSet::~CAnimationSet () // *************************************************************************** uint CAnimationSet::getNumChannelId () const { - return _ChannelIdByName.size (); + return (uint)_ChannelIdByName.size (); } // *************************************************************************** @@ -76,10 +76,10 @@ uint CAnimationSet::addAnimation (const char* name, CAnimation* animation) _AnimationName.push_back (name); // Add an entry name / animation - _AnimationIdByName.insert (std::map ::value_type (name, _Animation.size()-1)); + _AnimationIdByName.insert (std::map ::value_type (name, (uint32)_Animation.size()-1)); // Return animation id - return _Animation.size()-1; + return (uint)_Animation.size()-1; } // *************************************************************************** @@ -90,10 +90,10 @@ uint CAnimationSet::addSkeletonWeight (const char* name, CSkeletonWeight* skelet _SkeletonWeightName.push_back (name); // Add an entry name / animation - _SkeletonWeightIdByName.insert (std::map ::value_type (name, _SkeletonWeight.size()-1)); + _SkeletonWeightIdByName.insert (std::map ::value_type (name, (uint32)_SkeletonWeight.size()-1)); // Return animation id - return _SkeletonWeight.size()-1; + return (uint)_SkeletonWeight.size()-1; } // *************************************************************************** diff --git a/code/nel/src/3d/async_texture_manager.cpp b/code/nel/src/3d/async_texture_manager.cpp index 1360c3bea..a08375371 100644 --- a/code/nel/src/3d/async_texture_manager.cpp +++ b/code/nel/src/3d/async_texture_manager.cpp @@ -157,7 +157,7 @@ uint CAsyncTextureManager::addTextureRef(const string &textNameNotLwr, CMeshBa if(it==_TextureEntryMap.end()) { // search a free id. - uint i= _TextureEntries.size(); + uint i= (uint)_TextureEntries.size(); if(!_FreeTextureIds.empty()) { i= _FreeTextureIds.back(); @@ -301,7 +301,7 @@ void CAsyncTextureManager::releaseTexture(uint id, CMeshBaseInstance *instance // find an instance in this texture an remove it. CTextureEntry *text= _TextureEntries[id]; - uint instSize= text->Instances.size(); + uint instSize= (uint)text->Instances.size(); for(uint i=0;iInstances[i]== instance) @@ -701,7 +701,7 @@ void CAsyncTextureManager::updateTextureLodSystem(IDriver *pDriver) uint pivot= 0; uint currentWantedSize= currentBaseSize; uint currentLoadedSize= currentBaseSize; - for(i=lodArray.size()-1;i>=0;i--) + for(i=(sint)lodArray.size()-1;i>=0;i--) { uint lodSize= lodArray[i].Lod->ExtraSize; currentWantedSize+= lodSize; @@ -731,7 +731,7 @@ void CAsyncTextureManager::updateTextureLodSystem(IDriver *pDriver) { unload= false; // search from end of the list to pivot (included), the first LOD (ie the most important) to load. - for(i=lodArray.size()-1;i>=(sint)pivot;i--) + for(i=(sint)lodArray.size()-1;i>=(sint)pivot;i--) { if(!lodArray[i].Lod->UpLoaded) { diff --git a/code/nel/src/3d/channel_mixer.cpp b/code/nel/src/3d/channel_mixer.cpp index 7264131a5..bb04aa76e 100644 --- a/code/nel/src/3d/channel_mixer.cpp +++ b/code/nel/src/3d/channel_mixer.cpp @@ -187,7 +187,7 @@ void CChannelMixer::eval (bool detail, uint64 evalDetailDate) uint numChans; if(detail) { - numChans= _DetailListToEval.size(); + numChans= (uint)_DetailListToEval.size(); if(numChans) channelArrayPtr= &_DetailListToEval[0]; else @@ -195,7 +195,7 @@ void CChannelMixer::eval (bool detail, uint64 evalDetailDate) } else { - numChans= _GlobalListToEval.size(); + numChans= (uint)_GlobalListToEval.size(); if(numChans) channelArrayPtr= &_GlobalListToEval[0]; else diff --git a/code/nel/src/3d/coarse_mesh_build.cpp b/code/nel/src/3d/coarse_mesh_build.cpp index a7b90feed..14c2da789 100644 --- a/code/nel/src/3d/coarse_mesh_build.cpp +++ b/code/nel/src/3d/coarse_mesh_build.cpp @@ -35,7 +35,7 @@ bool CCoarseMeshBuild::build (const std::vector& coarseMeshes, return false; // 2. remap coordinates - remapCoordinates (coarseMeshes, desc, bitmaps.size ()); + remapCoordinates (coarseMeshes, desc, (uint)bitmaps.size ()); // 3. ok return true; diff --git a/code/nel/src/3d/deform_2d.cpp b/code/nel/src/3d/deform_2d.cpp index ae7352b70..dcaf2067a 100644 --- a/code/nel/src/3d/deform_2d.cpp +++ b/code/nel/src/3d/deform_2d.cpp @@ -134,7 +134,7 @@ void CDeform2d::doDeform(const TPoint2DVect &surf, IDriver *drv, IPerturbUV *uvp /** setup the whole vertex buffer * we don't share vertices here, as we work with unaligned quads */ - vb.setNumVertices(dest.size() << 2); + vb.setNumVertices((uint32)dest.size() << 2); mat.setTexture(0, _Tex); { CVertexBufferReadWrite vba; @@ -173,7 +173,7 @@ void CDeform2d::doDeform(const TPoint2DVect &surf, IDriver *drv, IPerturbUV *uvp } drv->activeVertexBuffer(vb); - drv->renderRawQuads(mat, 0, dest.size()); + drv->renderRawQuads(mat, 0, (uint32)dest.size()); } } // NL3D diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index 9c93d6b80..901c5e3f3 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -3187,7 +3187,7 @@ IOcclusionQuery::TOcclusionType COcclusionQueryD3D::getOcclusionType() H_AUTO_D3D(COcclusionQueryD3D_getOcclusionType); nlassert(Driver); nlassert(Query); - nlassert(Driver->_CurrentOcclusionQuery != this) // can't query result between a begin/end pair! + nlassert(Driver->_CurrentOcclusionQuery != this); // can't query result between a begin/end pair! if (OcclusionType == NotAvailable) { DWORD numPix; @@ -3207,7 +3207,7 @@ uint COcclusionQueryD3D::getVisibleCount() H_AUTO_D3D(COcclusionQueryD3D_getVisibleCount); nlassert(Driver); nlassert(Query); - nlassert(Driver->_CurrentOcclusionQuery != this) // can't query result between a begin/end pair! + nlassert(Driver->_CurrentOcclusionQuery != this); // can't query result between a begin/end pair! if (getOcclusionType() == NotAvailable) return 0; return VisibleCount; } diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp index 33af72d22..8a9e864cc 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp @@ -1401,7 +1401,7 @@ bool CDriverD3D::needsConstants (uint &numConstant, uint &firstConstant, uint &s alphaPipe[0].clear(); } add(rgbPipe[0], alphaPipe[0]); - numConstant = rgbPipe[0].size(); + numConstant = (uint)rgbPipe[0].size(); if (numConstant) { firstConstant = *(rgbPipe[0].begin()); @@ -1919,7 +1919,7 @@ IDirect3DPixelShader9 *CDriverD3D::buildPixelShader (const CNormalShaderDesc &no // Assemble and create the shader LPD3DXBUFFER pShader; LPD3DXBUFFER pErrorMsgs; - if (D3DXAssembleShader (shaderText.c_str(), shaderText.size(), NULL, NULL, 0, &pShader, &pErrorMsgs) == D3D_OK) + if (D3DXAssembleShader (shaderText.c_str(), (UINT)shaderText.size(), NULL, NULL, 0, &pShader, &pErrorMsgs) == D3D_OK) { IDirect3DPixelShader9 *shader; if (_DeviceInterface->CreatePixelShader((DWORD*)pShader->GetBufferPointer(), &shader) == D3D_OK) diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp index 67cd20b0c..4bb65d436 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp @@ -167,7 +167,7 @@ HRESULT CDriverD3D::SetTexture (DWORD Stage, LPDIRECT3DBASETEXTURE9 pTexture) H_AUTO_D3D(CDriverD3D_SetTexture ) // Look for the current texture uint i; - const uint count = _CurrentShaderTextures.size(); + const uint count = (uint)_CurrentShaderTextures.size(); for (i=0; igetText(), strlen(shd->getText())+1, NULL, NULL, 0, NULL, &(shaderInfo->Effect), &pErrorMsgs) + if (D3DXCreateEffect(_DeviceInterface, shd->getText(), (UINT)strlen(shd->getText())+1, NULL, NULL, 0, NULL, &(shaderInfo->Effect), &pErrorMsgs) == D3D_OK) { // Get the texture handle @@ -3713,7 +3713,7 @@ HRESULT STDMETHODCALLTYPE CFXPassRecorder::SetTexture(DWORD Stage, LPDIRECT3DBAS nlassert(Target); // Look for the current texture uint i; - const uint count = Driver->getCurrentShaderTextures().size(); + const uint count = (uint)Driver->getCurrentShaderTextures().size(); for (i=0; igetCurrentShaderTextures()[i]; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp index 2a8c081b1..f0e68cd20 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex_program.cpp @@ -334,7 +334,7 @@ bool CDriverD3D::activeVertexProgram (CVertexProgram *program) LPD3DXBUFFER pShader; LPD3DXBUFFER pErrorMsgs; - if (D3DXAssembleShader (dest.c_str(), dest.size(), NULL, NULL, 0, &pShader, &pErrorMsgs) == D3D_OK) + if (D3DXAssembleShader (dest.c_str(), (UINT)dest.size(), NULL, NULL, 0, &pShader, &pErrorMsgs) == D3D_OK) { if (_DeviceInterface->CreateVertexShader((DWORD*)pShader->GetBufferPointer(), &(getVertexProgramD3D(*program)->Shader)) != D3D_OK) return false; diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index ce504aad0..2f7e3ed24 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -4231,7 +4231,7 @@ IOcclusionQuery::TOcclusionType COcclusionQueryGL::getOcclusionType() H_AUTO_OGL(COcclusionQueryGL_getOcclusionType) nlassert(Driver); nlassert(ID); - nlassert(Driver->_CurrentOcclusionQuery != this) // can't query result between a begin/end pair! + nlassert(Driver->_CurrentOcclusionQuery != this); // can't query result between a begin/end pair! if (OcclusionType == NotAvailable) { GLuint result; @@ -4254,7 +4254,7 @@ uint COcclusionQueryGL::getVisibleCount() H_AUTO_OGL(COcclusionQueryGL_getVisibleCount) nlassert(Driver); nlassert(ID); - nlassert(Driver->_CurrentOcclusionQuery != this) // can't query result between a begin/end pair! + nlassert(Driver->_CurrentOcclusionQuery != this); // can't query result between a begin/end pair! if (getOcclusionType() == NotAvailable) return 0; return VisibleCount; } diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp index 452a7a569..2eafa4b1a 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp @@ -923,7 +923,7 @@ void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bo nglDisableVariantClientStateEXT(variants[CDriverGL::EVSPaletteSkinVariant]); break; case 7: // empty - nlstop + nlstop; break; case 8: case 9: diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp index ecac46292..cdf4eef0d 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp @@ -1413,7 +1413,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) } break; case CVertexBuffer::Empty: // empty - nlstop + nlstop; break; case CVertexBuffer::TexCoord0: case CVertexBuffer::TexCoord1: @@ -1483,7 +1483,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) } break; case CVertexBuffer::Empty: // empty - nlstop + nlstop; break; case CVertexBuffer::TexCoord0: case CVertexBuffer::TexCoord1: diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp index f2282d4af..cf6855ab2 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp @@ -120,7 +120,7 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) program->_DrvInfo=drvInfo; // Compile the program - nglLoadProgramNV (GL_VERTEX_PROGRAM_NV, drvInfo->ID, program->getProgram().length(), (const GLubyte*)program->getProgram().c_str()); + nglLoadProgramNV (GL_VERTEX_PROGRAM_NV, drvInfo->ID, (GLsizei)program->getProgram().length(), (const GLubyte*)program->getProgram().c_str()); // Get loading error code GLint errorOff; @@ -130,7 +130,7 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) if (errorOff>=0) { // String length - uint length = program->getProgram ().length(); + uint length = (uint)program->getProgram ().length(); const char* sString= program->getProgram ().c_str(); // Line count and char count @@ -1392,7 +1392,7 @@ bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgra // nglBindProgramARB( GL_VERTEX_PROGRAM_ARB, id); glGetError(); - nglProgramStringARB( GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, code.size(), code.c_str() ); + nglProgramStringARB( GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, (GLsizei)code.size(), code.c_str() ); GLenum err = glGetError(); if (err != GL_NO_ERROR) { @@ -1400,7 +1400,7 @@ bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgra { GLint position; glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &position); - nlassert(position != -1) // there was an error.. + nlassert(position != -1); // there was an error.. nlassert(position < (GLint) code.size()); uint line = 0; const char *lineStart = code.c_str(); diff --git a/code/nel/src/3d/driver_user.cpp b/code/nel/src/3d/driver_user.cpp index 69d75d1aa..fce33c526 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -861,7 +861,7 @@ void CDriverUser::drawQuads(const std::vector &q, UMater H_AUTO2; const CQuadColorUV *qptr = &(q[0]); - drawQuads(qptr , q.size(), mat); + drawQuads(qptr , (uint32)q.size(), mat); } // *************************************************************************** @@ -870,7 +870,7 @@ void CDriverUser::drawQuads(const std::vector &q, UMate H_AUTO2; const CQuadColorUV2 *qptr = &(q[0]); - drawQuads(qptr , q.size(), mat); + drawQuads(qptr , (uint32)q.size(), mat); } // *************************************************************************** diff --git a/code/nel/src/3d/dru.cpp b/code/nel/src/3d/dru.cpp index 3ddff9128..5e18f760b 100644 --- a/code/nel/src/3d/dru.cpp +++ b/code/nel/src/3d/dru.cpp @@ -490,7 +490,7 @@ void CDRU::drawTrianglesUnlit(const std::vector &trilist, if(trilist.size()==0) return; - CDRU::drawTrianglesUnlit( &(*trilist.begin()), trilist.size(), mat, driver); + CDRU::drawTrianglesUnlit( &(*trilist.begin()), (uint)trilist.size(), mat, driver); } @@ -529,7 +529,7 @@ void CDRU::drawLinesUnlit(const std::vector &linelist, CMateria { if(linelist.size()==0) return; - CDRU::drawLinesUnlit( &(*linelist.begin()), linelist.size(), mat, driver); + CDRU::drawLinesUnlit( &(*linelist.begin()), (sint)linelist.size(), mat, driver); } // *************************************************************************** void CDRU::drawLine(const CVector &a, const CVector &b, CRGBA color, IDriver& driver) diff --git a/code/nel/src/3d/fast_ptr_list.cpp b/code/nel/src/3d/fast_ptr_list.cpp index 40e5095b5..b4df6c152 100644 --- a/code/nel/src/3d/fast_ptr_list.cpp +++ b/code/nel/src/3d/fast_ptr_list.cpp @@ -71,7 +71,7 @@ void CFastPtrListBase::insert(void *element, CFastPtrListNode *node) _Elements.push_back(element); _Nodes.push_back(node); node->_Owner= this; - node->_IndexInOwner= _Nodes.size()-1; + node->_IndexInOwner= (uint32)_Nodes.size()-1; } // *************************************************************************** @@ -83,7 +83,7 @@ void CFastPtrListBase::erase(CFastPtrListNode *node) // Take the indexes, uint nodeIndex= node->_IndexInOwner; - uint lastIndex= _Nodes.size()-1; + uint lastIndex= (uint)_Nodes.size()-1; // swap the last element and the erased one. swap(_Elements[nodeIndex], _Elements[lastIndex]); diff --git a/code/nel/src/3d/font_manager.cpp b/code/nel/src/3d/font_manager.cpp index 882992a04..92de5f44d 100644 --- a/code/nel/src/3d/font_manager.cpp +++ b/code/nel/src/3d/font_manager.cpp @@ -100,7 +100,7 @@ void CFontManager::computeString (const ucstring &s, } // Setting vertices format - output.Vertices.setNumVertices (4 * s.size()); + output.Vertices.setNumVertices (4 * (uint32)s.size()); // 1 character <-> 1 quad sint32 penx = 0, dx; diff --git a/code/nel/src/3d/hls_texture_bank.cpp b/code/nel/src/3d/hls_texture_bank.cpp index f14c05510..fe8eee1a5 100644 --- a/code/nel/src/3d/hls_texture_bank.cpp +++ b/code/nel/src/3d/hls_texture_bank.cpp @@ -47,7 +47,7 @@ void CHLSTextureBank::reset() uint32 CHLSTextureBank::addColorTexture(const CHLSColorTexture &tex) { _ColorTextures.push_back(tex); - return _ColorTextures.size()-1; + return (uint32)_ColorTextures.size()-1; } // *************************************************************************** void CHLSTextureBank::addTextureInstance(const std::string &name, uint32 colorTextureId, const vector &cols) @@ -62,14 +62,14 @@ void CHLSTextureBank::addTextureInstance(const std::string &name, uint32 color // new instance CTextureInstance textInst; textInst._ColorTextureId= colorTextureId; - textInst._DataIndex= _TextureInstanceData.size(); + textInst._DataIndex= (uint32)_TextureInstanceData.size(); // leave ptrs undefined textInst._DataPtr= NULL; textInst._ColorTexturePtr= NULL; // allocate/fill data - uint32 nameSize= (nameLwr.size()+1); - uint32 colSize= cols.size()*sizeof(CHLSColorDelta); + uint32 nameSize= (uint32)(nameLwr.size()+1); + uint32 colSize= (uint32)cols.size()*sizeof(CHLSColorDelta); _TextureInstanceData.resize(_TextureInstanceData.size() + nameSize + colSize); // copy name memcpy(&_TextureInstanceData[textInst._DataIndex], nameLwr.c_str(), nameSize); @@ -176,7 +176,7 @@ bool CHLSTextureBank::CTextureInstance::sameName(const char *str) void CHLSTextureBank::CTextureInstance::buildColorVersion(NLMISC::CBitmap &out) { // get ptr to color deltas. - uint nameSize= strlen((const char*)_DataPtr)+1; + uint nameSize= (uint)strlen((const char*)_DataPtr)+1; CHLSColorDelta *colDeltas= (CHLSColorDelta*)(_DataPtr + nameSize); // build the texture. diff --git a/code/nel/src/3d/ig_surface_light_build.cpp b/code/nel/src/3d/ig_surface_light_build.cpp index 3f8cf5575..1cc388aa1 100644 --- a/code/nel/src/3d/ig_surface_light_build.cpp +++ b/code/nel/src/3d/ig_surface_light_build.cpp @@ -51,7 +51,7 @@ void CIGSurfaceLightBuild::buildSunDebugMesh(CMesh::CMeshBuild &meshBuild, // Resize vector. uint wVert= surface.Width; uint hVert= surface.Height; - uint vId0= meshBuild.Vertices.size(); + uint vId0= (uint)meshBuild.Vertices.size(); // Allocate vertices / colors meshBuild.Vertices.resize(vId0 + wVert*hVert); vector colors; @@ -98,7 +98,7 @@ void CIGSurfaceLightBuild::buildPLDebugMesh(CMesh::CMeshBuild &meshBuild, CMes meshBuild.VertexFlags= CVertexBuffer::PositionFlag | CVertexBuffer::PrimaryColorFlag; // Get the number of lights in Ig. - uint numLight= igOut.getPointLightList().size(); + uint numLight= (uint)igOut.getPointLightList().size(); numLight= raiseToNextPowerOf2(numLight); uint idMultiplier= 256/ numLight; @@ -132,7 +132,7 @@ void CIGSurfaceLightBuild::buildPLDebugMesh(CMesh::CMeshBuild &meshBuild, CMes // Resize vector. uint wVert= surface.Width; uint hVert= surface.Height; - uint vId0= meshBuild.Vertices.size(); + uint vId0= (uint)meshBuild.Vertices.size(); // Allocate vertices / colors meshBuild.Vertices.resize(vId0 + wVert*hVert); vector colors; diff --git a/code/nel/src/3d/instance_lighter.cpp b/code/nel/src/3d/instance_lighter.cpp index af3f406d5..47c5dddf1 100644 --- a/code/nel/src/3d/instance_lighter.cpp +++ b/code/nel/src/3d/instance_lighter.cpp @@ -83,7 +83,7 @@ void CInstanceLighter::addTriangles (CLandscape &landscape, std::vector &l landscape.getTessellationLeaves(leaves); // Number of leaves - uint leavesCount=leaves.size(); + uint leavesCount=(uint)leaves.size(); // Reserve the array triangleArray.reserve (triangleArray.size()+leavesCount); @@ -332,7 +332,7 @@ void CInstanceLighter::light (const CInstanceGroup &igIn, CInstanceGroup &igOut, // For all retrievers Infos in _IGSurfaceLightBuild while(itSrc!=_IGSurfaceLightBuild->RetrieverGridMap.end()) { - uint numSurfaces= itSrc->second.Grids.size(); + uint numSurfaces= (uint)itSrc->second.Grids.size(); // If !empty retriever. if(numSurfaces>0) { @@ -355,7 +355,7 @@ void CInstanceLighter::light (const CInstanceGroup &igIn, CInstanceGroup &igOut, surfDst.Origin= surfSrc.Origin; surfDst.Width= surfSrc.Width; surfDst.Height= surfSrc.Height; - surfDst.Cells.resize(surfSrc.Cells.size()); + surfDst.Cells.resize((uint32)surfSrc.Cells.size()); surfDst.Cells.fill(defaultCellCorner); // The grid must be valid an not empty nlassert( surfDst.Cells.size() == surfDst.Width*surfDst.Height ); @@ -1050,7 +1050,7 @@ void CInstanceLighter::compilePointLightRT(uint gridSize, float gridCellSize, // =========== CQuadGrid obstacleGrid; obstacleGrid.create(gridSize, gridCellSize); - uint size= obstacles.size(); + uint size= (uint)obstacles.size(); for(i=0; i { // append a PointLightInfluence pointLightList.push_back(CPointLightInfluence()); - sint id= pointLightList.size()-1; + sint id= (sint)pointLightList.size()-1; // setup the PointLightInfluence corner.Lights[0]->_IdInInfluenceList= id; pointLightList[id].PointLight= corner.Lights[0]; @@ -82,7 +82,7 @@ void CLightInfluenceInterpolator::interpolate(std::vector { // append a PointLightInfluence pointLightList.push_back(CPointLightInfluence()); - sint id= pointLightList.size()-1; + sint id= (sint)pointLightList.size()-1; // setup the PointLightInfluence corner.Lights[1]->_IdInInfluenceList= id; pointLightList[id].PointLight= corner.Lights[1]; diff --git a/code/nel/src/3d/lod_character_builder.cpp b/code/nel/src/3d/lod_character_builder.cpp index 1b5bcee95..af24cbed8 100644 --- a/code/nel/src/3d/lod_character_builder.cpp +++ b/code/nel/src/3d/lod_character_builder.cpp @@ -189,7 +189,7 @@ void CLodCharacterBuilder::addAnim(const char *animName, CAnimation *animation // *************************************************************************** void CLodCharacterBuilder::applySkin(CSkeletonModel *skeleton, CVector *dstVertices) { - uint numVerts= _LodBuild->Vertices.size(); + uint numVerts= (uint)_LodBuild->Vertices.size(); // for all vertices. for(uint i=0; i &triangleIndices= lodBuild.TriangleIndices; const vector &skinWeights= lodBuild.SkinWeights; const vector &uvs= lodBuild.UVs; @@ -372,7 +372,7 @@ void CLodCharacterShape::buildMesh(const std::string &name, const CLodCharacte // Copy data. _Name= name; _NumVertices= numVertices; - _NumTriangles= triangleIndices.size()/3; + _NumTriangles= (uint32)triangleIndices.size()/3; #ifdef NL_LOD_CHARACTER_INDEX16 _TriangleIndices.resize(triangleIndices.size()); for(uint k = 0; k < triangleIndices.size(); ++k) @@ -492,7 +492,7 @@ bool CLodCharacterShape::addAnim(const CAnimBuild &animBuild) // Add the anim to the array, and add an entry to the map _Anims.push_back(dstAnim); - _AnimMap.insert(make_pair(dstAnim.Name, _Anims.size()-1)); + _AnimMap.insert(make_pair(dstAnim.Name, (uint32)_Anims.size()-1)); return true; } diff --git a/code/nel/src/3d/lod_character_shape_bank.cpp b/code/nel/src/3d/lod_character_shape_bank.cpp index 943d9e02b..d5288da77 100644 --- a/code/nel/src/3d/lod_character_shape_bank.cpp +++ b/code/nel/src/3d/lod_character_shape_bank.cpp @@ -46,7 +46,7 @@ uint32 CLodCharacterShapeBank::addShape() // Alloc a new shape _ShapeArray.resize(_ShapeArray.size()+1); - return _ShapeArray.size()-1; + return (uint32)_ShapeArray.size()-1; } // *************************************************************************** @@ -105,7 +105,7 @@ bool CLodCharacterShapeBank::compile() // *************************************************************************** uint CLodCharacterShapeBank::getNumShapes() const { - return _ShapeArray.size(); + return (uint)_ShapeArray.size(); } // *************************************************************************** diff --git a/code/nel/src/3d/material.cpp b/code/nel/src/3d/material.cpp index d4e872c8f..91924eac7 100644 --- a/code/nel/src/3d/material.cpp +++ b/code/nel/src/3d/material.cpp @@ -226,7 +226,7 @@ void CMaterial::serial(NLMISC::IStream &f) } else { - n = _LightMaps.size(); + n = (uint32)_LightMaps.size(); f.serial(n); } for (uint32 i = 0; i < n; ++i) diff --git a/code/nel/src/3d/mesh.cpp b/code/nel/src/3d/mesh.cpp index 9093103e2..e61522aaf 100644 --- a/code/nel/src/3d/mesh.cpp +++ b/code/nel/src/3d/mesh.cpp @@ -290,7 +290,7 @@ void CMeshGeom::build (CMesh::CMeshBuild &m, uint numMaxMaterial) TCornerSet corners; const CFaceTmp *pFace= &(*tmpFaces.begin()); uint32 nFaceMB = 0; - sint N= tmpFaces.size(); + sint N= (sint)tmpFaces.size(); sint currentVBIndex=0; m.VertLink.clear (); @@ -336,7 +336,7 @@ void CMeshGeom::build (CMesh::CMeshBuild &m, uint numMaxMaterial) /// 4. Then, for all faces, build the RdrPass PBlock. //=================================================== pFace= &(*tmpFaces.begin()); - N= tmpFaces.size(); + N= (sint)tmpFaces.size(); for(;N>0;N--, pFace++) { sint mbId= pFace->MatrixBlockId; @@ -1302,7 +1302,7 @@ void CMeshGeom::buildSkin(CMesh::CMeshBuild &m, std::vector &tmpFaces) } // to Which matrixblock this face is inserted. - face.MatrixBlockId= _MatrixBlocks.size()-1; + face.MatrixBlockId= (sint)_MatrixBlocks.size()-1; // remove the face from remain face list. itFace= remainingFaces.erase(itFace); @@ -1450,13 +1450,13 @@ float CMeshGeom::getNumTriangles (float distance) uint32 triCount=0; // For each matrix block - uint mbCount=_MatrixBlocks.size(); + uint mbCount=(uint)_MatrixBlocks.size(); for (uint mb=0; mbbuild (m, mbase.Materials.size()); + _MeshGeom->build (m, (uint)mbase.Materials.size()); // compile some stuff compileRunTime(); diff --git a/code/nel/src/3d/mesh_base.cpp b/code/nel/src/3d/mesh_base.cpp index c8a997a7d..8b78d46e4 100644 --- a/code/nel/src/3d/mesh_base.cpp +++ b/code/nel/src/3d/mesh_base.cpp @@ -396,7 +396,7 @@ void CMeshBase::applyMaterialUsageOptim(const std::vector &materialUsed, s } // apply the remap to LightMaps infos - const uint count = _LightInfos.size (); + const uint count = (uint)_LightInfos.size (); for (i=0; i &materialUsed, s void CMeshBase::flushTextures(IDriver &driver, uint selectedTexture) { // Mat count - uint matCount=_Materials.size(); + uint matCount=(uint)_Materials.size(); // Flush each material textures for (uint mat=0; mat_LightInfos.size(); + return (uint32)pMesh->_LightInfos.size(); } // *************************************************************************** @@ -132,7 +132,7 @@ void CMeshBaseInstance::getLightMapName( uint32 nLightMapNb, std::string &LightM // *************************************************************************** uint32 CMeshBaseInstance::getNbBlendShape() { - return _AnimatedMorphFactor.size(); + return (uint32)_AnimatedMorphFactor.size(); } // *************************************************************************** @@ -228,8 +228,8 @@ void CMeshBaseInstance::traverseAnimDetail() // Lightmap automatic animation // Animated lightmap must have the same size than shape info lightmap. - const uint count0 = _AnimatedLightmap.size(); - const uint count1 = mb->_LightInfos.size (); + const uint count0 = (uint)_AnimatedLightmap.size(); + const uint count1 = (uint)mb->_LightInfos.size (); nlassert (count0 == count1); if (count0 == count1) { @@ -316,7 +316,7 @@ void CMeshBaseInstance::initAnimatedLightIndex (const CScene &scene) // For each lightmap in the shape CMeshBase *pMB = static_cast (static_cast (Shape)); - const uint count = pMB->_LightInfos.size (); + const uint count = (uint)pMB->_LightInfos.size (); uint i; // Resize the index array @@ -339,7 +339,7 @@ void CMeshBaseInstance::initAnimatedLightIndex (const CScene &scene) // *************************************************************************** uint CMeshBaseInstance::getNumMaterial () const { - return Materials.size (); + return (uint)Materials.size (); } diff --git a/code/nel/src/3d/mesh_block_manager.cpp b/code/nel/src/3d/mesh_block_manager.cpp index 8da305079..a78e86dd8 100644 --- a/code/nel/src/3d/mesh_block_manager.cpp +++ b/code/nel/src/3d/mesh_block_manager.cpp @@ -94,7 +94,7 @@ void CMeshBlockManager::addInstance(IMeshGeom *meshGeom, CMeshBaseInstance *in // link to the head of the list. instInfo.NextInstance= meshGeom->_RootInstanceId; - meshGeom->_RootInstanceId= hb->RdrInstances.size(); + meshGeom->_RootInstanceId= (sint32)hb->RdrInstances.size(); // add this instance hb->RdrInstances.push_back(instInfo); @@ -311,7 +311,7 @@ void CMeshBlockManager::allocateMeshVBHeap(IMeshGeom *mesh) // else, must add to the array else { - meshId= vbHeapBlock->AllocatedMeshGeoms.size(); + meshId= (uint)vbHeapBlock->AllocatedMeshGeoms.size(); vbHeapBlock->AllocatedMeshGeoms.push_back(mesh); } @@ -414,7 +414,7 @@ bool CMeshBlockManager::addVBHeap(IDriver *drv, uint vertexFormat, uint maxVer // add an entry to the array, and the map. _VBHeapBlocks.push_back(hb); - _VBHeapMap[vertexFormat]= _VBHeapBlocks.size()-1; + _VBHeapMap[vertexFormat]= (uint)_VBHeapBlocks.size()-1; return true; } diff --git a/code/nel/src/3d/mesh_morpher.cpp b/code/nel/src/3d/mesh_morpher.cpp index aed1b1dc6..7027864c9 100644 --- a/code/nel/src/3d/mesh_morpher.cpp +++ b/code/nel/src/3d/mesh_morpher.cpp @@ -405,7 +405,7 @@ void CMeshMorpher::updateRawSkin (CVertexBuffer *vbOri, if (rFactor != 0.0f) { rFactor*= 0.01f; - uint32 numVertices= rBS.VertRefs.size(); + uint32 numVertices= (uint32)rBS.VertRefs.size(); // don't know why, but cases happen where deltaNorm not empty while deltaPos is bool hasPos= rBS.deltaPos.size()>0; bool hasNorm= rBS.deltaNorm.size()>0; diff --git a/code/nel/src/3d/mesh_mrm.cpp b/code/nel/src/3d/mesh_mrm.cpp index 3f67d79cb..ab6332964 100644 --- a/code/nel/src/3d/mesh_mrm.cpp +++ b/code/nel/src/3d/mesh_mrm.cpp @@ -107,7 +107,7 @@ void CMeshMRMGeom::CLod::buildSkinVertexBlocks() uint i; for(i=0;i // LodOffset is filled in serial() when stream is input. } // After build, all lods are present in memory. - _NbLodLoaded= _Lods.size(); + _NbLodLoaded= (uint)_Lods.size(); // For load balancing. @@ -549,7 +549,7 @@ void CMeshMRMGeom::applyGeomorphWithVBHardPtr(std::vector &geoms // For all geomorphs. - uint nGeoms= geoms.size(); + uint nGeoms= (uint)geoms.size(); CMRMWedgeGeom *ptrGeom= &(geoms[0]); uint8 *destPtr= vertexDestPtr; /* NB: optimisation: lot of "if" in this Loop, but because of BTB, they always cost nothing (prediction is good). @@ -751,7 +751,7 @@ void CMeshMRMGeom::applyGeomorphWithVBHardPtr(std::vector &geoms // For all stages after 4. for(i=4;i &geoms, // For all geomorphs. - uint nGeoms= geoms.size(); + uint nGeoms= (uint)geoms.size(); CMRMWedgeGeom *ptrGeom= &(geoms[0]); uint8 *destPtr= vertexDestPtr; for(; nGeoms>0; nGeoms--, ptrGeom++, destPtr+= vertexSize ) @@ -1355,7 +1355,7 @@ sint CMeshMRMGeom::renderSkinGroupGeom(CMeshMRMInstance *mi, float alphaMRM, uin applyRawSkinWithNormal (lod, *(mi->_RawSkinCache), skeleton, vbDest, alphaLod); // Vertices are packed in RawSkin mode (ie no holes due to MRM!) - return mi->_RawSkinCache->Geomorphs.size() + + return (sint)mi->_RawSkinCache->Geomorphs.size() + mi->_RawSkinCache->TotalSoftVertices + mi->_RawSkinCache->TotalHardVertices; } @@ -1519,7 +1519,7 @@ void CMeshMRMGeom::updateShiftedTriangleCache(CMeshMRMInstance *mi, sint curLodI } // Build RdrPass - mi->_ShiftedTriangleCache->RdrPass.resize(pbList.size()); + mi->_ShiftedTriangleCache->RdrPass.resize((uint32)pbList.size()); // First pass, count number of triangles, and fill header info uint totalTri= 0; @@ -1764,7 +1764,7 @@ void CMeshMRMGeom::load(NLMISC::IStream &f) throw(NLMISC::EStream) } // Now, all lods are loaded. - _NbLodLoaded= _Lods.size(); + _NbLodLoaded= (uint)_Lods.size(); // If version doen't have boneNames, must build BoneId now. if(verHeader <= 2) @@ -1951,7 +1951,7 @@ void CMeshMRMGeom::loadFirstLod(NLMISC::IStream &f) */ uint numLodToLoad; if(verHeader<4) - numLodToLoad= _LodInfos.size(); + numLodToLoad= (uint)_LodInfos.size(); else numLodToLoad= 1; @@ -2152,7 +2152,7 @@ void CMeshMRMGeom::restoreOriginalSkinPart(CLod &lod) //=========================== for(uint i=0;i &vertice // **** count number of vertices really used (skip geomorphs) uint numUsedVertices=0; - for(i=geomorphs.size();i=0) numUsedVertices++; @@ -2607,13 +2607,13 @@ bool CMeshMRMGeom::buildGeometryForLod(uint lodId, std::vector &vertice _VBufferFinal.lock(vba); // get the start vert, beginning at end of geomorphs - const uint8 *pSrcVert= (const uint8*)vba.getVertexCoordPointer(geomorphs.size()); + const uint8 *pSrcVert= (const uint8*)vba.getVertexCoordPointer((uint)geomorphs.size()); uint32 vertSize= _VBufferFinal.getVertexSize(); CVector *pDstVert= &vertices[0]; uint dstIndex= 0; // Then run all input vertices (skip geomorphs) - for(i=geomorphs.size();i=0) @@ -2710,7 +2710,7 @@ uint CMeshMRMGeom::getNumRdrPassesForMesh() const // *************************************************************************** uint CMeshMRMGeom::getNumRdrPassesForInstance(CMeshBaseInstance *inst) const { - return _Lods[_MBRCurrentLodId].RdrPass.size(); + return (uint)_Lods[_MBRCurrentLodId].RdrPass.size(); } // *************************************************************************** void CMeshMRMGeom::beginMesh(CMeshGeomRenderContext &rdrCtx) @@ -2884,7 +2884,7 @@ void CMeshMRM::build (CMeshBase::CMeshBaseBuild &mBase, CMesh::CMeshBuild &m, CMeshBase::buildMeshBase (mBase); // Then build the geom. - _MeshMRMGeom.build (m, listBS, mBase.Materials.size(), params); + _MeshMRMGeom.build (m, listBS, (uint)mBase.Materials.size(), params); } // *************************************************************************** void CMeshMRM::build (CMeshBase::CMeshBaseBuild &m, const CMeshMRMGeom &mgeom) @@ -3196,10 +3196,10 @@ void CMeshMRMGeom::updateRawSkinNormal(bool enabled, CMeshMRMInstance *mi, sint // Resize the dest array. - skinLod.Vertices1.resize(lod.InfluencedVertices[0].size()); - skinLod.Vertices2.resize(lod.InfluencedVertices[1].size()); - skinLod.Vertices3.resize(lod.InfluencedVertices[2].size()); - skinLod.Vertices4.resize(lod.InfluencedVertices[3].size()); + skinLod.Vertices1.resize((uint32)lod.InfluencedVertices[0].size()); + skinLod.Vertices2.resize((uint32)lod.InfluencedVertices[1].size()); + skinLod.Vertices3.resize((uint32)lod.InfluencedVertices[2].size()); + skinLod.Vertices4.resize((uint32)lod.InfluencedVertices[3].size()); // Remap for BlendShape. Lasts 2 bits tells what RawSkin Array to seek (1 to 4), // low Bits indicate the number in them. 0xFFFFFFFF is a special value indicating "NotUsed in this lod" @@ -3308,7 +3308,7 @@ void CMeshMRMGeom::updateRawSkinNormal(bool enabled, CMeshMRMInstance *mi, sint // Remap Geomorphs. //======== - uint numGeoms= lod.Geomorphs.size(); + uint numGeoms= (uint)lod.Geomorphs.size(); skinLod.Geomorphs.resize( numGeoms ); for(i=0;i0) { - skinLod.VertexRemap.resize(vertexFinalRemap.size()); + skinLod.VertexRemap.resize((uint32)vertexFinalRemap.size()); for(i=0;i &shadowVerti // *************************************************************************** uint CMeshMRMGeom::getNumShadowSkinVertices() const { - return _ShadowSkin.Vertices.size(); + return (uint)_ShadowSkin.Vertices.size(); } // *************************************************************************** sint CMeshMRMGeom::renderShadowSkinGeom(CMeshMRMInstance *mi, uint remainingVertices, uint8 *vbDest) { - uint numVerts= _ShadowSkin.Vertices.size(); + uint numVerts= (uint)_ShadowSkin.Vertices.size(); // if no verts, no draw if(numVerts==0) @@ -3496,7 +3496,7 @@ void CMeshMRMGeom::renderShadowSkinPrimitives(CMeshMRMInstance *mi, CMaterial if(shiftedTris.getNumIndexes()<_ShadowSkin.Triangles.size()) { shiftedTris.setFormat(NL_MESH_MRM_INDEX_FORMAT); - shiftedTris.setNumIndexes(_ShadowSkin.Triangles.size()); + shiftedTris.setNumIndexes((uint32)_ShadowSkin.Triangles.size()); } shiftedTris.setPreferredMemory(CIndexBuffer::RAMVolatile, false); { @@ -3504,7 +3504,7 @@ void CMeshMRMGeom::renderShadowSkinPrimitives(CMeshMRMInstance *mi, CMaterial shiftedTris.lock(iba); const uint32 *src= &_ShadowSkin.Triangles[0]; TMeshMRMIndexType *dst= (TMeshMRMIndexType *) iba.getPtr(); - for(uint n= _ShadowSkin.Triangles.size();n>0;n--, src++, dst++) + for(uint n= (uint)_ShadowSkin.Triangles.size();n>0;n--, src++, dst++) { *dst= (TMeshMRMIndexType)(*src + baseVertex); } @@ -3513,7 +3513,7 @@ void CMeshMRMGeom::renderShadowSkinPrimitives(CMeshMRMInstance *mi, CMaterial // Render Triangles with cache //=========== - uint numTris= _ShadowSkin.Triangles.size()/3; + uint numTris= (uint)_ShadowSkin.Triangles.size()/3; // Render with the Materials of the MeshInstance. drv->activeIndexBuffer(shiftedTris); diff --git a/code/nel/src/3d/mesh_mrm_skin.cpp b/code/nel/src/3d/mesh_mrm_skin.cpp index e0111d7aa..af02a49e4 100644 --- a/code/nel/src/3d/mesh_mrm_skin.cpp +++ b/code/nel/src/3d/mesh_mrm_skin.cpp @@ -204,7 +204,7 @@ void CMeshMRMGeom::applySkin(CLod &lod, const CSkeletonModel *skeleton) nlassert(NL3D_MESH_SKINNING_MAX_MATRIX==4); for(uint i=0;i // For all geomorphs. - uint nGeoms= geoms.size(); + uint nGeoms= (uint)geoms.size(); CMRMWedgeGeom *ptrGeom= &(geoms[0]); uint8 *destPtr= vertexDestPtr; for(; nGeoms>0; nGeoms--, ptrGeom++, destPtr+= vertexSize ) @@ -472,7 +472,7 @@ void CMeshMRMSkinnedGeom::applyGeomorphPosNormalUV0(std::vector void CMeshMRMSkinnedGeom::applyGeomorphPosNormalUV0Int(std::vector &geoms, uint8 *vertexPtr, uint8 *vertexDestPtr, sint32 vertexSize, sint a, sint a1) { // For all geomorphs. - uint nGeoms= geoms.size(); + uint nGeoms= (uint)geoms.size(); CMRMWedgeGeom *ptrGeom= &(geoms[0]); uint8 *destPtr= vertexDestPtr; for(; nGeoms>0; nGeoms--, ptrGeom++, destPtr+= vertexSize ) @@ -567,7 +567,7 @@ inline sint CMeshMRMSkinnedGeom::chooseLod(float alphaMRM, float &alphaLod) /// Ensure numLod is correct if(numLod>=(sint)_Lods.size()) { - numLod= _Lods.size()-1; + numLod= (sint)_Lods.size()-1; alphaLod= 1; } @@ -799,7 +799,7 @@ sint CMeshMRMSkinnedGeom::renderSkinGroupGeom(CMeshMRMSkinnedInstance *mi, float applyRawSkinWithNormal (lod, *(mi->_RawSkinCache), skeleton, vbDest, alphaLod); // Vertices are packed in RawSkin mode (ie no holes due to MRM!) - return mi->_RawSkinCache->Geomorphs.size() + + return (sint)mi->_RawSkinCache->Geomorphs.size() + mi->_RawSkinCache->TotalSoftVertices + mi->_RawSkinCache->TotalHardVertices; } @@ -951,7 +951,7 @@ void CMeshMRMSkinnedGeom::updateShiftedTriangleCache(CMeshMRMSkinnedInstance *mi } // Build RdrPass - mi->_ShiftedTriangleCache->RdrPass.resize(pbList.size()); + mi->_ShiftedTriangleCache->RdrPass.resize((uint32)pbList.size()); // First pass, count number of triangles, and fill header info uint totalTri= 0; @@ -1463,7 +1463,7 @@ void CMeshMRMSkinned::build (CMeshBase::CMeshBaseBuild &mBase, CMesh::CMeshBui CMeshBase::buildMeshBase (mBase); // Then build the geom. - _MeshMRMGeom.build (m, mBase.Materials.size(), params); + _MeshMRMGeom.build (m, (uint)mBase.Materials.size(), params); } // *************************************************************************** void CMeshMRMSkinned::build (CMeshBase::CMeshBaseBuild &m, const CMeshMRMSkinnedGeom &mgeom) @@ -1736,10 +1736,10 @@ void CMeshMRMSkinnedGeom::updateRawSkinNormal(bool enabled, CMeshMRMSkinnedInst // Resize the dest array. - skinLod.Vertices1.resize(lod.InfluencedVertices[0].size()); - skinLod.Vertices2.resize(lod.InfluencedVertices[1].size()); - skinLod.Vertices3.resize(lod.InfluencedVertices[2].size()); - skinLod.Vertices4.resize(lod.InfluencedVertices[3].size()); + skinLod.Vertices1.resize((uint32)lod.InfluencedVertices[0].size()); + skinLod.Vertices2.resize((uint32)lod.InfluencedVertices[1].size()); + skinLod.Vertices3.resize((uint32)lod.InfluencedVertices[2].size()); + skinLod.Vertices4.resize((uint32)lod.InfluencedVertices[3].size()); // Vertex buffer pointers const CPackedVertexBuffer::CPackedVertex *vertices = _VBufferFinal.getPackedVertices(); @@ -1846,7 +1846,7 @@ void CMeshMRMSkinnedGeom::updateRawSkinNormal(bool enabled, CMeshMRMSkinnedInst // Remap Geomorphs. //======== - uint numGeoms= lod.Geomorphs.size(); + uint numGeoms= (uint)lod.Geomorphs.size(); skinLod.Geomorphs.resize( numGeoms ); for(i=0;i &shad // *************************************************************************** uint CMeshMRMSkinnedGeom::getNumShadowSkinVertices() const { - return _ShadowSkin.Vertices.size(); + return (uint)_ShadowSkin.Vertices.size(); } // *************************************************************************** sint CMeshMRMSkinnedGeom::renderShadowSkinGeom(CMeshMRMSkinnedInstance *mi, uint remainingVertices, uint8 *vbDest) { - uint numVerts= _ShadowSkin.Vertices.size(); + uint numVerts= (uint)_ShadowSkin.Vertices.size(); // if no verts, no draw if(numVerts==0) @@ -1991,14 +1991,14 @@ void CMeshMRMSkinnedGeom::renderShadowSkinPrimitives(CMeshMRMSkinnedInstance * //if(shiftedTris.getNumIndexes()<_ShadowSkin.Triangles.size()) //{ shiftedTris.setFormat(NL_SKINNED_MESH_MRM_INDEX_FORMAT); - shiftedTris.setNumIndexes(_ShadowSkin.Triangles.size()); + shiftedTris.setNumIndexes((uint32)_ShadowSkin.Triangles.size()); //} { CIndexBufferReadWrite iba; shiftedTris.lock(iba); const uint32 *src= &_ShadowSkin.Triangles[0]; TSkinnedMeshMRMIndexType *dst= (TSkinnedMeshMRMIndexType*) iba.getPtr(); - for(uint n= _ShadowSkin.Triangles.size();n>0;n--, src++, dst++) + for(uint n= (uint)_ShadowSkin.Triangles.size();n>0;n--, src++, dst++) { *dst= (TSkinnedMeshMRMIndexType)(*src + baseVertex); } @@ -2007,7 +2007,7 @@ void CMeshMRMSkinnedGeom::renderShadowSkinPrimitives(CMeshMRMSkinnedInstance * // Render Triangles with cache //=========== - uint numTris= _ShadowSkin.Triangles.size()/3; + uint numTris= (uint)_ShadowSkin.Triangles.size()/3; // Render with the Materials of the MeshInstance. drv->activeIndexBuffer(shiftedTris); diff --git a/code/nel/src/3d/mesh_multi_lod.cpp b/code/nel/src/3d/mesh_multi_lod.cpp index b9b25a41b..47ba62b79 100644 --- a/code/nel/src/3d/mesh_multi_lod.cpp +++ b/code/nel/src/3d/mesh_multi_lod.cpp @@ -115,7 +115,7 @@ void CMeshMultiLod::build(CMeshMultiLodBuild &mbuild) } // Sort the slot by the distance... - for (int i=mbuild.LodMeshes.size()-1; i>0; i--) + for (int i=(uint)mbuild.LodMeshes.size()-1; i>0; i--) for (int j=0; j &pyramid, const CMatrix &worldMatrix) { // Look for the biggest mesh - uint meshCount=_MeshVector.size(); + uint meshCount=(uint)_MeshVector.size(); for (uint i=0; i0) @@ -378,7 +378,7 @@ float CMeshMultiLod::getNumTrianglesWithCoarsestDist(float distance, float coars void CMeshMultiLod::getAABBox(NLMISC::CAABBox &bbox) const { // Get count - uint count=_MeshVector.size(); + uint count=(uint)_MeshVector.size(); for (uint slot=0; slot_MeshVector.size(); + uint meshCount=(uint)shape->_MeshVector.size(); Lod0=0; if (meshCount>1) { diff --git a/code/nel/src/3d/mrm_builder.cpp b/code/nel/src/3d/mrm_builder.cpp index d19eeb064..5820a575a 100644 --- a/code/nel/src/3d/mrm_builder.cpp +++ b/code/nel/src/3d/mrm_builder.cpp @@ -137,7 +137,7 @@ float CMRMBuilder::getDeltaFaceNormals(sint numvertex) CMRMVertex &vert= TmpVertices[numvertex]; float delta=0; CVector refNormal; - sint nfaces=vert.SharedFaces.size(); + sint nfaces=(sint)vert.SharedFaces.size(); for(sint i=0;inWantedFaces) @@ -1278,7 +1278,7 @@ void CMRMBuilder::makeFromMesh(const CMRMMesh &baseMesh, CMRMMeshGeom &lodMesh, void CMRMBuilder::buildAllLods(const CMRMMesh &baseMesh, std::vector &lodMeshs, uint nWantedLods, uint divisor) { - sint nFaces= baseMesh.Faces.size(); + sint nFaces= (sint)baseMesh.Faces.size(); sint nBaseFaces; sint i; CMRMMesh srcMesh = baseMesh; @@ -1328,7 +1328,7 @@ void CMRMBuilder::buildFinalMRM(std::vector &lodMeshs, CMRMMeshFin { sint i,j; sint lodId, attId; - sint nLods= lodMeshs.size(); + sint nLods= (sint)lodMeshs.size(); // Init. // =============== @@ -1401,7 +1401,7 @@ void CMRMBuilder::buildFinalMRM(std::vector &lodMeshs, CMRMMeshFin } // Here, the number of wedge indicate the max number of wedge this LOD needs. - finalMRM.Lods[lodId].NWedges= finalMRM.Wedges.size(); + finalMRM.Lods[lodId].NWedges= (sint)finalMRM.Wedges.size(); } @@ -1647,7 +1647,7 @@ sint CMRMBuilder::findInsertAttributeInBaseMesh(CMRMMesh &baseMesh, sint attId // if attribute not found in the map, then insert a new one. if(it==_AttributeMap[attId].end()) { - sint idx= baseMesh.Attributes[attId].size(); + sint idx= (sint)baseMesh.Attributes[attId].size(); // insert into the array. baseMesh.Attributes[attId].push_back(att); // insert into the map. @@ -1779,7 +1779,7 @@ uint32 CMRMBuilder::buildMrmBaseMesh(const CMesh::CMeshBuild &mbuild, CMRMMesh if(_HasMeshInterfaces) baseMesh.InterfaceLinks= mbuild.InterfaceLinks; // Resize faces. - nFaces= mbuild.Faces.size(); + nFaces= (sint)mbuild.Faces.size(); baseMesh.Faces.resize(nFaces); for(i=0; i::iterator it= matrixInfMap.find(matId); if( it==matrixInfMap.end() ) { - uint matInfId= destLod.MatrixInfluences.size(); + uint matInfId= (uint)destLod.MatrixInfluences.size(); matrixInfMap.insert( make_pair(matId, matInfId) ); // create the new MatrixInfluence. destLod.MatrixInfluences.push_back(matId); @@ -2244,7 +2244,7 @@ void CMRMBuilder::buildMeshBuildMrm(const CMRMMeshFinal &finalMRM, CMeshMRMGeo for (k = 0; k < (sint)mbuild.BlendShapes.size(); ++k) { CBlendShape &rBS = mbuild.BlendShapes[k]; - sint32 nNbVertVB = finalMRM.Wedges.size(); + sint32 nNbVertVB = (sint32)finalMRM.Wedges.size(); bool bIsDeltaPos = false; rBS.deltaPos.resize (nNbVertVB, CVector(0.0f,0.0f,0.0f)); bool bIsDeltaNorm = false; @@ -2489,7 +2489,7 @@ void CMRMBuilder::buildMeshBuildMrm(const CMRMMeshFinal &finalMRM, CMeshMRMSki // Setup the VertexBuffer. // ======================== // resize the VB. - mbuild.VBuffer.setNumVertices(finalMRM.Wedges.size()); + mbuild.VBuffer.setNumVertices((uint32)finalMRM.Wedges.size()); CVertexBufferReadWrite vba; mbuild.VBuffer.lock (vba); @@ -2603,7 +2603,7 @@ void CMRMBuilder::buildMeshBuildMrm(const CMRMMeshFinal &finalMRM, CMeshMRMSki else { // map material to rdrPass. - sint idRdrPass= destLod.RdrPass.size(); + sint idRdrPass= (sint)destLod.RdrPass.size(); rdrPassIndex[j]= idRdrPass; // create a rdrPass. destLod.RdrPass.push_back(CMeshMRMSkinnedGeom::CRdrPass()); @@ -2719,7 +2719,7 @@ void CMRMBuilder::buildMeshBuildMrm(const CMRMMeshFinal &finalMRM, CMeshMRMSki map::iterator it= matrixInfMap.find(matId); if( it==matrixInfMap.end() ) { - uint matInfId= destLod.MatrixInfluences.size(); + uint matInfId= (uint)destLod.MatrixInfluences.size(); matrixInfMap.insert( make_pair(matId, matInfId) ); // create the new MatrixInfluence. destLod.MatrixInfluences.push_back(matId); @@ -2746,7 +2746,7 @@ void CMRMBuilder::buildMeshBuildMrm(const CMRMMeshFinal &finalMRM, CMeshMRMSki for (k = 0; k < (sint)mbuild.BlendShapes.size(); ++k) { CBlendShape &rBS = mbuild.BlendShapes[k]; - sint32 nNbVertVB = finalMRM.Wedges.size(); + sint32 nNbVertVB = (sint32)finalMRM.Wedges.size(); bool bIsDeltaPos = false; rBS.deltaPos.resize (nNbVertVB, CVector(0.0f,0.0f,0.0f)); bool bIsDeltaNorm = false; diff --git a/code/nel/src/3d/mrm_internal.cpp b/code/nel/src/3d/mrm_internal.cpp index 3e8645b2b..3fa17794b 100644 --- a/code/nel/src/3d/mrm_internal.cpp +++ b/code/nel/src/3d/mrm_internal.cpp @@ -50,7 +50,7 @@ sint CMRMSewingMesh::mustCollapseEdge(uint lod, const CMRMEdge &edge, uint &vert sint CMRMSewingMesh::getNumCollapseEdge(uint lod) const { nlassert(lod<_Lods.size()); - return _Lods[lod].EdgeToCollapse.size(); + return (sint)_Lods[lod].EdgeToCollapse.size(); } @@ -65,7 +65,7 @@ void CMRMSewingMesh::build(const CMesh::CInterface &meshInt, uint nWantedLods, u // build edge list std::vector edgeList; - uint nMaxEdges= meshInt.Vertices.size(); + uint nMaxEdges= (uint)meshInt.Vertices.size(); edgeList.resize(nMaxEdges); for(uint i=0;i 01 12 23... becomes 02 23 (NB: 1 is collapsed to 2) - uint precEdgeId= (bestEdgeId+edgeList.size()-1)%edgeList.size(); + uint precEdgeId= (uint)((bestEdgeId+edgeList.size()-1)%edgeList.size()); edgeList[precEdgeId].v1= edgeList[bestEdgeId].v1; // and erase the edge from the current list edgeList.erase( edgeList.begin()+bestEdgeId ); diff --git a/code/nel/src/3d/mrm_mesh.cpp b/code/nel/src/3d/mrm_mesh.cpp index 2bcc6dc9f..104d81b11 100644 --- a/code/nel/src/3d/mrm_mesh.cpp +++ b/code/nel/src/3d/mrm_mesh.cpp @@ -48,7 +48,7 @@ sint CMRMMeshFinal::findInsertWedge(const CWedge &w) // if not found, must add it. if(it==_WedgeMap.end()) { - ret= Wedges.size(); + ret= (sint)Wedges.size(); // insert into the map, with good id. _WedgeMap.insert(make_pair(w, ret)); // add it to the array. diff --git a/code/nel/src/3d/packed_world.cpp b/code/nel/src/3d/packed_world.cpp index 0f75ee394..8a3acbb7c 100644 --- a/code/nel/src/3d/packed_world.cpp +++ b/code/nel/src/3d/packed_world.cpp @@ -34,7 +34,7 @@ void CPackedWorld::build(std::vector &packedZones) _Zones.clear(); if (packedZones.empty()) return; CAABBox box; - nlassert(packedZones[0]) + nlassert(packedZones[0]); box = packedZones[0]->Box; for(uint k = 1; k < packedZones.size(); ++k) { diff --git a/code/nel/src/3d/packed_zone.cpp b/code/nel/src/3d/packed_zone.cpp index f62104028..9f45d74a3 100644 --- a/code/nel/src/3d/packed_zone.cpp +++ b/code/nel/src/3d/packed_zone.cpp @@ -175,7 +175,7 @@ void CVectorPacker::flush(CBitMemStream &bits) bits.serial(isRLE, 1); bits.serial(_LastTag, 2); nlassert(_LastDeltas.size() <= 255); - uint8 length = _LastDeltas.size(); + uint8 length = (uint8)_LastDeltas.size(); //nlwarning("begin RLE, length = %d, tag = %d", (int) length, (int) repeatTag); bits.serial(length); for(uint k = 0; k < _LastDeltas.size(); ++k) @@ -223,7 +223,7 @@ void CVectorPacker::serialPackedVector16(std::vector &v,NLMISC::IStream CBitMemStream bits(true); std::vector datas; f.serialCont(datas); - bits.fill(&datas[0], datas.size()); + bits.fill(&datas[0], (uint32)datas.size()); uint32 numValues = 0; bits.serial(numValues); v.resize(numValues); @@ -312,7 +312,7 @@ void CVectorPacker::serialPackedVector16(std::vector &v,NLMISC::IStream _Repeated[AbsOrRLE] = 0; // CBitMemStream bits(false); - uint32 numValues = v.size(); + uint32 numValues = (uint32)v.size(); bits.serial(numValues); _LastTag = std::numeric_limits::max(); _LastDeltas.clear(); @@ -723,7 +723,7 @@ void CPackedZone32::build(std::vector &leaves, { if (!triListGrid(x, y).empty()) { - Grid(x, y) = TriLists.size(); + Grid(x, y) = (uint32)TriLists.size(); std::copy(triListGrid(x, y).begin(), triListGrid(x, y).end(), std::back_inserter(TriLists)); TriLists.push_back(UndefIndex); // mark the end of the list } @@ -902,7 +902,7 @@ void CPackedZone32::addTri(const CTriangle &tri, TVertexGrid &vertexGrid, TTriLi { if (x < 0) continue; if (x >= (sint) triListGrid.getWidth()) break; - triListGrid(x, gridY).push_back(Tris.size() - 1); + triListGrid(x, gridY).push_back((uint32)Tris.size() - 1); } } } @@ -940,8 +940,8 @@ uint32 CPackedZone32::allocVertex(const CVector &src, TVertexGrid &vertexGrid) // create a new vertex Verts.push_back(pv); - vertList.push_front(Verts.size() - 1); - return Verts.size() - 1; + vertList.push_front((uint32)Verts.size() - 1); + return (uint32)Verts.size() - 1; } // *************************************************************************************** @@ -1013,7 +1013,7 @@ void CPackedZone32::render(CVertexBuffer &vb, IDriver &drv, CMaterial &material, } } vba.unlock(); - uint numRemainingTris = batchSize - ((endDest - dest) / 3); + uint numRemainingTris = batchSize - (uint)((endDest - dest) / 3); if (numRemainingTris) { drv.setPolygonMode(IDriver::Filled); @@ -1236,7 +1236,7 @@ void CPackedZone16::render(CVertexBuffer &vb, IDriver &drv, CMaterial &material, } } vba.unlock(); - uint numRemainingTris = batchSize - ((endDest - dest) / 3); + uint numRemainingTris = batchSize - (uint)((endDest - dest) / 3); if (numRemainingTris) { drv.setPolygonMode(IDriver::Filled); diff --git a/code/nel/src/3d/particle_system.cpp b/code/nel/src/3d/particle_system.cpp index 0c020a5bd..c4d02d8b0 100644 --- a/code/nel/src/3d/particle_system.cpp +++ b/code/nel/src/3d/particle_system.cpp @@ -603,10 +603,10 @@ void CParticleSystem::step(TPass pass, TAnimationTime ellapsedTime, CParticleSys // nodes sorted by degree InsideSimLoop = true; // make enough room for spawns - uint numProcess = _ProcessVect.size(); + uint numProcess = (uint)_ProcessVect.size(); if (numProcess > _Spawns.size()) { - uint oldSize = _Spawns.size(); + uint oldSize = (uint)_Spawns.size(); _Spawns.resize(numProcess); for(uint k = oldSize; k < numProcess; ++k) { @@ -1044,7 +1044,7 @@ bool CParticleSystem::attach(CParticleSystemProcess *ptr) //nlassert(ptr->getOwner() == NULL); _ProcessVect.push_back(ptr); ptr->setOwner(this); - ptr->setIndex(_ProcessVect.size() - 1); + ptr->setIndex((uint32)_ProcessVect.size() - 1); //notifyMaxNumFacesChanged(); if (getBypassMaxNumIntegrationSteps()) { @@ -1299,7 +1299,7 @@ void CParticleSystem::unregisterLocatedBindableExternID(CPSLocatedBindable *lb) uint CParticleSystem::getNumLocatedBindableByExternID(uint32 id) const { NL_PS_FUNC_MAIN(CParticleSystem_getNumLocatedBindableByExternID) - return _LBMap.count(id); + return (uint)_LBMap.count(id); } ///======================================================================================= @@ -1502,7 +1502,7 @@ uint CParticleSystem::getIndexOf(const CParticleSystemProcess &process) const uint CParticleSystem::getNumID() const { NL_PS_FUNC_MAIN(CParticleSystem_getNumID) - return _LBMap.size(); + return (uint)_LBMap.size(); } ///======================================================================================= @@ -2127,7 +2127,7 @@ void CParticleSystem::addRefForUserSysCoordInfo(uint numRefs) { _UserCoordSystemInfo = new CUserCoordSystemInfo; } - nlassert(_UserCoordSystemInfo) + nlassert(_UserCoordSystemInfo); _UserCoordSystemInfo->NumRef += numRefs; } @@ -2138,7 +2138,7 @@ void CParticleSystem::releaseRefForUserSysCoordInfo(uint numRefs) NL_PS_FUNC_MAIN(CParticleSystem_releaseRefForUserSysCoordInfo) if (!numRefs) return; nlassert(_UserCoordSystemInfo); - nlassert(numRefs <= _UserCoordSystemInfo->NumRef) + nlassert(numRefs <= _UserCoordSystemInfo->NumRef); _UserCoordSystemInfo->NumRef -= numRefs; if (_UserCoordSystemInfo->NumRef == 0) { diff --git a/code/nel/src/3d/particle_system_shape.cpp b/code/nel/src/3d/particle_system_shape.cpp index d7d8aeab0..5e41ba530 100644 --- a/code/nel/src/3d/particle_system_shape.cpp +++ b/code/nel/src/3d/particle_system_shape.cpp @@ -125,7 +125,7 @@ void CParticleSystemShape::serial(NLMISC::IStream &f) throw(NLMISC::EStream) { std::vector buf; f.serialCont(buf); - _ParticleSystemProto.fill(&buf[0], buf.size()); + _ParticleSystemProto.fill(&buf[0], (uint32)buf.size()); } else { diff --git a/code/nel/src/3d/patch_vegetable.cpp b/code/nel/src/3d/patch_vegetable.cpp index fb089ee35..ffa5b0b92 100644 --- a/code/nel/src/3d/patch_vegetable.cpp +++ b/code/nel/src/3d/patch_vegetable.cpp @@ -59,7 +59,7 @@ void CPatch::generateTileVegetable(CVegetableInstanceGroup *vegetIg, uint distT const CTileVegetableDesc &tileVegetDesc= getLandscape()->getTileVegetableDesc(tileId); const std::vector &vegetableList= tileVegetDesc.getVegetableList(distType); uint distAddSeed= tileVegetDesc.getVegetableSeed(distType); - uint numVegetable= vegetableList.size(); + uint numVegetable= (uint)vegetableList.size(); // If no vegetables at all, skip. if(numVegetable==0) @@ -221,7 +221,7 @@ void CPatch::generateTileVegetable(CVegetableInstanceGroup *vegetIg, uint distT // reseve instance space for this vegetable. // instanceUVArray[i].size() is the number of instances to create. - veget.reserveIgAddInstances(vegetIgReserve, (CVegetable::TVegetableWater)vegetWaterState, instanceUVArray[i].size()); + veget.reserveIgAddInstances(vegetIgReserve, (CVegetable::TVegetableWater)vegetWaterState, (uint)instanceUVArray[i].size()); } // actual reseve memory of the ig. getLandscape()->_VegetableManager->reserveIgCompile(vegetIg, vegetIgReserve); diff --git a/code/nel/src/3d/point_light_named_array.cpp b/code/nel/src/3d/point_light_named_array.cpp index fd387c6dc..e8f2950cc 100644 --- a/code/nel/src/3d/point_light_named_array.cpp +++ b/code/nel/src/3d/point_light_named_array.cpp @@ -130,7 +130,7 @@ void CPointLightNamedArray::build(const std::vector &pointLi void CPointLightNamedArray::setPointLightFactor(const CScene &scene) { // Search in the map. - const uint count = _PointLightGroupMap.size (); + const uint count = (uint)_PointLightGroupMap.size (); uint i; for (i=0; i &pyramid) // Clip portal with pyramid CPolygon p; p.Vertices = _Poly; - p.clip( &pyramid[1], pyramid.size()-1 ); + p.clip( &pyramid[1], (uint)pyramid.size()-1 ); // Construct pyramid with clipped portal if( p.Vertices.size() > 2 ) @@ -292,7 +292,7 @@ bool CPortal::clipRay(const NLMISC::CVector &startWorld, const NLMISC::CVector & // Do convex test on each border sint sign= 0; - uint polySize= _Poly.size(); + uint polySize= (uint)_Poly.size(); for(uint i=0;iget(_Owner, k) : _GenNb; processEmit(k, nbToGenerate); } @@ -591,7 +591,7 @@ void CPSEmitter::processRegularEmissionWithNoLOD(uint firstInstanceIndex) { *phaseIt -= ::floorf((*phaseIt - _EmitDelay) / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; processEmit(k, nbToGenerate); } @@ -618,7 +618,7 @@ void CPSEmitter::processRegularEmissionWithNoLOD(uint firstInstanceIndex) { *phaseIt -= ::floorf(*phaseIt / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; processEmit(k, nbToGenerate); ++*numEmitIt; @@ -643,7 +643,7 @@ void CPSEmitter::processRegularEmissionWithNoLOD(uint firstInstanceIndex) { *phaseIt -= ::floorf((*phaseIt - _EmitDelay) / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; processEmit(k, nbToGenerate); ++*numEmitIt; @@ -744,7 +744,7 @@ void CPSEmitter::processRegularEmission(uint firstInstanceIndex, float emitLOD) { *phaseIt -= ::floorf(*phaseIt / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; if (nbToGenerate) { @@ -788,7 +788,7 @@ void CPSEmitter::processRegularEmission(uint firstInstanceIndex, float emitLOD) { *phaseIt -= ::floorf((*phaseIt - _EmitDelay) / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; if (nbToGenerate) { @@ -820,7 +820,7 @@ void CPSEmitter::processRegularEmission(uint firstInstanceIndex, float emitLOD) { *phaseIt -= ::floorf(*phaseIt / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; if (nbToGenerate) { @@ -874,7 +874,7 @@ void CPSEmitter::processRegularEmission(uint firstInstanceIndex, float emitLOD) { *phaseIt -= ::floorf((*phaseIt - _EmitDelay) / *currEmitPeriod) * *currEmitPeriod; } - const uint32 k = phaseIt - (_Phase.begin()); + const uint32 k = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, k) : _GenNb; if (nbToGenerate) { @@ -1112,7 +1112,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float uint numEmissions = (uint) ::floorf(*phaseIt / *currEmitPeriod); *phaseIt -= *currEmitPeriod * numEmissions; - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; if (nbToGenerate) { @@ -1149,7 +1149,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float } else { - const uint32 emitterIndex = phaseIt - (_Phase.begin()); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; if (nbToGenerate) { @@ -1201,7 +1201,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float float deltaT = std::max(*phaseIt - _EmitDelay, 0.f); //nlassert(deltaT >= 0.f); /// process each emission at the right pos at the right date - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; if (nbToGenerate) { @@ -1235,7 +1235,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float } else { - const uint32 emitterIndex = phaseIt - (_Phase.begin()); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; if (nbToGenerate) { @@ -1275,7 +1275,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float *phaseIt -= *currEmitPeriod * numEmissions; float deltaT = std::max(*phaseIt, 0.f); //nlassert(deltaT >= 0.f); - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); if (*numEmitIt > _MaxEmissionCount) // make sure we don't go over the emission limit { numEmissions -= *numEmitIt - _MaxEmissionCount; @@ -1314,7 +1314,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float } else { - const uint32 emitterIndex = phaseIt - _Phase.begin(); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; if (nbToGenerate) { @@ -1375,7 +1375,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float *phaseIt -= *currEmitPeriod * numEmissions; float deltaT = std::max(*phaseIt - _EmitDelay, 0.f); //nlassert(deltaT >= 0.f); - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); if (*numEmitIt > _MaxEmissionCount) // make sure we don't go over the emission limit { numEmissions -= *numEmitIt - _MaxEmissionCount; @@ -1413,7 +1413,7 @@ void CPSEmitter::processRegularEmissionConsistent(uint firstInstanceIndex, float } else { - const uint32 emitterIndex = phaseIt - (_Phase.begin()); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; if (nbToGenerate) { @@ -1535,7 +1535,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd *phaseIt -= *currEmitPeriod * numEmissions; float deltaT = std::max(0.f, *phaseIt); //nlassert(deltaT >= 0.f); - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); /// compute the position of the emitter for the needed dates numEmissions = GenEmitterPositions(_Owner, @@ -1563,7 +1563,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd } else { - const uint32 emitterIndex = phaseIt - (_Phase.begin()); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; processEmit(emitterIndex, nbToGenerate); } @@ -1592,7 +1592,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd float deltaT = std::max(*phaseIt - _EmitDelay, 0.f); //nlassert(deltaT >= 0.f); - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); /// compute the position of the emitter for the needed date numEmissions = GenEmitterPositions(_Owner, _EmittedType, @@ -1618,7 +1618,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd } else { - const uint32 emitterIndex = phaseIt - (_Phase.begin()); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; processEmit(emitterIndex, nbToGenerate); } @@ -1653,7 +1653,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd *phaseIt -= *currEmitPeriod * numEmissions; float deltaT = std::max(*phaseIt, 0.f); //nlassert(deltaT >= 0.f); - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); if (*numEmitIt > _MaxEmissionCount) // make sure we don't go over the emission limit { numEmissions -= *numEmitIt - _MaxEmissionCount; @@ -1684,7 +1684,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd } else { - const uint32 emitterIndex = phaseIt - _Phase.begin(); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; processEmit(emitterIndex, nbToGenerate); ++*numEmitIt; @@ -1717,7 +1717,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd *phaseIt -= *currEmitPeriod * numEmissions; float deltaT = std::max(*phaseIt - _EmitDelay, 0.f); //nlassert(deltaT >= 0.f); - uint emitterIndex = phaseIt - _Phase.begin(); + uint emitterIndex = (uint)(phaseIt - _Phase.begin()); if (*numEmitIt > _MaxEmissionCount) // make sure we don't go over the emission limit { numEmissions -= *numEmitIt - _MaxEmissionCount; @@ -1748,7 +1748,7 @@ void CPSEmitter::processRegularEmissionConsistentWithNoLOD(uint firstInstanceInd } else { - const uint32 emitterIndex = phaseIt - (_Phase.begin()); + const uint32 emitterIndex = (uint32)(phaseIt - _Phase.begin()); nbToGenerate = _GenNbScheme ? _GenNbScheme->get(_Owner, emitterIndex) : _GenNb; processEmit(emitterIndex, nbToGenerate); ++*numEmitIt; diff --git a/code/nel/src/3d/ps_face.cpp b/code/nel/src/3d/ps_face.cpp index 5db3d70c8..ae0f16c90 100644 --- a/code/nel/src/3d/ps_face.cpp +++ b/code/nel/src/3d/ps_face.cpp @@ -310,7 +310,7 @@ void CPSFace::serial(NLMISC::IStream &f) throw(NLMISC::EStream) } else { - uint32 nbConfigurations = _PrecompBasis.size(); + uint32 nbConfigurations = (uint32)_PrecompBasis.size(); f.serial(nbConfigurations); if (nbConfigurations) { @@ -364,7 +364,7 @@ void CPSFace::hintRotateTheSame(uint32 nbConfiguration void CPSFace::fillIndexesInPrecompBasis(void) { NL_PS_FUNC(CPSFace_fillIndexesInPrecompBasis) - const uint32 nbConf = _PrecompBasis.size(); + const uint32 nbConf = (uint32)_PrecompBasis.size(); if (_Owner) { _IndexInPrecompBasis.resize( _Owner->getMaxSize() ); @@ -381,7 +381,7 @@ void CPSFace::newElement(const CPSEmitterInfo &info) NL_PS_FUNC(CPSFace_newElement) CPSQuad::newElement(info); newPlaneBasisElement(info); - const uint32 nbConf = _PrecompBasis.size(); + const uint32 nbConf = (uint32)_PrecompBasis.size(); if (nbConf) // do we use precomputed basis ? { _IndexInPrecompBasis[_Owner->getNewElementIndex()] = rand() % nbConf; diff --git a/code/nel/src/3d/ps_float.cpp b/code/nel/src/3d/ps_float.cpp index 16a1a856c..9f5933adc 100644 --- a/code/nel/src/3d/ps_float.cpp +++ b/code/nel/src/3d/ps_float.cpp @@ -113,7 +113,7 @@ float CPSFloatCurveFunctor::getValue(float date) const else // hermite interpolation { float width = it->Date - precIt->Date; - uint index = precIt - _CtrlPoints.begin(); + uint index = (uint)(precIt - _CtrlPoints.begin()); float t1 = getSlope(index) * width, t2 = getSlope(index + 1) * width; const float lambda2 = NLMISC::sqr(lambda); const float lambda3 = lambda2 * lambda; diff --git a/code/nel/src/3d/ps_located.cpp b/code/nel/src/3d/ps_located.cpp index 0bb243aa6..a62162ab9 100644 --- a/code/nel/src/3d/ps_located.cpp +++ b/code/nel/src/3d/ps_located.cpp @@ -1853,7 +1853,7 @@ void CPSLocated::updateCollisions() #ifdef NL_DEBUG nlassert(CParticleSystem::_ParticleToRemove.size() <= _Size); #endif - CParticleSystem::_ParticleRemoveListIndex[currCollision->Index] = CParticleSystem::_ParticleToRemove.size() - 1; + CParticleSystem::_ParticleRemoveListIndex[currCollision->Index] = (sint)CParticleSystem::_ParticleToRemove.size() - 1; } currCollision = currCollision->Next; @@ -1899,7 +1899,7 @@ void CPSLocated::updateCollisions() #ifdef NL_DEBUG nlassert(CParticleSystem::_ParticleToRemove.size() <= _Size); #endif - CParticleSystem::_ParticleRemoveListIndex[currCollision->Index] = CParticleSystem::_ParticleToRemove.size() - 1; + CParticleSystem::_ParticleRemoveListIndex[currCollision->Index] = (sint)CParticleSystem::_ParticleToRemove.size() - 1; } } currCollision = currCollision->Next; @@ -2012,7 +2012,7 @@ void CPSLocated::updateLife() #ifdef NL_DEBUG nlassert(CParticleSystem::_ParticleToRemove.size() <= _Size); #endif - CParticleSystem::_ParticleRemoveListIndex[k] = CParticleSystem::_ParticleToRemove.size() - 1; + CParticleSystem::_ParticleRemoveListIndex[k] = (sint)CParticleSystem::_ParticleToRemove.size() - 1; } ++itTime; ++itTimeInc; @@ -2040,7 +2040,7 @@ void CPSLocated::updateLife() #ifdef NL_DEBUG nlassert(CParticleSystem::_ParticleToRemove.size() <= _Size); #endif - CParticleSystem::_ParticleRemoveListIndex[k] = CParticleSystem::_ParticleToRemove.size() - 1; + CParticleSystem::_ParticleRemoveListIndex[k] = (sint)CParticleSystem::_ParticleToRemove.size() - 1; } ++ itTime; } @@ -2068,7 +2068,7 @@ void CPSLocated::updateLife() #ifdef NL_DEBUG nlassert(CParticleSystem::_ParticleToRemove.size() <= _Size); #endif - CParticleSystem::_ParticleRemoveListIndex[k] = CParticleSystem::_ParticleToRemove.size() - 1; + CParticleSystem::_ParticleRemoveListIndex[k] = (sint)CParticleSystem::_ParticleToRemove.size() - 1; } } } @@ -2396,7 +2396,7 @@ void CPSLocated::addNewlySpawnedParticles() { sint32 insertionIndex = newElement(*it, false, CParticleSystem::EllapsedTime); #ifdef NL_DEBUG - nlassert(insertionIndex != -1) + nlassert(insertionIndex != -1); #endif if (_Time[insertionIndex] >= 1.f) { @@ -2407,7 +2407,7 @@ void CPSLocated::addNewlySpawnedParticles() #ifdef NL_DEBUG nlassert(CParticleSystem::_ParticleToRemove.size() <= _Size); #endif - CParticleSystem::_ParticleRemoveListIndex[insertionIndex] = CParticleSystem::_ParticleToRemove.size() - 1; + CParticleSystem::_ParticleRemoveListIndex[insertionIndex] = (sint)CParticleSystem::_ParticleToRemove.size() - 1; } } //CParticleSystem::InsideSimLoop = true; diff --git a/code/nel/src/3d/ps_mesh.cpp b/code/nel/src/3d/ps_mesh.cpp index adf2a5dd0..6d4ee0704 100644 --- a/code/nel/src/3d/ps_mesh.cpp +++ b/code/nel/src/3d/ps_mesh.cpp @@ -723,7 +723,7 @@ public: do { - const uint numShapes = m._Meshes.size(); + const uint numShapes = (uint)m._Meshes.size(); const uint8 *m0, *m1; float lambda; float opLambda; @@ -1105,7 +1105,7 @@ uint CPSConstraintMesh::getNumShapes() const { const_cast(this)->update(); } - return _MeshShapeFileName.size(); + return (uint)_MeshShapeFileName.size(); } //==================================================================================== @@ -1434,7 +1434,7 @@ void CPSConstraintMesh::fillIndexesInPrecompBasis(void) { NL_PS_FUNC(CPSConstraintMesh_fillIndexesInPrecompBasis) // TODO : avoid code duplication with CPSFace ... - const uint32 nbConf = _PrecompBasis.size(); + const uint32 nbConf = (uint32)_PrecompBasis.size(); if (_Owner) { _IndexInPrecompBasis.resize( _Owner->getMaxSize() ); @@ -1475,7 +1475,7 @@ void CPSConstraintMesh::serial(NLMISC::IStream &f) throw(NLMISC::EStream) } else { - uint32 nbConfigurations = _PrecompBasis.size(); + uint32 nbConfigurations = (uint32)_PrecompBasis.size(); f.serial(nbConfigurations); if (nbConfigurations) { @@ -1977,7 +1977,7 @@ void CPSConstraintMesh::newElement(const CPSEmitterInfo &info) newSizeElement(info); newPlaneBasisElement(info); // TODO : avoid code cuplication with CPSFace ... - const uint32 nbConf = _PrecompBasis.size(); + const uint32 nbConf = (uint32)_PrecompBasis.size(); if (nbConf) // do we use precomputed basis ? { _IndexInPrecompBasis[_Owner->getNewElementIndex()] = rand() % nbConf; diff --git a/code/nel/src/3d/ps_ribbon.cpp b/code/nel/src/3d/ps_ribbon.cpp index 21dcfc9af..457d94fe2 100644 --- a/code/nel/src/3d/ps_ribbon.cpp +++ b/code/nel/src/3d/ps_ribbon.cpp @@ -288,11 +288,11 @@ inline uint CPSRibbon::getNumVerticesInSlice() const NL_PS_FUNC(CPSRibbon_getNumVerticesInSlice) if (_BraceMode) { - return _Shape.size(); + return (uint)_Shape.size(); } else { - return _Shape.size() + (_Tex == NULL ? 0 : 1); + return (uint)_Shape.size() + (_Tex == NULL ? 0 : 1); } } @@ -724,7 +724,7 @@ void CPSRibbon::displayRibbons(uint32 nbRibbons, uint32 srcStep) // Compute ribbons // ///////////////////// const uint numVerticesInSlice = getNumVerticesInSlice(); - const uint numVerticesInShape = _Shape.size(); + const uint numVerticesInShape = (uint)_Shape.size(); // static std::vector sizes; static std::vector ribbonPos; // this is where the position of each ribbon slice center i stored @@ -943,7 +943,7 @@ CPSRibbon::CVBnPB &CPSRibbon::getVBnPB() ]; const uint numVerticesInSlice = getNumVerticesInSlice(); /// 1 vertex added for textured ribbon (to avoid texture stretching) - const uint numVerticesInShape = _Shape.size(); + const uint numVerticesInShape = (uint)_Shape.size(); // The number of slice is encoded in the upper word of the vb index @@ -974,11 +974,11 @@ CPSRibbon::CVBnPB &CPSRibbon::getVBnPB() // set the primitive block size if (_BraceMode) { - pb.setNumIndexes(6 * _UsedNbSegs * numRibbonInVB * (_Shape.size() / 2)); + pb.setNumIndexes(6 * _UsedNbSegs * numRibbonInVB * (uint32)(_Shape.size() / 2)); } else { - pb.setNumIndexes(6 * _UsedNbSegs * numRibbonInVB * _Shape.size()); + pb.setNumIndexes(6 * _UsedNbSegs * numRibbonInVB * (uint32)_Shape.size()); } // CIndexBufferReadWrite ibaWrite; diff --git a/code/nel/src/3d/ps_zone.cpp b/code/nel/src/3d/ps_zone.cpp index be8fdc331..4a804df15 100644 --- a/code/nel/src/3d/ps_zone.cpp +++ b/code/nel/src/3d/ps_zone.cpp @@ -235,7 +235,7 @@ void CPSZonePlane::computeCollisions(CPSLocated &target, uint firstInstanceIndex ci.Dist = startEnd.norm(); // we translate the particle from an epsilon so that it won't get hooked to the plane ci.NewPos = *itPosBefore + startEnd + PSCollideEpsilon * p.getNormal(); - const CVector &speed = target.getSpeed()[itPosBefore - posBefore]; + const CVector &speed = target.getSpeed()[(uint32)(itPosBefore - posBefore)]; ci.NewSpeed = _BounceFactor * (speed - 2.0f * (speed * p.getNormal()) * p.getNormal()); ci.CollisionZone = this; CPSLocated::_Collisions[itPosBefore - posBefore].update(ci); @@ -346,7 +346,7 @@ void CPSZoneSphere::computeCollisions(CPSLocated &target, uint firstInstanceInde ci.Dist = startEnd.norm(); // we translate the particle from an epsilon so that it won't get hooked to the sphere ci.NewPos = pos + startEnd + PSCollideEpsilon * normal; - const CVector &speed = target.getSpeed()[itPosBefore - posBefore]; + const CVector &speed = target.getSpeed()[(uint32)(itPosBefore - posBefore)]; ci.NewSpeed = _BounceFactor * (speed - 2.0f * (speed * normal) * normal); ci.CollisionZone = this; CPSLocated::_Collisions[itPosBefore - posBefore].update(ci); @@ -503,7 +503,7 @@ void CPSZoneDisc::computeCollisions(CPSLocated &target, uint firstInstanceIndex, hitRadius2 = (ci.NewPos - center) * (ci.NewPos - center); if (hitRadius2 < radiusIt->R2) // check collision against disc { - const CVector &speed = target.getSpeed()[itPosBefore - posBefore]; + const CVector &speed = target.getSpeed()[(uint32)(itPosBefore - posBefore)]; ci.NewSpeed = _BounceFactor * (speed - 2.0f * (speed * p.getNormal()) * p.getNormal()); ci.CollisionZone = this; CPSLocated::_Collisions[itPosBefore - posBefore].update(ci); @@ -953,7 +953,7 @@ void CPSZoneCylinder::computeCollisions(CPSLocated &target, uint firstInstanceIn if (alphaCyl < 0.f) alphaCyl = 1.f; } - const CVector &speed = target.getSpeed()[itPosBefore - posBefore]; + const CVector &speed = target.getSpeed()[(uint32)(itPosBefore - posBefore)]; // now, choose the minimum positive dist if (alphaTop < alphaBottom && alphaTop < alphaCyl) { @@ -1175,7 +1175,7 @@ void CPSZoneRectangle::computeCollisions(CPSLocated &target, uint firstInstanceI if ( fabs( (ci.NewPos - center) * X ) < *widthIt && fabs( (ci.NewPos - center) * Y ) < *heightIt) // check collision against rectangle { ci.NewPos += PSCollideEpsilon * p.getNormal(); - const CVector &speed = target.getSpeed()[itPosBefore - posBefore]; + const CVector &speed = target.getSpeed()[(uint32)(itPosBefore - posBefore)]; ci.NewSpeed = _BounceFactor * (speed - 2.0f * (speed * p.getNormal()) * p.getNormal()); ci.CollisionZone = this; CPSLocated::_Collisions[itPosBefore - posBefore].update(ci); diff --git a/code/nel/src/3d/quad_effect.cpp b/code/nel/src/3d/quad_effect.cpp index 7c516063a..c1b6bb76d 100644 --- a/code/nel/src/3d/quad_effect.cpp +++ b/code/nel/src/3d/quad_effect.cpp @@ -58,7 +58,7 @@ void CQuadEffect::makeRasters(const TPoint2DVect &poly dest.clear(); const float epsilon = 10E-5f; - sint size = poly.size(); + sint size = (sint)poly.size(); uint aelSize = 0; // size of active edge list sint k; // loop counter diff --git a/code/nel/src/3d/ray_mesh.cpp b/code/nel/src/3d/ray_mesh.cpp index f8eb2b78e..c9176b316 100644 --- a/code/nel/src/3d/ray_mesh.cpp +++ b/code/nel/src/3d/ray_mesh.cpp @@ -41,7 +41,7 @@ template static bool getRayIntersectionT(std::vector &vertices, const std::vector &tris, float &dist2D, float &distZ, bool computeDist2D) { - uint numTris= tris.size()/3; + uint numTris= (uint)tris.size()/3; if(!numTris) return false; @@ -243,7 +243,7 @@ bool CRayMesh::fastIntersect(const NLMISC::CMatrix &worldMatrix, const NLMISC:: // *** Make all points in ray space - uint numVerts= Vertices.size(); + uint numVerts= (uint)Vertices.size(); const CVector *src= &Vertices[0]; // enlarge temp buffer static std::vector meshInRaySpace; diff --git a/code/nel/src/3d/scene.cpp b/code/nel/src/3d/scene.cpp index 4c5e8e8c5..d00229061 100644 --- a/code/nel/src/3d/scene.cpp +++ b/code/nel/src/3d/scene.cpp @@ -840,7 +840,7 @@ void CScene::animate( TGlobalAnimationTime atTime ) //---------------- // First list all current AnimatedLightmaps (for faster vector iteration per ig) - const uint count = _AnimatedLightPtr.size (); + const uint count = (uint)_AnimatedLightPtr.size (); uint i; for (i=0; iinitModel(); // Ensure all the Traversals has enough space for visible list. - ClipTrav.reserveVisibleList(_Models.size()); - AnimDetailTrav.reserveVisibleList(_Models.size()); - LoadBalancingTrav.reserveVisibleList(_Models.size()); - LightTrav.reserveLightedList(_Models.size()); - RenderTrav.reserveRenderList(_Models.size()); + ClipTrav.reserveVisibleList((uint)_Models.size()); + AnimDetailTrav.reserveVisibleList((uint)_Models.size()); + LoadBalancingTrav.reserveVisibleList((uint)_Models.size()); + LightTrav.reserveLightedList((uint)_Models.size()); + RenderTrav.reserveRenderList((uint)_Models.size()); return m; } @@ -1309,9 +1309,9 @@ void CScene::setAutomaticAnimationSet(CAnimationSet *as) cm->setAnimationSet( _AutomaticAnimationSet ); // Add an automatic animation - _AnimatedLight.push_back ( CAnimatedLightmap (_LightGroupColor.size ()) ); + _AnimatedLight.push_back ( CAnimatedLightmap ((uint)_LightGroupColor.size ()) ); _AnimatedLightPtr.push_back ( &_AnimatedLight.back () ); - _AnimatedLightNameToIndex.insert ( std::map::value_type (lightName, _AnimatedLightPtr.size ()-1 ) ); + _AnimatedLightNameToIndex.insert ( std::map::value_type (lightName, (uint32)_AnimatedLightPtr.size ()-1 ) ); CAnimatedLightmap &animLM = _AnimatedLight.back (); animLM.setName( *itSel ); diff --git a/code/nel/src/3d/scene_group.cpp b/code/nel/src/3d/scene_group.cpp index a149e9fb9..5424ec50d 100644 --- a/code/nel/src/3d/scene_group.cpp +++ b/code/nel/src/3d/scene_group.cpp @@ -168,7 +168,7 @@ void CInstanceGroup::CInstance::serial (NLMISC::IStream& f) uint CInstanceGroup::getNumInstance () const { - return _InstancesInfos.size(); + return (uint)_InstancesInfos.size(); } // *************************************************************************** @@ -483,11 +483,11 @@ void CInstanceGroup::serial (NLMISC::IStream& f) uint32 i, j; for (i = 0; i < _ClusterInfos.size(); ++i) { - uint32 nNbPortals = _ClusterInfos[i]._Portals.size(); + uint32 nNbPortals = (uint32)_ClusterInfos[i]._Portals.size(); f.serial (nNbPortals); for (j = 0; j < nNbPortals; ++j) { - sint32 nPortalNb = (_ClusterInfos[i]._Portals[j] - &_Portals[0]); + sint32 nPortalNb = (sint32)(_ClusterInfos[i]._Portals[j] - &_Portals[0]); f.serial (nPortalNb); } } @@ -546,7 +546,7 @@ bool CInstanceGroup::addToScene (CScene& scene, IDriver *driver, uint selectedTe _Instances.resize (_InstancesInfos.size(), NULL); if (_IGAddBeginCallback) - _IGAddBeginCallback->startAddingIG(_InstancesInfos.size()); + _IGAddBeginCallback->startAddingIG((uint)_InstancesInfos.size()); // Creation and positionning of the new instance @@ -740,7 +740,7 @@ bool CInstanceGroup::addToSceneWhenAllShapesLoaded (CScene& scene, IDriver *driv if (_Portals[i]._Clusters[j]) { sint32 nClusterNb; - nClusterNb = (_Portals[i]._Clusters[j] - &_ClusterInfos[0]); + nClusterNb = (sint32)(_Portals[i]._Clusters[j] - &_ClusterInfos[0]); _Portals[i]._Clusters[j] = _ClusterInstances[nClusterNb]; } } @@ -828,7 +828,7 @@ bool CInstanceGroup::addToSceneAsync (CScene& scene, IDriver *driver, uint selec _Instances.resize (_InstancesInfos.size(), NULL); if (_IGAddBeginCallback) - _IGAddBeginCallback->startAddingIG(_InstancesInfos.size()); + _IGAddBeginCallback->startAddingIG((uint)_InstancesInfos.size()); // Creation and positionning of the new instance @@ -1374,14 +1374,14 @@ void CInstanceGroup::displayDebugClusters(IDriver *drv, class CTextContext *tx // count the number of vertices / triangles / lines to add if(poly.Vertices.size()>=3) { - numTotalVertices+= poly.Vertices.size(); + numTotalVertices+= (uint)poly.Vertices.size(); } } // **** count the number of portals vertices for(j=0;j_Portals.size();j++) { - numTotalVertices+= cluster->_Portals[j]->_Poly.size(); + numTotalVertices+= (uint)cluster->_Portals[j]->_Poly.size(); } // **** Draw those cluster polygons, and portals @@ -1436,7 +1436,7 @@ void CInstanceGroup::displayDebugClusters(IDriver *drv, class CTextContext *tx } } - iVert+= poly.Vertices.size(); + iVert+= (uint)poly.Vertices.size(); } } @@ -1489,7 +1489,7 @@ void CInstanceGroup::displayDebugClusters(IDriver *drv, class CTextContext *tx } } - iVert+= portalVerts.size(); + iVert+= (uint)portalVerts.size(); } } diff --git a/code/nel/src/3d/shadow_map_manager.cpp b/code/nel/src/3d/shadow_map_manager.cpp index 36d87ec85..34ab87bcd 100644 --- a/code/nel/src/3d/shadow_map_manager.cpp +++ b/code/nel/src/3d/shadow_map_manager.cpp @@ -308,7 +308,7 @@ void CShadowMapManager::renderGenerate(CScene *scene) // Allow Writing on alpha only. => don't write on RGB objects! driverForShadowGeneration->setColorMask(false, false, false, true); - uint numSC= _GenerateShadowCasters.size(); + uint numSC= (uint)_GenerateShadowCasters.size(); uint baseSC= 0; while(numSC>0) { diff --git a/code/nel/src/3d/shadow_poly_receiver.cpp b/code/nel/src/3d/shadow_poly_receiver.cpp index 02797babd..51acd7037 100644 --- a/code/nel/src/3d/shadow_poly_receiver.cpp +++ b/code/nel/src/3d/shadow_poly_receiver.cpp @@ -59,9 +59,9 @@ uint CShadowPolyReceiver::addTriangle(const NLMISC::CTriangle &tri) if(_FreeTriangles.empty()) { _Triangles.push_back(TTriangleGrid::CIterator()); - id= _Triangles.size()-1; + id= (uint)_Triangles.size()-1; // enlarge render size. - _RenderTriangles.setNumIndexes(_Triangles.size() * 3); + _RenderTriangles.setNumIndexes((uint32)_Triangles.size() * 3); } else { @@ -140,10 +140,10 @@ uint CShadowPolyReceiver::allocateVertex(const CVector &v) { // Add the vertex, and init refCount to 0. _Vertices.push_back(v); - id= _Vertices.size()-1; + id= (uint)_Vertices.size()-1; // Resize the VBuffer at max possible - _VB.setNumVertices(_Vertices.size()); + _VB.setNumVertices((uint32)_Vertices.size()); } else { @@ -223,8 +223,8 @@ inline void CShadowPolyReceiver::renderSelection(IDriver *drv, CMaterial &shadow uint currentTriIdx= 0; { // Volatile: must resize before lock - _VB.setNumVertices(_Vertices.size()); - _RenderTriangles.setNumIndexes(_Triangles.size() * 3); + _VB.setNumVertices((uint32)_Vertices.size()); + _RenderTriangles.setNumIndexes((uint32)_Triangles.size() * 3); // lock volatile, to avoid cpu stall CVertexBufferReadWrite vba; @@ -401,7 +401,7 @@ void CShadowPolyReceiver::computeClippedTrisWithPolyClip(const CShadowMap *shado } } - uint numVisibleTris = visibleTris.size(); + uint numVisibleTris = (uint)visibleTris.size(); // compute normals if needed if (colorUpfacingVertices) { diff --git a/code/nel/src/3d/shadow_skin.cpp b/code/nel/src/3d/shadow_skin.cpp index 3f764236b..340453c49 100644 --- a/code/nel/src/3d/shadow_skin.cpp +++ b/code/nel/src/3d/shadow_skin.cpp @@ -42,7 +42,7 @@ void CShadowSkin::applySkin(CVector *dst, std::vector &boneMat3x4) { if(Vertices.empty()) return; - uint numVerts= Vertices.size(); + uint numVerts= (uint)Vertices.size(); CShadowVertex *src= &Vertices[0]; // Then do the skin diff --git a/code/nel/src/3d/shape_bank.cpp b/code/nel/src/3d/shape_bank.cpp index 7108d1243..387d89a02 100644 --- a/code/nel/src/3d/shape_bank.cpp +++ b/code/nel/src/3d/shape_bank.cpp @@ -712,7 +712,7 @@ sint CShapeBank::getShapeCacheFreeSpace(const std::string &shapeCacheName) const TShapeCacheMap::const_iterator scmIt = ShapeCacheNameToShapeCache.find( shapeCacheName ); if( scmIt != ShapeCacheNameToShapeCache.end() ) { - return scmIt->second.MaxSize - scmIt->second.Elements.size(); + return scmIt->second.MaxSize - (sint)scmIt->second.Elements.size(); } return 0; } diff --git a/code/nel/src/3d/skeleton_model.cpp b/code/nel/src/3d/skeleton_model.cpp index bd1896b4a..f21a67b42 100644 --- a/code/nel/src/3d/skeleton_model.cpp +++ b/code/nel/src/3d/skeleton_model.cpp @@ -807,7 +807,7 @@ void CSkeletonModel::traverseAnimDetail() // must test / update the hierarchy of Bones. // Since they are orderd in depth-first order, we are sure that parent are computed before sons. - uint numBoneToCompute= _BoneToCompute.size(); + uint numBoneToCompute= (uint)_BoneToCompute.size(); CSkeletonModel::CBoneCompute *pBoneCompute= numBoneToCompute? &_BoneToCompute[0] : NULL; // traverse only bones which need to be computed for(;numBoneToCompute>0;numBoneToCompute--, pBoneCompute++) @@ -951,7 +951,7 @@ void CSkeletonModel::computeLodTexture() // Ok, compute influence of this instance on the Lod. // ---- Build all bmps of the instance with help of the asyncTextureManager - uint numMats= mbi->Materials.size(); + uint numMats= (uint)mbi->Materials.size(); // 256 materials possibles for the lod Manager numMats= min(numMats, 256U); // for endTexturecompute diff --git a/code/nel/src/3d/skeleton_shape.cpp b/code/nel/src/3d/skeleton_shape.cpp index a1d60ca36..01ab60fca 100644 --- a/code/nel/src/3d/skeleton_shape.cpp +++ b/code/nel/src/3d/skeleton_shape.cpp @@ -238,7 +238,7 @@ void CSkeletonShape::getAABBox(NLMISC::CAABBox &bbox) const uint CSkeletonShape::getLodForDistance(float dist) const { uint start=0; - uint end= _Lods.size(); + uint end= (uint)_Lods.size(); // find lower_bound by dichotomy while(end-1>start) { diff --git a/code/nel/src/3d/skeleton_spawn_script.cpp b/code/nel/src/3d/skeleton_spawn_script.cpp index 35733084b..6291d846f 100644 --- a/code/nel/src/3d/skeleton_spawn_script.cpp +++ b/code/nel/src/3d/skeleton_spawn_script.cpp @@ -155,7 +155,7 @@ void CSkeletonSpawnScript::parseCache(CScene *scene, CSkeletonModel *skeleton) // Delay the model creation at end of CScene::render() CSSSModelRequest req; req.Skel= skeleton; - req.InstanceId= _Instances.size()-1; + req.InstanceId= (uint)_Instances.size()-1; req.Shape= words[2]; // World Spawned Objects are sticked to the root bone (for CLod hiding behavior) req.BoneId= 0; @@ -211,7 +211,7 @@ void CSkeletonSpawnScript::parseCache(CScene *scene, CSkeletonModel *skeleton) // Delay the model creation at end of CScene::render() CSSSModelRequest req; req.Skel= skeleton; - req.InstanceId= _Instances.size()-1; + req.InstanceId= (uint)_Instances.size()-1; req.Shape= words[2]; req.BoneId= boneId; req.SSSWO= false; diff --git a/code/nel/src/3d/skeleton_weight.cpp b/code/nel/src/3d/skeleton_weight.cpp index c01ad9dbb..cbbd63295 100644 --- a/code/nel/src/3d/skeleton_weight.cpp +++ b/code/nel/src/3d/skeleton_weight.cpp @@ -28,7 +28,7 @@ namespace NL3D uint CSkeletonWeight::getNumNode () const { - return _Elements.size(); + return (uint)_Elements.size(); } // *************************************************************************** diff --git a/code/nel/src/3d/text_context.cpp b/code/nel/src/3d/text_context.cpp index c7e7afba0..32d842a50 100644 --- a/code/nel/src/3d/text_context.cpp +++ b/code/nel/src/3d/text_context.cpp @@ -73,7 +73,7 @@ uint32 CTextContext::textPush (const char *format, ...) _CacheStrings.push_back (csTmp); if (_CacheFreePlaces.size() == 0) _CacheFreePlaces.resize (1); - _CacheFreePlaces[0] = _CacheStrings.size()-1; + _CacheFreePlaces[0] = (uint32)_CacheStrings.size()-1; _CacheNbFreePlaces = 1; } @@ -99,7 +99,7 @@ uint32 CTextContext::textPush (const ucstring &str) _CacheStrings.push_back (csTmp); if (_CacheFreePlaces.size() == 0) _CacheFreePlaces.resize (1); - _CacheFreePlaces[0] = _CacheStrings.size()-1; + _CacheFreePlaces[0] = (uint32)_CacheStrings.size()-1; _CacheNbFreePlaces = 1; } diff --git a/code/nel/src/3d/texture_font.cpp b/code/nel/src/3d/texture_font.cpp index 078782696..0ff997282 100644 --- a/code/nel/src/3d/texture_font.cpp +++ b/code/nel/src/3d/texture_font.cpp @@ -350,7 +350,7 @@ CTextureFont::SLetterInfo* CTextureFont::getLetterInfo (SLetterKey& k) Accel.insert (map::value_type(k.getVal(),Front[cat])); // Invalidate the zone - sint index = (Front[cat] - &Letters[cat][0]);// / sizeof (SLetterInfo); + sint index = (sint)(Front[cat] - &Letters[cat][0]);// / sizeof (SLetterInfo); sint sizex = TextureSizeX / Categories[cat]; sint x = index % sizex; sint y = index / sizex; diff --git a/code/nel/src/3d/texture_near.cpp b/code/nel/src/3d/texture_near.cpp index 2d45edb9f..2b7f555ce 100644 --- a/code/nel/src/3d/texture_near.cpp +++ b/code/nel/src/3d/texture_near.cpp @@ -55,7 +55,7 @@ CTextureNear::CTextureNear(sint size) // *************************************************************************** sint CTextureNear::getNbAvailableTiles() { - return _FreeTiles.size(); + return (sint)_FreeTiles.size(); } // *************************************************************************** uint CTextureNear::getTileAndFillRect(CRGBA map[NL_TILE_LIGHTMAP_SIZE*NL_TILE_LIGHTMAP_SIZE]) diff --git a/code/nel/src/3d/tile_bank.cpp b/code/nel/src/3d/tile_bank.cpp index 779d0133c..0a187ad21 100644 --- a/code/nel/src/3d/tile_bank.cpp +++ b/code/nel/src/3d/tile_bank.cpp @@ -162,7 +162,7 @@ void CTileBank::serial(NLMISC::IStream &f) throw(NLMISC::EStream) // *************************************************************************** sint CTileBank::addLand (const std::string& name) { - sint last=_LandVector.size(); + sint last=(sint)_LandVector.size(); _LandVector.push_back(CTileLand()); _LandVector[last].setName (name); return last; @@ -179,7 +179,7 @@ void CTileBank::removeLand (sint landIndex) // *************************************************************************** sint CTileBank::addTileSet (const std::string& name) { - sint last=_TileSetVector.size(); + sint last=(sint)_TileSetVector.size(); _TileSetVector.push_back(CTileSet()); _TileSetVector[last].setName (name); for (int i=0; i &vegetables) { _VegetableSeed[i]= sumVeget; // add number of vegetable for next seed. - sumVeget+= _VegetableList[i].size(); + sumVeget+= (uint)_VegetableList[i].size(); } // compile some data diff --git a/code/nel/src/3d/track_sampled_common.cpp b/code/nel/src/3d/track_sampled_common.cpp index eaad3f825..3da3f9921 100644 --- a/code/nel/src/3d/track_sampled_common.cpp +++ b/code/nel/src/3d/track_sampled_common.cpp @@ -100,7 +100,7 @@ void CTrackSampledCommon::buildCommon(const std::vector &timeList, float uint i; // reset. - uint numKeys= timeList.size(); + uint numKeys= (uint)timeList.size(); _TimeBlocks.clear(); // Special case of 0 or 1 key. @@ -158,7 +158,7 @@ void CTrackSampledCommon::buildCommon(const std::vector &timeList, float } // Build the timeBlocks. - _TimeBlocks.resize(timeBlockKeyId.size()); + _TimeBlocks.resize((uint32)timeBlockKeyId.size()); for(i=0; i &timeList, const std::ve uint i; // reset. - uint numKeys= keyList.size(); + uint numKeys= (uint)keyList.size(); _Keys.clear(); _TimeBlocks.clear(); @@ -230,7 +230,7 @@ void CTrackSampledQuat::applySampleDivisor(uint sampleDivisor) // **** rebuild the keys NLMISC::CObjectVector newKeys; - newKeys.resize(keepKeys.size()); + newKeys.resize((uint32)keepKeys.size()); for(uint i=0;i &timeList, const std:: uint i; // reset. - uint numKeys= keyList.size(); + uint numKeys= (uint)keyList.size(); _Keys.clear(); _TimeBlocks.clear(); @@ -134,7 +134,7 @@ void CTrackSampledVector::applySampleDivisor(uint sampleDivisor) // **** rebuild the keys NLMISC::CObjectVector newKeys; - newKeys.resize(keepKeys.size()); + newKeys.resize((uint32)keepKeys.size()); for(uint i=0;iParent==parent) diff --git a/code/nel/src/3d/u_instance.cpp b/code/nel/src/3d/u_instance.cpp index 3d3bd8c68..e50d71bf5 100644 --- a/code/nel/src/3d/u_instance.cpp +++ b/code/nel/src/3d/u_instance.cpp @@ -244,7 +244,7 @@ uint UInstance::getNumMaterials() const { CMeshBaseInstance *mi= dynamic_cast(_Object); if(mi) - return mi->Materials.size(); + return (uint)mi->Materials.size(); else return 0; } diff --git a/code/nel/src/3d/u_skeleton.cpp b/code/nel/src/3d/u_skeleton.cpp index e0ae9a032..2d704d9ad 100644 --- a/code/nel/src/3d/u_skeleton.cpp +++ b/code/nel/src/3d/u_skeleton.cpp @@ -161,7 +161,7 @@ uint USkeleton::getNumBones() const { NL3D_HAUTO_UI_SKELETON; CSkeletonModel *object = getObjectPtr(); - return object->Bones.size(); + return (uint)object->Bones.size(); } // *************************************************************************** diff --git a/code/nel/src/3d/vegetable_manager.cpp b/code/nel/src/3d/vegetable_manager.cpp index 85f6c1fdf..656f99dfe 100644 --- a/code/nel/src/3d/vegetable_manager.cpp +++ b/code/nel/src/3d/vegetable_manager.cpp @@ -891,7 +891,7 @@ void CVegetableManager::reserveIgAddInstances(CVegetableInstanceGroupReserve & // Reserve space in the rdrPass. vegetRdrPass.NVertices+= numInstances * shape->VB.getNumVertices(); - vegetRdrPass.NTriangles+= numInstances * shape->TriangleIndices.size()/3; + vegetRdrPass.NTriangles+= numInstances * (uint)shape->TriangleIndices.size()/3; // if the instances are lighted, reserve space for lighting updates if(instanceLighted) vegetRdrPass.NLightedInstances+= numInstances; @@ -1206,8 +1206,8 @@ void CVegetableManager::addInstance(CVegetableInstanceGroup *ig, // Vertex/triangle Info. uint numNewVertices= shape->VB.getNumVertices(); - uint numNewTris= shape->TriangleIndices.size()/3; - uint numNewIndices= shape->TriangleIndices.size(); + uint numNewTris= (uint)shape->TriangleIndices.size()/3; + uint numNewIndices= (uint)shape->TriangleIndices.size(); // src info. uint srcNormalOff= (instanceLighted? shape->VB.getNormalOff() : 0); @@ -2519,7 +2519,7 @@ uint CVegetableManager::updateInstanceLighting(CVegetableInstanceGroup *ig, uin CMatrix &normalMat= vegetLI.NormalMat; // array of vertex id to update uint32 *ptrVid= vegetRdrPass.Vertices.getPtr() + vegetLI.StartIdInRdrPass; - uint numVertices= shape->InstanceVertices.size(); + uint numVertices= (uint)shape->InstanceVertices.size(); // Copy Dynamic Lightmap UV in Alpha part (save memory for an extra cost of 1 VP instruction) primaryRGBA.A= vegetLI.DlmUV.U; diff --git a/code/nel/src/3d/vegetablevb_allocator.cpp b/code/nel/src/3d/vegetablevb_allocator.cpp index 8bb781a3b..b36df6918 100644 --- a/code/nel/src/3d/vegetablevb_allocator.cpp +++ b/code/nel/src/3d/vegetablevb_allocator.cpp @@ -170,7 +170,7 @@ void CVegetableVBAllocator::unlockBuffer() uint CVegetableVBAllocator::getNumUserVerticesAllocated() const { // get the number of vertices which are allocated by allocateVertex(). - return _NumVerticesAllocated - _VertexFreeMemory.size(); + return _NumVerticesAllocated - (uint)_VertexFreeMemory.size(); } // *************************************************************************** diff --git a/code/nel/src/3d/vertex_buffer.cpp b/code/nel/src/3d/vertex_buffer.cpp index c52ab0622..42d271c03 100644 --- a/code/nel/src/3d/vertex_buffer.cpp +++ b/code/nel/src/3d/vertex_buffer.cpp @@ -463,7 +463,7 @@ void CVertexBuffer::initEx () // Compute new capacity if (_VertexSize) - _Capacity = _NonResidentVertices.size()/_VertexSize; + _Capacity = (uint32)_NonResidentVertices.size()/_VertexSize; else _Capacity = 0; diff --git a/code/nel/src/3d/visual_collision_entity.cpp b/code/nel/src/3d/visual_collision_entity.cpp index ef719c23a..625f87c2e 100644 --- a/code/nel/src/3d/visual_collision_entity.cpp +++ b/code/nel/src/3d/visual_collision_entity.cpp @@ -149,7 +149,7 @@ CTrianglePatch *CVisualCollisionEntity::getPatchTriangleUnderUs(const CVector & CPatchQuadBlock &qb= *_PatchQuadBlocks[qbId]; // Build the 2 triangles of this tile Id. - sint idStart= testTriangles.size(); + sint idStart= (sint)testTriangles.size(); testTriangles.resize(idStart+2); qb.buildTileTriangles((uint8)ptr->QuadId, &testTriangles[idStart]); diff --git a/code/nel/src/3d/visual_collision_mesh.cpp b/code/nel/src/3d/visual_collision_mesh.cpp index fb2f82bd9..22984f3ff 100644 --- a/code/nel/src/3d/visual_collision_mesh.cpp +++ b/code/nel/src/3d/visual_collision_mesh.cpp @@ -276,7 +276,7 @@ bool CVisualCollisionMesh::build(const std::vector &vertices, const localBBox.extend(vertices[i]); // Build the Static Grid - uint numTris= triangles.size()/3; + uint numTris= (uint)triangles.size()/3; _QuadGrid.create(16, numTris, localBBox); // Add all triangles for(i=0;i gives grid cells that must be clipped to fit the shape boundaries // Make sure that rasters array for inside has the same size that raster array for borders (by inserting NULL rasters) - sint height = border.size(); + sint height = (sint)border.size(); if (_Inside.empty()) { _MinYInside = minYBorder; } - sint bottomGap = border.size() - _Inside.size(); + sint bottomGap = (sint)(border.size() - _Inside.size()); _Inside.resize(height); nlassert(minYBorder == _MinYInside); @@ -1285,7 +1285,7 @@ uint CWaterModel::getNumWantedVertices() const CVector2f *prevVert = &projPoly.Vertices.back(); const CVector2f *currVert = &projPoly.Vertices.front(); - uint numVerts = projPoly.Vertices.size(); + uint numVerts = (uint)projPoly.Vertices.size(); bool ccw = projPoly.isCCWOriented(); clipPlanes.resize(numVerts); for(uint k = 0; k < numVerts; ++k) @@ -1324,11 +1324,11 @@ uint CWaterModel::getNumWantedVertices() if (!clipPoly.Vertices.empty()) { // backup result (will be unprojected later) - _ClippedTriNumVerts.push_back(clipPoly.Vertices.size()); - uint prevSize = _ClippedTris.size(); + _ClippedTriNumVerts.push_back((uint)clipPoly.Vertices.size()); + uint prevSize = (uint)_ClippedTris.size(); _ClippedTris.resize(_ClippedTris.size() + clipPoly.Vertices.size()); std::copy(clipPoly.Vertices.begin(), clipPoly.Vertices.end(), _ClippedTris.begin() + prevSize); // append to packed list - totalNumVertices += (clipPoly.Vertices.size() - 2) * 3; + totalNumVertices += ((uint)clipPoly.Vertices.size() - 2) * 3; } } // middle block, are not clipped, but count the number of wanted vertices @@ -1348,11 +1348,11 @@ uint CWaterModel::getNumWantedVertices() if (!clipPoly.Vertices.empty()) { // backup result (will be unprojected later) - _ClippedTriNumVerts.push_back(clipPoly.Vertices.size()); - uint prevSize = _ClippedTris.size(); + _ClippedTriNumVerts.push_back((uint)clipPoly.Vertices.size()); + uint prevSize = (uint)_ClippedTris.size(); _ClippedTris.resize(_ClippedTris.size() + clipPoly.Vertices.size()); std::copy(clipPoly.Vertices.begin(), clipPoly.Vertices.end(), _ClippedTris.begin() + prevSize); // append to packed list - totalNumVertices += (clipPoly.Vertices.size() - 2) * 3; + totalNumVertices += ((uint)clipPoly.Vertices.size() - 2) * 3; } } } @@ -1512,7 +1512,7 @@ uint CWaterModel::fillVBSoft(void *datas, uint startTri) } } nlassert((dest - (uint8 * ) datas) % (3 * WATER_VERTEX_SOFT_SIZE) == 0); - uint endTri = (dest - (uint8 * ) datas) / (3 * WATER_VERTEX_SOFT_SIZE); + uint endTri = (uint)(dest - (uint8 * ) datas) / (3 * WATER_VERTEX_SOFT_SIZE); _NumTris = endTri - _StartTri; return endTri; } @@ -1600,7 +1600,7 @@ uint CWaterModel::fillVBHard(void *datas, uint startTri) } } nlassert((dest - (uint8 * ) datas) % (3 * WATER_VERTEX_HARD_SIZE) == 0); - uint endTri = (dest - (uint8 * ) datas) / (3 * WATER_VERTEX_HARD_SIZE); + uint endTri = (uint)(dest - (uint8 * ) datas) / (3 * WATER_VERTEX_HARD_SIZE); _NumTris = endTri - _StartTri; return endTri; } diff --git a/code/nel/src/3d/water_pool_manager.cpp b/code/nel/src/3d/water_pool_manager.cpp index 969bab32b..4babd29f7 100644 --- a/code/nel/src/3d/water_pool_manager.cpp +++ b/code/nel/src/3d/water_pool_manager.cpp @@ -187,7 +187,7 @@ bool CWaterPoolManager::isWaterShapeObserver(const CWaterShape *shape) const uint CWaterPoolManager::getNumPools() const { - return _PoolMap.size(); + return (uint)_PoolMap.size(); } //=============================================================================================== @@ -219,7 +219,7 @@ void CWaterPoolManager::serial(NLMISC::IStream &f) throw(NLMISC::EStream) TPoolMap::iterator it; if (!f.isReading()) { - size = _PoolMap.size(); + size = (uint32)_PoolMap.size(); it = _PoolMap.begin(); } else diff --git a/code/nel/src/3d/zone.cpp b/code/nel/src/3d/zone.cpp index 579aa5d2e..ef43668b8 100644 --- a/code/nel/src/3d/zone.cpp +++ b/code/nel/src/3d/zone.cpp @@ -230,8 +230,8 @@ void CZone::build(const CZoneInfo &zoneInfo, uint32 numVertices) NumVertices= max((uint32)NumVertices, numVertices); // Init the Clip Arrays - _PatchRenderClipped.resize(Patchs.size()); - _PatchOldRenderClipped.resize(Patchs.size()); + _PatchRenderClipped.resize((uint)Patchs.size()); + _PatchOldRenderClipped.resize((uint)Patchs.size()); _PatchRenderClipped.setAll(); _PatchOldRenderClipped.setAll(); @@ -373,8 +373,8 @@ void CZone::build(const CZone &zone) PatchConnects= zone.PatchConnects; // Init the Clip Arrays - _PatchRenderClipped.resize(Patchs.size()); - _PatchOldRenderClipped.resize(Patchs.size()); + _PatchRenderClipped.resize((uint)Patchs.size()); + _PatchOldRenderClipped.resize((uint)Patchs.size()); _PatchRenderClipped.setAll(); _PatchOldRenderClipped.setAll(); @@ -488,8 +488,8 @@ void CZone::serial(NLMISC::IStream &f) // If read, must create and init Patch Clipped state to true (clipped even if not compiled) if(f.isReading()) { - _PatchRenderClipped.resize(Patchs.size()); - _PatchOldRenderClipped.resize(Patchs.size()); + _PatchRenderClipped.resize((uint)Patchs.size()); + _PatchOldRenderClipped.resize((uint)Patchs.size()); _PatchRenderClipped.setAll(); _PatchOldRenderClipped.setAll(); } @@ -999,7 +999,7 @@ void CZone::clip(const std::vector &pyramid) // get BitSet as Raw Array of uint32 uint32 *oldRenderClip= const_cast(&_PatchOldRenderClipped.getVector()[0]); const uint32 *newRenderClip= &_PatchRenderClipped.getVector()[0]; - uint numPatchs= Patchs.size(); + uint numPatchs= (uint)Patchs.size(); // Then, we must test by patch. for(uint i=0;i &patchInfo, NL3D::CZoneSymmetrisation &zoneSymmetry, const NL3D::CTileBank &bank, bool symmetry, uint rotate, float snapCell, float weldThreshold, const NLMISC::CMatrix &toOriginalSpace) { - uint patchCount = patchInfo.size (); + uint patchCount = (uint)patchInfo.size (); uint i; // --- Export tile info Symmetry of the bind info. diff --git a/code/nel/src/3d/zone_lighter.cpp b/code/nel/src/3d/zone_lighter.cpp index 982c6df7d..7c23c6f5c 100644 --- a/code/nel/src/3d/zone_lighter.cpp +++ b/code/nel/src/3d/zone_lighter.cpp @@ -970,7 +970,7 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight CVector center = zoneBB.getCenter (); // *** Compute planes - const uint size=obstacles.size(); + const uint size=(uint)obstacles.size(); uint triangleId; for (triangleId=0; triangleIdobstacles.size ()) - lastTriangle=obstacles.size (); + lastTriangle=(uint)obstacles.size (); // Create a thread CRenderZBuffer *runnable = new CRenderZBuffer (process, this, &description, firstTriangle, lastTriangle - firstTriangle, &obstacles); @@ -1132,7 +1132,7 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight pZone->retrieve (_PatchInfo, _BorderVertices); // Number of patch - uint patchCount=_PatchInfo.size(); + uint patchCount=(uint)_PatchInfo.size(); // Bit array to know if the lumel is shadowed if (description.Shadow) @@ -1150,7 +1150,7 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight } // Number of patch - uint patchCount=_PatchInfo.size(); + uint patchCount=(uint)_PatchInfo.size(); // Reset patch count { @@ -1294,7 +1294,7 @@ void CZoneLighter::processCalc (uint process, const CLightDesc& description) std::vector &lumels=_Lumels[patch]; // Lumel count - uint lumelCount=lumels.size(); + uint lumelCount=(uint)lumels.size(); CPatchInfo &patchInfo=_PatchInfo[patch]; nlassert (patchInfo.Lumels.size()==lumelCount); @@ -1315,7 +1315,7 @@ void CZoneLighter::processCalc (uint process, const CLightDesc& description) std::vector &lumels=_Lumels[patch]; // Lumel count - uint lumelCount=lumels.size(); + uint lumelCount=(uint)lumels.size(); CPatchInfo &patchInfo=_PatchInfo[patch]; nlassert (patchInfo.Lumels.size()==lumelCount); @@ -1613,7 +1613,7 @@ void CZoneLighter::addTriangles (CLandscape &landscape, vector &listZone, landscape.getTessellationLeaves(leaves); // Number of leaves - uint leavesCount=leaves.size(); + uint leavesCount=(uint)leaves.size(); // Reserve the array triangleArray.reserve (triangleArray.size()+leavesCount); @@ -1997,7 +1997,7 @@ void CZoneLighter::buildZoneInformation (CLandscape &landscape, const vector > visited; // Zone count - uint zoneCount=listZone.size(); + uint zoneCount=(uint)listZone.size(); // Resize arries _Locator.resize (zoneCount); @@ -2164,7 +2164,7 @@ void CZoneLighter::buildZoneInformation (CLandscape &landscape, const vector obstacleGrid; obstacleGrid.create(gridSize, gridCellSize); - uint size= obstacles.size(); + uint size= (uint)obstacles.size(); for(i=0; i::iterator it = tessFaces.begin(); it != tessFaces.end(); ++it, ++triCount) @@ -3673,7 +3673,7 @@ void CZoneLighter::computeTileFlagsForPositionTowardWater(const CLightDesc &ligh NLMISC::CPolygon2D tilePoly; tilePoly.Vertices.resize(4); - uint tileCount = 0, totalTileCount = tiles.size(); + uint tileCount = 0, totalTileCount = (uint)tiles.size(); for (TTileOfPatchMap::iterator tileIt = tiles.begin(); tileIt != tiles.end(); ++tileIt, ++tileCount) { diff --git a/code/nel/src/georges/form.cpp b/code/nel/src/georges/form.cpp index 4e6da4b5b..407a94cfd 100644 --- a/code/nel/src/georges/form.cpp +++ b/code/nel/src/georges/form.cpp @@ -320,7 +320,7 @@ const std::string &CForm::getParentFilename (uint parent) const uint CForm::getParentCount () const { - return ParentList.size (); + return (uint)ParentList.size (); } // *************************************************************************** diff --git a/code/nel/src/georges/form_dfn.cpp b/code/nel/src/georges/form_dfn.cpp index a973ed73e..6f9cc42f5 100644 --- a/code/nel/src/georges/form_dfn.cpp +++ b/code/nel/src/georges/form_dfn.cpp @@ -390,7 +390,7 @@ void CFormDfn::getParentDfn (std::vector &array, uint32 round) uint CFormDfn::getNumParent () const { - return Parents.size (); + return (uint)Parents.size (); } // *************************************************************************** @@ -411,7 +411,7 @@ const string& CFormDfn::getParentFilename (uint parent) const uint CFormDfn::getNumEntry () const { - return Entries.size(); + return (uint)Entries.size(); } // *************************************************************************** @@ -586,11 +586,11 @@ CFormDfn *CFormDfn::getSubDfn (uint index, uint &dfnIndex) // For each parent uint dfn; dfnIndex = index; - uint parentSize = parentDfn.size(); + uint parentSize = (uint)parentDfn.size(); for (dfn=0; dfnEntries.size (); + uint size = (uint)parentDfn[dfn]->Entries.size (); if (dfnIndexEntries.size (); + uint size = (uint)parentDfn[dfn]->Entries.size (); if (dfnIndex=0) { CEntry *entryPtr=&Entries[entryIndex]; @@ -783,7 +783,7 @@ bool CFormDfn::getEntryType (uint entry, UType **type) uint CFormDfn::getNumParents () const { - return Parents.size (); + return (uint)Parents.size (); } // *************************************************************************** diff --git a/code/nel/src/georges/form_elm.cpp b/code/nel/src/georges/form_elm.cpp index 37cbd7ae7..0f6cfaa65 100644 --- a/code/nel/src/georges/form_elm.cpp +++ b/code/nel/src/georges/form_elm.cpp @@ -1153,7 +1153,7 @@ bool CFormElm::getInternalNodeByName (CForm *form, const char *name, const CForm // The array pointer CFormElmArray *array = safe_cast(*node); - uint oldSize = array->Elements.size (); + uint oldSize = (uint)array->Elements.size (); array->Elements.resize (arrayIndex+1); // Insert empty element @@ -1358,7 +1358,7 @@ exit:; // Get the path name string formName; backupFirstElm->getFormName (formName); - uint formNameSize = formName.size (); + uint formNameSize = (uint)formName.size (); if ((formNameSize > 0) && (formName[formNameSize-1] != '.') && (formName[formNameSize-1] != '[')) formName += "."; formName += name; @@ -1712,7 +1712,7 @@ bool CFormElmStruct::isStruct () const bool CFormElmStruct::getStructSize (uint &size) const { - size = Elements.size(); + size = (uint)Elements.size(); return true; } @@ -2275,7 +2275,7 @@ bool CFormElmArray::isArray () const bool CFormElmArray::getArraySize (uint &size) const { - size = Elements.size (); + size = (uint)Elements.size (); return true; } diff --git a/code/nel/src/georges/type.cpp b/code/nel/src/georges/type.cpp index 3eb5fc347..c120df9a8 100644 --- a/code/nel/src/georges/type.cpp +++ b/code/nel/src/georges/type.cpp @@ -340,7 +340,7 @@ public: // While the filename as a number sint i; - for (i=filename.size ()-1; i>=0; i--) + for (i=(sint)filename.size ()-1; i>=0; i--) { if ((filename[i]<'0') || (filename[i]>'9')) break; @@ -575,7 +575,7 @@ bool CType::getValue (string &result, const CForm *form, const CFormElmAtom *nod { // Evaluate predefinition uint i; - uint predefCount = Definitions.size (); + uint predefCount = (uint)Definitions.size (); for (i=0; igetFilename ().c_str (), "getValue", "Missing closing quote\n%s\n%s", result.c_str (), msg); return false; } @@ -702,7 +702,7 @@ bool CType::getValue (string &result, const CForm *form, const CFormElmAtom *nod { // Build a nice error output in warning char msg[512]; - buildError (msg, result.size ()); + buildError (msg, (uint)result.size ()); warning (false, formName, form->getFilename ().c_str (), "getValue", "Missing double quote\n%s\n%s", result.c_str (), msg); return false; } @@ -757,7 +757,7 @@ bool CType::getValue (string &result, const CForm *form, const CFormElmAtom *nod { // Evaluate predefinition uint i; - uint predefCount = Definitions.size (); + uint predefCount = (uint)Definitions.size (); for (i=0; i::iterator first(_Properties.begin()), last(_Properties.end()); for (; first != last; ++first) @@ -1100,7 +1100,7 @@ void IPrimitive::serial (NLMISC::IStream &f) void IPrimitive::updateChildId (uint index) { uint i; - uint count = _Children.size (); + uint count = (uint)_Children.size (); for (i=index; i_ChildId = i; } @@ -1598,7 +1598,7 @@ bool IPrimitive::insertChild (IPrimitive *primitive, uint index) { // At the end ? if (index == AtTheEnd) - index = _Children.size (); + index = (uint)_Children.size (); // Index valid ? if (index>_Children.size ()) @@ -1854,7 +1854,7 @@ void IPrimitive::initDefaultValues (CLigoConfig &config) if (primitiveClass) { // For each properties - uint count = primitiveClass->Parameters.size (); + uint count = (uint)primitiveClass->Parameters.size (); uint i; for (i=0; i &pairs = matchGroup.Pairs[rules]; diff --git a/code/nel/src/ligo/zone_edge.cpp b/code/nel/src/ligo/zone_edge.cpp index 8adfba0d0..235ba0880 100644 --- a/code/nel/src/ligo/zone_edge.cpp +++ b/code/nel/src/ligo/zone_edge.cpp @@ -53,7 +53,7 @@ bool CZoneEdge::build (const std::vector &theEdge, const std::v } // Check last position - uint lastIndex = theEdge.size()-1; + uint lastIndex = (uint)theEdge.size()-1; toCheck = CVector (theEdge[lastIndex].x, theEdge[lastIndex].y, 0); if (((toCheck-CVector (config.CellSize, 0, 0)).norm())>config.Snap) { diff --git a/code/nel/src/ligo/zone_edge.h b/code/nel/src/ligo/zone_edge.h index 661977f91..1a433b781 100644 --- a/code/nel/src/ligo/zone_edge.h +++ b/code/nel/src/ligo/zone_edge.h @@ -64,7 +64,7 @@ public: void invert (const CLigoConfig &config); /// Return the vertex count - uint getNumVertex () const { return _TheEdge.size(); } + uint getNumVertex () const { return (uint)_TheEdge.size(); } /// Return the vertex const NLMISC::CVector& getVertex (uint id) const { return _TheEdge[id]; } diff --git a/code/nel/src/ligo/zone_template.cpp b/code/nel/src/ligo/zone_template.cpp index feca42e44..a42ae50aa 100644 --- a/code/nel/src/ligo/zone_template.cpp +++ b/code/nel/src/ligo/zone_template.cpp @@ -104,7 +104,7 @@ bool CZoneTemplate::build (const std::vector &vertices, const s vector boundaryFlags; // Vertices count - uint vertexCount = vertices.size(); + uint vertexCount = (uint)vertices.size(); // Resize the array boundaryFlags.resize (vertexCount, 0); @@ -131,7 +131,7 @@ bool CZoneTemplate::build (const std::vector &vertices, const s multimap edgePairReverse; // Index count - uint edgeCount = indexes.size(); + uint edgeCount = (uint)indexes.size(); // For each vertices uint edge; diff --git a/code/nel/src/logic/logic_state_machine.cpp b/code/nel/src/logic/logic_state_machine.cpp index 092c90263..dd4166bdb 100644 --- a/code/nel/src/logic/logic_state_machine.cpp +++ b/code/nel/src/logic/logic_state_machine.cpp @@ -504,7 +504,7 @@ bool testNameWithFilter( sint8 filter, string motif, string varName ) // *xxx case 1 : { - sint beginIndex = varName.size() - motif.size() - 1; + sint beginIndex = (sint)(varName.size() - motif.size() - 1); string endOfVarName = varName.substr(beginIndex,motif.size()); if( endOfVarName == motif ) { diff --git a/code/nel/src/misc/big_file.cpp b/code/nel/src/misc/big_file.cpp index 96b585e36..d6f9a41bd 100644 --- a/code/nel/src/misc/big_file.cpp +++ b/code/nel/src/misc/big_file.cpp @@ -226,7 +226,7 @@ bool CBigFile::add (const std::string &sBigFileName, uint32 nOptions) map::iterator it = tempMap.begin(); while (it != tempMap.end()) { - nSize += it->first.size() + 1; + nSize += (uint)it->first.size() + 1; nNb++; it++; } @@ -246,7 +246,7 @@ bool CBigFile::add (const std::string &sBigFileName, uint32 nOptions) bnp.Files[nNb].Size = it->second.Size; bnp.Files[nNb].Pos = it->second.Pos; - nSize += it->first.size() + 1; + nSize += (uint)it->first.size() + 1; nNb++; it++; } diff --git a/code/nel/src/misc/bit_mem_stream.cpp b/code/nel/src/misc/bit_mem_stream.cpp index 4e21fa6eb..2ce0e9fd0 100644 --- a/code/nel/src/misc/bit_mem_stream.cpp +++ b/code/nel/src/misc/bit_mem_stream.cpp @@ -515,7 +515,7 @@ void CBitMemStream::serial(std::string &b) } else { - len = b.size(); + len = (uint32)b.size(); if (len>1000000) throw NLMISC::EInvalidDataStream( "BMS: Trying to write a string of %u bytes", len ); serial( len ); @@ -556,7 +556,7 @@ inline void CBitMemStream::serial(ucstring &b) } else { - len= b.size(); + len= (uint32)b.size(); if (len>1000000) throw NLMISC::EInvalidDataStream( "BMS: Trying to write an ucstring of %u bytes", len ); serial(len); @@ -664,7 +664,7 @@ void CBitMemStream::serialCont(std::vector &cont) } else { - len= cont.size(); + len= (sint32)cont.size(); serial(len); std::vector::iterator it= cont.begin(); diff --git a/code/nel/src/misc/bitmap_png.cpp b/code/nel/src/misc/bitmap_png.cpp index d98c1106e..a73e161ce 100644 --- a/code/nel/src/misc/bitmap_png.cpp +++ b/code/nel/src/misc/bitmap_png.cpp @@ -132,7 +132,7 @@ uint8 CBitmap::readPNG( NLMISC::IStream &f ) // at this point, the image must be converted to an 24bit image RGB // rowbytes is the width x number of channels - uint32 rowbytes = png_get_rowbytes(png_ptr, info_ptr); + uint32 rowbytes = (uint32)png_get_rowbytes(png_ptr, info_ptr); uint32 srcChannels = png_get_channels(png_ptr, info_ptr); // allocates buffer to copy image data @@ -326,7 +326,7 @@ bool CBitmap::writePNG( NLMISC::IStream &f, uint32 d) png_set_packing(png_ptr); // rowbytes is the width x number of channels - uint32 rowbytes = png_get_rowbytes(png_ptr, info_ptr); + uint32 rowbytes = (uint32)png_get_rowbytes(png_ptr, info_ptr); uint32 dstChannels = png_get_channels(png_ptr, info_ptr); // get channels number of bitmap diff --git a/code/nel/src/misc/buf_fifo.cpp b/code/nel/src/misc/buf_fifo.cpp index d96cf8ebd..5c6624213 100644 --- a/code/nel/src/misc/buf_fifo.cpp +++ b/code/nel/src/misc/buf_fifo.cpp @@ -118,7 +118,7 @@ void CBufFIFO::push(const std::vector &buffer1, const std::vector TTicks before = CTime::getPerformanceTime(); #endif - TFifoSize s = buffer1.size() + buffer2.size(); + TFifoSize s = (TFifoSize)(buffer1.size() + buffer2.size()); #if DEBUG_FIFO nldebug("%p push2(%d)", this, s); @@ -421,16 +421,16 @@ uint32 CBufFIFO::size () if (_Rewinder == NULL) return _BufferSize; else - return _Rewinder - _Buffer; + return (uint32)(_Rewinder - _Buffer); } else if (_Head > _Tail) { - return _Head - _Tail; + return (uint32)(_Head - _Tail); } else if (_Head < _Tail) { nlassert (_Rewinder != NULL); - return (_Rewinder - _Tail) + (_Head - _Buffer); + return (uint32)((_Rewinder - _Tail) + (_Head - _Buffer)); } nlstop; return 0; @@ -489,9 +489,9 @@ void CBufFIFO::resize (uint32 s) { nlassert (_Rewinder != NULL); - uint size1 = _Rewinder - _Tail; + uint size1 = (uint)(_Rewinder - _Tail); CFastMem::memcpy (NewBuffer, _Tail, size1); - uint size2 = _Head - _Buffer; + uint size2 = (uint)(_Head - _Buffer); CFastMem::memcpy (NewBuffer + size1, _Buffer, size2); nlassert (size1+size2==UsedSize); @@ -582,7 +582,7 @@ void CBufFIFO::display () { if (strlen(str) < 1023) { - uint32 p = strlen(str); + uint32 p = (uint32)strlen(str); if (isprint(*pos)) str[p] = *pos; else diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 55b50a219..8edb75057 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -107,12 +107,12 @@ void nlSleep( uint32 ms ) /* * Returns Thread Id (note: on Linux, Process Id is the same as the Thread Id) */ -uint getThreadId() +size_t getThreadId() { #ifdef NL_OS_WINDOWS return GetCurrentThreadId(); #elif defined NL_OS_UNIX - return uint(pthread_self()); + return size_t(pthread_self()); // doesnt work on linux kernel 2.6 return getpid(); #endif @@ -128,7 +128,7 @@ string stringFromVector( const vector& v, bool limited ) if (!v.empty()) { - int size = v.size (); + int size = (int)v.size (); if (limited && size > 1000) { string middle = "......"; diff --git a/code/nel/src/misc/config_file/config_file.cpp b/code/nel/src/misc/config_file/config_file.cpp index ccade2081..2351a58f7 100644 --- a/code/nel/src/misc/config_file/config_file.cpp +++ b/code/nel/src/misc/config_file/config_file.cpp @@ -56,13 +56,13 @@ int CConfigFile::CVar::asInt (int index) const switch (Type) { case T_STRING: - if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, StrValues.size (), index); + if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, (int)StrValues.size (), index); return atoi(StrValues[index].c_str()); case T_REAL: - if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, RealValues.size (), index); + if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, (int)RealValues.size (), index); return (int)RealValues[index]; default: - if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, IntValues.size (), index); + if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, (int)IntValues.size (), index); return IntValues[index]; } } @@ -73,13 +73,13 @@ double CConfigFile::CVar::asDouble (int index) const switch (Type) { case T_INT: - if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, IntValues.size (), index); + if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, (int)IntValues.size (), index); return (double)IntValues[index]; case T_STRING: - if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, StrValues.size (), index); + if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, (int)StrValues.size (), index); return atof(StrValues[index].c_str()); default: - if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, RealValues.size (), index); + if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, (int)RealValues.size (), index); return RealValues[index]; } } @@ -95,13 +95,13 @@ std::string CConfigFile::CVar::asString (int index) const switch (Type) { case T_INT: - if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, IntValues.size (), index); + if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, (int)IntValues.size (), index); return toString(IntValues[index]); case T_REAL: - if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, RealValues.size (), index); + if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, (int)RealValues.size (), index); return toString(RealValues[index]); default: - if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, StrValues.size (), index); + if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, (int)StrValues.size (), index); return StrValues[index]; } } @@ -111,7 +111,7 @@ bool CConfigFile::CVar::asBool (int index) const switch (Type) { case T_STRING: - if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, StrValues.size (), index); + if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, (int)StrValues.size (), index); if(StrValues[index] == "true") { return true; @@ -121,7 +121,7 @@ bool CConfigFile::CVar::asBool (int index) const return false; } case T_REAL: - if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, RealValues.size (), index); + if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, (int)RealValues.size (), index); if ((int)RealValues[index] == 1) { return true; @@ -131,7 +131,7 @@ bool CConfigFile::CVar::asBool (int index) const return false; } default: - if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, IntValues.size (), index); + if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, (int)IntValues.size (), index); if (IntValues[index] == 1) { return true; @@ -146,7 +146,7 @@ bool CConfigFile::CVar::asBool (int index) const void CConfigFile::CVar::setAsInt (int val, int index) { if (Type != T_INT) throw EBadType (Name, Type, T_INT); - else if (index > (int)IntValues.size () || index < 0) throw EBadSize (Name, IntValues.size (), index); + else if (index > (int)IntValues.size () || index < 0) throw EBadSize (Name, (int)IntValues.size (), index); else if (index == (int)IntValues.size ()) IntValues.push_back(val); else IntValues[index] = val; Root = false; @@ -155,7 +155,7 @@ void CConfigFile::CVar::setAsInt (int val, int index) void CConfigFile::CVar::setAsDouble (double val, int index) { if (Type != T_REAL) throw EBadType (Name, Type, T_REAL); - else if (index > (int)RealValues.size () || index < 0) throw EBadSize (Name, RealValues.size (), index); + else if (index > (int)RealValues.size () || index < 0) throw EBadSize (Name, (int)RealValues.size (), index); else if (index == (int)RealValues.size ()) RealValues.push_back(val); else RealValues[index] = val; Root = false; @@ -169,7 +169,7 @@ void CConfigFile::CVar::setAsFloat (float val, int index) void CConfigFile::CVar::setAsString (const std::string &val, int index) { if (Type != T_STRING) throw EBadType (Name, Type, T_STRING); - else if (index > (int)StrValues.size () || index < 0) throw EBadSize (Name, StrValues.size (), index); + else if (index > (int)StrValues.size () || index < 0) throw EBadSize (Name, (int)StrValues.size (), index); else if (index == (int)StrValues.size ()) StrValues.push_back(val); else StrValues[index] = val; Root = false; @@ -277,9 +277,9 @@ uint CConfigFile::CVar::size () const { switch (Type) { - case T_INT: return IntValues.size (); - case T_REAL: return RealValues.size (); - case T_STRING: return StrValues.size (); + case T_INT: return (uint)IntValues.size (); + case T_REAL: return (uint)RealValues.size (); + case T_STRING: return (uint)StrValues.size (); default: return 0; } } @@ -356,7 +356,7 @@ bool CConfigFile::loaded() uint32 CConfigFile::getVarCount() { - return _Vars.size(); + return (uint32)_Vars.size(); } @@ -396,7 +396,7 @@ void CConfigFile::reparse (bool lookupPaths) string utf8 = content.toUtf8(); CMemStream stream; - stream.serialBuffer((uint8*)(utf8.data()), utf8.size()); + stream.serialBuffer((uint8*)(utf8.data()), (uint)utf8.size()); cf_ifile = stream; if (!cf_ifile.isReading()) { @@ -856,7 +856,7 @@ void CConfigFile::clearVars () uint CConfigFile::getNumVar () const { - return _Vars.size (); + return (uint)_Vars.size (); } CConfigFile::CVar *CConfigFile::getVar (uint varId) diff --git a/code/nel/src/misc/debug.cpp b/code/nel/src/misc/debug.cpp index b8054d20a..c3e5b1151 100644 --- a/code/nel/src/misc/debug.cpp +++ b/code/nel/src/misc/debug.cpp @@ -449,7 +449,7 @@ public: { string shortExc, longExc, subject; string addr, ext; - sint skipNFirst = 0; + ULONG_PTR skipNFirst = 0; _Reason = ""; if (m_pexp == NULL) @@ -555,7 +555,7 @@ public: } // display the callstack - void addStackAndLogToReason (sint /* skipNFirst */ = 0) + void addStackAndLogToReason (ULONG_PTR /* skipNFirst */ = 0) { #ifdef NL_OS_WINDOWS // ace hack diff --git a/code/nel/src/misc/di_game_device.cpp b/code/nel/src/misc/di_game_device.cpp index 624994a39..e13b733e8 100644 --- a/code/nel/src/misc/di_game_device.cpp +++ b/code/nel/src/misc/di_game_device.cpp @@ -366,7 +366,7 @@ BOOL CDIGameDevice::processEnumObject(LPCDIDEVICEOBJECTINSTANCE lpddoi) if (_Buttons.size() < MaxNumButtons) { _Buttons.push_back(CButton()); - uint buttonIndex = _Buttons.size() - 1; + uint buttonIndex = (uint)_Buttons.size() - 1; char defaultButtonName[32]; smprintf(defaultButtonName, 32, "BUTTON %d", buttonIndex + 1); BuildCtrlName(lpddoi, _Buttons[buttonIndex].Name, defaultButtonName); @@ -382,7 +382,7 @@ BOOL CDIGameDevice::processEnumObject(LPCDIDEVICEOBJECTINSTANCE lpddoi) if (_Sliders.size() < MaxNumSliders) { _Sliders.push_back(CSlider()); - uint sliderIndex = _Sliders.size() - 1; + uint sliderIndex = (uint)_Sliders.size() - 1; GetDIAxisRange(_Device, lpddoi->dwOfs, lpddoi->dwType, _Sliders[sliderIndex].Min, _Sliders[sliderIndex].Max); char defaultSliderName[32]; smprintf(defaultSliderName, 32, "SLIDER %d", sliderIndex + 1); @@ -400,7 +400,7 @@ BOOL CDIGameDevice::processEnumObject(LPCDIDEVICEOBJECTINSTANCE lpddoi) if (_POVs.size() < MaxNumPOVs) { _POVs.push_back(CPOV()); - uint povIndex = _POVs.size() - 1; + uint povIndex = (uint)_POVs.size() - 1; char defaultPOVName[16]; smprintf(defaultPOVName, 16, "POV %d", povIndex + 1); BuildCtrlName(lpddoi, _POVs[povIndex].Name, defaultPOVName); @@ -435,7 +435,7 @@ uint CDIGameDevice::getBufferSize() const //============================================================================ uint CDIGameDevice::getNumButtons() const { - return _Buttons.size(); + return (uint)_Buttons.size(); } //============================================================================ @@ -448,13 +448,13 @@ bool CDIGameDevice::hasAxis(TAxis axis) const //============================================================================ uint CDIGameDevice::getNumSliders() const { - return _Sliders.size(); + return (uint)_Sliders.size(); } //============================================================================ uint CDIGameDevice::getNumPOV() const { - return _POVs.size(); + return (uint)_POVs.size(); } //============================================================================ const char *CDIGameDevice::getButtonName(uint index) const diff --git a/code/nel/src/misc/diff_tool.cpp b/code/nel/src/misc/diff_tool.cpp index c6e06b466..27621748f 100644 --- a/code/nel/src/misc/diff_tool.cpp +++ b/code/nel/src/misc/diff_tool.cpp @@ -721,7 +721,7 @@ bool readExcelSheet(const ucstring &str, TWorksheet &worksheet, bool checkUnique // enlarge Worksheet row size, as needed uint startLine= worksheet.size(); - worksheet.resize(startLine + lines.size()); + worksheet.resize(startLine + (uint)lines.size()); // **** fill worksheet @@ -850,7 +850,7 @@ void makeHashCode(TWorksheet &sheet, bool forceRehash) } else { - uint index = it - sheet.Data[0].begin(); + uint index = (uint)(it - sheet.Data[0].begin()); for (uint j=1; j= (InternalStringLen-1)) { _InternalStlString.resize (size); @@ -496,7 +496,7 @@ CEvalNumExpr::TReturnState CEvalNumExpr::getNextToken (TToken &token) } // This is a user string, copy the string - uint size = _ExprPtr - start; + uint size = (uint)(_ExprPtr - start); if (size >= (InternalStringLen-1)) { _InternalStlString.resize (size); @@ -590,14 +590,14 @@ CEvalNumExpr::TReturnState CEvalNumExpr::evalExpression (const char *expression, else { if (errorIndex) - *errorIndex = _ExprPtr - expression; + *errorIndex = (int)(_ExprPtr - expression); return MustBeEnd; } } else { if (errorIndex) - *errorIndex = _ExprPtr - expression; + *errorIndex = (int)(_ExprPtr - expression); return error; } } diff --git a/code/nel/src/misc/file.cpp b/code/nel/src/misc/file.cpp index acc9cf134..df36c17be 100644 --- a/code/nel/src/misc/file.cpp +++ b/code/nel/src/misc/file.cpp @@ -98,7 +98,7 @@ void CIFile::loadIntoCache() if(!_IsAsyncLoading) { _ReadingFromFile += _FileSize; - int read = fread (_Cache, _FileSize, 1, _F); + int read = (int)fread (_Cache, _FileSize, 1, _F); _FileRead++; _ReadingFromFile -= _FileSize; _ReadFromFile += read * _FileSize; @@ -113,7 +113,7 @@ void CIFile::loadIntoCache() sint n= READPACKETSIZE-_NbBytesLoaded; n= max(n, 1); _ReadingFromFile += n; - int read = fread (_Cache+index, n, 1, _F); + int read = (int)fread (_Cache+index, n, 1, _F); _FileRead++; _ReadingFromFile -= n; _ReadFromFile += read * n; @@ -126,7 +126,7 @@ void CIFile::loadIntoCache() { uint n= _FileSize-index; _ReadingFromFile += n; - int read = fread (_Cache+index, n, 1, _F); + int read = (int)fread (_Cache+index, n, 1, _F); _FileRead++; _ReadingFromFile -= n; _ReadFromFile += read * n; @@ -428,7 +428,7 @@ void CIFile::serialBuffer(uint8 *buf, uint len) throw(EReadError) { int read; _ReadingFromFile += len; - read=fread(buf, len, 1, _F); + read=(int)fread(buf, len, 1, _F); _FileRead++; _ReadingFromFile -= len; _ReadFromFile += /*read **/ len; @@ -771,7 +771,7 @@ NLMISC_CATEGORISED_COMMAND(nel, iFileAccessLogDisplay, "Display file access logs uint32 count=0; while (it!=itEnd) { - uint32 numTimes= it->second.size(); + uint32 numTimes= (uint32)it->second.size(); CSString fileName= it->first; if (fileName.contains("@")) { diff --git a/code/nel/src/misc/hierarchical_timer.cpp b/code/nel/src/misc/hierarchical_timer.cpp index 9137214e2..d56fab0b4 100644 --- a/code/nel/src/misc/hierarchical_timer.cpp +++ b/code/nel/src/misc/hierarchical_timer.cpp @@ -323,7 +323,7 @@ void CHTimer::display(CLog *log, TSortCriterion criterion, bool displayInline /* { statsPtr[k] = &stats[k]; stats[k].Timer = it->first; - stats[k].buildFromNodes(&(it->second[0]), it->second.size(), _MsPerTick); + stats[k].buildFromNodes(&(it->second[0]), (uint)it->second.size(), _MsPerTick); ++k; } @@ -521,7 +521,7 @@ void CHTimer::displayByExecutionPath(CLog *log, TSortCriterion criterion, bool TNodeVect &execNodes = nodeMap[currTimer]; if (execNodes.size() > 0) { - currNodeStats.buildFromNodes(&execNodes[0], execNodes.size(), _MsPerTick); + currNodeStats.buildFromNodes(&execNodes[0], (uint)execNodes.size(), _MsPerTick); currNodeStats.getStats(resultStats, displayEx, rootStats.TotalTime, _WantStandardDeviation); log->displayRawNL("HTIMER: %s", (resultName + resultStats).c_str()); } @@ -639,7 +639,7 @@ void CHTimer::displayByExecutionPath(CLog *log, TSortCriterion criterion, bool // build the indented node name. resultName.resize(labelNumChar); std::fill(resultName.begin(), resultName.end(), '.'); - uint startIndex = (examStack.size()-1) * indentationStep; + uint startIndex = (uint)(examStack.size()-1) * indentationStep; uint endIndex = std::min(startIndex + (uint)::strlen(node->Owner->_Name), labelNumChar); if ((sint) (endIndex - startIndex) >= 1) { @@ -759,7 +759,7 @@ void CHTimer::displayByExecutionPath(CLog *log, TSortCriterion criterion, bool // build the indented node name. resultName.resize(labelNumChar); std::fill(resultName.begin(), resultName.end(), '.'); - uint startIndex = (examStack.size()-1) * indentationStep; + uint startIndex = (uint)(examStack.size()-1) * indentationStep; uint endIndex = std::min(startIndex + (uint)::strlen(node->Owner->_Name), labelNumChar); if ((sint) (endIndex - startIndex) >= 1) { @@ -849,7 +849,7 @@ void CHTimer::CStats::buildFromNodes(CNode **nodes, uint numNodes, double msPerT uint numMeasures = 0; for(k = 0; k < numNodes; ++k) { - numMeasures += nodes[k]->Measures.size(); + numMeasures += (uint)nodes[k]->Measures.size(); for(l = 0; l < nodes[k]->Measures.size(); ++l) { varianceSum += NLMISC::sqr(nodes[k]->Measures[l] - MeanTime); diff --git a/code/nel/src/misc/i18n.cpp b/code/nel/src/misc/i18n.cpp index 3f3407b2a..4f7c08693 100644 --- a/code/nel/src/misc/i18n.cpp +++ b/code/nel/src/misc/i18n.cpp @@ -481,18 +481,18 @@ void CI18N::_readTextFile(const string &filename, string text; text.resize(file.getFileSize()); if (file.getFileSize() > 0) - file.serialBuffer((uint8*)(&text[0]), text.size()); + file.serialBuffer((uint8*)(&text[0]), (uint)text.size()); // Transform the string in ucstring according to format header if (!text.empty()) - readTextBuffer((uint8*)&text[0], text.size(), result, forceUtf8); + readTextBuffer((uint8*)&text[0], (uint)text.size(), result, forceUtf8); if (preprocess) { // a string to old the result of the preprocess ucstring final; // make rooms to reduce allocation cost - final.reserve(raiseToNextPowerOf2(result.size())); + final.reserve(raiseToNextPowerOf2((uint)result.size())); // parse the file, looking for preprocessor command. ucstring::const_iterator it(result.begin()), end(result.end()); diff --git a/code/nel/src/misc/i_xml.cpp b/code/nel/src/misc/i_xml.cpp index 536358f81..91a32a225 100644 --- a/code/nel/src/misc/i_xml.cpp +++ b/code/nel/src/misc/i_xml.cpp @@ -304,7 +304,7 @@ void CIXml::serialSeparatedBufferIn ( string &value, bool checkSeparator ) else { // Content length - uint length = _ContentString.length(); + uint length = (uint)_ContentString.length(); // String empty ? if (length==0) @@ -352,7 +352,7 @@ void CIXml::serialSeparatedBufferIn ( string &value, bool checkSeparator ) _ContentStringIndex = 0; // New length - length = _ContentString.length(); + length = (uint)_ContentString.length(); } } diff --git a/code/nel/src/misc/inter_window_msg_queue.cpp b/code/nel/src/misc/inter_window_msg_queue.cpp index df073099d..fa63c9069 100644 --- a/code/nel/src/misc/inter_window_msg_queue.cpp +++ b/code/nel/src/misc/inter_window_msg_queue.cpp @@ -501,7 +501,7 @@ namespace NLMISC dest.clear(); } std::vector &msgIn = _InMessageQueue.front().Msg; - dest.serialBuffer(&(msgIn[0]), msgIn.size()); + dest.serialBuffer(&(msgIn[0]), (uint)msgIn.size()); _InMessageQueue.pop_front(); // make dest a read stream dest.invert(); @@ -519,13 +519,13 @@ namespace NLMISC uint CInterWindowMsgQueue::getSendQueueSize() const { CSynchronized::CAccessor outMessageQueue(&const_cast &>(_OutMessageQueue)); - return outMessageQueue.value().size(); + return (uint)outMessageQueue.value().size(); } //************************************************************************************************** uint CInterWindowMsgQueue::getReceiveQueueSize() const { - return _InMessageQueue.size(); + return (uint)_InMessageQueue.size(); } } // NLMISC diff --git a/code/nel/src/misc/noise_value.cpp b/code/nel/src/misc/noise_value.cpp index 0af58cc72..89b9a8ad4 100644 --- a/code/nel/src/misc/noise_value.cpp +++ b/code/nel/src/misc/noise_value.cpp @@ -300,7 +300,7 @@ void CNoiseValue::serial(IStream &f) void CNoiseColorGradient::eval(const CVector &posInWorld, CRGBAF &result) const { // test if not null grads. - uint nGrads= Gradients.size(); + uint nGrads= (uint)Gradients.size(); if(nGrads==0) return; // if only one color, easy diff --git a/code/nel/src/misc/o_xml.cpp b/code/nel/src/misc/o_xml.cpp index 2e2397e13..ce53b754d 100644 --- a/code/nel/src/misc/o_xml.cpp +++ b/code/nel/src/misc/o_xml.cpp @@ -91,7 +91,7 @@ inline void COXml::flushContentString () nlassert (_CurrentNode); // String size - uint size=_ContentString.length(); + uint size=(uint)_ContentString.length(); // Some content to write ? if (size) @@ -226,7 +226,7 @@ void COXml::serialSeparatedBufferOut( const char *value ) else { // Get the content buffer size - uint size=_ContentString.length(); + uint size=(uint)_ContentString.length(); // Add a separator if ((size) && (_ContentString[size-1]!='\n')) diff --git a/code/nel/src/misc/polygon.cpp b/code/nel/src/misc/polygon.cpp index 355e58705..b45e72ba0 100644 --- a/code/nel/src/misc/polygon.cpp +++ b/code/nel/src/misc/polygon.cpp @@ -104,7 +104,7 @@ void CPolygon::clip(const std::vector &planes) { if(planes.size()==0) return; - clip(&(*planes.begin()), planes.size()); + clip(&(*planes.begin()), (uint)planes.size()); } @@ -122,7 +122,7 @@ void CPolygon::getBestTriplet(uint &index0,uint &index1,uint &index2) nlassert(Vertices.size() >= 3); uint i, j, k; float bestArea = 0.f; - const uint numVerts = Vertices.size(); + const uint numVerts = (uint)Vertices.size(); for (i = 0; i < numVerts; ++i) { for (j = 0; j < numVerts; ++j) @@ -402,7 +402,7 @@ bool CPolygon::toConvexPolygonsInCone (const std::vector &vertex, uint a0=0; uint a1; if (a==0) - a1=vertex.size()-1; + a1= (uint)vertex.size()-1; else a1= a-1; @@ -442,7 +442,7 @@ void CPolygon::toConvexPolygonsLocalAndBSP (std::vector &localVertices, invert.invert (); // Insert vertices in an ordered table - uint vertexCount = Vertices.size(); + uint vertexCount = (uint)Vertices.size(); TCConcavePolygonsVertexMap vertexMap; localVertices.resize (vertexCount); uint i, j; @@ -456,7 +456,7 @@ void CPolygon::toConvexPolygonsLocalAndBSP (std::vector &localVertices, // Plane direction i=0; - j=Vertices.size()-1; + j=(uint)Vertices.size()-1; CVector normal = localVertices[i] - localVertices[j]; normal = normal ^ CVector::K; CPlane clipPlane; @@ -699,11 +699,11 @@ bool CPolygon::chain (const std::vector &other, const CMatrix& basis) } // Look for a couple.. - uint thisCount = Vertices.size(); + uint thisCount = (uint)Vertices.size(); uint i, j; for (o=0; o &other, const CMatrix& basis) uint otherToCheck; for (otherToCheck=o+1; otherToCheck= 3); uint i, j, k; float bestArea = 0.f; - const uint numVerts = Vertices.size(); + const uint numVerts = (uint)Vertices.size(); for (i = 0; i < numVerts; ++i) { for (j = 0; j < numVerts; ++j) @@ -2011,7 +2011,7 @@ bool CPolygon2D::getNonNullSeg(uint &index) const float norm2 = (Vertices[Vertices.size() - 1] - Vertices[0]).sqrnorm(); if ( norm2 > bestLength) { - index = Vertices.size() - 1; + index = (uint)Vertices.size() - 1; return true; } @@ -2084,7 +2084,7 @@ bool CPolygon2D::contains(const CVector2f &p, bool hintIsConvex /*= true*/) con { if (hintIsConvex) { - uint numVerts = Vertices.size(); + uint numVerts = (uint)Vertices.size(); nlassert(numVerts >= 0.f); for (uint k = 0; k < numVerts; ++k) { @@ -2161,9 +2161,9 @@ CPolygon2D::CPolygon2D(const CTriangle &tri, const CMatrix &projMat) // ******************************************************************************* void CPolygon2D::getBoundingRect(CVector2f &minCorner, CVector2f &maxCorner) const { - nlassert(!Vertices.empty()) + nlassert(!Vertices.empty()); minCorner = maxCorner = Vertices[0]; - uint numVertices = Vertices.size(); + uint numVertices = (uint)Vertices.size(); for(uint k = 0; k < numVertices; ++k) { minCorner.minof(minCorner, Vertices[k]); @@ -2224,7 +2224,7 @@ static inline bool testSegmentIntersection(const CVector2f &a, const CVector2f & bool CPolygon2D::selfIntersect() const { if (Vertices.size() < 3) return false; - uint numEdges = Vertices.size(); + uint numEdges = (uint)Vertices.size(); for(uint k = 0; k < numEdges; ++k) { // test intersection with all other edges that don't share a vertex with this one diff --git a/code/nel/src/misc/sheet_id.cpp b/code/nel/src/misc/sheet_id.cpp index ba04daa87..5524bc721 100644 --- a/code/nel/src/misc/sheet_id.cpp +++ b/code/nel/src/misc/sheet_id.cpp @@ -173,7 +173,7 @@ void CSheetId::loadSheetId () if (_RemoveUnknownSheet) { uint32 removednbfiles = 0; - uint32 nbfiles = tempMap.size(); + uint32 nbfiles = (uint32)tempMap.size(); // now we remove all files that not available map::iterator itStr2; @@ -204,7 +204,7 @@ void CSheetId::loadSheetId () map::const_iterator it = tempMap.begin(); while (it != tempMap.end()) { - nSize += it->second.size()+1; + nSize += (uint32)it->second.size()+1; nNb++; it++; } @@ -220,7 +220,7 @@ void CSheetId::loadSheetId () tempVec[nNb].Ptr = _AllStrings.Ptr+nSize; strcpy(_AllStrings.Ptr+nSize, it->second.c_str()); toLower(_AllStrings.Ptr+nSize); - nSize += it->second.size()+1; + nSize += (uint32)it->second.size()+1; nNb++; it++; } @@ -243,7 +243,7 @@ void CSheetId::loadSheetId () // Build the invert map (Name to Id) & file extension vector { - uint32 nSize = _SheetIdToName.size(); + uint32 nSize = (uint32)_SheetIdToName.size(); _SheetNameToId.reserve(nSize); CStaticMap::iterator itStr; for( itStr = _SheetIdToName.begin(); itStr != _SheetIdToName.end(); ++itStr ) diff --git a/code/nel/src/misc/sstring.cpp b/code/nel/src/misc/sstring.cpp index 8ba147ba9..4c37b1f1a 100644 --- a/code/nel/src/misc/sstring.cpp +++ b/code/nel/src/misc/sstring.cpp @@ -199,7 +199,7 @@ namespace NLMISC } // scan the string for binary characters - uint32 i=size(); + uint32 i=(uint32)size(); // while (i && !tbl[i-1]) // { // i--; @@ -228,14 +228,14 @@ namespace NLMISC return false; // iterate from size-2 to 1 - for (uint32 i=size()-1; --i;) + for (uint32 i=(uint32)size()-1; --i;) if (!isValidFileNameChar((*this)[i]) && (*this)[i]!=' ') return false; } else { // iterate from size-1 to 0 - for (uint32 i=size(); i--;) + for (uint32 i=(uint32)size(); i--;) if (!isValidFileNameChar((*this)[i])) return false; } @@ -256,7 +256,7 @@ namespace NLMISC return false; // iterate from size-1 to 1 - for (uint32 i=size(); --i;) + for (uint32 i=(uint32)size(); --i;) if (!isValidKeywordChar((*this)[i])) return false; @@ -492,9 +492,9 @@ namespace NLMISC CSString s=strip(); while(!s.empty()) { - uint32 pre=s.size(); + uint32 pre=(uint32)s.size(); result.push_back(s.firstWord(true)); - uint32 post=s.size(); + uint32 post=(uint32)s.size(); if (post>=pre) return false; } @@ -506,9 +506,9 @@ namespace NLMISC CSString s=*this; while(!s.empty()) { - uint32 pre=s.size(); + uint32 pre=(uint32)s.size(); result.push_back(s.firstWordOrWords(true,useSlashStringEscape,useRepeatQuoteStringEscape)); - uint32 post=s.size(); + uint32 post=(uint32)s.size(); if (post>=pre) return false; } @@ -524,7 +524,7 @@ namespace NLMISC s=s.replace("\r",""); uint32 it=0; - uint32 len= s.size(); + uint32 len= (uint32)s.size(); while(it=pre) return false; } @@ -571,7 +571,7 @@ namespace NLMISC while(!s.empty()) { - uint32 pre=s.size(); + uint32 pre=(uint32)s.size(); result.push_back(s.splitToOneOfSeparators( separators,true,useAngleBrace,useSlashStringEscape, useRepeatQuoteStringEscape,!retainSeparators )); @@ -589,7 +589,7 @@ namespace NLMISC } } - uint32 post=s.size(); + uint32 post=(uint32)s.size(); if (post>=pre) return false; } @@ -630,7 +630,7 @@ namespace NLMISC { CSString result; int i,j; - for (j=size()-1; j>=0 && isWhiteSpace((*this)[j]); --j) {} + for (j=(int)size()-1; j>=0 && isWhiteSpace((*this)[j]); --j) {} for (i=0; i=0 && isWhiteSpace((*this)[j]); --j) {} + for (j=(int)size()-1; j>=0 && isWhiteSpace((*this)[j]); --j) {} result=substr(i,j-i+1); return result; } @@ -1025,7 +1025,7 @@ namespace NLMISC } else if ((*this)[0]=='\"' && isDelimitedMonoBlock(false,useSlashStringEscape,useRepeatQuoteStringEscape)) { - i=size(); + i=(uint32)size(); } if (i!=size()) return quote(useSlashStringEscape,useRepeatQuoteStringEscape); @@ -1227,7 +1227,7 @@ namespace NLMISC { bool foundToken= false; - for (uint32 i=size();i--;) + for (uint32 i=(uint32)size();i--;) { switch((*this)[i]) { @@ -1277,7 +1277,7 @@ namespace NLMISC bool CSString::isXMLCompatible(bool isParameter) const { - for (uint32 i=size();i--;) + for (uint32 i=(uint32)size();i--;) { switch((*this)[i]) { @@ -1749,7 +1749,7 @@ namespace NLMISC return false; } resize(NLMISC::CFile::getFileSize(file)); - uint32 bytesRead=fread(const_cast(data()),1,size(),file); + uint32 bytesRead=(uint32)fread(const_cast(data()),1,size(),file); fclose(file); if (bytesRead!=size()) { @@ -1769,7 +1769,7 @@ namespace NLMISC nlwarning("Failed to open file for writing: %s",fileName.c_str()); return false; } - uint32 recordsWritten=fwrite(const_cast(data()),size(),1,file); + uint32 recordsWritten=(uint32)fwrite(const_cast(data()),size(),1,file); fclose(file); if (recordsWritten!=1) { diff --git a/code/nel/src/misc/stream.cpp b/code/nel/src/misc/stream.cpp index 79af32a8d..7eee72309 100644 --- a/code/nel/src/misc/stream.cpp +++ b/code/nel/src/misc/stream.cpp @@ -342,7 +342,7 @@ void IStream::serialCont(vector &cont) } else { - len= cont.size(); + len= (sint32)cont.size(); serial(len); if (len != 0) serialBuffer( (uint8*)&(*cont.begin()) , len); @@ -366,7 +366,7 @@ void IStream::serialCont(vector &cont) } else { - len= cont.size(); + len= (sint32)cont.size(); serial(len); if (len != 0) serialBuffer( (uint8*)&(*cont.begin()) , len); @@ -403,7 +403,7 @@ void IStream::serialCont(vector &cont) } else { - len= cont.size(); + len= (sint32)cont.size(); serial(len); if (len != 0) diff --git a/code/nel/src/misc/string_mapper.cpp b/code/nel/src/misc/string_mapper.cpp index b6c235be9..ea8409f54 100644 --- a/code/nel/src/misc/string_mapper.cpp +++ b/code/nel/src/misc/string_mapper.cpp @@ -155,7 +155,7 @@ void CStaticStringMapper::memoryCompress() uint32 nNbStrings = 0; while (it != _TempIdTable.end()) { - nTotalSize += it->second.size() + 1; + nTotalSize += (uint)it->second.size() + 1; nNbStrings++; it++; } @@ -169,7 +169,7 @@ void CStaticStringMapper::memoryCompress() { strcpy(_AllStrings + nTotalSize, it->second.c_str()); _IdToStr[nNbStrings] = _AllStrings + nTotalSize; - nTotalSize += it->second.size() + 1; + nTotalSize += (uint)it->second.size() + 1; nNbStrings++; it++; } diff --git a/code/nel/src/misc/task_manager.cpp b/code/nel/src/misc/task_manager.cpp index a75c931e9..4001c1744 100644 --- a/code/nel/src/misc/task_manager.cpp +++ b/code/nel/src/misc/task_manager.cpp @@ -149,7 +149,7 @@ bool CTaskManager::deleteTask(IRunnable *r) uint CTaskManager::taskListSize(void) { CUnfairSynchronized >::CAccessor acces(&_TaskQueue); - return acces.value().size(); + return (uint)acces.value().size(); } @@ -216,7 +216,7 @@ void CTaskManager::clearDump() uint CTaskManager::getNumWaitingTasks() { CUnfairSynchronized >::CAccessor acces(&_TaskQueue); - return acces.value().size(); + return (uint)acces.value().size(); } // *************************************************************************** diff --git a/code/nel/src/misc/unicode.cpp b/code/nel/src/misc/unicode.cpp index bcd905eb5..117ad1e26 100644 --- a/code/nel/src/misc/unicode.cpp +++ b/code/nel/src/misc/unicode.cpp @@ -1907,8 +1907,8 @@ ucstring toLower (const ucstring &str) { uint i; ucstring temp = str; - const uint size = temp.size(); - for (i=0; i >::CAccessor access (&_Labels); access.value().push_back (CLabelEntry(value)); - pos = access.value().size()-1; + pos = (int)access.value().size()-1; } return pos; } diff --git a/code/nel/src/misc/xml_pack.cpp b/code/nel/src/misc/xml_pack.cpp index 27c8bd0a9..dce0f72a1 100644 --- a/code/nel/src/misc/xml_pack.cpp +++ b/code/nel/src/misc/xml_pack.cpp @@ -179,8 +179,8 @@ namespace NLMISC // ok, the file is parsed, store it fileInfo.FileName = CStringMapper::map(subFileName); - fileInfo.FileOffset = beginOfFile - buffer.begin(); - fileInfo.FileSize = endOfFile - beginOfFile; + fileInfo.FileOffset = (uint32)(beginOfFile - buffer.begin()); + fileInfo.FileSize = (uint32)(endOfFile - beginOfFile); // fileInfo.FileHandler = fopen(xmlPackFileName.c_str(), "rb"); packInfo._XMLFiles.insert(make_pair(fileInfo.FileName, fileInfo)); diff --git a/code/nel/src/net/callback_net_base.cpp b/code/nel/src/net/callback_net_base.cpp index a59dd3398..8620a75b3 100644 --- a/code/nel/src/net/callback_net_base.cpp +++ b/code/nel/src/net/callback_net_base.cpp @@ -121,7 +121,7 @@ void CCallbackNetBase::addCallbackArray (const TCallbackItem *callbackarray, sin } // resize the array - sint oldsize = _CallbackArray.size(); + sint oldsize = (sint)_CallbackArray.size(); _CallbackArray.resize (oldsize + arraysize); diff --git a/code/nel/src/net/email.cpp b/code/nel/src/net/email.cpp index 428806fcd..7198215f9 100644 --- a/code/nel/src/net/email.cpp +++ b/code/nel/src/net/email.cpp @@ -77,7 +77,7 @@ static void uuencode (const char *s, const char *store, const int length) bool sendEMailCommand (CTcpSock &sock, const std::string &command, uint32 code = 250) { string buffer = command + "\r\n"; - uint32 size = buffer.size(); + uint32 size = (uint32)buffer.size(); if(!command.empty()) { if (sock.send ((uint8 *)buffer.c_str(), size) != CSock::Ok) @@ -285,7 +285,7 @@ bool sendEmail (const string &smtpServer, const string &from, const string &to, memset(&src_buf[size], 0, src_buf_size - size); } /* Encode the buffer we just read in */ - uuencode(src_buf, dst_buf, size); + uuencode(src_buf, dst_buf, (int)size); formatedBody += dst_buf; formatedBody += "\r\n"; diff --git a/code/nel/src/net/listen_sock.cpp b/code/nel/src/net/listen_sock.cpp index bd0c48af8..52e5407a2 100644 --- a/code/nel/src/net/listen_sock.cpp +++ b/code/nel/src/net/listen_sock.cpp @@ -17,7 +17,8 @@ #include "stdnet.h" #include "nel/net/listen_sock.h" -#include "nel/net/net_log.h" +#include "nel/net/net_log.h" + #ifdef NL_OS_WINDOWS @@ -122,8 +123,8 @@ CTcpSock *CListenSock::accept() { // Accept connection sockaddr_in saddr; - socklen_t saddrlen = sizeof(saddr); - SOCKET newsock = ::accept( _Sock, (sockaddr*)&saddr, &saddrlen ); + socklen_t saddrlen = (socklen_t)sizeof(saddr); + SOCKET newsock = (SOCKET)::accept( _Sock, (sockaddr*)&saddr, &saddrlen ); if ( newsock == INVALID_SOCKET ) { if (_Sock == INVALID_SOCKET) diff --git a/code/nel/src/net/login_server.cpp b/code/nel/src/net/login_server.cpp index 0515348d7..2ff2e3b88 100644 --- a/code/nel/src/net/login_server.cpp +++ b/code/nel/src/net/login_server.cpp @@ -170,7 +170,7 @@ void cbWSChooseShard (CMessage &msgin, const std::string &/* serviceName */, TSe msgout.serial (reason); msgout.serial (cookie); msgout.serial (ListenAddr); - uint32 nbPending = PendingUsers.size(); + uint32 nbPending = (uint32)PendingUsers.size(); msgout.serial (nbPending); CUnifiedNetwork::getInstance()->send ("WS", msgout); } @@ -302,7 +302,7 @@ void CLoginServer::setListenAddress(const string &la) uint32 CLoginServer::getNbPendingUsers() { - return PendingUsers.size(); + return (uint32)PendingUsers.size(); } void cfcbListenAddress (CConfigFile::CVar &var) diff --git a/code/nel/src/net/module_common.cpp b/code/nel/src/net/module_common.cpp index 7eee0048f..6bbd527e6 100644 --- a/code/nel/src/net/module_common.cpp +++ b/code/nel/src/net/module_common.cpp @@ -31,7 +31,7 @@ namespace NLNET - uint first = 0, last = copy.SubParams.size(); + uint first = 0, last = (uint)copy.SubParams.size(); SubParams.resize( last ); for (; first != last; ++first) { diff --git a/code/nel/src/net/module_gateway.cpp b/code/nel/src/net/module_gateway.cpp index 7018f9961..f3933bb29 100644 --- a/code/nel/src/net/module_gateway.cpp +++ b/code/nel/src/net/module_gateway.cpp @@ -540,12 +540,12 @@ namespace NLNET virtual uint32 getTransportCount() const { - return _Transports.size(); + return (uint32)_Transports.size(); } virtual uint32 getRouteCount() const { - return _Routes.size(); + return (uint32)_Routes.size(); } virtual uint32 getReceivedPingCount() const @@ -1279,7 +1279,7 @@ namespace NLNET virtual uint32 getProxyCount() const { - return _ModuleProxies.size(); + return (uint32)_ModuleProxies.size(); } /// Fill a vector with the list of proxies managed here. The module are filled in ascending proxy id order. diff --git a/code/nel/src/net/module_gateway_transport.cpp b/code/nel/src/net/module_gateway_transport.cpp index b07b7421a..6088ab3e8 100644 --- a/code/nel/src/net/module_gateway_transport.cpp +++ b/code/nel/src/net/module_gateway_transport.cpp @@ -135,7 +135,7 @@ namespace NLNET virtual uint32 getRouteCount() const { - return _Routes.size(); + return (uint32)_Routes.size(); } void dump(NLMISC::CLog &log) const @@ -566,7 +566,7 @@ namespace NLNET virtual uint32 getRouteCount() const { - return _Routes.size(); + return (uint32)_Routes.size(); } void dump(NLMISC::CLog &log) const @@ -661,12 +661,12 @@ namespace NLNET // affect a connection id if (_FreeRoutesIds.empty()) { - connId = _RouteIds.size(); + connId = (uint32)_RouteIds.size(); _RouteIds.push_back(InvalidSockId); } else { - connId = _FreeRoutesIds.back(); + connId = (uint32)_FreeRoutesIds.back(); _FreeRoutesIds.pop_back(); } diff --git a/code/nel/src/net/module_l5_transport.cpp b/code/nel/src/net/module_l5_transport.cpp index f6b3530ec..c022150ee 100644 --- a/code/nel/src/net/module_l5_transport.cpp +++ b/code/nel/src/net/module_l5_transport.cpp @@ -177,7 +177,7 @@ namespace NLNET virtual uint32 getRouteCount() const { - return _Routes.size(); + return (uint32)_Routes.size(); } void dump(NLMISC::CLog &log) const diff --git a/code/nel/src/net/module_local_gateway.cpp b/code/nel/src/net/module_local_gateway.cpp index e64754f91..3c4e943e4 100644 --- a/code/nel/src/net/module_local_gateway.cpp +++ b/code/nel/src/net/module_local_gateway.cpp @@ -260,7 +260,7 @@ namespace NLNET virtual uint32 getProxyCount() const { - return _ModuleProxies.getAToBMap().size(); + return (uint32)_ModuleProxies.getAToBMap().size(); } /// Fill a vector with the list of proxies managed here. The module are filled in ascending proxy id order. diff --git a/code/nel/src/net/module_manager.cpp b/code/nel/src/net/module_manager.cpp index e6442a362..c76989206 100644 --- a/code/nel/src/net/module_manager.cpp +++ b/code/nel/src/net/module_manager.cpp @@ -661,12 +661,12 @@ namespace NLNET virtual uint32 getNbModule() { - return _ModuleInstances.getAToBMap().size(); + return (uint32)_ModuleInstances.getAToBMap().size(); } virtual uint32 getNbModuleProxy() { - return _ModuleProxyIds.getAToBMap().size(); + return (uint32)_ModuleProxyIds.getAToBMap().size(); } diff --git a/code/nel/src/net/service.cpp b/code/nel/src/net/service.cpp index 6e219de93..1fccea0ca 100644 --- a/code/nel/src/net/service.cpp +++ b/code/nel/src/net/service.cpp @@ -124,7 +124,7 @@ uint32 LastTimeInCallback = 0; // this is the thread that initialized the signal redirection // we'll ignore other thread signals -static uint SignalisedThread; +static size_t SignalisedThread; static CFileDisplayer fd; static CNetDisplayer commandDisplayer(false); @@ -409,7 +409,7 @@ string IService::getArg (char argName) const begin++; // End - uint size = _Args[i].size(); + uint size = (uint)_Args[i].size(); if (size && _Args[i][size-1] == '"') size--; size = (uint)(std::max((int)0, (int)size-(int)begin)); diff --git a/code/nel/src/net/sock.cpp b/code/nel/src/net/sock.cpp index 94206494d..b8d116962 100644 --- a/code/nel/src/net/sock.cpp +++ b/code/nel/src/net/sock.cpp @@ -263,7 +263,7 @@ void CSock::createSocket( int type, int protocol ) { nlassert( _Sock == INVALID_SOCKET ); - _Sock = socket( AF_INET, type, protocol ); // or IPPROTO_IP (=0) ? + _Sock = (SOCKET)socket( AF_INET, type, protocol ); // or IPPROTO_IP (=0) ? if ( _Sock == INVALID_SOCKET ) { throw ESocket( "Socket creation failed" ); diff --git a/code/nel/src/net/transport_class.cpp b/code/nel/src/net/transport_class.cpp index 7c5171f03..1d9796dd2 100644 --- a/code/nel/src/net/transport_class.cpp +++ b/code/nel/src/net/transport_class.cpp @@ -377,7 +377,7 @@ void CTransportClass::createLocalRegisteredClassMessage () TempMessage.invert(); TempMessage.setType ("CT_LRC"); - uint32 nbClass = LocalRegisteredClass.size (); + uint32 nbClass = (uint32)LocalRegisteredClass.size (); TempMessage.serial (nbClass); for (TRegisteredClass::iterator it = LocalRegisteredClass.begin(); it != LocalRegisteredClass.end (); it++) @@ -386,7 +386,7 @@ void CTransportClass::createLocalRegisteredClassMessage () TempMessage.serial ((*it).second.Instance->Name); - uint32 nbProp = (*it).second.Instance->Prop.size (); + uint32 nbProp = (uint32)(*it).second.Instance->Prop.size (); TempMessage.serial (nbProp); for (uint j = 0; j < (*it).second.Instance->Prop.size (); j++) diff --git a/code/nel/src/net/unified_network.cpp b/code/nel/src/net/unified_network.cpp index a15f12fbb..bb01286c7 100644 --- a/code/nel/src/net/unified_network.cpp +++ b/code/nel/src/net/unified_network.cpp @@ -34,7 +34,7 @@ using namespace NLMISC; namespace NLNET { -static uint ThreadCreator = 0; +static size_t ThreadCreator = 0; static const uint64 AppIdDeadConnection = 0xDEAD; @@ -1686,7 +1686,7 @@ CCallbackNetBase *CUnifiedNetwork::getNetBase(const std::string &name, TSockId & if (ThreadCreator != NLMISC::getThreadId()) nlwarning ("HNETL5: Multithread access but this class is not thread safe thread creator = %u thread used = %u", ThreadCreator, NLMISC::getThreadId()); - sint count = _NamedCnx.count(name); + sint count = (sint)_NamedCnx.count(name); if (count <= 0) { @@ -2132,7 +2132,7 @@ void CUnifiedNetwork::CUnifiedConnection::display (bool full, CLog *log) log->displayNL ("> %s-%hu %s %s %s (%d ExtAddr %d Cnx) TotalCb %d", ServiceName.c_str (), ServiceId.get(), IsExternal?"External":"NotExternal", AutoRetry?"AutoRetry":"NoAutoRetry", SendId?"SendId":"NoSendId", ExtAddress.size (), Connections.size (), TotalCallbackCalled); - uint maxc = std::max (ExtAddress.size (), Connections.size ()); + uint maxc = (uint)std::max (ExtAddress.size (), Connections.size ()); for (uint j = 0; j < maxc; j++) { diff --git a/code/nel/src/pacs/build_indoor.cpp b/code/nel/src/pacs/build_indoor.cpp index bd2d995a7..672088fa8 100644 --- a/code/nel/src/pacs/build_indoor.cpp +++ b/code/nel/src/pacs/build_indoor.cpp @@ -466,7 +466,7 @@ void buildExteriorMesh(CCollisionMeshBuild &cmb, CExteriorMesh &em) sint pivot = (edge+1)%3; sint nextEdge = edge; - uint firstExtEdge = edges.size(); + uint firstExtEdge = (uint)edges.size(); for(;;) { diff --git a/code/nel/src/pacs/chain.cpp b/code/nel/src/pacs/chain.cpp index bda615fc6..aaa631dea 100644 --- a/code/nel/src/pacs/chain.cpp +++ b/code/nel/src/pacs/chain.cpp @@ -87,14 +87,14 @@ void NLPACS::COrderedChain::traverse(sint from, sint to, bool forward, vectorto; --i) @@ -216,7 +216,7 @@ void NLPACS::CChain::make(const vector &vertices, sint32 left, sint32 r if (useOChainId.empty()) { - subChainId = chains.size(); + subChainId = (uint32)chains.size(); if (subChainId > 65535) nlerror("in NLPACS::CChain::make(): reached the maximum number of ordered chains"); diff --git a/code/nel/src/pacs/chain.h b/code/nel/src/pacs/chain.h index c2432d382..c03a2d7ff 100644 --- a/code/nel/src/pacs/chain.h +++ b/code/nel/src/pacs/chain.h @@ -322,7 +322,7 @@ inline void COrderedChain3f::unpack(const COrderedChain &chain) { uint i, mx; const std::vector &vertices = chain.getVertices(); - mx = _Vertices.size(); + mx = (uint)_Vertices.size(); _Vertices.resize(vertices.size()); _Forward = chain.isForward(); _ParentId = chain.getParentId(); diff --git a/code/nel/src/pacs/chain_quad.cpp b/code/nel/src/pacs/chain_quad.cpp index c75ca9f3c..ad28aae7c 100644 --- a/code/nel/src/pacs/chain_quad.cpp +++ b/code/nel/src/pacs/chain_quad.cpp @@ -207,7 +207,7 @@ void CChainQuad::build(const std::vector &ochains) // add an entry for Len. memSize+= sizeof(uint16); // add N entry of CEdgeChainEntry. - memSize+= quadNode.size()*sizeof(CEdgeChainEntry); + memSize+= (sint)quadNode.size()*sizeof(CEdgeChainEntry); } } @@ -516,7 +516,7 @@ void CChainQuad::serial(NLMISC::IStream &f) else { // len/resize. - len= _Quad.size(); + len= (uint32)_Quad.size(); f.serial(len); // write offsets. diff --git a/code/nel/src/pacs/collision_surface_temp.cpp b/code/nel/src/pacs/collision_surface_temp.cpp index 99e0e26cd..88ee4abb5 100644 --- a/code/nel/src/pacs/collision_surface_temp.cpp +++ b/code/nel/src/pacs/collision_surface_temp.cpp @@ -58,7 +58,7 @@ void CCollisionSurfaceTemp::resetEdgeCollideNodes() // *************************************************************************** uint32 CCollisionSurfaceTemp::allocEdgeCollideNode(uint32 size) { - uint32 id= _EdgeCollideNodes.size(); + uint32 id= (uint32)_EdgeCollideNodes.size(); _EdgeCollideNodes.resize(id+size); return id; } diff --git a/code/nel/src/pacs/edge_quad.cpp b/code/nel/src/pacs/edge_quad.cpp index 8d1b2c0ce..68f3f6865 100644 --- a/code/nel/src/pacs/edge_quad.cpp +++ b/code/nel/src/pacs/edge_quad.cpp @@ -357,7 +357,7 @@ void CEdgeQuad::build(const CExteriorMesh &em, // add an entry for Len. memSize+= sizeof(uint16); // add N entry of CEdgeChainEntry. - memSize+= quadNode.size()*sizeof(uint16); + memSize+= (sint)quadNode.size()*sizeof(uint16); } } @@ -614,7 +614,7 @@ void CEdgeQuad::serial(NLMISC::IStream &f) else { // len/resize. - len= _Quad.size(); + len= (uint32)_Quad.size(); f.serial(len); // write offsets. diff --git a/code/nel/src/pacs/face_grid.h b/code/nel/src/pacs/face_grid.h index 3eb369490..b1ab700f7 100644 --- a/code/nel/src/pacs/face_grid.h +++ b/code/nel/src/pacs/face_grid.h @@ -134,7 +134,7 @@ inline void CFaceGrid::create(const CFaceGrid::CFaceGridBuild &fgb) uint i; for (i=0; i &s idx = x+(y<<_Log2Width); start = _Grid[idx++]; - stop = (idx == _Grid.size()) ? _GridData.size() : _Grid[idx]; + stop = (idx == _Grid.size()) ? (uint)_GridData.size() : _Grid[idx]; for (; start &verts, return -1; } - sint32 newId = _Chains.size(); + sint32 newId = (sint32)_Chains.size(); _Chains.resize(newId+1); CChain &chain = _Chains.back(); @@ -471,13 +471,13 @@ void NLPACS::CLocalRetriever::computeLoopsAndTips() if (j == chainFlags.size()) break; - uint32 loopId = surface._Loops.size(); + uint32 loopId = (uint32)surface._Loops.size(); surface._Loops.push_back(CRetrievableSurface::TLoop()); CRetrievableSurface::TLoop &loop = surface._Loops.back(); CVector loopStart = getStartVector(surface._Chains[j].Chain, i); CVector currentEnd = getStopVector(surface._Chains[j].Chain, i); - _Chains[surface._Chains[j].Chain].setLoopIndexes(i, loopId, loop.size()); + _Chains[surface._Chains[j].Chain].setLoopIndexes(i, loopId, (uint)loop.size()); loop.push_back(uint16(j)); chainFlags[j] = true; @@ -532,7 +532,7 @@ void NLPACS::CLocalRetriever::computeLoopsAndTips() } currentEnd = getStopVector(surface._Chains[bestChain].Chain, i); - _Chains[surface._Chains[bestChain].Chain].setLoopIndexes(i, loopId, loop.size()); + _Chains[surface._Chains[bestChain].Chain].setLoopIndexes(i, loopId, (uint)loop.size()); loop.push_back(uint16(bestChain)); chainFlags[bestChain] = true; ++totalAdded; @@ -673,21 +673,21 @@ void NLPACS::CLocalRetriever::buildSurfacePolygons(uint32 surface, list0; --l) + for (l=(uint)ochain.getVertices().size()-1; l>0; --l) poly.Vertices.push_back(ochain[l].unpack3f()); } } } else { - for (k=chain._SubChains.size(); (sint)k>0; --k) + for (k=(uint)chain._SubChains.size(); (sint)k>0; --k) { const COrderedChain &ochain = _OrderedChains[chain._SubChains[k]]; bool ochainforward = ochain.isForward(); if (ochainforward) { - for (l=ochain.getVertices().size()-1; (sint)l>0; --l) + for (l=(uint)ochain.getVertices().size()-1; (sint)l>0; --l) poly.Vertices.push_back(ochain[l].unpack3f()); } else @@ -733,21 +733,21 @@ void NLPACS::CLocalRetriever::build3dSurfacePolygons(uint32 surface, list0; --l) + for (l=(uint)ochain.getVertices().size()-1; l>0; --l) poly.Vertices.push_back(ochain[l]); } } } else { - for (k=chain._SubChains.size()-1; (sint)k>=0; --k) + for (k=(uint)chain._SubChains.size()-1; (sint)k>=0; --k) { const COrderedChain3f &ochain = _FullOrderedChains[chain._SubChains[k]]; bool ochainforward = ochain.isForward(); if (ochainforward) { - for (l=ochain.getVertices().size()-1; (sint)l>0; --l) + for (l=(uint)ochain.getVertices().size()-1; (sint)l>0; --l) poly.Vertices.push_back(ochain[l]); } else @@ -779,7 +779,7 @@ void NLPACS::CLocalRetriever::findBorderChains() for (chain=0; chain<_Chains.size(); ++chain) if (_Chains[chain].isBorderChain()) { - sint32 index = _BorderChains.size(); + sint32 index = (sint32)_BorderChains.size(); _BorderChains.push_back(uint16(chain)); _Chains[chain].setBorderChainIndex(index); } @@ -1108,7 +1108,7 @@ void NLPACS::CLocalRetriever::retrievePosition(CVector estimated, CCollisionSurf else { const vector &vertices = sub.getVertices(); - uint start = 0, stop = vertices.size()-1; + uint start = 0, stop = (uint)vertices.size()-1; // then finds the smallest segment of the chain that includes the estimated position. while (stop-start > 1) @@ -1282,7 +1282,7 @@ void NLPACS::CLocalRetriever::retrieveAccuratePosition(CVector2s estim, CCollisi else { const vector &vertices = sub.getVertices(); - uint start = 0, stop = vertices.size()-1; + uint start = 0, stop = (uint)vertices.size()-1; // then finds the smallest segment of the chain that includes the estimated position. while (stop-start > 1) @@ -1705,7 +1705,7 @@ void NLPACS::CLocalRetriever::findPath(const NLPACS::CLocalRetriever::CLocalPosi sort(intersections.begin(), intersections.end()); uint intersStart = 0; - uint intersEnd = intersections.size(); + uint intersEnd = (uint)intersections.size(); if (intersEnd > 0) { @@ -1834,13 +1834,13 @@ void NLPACS::CLocalRetriever::findPath(const NLPACS::CLocalRetriever::CLocalPosi { loopIndex--; if (loopIndex < 0) - loopIndex = loop.size()-1; + loopIndex = (sint)loop.size()-1; } thisChainId = surface._Chains[loop[loopIndex]].Chain; thisChainForward = (_Chains[thisChainId].getLeft() == surfaceId); thisOChainIndex = (thisChainForward && forward || !thisChainForward && !forward) ? - 0 : _Chains[thisChainId]._SubChains.size()-1; + 0 : (sint)_Chains[thisChainId]._SubChains.size()-1; } thisOChainId = _Chains[thisChainId]._SubChains[thisOChainIndex]; @@ -1894,7 +1894,7 @@ void NLPACS::CLocalRetriever::testCollision(CCollisionSurfaceTemp &cst, const CA uint16 *chainLUT= cst.OChainLUT; // bkup where we begin to add chains. - uint firstChainAdded= cst.CollisionChains.size(); + uint firstChainAdded= (uint)cst.CollisionChains.size(); // For all edgechain entry. for(i=0;i > edges; diff --git a/code/nel/src/pacs/move_container.cpp b/code/nel/src/pacs/move_container.cpp index bf4bc1655..2d2473625 100644 --- a/code/nel/src/pacs/move_container.cpp +++ b/code/nel/src/pacs/move_container.cpp @@ -684,7 +684,7 @@ bool CMoveContainer::evalOneTerrainCollision (double beginTime, CMovePrimitive * testMoveValid=true; // Size of the array - uint size=result->size(); + uint size=(uint)result->size(); // For each detected collisions for (uint c=0; c= (int)_TimeOT.size()) { nlwarning("PACS: newCollision() failure, index [%d] >= (int)_TimeOT.size() [%d], clamped to max", index, (int)_TimeOT.size()); - index = _TimeOT.size()-1; + index = (int)_TimeOT.size()-1; } _TimeOT[index].link (info); @@ -1197,7 +1197,7 @@ void CMoveContainer::newCollision (CMovePrimitive* first, const CCollisionSurfac if (index >= (int)_TimeOT.size()) { nlwarning("PACS: newCollision() failure, index [%d] >= (int)_TimeOT.size() [%d], clamped to max", index, (int)_TimeOT.size()); - index = _TimeOT.size()-1; + index = (int)_TimeOT.size()-1; } _TimeOT[index].link (info); @@ -1212,7 +1212,7 @@ void CMoveContainer::newCollision (CMovePrimitive* first, const CCollisionSurfac void CMoveContainer::newTrigger (CMovePrimitive* first, CMovePrimitive* second, const CCollisionDesc& desc, uint triggerType) { // Element index - uint index=_Triggers.size(); + uint index=(uint)_Triggers.size(); // Add one element _Triggers.resize (index+1); @@ -1503,7 +1503,7 @@ void CMoveContainer::removeNCFromModifiedList (CMovePrimitive* primitive, uint8 { // For each world image uint i; - uint worldImageCount = _ChangedRoot.size(); + uint worldImageCount = (uint)_ChangedRoot.size(); for (i=0; i &getRetrievers() const { return _Retrievers; } /// Returns the number of retrievers in the bank. - uint size() const { return _Retrievers.size(); } + uint size() const { return (uint)_Retrievers.size(); } /// Gets nth retriever. const CLocalRetriever &getRetriever(uint n) const @@ -79,7 +79,7 @@ public: } /// Adds the given retriever to the bank. - uint addRetriever(const CLocalRetriever &retriever) { _Retrievers.push_back(retriever); return _Retrievers.size()-1; } + uint addRetriever(const CLocalRetriever &retriever) { _Retrievers.push_back(retriever); return (uint)_Retrievers.size()-1; } /// Loads the retriever named 'filename' (using defined search paths) and adds it to the bank. uint addRetriever(const std::string &filename) @@ -92,7 +92,7 @@ public: localRetriever.serial(input); input.close(); - return _Retrievers.size()-1; + return (uint)_Retrievers.size()-1; } /// Cleans the bank up. @@ -166,7 +166,7 @@ public: } else { - uint32 num = _Retrievers.size(); + uint32 num = (uint32)_Retrievers.size(); f.serial(num); } } diff --git a/code/nel/src/pacs/retriever_instance.cpp b/code/nel/src/pacs/retriever_instance.cpp index c9b5c7328..3e4f87823 100644 --- a/code/nel/src/pacs/retriever_instance.cpp +++ b/code/nel/src/pacs/retriever_instance.cpp @@ -637,7 +637,7 @@ void NLPACS::CRetrieverInstance::testExteriorCollision(NLPACS::CCollisionSurface uint16 *edgeLUT= cst.OChainLUT; // bkup where we begin to add chains. - uint firstChainAdded= cst.CollisionChains.size(); + uint firstChainAdded= (uint)cst.CollisionChains.size(); // For all exterioredge entry. for(i=0;i 0) diff --git a/code/nel/src/sound/async_file_manager_sound.cpp b/code/nel/src/sound/async_file_manager_sound.cpp index 41b0e34fc..4f0beea53 100644 --- a/code/nel/src/sound/async_file_manager_sound.cpp +++ b/code/nel/src/sound/async_file_manager_sound.cpp @@ -193,7 +193,7 @@ void CAsyncFileManagerSound::CLoadWavFile::run (void) } _pDestbuffer->setFormat(bufferFormat, channels, bitsPerSample, frequency); - if (!_pDestbuffer->fill(&result[0], result.size())) + if (!_pDestbuffer->fill(&result[0], (uint)result.size())) { nlwarning("CAsyncFileManagerSound::CLoadWavFile::run : _pDestbuffer->fill returned false !"); return; diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index c7161b082..a524b39cc 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -181,12 +181,12 @@ void CAudioMixerUser::initClusteredSound(NL3D::CScene *scene, float minGain, flo void CAudioMixerUser::setPriorityReserve(TSoundPriority priorityChannel, size_t reserve) { - _PriorityReserve[priorityChannel] = min(_Tracks.size(), reserve); + _PriorityReserve[priorityChannel] = (uint32)min(_Tracks.size(), reserve); } void CAudioMixerUser::setLowWaterMark(size_t value) { - _LowWaterMark = min(_Tracks.size(), value); + _LowWaterMark = (uint32)min(_Tracks.size(), value); } @@ -544,7 +544,7 @@ void CAudioMixerUser::initDevice(const std::string &deviceName, const CInitInfo _LowWaterMark = 0; for (i=0; i &sampleL } vector mono16Data; - if (!IBuffer::convertToMono16PCM(&result[0], result.size(), mono16Data, bufferFormat, channels, bitsPerSample)) + if (!IBuffer::convertToMono16PCM(&result[0], (uint)result.size(), mono16Data, bufferFormat, channels, bitsPerSample)) { nlwarning(" IBuffer::convertToMono16PCM returned false"); continue; } vector adpcmData; - if (!IBuffer::convertMono16PCMToMonoADPCM(&mono16Data[0], mono16Data.size(), adpcmData)) + if (!IBuffer::convertMono16PCMToMonoADPCM(&mono16Data[0], (uint)mono16Data.size(), adpcmData)) { nlwarning(" IBuffer::convertMono16PCMToMonoADPCM returned false"); continue; @@ -763,7 +763,7 @@ std::string UAudioMixer::buildSampleBank(const std::vector &sampleL adpcmBuffers[j].swap(adpcmData); mono16Buffers[j].swap(mono16Data); - hdr.addSample(CFile::getFilename(sampleList[j]), frequency, mono16Data.size(), mono16Buffers[j].size() * 2, adpcmBuffers[j].size()); + hdr.addSample(CFile::getFilename(sampleList[j]), frequency, (uint32)mono16Data.size(), (uint32)mono16Buffers[j].size() * 2, (uint32)adpcmBuffers[j].size()); } // write the sample bank (if any sample available) @@ -776,8 +776,8 @@ std::string UAudioMixer::buildSampleBank(const std::vector &sampleL nlassert(mono16Buffers.size() == adpcmBuffers.size()); for (uint j = 0; j < mono16Buffers.size(); ++j) { - sbf.serialBuffer((uint8*)(&mono16Buffers[j][0]), mono16Buffers[j].size()*2); - sbf.serialBuffer((uint8*)(&adpcmBuffers[j][0]), adpcmBuffers[j].size()); + sbf.serialBuffer((uint8*)(&mono16Buffers[j][0]), (uint)mono16Buffers[j].size()*2); + sbf.serialBuffer((uint8*)(&adpcmBuffers[j][0]), (uint)adpcmBuffers[j].size()); } return filename; @@ -1134,7 +1134,7 @@ void CAudioMixerUser::CControledSources::serial(NLMISC::IStream &s) s.serial(name); s.serialEnum(ParamId); - uint32 size = SoundNames.size(); + uint32 size = (uint32)SoundNames.size(); s.serial(size); for (uint i=0; i &poly, const CVector proj = plane.project(pos); float minDist = FLT_MAX; bool projIn = true; - uint nbVertex = poly.size(); + uint nbVertex = (uint)poly.size(); // loop throw all vertex for (uint j=0; j& names, TTestFunctionAL a } } nlassert( ibcompacted <= names.end() ); - return ibcompacted - names.begin(); + return (uint)(ibcompacted - names.begin()); } diff --git a/code/nel/src/sound/driver/openal/stdopenal.h b/code/nel/src/sound/driver/openal/stdopenal.h index 4bd9fd2a3..4ee7036bc 100644 --- a/code/nel/src/sound/driver/openal/stdopenal.h +++ b/code/nel/src/sound/driver/openal/stdopenal.h @@ -35,8 +35,13 @@ #include #include -#include -#include +#ifdef NL_OS_MAC +# include +# include +#else +# include +# include +#endif #include #include diff --git a/code/nel/src/sound/driver/xaudio2/listener_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/listener_xaudio2.cpp index fb65e43b1..0130ef4a9 100644 --- a/code/nel/src/sound/driver/xaudio2/listener_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/listener_xaudio2.cpp @@ -75,8 +75,9 @@ CListenerXAudio2::~CListenerXAudio2() if (soundDriver) soundDriver->removeListener(this); } -#define NLSOUND_XAUDIO2_RELEASE_EX(pointer, command) if (_ListenerOk) nlassert(pointer) \ +#define NLSOUND_XAUDIO2_RELEASE_EX(pointer, command) if (_ListenerOk) nlassert(pointer); \ if (pointer) { command; pointer = NULL; } + void CListenerXAudio2::release() { NLSOUND_XAUDIO2_RELEASE_EX(_FilterVoice, _FilterVoice->DestroyVoice()) diff --git a/code/nel/src/sound/sample_bank.cpp b/code/nel/src/sound/sample_bank.cpp index 75795bac7..9cce83496 100644 --- a/code/nel/src/sound/sample_bank.cpp +++ b/code/nel/src/sound/sample_bank.cpp @@ -451,7 +451,7 @@ IBuffer* CSampleBank::getSample(const NLMISC::TStringId &name) uint CSampleBank::countSamples() { - return _Samples.size(); + return (uint)_Samples.size(); } // ******************************************************** diff --git a/code/nel/src/sound/sound_anim_manager.cpp b/code/nel/src/sound/sound_anim_manager.cpp index 04c32ddc4..7016764fe 100644 --- a/code/nel/src/sound/sound_anim_manager.cpp +++ b/code/nel/src/sound/sound_anim_manager.cpp @@ -112,7 +112,7 @@ TSoundAnimId CSoundAnimManager::createAnimation(std::string& name) nlassert(!name.empty()); // create and insert animations - TSoundAnimId id = _Animations.size(); + TSoundAnimId id = (TSoundAnimId)_Animations.size(); CSoundAnimation* anim = new CSoundAnimation(name, id); _Animations.push_back(anim); diff --git a/code/nel/src/sound/sound_bank.cpp b/code/nel/src/sound/sound_bank.cpp index 3de9f6e79..9d8059e24 100644 --- a/code/nel/src/sound/sound_bank.cpp +++ b/code/nel/src/sound/sound_bank.cpp @@ -358,7 +358,7 @@ void CSoundBank::getNames( std::vector &names ) */ uint CSoundBank::countSounds() { - return _Sounds.size(); + return (uint)_Sounds.size(); } diff --git a/code/ryzom/client/src/fog_map.cpp b/code/ryzom/client/src/fog_map.cpp index b0941cfb9..bd1e47978 100644 --- a/code/ryzom/client/src/fog_map.cpp +++ b/code/ryzom/client/src/fog_map.cpp @@ -132,7 +132,7 @@ void CFogMap::getFogParams(float startDist, float endDist, float x, float y, flo NLMISC::CRGBAF CFogMap::getMapValue(TMapType type, float x, float y, NLMISC::CRGBAF defaultValue) const { H_AUTO_USE(RZ_FogMap) - nlassert(type < CFogMapBuild::NumMap) + nlassert(type < CFogMapBuild::NumMap); if (_Map[type].getWidth() == 0) return defaultValue; float mx, my; worldPosToMapPos(x, y, mx, my); @@ -143,7 +143,7 @@ NLMISC::CRGBAF CFogMap::getMapValue(TMapType type, float x, float y, NLMISC::CRG NLMISC::CRGBAF CFogMap::getMapValueFromMapCoord(TMapType type, float x, float y, NLMISC::CRGBAF defaultValue) const { H_AUTO_USE(RZ_FogMap) - nlassert(type < CFogMapBuild::NumMap) + nlassert(type < CFogMapBuild::NumMap); if (_Map[type].getWidth() == 0) return defaultValue; return _Map[type].getColor(x, y); } diff --git a/code/ryzom/client/src/interface_v3/group_list.cpp b/code/ryzom/client/src/interface_v3/group_list.cpp index ca303d8e6..43e6df6c7 100644 --- a/code/ryzom/client/src/interface_v3/group_list.cpp +++ b/code/ryzom/client/src/interface_v3/group_list.cpp @@ -900,7 +900,7 @@ bool CGroupList::addChildAtIndex(CViewBase *child, uint index, bool deleteOn addView (pVB, (sint) index); return true; } - nlstop + nlstop; return false; } return false; diff --git a/code/ryzom/client/src/interface_v3/group_paragraph.cpp b/code/ryzom/client/src/interface_v3/group_paragraph.cpp index a71f0ae1f..04bdc4033 100644 --- a/code/ryzom/client/src/interface_v3/group_paragraph.cpp +++ b/code/ryzom/client/src/interface_v3/group_paragraph.cpp @@ -1074,7 +1074,7 @@ bool CGroupParagraph::addChildAtIndex(CViewBase *child, uint index, bool deleteO addView (pVB, (sint) index); return true; } - nlstop + nlstop; return false; } return false; diff --git a/code/ryzom/client/src/login_xdelta.cpp b/code/ryzom/client/src/login_xdelta.cpp index 7a0c6e459..12df6a500 100644 --- a/code/ryzom/client/src/login_xdelta.cpp +++ b/code/ryzom/client/src/login_xdelta.cpp @@ -626,7 +626,7 @@ CXDeltaPatch::TApplyResult CXDeltaPatch::apply(const std::string &sFileToPatch, if (_Ctrl.SourceInfo.size() == 2) { // _Ctrl.SourceInfo[0].IsData must be true - nlassert(_Ctrl.SourceInfo[0].IsData) + nlassert(_Ctrl.SourceInfo[0].IsData); // index 0 == Data from patch file if (!XDFR[0].init(_FileName, _HeaderOffset, _CtrlOffset, isPatchCompressed())) { diff --git a/code/ryzom/client/src/r2/dmc/client_edition_module.cpp b/code/ryzom/client/src/r2/dmc/client_edition_module.cpp index 1972d3da1..7a92e575f 100644 --- a/code/ryzom/client/src/r2/dmc/client_edition_module.cpp +++ b/code/ryzom/client/src/r2/dmc/client_edition_module.cpp @@ -1762,7 +1762,7 @@ uint32 CClientEditionModule::getCurrentMaxId() return 1000; std::string eid = getEid(); sint32 currentId = _Factory->getMaxId(eid); - nlassert(currentId >= -1) + nlassert(currentId >= -1); return static_cast(currentId + 1); } diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index f147680d9..732699bf5 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -5599,7 +5599,7 @@ void CEditor::onAttrModified(const CObject *value) { CInstance *parentInstance = getInstanceFromObject(parent); sint32 indexInParent = parent->findIndex(son); - nlassert(indexInParent != -1) + nlassert(indexInParent != -1); if (parentInstance) { // we are in an instance (a CObjectTable with an instance id) diff --git a/code/ryzom/client/src/r2/tool_choose_pos_lua.cpp b/code/ryzom/client/src/r2/tool_choose_pos_lua.cpp index b22058e8a..467cb60f7 100644 --- a/code/ryzom/client/src/r2/tool_choose_pos_lua.cpp +++ b/code/ryzom/client/src/r2/tool_choose_pos_lua.cpp @@ -55,7 +55,7 @@ CToolChoosePosLua::CToolChoosePosLua(uint ghostSlot, void CToolChoosePosLua::commit(const NLMISC::CVector &createPosition, float /* createAngle */) { //H_AUTO(R2_CToolChoosePosLua_commit) - nlassert(!_Commited) + nlassert(!_Commited); if (_ValidFunc.isFunction()) { CLuaState &lua = *_ValidFunc.getLuaState(); diff --git a/code/ryzom/common/src/game_share/server_edition_module.cpp b/code/ryzom/common/src/game_share/server_edition_module.cpp index fb70c4fdc..29c0351cc 100644 --- a/code/ryzom/common/src/game_share/server_edition_module.cpp +++ b/code/ryzom/common/src/game_share/server_edition_module.cpp @@ -1168,7 +1168,7 @@ void CServerEditionModule::init(NLNET::IModuleSocket* gateway, CDynamicMapServic void CServerEditionModule::updateRSMGR() { - nlassert(!_SessionManager.isNull()) + nlassert(!_SessionManager.isNull()); nlassert(!_WaitingForBS); RSMGR::CRingSessionManagerProxy rsm(_SessionManager); @@ -5131,7 +5131,7 @@ void CServerEditionModule::wakeUpSessionImpl(CEditionSession* session) { CEditionSession* previous = found->second ; - nlassert( session != previous) + nlassert( session != previous); sessionPtr->swap( *previous); session = previous; } diff --git a/code/ryzom/server/src/ai_service/ai.cpp b/code/ryzom/server/src/ai_service/ai.cpp index a3e16e3fe..b51f1279c 100644 --- a/code/ryzom/server/src/ai_service/ai.cpp +++ b/code/ryzom/server/src/ai_service/ai.cpp @@ -418,7 +418,7 @@ void CAIS::update() // send agglomerated hp changes if (!_CreatureChangeHPList.Entities.empty()) { - nlassert(_CreatureChangeHPList.Entities.size()==_CreatureChangeHPList.DeltaHp.size()) + nlassert(_CreatureChangeHPList.Entities.size()==_CreatureChangeHPList.DeltaHp.size()); _CreatureChangeHPList.send("EGS"); _CreatureChangeHPList.Entities.clear(); _CreatureChangeHPList.DeltaHp.clear(); diff --git a/code/ryzom/server/src/ai_service/ai_logic_action.h b/code/ryzom/server/src/ai_service/ai_logic_action.h index dd2eb551a..631f9f620 100644 --- a/code/ryzom/server/src/ai_service/ai_logic_action.h +++ b/code/ryzom/server/src/ai_service/ai_logic_action.h @@ -58,7 +58,7 @@ public: {} // attach a group family to the action if it supports it (assert otherwise) - virtual void addGroupFamily(CGroupFamily *gf) { nlassert(0) } + virtual void addGroupFamily(CGroupFamily *gf) { nlassert(0); } }; // Code use by native functions and LogicAction diff --git a/code/ryzom/server/src/ai_service/group_profile.cpp b/code/ryzom/server/src/ai_service/group_profile.cpp index 0e2b81f34..0d05625ce 100644 --- a/code/ryzom/server/src/ai_service/group_profile.cpp +++ b/code/ryzom/server/src/ai_service/group_profile.cpp @@ -74,7 +74,7 @@ void CGrpProfileDynFollowPath::calcPath() _FollowRoute.setAIProfile(new CGrpProfileFollowRoute(_Grp, _CurrentRoad->coords(), _CurrentRoad->verticalPos(), true)); CGrpProfileFollowRoute*const fr = static_cast(_FollowRoute.getAIProfile()); - nlassert(_CurrentZone==_CurrentRoad->startZone() || _CurrentZone==_CurrentRoad->endZone()) + nlassert(_CurrentZone==_CurrentRoad->startZone() || _CurrentZone==_CurrentRoad->endZone()); fr->setDirection(_CurrentRoad->startZone()==_CurrentZone); } diff --git a/code/ryzom/server/src/ai_service/script_compiler.cpp b/code/ryzom/server/src/ai_service/script_compiler.cpp index 29ed4b777..9a7a2bfb6 100644 --- a/code/ryzom/server/src/ai_service/script_compiler.cpp +++ b/code/ryzom/server/src/ai_service/script_compiler.cpp @@ -1146,7 +1146,7 @@ void CCompiler::dumpByteCode (const string &sourceCode, const string &fullName, fclose (file); } else - nlstop ("can't open %s for writing", tmp.c_str ()); + nlstopex(("can't open %s for writing", tmp.c_str ())); } CSmartPtr CCompiler::compileCodeOld (const string &sourceCode, const string &fullName, bool debug) const diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp index 53daf0788..ec4b609e7 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp @@ -864,7 +864,7 @@ class CMissionStepKillByName : public IMissionStepTemplate retParams[0].Type = STRING_MANAGER::bot_name; retParams[0].Identifier = TargetName; retParams[1].Type = STRING_MANAGER::integer; - nlassert( subStepStates.size() == 1 ) + nlassert( subStepStates.size() == 1 ); retParams[1].Int = subStepStates[0]; if ( Place != 0xFFFF ) { diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp index d8b3f06d5..f4cd49618 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp @@ -278,7 +278,7 @@ void CCombatAttackerAI::initFromRowId( const TDataSetRow &rowId ) return; #if !FINAL_VERSION - nlassert(entity->getId().getType() == RYZOMID::creature) + nlassert(entity->getId().getType() == RYZOMID::creature); #endif const CStaticCreatures * form = entity->getForm(); @@ -400,7 +400,7 @@ void CCombatAttackerNpc::initFromRowId( const TDataSetRow &rowId ) return; #if !FINAL_VERSION - nlassert(entity->getId().getType() == RYZOMID::npc) + nlassert(entity->getId().getType() == RYZOMID::npc); #endif const CStaticCreatures * form = entity->getForm(); diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.h b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.h index 2b26d428b..8e015b77a 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.h +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.h @@ -212,7 +212,7 @@ public: } #if !FINAL_VERSION - nlassert(character->getId().getType() == RYZOMID::player) + nlassert(character->getId().getType() == RYZOMID::player); #endif _Character = character; diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_defender.h b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_defender.h index 11d25d9c8..4178eec7e 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_defender.h +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_defender.h @@ -95,7 +95,7 @@ public: if ( !TheDataset.isAccessible(rowId)) { nlwarning(" ERROR Get an invalid row id as param for the constructor, should never happens"); - nlstop(""); + nlstop; return; } diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp index 71ecc118d..1099b247e 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp @@ -212,7 +212,7 @@ void CPVPFactionRewardManager::init() } else { - nlstop("Pointer null in map of totem base found !!!!"); + nlstopex(("Pointer null in map of totem base found !!!!")); } } diff --git a/code/ryzom/server/src/logger_service/log_query.h b/code/ryzom/server/src/logger_service/log_query.h index 0a3800767..2eccb17a5 100644 --- a/code/ryzom/server/src/logger_service/log_query.h +++ b/code/ryzom/server/src/logger_service/log_query.h @@ -846,7 +846,7 @@ struct TPredicateNode : public TQueryNode } } else - nlstop + nlstop; } else { diff --git a/code/ryzom/server/src/server_share/msg_ai_service.h b/code/ryzom/server/src/server_share/msg_ai_service.h index a39fbccda..777c208cd 100644 --- a/code/ryzom/server/src/server_share/msg_ai_service.h +++ b/code/ryzom/server/src/server_share/msg_ai_service.h @@ -653,7 +653,7 @@ struct COutpostCreateSquadMsg static uint32 const s_version = 1; uint32 version = s_version; s.serial(version); - nlassert(version==s_version) + nlassert(version==s_version); s.serial(Outpost); s.serial(Group); s.serial(Zone); diff --git a/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp b/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp index 0154c15d5..7dc259524 100644 --- a/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp +++ b/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp @@ -3910,7 +3910,7 @@ endOfWelcomeUserResult: { nldebug("RSM : setScenarioInfo char %u set scenario info for session %u", charId, sessionId.asInt()); - nlstop("Deprecated"); + nlstopex(("Deprecated")); // // load the user // CCharacterPtr character = CCharacter::load(_RingDb, charId, __FILE__, __LINE__);