diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 2376218471e77d3bcd9d7c27a98499790eb2cee1..9532a1c6036ae65d19aa7d2447fda2b066de34b5 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -120,7 +120,7 @@ private: //----------------------------------------------------------------------------- LLAvatarAppearance::LLAvatarXmlInfo::LLAvatarXmlInfo() - : mTexSkinColorInfo(0), mTexHairColorInfo(0), mTexEyeColorInfo(0) + : mTexSkinColorInfo(nullptr), mTexHairColorInfo(nullptr), mTexEyeColorInfo(nullptr) { } @@ -161,31 +161,31 @@ LLAvatarAppearance::LLAvatarXmlInfo::~LLAvatarXmlInfo() //----------------------------------------------------------------------------- LLXmlTree LLAvatarAppearance::sXMLTree; LLXmlTree LLAvatarAppearance::sSkeletonXMLTree; -LLAvatarSkeletonInfo* LLAvatarAppearance::sAvatarSkeletonInfo = NULL; -LLAvatarAppearance::LLAvatarXmlInfo* LLAvatarAppearance::sAvatarXmlInfo = NULL; +LLAvatarSkeletonInfo* LLAvatarAppearance::sAvatarSkeletonInfo = nullptr; +LLAvatarAppearance::LLAvatarXmlInfo* LLAvatarAppearance::sAvatarXmlInfo = nullptr; LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) : LLCharacter(), - mIsDummy(FALSE), - mTexSkinColor( NULL ), - mTexHairColor( NULL ), - mTexEyeColor( NULL ), - mPelvisToFoot(0.f), mHeadOffset(), - mRoot(NULL), - mWearableData(wearable_data), + mRoot(nullptr), + mIsBuilt(FALSE), + mPelvisToFoot(0.f), + mIsDummy(FALSE), + mTexSkinColor(nullptr ), + mTexHairColor(nullptr ), + mTexEyeColor(nullptr ), + mWearableData(wearable_data), mNumBones(0), mNumCollisionVolumes(0), - mCollisionVolumes(NULL), - mIsBuilt(FALSE) + mCollisionVolumes(nullptr) { llassert_always(mWearableData); mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES); for (U32 i = 0; i < mBakedTextureDatas.size(); i++ ) { mBakedTextureDatas[i].mLastTextureID = IMG_DEFAULT_AVATAR; - mBakedTextureDatas[i].mTexLayerSet = NULL; + mBakedTextureDatas[i].mTexLayerSet = nullptr; mBakedTextureDatas[i].mIsLoaded = false; mBakedTextureDatas[i].mIsUsed = false; mBakedTextureDatas[i].mMaskTexName = 0; @@ -609,7 +609,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename) //----------------------------------------------------------------------------- BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 &volume_num, S32 &joint_num) { - LLJoint* joint = NULL; + LLJoint* joint = nullptr; LL_DEBUGS("BVH") << "bone info: name " << info->mName << " isJoint " << info->mIsJoint @@ -689,7 +689,7 @@ BOOL LLAvatarAppearance::allocateCharacterJoints( U32 num ) if (mSkeleton.size() != num) { clearSkeleton(); - mSkeleton = avatar_joint_list_t(num,NULL); + mSkeleton = avatar_joint_list_t(num, nullptr); mNumBones = num; } @@ -727,7 +727,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info) for (iter = info->mBoneInfoList.begin(); iter != info->mBoneInfoList.end(); ++iter) { LLAvatarBoneInfo *bone_info = *iter; - if (!setupBone(bone_info, NULL, current_volume_num, current_joint_num)) + if (!setupBone(bone_info, nullptr, current_volume_num, current_joint_num)) { LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL; return FALSE; @@ -812,7 +812,7 @@ void LLAvatarAppearance::buildCharacter() meshIter != joint->mMeshParts.end(); ++meshIter) { LLAvatarJointMesh * mesh = *meshIter; - mesh->setMesh(NULL); + mesh->setMesh(nullptr); } } @@ -1116,7 +1116,7 @@ BOOL LLAvatarAppearance::loadMeshNodes() const std::string &type = info->mType; S32 lod = info->mLOD; - LLAvatarJointMesh* mesh = NULL; + LLAvatarJointMesh* mesh = nullptr; U8 mesh_id = 0; BOOL found_mesh_id = FALSE; @@ -1162,7 +1162,7 @@ BOOL LLAvatarAppearance::loadMeshNodes() // Do not touch!!! mesh->setColor( LLColor4::white ); - LLPolyMesh *poly_mesh = NULL; + LLPolyMesh *poly_mesh = nullptr; if (!info->mReferenceMeshName.empty()) { @@ -1311,7 +1311,7 @@ LLJoint *LLAvatarAppearance::getCharacterJoint( U32 num ) if ((S32)num >= mSkeleton.size() || (S32)num < 0) { - return NULL; + return nullptr; } if (!mSkeleton[num]) { @@ -1341,7 +1341,7 @@ LLJoint* LLAvatarAppearance::findCollisionVolume(U32 volume_id) { if ((S32)volume_id > mNumCollisionVolumes) { - return NULL; + return nullptr; } return &mCollisionVolumes[volume_id]; diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index a7f1dcee27b5d5d954749230a465a683d6cef957..3056270be7717f975d6339094bdcd94472378dc9 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -90,14 +90,14 @@ public: // LLCharacter interface and related //-------------------------------------------------------------------- public: - /*virtual*/ LLJoint* getCharacterJoint(U32 num); + /*virtual*/ LLJoint* getCharacterJoint(U32 num) override; - /*virtual*/ const char* getAnimationPrefix() { return "avatar"; } - /*virtual*/ LLVector3 getVolumePos(S32 joint_index, LLVector3& volume_offset); - /*virtual*/ LLJoint* findCollisionVolume(U32 volume_id); - /*virtual*/ S32 getCollisionVolumeID(std::string &name); - /*virtual*/ LLPolyMesh* getHeadMesh(); - /*virtual*/ LLPolyMesh* getUpperBodyMesh(); + /*virtual*/ const char* getAnimationPrefix() override { return "avatar"; } + /*virtual*/ LLVector3 getVolumePos(S32 joint_index, LLVector3& volume_offset) override; + /*virtual*/ LLJoint* findCollisionVolume(U32 volume_id) override; + /*virtual*/ S32 getCollisionVolumeID(std::string &name) override; + /*virtual*/ LLPolyMesh* getHeadMesh() override; + /*virtual*/ LLPolyMesh* getUpperBodyMesh() override; /** Inherited ** ** @@ -135,7 +135,7 @@ protected: public: F32 getPelvisToFoot() const { return mPelvisToFoot; } - /*virtual*/ LLJoint* getRootJoint() { return mRoot; } + /*virtual*/ LLJoint* getRootJoint() override { return mRoot; } LLVector3 mHeadOffset; // current head position LLAvatarJoint *mRoot; diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index 7d69ada03167c91f7bf255fde338f9b9fde670e0..09e29bf23c9b2ad6e9aff39d74ea9984afa914c7 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -167,12 +167,12 @@ LLAvatarAppearanceDictionary::TextureEntry::TextureEntry(const std::string &name const std::string &default_image_name, LLWearableType::EType wearable_type) : LLDictionaryEntry(name), + mDefaultImageName(default_image_name), + mWearableType(wearable_type), mIsLocalTexture(is_local_texture), mIsBakedTexture(!is_local_texture), mIsUsedByBakedTexture(baked_texture_index != BAKED_NUM_INDICES), - mBakedTextureIndex(baked_texture_index), - mDefaultImageName(default_image_name), - mWearableType(wearable_type) + mBakedTextureIndex(baked_texture_index) { } @@ -181,8 +181,8 @@ LLAvatarAppearanceDictionary::MeshEntry::MeshEntry(EBakedTextureIndex baked_inde U8 level, LLJointPickName pick) : LLDictionaryEntry(name), - mBakedID(baked_index), mLOD(level), + mBakedID(baked_index), mPickName(pick) { } @@ -192,8 +192,8 @@ LLAvatarAppearanceDictionary::BakedEntry::BakedEntry(ETextureIndex tex_index, U32 num_local_textures, ... ) : LLDictionaryEntry(name), - mWearablesHashID(LLUUID(hash_name)), - mTextureIndex(tex_index) + mTextureIndex(tex_index), + mWearablesHashID(LLUUID(hash_name)) { va_list argp; diff --git a/indra/llappearance/llavatarjoint.h b/indra/llappearance/llavatarjoint.h index fec91503c787b863ca0a7223561649ce9a257dd4..e3b5323aef3a12819fd550abe03f786231f4340c 100644 --- a/indra/llappearance/llavatarjoint.h +++ b/indra/llappearance/llavatarjoint.h @@ -48,7 +48,7 @@ public: LLAvatarJoint(); LLAvatarJoint(S32 joint_num); // *TODO: Only used for LLVOAvatarSelf::mScreenp. *DOES NOT INITIALIZE mResetAfterRestoreOldXform* - LLAvatarJoint(const std::string &name, LLJoint *parent = NULL); + LLAvatarJoint(const std::string &name, LLJoint *parent = nullptr); virtual ~LLAvatarJoint(); // Gets the validity of this joint @@ -127,8 +127,8 @@ public: LLAvatarJointCollisionVolume(); virtual ~LLAvatarJointCollisionVolume() {}; - /*virtual*/ BOOL inheritScale() { return TRUE; } - /*virtual*/ U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ); + /*virtual*/ BOOL inheritScale() override { return TRUE; } + /*virtual*/ U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ) override; void renderCollision(); diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp index e262cba9fa4357faaba9f14b183f2efa163f2710..b35e2f5094a4d04f3c623218a3c0825a4ec84adc 100644 --- a/indra/llappearance/lldriverparam.cpp +++ b/indra/llappearance/lldriverparam.cpp @@ -39,7 +39,7 @@ //----------------------------------------------------------------------------- LLDriverParamInfo::LLDriverParamInfo() : - mDriverParam(NULL) + mDriverParam(nullptr) { } @@ -170,7 +170,7 @@ LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearabl : LLViewerVisualParam(), mDefaultVec(), mDriven(), - mCurrentDistortionParam( NULL ), + mCurrentDistortionParam(nullptr ), mAvatarAppearance(appearance), mWearablep(wearable) { @@ -369,8 +369,8 @@ LLVector4a LLDriverParam::getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) const LLVector4a* LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) { - mCurrentDistortionParam = NULL; - const LLVector4a* v = NULL; + mCurrentDistortionParam = nullptr; + const LLVector4a* v = nullptr; for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); ++iter ) { LLDrivenEntry* driven = &(*iter); @@ -390,10 +390,10 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly llassert( mCurrentDistortionParam ); if( !mCurrentDistortionParam ) { - return NULL; + return nullptr; } - LLDrivenEntry* driven = NULL; + LLDrivenEntry* driven = nullptr; entry_list_t::iterator iter; // Set mDriven iteration to the right point @@ -409,7 +409,7 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly llassert(driven); if (!driven) { - return NULL; // shouldn't happen, but... + return nullptr; // shouldn't happen, but... } // We're already in the middle of a param's distortions, so get the next one. @@ -442,7 +442,7 @@ const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const { if (0 > index || index >= mDriven.size()) { - return NULL; + return nullptr; } return mDriven[index].mParam; } diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h index db0967e855c6a16b4b93c83a2e68a275f383303c..2f5273438ede45b9f54dc5ccdd4077fdcfd0e2d0 100644 --- a/indra/llappearance/lldriverparam.h +++ b/indra/llappearance/lldriverparam.h @@ -65,9 +65,9 @@ public: LLDriverParamInfo(); /*virtual*/ ~LLDriverParamInfo() {}; - /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); + /*virtual*/ BOOL parseXml(LLXmlTreeNode* node) override; - /*virtual*/ void toStream(std::ostream &out); + /*virtual*/ void toStream(std::ostream &out) override; protected: typedef std::deque<LLDrivenEntryInfo> entry_info_list_t; @@ -84,7 +84,7 @@ private: // Hide the default constructor. Force construction with LLAvatarAppearance. LLDriverParam() {} public: - LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable = NULL); + LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable = nullptr); ~LLDriverParam(); void* operator new(size_t size) @@ -107,23 +107,23 @@ public: void updateCrossDrivenParams(LLWearableType::EType driven_type); - /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const override; // LLVisualParam Virtual functions - /*virtual*/ void apply( ESex sex ) {} // apply is called separately for each driven param. - /*virtual*/ void setWeight(F32 weight, BOOL upload_bake); - /*virtual*/ void setAnimationTarget( F32 target_value, BOOL upload_bake); - /*virtual*/ void stopAnimating(BOOL upload_bake); - /*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params); - /*virtual*/ void resetDrivenParams(); + /*virtual*/ void apply( ESex sex ) override {} // apply is called separately for each driven param. + /*virtual*/ void setWeight(F32 weight, BOOL upload_bake) override; + /*virtual*/ void setAnimationTarget( F32 target_value, BOOL upload_bake) override; + /*virtual*/ void stopAnimating(BOOL upload_bake) override; + /*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params) override; + /*virtual*/ void resetDrivenParams() override; // LLViewerVisualParam Virtual functions - /*virtual*/ F32 getTotalDistortion(); - /*virtual*/ const LLVector4a& getAvgDistortion(); - /*virtual*/ F32 getMaxDistortion(); - /*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh); - /*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh); - /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh); + /*virtual*/ F32 getTotalDistortion() override; + /*virtual*/ const LLVector4a& getAvgDistortion() override; + /*virtual*/ F32 getMaxDistortion() override; + /*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) override; + /*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) override; + /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) override; S32 getDrivenParamsCount() const; const LLViewerVisualParam* getDrivenParam(S32 index) const; diff --git a/indra/llappearance/lllocaltextureobject.cpp b/indra/llappearance/lllocaltextureobject.cpp index 58689ce9faabea79bf42e681cb8ae287a71dc59d..d709c7fb5f1cc842f65b09d59746e88c2ac48960 100644 --- a/indra/llappearance/lllocaltextureobject.cpp +++ b/indra/llappearance/lllocaltextureobject.cpp @@ -41,7 +41,7 @@ LLLocalTextureObject::LLLocalTextureObject() : mIsBakedReady(FALSE), mDiscard(MAX_DISCARD_LEVEL+1) { - mImage = NULL; + mImage = nullptr; } LLLocalTextureObject::LLLocalTextureObject(LLGLTexture* image, const LLUUID& id) : @@ -90,7 +90,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(U32 index) const { if (index >= getNumTexLayers()) { - return NULL; + return nullptr; } return mTexLayers[index]; @@ -107,7 +107,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name) } } - return NULL; + return nullptr; } U32 LLLocalTextureObject::getNumTexLayers() const @@ -142,7 +142,7 @@ BOOL LLLocalTextureObject::setTexLayer(LLTexLayer *new_tex_layer, U32 index) return FALSE; } - if (new_tex_layer == NULL) + if (new_tex_layer == nullptr) { return removeTexLayer(index); } @@ -161,7 +161,7 @@ BOOL LLLocalTextureObject::setTexLayer(LLTexLayer *new_tex_layer, U32 index) BOOL LLLocalTextureObject::addTexLayer(LLTexLayer *new_tex_layer, LLWearable *wearable) { - if (new_tex_layer == NULL) + if (new_tex_layer == nullptr) { return FALSE; } @@ -174,7 +174,7 @@ BOOL LLLocalTextureObject::addTexLayer(LLTexLayer *new_tex_layer, LLWearable *we BOOL LLLocalTextureObject::addTexLayer(LLTexLayerTemplate *new_tex_layer, LLWearable *wearable) { - if (new_tex_layer == NULL) + if (new_tex_layer == nullptr) { return FALSE; } diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index 2e7c0f881cb56881d5e434147bd41ac39075aa99..3de0bf29e9ef2f18af6613727089e59c101aa1c5 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -66,25 +66,25 @@ LLPolyMesh::LLPolyMeshSharedDataTable LLPolyMesh::sGlobalSharedMeshList; LLPolyMeshSharedData::LLPolyMeshSharedData() { mNumVertices = 0; - mBaseCoords = NULL; - mBaseNormals = NULL; - mBaseBinormals = NULL; - mTexCoords = NULL; - mDetailTexCoords = NULL; - mWeights = NULL; + mBaseCoords = nullptr; + mBaseNormals = nullptr; + mBaseBinormals = nullptr; + mTexCoords = nullptr; + mDetailTexCoords = nullptr; + mWeights = nullptr; mHasWeights = FALSE; mHasDetailTexCoords = FALSE; mNumFaces = 0; - mFaces = NULL; + mFaces = nullptr; mNumJointNames = 0; - mJointNames = NULL; + mJointNames = nullptr; - mTriangleIndices = NULL; + mTriangleIndices = nullptr; mNumTriangleIndices = 0; - mReferenceData = NULL; + mReferenceData = nullptr; mLastIndexOffset = -1; } @@ -129,34 +129,34 @@ void LLPolyMeshSharedData::freeMeshData() mNumVertices = 0; ll_aligned_free_16(mBaseCoords); - mBaseCoords = NULL; + mBaseCoords = nullptr; ll_aligned_free_16(mBaseNormals); - mBaseNormals = NULL; + mBaseNormals = nullptr; ll_aligned_free_16(mBaseBinormals); - mBaseBinormals = NULL; + mBaseBinormals = nullptr; ll_aligned_free_16(mTexCoords); - mTexCoords = NULL; + mTexCoords = nullptr; ll_aligned_free_16(mDetailTexCoords); - mDetailTexCoords = NULL; + mDetailTexCoords = nullptr; ll_aligned_free_16(mWeights); - mWeights = NULL; + mWeights = nullptr; } mNumFaces = 0; delete [] mFaces; - mFaces = NULL; + mFaces = nullptr; mNumJointNames = 0; delete [] mJointNames; - mJointNames = NULL; + mJointNames = nullptr; delete [] mTriangleIndices; - mTriangleIndices = NULL; + mTriangleIndices = nullptr; // mVertFaceMap.deleteAllData(); } @@ -762,7 +762,7 @@ const S32 *LLPolyMeshSharedData::getSharedVert(S32 vert) { return &mSharedVerts[vert]; } - return NULL; + return nullptr; } //----------------------------------------------------------------------------- @@ -785,8 +785,8 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ mSharedData = shared_data; mReferenceMesh = reference_mesh; - mAvatarp = NULL; - mVertexData = NULL; + mAvatarp = nullptr; + mVertexData = nullptr; mCurVertexCount = 0; mFaceIndexCount = 0; @@ -853,7 +853,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m //------------------------------------------------------------------------- // search for an existing mesh by this name //------------------------------------------------------------------------- - LLPolyMeshSharedData* meshSharedData = get_if_there(sGlobalSharedMeshList, name, (LLPolyMeshSharedData*)NULL); + LLPolyMeshSharedData* meshSharedData = get_if_there(sGlobalSharedMeshList, name, (LLPolyMeshSharedData*)nullptr); if (meshSharedData) { // LL_INFOS() << "Polymesh " << name << " found in global mesh table." << LL_ENDL; @@ -875,7 +875,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m if ( ! mesh_data->loadMesh( full_path ) ) { delete mesh_data; - return NULL; + return nullptr; } LLPolyMesh *poly_mesh = new LLPolyMesh(mesh_data, reference_mesh); @@ -1026,7 +1026,7 @@ void LLPolyMesh::initializeForMorph() LLPolyMorphData* LLPolyMesh::getMorphData(const std::string& morph_name) { if (!mSharedData) - return NULL; + return nullptr; for (LLPolyMeshSharedData::morphdata_list_t::iterator iter = mSharedData->mMorphData.begin(); iter != mSharedData->mMorphData.end(); ++iter) { @@ -1036,7 +1036,7 @@ LLPolyMorphData* LLPolyMesh::getMorphData(const std::string& morph_name) return morph_data; } } - return NULL; + return nullptr; } //----------------------------------------------------------------------------- diff --git a/indra/llappearance/llpolymesh.h b/indra/llappearance/llpolymesh.h index 22b92fa61d424a6ee759b8cf111ece7f9a1de8ae..e3fcab2e7808f190800753add87e277978c857e7 100644 --- a/indra/llappearance/llpolymesh.h +++ b/indra/llappearance/llpolymesh.h @@ -136,7 +136,7 @@ public: const S32 *getSharedVert(S32 vert); - BOOL isLOD() { return (mReferenceData != NULL); } + BOOL isLOD() { return (mReferenceData != nullptr); } }; @@ -164,7 +164,7 @@ public: // Requests a mesh by name. // If the mesh already exists in the global mesh table, it is returned, // otherwise it is loaded from file, added to the table, and returned. - static LLPolyMesh *getMesh( const std::string &name, LLPolyMesh* reference_mesh = NULL); + static LLPolyMesh *getMesh( const std::string &name, LLPolyMesh* reference_mesh = nullptr); // Frees all loaded meshes. // This should only be called once you know there are no outstanding diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index a9576ce269d2b9c834a26fe76fffc5a393380314..a2bb5ec418467fbb9e9b079a89a415d62cb4b294 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -52,26 +52,26 @@ LLPolyMorphData::LLPolyMorphData(const std::string& morph_name) mTotalDistortion = 0.f; mAvgDistortion.clear(); mMaxDistortion = 0.f; - mVertexIndices = NULL; - mCoords = NULL; - mNormals = NULL; - mBinormals = NULL; - mTexCoords = NULL; + mVertexIndices = nullptr; + mCoords = nullptr; + mNormals = nullptr; + mBinormals = nullptr; + mTexCoords = nullptr; - mMesh = NULL; + mMesh = nullptr; } LLPolyMorphData::LLPolyMorphData(const LLPolyMorphData &rhs) : mName(rhs.mName), mNumIndices(rhs.mNumIndices), + mVertexIndices(nullptr), + mCoords(nullptr), + mNormals(nullptr), + mBinormals(nullptr), + mTexCoords(nullptr), mTotalDistortion(rhs.mTotalDistortion), - mAvgDistortion(rhs.mAvgDistortion), mMaxDistortion(rhs.mMaxDistortion), - mVertexIndices(NULL), - mCoords(NULL), - mNormals(NULL), - mBinormals(NULL), - mTexCoords(NULL) + mAvgDistortion(rhs.mAvgDistortion) { const S32 numVertices = mNumIndices; @@ -219,34 +219,34 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh) //----------------------------------------------------------------------------- void LLPolyMorphData::freeData() { - if (mCoords != NULL) + if (mCoords != nullptr) { ll_aligned_free_16(mCoords); - mCoords = NULL; + mCoords = nullptr; } - if (mNormals != NULL) + if (mNormals != nullptr) { ll_aligned_free_16(mNormals); - mNormals = NULL; + mNormals = nullptr; } - if (mBinormals != NULL) + if (mBinormals != nullptr) { ll_aligned_free_16(mBinormals); - mBinormals = NULL; + mBinormals = nullptr; } - if (mTexCoords != NULL) + if (mTexCoords != nullptr) { delete [] mTexCoords; - mTexCoords = NULL; + mTexCoords = nullptr; } - if (mVertexIndices != NULL) + if (mVertexIndices != nullptr) { delete [] mVertexIndices; - mVertexIndices = NULL; + mVertexIndices = nullptr; } } @@ -278,7 +278,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node) LLXmlTreeNode *paramNode = node->getChildByName("param_morph"); - if (NULL == paramNode) + if (nullptr == paramNode) { LL_WARNS() << "Failed to getChildByName(\"param_morph\")" << LL_ENDL; @@ -316,9 +316,9 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node) //----------------------------------------------------------------------------- LLPolyMorphTarget::LLPolyMorphTarget(LLPolyMesh *poly_mesh) : LLViewerVisualParam(), - mMorphData(NULL), + mMorphData(nullptr), mMesh(poly_mesh), - mVertMask(NULL), + mVertMask(nullptr), mLastSex(SEX_FEMALE), mNumMorphMasksPending(0), mVolumeMorphs() @@ -332,7 +332,7 @@ LLPolyMorphTarget::LLPolyMorphTarget(const LLPolyMorphTarget& pOther) : LLViewerVisualParam(pOther), mMorphData(pOther.mMorphData), mMesh(pOther.mMesh), - mVertMask(pOther.mVertMask == NULL ? NULL : new LLPolyVertexMask(*pOther.mVertMask)), + mVertMask(pOther.mVertMask == nullptr ? NULL : new LLPolyVertexMask(*pOther.mVertMask)), mLastSex(pOther.mLastSex), mNumMorphMasksPending(pOther.mNumMorphMasksPending), mVolumeMorphs(pOther.mVolumeMorphs) @@ -345,7 +345,7 @@ LLPolyMorphTarget::LLPolyMorphTarget(const LLPolyMorphTarget& pOther) LLPolyMorphTarget::~LLPolyMorphTarget() { delete mVertMask; - mVertMask = NULL; + mVertMask = nullptr; } //----------------------------------------------------------------------------- @@ -452,18 +452,18 @@ const LLVector4a *LLPolyMorphTarget::getFirstDistortion(U32 *index, LLPolyMesh * if (mMorphData->mNumIndices) { resultVec = &mMorphData->mCoords[mMorphData->mCurrentIndex]; - if (index != NULL) + if (index != nullptr) { *index = mMorphData->mVertexIndices[mMorphData->mCurrentIndex]; } - if (poly_mesh != NULL) + if (poly_mesh != nullptr) { *poly_mesh = mMesh; } return resultVec; } - return NULL; + return nullptr; } //----------------------------------------------------------------------------- @@ -478,17 +478,17 @@ const LLVector4a *LLPolyMorphTarget::getNextDistortion(U32 *index, LLPolyMesh ** if (mMorphData->mCurrentIndex < mMorphData->mNumIndices) { resultVec = &mMorphData->mCoords[mMorphData->mCurrentIndex]; - if (index != NULL) + if (index != nullptr) { *index = mMorphData->mVertexIndices[mMorphData->mCurrentIndex]; } - if (poly_mesh != NULL) + if (poly_mesh != nullptr) { *poly_mesh = mMesh; } return resultVec; } - return NULL; + return nullptr; } //----------------------------------------------------------------------------- @@ -778,7 +778,7 @@ LLPolyVertexMask::LLPolyVertexMask(const LLPolyVertexMask& pOther) LLPolyVertexMask::~LLPolyVertexMask() { delete [] mWeights; - mWeights = NULL; + mWeights = nullptr; } //----------------------------------------------------------------------------- @@ -841,7 +841,7 @@ F32* LLPolyVertexMask::getMorphMaskWeights() { if (!mWeightsGenerated) { - return NULL; + return nullptr; } return mWeights; diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h index 80c9507f1633bef1bc366fa23fe0ec481fe500d0..407f945873c2dd6546487ec6c8337ac00552fffd 100644 --- a/indra/llappearance/llpolymorph.h +++ b/indra/llappearance/llpolymorph.h @@ -136,7 +136,7 @@ public: LLPolyMorphTargetInfo(); /*virtual*/ ~LLPolyMorphTargetInfo() {}; - /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); + /*virtual*/ BOOL parseXml(LLXmlTreeNode* node) override; protected: std::string mMorphName; @@ -162,19 +162,19 @@ public: // This sets mInfo and calls initialization functions BOOL setInfo(LLPolyMorphTargetInfo *info); - /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const override; // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); - /*virtual*/ void apply( ESex sex ); + /*virtual*/ void apply( ESex sex ) override; // LLViewerVisualParam Virtual functions - /*virtual*/ F32 getTotalDistortion(); - /*virtual*/ const LLVector4a& getAvgDistortion(); - /*virtual*/ F32 getMaxDistortion(); - /*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh); - /*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh); - /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh); + /*virtual*/ F32 getTotalDistortion() override; + /*virtual*/ const LLVector4a& getAvgDistortion() override; + /*virtual*/ F32 getMaxDistortion() override; + /*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) override; + /*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) override; + /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) override; void applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert); void addPendingMorphMask() { mNumMorphMasksPending++; } diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index 9a3b45330fb8c0d45ad90415429651c233b64d8a..9659908173ff13187a2014c1aa0a46a7ffd6c7be 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -58,7 +58,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node) LLXmlTreeNode* skeletalParam = node->getChildByName("param_skeleton"); - if (NULL == skeletalParam) + if (nullptr == skeletalParam) { LL_WARNS() << "Failed to getChildByName(\"param_skeleton\")" << LL_ENDL; diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h index 4c25744cc6ddfb35a36766d0b6bbfcc5edf8c5b0..7d612a4abaa7d0898b69fe64f8b35b938f35cb0a 100644 --- a/indra/llappearance/llpolyskeletaldistortion.h +++ b/indra/llappearance/llpolyskeletaldistortion.h @@ -64,7 +64,7 @@ public: LLPolySkeletalDistortionInfo(); /*virtual*/ ~LLPolySkeletalDistortionInfo() {}; - /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); + /*virtual*/ BOOL parseXml(LLXmlTreeNode* node) override; protected: typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t; @@ -97,19 +97,21 @@ public: // This sets mInfo and calls initialization functions BOOL setInfo(LLPolySkeletalDistortionInfo *info); - /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const override; // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); - /*virtual*/ void apply( ESex sex ); + /*virtual*/ void apply( ESex sex ) override; // LLViewerVisualParam Virtual functions - /*virtual*/ F32 getTotalDistortion() { return 0.1f; } - /*virtual*/ const LLVector4a& getAvgDistortion() { return mDefaultVec; } - /*virtual*/ F32 getMaxDistortion() { return 0.1f; } - /*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh){return LLVector4a(0.001f, 0.001f, 0.001f);} - /*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return &mDefaultVec;}; - /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;}; + /*virtual*/ F32 getTotalDistortion() override { return 0.1f; } + /*virtual*/ const LLVector4a& getAvgDistortion() override { return mDefaultVec; } + /*virtual*/ F32 getMaxDistortion() override { return 0.1f; } + /*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) override {return LLVector4a(0.001f, 0.001f, 0.001f);} + /*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) override + {index = nullptr; poly_mesh = nullptr; return &mDefaultVec;}; + /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) override + {index = nullptr; poly_mesh = nullptr; return nullptr;}; protected: LLPolySkeletalDistortion(const LLPolySkeletalDistortion& pOther); diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index 01165c50253ef6e9965b106a77e7d4d75721f671..3be276f31789c4dac321913f4b8f0472f6c907e8 100644 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -40,7 +40,7 @@ class LLWearable; LLTexGlobalColor::LLTexGlobalColor(LLAvatarAppearance* appearance) : mAvatarAppearance(appearance), - mInfo(NULL) + mInfo(nullptr) { } @@ -64,7 +64,7 @@ BOOL LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info) LLTexParamGlobalColor* param_color = new LLTexParamGlobalColor(this); if (!param_color->setInfo(*iter, TRUE)) { - mInfo = NULL; + mInfo = nullptr; return FALSE; } mParamGlobalColorList.push_back(param_color); diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 576850f97822b4f5d97872e400f634f54ff989de..e669178fa92eec84b3cb8b4df9b95b5b249013b7 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -276,7 +276,7 @@ LLTexLayerSet::LLTexLayerSet(LLAvatarAppearance* const appearance) : mAvatarAppearance( appearance ), mIsVisible( TRUE ), mBakedTexIndex(LLAvatarAppearanceDefines::BAKED_HEAD), - mInfo( NULL ) + mInfo(nullptr ) { } @@ -306,7 +306,7 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info) iter != info->mLayerInfoList.end(); ++iter) { - LLTexLayerInterface *layer = NULL; + LLTexLayerInterface *layer = nullptr; if ( (*iter)->isUserSettable() ) { layer = new LLTexLayerTemplate( this, getAvatarAppearance() ); @@ -316,9 +316,9 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info) layer = new LLTexLayer(this); } // this is the first time this layer (of either type) is being created - make sure you add the parameters to the avatar appearance - if (!layer->setInfo(*iter, NULL)) + if (!layer->setInfo(*iter, nullptr)) { - mInfo = NULL; + mInfo = nullptr; return FALSE; } if (!layer->isVisibilityMask()) @@ -505,7 +505,7 @@ void LLTexLayerSet::destroyComposite() { if( mComposite ) { - mComposite = NULL; + mComposite = nullptr; } } @@ -836,15 +836,15 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) LLTexLayerInterface::LLTexLayerInterface(LLTexLayerSet* const layer_set): mTexLayerSet( layer_set ), + mInfo(nullptr), mMorphMasksValid( FALSE ), - mInfo(NULL), mHasMorph(FALSE) { } LLTexLayerInterface::LLTexLayerInterface(const LLTexLayerInterface &layer, LLWearable *wearable): mTexLayerSet( layer.mTexLayerSet ), - mInfo(NULL) + mInfo(nullptr) { // don't add visual params for cloned layers setInfo(layer.getInfo(), wearable); @@ -856,7 +856,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab { // setInfo should only be called once. Code is not robust enough to handle redefinition of a texlayer. // Not a critical warning, but could be useful for debugging later issues. -Nyx - if (mInfo != NULL) + if (mInfo != nullptr) { LL_WARNS() << "mInfo != NULL" << LL_ENDL; } @@ -874,7 +874,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab param_color = new LLTexLayerParamColor(this); if (!param_color->setInfo(*iter, TRUE)) { - mInfo = NULL; + mInfo = nullptr; return FALSE; } } @@ -883,7 +883,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab param_color = (LLTexLayerParamColor*)wearable->getVisualParam((*iter)->getID()); if (!param_color) { - mInfo = NULL; + mInfo = nullptr; return FALSE; } } @@ -901,7 +901,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab param_alpha = new LLTexLayerParamAlpha( this ); if (!param_alpha->setInfo(*iter, TRUE)) { - mInfo = NULL; + mInfo = nullptr; return FALSE; } } @@ -910,7 +910,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab param_alpha = (LLTexLayerParamAlpha*) wearable->getVisualParam((*iter)->getID()); if (!param_alpha) { - mInfo = NULL; + mInfo = nullptr; return FALSE; } } @@ -1005,7 +1005,7 @@ void LLTexLayerInterface::invalidateMorphMasks() LLViewerVisualParam* LLTexLayerInterface::getVisualParamPtr(S32 index) const { - LLViewerVisualParam *result = NULL; + LLViewerVisualParam *result = nullptr; for (param_color_list_t::const_iterator color_iter = mParamColorList.begin(); color_iter != mParamColorList.end() && !result; ++color_iter) { if ((*color_iter)->getID() == index) @@ -1039,13 +1039,13 @@ LLViewerVisualParam* LLTexLayerInterface::getVisualParamPtr(S32 index) const //----------------------------------------------------------------------------- LLTexLayer::LLTexLayer(LLTexLayerSet* const layer_set) : LLTexLayerInterface( layer_set ), - mLocalTextureObject(NULL) + mLocalTextureObject(nullptr) { } LLTexLayer::LLTexLayer(const LLTexLayer &layer, LLWearable *wearable) : LLTexLayerInterface( layer, wearable ), - mLocalTextureObject(NULL) + mLocalTextureObject(nullptr) { } @@ -1203,13 +1203,13 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height) if( (getInfo()->mLocalTexture != -1) && !getInfo()->mUseLocalTextureAlphaOnly ) { { - LLGLTexture* tex = NULL; + LLGLTexture* tex = nullptr; if (mLocalTextureObject && mLocalTextureObject->getImage()) { tex = mLocalTextureObject->getImage(); if (mLocalTextureObject->getID() == IMG_DEFAULT_AVATAR) { - tex = NULL; + tex = nullptr; } } else @@ -1561,7 +1561,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC } U32 cache_index = alpha_mask_crc.getCRC(); - U8* alpha_data = NULL; + U8* alpha_data = nullptr; // We believe we need to generate morph masks, do not assume that the cached version is accurate. // We can get bad morph masks during login, on minimize, and occasional gl errors. // We should only be doing this when we believe something has changed with respect to the user's appearance. @@ -1723,11 +1723,11 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const { if (mWearableCache.size() <= i) { - return NULL; + return nullptr; } LLWearable *wearable = mWearableCache[i]; - LLLocalTextureObject *lto = NULL; - LLTexLayer *layer = NULL; + LLLocalTextureObject *lto = nullptr; + LLTexLayer *layer = nullptr; if (wearable) { lto = wearable->getLocalTextureObject(mInfo->mLocalTexture); @@ -1750,9 +1750,9 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const updateWearableCache(); for (wearable_cache_t::const_iterator iter = mWearableCache.begin(); iter!= mWearableCache.end(); ++iter) { - LLWearable* wearable = NULL; - LLLocalTextureObject *lto = NULL; - LLTexLayer *layer = NULL; + LLWearable* wearable = nullptr; + LLLocalTextureObject *lto = nullptr; + LLTexLayer *layer = nullptr; wearable = *iter; if (wearable) { @@ -1866,7 +1866,7 @@ LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name) return layer; } } - return NULL; + return nullptr; } void LLTexLayerSet::cloneTemplates(LLLocalTextureObject *lto, LLAvatarAppearanceDefines::ETextureIndex tex_index, LLWearable *wearable) @@ -1894,9 +1894,9 @@ void LLTexLayerSet::cloneTemplates(LLLocalTextureObject *lto, LLAvatarAppearance //----------------------------------------------------------------------------- LLTexLayerStaticImageList::LLTexLayerStaticImageList() : + mImageNames(16384), mGLBytes(0), - mTGABytes(0), - mImageNames(16384) + mTGABytes(0) { } @@ -1959,7 +1959,7 @@ LLImageTGA* LLTexLayerStaticImageList::getImageTGA(const std::string& file_name) } else { - return NULL; + return nullptr; } } } @@ -2007,7 +2007,7 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, } else { - tex = NULL; + tex = nullptr; } } diff --git a/indra/llappearance/lltexlayer.h b/indra/llappearance/lltexlayer.h index 9318b23fd199b32841d84a7192748634dcf282e2..5adcc937d0c7339d8cd118ca82176a37443be082 100644 --- a/indra/llappearance/lltexlayer.h +++ b/indra/llappearance/lltexlayer.h @@ -121,13 +121,13 @@ public: LLTexLayerTemplate(LLTexLayerSet* const layer_set, LLAvatarAppearance* const appearance); LLTexLayerTemplate(const LLTexLayerTemplate &layer); /*virtual*/ ~LLTexLayerTemplate(); - /*virtual*/ BOOL render(S32 x, S32 y, S32 width, S32 height); - /*virtual*/ BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions - /*virtual*/ BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer - /*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height); - /*virtual*/ void setHasMorph(BOOL newval); - /*virtual*/ void deleteCaches(); - /*virtual*/ BOOL isInvisibleAlphaMask() const; + /*virtual*/ BOOL render(S32 x, S32 y, S32 width, S32 height) override; + /*virtual*/ BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable) override; // This sets mInfo and calls initialization functions + /*virtual*/ BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) override; // Multiplies a single alpha texture against the frame buffer + /*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height) override; + /*virtual*/ void setHasMorph(BOOL newval) override; + /*virtual*/ void deleteCaches() override; + /*virtual*/ BOOL isInvisibleAlphaMask() const override; protected: U32 updateWearableCache() const; LLTexLayer* getLayer(U32 i) const; @@ -151,23 +151,23 @@ public: LLTexLayer(const LLTexLayerTemplate &layer_template, LLLocalTextureObject *lto, LLWearable *wearable); /*virtual*/ ~LLTexLayer(); - /*virtual*/ BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions - /*virtual*/ BOOL render(S32 x, S32 y, S32 width, S32 height); + /*virtual*/ BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable) override; // This sets mInfo and calls initialization functions + /*virtual*/ BOOL render(S32 x, S32 y, S32 width, S32 height) override; - /*virtual*/ void deleteCaches(); + /*virtual*/ void deleteCaches() override; const U8* getAlphaData() const; BOOL findNetColor(LLColor4* color) const; - /*virtual*/ BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer - /*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height); + /*virtual*/ BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) override; // Multiplies a single alpha texture against the frame buffer + /*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height) override; void renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLColor4 &layer_color, bool force_render); void addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32 height); - /*virtual*/ BOOL isInvisibleAlphaMask() const; + /*virtual*/ BOOL isInvisibleAlphaMask() const override; void setLTO(LLLocalTextureObject *lto) { mLocalTextureObject = lto; } LLLocalTextureObject* getLTO() { return mLocalTextureObject; } - /*virtual*/ void asLLSD(LLSD& sd) const; + /*virtual*/ void asLLSD(LLSD& sd) const override; static void calculateTexLayerColor(const param_color_list_t ¶m_list, LLColor4 &net_color); protected: diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h index e4613fe48c96cc35eb5be2b5c86da6a8534ec4d0..5075c1a05aacfaa007f5d6661bac85a1ddafab94 100644 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -49,7 +49,7 @@ public: LLTexLayerParam(LLTexLayerInterface *layer); LLTexLayerParam(LLAvatarAppearance *appearance); /*virtual*/ BOOL setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance); - /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0; + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const override = 0; protected: LLTexLayerParam(const LLTexLayerParam& pOther); @@ -80,21 +80,23 @@ public: ll_aligned_free_16(ptr); } - /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const; + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = nullptr) const override; // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); - /*virtual*/ void apply( ESex avatar_sex ) {} - /*virtual*/ void setWeight(F32 weight, BOOL upload_bake); - /*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake); - /*virtual*/ void animate(F32 delta, BOOL upload_bake); + /*virtual*/ void apply( ESex avatar_sex ) override {} + /*virtual*/ void setWeight(F32 weight, BOOL upload_bake) override; + /*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake) override; + /*virtual*/ void animate(F32 delta, BOOL upload_bake) override; // LLViewerVisualParam Virtual functions - /*virtual*/ F32 getTotalDistortion() { return 1.f; } - /*virtual*/ const LLVector4a& getAvgDistortion() { return mAvgDistortionVec; } - /*virtual*/ F32 getMaxDistortion() { return 3.f; } - /*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { return LLVector4a(1.f, 1.f, 1.f);} - /*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return &mAvgDistortionVec;}; - /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return NULL;}; + /*virtual*/ F32 getTotalDistortion() override { return 1.f; } + /*virtual*/ const LLVector4a& getAvgDistortion() override { return mAvgDistortionVec; } + /*virtual*/ F32 getMaxDistortion() override { return 3.f; } + /*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) override { return LLVector4a(1.f, 1.f, 1.f);} + /*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) override + { index = nullptr; poly_mesh = nullptr; return &mAvgDistortionVec;}; + /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) override + { index = nullptr; poly_mesh = nullptr; return nullptr;}; // New functions BOOL render( S32 x, S32 y, S32 width, S32 height ); @@ -128,7 +130,7 @@ public: LLTexLayerParamAlphaInfo(); /*virtual*/ ~LLTexLayerParamAlphaInfo() {}; - /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); + /*virtual*/ BOOL parseXml(LLXmlTreeNode* node) override; private: std::string mStaticImageFileName; @@ -172,23 +174,25 @@ public: /* virtual */ ~LLTexLayerParamColor(); - /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const; + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = nullptr) const override; // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); - /*virtual*/ void apply( ESex avatar_sex ) {} - /*virtual*/ void setWeight(F32 weight, BOOL upload_bake); - /*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake); - /*virtual*/ void animate(F32 delta, BOOL upload_bake); + /*virtual*/ void apply( ESex avatar_sex ) override {} + /*virtual*/ void setWeight(F32 weight, BOOL upload_bake) override; + /*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake) override; + /*virtual*/ void animate(F32 delta, BOOL upload_bake) override; // LLViewerVisualParam Virtual functions - /*virtual*/ F32 getTotalDistortion() { return 1.f; } - /*virtual*/ const LLVector4a& getAvgDistortion() { return mAvgDistortionVec; } - /*virtual*/ F32 getMaxDistortion() { return 3.f; } - /*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { return LLVector4a(1.f, 1.f, 1.f); } - /*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return &mAvgDistortionVec;}; - /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return NULL;}; + /*virtual*/ F32 getTotalDistortion() override { return 1.f; } + /*virtual*/ const LLVector4a& getAvgDistortion() override { return mAvgDistortionVec; } + /*virtual*/ F32 getMaxDistortion() override { return 3.f; } + /*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) override { return LLVector4a(1.f, 1.f, 1.f); } + /*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) override + { index = nullptr; poly_mesh = nullptr; return &mAvgDistortionVec;}; + /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) override + { index = nullptr; poly_mesh = nullptr; return nullptr;}; // New functions LLColor4 getNetColor() const; @@ -207,7 +211,7 @@ class LLTexLayerParamColorInfo : public LLViewerVisualParamInfo public: LLTexLayerParamColorInfo(); virtual ~LLTexLayerParamColorInfo() {}; - BOOL parseXml( LLXmlTreeNode* node ); + BOOL parseXml( LLXmlTreeNode* node ) override; LLTexLayerParamColor::EColorOperation getOperation() const { return mOperation; } private: enum { MAX_COLOR_VALUES = 20 }; diff --git a/indra/llappearance/lltexturemanagerbridge.cpp b/indra/llappearance/lltexturemanagerbridge.cpp index 74dc2e7f1a41ee7505812c45cabe966245185b7d..54b17061e231bc62b413ecee79181dbaab7c1805 100644 --- a/indra/llappearance/lltexturemanagerbridge.cpp +++ b/indra/llappearance/lltexturemanagerbridge.cpp @@ -29,6 +29,6 @@ #include "lltexturemanagerbridge.h" // Define a null texture manager bridge. Applications must provide their own bridge implementaton. -LLTextureManagerBridge* gTextureManagerBridgep = NULL; +LLTextureManagerBridge* gTextureManagerBridgep = nullptr; diff --git a/indra/llappearance/llviewervisualparam.h b/indra/llappearance/llviewervisualparam.h index 1a710c0ca691b21a6e5b9ac449bce76e4904d756..d5832f7c2e93b3cf5119213300325f0764ab5641 100644 --- a/indra/llappearance/llviewervisualparam.h +++ b/indra/llappearance/llviewervisualparam.h @@ -43,9 +43,9 @@ public: LLViewerVisualParamInfo(); /*virtual*/ ~LLViewerVisualParamInfo(); - /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); + /*virtual*/ BOOL parseXml(LLXmlTreeNode* node) override; - /*virtual*/ void toStream(std::ostream &out); + /*virtual*/ void toStream(std::ostream &out) override; protected: S32 mWearableType; diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index c24dc1dedbd2a1d30e1cda78b860152754d80379..25ade64e604c50cf33a2c281d5c480999306264e 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -66,7 +66,7 @@ LLWearable::~LLWearable() LLVisualParam* vp = vpIter->second; vp->clearNextParam(); delete vp; - vpIter->second = NULL; + vpIter->second = nullptr; } destroyTextures(); @@ -183,7 +183,7 @@ void LLWearable::createVisualParams(LLAvatarAppearance *avatarp) void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp) { - LLTexLayerSet *layer_set = NULL; + LLTexLayerSet *layer_set = nullptr; const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)te); if (texture_dict->mIsUsedByBakedTexture) { @@ -500,7 +500,7 @@ LLLocalTextureObject* LLWearable::getLocalTextureObject(S32 index) LLLocalTextureObject* lto = iter->second; return lto; } - return NULL; + return nullptr; } const LLLocalTextureObject* LLWearable::getLocalTextureObject(S32 index) const @@ -511,7 +511,7 @@ const LLLocalTextureObject* LLWearable::getLocalTextureObject(S32 index) const const LLLocalTextureObject* lto = iter->second; return lto; } - return NULL; + return nullptr; } std::vector<LLLocalTextureObject*> LLWearable::getLocalTextureListSeq() @@ -605,8 +605,8 @@ void LLWearable::syncImages(te_map_t &src, te_map_t &dst) { te_map_t::const_iterator iter = src.find(te); LLUUID image_id; - LLGLTexture *image = NULL; - LLLocalTextureObject *lto = NULL; + LLGLTexture *image = nullptr; + LLLocalTextureObject *lto = nullptr; if(iter != src.end()) { // there's a Local Texture Object in the source image map. Use this to populate the values to store in the destination image map. diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp index 1f8bc15197f05bc8336dd682c6d5d10d761fdc52..80cdc4e1b7d1372f4c1da0e7af4845009f9ecffe 100644 --- a/indra/llappearance/llwearabledata.cpp +++ b/indra/llappearance/llwearabledata.cpp @@ -36,7 +36,7 @@ #include "llmd5.h" LLWearableData::LLWearableData() : - mAvatarAppearance(NULL) + mAvatarAppearance(nullptr) { } @@ -52,12 +52,12 @@ LLWearable* LLWearableData::getWearable(const LLWearableType::EType type, U32 in wearableentry_map_t::iterator wearable_iter = mWearableDatas.find(type); if (wearable_iter == mWearableDatas.end()) { - return NULL; + return nullptr; } wearableentry_vec_t& wearable_vec = wearable_iter->second; if (index>=wearable_vec.size()) { - return NULL; + return nullptr; } else { @@ -98,7 +98,7 @@ void LLWearableData::pushWearable(const LLWearableType::EType type, LLWearable *wearable, bool trigger_updated /* = true */) { - if (wearable == NULL) + if (wearable == nullptr) { // no null wearables please! LL_WARNS() << "Null wearable sent for type " << type << LL_ENDL; @@ -126,7 +126,7 @@ void LLWearableData::wearableUpdated(LLWearable *wearable, BOOL removed) void LLWearableData::eraseWearable(LLWearable *wearable) { - if (wearable == NULL) + if (wearable == nullptr) { // nothing to do here. move along. return; @@ -205,7 +205,7 @@ void LLWearableData::pullCrossWearableValues(const LLWearableType::EType type) BOOL LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_found) const { - if (wearable == NULL) + if (wearable == nullptr) { return FALSE; } @@ -291,7 +291,7 @@ const LLWearable* LLWearableData::getWearable(const LLWearableType::EType type, { return wearable_iter->second[index]; } - return NULL; + return nullptr; #endif } @@ -311,7 +311,7 @@ LLWearable* LLWearableData::getTopWearable(const LLWearableType::EType type) { return wearable_iter->second.back(); } - return NULL; + return nullptr; #endif } @@ -331,7 +331,7 @@ const LLWearable* LLWearableData::getTopWearable(const LLWearableType::EType typ { return wearable_iter->second.back(); } - return NULL; + return nullptr; #endif } @@ -350,7 +350,7 @@ LLWearable* LLWearableData::getBottomWearable(const LLWearableType::EType type) { return wearable_iter->second.front(); } - return NULL; + return nullptr; #endif } @@ -369,7 +369,7 @@ const LLWearable* LLWearableData::getBottomWearable(const LLWearableType::EType { return wearable_iter->second.front(); } - return NULL; + return nullptr; #endif } diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp index 19830b35653ea3d3148dd09cde95b5d80b5e1141..114cb2b04519be6465c64049885c3f6c4638167e 100644 --- a/indra/llappearance/llwearabletype.cpp +++ b/indra/llappearance/llwearabletype.cpp @@ -31,7 +31,7 @@ #include "llinventorytype.h" #include "llinventorydefines.h" -static LLTranslationBridge* sTrans = NULL; +static LLTranslationBridge* sTrans = nullptr; // static void LLWearableType::initClass(LLTranslationBridge* trans) @@ -54,8 +54,8 @@ struct WearableEntry : public LLDictionaryEntry BOOL allow_multiwear = TRUE) : LLDictionaryEntry(name), mAssetType(assetType), - mDefaultNewName(default_new_name), mLabel(sTrans->getString(name)), + mDefaultNewName(default_new_name), mIconName(iconName), mDisableCameraSwitch(disable_camera_switch), mAllowMultiwear(allow_multiwear) diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index 2d141e535df06ed9cc3f36c46a323a4f0f5e1adc..80cd2ddc1d3a8be6b5c06b85393fd50a6e66e211 100644 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -47,7 +47,7 @@ extern LLAudioEngine *gAudiop; -LLAudioDecodeMgr *gAudioDecodeMgrp = NULL; +LLAudioDecodeMgr *gAudioDecodeMgrp = nullptr; static const S32 WAV_HEADER_SIZE = 44; @@ -63,7 +63,7 @@ public: public: WriteResponder(LLVorbisDecodeState* decoder) : mDecoder(decoder) {} ~WriteResponder() {} - void completed(S32 bytes) + void completed(S32 bytes) override { mDecoder->ioComplete(bytes); } @@ -172,7 +172,7 @@ LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, const std::string & mValid = FALSE; mBytesRead = -1; mUUID = uuid; - mInFilep = NULL; + mInFilep = nullptr; mCurrentSection = 0; #if !defined(USE_WAV_VFILE) mOutFilename = out_filename; @@ -188,7 +188,7 @@ LLVorbisDecodeState::~LLVorbisDecodeState() if (!mDone) { delete mInFilep; - mInFilep = NULL; + mInFilep = nullptr; } } @@ -210,7 +210,7 @@ BOOL LLVorbisDecodeState::initDecode() { LL_WARNS("AudioEngine") << "Failed to allocate vfile for reading: "<< e.what() << LL_ENDL; delete mInFilep; - mInFilep = NULL; + mInFilep = nullptr; return FALSE; } @@ -218,11 +218,11 @@ BOOL LLVorbisDecodeState::initDecode() { LL_WARNS("AudioEngine") << "unable to open vorbis source vfile for reading" << LL_ENDL; delete mInFilep; - mInFilep = NULL; + mInFilep = nullptr; return FALSE; } - S32 r = ov_open_callbacks(mInFilep, &mVF, NULL, 0, vfs_callbacks); + S32 r = ov_open_callbacks(mInFilep, &mVF, nullptr, 0, vfs_callbacks); if(r < 0) { LL_WARNS("AudioEngine") << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << mUUID << LL_ENDL; @@ -274,7 +274,7 @@ BOOL LLVorbisDecodeState::initDecode() LL_WARNS("AudioEngine") << "Bad asset encoded by: " << comment->vendor << LL_ENDL; } delete mInFilep; - mInFilep = NULL; + mInFilep = nullptr; return FALSE; } @@ -591,7 +591,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs) adp->setHasCompletedDecode(true); } - mCurrentDecodep = NULL; + mCurrentDecodep = nullptr; done = TRUE; } @@ -626,7 +626,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs) adp->setHasCompletedDecode(true); LL_INFOS("AudioEngine") << "Vorbis decode failed for " << mCurrentDecodep->getUUID() << LL_ENDL; } - mCurrentDecodep = NULL; + mCurrentDecodep = nullptr; } done = TRUE; // done for now } @@ -664,7 +664,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs) mCurrentDecodep = new LLVorbisDecodeState(uuid, d_path); if (!mCurrentDecodep->initDecode()) { - mCurrentDecodep = NULL; + mCurrentDecodep = nullptr; } } } diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index 0b5d941b8be5b096a3f86748a2257d5b9bdd9f8a..6f3c1becb3d07cf80590e00fd527ccc64cd8bfd1 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -46,7 +46,7 @@ // necessary for grabbing sounds from sim (implemented in viewer) extern void request_sound(const LLUUID &sound_guid); -LLAudioEngine* gAudiop = NULL; +LLAudioEngine* gAudiop = nullptr; // @@ -79,10 +79,10 @@ void LLAudioEngine::setDefaults() { mMaxWindGain = 1.f; - mListenerp = NULL; + mListenerp = nullptr; mMuted = false; - mUserData = NULL; + mUserData = nullptr; mLastStatus = 0; @@ -92,11 +92,11 @@ void LLAudioEngine::setDefaults() S32 i; for (i = 0; i < MAX_CHANNELS; i++) { - mChannels[i] = NULL; + mChannels[i] = nullptr; } for (i = 0; i < MAX_BUFFERS; i++) { - mBuffers[i] = NULL; + mBuffers[i] = nullptr; } mMasterGain = 1.f; @@ -107,7 +107,7 @@ void LLAudioEngine::setDefaults() mInternalGain = -1.f; mNextWindUpdate = 0.f; - mStreamingAudioImpl = NULL; + mStreamingAudioImpl = nullptr; for (U32 i = 0; i < LLAudioEngine::AUDIO_TYPE_COUNT; i++) mSecondaryGain[i] = 1.0f; @@ -136,14 +136,14 @@ void LLAudioEngine::shutdown() { // Clean up decode manager delete gAudioDecodeMgrp; - gAudioDecodeMgrp = NULL; + gAudioDecodeMgrp = nullptr; // Clean up wind source cleanupWind(); // Clean up streaming audio delete mStreamingAudioImpl; - mStreamingAudioImpl = NULL; + mStreamingAudioImpl = nullptr; // Clean up audio sources source_map::iterator iter_src; @@ -166,14 +166,14 @@ void LLAudioEngine::shutdown() for (i = 0; i < MAX_CHANNELS; i++) { delete mChannels[i]; - mChannels[i] = NULL; + mChannels[i] = nullptr; } // Clean up buffers for (i = 0; i < MAX_BUFFERS; i++) { delete mBuffers[i]; - mBuffers[i] = NULL; + mBuffers[i] = nullptr; } } @@ -269,7 +269,7 @@ void LLAudioEngine::idle(F32 max_decode_time) } F32 max_priority = -1.f; - LLAudioSource *max_sourcep = NULL; // Maximum priority source without a channel + LLAudioSource *max_sourcep = nullptr; // Maximum priority source without a channel source_map::iterator iter; for (iter = mAllSources.begin(); iter != mAllSources.end();) { @@ -356,7 +356,7 @@ void LLAudioEngine::idle(F32 max_decode_time) { // This sound isn't playing, so we just process move the queue sourcep->mCurrentDatap = sourcep->mQueuedDatap; - sourcep->mQueuedDatap = NULL; + sourcep->mQueuedDatap = nullptr; // Reset the timer so the source doesn't die. sourcep->mAgeTimer.reset(); @@ -382,7 +382,7 @@ void LLAudioEngine::idle(F32 max_decode_time) if (!channelp->isPlaying()) { sourcep->mCurrentDatap = sourcep->mQueuedDatap; - sourcep->mQueuedDatap = NULL; + sourcep->mQueuedDatap = nullptr; // Reset the timer so the source doesn't die. sourcep->mAgeTimer.reset(); @@ -404,7 +404,7 @@ void LLAudioEngine::idle(F32 max_decode_time) if (channelp->mLoopedThisFrame) { sourcep->mCurrentDatap = sourcep->mQueuedDatap; - sourcep->mQueuedDatap = NULL; + sourcep->mQueuedDatap = nullptr; // Actually, should do a time sync so if we're a loop master/slave // we don't drift away. @@ -421,8 +421,8 @@ void LLAudioEngine::idle(F32 max_decode_time) updateChannels(); // Hack! For now, just use a global sync master; - LLAudioSource *sync_masterp = NULL; - LLAudioChannel *master_channelp = NULL; + LLAudioSource *sync_masterp = nullptr; + LLAudioChannel *master_channelp = nullptr; F32 max_sm_priority = -1.f; for (iter = mAllSources.begin(); iter != mAllSources.end(); ++iter) { @@ -487,9 +487,9 @@ void LLAudioEngine::idle(F32 max_decode_time) if (!mBuffers[i]->mInUse && mBuffers[i]->mLastUseTimer.getElapsedTimeF32() > 30.f) { //LL_INFOS() << "Flushing unused buffer!" << LL_ENDL; - mBuffers[i]->mAudioDatap->mBufferp = NULL; + mBuffers[i]->mAudioDatap->mBufferp = nullptr; delete mBuffers[i]; - mBuffers[i] = NULL; + mBuffers[i] = nullptr; } } } @@ -600,12 +600,12 @@ LLAudioBuffer * LLAudioEngine::getFreeBuffer() { LL_DEBUGS() << "Taking over unused buffer " << buffer_id << LL_ENDL; //LL_INFOS() << "Flushing unused buffer!" << LL_ENDL; - mBuffers[buffer_id]->mAudioDatap->mBufferp = NULL; + mBuffers[buffer_id]->mAudioDatap->mBufferp = nullptr; delete mBuffers[buffer_id]; mBuffers[buffer_id] = createBuffer(); return mBuffers[buffer_id]; } - return NULL; + return nullptr; } @@ -628,7 +628,7 @@ LLAudioChannel * LLAudioEngine::getFreeChannel(const F32 priority) mChannels[i]->cleanup(); if (mChannels[i]->getSource()) { - mChannels[i]->getSource()->setChannel(NULL); + mChannels[i]->getSource()->setChannel(nullptr); } return mChannels[i]; } @@ -638,7 +638,7 @@ LLAudioChannel * LLAudioEngine::getFreeChannel(const F32 priority) // All channels used, check priorities. // Find channel with lowest priority and see if we want to replace it. F32 min_priority = 10000.f; - LLAudioChannel *min_channelp = NULL; + LLAudioChannel *min_channelp = nullptr; for (i = 0; i < mNumChannels; i++) { @@ -654,12 +654,12 @@ LLAudioChannel * LLAudioEngine::getFreeChannel(const F32 priority) if (min_priority > priority || !min_channelp) { // All playing channels have higher priority, return. - return NULL; + return nullptr; } // Flush the minimum priority channel, and return it. min_channelp->cleanup(); - min_channelp->getSource()->setChannel(NULL); + min_channelp->getSource()->setChannel(nullptr); return min_channelp; } @@ -672,7 +672,7 @@ void LLAudioEngine::cleanupBuffer(LLAudioBuffer *bufferp) if (mBuffers[i] == bufferp) { delete mBuffers[i]; - mBuffers[i] = NULL; + mBuffers[i] = nullptr; } } } @@ -971,7 +971,7 @@ LLAudioSource * LLAudioEngine::findAudioSource(const LLUUID &source_id) if (iter == mAllSources.end()) { - return NULL; + return nullptr; } else { @@ -1063,8 +1063,8 @@ void LLAudioEngine::startNextTransfer() // Pick one in the following order: LLUUID asset_id; S32 i; - LLAudioSource *asp = NULL; - LLAudioData *adp = NULL; + LLAudioSource *asp = nullptr; + LLAudioData *adp = nullptr; data_map::iterator data_iter; // Check all channels for currently playing sounds. @@ -1240,7 +1240,7 @@ void LLAudioEngine::startNextTransfer() mCurrentTransfer = asset_id; mCurrentTransferTimer.reset(); gAssetStorage->getAssetData(asset_id, LLAssetType::AT_SOUND, - assetCallback, NULL); + assetCallback, nullptr); } else { @@ -1311,9 +1311,9 @@ LLAudioSource::LLAudioSource(const LLUUID& id, const LLUUID& owner_id, const F32 mPlayedOnce(false), mCorrupted(false), mType(type), - mChannelp(NULL), - mCurrentDatap(NULL), - mQueuedDatap(NULL) + mChannelp(nullptr), + mCurrentDatap(nullptr), + mQueuedDatap(nullptr) { } @@ -1323,8 +1323,8 @@ LLAudioSource::~LLAudioSource() if (mChannelp) { // Stop playback of this sound - mChannelp->setSource(NULL); - mChannelp = NULL; + mChannelp->setSource(nullptr); + mChannelp = nullptr; } } @@ -1440,11 +1440,11 @@ bool LLAudioSource::play(const LLUUID &audio_uuid) { if (getChannel()) { - getChannel()->setSource(NULL); - setChannel(NULL); + getChannel()->setSource(nullptr); + setChannel(nullptr); if (!isMuted()) { - mCurrentDatap = NULL; + mCurrentDatap = nullptr; } } return false; @@ -1675,7 +1675,7 @@ LLAudioBuffer * LLAudioSource::getCurrentBuffer() { if (!mCurrentDatap) { - return NULL; + return nullptr; } return mCurrentDatap->getBuffer(); @@ -1690,8 +1690,8 @@ LLAudioBuffer * LLAudioSource::getCurrentBuffer() LLAudioChannel::LLAudioChannel() : - mCurrentSourcep(NULL), - mCurrentBufferp(NULL), + mCurrentSourcep(nullptr), + mCurrentBufferp(nullptr), mLoopedThisFrame(false), mWaiting(false), mSecondaryGain(1.0f) @@ -1705,9 +1705,9 @@ LLAudioChannel::~LLAudioChannel() //LL_INFOS() << "Cleaning up audio channel" << LL_ENDL; if (mCurrentSourcep) { - mCurrentSourcep->setChannel(NULL); + mCurrentSourcep->setChannel(nullptr); } - mCurrentBufferp = NULL; + mCurrentBufferp = nullptr; } @@ -1720,7 +1720,7 @@ void LLAudioChannel::setSource(LLAudioSource *sourcep) // Clearing the source for this channel, don't need to do anything. //LL_INFOS() << "Clearing source for channel" << LL_ENDL; cleanup(); - mCurrentSourcep = NULL; + mCurrentSourcep = nullptr; mWaiting = false; } else @@ -1803,7 +1803,7 @@ bool LLAudioChannel::updateBuffer() LLAudioData::LLAudioData(const LLUUID &uuid) : mID(uuid), - mBufferp(NULL), + mBufferp(nullptr), mHasLocalData(false), mHasDecodedData(false), mHasCompletedDecode(false), @@ -1868,7 +1868,7 @@ bool LLAudioData::load() { // Hrm. Right now, let's unset the buffer, since it's empty. gAudiop->cleanupBuffer(mBufferp); - mBufferp = NULL; + mBufferp = nullptr; return false; } diff --git a/indra/llaudio/llaudioengine_fmodstudio.cpp b/indra/llaudio/llaudioengine_fmodstudio.cpp index 0229d2e0b3c911a84e396abf3e0efbd621848af6..8d2fff13789805a767ce7d261ad361f47c33022c 100644 --- a/indra/llaudio/llaudioengine_fmodstudio.cpp +++ b/indra/llaudio/llaudioengine_fmodstudio.cpp @@ -49,14 +49,14 @@ const U32 EXTRA_SOUND_CHANNELS = 10; FMOD_RESULT F_CALLBACK windDSPCallback(FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int *outchannels); -FMOD::ChannelGroup *LLAudioEngine_FMODSTUDIO::mChannelGroups[LLAudioEngine::AUDIO_TYPE_COUNT] = {0}; +FMOD::ChannelGroup *LLAudioEngine_FMODSTUDIO::mChannelGroups[LLAudioEngine::AUDIO_TYPE_COUNT] = {nullptr}; LLAudioEngine_FMODSTUDIO::LLAudioEngine_FMODSTUDIO(bool enable_profiler, U32 resample_method) : mInited(false) - , mWindGen(NULL) - , mWindDSPDesc(NULL) - , mWindDSP(NULL) - , mSystem(NULL) + , mWindGen(nullptr) + , mWindDSPDesc(nullptr) + , mWindDSP(nullptr) + , mSystem(nullptr) , mEnableProfiler(enable_profiler) , mResampleMethod(resample_method) { @@ -197,7 +197,7 @@ bool LLAudioEngine_FMODSTUDIO::init(const S32 num_channels, void* userdata) #else // LL_LINUX // initialize the FMOD engine - result = mSystem->init( num_channels + EXTRA_SOUND_CHANNELS, fmod_flags, 0); + result = mSystem->init( num_channels + EXTRA_SOUND_CHANNELS, fmod_flags, nullptr); if (result == FMOD_ERR_OUTPUT_CREATEBUFFER) { /* @@ -209,7 +209,7 @@ bool LLAudioEngine_FMODSTUDIO::init(const S32 num_channels, void* userdata) /* ... and re-init. */ - result = mSystem->init( num_channels + EXTRA_SOUND_CHANNELS, fmod_flags, 0); + result = mSystem->init( num_channels + EXTRA_SOUND_CHANNELS, fmod_flags, nullptr); } if(Check_FMOD_Error(result, "Error initializing FMOD Studio")) return false; @@ -241,7 +241,7 @@ bool LLAudioEngine_FMODSTUDIO::init(const S32 num_channels, void* userdata) LL_INFOS("AppInit") << "LLAudioEngine_FMODSTUDIO::init(): r_numbuffers=" << r_numbuffers << LL_ENDL; char r_name[512]; - mSystem->getDriverInfo(0, r_name, 511, NULL, &r_samplerate, NULL, &r_channels); + mSystem->getDriverInfo(0, r_name, 511, nullptr, &r_samplerate, nullptr, &r_channels); r_name[511] = '\0'; LL_INFOS("AppInit") << "LLAudioEngine_FMODSTUDIO::init(): r_name=\"" << r_name << "\"" << LL_ENDL; LL_INFOS("AppInit") << "LLAudioEngine_FMODSTUDIO::init(): r_samplerate=" << r_samplerate << "Hz" << LL_ENDL; @@ -303,7 +303,7 @@ void LLAudioEngine_FMODSTUDIO::shutdown() LL_INFOS() << "LLAudioEngine_FMODSTUDIO::shutdown() done closing FMOD Studio" << LL_ENDL; delete mListenerp; - mListenerp = NULL; + mListenerp = nullptr; } @@ -335,13 +335,13 @@ bool LLAudioEngine_FMODSTUDIO::initWind() int frequency = 44100; FMOD_SPEAKERMODE mode; - if (!Check_FMOD_Error(mSystem->getSoftwareFormat(&frequency, &mode, NULL), "FMOD::System::getSoftwareFormat")) + if (!Check_FMOD_Error(mSystem->getSoftwareFormat(&frequency, &mode, nullptr), "FMOD::System::getSoftwareFormat")) { mWindGen = new LLWindGen<MIXBUFFERFORMAT>((U32)frequency); if (!Check_FMOD_Error(mWindDSP->setUserData((void*)mWindGen), "FMOD::DSP::setUserData") && !Check_FMOD_Error(mWindDSP->setChannelFormat(FMOD_CHANNELMASK_STEREO, 2, mode), "FMOD::DSP::setChannelFormat") && - !Check_FMOD_Error(mSystem->playDSP(mWindDSP, NULL, false, 0), "FMOD::System::playDSP")) + !Check_FMOD_Error(mSystem->playDSP(mWindDSP, nullptr, false, nullptr), "FMOD::System::playDSP")) return true; //Success } @@ -354,18 +354,18 @@ void LLAudioEngine_FMODSTUDIO::cleanupWind() { if (mWindDSP) { - FMOD::ChannelGroup* mastergroup = NULL; + FMOD::ChannelGroup* mastergroup = nullptr; if (!Check_FMOD_Error(mSystem->getMasterChannelGroup(&mastergroup), "FMOD::System::getMasterChannelGroup") && mastergroup) Check_FMOD_Error(mastergroup->removeDSP(mWindDSP), "FMOD::ChannelGroup::removeDSP"); Check_FMOD_Error(mWindDSP->release(), "FMOD::DSP::release"); - mWindDSP = NULL; + mWindDSP = nullptr; } delete mWindDSPDesc; - mWindDSPDesc = NULL; + mWindDSPDesc = nullptr; delete mWindGen; - mWindGen = NULL; + mWindGen = nullptr; } @@ -430,7 +430,7 @@ void LLAudioEngine_FMODSTUDIO::setInternalGain(F32 gain) // LLAudioChannelFMODSTUDIO implementation // -LLAudioChannelFMODSTUDIO::LLAudioChannelFMODSTUDIO(FMOD::System *system) : LLAudioChannel(), mSystemp(system), mChannelp(NULL), mLastSamplePos(0) +LLAudioChannelFMODSTUDIO::LLAudioChannelFMODSTUDIO(FMOD::System *system) : LLAudioChannel(), mSystemp(system), mChannelp(nullptr), mLastSamplePos(0) { } @@ -466,7 +466,7 @@ bool LLAudioChannelFMODSTUDIO::updateBuffer() // setup. if (!mChannelp) { - FMOD_RESULT result = getSystem()->playSound(soundp, NULL, true, &mChannelp); + FMOD_RESULT result = getSystem()->playSound(soundp, nullptr, true, &mChannelp); Check_FMOD_Error(result, "FMOD::System::playSound"); } @@ -566,8 +566,8 @@ void LLAudioChannelFMODSTUDIO::cleanup() //LL_INFOS() << "Cleaning up channel: " << mChannelID << LL_ENDL; Check_FMOD_Error(mChannelp->stop(),"FMOD::Channel::stop"); - mCurrentBufferp = NULL; - mChannelp = NULL; + mCurrentBufferp = nullptr; + mChannelp = nullptr; } @@ -630,7 +630,7 @@ bool LLAudioChannelFMODSTUDIO::isPlaying() // -LLAudioBufferFMODSTUDIO::LLAudioBufferFMODSTUDIO(FMOD::System *system) : mSystemp(system), mSoundp(NULL) +LLAudioBufferFMODSTUDIO::LLAudioBufferFMODSTUDIO(FMOD::System *system) : mSystemp(system), mSoundp(nullptr) { } @@ -640,7 +640,7 @@ LLAudioBufferFMODSTUDIO::~LLAudioBufferFMODSTUDIO() if(mSoundp) { Check_FMOD_Error(mSoundp->release(),"FMOD::Sound::Release"); - mSoundp = NULL; + mSoundp = nullptr; } } @@ -665,7 +665,7 @@ bool LLAudioBufferFMODSTUDIO::loadWAV(const std::string& filename) { // If there's already something loaded in this buffer, clean it up. Check_FMOD_Error(mSoundp->release(),"FMOD::Sound::release"); - mSoundp = NULL; + mSoundp = nullptr; } FMOD_MODE base_mode = FMOD_LOOP_NORMAL; diff --git a/indra/llaudio/llaudioengine_fmodstudio.h b/indra/llaudio/llaudioengine_fmodstudio.h index fb1b8ae2cd3e948d0536c8c960397d6ed8b9cec8..bbebe388d591af50cc00b0f87343418941e547a2 100644 --- a/indra/llaudio/llaudioengine_fmodstudio.h +++ b/indra/llaudio/llaudioengine_fmodstudio.h @@ -57,25 +57,25 @@ public: virtual ~LLAudioEngine_FMODSTUDIO(); // initialization/startup/shutdown - virtual bool init(const S32 num_channels, void *user_data); - virtual std::string getDriverName(bool verbose); - virtual void allocateListener(); + bool init(const S32 num_channels, void *user_data) override; + std::string getDriverName(bool verbose) override; + void allocateListener() override; - virtual void shutdown(); + void shutdown() override; - /*virtual*/ bool initWind(); - /*virtual*/ void cleanupWind(); + /*virtual*/ bool initWind() override; + /*virtual*/ void cleanupWind() override; - /*virtual*/void updateWind(LLVector3 direction, F32 camera_height_above_water); + /*virtual*/void updateWind(LLVector3 direction, F32 camera_height_above_water) override; typedef F32 MIXBUFFERFORMAT; FMOD::System *getSystem() const {return mSystem;} protected: - /*virtual*/ LLAudioBuffer *createBuffer(); // Get a free buffer, or flush an existing one if you have to. - /*virtual*/ LLAudioChannel *createChannel(); // Create a new audio channel. + /*virtual*/ LLAudioBuffer *createBuffer() override; // Get a free buffer, or flush an existing one if you have to. + /*virtual*/ LLAudioChannel *createChannel() override; // Create a new audio channel. - /*virtual*/ void setInternalGain(F32 gain); + /*virtual*/ void setInternalGain(F32 gain) override; bool mInited; @@ -99,14 +99,14 @@ public: virtual ~LLAudioChannelFMODSTUDIO(); protected: - /*virtual*/ void play(); - /*virtual*/ void playSynced(LLAudioChannel *channelp); - /*virtual*/ void cleanup(); - /*virtual*/ bool isPlaying(); + /*virtual*/ void play() override; + /*virtual*/ void playSynced(LLAudioChannel *channelp) override; + /*virtual*/ void cleanup() override; + /*virtual*/ bool isPlaying() override; - /*virtual*/ bool updateBuffer(); - /*virtual*/ void update3DPosition(); - /*virtual*/ void updateLoop(); + /*virtual*/ bool updateBuffer() override; + /*virtual*/ void update3DPosition() override; + /*virtual*/ void updateLoop() override; void set3DMode(bool use3d); protected: @@ -123,8 +123,8 @@ public: LLAudioBufferFMODSTUDIO(FMOD::System *audioengine); virtual ~LLAudioBufferFMODSTUDIO(); - /*virtual*/ bool loadWAV(const std::string& filename); - /*virtual*/ U32 getLength(); + /*virtual*/ bool loadWAV(const std::string& filename) override; + /*virtual*/ U32 getLength() override; friend class LLAudioChannelFMODSTUDIO; protected: FMOD::System *getSystem() const {return mSystemp;} diff --git a/indra/llaudio/lllistener_fmodstudio.cpp b/indra/llaudio/lllistener_fmodstudio.cpp index a97e9f2ce449c9ae7b055a8e0984ec1664a773b4..3005cb1c0baf96cc28357be7c2e0f231b9df002c 100644 --- a/indra/llaudio/lllistener_fmodstudio.cpp +++ b/indra/llaudio/lllistener_fmodstudio.cpp @@ -53,7 +53,7 @@ void LLListener_FMODSTUDIO::translate(const LLVector3& offset) { LLListener::translate(offset); - mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)mPosition.mV, NULL, NULL, NULL); + mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)mPosition.mV, nullptr, nullptr, nullptr); } //----------------------------------------------------------------------- @@ -61,7 +61,7 @@ void LLListener_FMODSTUDIO::setPosition(const LLVector3& pos) { LLListener::setPosition(pos); - mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)mPosition.mV, NULL, NULL, NULL); + mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)mPosition.mV, nullptr, nullptr, nullptr); } //----------------------------------------------------------------------- @@ -69,7 +69,7 @@ void LLListener_FMODSTUDIO::setVelocity(const LLVector3& vel) { LLListener::setVelocity(vel); - mSystem->set3DListenerAttributes(0, NULL, (FMOD_VECTOR*)mVelocity.mV, NULL, NULL); + mSystem->set3DListenerAttributes(0, nullptr, (FMOD_VECTOR*)mVelocity.mV, nullptr, nullptr); } //----------------------------------------------------------------------- @@ -77,7 +77,7 @@ void LLListener_FMODSTUDIO::orient(const LLVector3& up, const LLVector3& at) { LLListener::orient(up, at); - mSystem->set3DListenerAttributes(0, NULL, NULL, (FMOD_VECTOR*)at.mV, (FMOD_VECTOR*)up.mV); + mSystem->set3DListenerAttributes(0, nullptr, nullptr, (FMOD_VECTOR*)at.mV, (FMOD_VECTOR*)up.mV); } //----------------------------------------------------------------------- @@ -100,8 +100,8 @@ void LLListener_FMODSTUDIO::setRolloffFactor(F32 factor) if(mRolloffFactor != factor) { LLVector3 tmp_pos = mPosition - LLVector3(0.f,0.f,.1f); - mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*) tmp_pos.mV, NULL, NULL, NULL); - mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*) mPosition.mV, NULL, NULL, NULL); + mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*) tmp_pos.mV, nullptr, nullptr, nullptr); + mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*) mPosition.mV, nullptr, nullptr, nullptr); } mRolloffFactor = factor; mSystem->set3DSettings(mDopplerFactor, 1.f, mRolloffFactor); diff --git a/indra/llaudio/llstreamingaudio.h b/indra/llaudio/llstreamingaudio.h index c143dd5dd96a54e631a786a2ea9573c60c9f49e4..b6c0af840d817ade532f61ade82363f9c90ac228 100644 --- a/indra/llaudio/llstreamingaudio.h +++ b/indra/llaudio/llstreamingaudio.h @@ -52,7 +52,7 @@ class LLStreamingAudioInterface virtual void setBufferSizes(U32 streambuffertime, U32 decodebuffertime) {} virtual bool supportsMetaData() { return false; } - virtual const LLSD *getMetaData() { return NULL; } + virtual const LLSD *getMetaData() { return nullptr; } virtual const bool hasNewMetaData() { return false; } virtual bool supportsWaveData() { return false; } virtual bool getWaveData(float* arr, S32 count, S32 stride = 1){ return false; } diff --git a/indra/llaudio/llstreamingaudio_fmodstudio.cpp b/indra/llaudio/llstreamingaudio_fmodstudio.cpp index 17fb0819903e36e05d0e59d835f1a69dc3ff3dd1..d58cf78961614a8b7424847934de19cc71fee916 100644 --- a/indra/llaudio/llstreamingaudio_fmodstudio.cpp +++ b/indra/llaudio/llstreamingaudio_fmodstudio.cpp @@ -54,7 +54,7 @@ public: const std::string& getURL() { return mInternetStreamURL; } - FMOD_RESULT getOpenState(FMOD_OPENSTATE& openstate, unsigned int* percentbuffered = NULL, bool* starving = NULL, bool* diskbusy = NULL); + FMOD_RESULT getOpenState(FMOD_OPENSTATE& openstate, unsigned int* percentbuffered = nullptr, bool* starving = nullptr, bool* diskbusy = nullptr); protected: FMOD::System* mSystem; FMOD::ChannelGroup* mChannelGroup; @@ -114,12 +114,12 @@ FMOD_RESULT F_CALLBACK waveDataCallback(FMOD_DSP_STATE *dsp_state, float *inbuff //--------------------------------------------------------------------------- LLStreamingAudio_FMODSTUDIO::LLStreamingAudio_FMODSTUDIO(FMOD::System *system) : mSystem(system), - mCurrentInternetStreamp(NULL), - mStreamDSP(NULL), - mStreamGroup(NULL), - mFMODInternetStreamChannelp(NULL), + mCurrentInternetStreamp(nullptr), + mStreamDSP(nullptr), + mStreamGroup(nullptr), + mFMODInternetStreamChannelp(nullptr), mGain(1.0f), - mMetaData(NULL), + mMetaData(nullptr), mNewMetadata(true) { FMOD_RESULT result; @@ -287,7 +287,7 @@ void LLStreamingAudio_FMODSTUDIO::update() if(!mMetaData) mMetaData = new LLSD; - FMOD::Sound *sound = NULL; + FMOD::Sound *sound = nullptr; if(mFMODInternetStreamChannelp->getCurrentSound(&sound) == FMOD_OK && sound) { @@ -300,7 +300,7 @@ void LLStreamingAudio_FMODSTUDIO::update() for(S32 i = 0; i < tagcount; ++i) { - if(sound->getTag(NULL, i, &tag)!=FMOD_OK) + if(sound->getTag(nullptr, i, &tag)!=FMOD_OK) continue; std::string name = tag.name; @@ -410,7 +410,7 @@ void LLStreamingAudio_FMODSTUDIO::stop() if(mMetaData) { delete mMetaData; - mMetaData = NULL; + mMetaData = nullptr; } if (mFMODInternetStreamChannelp) @@ -421,7 +421,7 @@ void LLStreamingAudio_FMODSTUDIO::stop() { Check_FMOD_Error(mFMODInternetStreamChannelp->removeDSP(mStreamDSP), "FMOD::Channel::removeDSP"); } - mFMODInternetStreamChannelp = NULL; + mFMODInternetStreamChannelp = nullptr; } if (mCurrentInternetStreamp) @@ -436,7 +436,7 @@ void LLStreamingAudio_FMODSTUDIO::stop() LL_WARNS() << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << LL_ENDL; mDeadStreams.push_back(mCurrentInternetStreamp); } - mCurrentInternetStreamp = NULL; + mCurrentInternetStreamp = nullptr; } } @@ -552,13 +552,13 @@ bool LLStreamingAudio_FMODSTUDIO::getWaveData(float* arr, S32 count, S32 stride/ LLAudioStreamManagerFMODSTUDIO::LLAudioStreamManagerFMODSTUDIO(FMOD::System *system, FMOD::ChannelGroup *group, const std::string& url) : mSystem(system), mChannelGroup(group), - mStreamChannel(NULL), - mInternetStream(NULL), + mStreamChannel(nullptr), + mInternetStream(nullptr), mReady(false) { mInternetStreamURL = url; - FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_IGNORETAGS, 0, &mInternetStream); + FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_IGNORETAGS, nullptr, &mInternetStream); if (result!= FMOD_OK) { @@ -579,7 +579,7 @@ FMOD::Channel *LLAudioStreamManagerFMODSTUDIO::startStream() if (getOpenState(open_state) != FMOD_OK || open_state != FMOD_OPENSTATE_READY) { LL_WARNS() << "No internet stream to start playing!" << LL_ENDL; - return NULL; + return nullptr; } if(mStreamChannel) @@ -609,8 +609,8 @@ bool LLAudioStreamManagerFMODSTUDIO::stopStream() if (close && mInternetStream->release() == FMOD_OK) { - mStreamChannel = NULL; - mInternetStream = NULL; + mStreamChannel = nullptr; + mInternetStream = nullptr; return true; } else @@ -669,10 +669,10 @@ void LLStreamingAudio_FMODSTUDIO::cleanupWaveData() if (mStreamGroup) { Check_FMOD_Error(mStreamGroup->release(), "FMOD::ChannelGroup::release"); - mStreamGroup = NULL; + mStreamGroup = nullptr; } if(mStreamDSP) Check_FMOD_Error(mStreamDSP->release(), "FMOD::DSP::release"); - mStreamDSP = NULL; + mStreamDSP = nullptr; } diff --git a/indra/llaudio/llstreamingaudio_fmodstudio.h b/indra/llaudio/llstreamingaudio_fmodstudio.h index 152edc5dcc7df6ab1cf5c89602d88700a8b44c37..8cfe14b14006807c495fd4fdff7465dabb46ec7b 100644 --- a/indra/llaudio/llstreamingaudio_fmodstudio.h +++ b/indra/llaudio/llstreamingaudio_fmodstudio.h @@ -49,23 +49,23 @@ class LLStreamingAudio_FMODSTUDIO : public LLStreamingAudioInterface LLStreamingAudio_FMODSTUDIO(FMOD::System *system); /*virtual*/ ~LLStreamingAudio_FMODSTUDIO(); - /*virtual*/ void start(const std::string& url); - /*virtual*/ void stop(); - /*virtual*/ void pause(S32 pause); - /*virtual*/ void update(); - /*virtual*/ S32 isPlaying(); - /*virtual*/ void setGain(F32 vol); - /*virtual*/ F32 getGain(); - /*virtual*/ std::string getURL(); + /*virtual*/ void start(const std::string& url) override; + /*virtual*/ void stop() override; + /*virtual*/ void pause(S32 pause) override; + /*virtual*/ void update() override; + /*virtual*/ S32 isPlaying() override; + /*virtual*/ void setGain(F32 vol) override; + /*virtual*/ F32 getGain() override; + /*virtual*/ std::string getURL() override; - /*virtual*/ bool supportsAdjustableBufferSizes(){return true;} - /*virtual*/ void setBufferSizes(U32 streambuffertime, U32 decodebuffertime); + /*virtual*/ bool supportsAdjustableBufferSizes() override {return true;} + /*virtual*/ void setBufferSizes(U32 streambuffertime, U32 decodebuffertime) override; - /*virtual*/ bool supportsMetaData(){return true;} - /*virtual*/ const LLSD *getMetaData() { return mMetaData; } //return NULL if not playing. - /*virtual*/ const bool hasNewMetaData(); - /*virtual*/ bool supportsWaveData(){return true;} - /*virtual*/ bool getWaveData(float* arr, S32 count, S32 stride = 1); + /*virtual*/ bool supportsMetaData() override {return true;} + /*virtual*/ const LLSD *getMetaData() override { return mMetaData; } //return NULL if not playing. + /*virtual*/ const bool hasNewMetaData() override; + /*virtual*/ bool supportsWaveData() override {return true;} + /*virtual*/ bool getWaveData(float* arr, S32 count, S32 stride = 1) override; private: bool releaseDeadStreams(); void cleanupWaveData(); diff --git a/indra/llaudio/llvorbisencode.cpp b/indra/llaudio/llvorbisencode.cpp index 69c8664045229ccf3d62c16785babf1cf5cf23c1..c5b6d769a5d218075942b22614f8913bc2faaa7d 100644 --- a/indra/llaudio/llvorbisencode.cpp +++ b/indra/llaudio/llvorbisencode.cpp @@ -455,7 +455,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname /* analysis */ /* Do the main analysis, creating a packet */ - vorbis_analysis(&vb, NULL); + vorbis_analysis(&vb, nullptr); vorbis_bitrate_addblock(&vb); while(vorbis_bitrate_flushpacket(&vd, &op)) diff --git a/indra/llcharacter/llanimationstates.cpp b/indra/llcharacter/llanimationstates.cpp index e6f966b1e530983b78b196d055a21c42d7f27e30..119a3db456f986523ca78b8988048e5ec5135337 100644 --- a/indra/llcharacter/llanimationstates.cpp +++ b/indra/llcharacter/llanimationstates.cpp @@ -355,14 +355,14 @@ const char *LLAnimationLibrary::animStateToString( const LLUUID& state ) { if (state.isNull()) { - return NULL; + return nullptr; } if (mAnimMap.count(state)) { return mAnimMap[state]; } - return NULL; + return nullptr; } diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index 975bec61fc783542308038c831d23bfa813453fd..0372bdf2899f6a08dd7f5cc3f497e788d3030e97 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -1332,8 +1332,8 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp) // find mergechild and mergeparent joints, if specified LLQuaternion mergeParentRot; LLQuaternion mergeChildRot; - Joint *mergeParent = NULL; - Joint *mergeChild = NULL; + Joint *mergeParent = nullptr; + Joint *mergeChild = nullptr; JointVector::iterator mji; for (mji=mJoints.begin(); mji!=mJoints.end(); ++mji) diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp index bdf5100071d1179c9749f2780763edc143a84c40..86bf7e89eafe0aa186efee17bb63839efffb1e12 100644 --- a/indra/llcharacter/llcharacter.cpp +++ b/indra/llcharacter/llcharacter.cpp @@ -98,7 +98,7 @@ LLCharacter::~LLCharacter() //----------------------------------------------------------------------------- LLJoint *LLCharacter::getJoint( const std::string &name ) { - LLJoint* joint = NULL; + LLJoint* joint = nullptr; LLJoint *root = getRootJoint(); if (root) @@ -242,7 +242,7 @@ void LLCharacter::flushAllMotions() void LLCharacter::dumpCharacter( LLJoint* joint ) { // handle top level entry into recursion - if (joint == NULL) + if (joint == nullptr) { LL_INFOS() << "DEBUG: Dumping Character @" << this << LL_ENDL; dumpCharacter( getRootJoint() ); @@ -275,7 +275,7 @@ void LLCharacter::setAnimationData(const std::string& name, void *data) //----------------------------------------------------------------------------- void* LLCharacter::getAnimationData(const std::string& name) { - return get_if_there(mAnimationData, name, (void*)NULL); + return get_if_there(mAnimationData, name, (void*)nullptr); } //----------------------------------------------------------------------------- @@ -416,7 +416,7 @@ LLVisualParam* LLCharacter::getVisualParam(const char *param_name) return name_iter->second; } LL_WARNS() << "LLCharacter::getVisualParam() Invalid visual parameter: " << param_name << LL_ENDL; - return NULL; + return nullptr; } //----------------------------------------------------------------------------- @@ -426,7 +426,7 @@ void LLCharacter::addSharedVisualParam(LLVisualParam *param) { S32 index = param->getID(); visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index); - LLVisualParam* current_param = 0; + LLVisualParam* current_param = nullptr; if (index_iter != mVisualParamIndexMap.end()) current_param = index_iter->second; if( current_param ) diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index e1eb2ab2df05a5a2d1268f00c0363207845b2f07..ba2d27e3f56929cfa1f40b60b8ddb5b6f1597aee 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -173,13 +173,13 @@ public: virtual void deactivateAllMotions(); // dumps information for debugging - virtual void dumpCharacter( LLJoint *joint = NULL ); + virtual void dumpCharacter( LLJoint *joint = nullptr ); virtual F32 getPreferredPelvisHeight() { return mPreferredPelvisHeight; } virtual LLVector3 getVolumePos(S32 joint_index, LLVector3& volume_offset) { return LLVector3::zero; } - virtual LLJoint* findCollisionVolume(U32 volume_id) { return NULL; } + virtual LLJoint* findCollisionVolume(U32 volume_id) { return nullptr; } virtual S32 getCollisionVolumeID(std::string &name) { return -1; } @@ -222,7 +222,7 @@ public: #else if (mCurIterator == mVisualParamSortedVector.end()) #endif - return 0; + return nullptr; return (mCurIterator++)->second; } diff --git a/indra/llcharacter/lleditingmotion.cpp b/indra/llcharacter/lleditingmotion.cpp index dae2de48c7fcdda86ed24013b23cdb9c68cbd074..cc2d7f9ef0b1f1fb720bb29cb8cb974528a76f90 100644 --- a/indra/llcharacter/lleditingmotion.cpp +++ b/indra/llcharacter/lleditingmotion.cpp @@ -51,7 +51,7 @@ S32 LLEditingMotion::sHandPosePriority = 3; //----------------------------------------------------------------------------- LLEditingMotion::LLEditingMotion( const LLUUID &id) : LLMotion(id) { - mCharacter = NULL; + mCharacter = nullptr; // create kinematic chain mParentJoint.addChild( &mShoulderJoint ); diff --git a/indra/llcharacter/lleditingmotion.h b/indra/llcharacter/lleditingmotion.h index 7b1c8bb0598ad3a4be255011978bd9553c532342..b352a39ba5e0e6c550dfa86be61d7d81541598e7 100644 --- a/indra/llcharacter/lleditingmotion.h +++ b/indra/llcharacter/lleditingmotion.h @@ -67,42 +67,42 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return TRUE; } + BOOL getLoop() override { return TRUE; } // motions must report their total duration - virtual F32 getDuration() { return 0.0; } + F32 getDuration() override { return 0.0; } // motions must report their "ease in" duration - virtual F32 getEaseInDuration() { return EDITING_EASEIN_DURATION; } + F32 getEaseInDuration() override { return EDITING_EASEIN_DURATION; } // motions must report their "ease out" duration. - virtual F32 getEaseOutDuration() { return EDITING_EASEOUT_DURATION; } + F32 getEaseOutDuration() override { return EDITING_EASEOUT_DURATION; } // motions must report their priority - virtual LLJoint::JointPriority getPriority() { return EDITING_PRIORITY; } + LLJoint::JointPriority getPriority() override { return EDITING_PRIORITY; } - virtual LLMotionBlendType getBlendType() { return NORMAL_BLEND; } + LLMotionBlendType getBlendType() override { return NORMAL_BLEND; } // called to determine when a motion should be activated/deactivated based on avatar pixel coverage - virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_EDITING; } + F32 getMinPixelArea() override { return MIN_REQUIRED_PIXEL_AREA_EDITING; } // run-time (post constructor) initialization, // called after parameters have been set // must return true to indicate success and be available for activation - virtual LLMotionInitStatus onInitialize(LLCharacter *character); + LLMotionInitStatus onInitialize(LLCharacter *character) override; // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + BOOL onActivate() override; // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + BOOL onUpdate(F32 time, U8* joint_mask) override; // called when a motion is deactivated - virtual void onDeactivate(); + void onDeactivate() override; public: //------------------------------------------------------------------------- diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index bc42cf2a9ab098f86e8ec1b09686e9e665c7e324..9f7f4c28b176ea2fa37779185b4264d6d1c87a1a 100644 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -203,7 +203,7 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin for( token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) { - LLGesture* gesture = NULL; + LLGesture* gesture = nullptr; if( !found_gestures ) // Only pay attention to the first gesture in the string. { @@ -239,7 +239,7 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin found_gestures = TRUE; break; } - gesture = NULL; + gesture = nullptr; } } diff --git a/indra/llcharacter/llhandmotion.cpp b/indra/llcharacter/llhandmotion.cpp index 75d280715f7de811ef2b3ea8ea281f5bdf61c86a..67beb291bd65e98ccfecc495ddcc5304e98441f6 100644 --- a/indra/llcharacter/llhandmotion.cpp +++ b/indra/llcharacter/llhandmotion.cpp @@ -65,7 +65,7 @@ const F32 HAND_MORPH_BLEND_TIME = 0.2f; //----------------------------------------------------------------------------- LLHandMotion::LLHandMotion(const LLUUID &id) : LLMotion(id) { - mCharacter = NULL; + mCharacter = nullptr; mLastTime = 0.f; mCurrentPose = HAND_POSE_RELAXED; mNewPose = HAND_POSE_RELAXED; diff --git a/indra/llcharacter/llhandmotion.h b/indra/llcharacter/llhandmotion.h index 08de7056c8e19d404ad4d80917766898bd275294..cecb2fb34e75a6daca15630d457c522c05a638b8 100644 --- a/indra/llcharacter/llhandmotion.h +++ b/indra/llcharacter/llhandmotion.h @@ -82,44 +82,45 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return TRUE; } + BOOL getLoop() override { return TRUE; } // motions must report their total duration - virtual F32 getDuration() { return 0.0; } + F32 getDuration() override { return 0.0; } // motions must report their "ease in" duration - virtual F32 getEaseInDuration() { return 0.0; } + F32 getEaseInDuration() override { return 0.0; } // motions must report their "ease out" duration. - virtual F32 getEaseOutDuration() { return 0.0; } + F32 getEaseOutDuration() override { return 0.0; } // called to determine when a motion should be activated/deactivated based on avatar pixel coverage - virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_HAND; } + F32 getMinPixelArea() override + { return MIN_REQUIRED_PIXEL_AREA_HAND; } // motions must report their priority - virtual LLJoint::JointPriority getPriority() { return LLJoint::MEDIUM_PRIORITY; } + LLJoint::JointPriority getPriority() override { return LLJoint::MEDIUM_PRIORITY; } - virtual LLMotionBlendType getBlendType() { return NORMAL_BLEND; } + LLMotionBlendType getBlendType() override { return NORMAL_BLEND; } // run-time (post constructor) initialization, // called after parameters have been set // must return true to indicate success and be available for activation - virtual LLMotionInitStatus onInitialize(LLCharacter *character); + LLMotionInitStatus onInitialize(LLCharacter *character) override; // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + BOOL onActivate() override; // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + BOOL onUpdate(F32 time, U8* joint_mask) override; // called when a motion is deactivated - virtual void onDeactivate(); + void onDeactivate() override; - virtual BOOL canDeprecate() { return FALSE; } + BOOL canDeprecate() override { return FALSE; } static std::string getHandPoseName(eHandPose pose); static eHandPose getHandPose(std::string posename); diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp index 44433771c78330a302e8f067e86d2c26c0a7eabe..ad76edcf5535c9905030882bc78ceae19952e861 100644 --- a/indra/llcharacter/llheadrotmotion.cpp +++ b/indra/llcharacter/llheadrotmotion.cpp @@ -71,15 +71,15 @@ const F32 EYE_BLINK_TIME_DELTA = 0.005f; // time between one eye starting a blin //----------------------------------------------------------------------------- LLHeadRotMotion::LLHeadRotMotion(const LLUUID &id) : LLMotion(id), - mCharacter(NULL), - mTorsoJoint(NULL), - mHeadJoint(NULL), - mRootJoint(NULL), - mPelvisJoint(NULL), + mCharacter(nullptr), + mTorsoJoint(nullptr), + mHeadJoint(nullptr), + mRootJoint(nullptr), + mPelvisJoint(nullptr), // LLPointer<LLJointState> - mHeadState(new LLJointState), mTorsoState(new LLJointState), - mNeckState(new LLJointState) + mNeckState(new LLJointState), + mHeadState(new LLJointState) { mName = "head_rot"; } @@ -272,7 +272,7 @@ void LLHeadRotMotion::onDeactivate() //----------------------------------------------------------------------------- LLEyeMotion::LLEyeMotion(const LLUUID &id) : LLMotion(id) { - mCharacter = NULL; + mCharacter = nullptr; mEyeJitterTime = 0.f; mEyeJitterYaw = 0.f; mEyeJitterPitch = 0.f; @@ -284,7 +284,7 @@ LLEyeMotion::LLEyeMotion(const LLUUID &id) : LLMotion(id) mEyeBlinkTime = 0.f; mEyesClosed = FALSE; - mHeadJoint = NULL; + mHeadJoint = nullptr; mName = "eye_rot"; diff --git a/indra/llcharacter/llheadrotmotion.h b/indra/llcharacter/llheadrotmotion.h index 53ae1813bc1bb5d6a50c991d91a808b5a3fc5665..b5bcc15eafe656ea8329ec30e0aa3f6994647ea1 100644 --- a/indra/llcharacter/llheadrotmotion.h +++ b/indra/llcharacter/llheadrotmotion.h @@ -64,42 +64,43 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return TRUE; } + BOOL getLoop() override { return TRUE; } // motions must report their total duration - virtual F32 getDuration() { return 0.0; } + F32 getDuration() override { return 0.0; } // motions must report their "ease in" duration - virtual F32 getEaseInDuration() { return 1.f; } + F32 getEaseInDuration() override { return 1.f; } // motions must report their "ease out" duration. - virtual F32 getEaseOutDuration() { return 1.f; } + F32 getEaseOutDuration() override { return 1.f; } // called to determine when a motion should be activated/deactivated based on avatar pixel coverage - virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_HEAD_ROT; } + F32 getMinPixelArea() override + { return MIN_REQUIRED_PIXEL_AREA_HEAD_ROT; } // motions must report their priority - virtual LLJoint::JointPriority getPriority() { return LLJoint::MEDIUM_PRIORITY; } + LLJoint::JointPriority getPriority() override { return LLJoint::MEDIUM_PRIORITY; } - virtual LLMotionBlendType getBlendType() { return NORMAL_BLEND; } + LLMotionBlendType getBlendType() override { return NORMAL_BLEND; } // run-time (post constructor) initialization, // called after parameters have been set // must return true to indicate success and be available for activation - virtual LLMotionInitStatus onInitialize(LLCharacter *character); + LLMotionInitStatus onInitialize(LLCharacter *character) override; // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + BOOL onActivate() override; // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + BOOL onUpdate(F32 time, U8* joint_mask) override; // called when a motion is deactivated - virtual void onDeactivate(); + void onDeactivate() override; public: //------------------------------------------------------------------------- @@ -147,44 +148,45 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return TRUE; } + BOOL getLoop() override { return TRUE; } // motions must report their total duration - virtual F32 getDuration() { return 0.0; } + F32 getDuration() override { return 0.0; } // motions must report their "ease in" duration - virtual F32 getEaseInDuration() { return 0.5f; } + F32 getEaseInDuration() override { return 0.5f; } // motions must report their "ease out" duration. - virtual F32 getEaseOutDuration() { return 0.5f; } + F32 getEaseOutDuration() override { return 0.5f; } // called to determine when a motion should be activated/deactivated based on avatar pixel coverage - virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_EYE; } + F32 getMinPixelArea() override + { return MIN_REQUIRED_PIXEL_AREA_EYE; } // motions must report their priority - virtual LLJoint::JointPriority getPriority() { return LLJoint::MEDIUM_PRIORITY; } + LLJoint::JointPriority getPriority() override { return LLJoint::MEDIUM_PRIORITY; } - virtual LLMotionBlendType getBlendType() { return NORMAL_BLEND; } + LLMotionBlendType getBlendType() override { return NORMAL_BLEND; } // run-time (post constructor) initialization, // called after parameters have been set // must return true to indicate success and be available for activation - virtual LLMotionInitStatus onInitialize(LLCharacter *character); + LLMotionInitStatus onInitialize(LLCharacter *character) override; // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + BOOL onActivate() override; void adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_state, LLJointState& right_eye_state); // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + BOOL onUpdate(F32 time, U8* joint_mask) override; // called when a motion is deactivated - virtual void onDeactivate(); + void onDeactivate() override; public: //------------------------------------------------------------------------- diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 96e2966e100fc76660ec2fa68f90b917c83deddb..676f5302bc0659d783390de23fdfc4ce27c9d229 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -107,7 +107,7 @@ void LLVector3OverrideMap::clear() void LLJoint::init() { mName = "unnamed"; - mParent = NULL; + mParent = nullptr; mXform.setScaleChildOffset(TRUE); mXform.setScale(LLVector3(1.0f, 1.0f, 1.0f)); mDirtyFlags = MATRIX_DIRTY | ROTATION_DIRTY | POSITION_DIRTY; @@ -237,7 +237,7 @@ void LLJoint::setJointNum(S32 joint_num) //----------------------------------------------------------------------------- LLJoint *LLJoint::getRoot() { - if ( getParent() == NULL ) + if ( getParent() == nullptr ) { return this; } @@ -267,7 +267,7 @@ LLJoint *LLJoint::findJoint( const std::string &name ) } } - return NULL; + return nullptr; } @@ -296,8 +296,8 @@ void LLJoint::removeChild(LLJoint* joint) { mChildren.erase(iter); - joint->mXform.setParent(NULL); - joint->mParent = NULL; + joint->mXform.setParent(nullptr); + joint->mParent = nullptr; joint->touch(); } } @@ -314,8 +314,8 @@ void LLJoint::removeAllChildren() child_list_t::iterator curiter = iter++; LLJoint* joint = *curiter; mChildren.erase(curiter); - joint->mXform.setParent(NULL); - joint->mParent = NULL; + joint->mXform.setParent(nullptr); + joint->mParent = nullptr; joint->touch(); } } @@ -788,7 +788,7 @@ LLVector3 LLJoint::getLastWorldPosition() //-------------------------------------------------------------------- void LLJoint::setWorldPosition( const LLVector3& pos ) { - if (mParent == NULL) + if (mParent == nullptr) { this->setPosition( pos ); return; @@ -860,7 +860,7 @@ LLQuaternion LLJoint::getLastWorldRotation() //-------------------------------------------------------------------- void LLJoint::setWorldRotation( const LLQuaternion& rot ) { - if (mParent == NULL) + if (mParent == nullptr) { this->setRotation( rot ); return; diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 14f05fe476f8739919cb64b794a2d317cf9b922f..b7f690594479668a9cdae0f358f83367040da5a4 100644 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -168,7 +168,7 @@ public: LLJoint(S32 joint_num); // *TODO: Only used for LLVOAvatarSelf::mScreenp. *DOES NOT INITIALIZE mResetAfterRestoreOldXform* - LLJoint( const std::string &name, LLJoint *parent=NULL ); + LLJoint( const std::string &name, LLJoint *parent= nullptr ); virtual ~LLJoint(); private: @@ -176,7 +176,7 @@ private: public: // set name and parent - void setup( const std::string &name, LLJoint *parent=NULL ); + void setup( const std::string &name, LLJoint *parent= nullptr ); void touch(U32 flags = ALL_DIRTY); diff --git a/indra/llcharacter/lljointsolverrp3.cpp b/indra/llcharacter/lljointsolverrp3.cpp index 6b3b411dcbc14ebf6840d2c4176ba390bde37107..f662dbbbf0d7c9e34680b13a5d72534a37d8446f 100644 --- a/indra/llcharacter/lljointsolverrp3.cpp +++ b/indra/llcharacter/lljointsolverrp3.cpp @@ -43,10 +43,10 @@ //----------------------------------------------------------------------------- LLJointSolverRP3::LLJointSolverRP3() { - mJointA = NULL; - mJointB = NULL; - mJointC = NULL; - mJointGoal = NULL; + mJointA = nullptr; + mJointB = nullptr; + mJointC = nullptr; + mJointGoal = nullptr; mLengthAB = 1.0f; mLengthBC = 1.0f; mPoleVector.setVec( 1.0f, 0.0f, 0.0f ); diff --git a/indra/llcharacter/lljointstate.h b/indra/llcharacter/lljointstate.h index fd0886b53049f04f7ca38f8070d3e11c94338a81..f26981cdf53083cb4e63462e4e5e725a3518d767 100644 --- a/indra/llcharacter/lljointstate.h +++ b/indra/llcharacter/lljointstate.h @@ -64,7 +64,7 @@ protected: public: // Constructor LLJointState() - : mJoint(NULL) + : mJoint(nullptr) , mUsage(0) , mWeight(0.f) , mPriority(LLJoint::USE_MOTION_PRIORITY) @@ -80,7 +80,7 @@ public: // joint that this state is applied to LLJoint* getJoint() { return mJoint; } const LLJoint* getJoint() const { return mJoint; } - BOOL setJoint( LLJoint *joint ) { mJoint = joint; return mJoint != NULL; } + BOOL setJoint( LLJoint *joint ) { mJoint = joint; return mJoint != nullptr; } // transform type (bitwise flags can be combined) // Note that these are set automatically when various diff --git a/indra/llcharacter/llkeyframefallmotion.cpp b/indra/llcharacter/llkeyframefallmotion.cpp index 2fdc5d440f72812fa7c8a9f2f0427a6d8a0505d9..cf0412e02d2119f494be51c0d1d3f554626f73ad 100644 --- a/indra/llcharacter/llkeyframefallmotion.cpp +++ b/indra/llcharacter/llkeyframefallmotion.cpp @@ -48,7 +48,7 @@ LLKeyframeFallMotion::LLKeyframeFallMotion(const LLUUID &id) : LLKeyframeMotion(id) { mVelocityZ = 0.f; - mCharacter = NULL; + mCharacter = nullptr; } diff --git a/indra/llcharacter/llkeyframefallmotion.h b/indra/llcharacter/llkeyframefallmotion.h index 7f0a2fdda28ade431e24f44d143c85517f9b8ef9..83486ea6168e59b1fdce970e429f1c36efdb62ff 100644 --- a/indra/llcharacter/llkeyframefallmotion.h +++ b/indra/llcharacter/llkeyframefallmotion.h @@ -59,10 +59,10 @@ public: //------------------------------------------------------------------------- // animation callbacks to be implemented by subclasses //------------------------------------------------------------------------- - virtual LLMotionInitStatus onInitialize(LLCharacter *character); - virtual BOOL onActivate(); - virtual F32 getEaseInDuration(); - virtual BOOL onUpdate(F32 activeTime, U8* joint_mask); + LLMotionInitStatus onInitialize(LLCharacter *character) override; + BOOL onActivate() override; + F32 getEaseInDuration() override; + BOOL onUpdate(F32 activeTime, U8* joint_mask) override; protected: //------------------------------------------------------------------------- diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 11e9a6f2186a503d0a548dafb49eece4b4d8f7c2..f823f4069862ffac7599cb57505855337369a5d0 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -48,7 +48,7 @@ //----------------------------------------------------------------------------- // Static Definitions //----------------------------------------------------------------------------- -LLVFS* LLKeyframeMotion::sVFS = NULL; +LLVFS* LLKeyframeMotion::sVFS = nullptr; LLKeyframeDataCache::keyframe_data_map_t LLKeyframeDataCache::sKeyframeDataMap; //----------------------------------------------------------------------------- @@ -388,7 +388,7 @@ void LLKeyframeMotion::JointMotion::update(LLJointState* joint_state, F32 time, { // this value being 0 is the cause of https://jira.lindenlab.com/browse/SL-22678 but I haven't // managed to get a stack to see how it got here. Testing for 0 here will stop the crash. - if ( joint_state == NULL ) + if ( joint_state == nullptr ) { return; } @@ -433,9 +433,9 @@ void LLKeyframeMotion::JointMotion::update(LLJointState* joint_state, F32 time, //----------------------------------------------------------------------------- LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id) : LLMotion(id), - mJointMotionList(NULL), - mPelvisp(NULL), - mCharacter(NULL), + mJointMotionList(nullptr), + mPelvisp(nullptr), + mCharacter(nullptr), mLastSkeletonSerialNum(0), mLastUpdateTime(0.f), mLastLoopedTime(0.f), @@ -585,7 +585,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact if (!anim_file->getSize()) { delete anim_file; - anim_file = NULL; + anim_file = nullptr; // request asset over network on next call to load mAssetStatus = ASSET_NEEDS_FETCH; @@ -598,7 +598,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact anim_data = new U8[anim_file_size]; success = anim_file->read(anim_data, anim_file_size); /*Flawfinder: ignore*/ delete anim_file; - anim_file = NULL; + anim_file = nullptr; } if (!success) @@ -1011,8 +1011,8 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 } LLVector3 norm; - LLJoint *source_jointp = NULL; - LLJoint *target_jointp = NULL; + LLJoint *source_jointp = nullptr; + LLJoint *target_jointp = nullptr; if (shared_data->mConstraintType == CONSTRAINT_TYPE_PLANE) { @@ -1463,7 +1463,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) { LL_WARNS() << "Joint will be omitted from animation: joint_num " << joint_num << " is outside of legal range [0-" << LL_CHARACTER_MAX_ANIMATED_JOINTS << ") for joint " << joint->getName() << LL_ENDL; - joint = NULL; + joint = nullptr; } } else @@ -2440,7 +2440,7 @@ LLKeyframeMotion::JointMotionList* LLKeyframeDataCache::getKeyframeData(const LL keyframe_data_map_t::iterator found_data = sKeyframeDataMap.find(id); if (found_data == sKeyframeDataMap.end()) { - return NULL; + return nullptr; } return found_data->second; } @@ -2470,8 +2470,8 @@ LLKeyframeMotion::JointConstraint::JointConstraint(JointConstraintSharedData* sh mWeight = 0.f; mTotalLength = 0.f; mActive = FALSE; - mSourceVolume = NULL; - mTargetVolume = NULL; + mSourceVolume = nullptr; + mTargetVolume = nullptr; mFixupDistanceRMS = 0.f; for (S32 i=0; i<MAX_CHAIN_LENGTH; ++i) diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h index a02aa0b462a539a12d0dfc6e1f3b76068380730d..60f129d48898096a366f4e3ca92197e7bb0fbcbe 100644 --- a/indra/llcharacter/llkeyframemotion.h +++ b/indra/llcharacter/llkeyframemotion.h @@ -85,59 +85,64 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { + BOOL getLoop() override + { if (mJointMotionList) return mJointMotionList->mLoop; else return FALSE; } // motions must report their total duration - virtual F32 getDuration() { + F32 getDuration() override + { if (mJointMotionList) return mJointMotionList->mDuration; else return 0.f; } // motions must report their "ease in" duration - virtual F32 getEaseInDuration() { + F32 getEaseInDuration() override + { if (mJointMotionList) return mJointMotionList->mEaseInDuration; else return 0.f; } // motions must report their "ease out" duration. - virtual F32 getEaseOutDuration() { + F32 getEaseOutDuration() override + { if (mJointMotionList) return mJointMotionList->mEaseOutDuration; else return 0.f; } // motions must report their priority - virtual LLJoint::JointPriority getPriority() { + LLJoint::JointPriority getPriority() override + { if (mJointMotionList) return mJointMotionList->mBasePriority; else return LLJoint::LOW_PRIORITY; } - virtual LLMotionBlendType getBlendType() { return NORMAL_BLEND; } + LLMotionBlendType getBlendType() override { return NORMAL_BLEND; } // called to determine when a motion should be activated/deactivated based on avatar pixel coverage - virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_KEYFRAME; } + F32 getMinPixelArea() override { return MIN_REQUIRED_PIXEL_AREA_KEYFRAME; } // run-time (post constructor) initialization, // called after parameters have been set // must return true to indicate success and be available for activation - virtual LLMotionInitStatus onInitialize(LLCharacter *character); + LLMotionInitStatus onInitialize(LLCharacter *character) override; // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + BOOL onActivate() override; // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + BOOL onUpdate(F32 time, U8* joint_mask) override; // called when a motion is deactivated - virtual void onDeactivate(); + void onDeactivate() override; - virtual void setStopTime(F32 time); + void setStopTime(F32 time) override; static void setVFS(LLVFS* vfs) { sVFS = vfs; } @@ -150,7 +155,7 @@ public: U32 getFileSize(); BOOL serialize(LLDataPacker& dp) const; BOOL deserialize(LLDataPacker& dp); - BOOL isLoaded() { return mJointMotionList != NULL; } + BOOL isLoaded() { return mJointMotionList != nullptr; } void dumpToFile(const std::string& name); @@ -199,17 +204,17 @@ protected: { public: JointConstraintSharedData() : + mSourceConstraintVolume(0), + mTargetConstraintVolume(0), mChainLength(0), + mJointStateIndices(nullptr), mEaseInStartTime(0.f), mEaseInStopTime(0.f), mEaseOutStartTime(0.f), - mEaseOutStopTime(0.f), + mEaseOutStopTime(0.f), mUseTargetOffset(FALSE), mConstraintType(CONSTRAINT_TYPE_POINT), - mConstraintTargetType(CONSTRAINT_TARGET_TYPE_BODY), - mSourceConstraintVolume(0), - mTargetConstraintVolume(0), - mJointStateIndices(NULL) + mConstraintTargetType(CONSTRAINT_TARGET_TYPE_BODY) { }; ~JointConstraintSharedData() { delete [] mJointStateIndices; } diff --git a/indra/llcharacter/llkeyframestandmotion.cpp b/indra/llcharacter/llkeyframestandmotion.cpp index a5e879f2427c89ddc8bbf305fb0d4623dd547c6b..3f9ae7c46fa90edbb0ec221b054928dd03be8580 100644 --- a/indra/llcharacter/llkeyframestandmotion.cpp +++ b/indra/llcharacter/llkeyframestandmotion.cpp @@ -50,7 +50,7 @@ const F32 POSITION_THRESHOLD = 0.1f; LLKeyframeStandMotion::LLKeyframeStandMotion(const LLUUID &id) : LLKeyframeMotion(id) { mFlipFeet = FALSE; - mCharacter = NULL; + mCharacter = nullptr; // create kinematic hierarchy mPelvisJoint.addChild( &mHipLeftJoint ); @@ -60,15 +60,15 @@ LLKeyframeStandMotion::LLKeyframeStandMotion(const LLUUID &id) : LLKeyframeMotio mHipRightJoint.addChild( &mKneeRightJoint ); mKneeRightJoint.addChild( &mAnkleRightJoint ); - mPelvisState = NULL; + mPelvisState = nullptr; - mHipLeftState = NULL; - mKneeLeftState = NULL; - mAnkleLeftState = NULL; + mHipLeftState = nullptr; + mKneeLeftState = nullptr; + mAnkleLeftState = nullptr; - mHipRightState = NULL; - mKneeRightState = NULL; - mAnkleRightState = NULL; + mHipRightState = nullptr; + mKneeRightState = nullptr; + mAnkleRightState = nullptr; mTrackAnkles = TRUE; diff --git a/indra/llcharacter/llkeyframestandmotion.h b/indra/llcharacter/llkeyframestandmotion.h index c2634ecd6d185f452dd6f90a8a996566fd6f5874..1e2ce07fbd33129ac73b35822effb2e7c5a7ccb0 100644 --- a/indra/llcharacter/llkeyframestandmotion.h +++ b/indra/llcharacter/llkeyframestandmotion.h @@ -60,10 +60,10 @@ public: //------------------------------------------------------------------------- // animation callbacks to be implemented by subclasses //------------------------------------------------------------------------- - virtual LLMotionInitStatus onInitialize(LLCharacter *character); - virtual BOOL onActivate(); - void onDeactivate(); - virtual BOOL onUpdate(F32 time, U8* joint_mask); + LLMotionInitStatus onInitialize(LLCharacter *character) override; + BOOL onActivate() override; + void onDeactivate() override; + BOOL onUpdate(F32 time, U8* joint_mask) override; public: //------------------------------------------------------------------------- diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index 827319ccba43bef62bc5c59d6acf93f06c925efa..4033074b3696a091f32b446aca4412155e92394a 100644 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -56,7 +56,7 @@ const F32 SPEED_ADJUST_TIME_CONSTANT = 0.1f; // time constant for speed adjustm //----------------------------------------------------------------------------- LLKeyframeWalkMotion::LLKeyframeWalkMotion(const LLUUID &id) : LLKeyframeMotion(id), - mCharacter(NULL), + mCharacter(nullptr), mCyclePhase(0.0f), mRealTimeLast(0.0f), mAdjTimeLast(0.0f), @@ -139,17 +139,17 @@ BOOL LLKeyframeWalkMotion::onUpdate(F32 time, U8* joint_mask) //----------------------------------------------------------------------------- LLWalkAdjustMotion::LLWalkAdjustMotion(const LLUUID &id) : LLMotion(id), - mCharacter(NULL), + mCharacter(nullptr), + mLeftAnkleJoint(nullptr), + mRightAnkleJoint(nullptr), + mPelvisState(new LLJointState), + mPelvisJoint(nullptr), mLastTime(0.f), - mAnimSpeed(0.f), mAdjustedSpeed(0.f), + mAnimSpeed(0.f), mRelativeDir(0.f), - mAnkleOffset(0.f), - mLeftAnkleJoint(NULL), - mRightAnkleJoint(NULL), - mPelvisJoint(NULL), // LLPointer<LLJointState> - mPelvisState(new LLJointState) + mAnkleOffset(0.f) { mName = "walk_adjust"; } @@ -336,7 +336,7 @@ void LLWalkAdjustMotion::onDeactivate() //----------------------------------------------------------------------------- LLFlyAdjustMotion::LLFlyAdjustMotion(const LLUUID &id) : LLMotion(id), - mCharacter(NULL), + mCharacter(nullptr), mRoll(0.f) { mName = "fly_adjust"; diff --git a/indra/llcharacter/llkeyframewalkmotion.h b/indra/llcharacter/llkeyframewalkmotion.h index 0e8d21b7652ccf523b582e5f7a381269ecfcb6aa..e940bfb7d0cc42a27a24686237197cdf60a3611c 100644 --- a/indra/llcharacter/llkeyframewalkmotion.h +++ b/indra/llcharacter/llkeyframewalkmotion.h @@ -64,10 +64,10 @@ public: //------------------------------------------------------------------------- // animation callbacks to be implemented by subclasses //------------------------------------------------------------------------- - virtual LLMotionInitStatus onInitialize(LLCharacter *character); - virtual BOOL onActivate(); - virtual void onDeactivate(); - virtual BOOL onUpdate(F32 time, U8* joint_mask); + LLMotionInitStatus onInitialize(LLCharacter *character) override; + BOOL onActivate() override; + void onDeactivate() override; + BOOL onUpdate(F32 time, U8* joint_mask) override; public: //------------------------------------------------------------------------- @@ -99,17 +99,17 @@ public: //------------------------------------------------------------------------- // animation callbacks to be implemented by subclasses //------------------------------------------------------------------------- - virtual LLMotionInitStatus onInitialize(LLCharacter *character); - virtual BOOL onActivate(); - virtual void onDeactivate(); - virtual BOOL onUpdate(F32 time, U8* joint_mask); - virtual LLJoint::JointPriority getPriority(){return LLJoint::HIGH_PRIORITY;} - virtual BOOL getLoop() { return TRUE; } - virtual F32 getDuration() { return 0.f; } - virtual F32 getEaseInDuration() { return 0.f; } - virtual F32 getEaseOutDuration() { return 0.f; } - virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_WALK_ADJUST; } - virtual LLMotionBlendType getBlendType() { return ADDITIVE_BLEND; } + LLMotionInitStatus onInitialize(LLCharacter *character) override; + BOOL onActivate() override; + void onDeactivate() override; + BOOL onUpdate(F32 time, U8* joint_mask) override; + LLJoint::JointPriority getPriority() override {return LLJoint::HIGH_PRIORITY;} + BOOL getLoop() override { return TRUE; } + F32 getDuration() override { return 0.f; } + F32 getEaseInDuration() override { return 0.f; } + F32 getEaseOutDuration() override { return 0.f; } + F32 getMinPixelArea() override { return MIN_REQUIRED_PIXEL_AREA_WALK_ADJUST; } + LLMotionBlendType getBlendType() override { return ADDITIVE_BLEND; } public: //------------------------------------------------------------------------- @@ -149,17 +149,17 @@ public: //------------------------------------------------------------------------- // animation callbacks to be implemented by subclasses //------------------------------------------------------------------------- - virtual LLMotionInitStatus onInitialize(LLCharacter *character); - virtual BOOL onActivate(); - virtual void onDeactivate() {}; - virtual BOOL onUpdate(F32 time, U8* joint_mask); - virtual LLJoint::JointPriority getPriority(){return LLJoint::HIGHER_PRIORITY;} - virtual BOOL getLoop() { return TRUE; } - virtual F32 getDuration() { return 0.f; } - virtual F32 getEaseInDuration() { return 0.f; } - virtual F32 getEaseOutDuration() { return 0.f; } - virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_FLY_ADJUST; } - virtual LLMotionBlendType getBlendType() { return ADDITIVE_BLEND; } + LLMotionInitStatus onInitialize(LLCharacter *character) override; + BOOL onActivate() override; + void onDeactivate() override {}; + BOOL onUpdate(F32 time, U8* joint_mask) override; + LLJoint::JointPriority getPriority() override {return LLJoint::HIGHER_PRIORITY;} + BOOL getLoop() override { return TRUE; } + F32 getDuration() override { return 0.f; } + F32 getEaseInDuration() override { return 0.f; } + F32 getEaseOutDuration() override { return 0.f; } + F32 getMinPixelArea() override { return MIN_REQUIRED_PIXEL_AREA_FLY_ADJUST; } + LLMotionBlendType getBlendType() override { return ADDITIVE_BLEND; } protected: //------------------------------------------------------------------------- diff --git a/indra/llcharacter/llmotion.cpp b/indra/llcharacter/llmotion.cpp index 3a16d34fa23215fc2d10a1acda4cc135d5229235..38900afb4477e188041790b8a62122186648b9c1 100644 --- a/indra/llcharacter/llmotion.cpp +++ b/indra/llcharacter/llmotion.cpp @@ -53,8 +53,8 @@ LLMotion::LLMotion( const LLUUID &id ) : mSendStopTimestamp(F32_MAX), mResidualWeight(0.f), mFadeWeight(1.f), - mDeactivateCallback(NULL), - mDeactivateCallbackUserData(NULL) + mDeactivateCallback(nullptr), + mDeactivateCallbackUserData(nullptr) { for (S32 i=0; i<3; ++i) memset(&mJointSignature[i][0], 0, sizeof(U8) * LL_CHARACTER_MAX_ANIMATED_JOINTS); @@ -164,8 +164,8 @@ void LLMotion::deactivate() if (mDeactivateCallback) { (*mDeactivateCallback)(mDeactivateCallbackUserData); - mDeactivateCallback = NULL; // only call callback once - mDeactivateCallbackUserData = NULL; + mDeactivateCallback = nullptr; // only call callback once + mDeactivateCallbackUserData = nullptr; } onDeactivate(); diff --git a/indra/llcharacter/llmotion.h b/indra/llcharacter/llmotion.h index 3fd25dfb1a705817e05ed4b790e512a5b0e53e5f..9833dc4cfe9be8bde21683ab8557f6dca4341eea 100644 --- a/indra/llcharacter/llmotion.h +++ b/indra/llcharacter/llmotion.h @@ -194,18 +194,22 @@ public: LLTestMotion(const LLUUID &id) : LLMotion(id){} ~LLTestMotion() {} static LLMotion *create(const LLUUID& id) { return new LLTestMotion(id); } - BOOL getLoop() { return FALSE; } - F32 getDuration() { return 0.0f; } - F32 getEaseInDuration() { return 0.0f; } - F32 getEaseOutDuration() { return 0.0f; } - LLJoint::JointPriority getPriority() { return LLJoint::HIGH_PRIORITY; } - LLMotionBlendType getBlendType() { return NORMAL_BLEND; } - F32 getMinPixelArea() { return 0.f; } + BOOL getLoop() override { return FALSE; } + F32 getDuration() override { return 0.0f; } + F32 getEaseInDuration() override { return 0.0f; } + F32 getEaseOutDuration() override { return 0.0f; } + LLJoint::JointPriority getPriority() override { return LLJoint::HIGH_PRIORITY; } + LLMotionBlendType getBlendType() override { return NORMAL_BLEND; } + F32 getMinPixelArea() override { return 0.f; } - LLMotionInitStatus onInitialize(LLCharacter*) { LL_INFOS() << "LLTestMotion::onInitialize()" << LL_ENDL; return STATUS_SUCCESS; } - BOOL onActivate() { LL_INFOS() << "LLTestMotion::onActivate()" << LL_ENDL; return TRUE; } - BOOL onUpdate(F32 time, U8* joint_mask) { LL_INFOS() << "LLTestMotion::onUpdate(" << time << ")" << LL_ENDL; return TRUE; } - void onDeactivate() { LL_INFOS() << "LLTestMotion::onDeactivate()" << LL_ENDL; } + LLMotionInitStatus onInitialize(LLCharacter*) override + { LL_INFOS() << "LLTestMotion::onInitialize()" << LL_ENDL; return STATUS_SUCCESS; } + BOOL onActivate() override + { LL_INFOS() << "LLTestMotion::onActivate()" << LL_ENDL; return TRUE; } + BOOL onUpdate(F32 time, U8* joint_mask) override + { LL_INFOS() << "LLTestMotion::onUpdate(" << time << ")" << LL_ENDL; return TRUE; } + void onDeactivate() override + { LL_INFOS() << "LLTestMotion::onDeactivate()" << LL_ENDL; } }; @@ -220,43 +224,43 @@ public: static LLMotion *create(const LLUUID &id) { return new LLNullMotion(id); } // motions must specify whether or not they loop - /*virtual*/ BOOL getLoop() { return TRUE; } + /*virtual*/ BOOL getLoop() override { return TRUE; } // motions must report their total duration - /*virtual*/ F32 getDuration() { return 1.f; } + /*virtual*/ F32 getDuration() override { return 1.f; } // motions must report their "ease in" duration - /*virtual*/ F32 getEaseInDuration() { return 0.f; } + /*virtual*/ F32 getEaseInDuration() override { return 0.f; } // motions must report their "ease out" duration. - /*virtual*/ F32 getEaseOutDuration() { return 0.f; } + /*virtual*/ F32 getEaseOutDuration() override { return 0.f; } // motions must report their priority level - /*virtual*/ LLJoint::JointPriority getPriority() { return LLJoint::HIGH_PRIORITY; } + /*virtual*/ LLJoint::JointPriority getPriority() override { return LLJoint::HIGH_PRIORITY; } // motions must report their blend type - /*virtual*/ LLMotionBlendType getBlendType() { return NORMAL_BLEND; } + /*virtual*/ LLMotionBlendType getBlendType() override { return NORMAL_BLEND; } // called to determine when a motion should be activated/deactivated based on avatar pixel coverage - /*virtual*/ F32 getMinPixelArea() { return 0.f; } + /*virtual*/ F32 getMinPixelArea() override { return 0.f; } // run-time (post constructor) initialization, // called after parameters have been set // must return true to indicate success and be available for activation - /*virtual*/ LLMotionInitStatus onInitialize(LLCharacter *character) { return STATUS_SUCCESS; } + /*virtual*/ LLMotionInitStatus onInitialize(LLCharacter *character) override { return STATUS_SUCCESS; } // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - /*virtual*/ BOOL onActivate() { return TRUE; } + /*virtual*/ BOOL onActivate() override { return TRUE; } // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - /*virtual*/ BOOL onUpdate(F32 activeTime, U8* joint_mask) { return TRUE; } + /*virtual*/ BOOL onUpdate(F32 activeTime, U8* joint_mask) override { return TRUE; } // called when a motion is deactivated - /*virtual*/ void onDeactivate() {} + /*virtual*/ void onDeactivate() override {} }; #endif // LL_LLMOTION_H diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index 4834046990fef78ed8a0ab35620bba4cb7521aa7..9f1c41255142b9854bb5f5956c33d1f4440cc213 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -100,7 +100,7 @@ BOOL LLMotionRegistry::registerMotion( const LLUUID& id, LLMotionConstructor con //----------------------------------------------------------------------------- void LLMotionRegistry::markBad( const LLUUID& id ) { - mMotionTable[id] = LLMotionConstructor(NULL); + mMotionTable[id] = LLMotionConstructor(nullptr); } //----------------------------------------------------------------------------- @@ -108,10 +108,10 @@ void LLMotionRegistry::markBad( const LLUUID& id ) //----------------------------------------------------------------------------- LLMotion *LLMotionRegistry::createMotion( const LLUUID &id ) { - LLMotionConstructor constructor = get_if_there(mMotionTable, id, LLMotionConstructor(NULL)); - LLMotion* motion = NULL; + LLMotionConstructor constructor = get_if_there(mMotionTable, id, LLMotionConstructor(nullptr)); + LLMotion* motion = nullptr; - if ( constructor == NULL ) + if ( constructor == nullptr ) { // *FIX: need to replace with a better default scheme. RN motion = LLKeyframeMotion::create(id); @@ -135,18 +135,18 @@ LLMotion *LLMotionRegistry::createMotion( const LLUUID &id ) // Class Constructor //----------------------------------------------------------------------------- LLMotionController::LLMotionController() - : mTimeFactor(sCurrentTimeFactor), - mCharacter(NULL), - mAnimTime(0.f), + : mIsSelf(FALSE), + mTimeFactor(sCurrentTimeFactor), + mCharacter(nullptr), mPrevTimerElapsed(0.f), + mAnimTime(0.f), mLastTime(0.0f), mHasRunOnce(FALSE), mPaused(FALSE), mPauseTime(0.f), mTimeStep(0.f), mTimeStepCount(0), - mLastInterp(0.f), - mIsSelf(FALSE) + mLastInterp(0.f) { } @@ -360,7 +360,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id ) motion = sRegistry.createMotion(id); if (!motion) { - return NULL; + return nullptr; } // look up name for default motions @@ -378,7 +378,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id ) LL_INFOS() << "Motion " << id << " init failed." << LL_ENDL; sRegistry.markBad(id); delete motion; - return NULL; + return nullptr; case LLMotion::STATUS_HOLD: mLoadingMotions.insert(motion); break; @@ -414,7 +414,7 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset) { deprecateMotionInstance(motion); // force creation of new instance - motion = NULL; + motion = nullptr; } // create new motion instance @@ -926,7 +926,7 @@ BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time) { // It's not clear why the getWeight() line seems to be crashing this, but // hopefully this fixes it. - if (motion == NULL || motion->getPose() == NULL) + if (motion == nullptr || motion->getPose() == nullptr) { return FALSE; } @@ -1041,7 +1041,7 @@ LLMotion* LLMotionController::findMotion(const LLUUID& id) const motion_map_t::const_iterator iter = mAllMotions.find(id); if(iter == mAllMotions.end()) { - return NULL; + return nullptr; } else { diff --git a/indra/llcharacter/llmultigesture.cpp b/indra/llcharacter/llmultigesture.cpp index 0a098fc403e2602d3d68ae39fff3c4fa67bdaa41..adb31b09a0e07ef62e6c6a6554209aa95ffa04ac 100644 --- a/indra/llcharacter/llmultigesture.cpp +++ b/indra/llcharacter/llmultigesture.cpp @@ -52,8 +52,8 @@ LLMultiGesture::LLMultiGesture() mSteps(), mPlaying(FALSE), mCurrentStep(0), - mDoneCallback(NULL), - mCallbackData(NULL) + mDoneCallback(nullptr), + mCallbackData(nullptr) { reset(); } diff --git a/indra/llcharacter/llmultigesture.h b/indra/llcharacter/llmultigesture.h index fab1e959d6fa24993c95c92c227a89466e5a1ed0..3af50b61e380985c26e84f9e047c5d338c9aa696 100644 --- a/indra/llcharacter/llmultigesture.h +++ b/indra/llcharacter/llmultigesture.h @@ -144,15 +144,15 @@ public: LLGestureStepAnimation(); virtual ~LLGestureStepAnimation(); - virtual EStepType getType() { return STEP_ANIMATION; } + EStepType getType() override { return STEP_ANIMATION; } - virtual std::vector<std::string> getLabel() const; + std::vector<std::string> getLabel() const override; - virtual S32 getMaxSerialSize() const; - virtual BOOL serialize(LLDataPacker& dp) const; - virtual BOOL deserialize(LLDataPacker& dp); + S32 getMaxSerialSize() const override; + BOOL serialize(LLDataPacker& dp) const override; + BOOL deserialize(LLDataPacker& dp) override; - virtual void dump(); + void dump() override; public: std::string mAnimName; @@ -167,15 +167,15 @@ public: LLGestureStepSound(); virtual ~LLGestureStepSound(); - virtual EStepType getType() { return STEP_SOUND; } + EStepType getType() override { return STEP_SOUND; } - virtual std::vector<std::string> getLabel() const; + std::vector<std::string> getLabel() const override; - virtual S32 getMaxSerialSize() const; - virtual BOOL serialize(LLDataPacker& dp) const; - virtual BOOL deserialize(LLDataPacker& dp); + S32 getMaxSerialSize() const override; + BOOL serialize(LLDataPacker& dp) const override; + BOOL deserialize(LLDataPacker& dp) override; - virtual void dump(); + void dump() override; public: std::string mSoundName; @@ -190,15 +190,15 @@ public: LLGestureStepChat(); virtual ~LLGestureStepChat(); - virtual EStepType getType() { return STEP_CHAT; } + EStepType getType() override { return STEP_CHAT; } - virtual std::vector<std::string> getLabel() const; + std::vector<std::string> getLabel() const override; - virtual S32 getMaxSerialSize() const; - virtual BOOL serialize(LLDataPacker& dp) const; - virtual BOOL deserialize(LLDataPacker& dp); + S32 getMaxSerialSize() const override; + BOOL serialize(LLDataPacker& dp) const override; + BOOL deserialize(LLDataPacker& dp) override; - virtual void dump(); + void dump() override; public: std::string mChatText; @@ -215,15 +215,15 @@ public: LLGestureStepWait(); virtual ~LLGestureStepWait(); - virtual EStepType getType() { return STEP_WAIT; } + EStepType getType() override { return STEP_WAIT; } - virtual std::vector<std::string> getLabel() const; + std::vector<std::string> getLabel() const override; - virtual S32 getMaxSerialSize() const; - virtual BOOL serialize(LLDataPacker& dp) const; - virtual BOOL deserialize(LLDataPacker& dp); + S32 getMaxSerialSize() const override; + BOOL serialize(LLDataPacker& dp) const override; + BOOL deserialize(LLDataPacker& dp) override; - virtual void dump(); + void dump() override; public: F32 mWaitSeconds; diff --git a/indra/llcharacter/llpose.cpp b/indra/llcharacter/llpose.cpp index dfd0499b809fd0ff55fa86e321da926beb31fde5..67d554a3321e41b9ae310e4a2eaa958ae362117c 100644 --- a/indra/llcharacter/llpose.cpp +++ b/indra/llcharacter/llpose.cpp @@ -56,7 +56,7 @@ LLJointState* LLPose::getFirstJointState() mListIter = mJointMap.begin(); if (mListIter == mJointMap.end()) { - return NULL; + return nullptr; } else { @@ -72,7 +72,7 @@ LLJointState *LLPose::getNextJointState() mListIter++; if (mListIter == mJointMap.end()) { - return NULL; + return nullptr; } else { @@ -119,7 +119,7 @@ LLJointState* LLPose::findJointState(LLJoint *joint) if (iter == mJointMap.end()) { - return NULL; + return nullptr; } else { @@ -136,7 +136,7 @@ LLJointState* LLPose::findJointState(const std::string &name) if (iter == mJointMap.end()) { - return NULL; + return nullptr; } else { @@ -183,7 +183,7 @@ LLJointStateBlender::LLJointStateBlender() { for(S32 i = 0; i < JSB_NUM_JOINT_STATES; i++) { - mJointStates[i] = NULL; + mJointStates[i] = nullptr; mPriorities[i] = S32_MIN; mAdditiveBlends[i] = FALSE; } @@ -398,7 +398,7 @@ void LLJointStateBlender::blendJointStates(BOOL apply_now) // now clear joint states for(S32 i = 0; i < JSB_NUM_JOINT_STATES; i++) { - mJointStates[i] = NULL; + mJointStates[i] = nullptr; } } } @@ -434,7 +434,7 @@ void LLJointStateBlender::clear() // now clear joint states for(S32 i = 0; i < JSB_NUM_JOINT_STATES; i++) { - mJointStates[i] = NULL; + mJointStates[i] = nullptr; } } diff --git a/indra/llcharacter/lltargetingmotion.cpp b/indra/llcharacter/lltargetingmotion.cpp index 0ddaf1c53868147a4ba83360436b395d679aeca3..7566d81be1bacb5f3679cd727a814a0ecb13f0e1 100644 --- a/indra/llcharacter/lltargetingmotion.cpp +++ b/indra/llcharacter/lltargetingmotion.cpp @@ -47,12 +47,12 @@ const F32 TORSO_TARGET_HALF_LIFE = 0.25f; //----------------------------------------------------------------------------- LLTargetingMotion::LLTargetingMotion(const LLUUID &id) : LLMotion(id), - mCharacter(NULL), - mPelvisJoint(NULL), - mTorsoJoint(NULL), - mRightHandJoint(NULL), + mCharacter(nullptr), + mTorsoState(new LLJointState), + mPelvisJoint(nullptr), + mTorsoJoint(nullptr), // LLPointer<LLJointState> - mTorsoState(new LLJointState) + mRightHandJoint(nullptr) { mName = "targeting"; } diff --git a/indra/llcharacter/lltargetingmotion.h b/indra/llcharacter/lltargetingmotion.h index 0971417e1efd0065655c971602c9698b51652bcd..8d0aaa258f28282e78ebfe6b1c8ade96f87a1487 100644 --- a/indra/llcharacter/lltargetingmotion.h +++ b/indra/llcharacter/lltargetingmotion.h @@ -66,42 +66,43 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return TRUE; } + BOOL getLoop() override { return TRUE; } // motions must report their total duration - virtual F32 getDuration() { return 0.0; } + F32 getDuration() override { return 0.0; } // motions must report their "ease in" duration - virtual F32 getEaseInDuration() { return TARGETING_EASEIN_DURATION; } + F32 getEaseInDuration() override { return TARGETING_EASEIN_DURATION; } // motions must report their "ease out" duration. - virtual F32 getEaseOutDuration() { return TARGETING_EASEOUT_DURATION; } + F32 getEaseOutDuration() override { return TARGETING_EASEOUT_DURATION; } // motions must report their priority - virtual LLJoint::JointPriority getPriority() { return TARGETING_PRIORITY; } + LLJoint::JointPriority getPriority() override { return TARGETING_PRIORITY; } - virtual LLMotionBlendType getBlendType() { return ADDITIVE_BLEND; } + LLMotionBlendType getBlendType() override { return ADDITIVE_BLEND; } // called to determine when a motion should be activated/deactivated based on avatar pixel coverage - virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_TARGETING; } + F32 getMinPixelArea() override + { return MIN_REQUIRED_PIXEL_AREA_TARGETING; } // run-time (post constructor) initialization, // called after parameters have been set // must return true to indicate success and be available for activation - virtual LLMotionInitStatus onInitialize(LLCharacter *character); + LLMotionInitStatus onInitialize(LLCharacter *character) override; // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + BOOL onActivate() override; // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + BOOL onUpdate(F32 time, U8* joint_mask) override; // called when a motion is deactivated - virtual void onDeactivate(); + void onDeactivate() override; public: diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp index 08f342da54782f09cb103dd8b8c7b6bcbb076378..3867a93677154c1cced8d936727e4f16e11cee62 100644 --- a/indra/llcharacter/llvisualparam.cpp +++ b/indra/llcharacter/llvisualparam.cpp @@ -164,12 +164,12 @@ void LLVisualParamInfo::toStream(std::ostream &out) LLVisualParam::LLVisualParam() : mCurWeight( 0.f ), mLastWeight( 0.f ), - mNext( NULL ), + mNext(nullptr ), mTargetWeight( 0.f ), mIsAnimating( FALSE ), mIsDummy(FALSE), mID( -1 ), - mInfo( 0 ), + mInfo( nullptr ), mParamLocation(LOC_UNKNOWN) { } @@ -196,7 +196,7 @@ LLVisualParam::LLVisualParam(const LLVisualParam& pOther) LLVisualParam::~LLVisualParam() { delete mNext; - mNext = NULL; + mNext = nullptr; } /* @@ -307,7 +307,7 @@ void LLVisualParam::setNextParam( LLVisualParam *next ) //----------------------------------------------------------------------------- void LLVisualParam::clearNextParam() { - mNext = NULL; + mNext = nullptr; } //----------------------------------------------------------------------------- diff --git a/indra/llcommon/StackWalker.cpp b/indra/llcommon/StackWalker.cpp index 5a2ab4a4f25cd86591d7135a7d9af47630684553..06d11b67c6543fe81787e4ade6ac5116cc506e7b 100644 --- a/indra/llcommon/StackWalker.cpp +++ b/indra/llcommon/StackWalker.cpp @@ -262,44 +262,44 @@ public: StackWalkerInternal(StackWalker *parent, HANDLE hProcess) { m_parent = parent; - m_hDbhHelp = NULL; - pSC = NULL; + m_hDbhHelp = nullptr; + pSC = nullptr; m_hProcess = hProcess; - m_szSymPath = NULL; - pSFTA = NULL; - pSGLFA = NULL; - pSGMB = NULL; - pSGMI = NULL; - pSGO = NULL; - pSGSFA = NULL; - pSI = NULL; - pSLM = NULL; - pSSO = NULL; - pSW = NULL; - pUDSN = NULL; - pSGSP = NULL; + m_szSymPath = nullptr; + pSFTA = nullptr; + pSGLFA = nullptr; + pSGMB = nullptr; + pSGMI = nullptr; + pSGO = nullptr; + pSGSFA = nullptr; + pSI = nullptr; + pSLM = nullptr; + pSSO = nullptr; + pSW = nullptr; + pUDSN = nullptr; + pSGSP = nullptr; } ~StackWalkerInternal() { - if (pSC != NULL) + if (pSC != nullptr) pSC(m_hProcess); // SymCleanup - if (m_hDbhHelp != NULL) + if (m_hDbhHelp != nullptr) FreeLibrary(m_hDbhHelp); - m_hDbhHelp = NULL; - m_parent = NULL; - if(m_szSymPath != NULL) + m_hDbhHelp = nullptr; + m_parent = nullptr; + if(m_szSymPath != nullptr) free(m_szSymPath); - m_szSymPath = NULL; + m_szSymPath = nullptr; } BOOL Init(LPCSTR szSymPath) { - if (m_parent == NULL) + if (m_parent == nullptr) return FALSE; // Dynamically load the Entry-Points for dbghelp.dll: // First try to load the newsest one from TCHAR szTemp[4096]; // But before wqe do this, we first check if the ".local" file exists - if (GetModuleFileName(NULL, szTemp, 4096) > 0) + if (GetModuleFileName(nullptr, szTemp, 4096) > 0) { _tcscat_s(szTemp, _T(".local")); if (GetFileAttributes(szTemp) == INVALID_FILE_ATTRIBUTES) @@ -307,7 +307,7 @@ public: // ".local" file does not exist, so we can try to load the dbghelp.dll from the "Debugging Tools for Windows" // Ok, first try the new path according to the archtitecture: #ifdef _M_IX86 - if ( (m_hDbhHelp == NULL) && (GetEnvironmentVariable(_T("ProgramFiles"), szTemp, 4096) > 0) ) + if ( (m_hDbhHelp == nullptr) && (GetEnvironmentVariable(_T("ProgramFiles"), szTemp, 4096) > 0) ) { _tcscat_s(szTemp, _T("\\Debugging Tools for Windows (x86)\\dbghelp.dll")); // now check if the file exists: @@ -338,7 +338,7 @@ public: } #endif // If still not found, try the old directories... - if ( (m_hDbhHelp == NULL) && (GetEnvironmentVariable(_T("ProgramFiles"), szTemp, 4096) > 0) ) + if ( (m_hDbhHelp == nullptr) && (GetEnvironmentVariable(_T("ProgramFiles"), szTemp, 4096) > 0) ) { _tcscat_s(szTemp, _T("\\Debugging Tools for Windows\\dbghelp.dll")); // now check if the file exists: @@ -360,9 +360,9 @@ public: #endif } } - if (m_hDbhHelp == NULL) // if not already loaded, try to load a default-one + if (m_hDbhHelp == nullptr) // if not already loaded, try to load a default-one m_hDbhHelp = LoadLibrary( _T("dbghelp.dll") ); - if (m_hDbhHelp == NULL) + if (m_hDbhHelp == nullptr) return FALSE; pSI = (tSI) GetProcAddress(m_hDbhHelp, "SymInitialize" ); pSC = (tSC) GetProcAddress(m_hDbhHelp, "SymCleanup" ); @@ -380,18 +380,18 @@ public: pSLM = (tSLM) GetProcAddress(m_hDbhHelp, "SymLoadModule64" ); pSGSP =(tSGSP) GetProcAddress(m_hDbhHelp, "SymGetSearchPath" ); - if ( pSC == NULL || pSFTA == NULL || pSGMB == NULL || pSGMI == NULL || - pSGO == NULL || pSGSFA == NULL || pSI == NULL || pSSO == NULL || - pSW == NULL || pUDSN == NULL || pSLM == NULL ) + if ( pSC == nullptr || pSFTA == nullptr || pSGMB == nullptr || pSGMI == nullptr || + pSGO == nullptr || pSGSFA == nullptr || pSI == nullptr || pSSO == nullptr || + pSW == nullptr || pUDSN == nullptr || pSLM == nullptr ) { FreeLibrary(m_hDbhHelp); - m_hDbhHelp = NULL; - pSC = NULL; + m_hDbhHelp = nullptr; + pSC = nullptr; return FALSE; } // SymInitialize - if (szSymPath != NULL) + if (szSymPath != nullptr) m_szSymPath = _strdup(szSymPath); if (this->pSI(m_hProcess, m_szSymPath, FALSE) == FALSE) this->m_parent->OnDbgHelpErr("SymInitialize", GetLastError(), 0); @@ -404,7 +404,7 @@ public: symOptions = this->pSSO(symOptions); char buf[StackWalker::STACKWALK_MAX_NAMELEN] = {0}; - if (this->pSGSP != NULL) + if (this->pSGSP != nullptr) { if (this->pSGSP(m_hProcess, buf, StackWalker::STACKWALK_MAX_NAMELEN) == FALSE) this->m_parent->OnDbgHelpErr("SymGetSearchPath", GetLastError(), 0); @@ -565,10 +565,10 @@ private: // try both dlls... const TCHAR *dllname[] = { _T("kernel32.dll"), _T("tlhelp32.dll") }; - HINSTANCE hToolhelp = NULL; - tCT32S pCT32S = NULL; - tM32F pM32F = NULL; - tM32N pM32N = NULL; + HINSTANCE hToolhelp = nullptr; + tCT32S pCT32S = nullptr; + tM32F pM32F = nullptr; + tM32N pM32N = nullptr; HANDLE hSnap; MODULEENTRY32 me; @@ -579,18 +579,18 @@ private: for (i = 0; i<(sizeof(dllname) / sizeof(dllname[0])); i++ ) { hToolhelp = LoadLibrary( dllname[i] ); - if (hToolhelp == NULL) + if (hToolhelp == nullptr) continue; pCT32S = (tCT32S) GetProcAddress(hToolhelp, "CreateToolhelp32Snapshot"); pM32F = (tM32F) GetProcAddress(hToolhelp, "Module32First"); pM32N = (tM32N) GetProcAddress(hToolhelp, "Module32Next"); - if ( (pCT32S != NULL) && (pM32F != NULL) && (pM32N != NULL) ) + if ( (pCT32S != nullptr) && (pM32F != nullptr) && (pM32N != nullptr) ) break; // found the functions! FreeLibrary(hToolhelp); - hToolhelp = NULL; + hToolhelp = nullptr; } - if (hToolhelp == NULL) + if (hToolhelp == nullptr) return FALSE; hSnap = pCT32S( TH32CS_SNAPMODULE, pid ); @@ -643,21 +643,21 @@ private: //ModuleEntry e; DWORD cbNeeded; MODULEINFO mi; - HMODULE *hMods = 0; - char *tt = NULL; - char *tt2 = NULL; + HMODULE *hMods = nullptr; + char *tt = nullptr; + char *tt2 = nullptr; const SIZE_T TTBUFLEN = 8096; int cnt = 0; hPsapi = LoadLibrary( _T("psapi.dll") ); - if (hPsapi == NULL) + if (hPsapi == nullptr) return FALSE; pEPM = (tEPM) GetProcAddress( hPsapi, "EnumProcessModules" ); pGMFNE = (tGMFNE) GetProcAddress( hPsapi, "GetModuleFileNameExA" ); pGMBN = (tGMFNE) GetProcAddress( hPsapi, "GetModuleBaseNameA" ); pGMI = (tGMI) GetProcAddress( hPsapi, "GetModuleInformation" ); - if ( (pEPM == NULL) || (pGMFNE == NULL) || (pGMBN == NULL) || (pGMI == NULL) ) + if ( (pEPM == nullptr) || (pGMFNE == nullptr) || (pGMBN == nullptr) || (pGMI == nullptr) ) { // we couldn´t find all functions FreeLibrary(hPsapi); @@ -667,7 +667,7 @@ private: hMods = (HMODULE*) malloc(sizeof(HMODULE) * (TTBUFLEN / sizeof(HMODULE))); tt = (char*) malloc(sizeof(char) * TTBUFLEN); tt2 = (char*) malloc(sizeof(char) * TTBUFLEN); - if ( (hMods == NULL) || (tt == NULL) || (tt2 == NULL) ) + if ( (hMods == nullptr) || (tt == nullptr) || (tt2 == nullptr) ) goto cleanup; if ( ! pEPM( hProcess, hMods, TTBUFLEN, &cbNeeded ) ) @@ -700,10 +700,10 @@ private: } cleanup: - if (hPsapi != NULL) FreeLibrary(hPsapi); - if (tt2 != NULL) free(tt2); - if (tt != NULL) free(tt); - if (hMods != NULL) free(hMods); + if (hPsapi != nullptr) FreeLibrary(hPsapi); + if (tt2 != nullptr) free(tt2); + if (tt != nullptr) free(tt); + if (hMods != nullptr) free(hMods); return cnt != 0; } // GetModuleListPSAPI @@ -713,33 +713,33 @@ private: CHAR *szImg = _strdup(img); CHAR *szMod = _strdup(mod); DWORD result = ERROR_SUCCESS; - if ( (szImg == NULL) || (szMod == NULL) ) + if ( (szImg == nullptr) || (szMod == nullptr) ) result = ERROR_NOT_ENOUGH_MEMORY; else { - if (pSLM(hProcess, 0, szImg, szMod, baseAddr, size) == 0) + if (pSLM(hProcess, nullptr, szImg, szMod, baseAddr, size) == 0) result = GetLastError(); } ULONGLONG fileVersion = 0; - if ( (m_parent != NULL) && (szImg != NULL) ) + if ( (m_parent != nullptr) && (szImg != nullptr) ) { // try to retrive the file-version: if ( (this->m_parent->m_options & StackWalker::RetrieveFileVersion) != 0) { - VS_FIXEDFILEINFO *fInfo = NULL; + VS_FIXEDFILEINFO *fInfo = nullptr; DWORD dwHandle; DWORD dwSize = GetFileVersionInfoSizeA(szImg, &dwHandle); if (dwSize > 0) { LPVOID vData = malloc(dwSize); - if (vData != NULL) + if (vData != nullptr) { if (GetFileVersionInfoA(szImg, dwHandle, dwSize, vData) != 0) { UINT len; TCHAR szSubBlock[] = _T("\\"); if (VerQueryValue(vData, szSubBlock, (LPVOID*) &fInfo, &len) == 0) - fInfo = NULL; + fInfo = nullptr; else { fileVersion = ((ULONGLONG)fInfo->dwFileVersionLS) + ((ULONGLONG)fInfo->dwFileVersionMS << 32); @@ -791,8 +791,8 @@ private: pdbName = Module.LoadedPdbName; this->m_parent->OnLoadModule(img, mod, baseAddr, size, result, szSymType, pdbName, fileVersion); } - if (szImg != NULL) free(szImg); - if (szMod != NULL) free(szMod); + if (szImg != nullptr) free(szImg); + if (szMod != nullptr) free(szMod); return result; } public: @@ -809,7 +809,7 @@ public: BOOL GetModuleInfo(HANDLE hProcess, DWORD64 baseAddr, IMAGEHLP_MODULE64_V3 *pModuleInfo) { memset(pModuleInfo, 0, sizeof(IMAGEHLP_MODULE64_V3)); - if(this->pSGMI == NULL) + if(this->pSGMI == nullptr) { SetLastError(ERROR_DLL_INIT_FAILED); return FALSE; @@ -817,7 +817,7 @@ public: // First try to use the larger ModuleInfo-Structure pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULE64_V3); void *pData = malloc(4096); // reserve enough memory, so the bug in v6.3.5.1 does not lead to memory-overwrites... - if (pData == NULL) + if (pData == nullptr) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; @@ -863,7 +863,7 @@ StackWalker::StackWalker(DWORD dwProcessId, HANDLE hProcess) this->m_hProcess = hProcess; this->m_sw = new StackWalkerInternal(this, this->m_hProcess); this->m_dwProcessId = dwProcessId; - this->m_szSymPath = NULL; + this->m_szSymPath = nullptr; this->m_MaxRecursionCount = 1000; } StackWalker::StackWalker(bool verbose, int options, LPCSTR szSymPath, DWORD dwProcessId, HANDLE hProcess) @@ -874,29 +874,29 @@ StackWalker::StackWalker(bool verbose, int options, LPCSTR szSymPath, DWORD dwPr this->m_hProcess = hProcess; this->m_sw = new StackWalkerInternal(this, this->m_hProcess); this->m_dwProcessId = dwProcessId; - if (szSymPath != NULL) + if (szSymPath != nullptr) { this->m_szSymPath = _strdup(szSymPath); this->m_options |= SymBuildPath; } else - this->m_szSymPath = NULL; + this->m_szSymPath = nullptr; this->m_MaxRecursionCount = 1000; } StackWalker::~StackWalker() { - if (m_szSymPath != NULL) + if (m_szSymPath != nullptr) free(m_szSymPath); - m_szSymPath = NULL; - if (this->m_sw != NULL) + m_szSymPath = nullptr; + if (this->m_sw != nullptr) delete this->m_sw; - this->m_sw = NULL; + this->m_sw = nullptr; } BOOL StackWalker::LoadModules() { - if (this->m_sw == NULL) + if (this->m_sw == nullptr) { SetLastError(ERROR_DLL_INIT_FAILED); return FALSE; @@ -905,19 +905,19 @@ BOOL StackWalker::LoadModules() return TRUE; // Build the sym-path: - char *szSymPath = NULL; + char *szSymPath = nullptr; if ( (this->m_options & SymBuildPath) != 0) { const size_t nSymPathLen = 4096; szSymPath = (char*) malloc(nSymPathLen); - if (szSymPath == NULL) + if (szSymPath == nullptr) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } szSymPath[0] = 0; // Now first add the (optional) provided sympath: - if (this->m_szSymPath != NULL) + if (this->m_szSymPath != nullptr) { strcat_s(szSymPath, nSymPathLen, this->m_szSymPath); strcat_s(szSymPath, nSymPathLen, ";"); @@ -936,7 +936,7 @@ BOOL StackWalker::LoadModules() } // Now add the path for the main-module: - if (GetModuleFileNameA(NULL, szTemp, nTempLen) > 0) + if (GetModuleFileNameA(nullptr, szTemp, nTempLen) > 0) { szTemp[nTempLen-1] = 0; for (char *p = (szTemp+strlen(szTemp)-1); p >= szTemp; --p) @@ -994,7 +994,7 @@ BOOL StackWalker::LoadModules() // First Init the whole stuff... BOOL bRet = this->m_sw->Init(szSymPath); - if (szSymPath != NULL) free(szSymPath); szSymPath = NULL; + if (szSymPath != nullptr) free(szSymPath); szSymPath = nullptr; if (bRet == FALSE) { this->OnDbgHelpErr("Error while initializing dbghelp.dll", 0, 0); @@ -1013,15 +1013,15 @@ BOOL StackWalker::LoadModules() // This has to be done due to a problem with the "hProcess"-parameter in x64... // Because this class is in no case multi-threading-enabled (because of the limitations // of dbghelp.dll) it is "safe" to use a static-variable -static StackWalker::PReadProcessMemoryRoutine s_readMemoryFunction = NULL; -static LPVOID s_readMemoryFunction_UserData = NULL; +static StackWalker::PReadProcessMemoryRoutine s_readMemoryFunction = nullptr; +static LPVOID s_readMemoryFunction_UserData = nullptr; BOOL StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *context, PReadProcessMemoryRoutine readMemoryFunction, LPVOID pUserData) { m_verbose = verbose; CONTEXT c; CallstackEntry csEntry; - IMAGEHLP_SYMBOL64 *pSym = NULL; + IMAGEHLP_SYMBOL64 *pSym = nullptr; StackWalkerInternal::IMAGEHLP_MODULE64_V3 Module; IMAGEHLP_LINE64 Line; int frameNum; @@ -1031,7 +1031,7 @@ BOOL StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con if (m_modulesLoaded == FALSE) this->LoadModules(); // ignore the result... - if (this->m_sw->m_hDbhHelp == NULL) + if (this->m_sw->m_hDbhHelp == nullptr) { SetLastError(ERROR_DLL_INIT_FAILED); return FALSE; @@ -1040,7 +1040,7 @@ BOOL StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con s_readMemoryFunction = readMemoryFunction; s_readMemoryFunction_UserData = pUserData; - if (context == NULL) + if (context == nullptr) { // If no context is provided, capture the context // See: https://stackwalker.codeplex.com/discussions/446958 @@ -1122,7 +1122,7 @@ BOOL StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con // assume that either you are done, or that the stack is so hosed that the next // deeper frame could not be found. // CONTEXT need not to be suplied if imageTyp is IMAGE_FILE_MACHINE_I386! - if ( ! this->m_sw->pSW(imageType, this->m_hProcess, hThread, &s, &c, myReadProcMem, this->m_sw->pSFTA, this->m_sw->pSGMB, NULL) ) + if ( ! this->m_sw->pSW(imageType, this->m_hProcess, hThread, &s, &c, myReadProcMem, this->m_sw->pSFTA, this->m_sw->pSGMB, nullptr) ) { // INFO: "StackWalk64" does not set "GetLastError"... this->OnDbgHelpErr("StackWalk64", 0, s.AddrPC.Offset); @@ -1167,7 +1167,7 @@ BOOL StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con } // show line number info, NT5.0-method (SymGetLineFromAddr64()) - if (this->m_sw->pSGLFA != NULL ) + if (this->m_sw->pSGLFA != nullptr ) { // yes, we have SymGetLineFromAddr64() if (this->m_sw->pSGLFA(this->m_hProcess, s.AddrPC.Offset, &(csEntry.offsetFromLine), &Line) != FALSE) { @@ -1218,7 +1218,7 @@ BOOL StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con break; default: //_snprintf( ty, sizeof(ty), "symtype=%ld", (long) Module.SymType ); - csEntry.symTypeString = NULL; + csEntry.symTypeString = nullptr; break; } @@ -1258,7 +1258,7 @@ BOOL StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con if (bLastEntryCalled == false) this->OnCallstackEntry(lastEntry, csEntry); - if (context == NULL) + if (context == nullptr) ResumeThread(hThread); return TRUE; @@ -1272,7 +1272,7 @@ BOOL __stdcall StackWalker::myReadProcMem( LPDWORD lpNumberOfBytesRead ) { - if (s_readMemoryFunction == NULL) + if (s_readMemoryFunction == nullptr) { SIZE_T st; BOOL bRet = ReadProcessMemory(hProcess, (LPVOID) qwBaseAddress, lpBuffer, nSize, &st); diff --git a/indra/llcommon/StackWalker.h b/indra/llcommon/StackWalker.h index 6c5e6fd429f4d36702441b7235f8069eaa6a1df1..e7bfe19a4f6f6de7697902e1896fda195a7762cd 100644 --- a/indra/llcommon/StackWalker.h +++ b/indra/llcommon/StackWalker.h @@ -96,7 +96,7 @@ public: StackWalker( bool verbose = true, int options = OptionsAll, // 'int' is by design, to combine the enum-flags - LPCSTR szSymPath = NULL, + LPCSTR szSymPath = nullptr, DWORD dwProcessId = GetCurrentProcessId(), HANDLE hProcess = GetCurrentProcess() ); @@ -117,9 +117,9 @@ public: BOOL ShowCallstack( bool verbose, HANDLE hThread = GetCurrentThread(), - const CONTEXT *context = NULL, - PReadProcessMemoryRoutine readMemoryFunction = NULL, - LPVOID pUserData = NULL // optional to identify some data in the 'readMemoryFunction'-callback + const CONTEXT *context = nullptr, + PReadProcessMemoryRoutine readMemoryFunction = nullptr, + LPVOID pUserData = nullptr // optional to identify some data in the 'readMemoryFunction'-callback ); #if _MSC_VER >= 1300 diff --git a/indra/llcommon/llalignedarray.h b/indra/llcommon/llalignedarray.h index b4559197f8009002a206f64d949e2b5f4ed85c73..e839baad18633e876f96f228a80e1da7dcd318f5 100644 --- a/indra/llcommon/llalignedarray.h +++ b/indra/llcommon/llalignedarray.h @@ -73,7 +73,7 @@ LLAlignedArray<T, alignment>::~LLAlignedArray() template <class T, U32 alignment> void LLAlignedArray<T, alignment>::push_back(const T& elem) { - T* old_buf = NULL; + T* old_buf = nullptr; if (mCapacity <= mElementCount) { mCapacity++; diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 94829d2c771a2a864e1cece7a87749fadae108ef..79cefcda8666fa5c1dafabd299b410d5bf8d8a6c 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -106,7 +106,7 @@ S32 LL_HEARTBEAT_SIGNAL = (SIGRTMAX >= 0) ? (SIGRTMAX-0) : SIGUSR2; #endif // LL_WINDOWS // the static application instance -LLApp* LLApp::sApplication = NULL; +LLApp* LLApp::sApplication = nullptr; // Allows the generation of core files for post mortem under gdb // and disables crashlogger @@ -118,20 +118,20 @@ BOOL LLApp::sLogInSignal = FALSE; // static LLApp::EAppStatus LLApp::sStatus = LLApp::APP_STATUS_STOPPED; // Keeps track of application status -LLAppErrorHandler LLApp::sErrorHandler = NULL; +LLAppErrorHandler LLApp::sErrorHandler = nullptr; BOOL LLApp::sErrorThreadRunning = FALSE; LLApp::LLApp() - : mThreadErrorp(NULL), - mExceptionHandler(NULL) + : mThreadErrorp(nullptr), + mExceptionHandler(nullptr) { commonCtor(); } LLApp::LLApp(LLErrorThread *error_thread) : mThreadErrorp(error_thread), - mExceptionHandler(NULL) + mExceptionHandler(nullptr) { commonCtor(); } @@ -179,10 +179,10 @@ LLApp::~LLApp() if (mThreadErrorp) { delete mThreadErrorp; - mThreadErrorp = NULL; + mThreadErrorp = nullptr; } - if(mExceptionHandler != 0) delete mExceptionHandler; + if(mExceptionHandler != nullptr) delete mExceptionHandler; SUBSYSTEM_CLEANUP(LLCommon); } @@ -518,7 +518,7 @@ void LLApp::setMiniDumpDir(const std::string &path) mDumpPath = path; } - if(mExceptionHandler == 0) return; + if(mExceptionHandler == nullptr) return; #ifdef LL_WINDOWS wchar_t buffer[MAX_MINDUMP_PATH_LENGTH]; mbstowcs(buffer, mDumpPath.c_str(), MAX_MINDUMP_PATH_LENGTH); @@ -540,7 +540,7 @@ void LLApp::setDebugFileNames(const std::string &path) void LLApp::writeMiniDump() { - if(mExceptionHandler == 0) return; + if(mExceptionHandler == nullptr) return; mExceptionHandler->WriteMinidump(); } @@ -599,10 +599,10 @@ bool LLApp::isExiting() void LLApp::disableCrashlogger() { // Disable Breakpad exception handler. - if (mExceptionHandler != 0) + if (mExceptionHandler != nullptr) { delete mExceptionHandler; - mExceptionHandler = 0; + mExceptionHandler = nullptr; } sDisableCrashlogger = TRUE; diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index 38bfdcd8adca7fab481a86322caf49e2aaff2a77..d008e94d672128318e44638f84017478255dda95 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -33,8 +33,8 @@ #include "llmutex.h" #include "llstl.h" -apr_pool_t *gAPRPoolp = NULL; // Global APR memory pool -LLVolatileAPRPool *LLAPRFile::sAPRFilePoolp = NULL ; //global volatile APR memory pool. +apr_pool_t *gAPRPoolp = nullptr; // Global APR memory pool +LLVolatileAPRPool *LLAPRFile::sAPRFilePoolp = nullptr ; //global volatile APR memory pool. const S32 FULL_VOLATILE_APR_POOL = 1024 ; //number of references to LLVolatileAPRPool @@ -73,12 +73,12 @@ void ll_cleanup_apr() if (gAPRPoolp) { apr_pool_destroy(gAPRPoolp); - gAPRPoolp = NULL; + gAPRPoolp = nullptr; } if (LLAPRFile::sAPRFilePoolp) { delete LLAPRFile::sAPRFilePoolp ; - LLAPRFile::sAPRFilePoolp = NULL ; + LLAPRFile::sAPRFilePoolp = nullptr ; } apr_terminate(); } @@ -88,7 +88,7 @@ void ll_cleanup_apr() //LLAPRPool // LLAPRPool::LLAPRPool(apr_pool_t *parent, apr_size_t size, BOOL releasePoolFlag) -: mPool(NULL) +: mPool(nullptr) , mParent(parent) , mMaxSize(size) , mReleasePoolFlag(releasePoolFlag) @@ -131,7 +131,7 @@ void LLAPRPool::releaseAPRPool() if(!mParent || mReleasePoolFlag) { apr_pool_destroy(mPool) ; - mPool = NULL ; + mPool = nullptr ; } } @@ -145,7 +145,7 @@ LLVolatileAPRPool::LLVolatileAPRPool(BOOL is_local, apr_pool_t *parent, apr_size : LLAPRPool(parent, size, releasePoolFlag), mNumActiveRef(0), mNumTotalRef(0), - mMutexp(NULL) + mMutexp(nullptr) { //create mutex if(!is_local) //not a local apr_pool, that is: shared by multiple threads. @@ -260,14 +260,14 @@ void ll_apr_assert_status(apr_status_t status, apr_dso_handle_t *handle) // LLAPRFile functions // LLAPRFile::LLAPRFile() - : mFile(NULL), - mCurrentFilePoolp(NULL) + : mFile(nullptr), + mCurrentFilePoolp(nullptr) { } LLAPRFile::LLAPRFile(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool) - : mFile(NULL), - mCurrentFilePoolp(NULL) + : mFile(nullptr), + mCurrentFilePoolp(nullptr) { open(filename, flags, pool); } @@ -283,13 +283,13 @@ apr_status_t LLAPRFile::close() if(mFile) { ret = apr_file_close(mFile); - mFile = NULL ; + mFile = nullptr ; } if(mCurrentFilePoolp) { mCurrentFilePoolp->clearVolatileAPRPool() ; - mCurrentFilePoolp = NULL ; + mCurrentFilePoolp = nullptr ; } return ret ; @@ -308,7 +308,7 @@ apr_status_t LLAPRFile::open(const std::string& filename, apr_int32_t flags, LLV if (s != APR_SUCCESS || !mFile) { - mFile = NULL ; + mFile = nullptr ; if (sizep) { @@ -355,7 +355,7 @@ apr_status_t LLAPRFile::open(const std::string& filename, apr_int32_t flags, BOO s = apr_file_open(&mFile, filename.c_str(), flags, APR_OS_DEFAULT, gAPRPoolp); if (s != APR_SUCCESS || !mFile) { - mFile = NULL ; + mFile = nullptr ; close() ; return s; } @@ -436,7 +436,7 @@ apr_status_t LLAPRFile::close(apr_file_t* file_handle, LLVolatileAPRPool* pool) if(file_handle) { ret = apr_file_close(file_handle); - file_handle = NULL ; + file_handle = nullptr ; } if(pool) @@ -460,9 +460,9 @@ apr_file_t* LLAPRFile::open(const std::string& filename, LLVolatileAPRPool* pool { ll_apr_warn_status(s); LL_WARNS("APR") << " Attempting to open filename: " << filename << LL_ENDL; - file_handle = NULL ; + file_handle = nullptr ; close(file_handle, pool) ; - return NULL; + return nullptr; } return file_handle ; diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 22ecc6677fb3b14544bbb2791506ca204d9c09da..977b08b90e58588cf70c4cdec9935c868f26585a 100644 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -85,7 +85,7 @@ bool LL_COMMON_API ll_apr_is_initialized(); class LL_COMMON_API LLAPRPool { public: - LLAPRPool(apr_pool_t *parent = NULL, apr_size_t size = 0, BOOL releasePoolFlag = TRUE) ; + LLAPRPool(apr_pool_t *parent = nullptr, apr_size_t size = 0, BOOL releasePoolFlag = TRUE) ; virtual ~LLAPRPool() ; virtual apr_pool_t* getAPRPool() ; @@ -111,10 +111,10 @@ protected: class LL_COMMON_API LLVolatileAPRPool : public LLAPRPool { public: - LLVolatileAPRPool(BOOL is_local = TRUE, apr_pool_t *parent = NULL, apr_size_t size = 0, BOOL releasePoolFlag = TRUE); + LLVolatileAPRPool(BOOL is_local = TRUE, apr_pool_t *parent = nullptr, apr_size_t size = 0, BOOL releasePoolFlag = TRUE); virtual ~LLVolatileAPRPool(); - /*virtual*/ apr_pool_t* getAPRPool() ; //define this virtual function to avoid any mistakenly calling LLAPRPool::getAPRPool(). + /*virtual*/ apr_pool_t* getAPRPool() override; //define this virtual function to avoid any mistakenly calling LLAPRPool::getAPRPool(). apr_pool_t* getVolatileAPRPool() ; void clearVolatileAPRPool() ; @@ -160,13 +160,13 @@ private: public: LLAPRFile() ; - LLAPRFile(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool = NULL); + LLAPRFile(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool = nullptr); ~LLAPRFile() ; LLAPRFile(const LLAPRFile&) = delete; LLAPRFile& operator=(const LLAPRFile&) = delete; - apr_status_t open(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool = NULL, S32* sizep = NULL); + apr_status_t open(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool = nullptr, S32* sizep = nullptr); apr_status_t open(const std::string& filename, apr_int32_t flags, BOOL use_global_pool); //use gAPRPoolp. apr_status_t close() ; @@ -196,16 +196,16 @@ private: static S32 seek(apr_file_t* file, apr_seek_where_t where, S32 offset); public: // returns false if failure: - static bool remove(const std::string& filename, LLVolatileAPRPool* pool = NULL); - static bool rename(const std::string& filename, const std::string& newname, LLVolatileAPRPool* pool = NULL); - static bool isExist(const std::string& filename, LLVolatileAPRPool* pool = NULL, apr_int32_t flags = APR_READ); - static S32 size(const std::string& filename, LLVolatileAPRPool* pool = NULL); - static bool makeDir(const std::string& dirname, LLVolatileAPRPool* pool = NULL); - static bool removeDir(const std::string& dirname, LLVolatileAPRPool* pool = NULL); + static bool remove(const std::string& filename, LLVolatileAPRPool* pool = nullptr); + static bool rename(const std::string& filename, const std::string& newname, LLVolatileAPRPool* pool = nullptr); + static bool isExist(const std::string& filename, LLVolatileAPRPool* pool = nullptr, apr_int32_t flags = APR_READ); + static S32 size(const std::string& filename, LLVolatileAPRPool* pool = nullptr); + static bool makeDir(const std::string& dirname, LLVolatileAPRPool* pool = nullptr); + static bool removeDir(const std::string& dirname, LLVolatileAPRPool* pool = nullptr); // Returns bytes read/written, 0 if read/write fails: - static S32 readEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool = NULL); - static S32 writeEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool = NULL); // offset<0 means append + static S32 readEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool = nullptr); + static S32 writeEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool = nullptr); // offset<0 means append //******************************************************************************************************************************* }; diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index f8e62e407a576d48a2360ca465d0137aad7c957d..3066ea1f1f69e06cd5670dd26de315a1d5c5362d 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -97,7 +97,7 @@ LLAssetDictionary::LLAssetDictionary() addEntry(LLAssetType::AT_MESH, new AssetEntry("MESH", "mesh", "mesh", false, false, false)); addEntry(LLAssetType::AT_WIDGET, new AssetEntry("WIDGET", "widget", "widget", false, false, false)); addEntry(LLAssetType::AT_PERSON, new AssetEntry("PERSON", "person", "person", false, false, false)); - addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", NULL, FALSE, FALSE, FALSE)); + addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", nullptr, FALSE, FALSE, FALSE)); }; diff --git a/indra/llcommon/llcallbacklist.cpp b/indra/llcommon/llcallbacklist.cpp index 1619a94e5d265f2ce51a2c7a5ec123f76264fe50..4515d4aa30a71a32511a0d77cb10a6d4a0649db0 100644 --- a/indra/llcommon/llcallbacklist.cpp +++ b/indra/llcommon/llcallbacklist.cpp @@ -192,7 +192,7 @@ public: } private: - BOOL tick() + BOOL tick() override { mCallable(); return TRUE; @@ -216,7 +216,7 @@ public: { } private: - BOOL tick() + BOOL tick() override { return mCallable(); } @@ -255,7 +255,7 @@ LLCallbackList::test() LL_INFOS() << "Testing LLCallbackList" << LL_ENDL; - if (!list->deleteFunction(NULL)) + if (!list->deleteFunction(nullptr)) { LL_INFOS() << "passed 1" << LL_ENDL; } diff --git a/indra/llcommon/llcallbacklist.h b/indra/llcommon/llcallbacklist.h index f9ce7fca8a1ab7dd434c1de54c75830750719d8e..cdebdee5276f831347b274e20c6d2ce1cef83c0c 100644 --- a/indra/llcommon/llcallbacklist.h +++ b/indra/llcommon/llcallbacklist.h @@ -43,9 +43,9 @@ public: LLCallbackList(); ~LLCallbackList(); - void addFunction( callback_t func, void *data = NULL ); // register a callback, which will be called as func(data) - bool containsFunction( callback_t func, void *data = NULL ); // true if list already contains the function/data pair - bool deleteFunction( callback_t func, void *data = NULL ); // removes the first instance of this function/data pair from the list, false if not found + void addFunction( callback_t func, void *data = nullptr ); // register a callback, which will be called as func(data) + bool containsFunction( callback_t func, void *data = nullptr ); // true if list already contains the function/data pair + bool deleteFunction( callback_t func, void *data = nullptr ); // removes the first instance of this function/data pair from the list, false if not found void callFunctions(); // calls all functions void deleteAllFunctions(); diff --git a/indra/llcommon/llcallstack.cpp b/indra/llcommon/llcallstack.cpp index 299f7c44b365b21415c40cb41dd26e65f108e9bd..5f09bf65ec6e6ecbfaeb235c67b122f6a669e036 100644 --- a/indra/llcommon/llcallstack.cpp +++ b/indra/llcommon/llcallstack.cpp @@ -58,7 +58,7 @@ public: } } protected: - virtual void OnOutput(LPCSTR szText) + void OnOutput(LPCSTR szText) override { m_stack.push_back(szText); } @@ -78,11 +78,11 @@ public: }; #endif -LLCallStackImpl *LLCallStack::s_impl = NULL; +LLCallStackImpl *LLCallStack::s_impl = nullptr; LLCallStack::LLCallStack(S32 skip_count, bool verbose): - m_skipCount(skip_count), - m_verbose(verbose) + m_verbose(verbose), + m_skipCount(skip_count) { if (!s_impl) { diff --git a/indra/llcommon/llcommon.cpp b/indra/llcommon/llcommon.cpp index ae0353edc382e2219f9eed3e093ec29625bd2311..4dfa44c029977f105aabebe197207d020dc4f36f 100644 --- a/indra/llcommon/llcommon.cpp +++ b/indra/llcommon/llcommon.cpp @@ -39,7 +39,7 @@ //static BOOL LLCommon::sAprInitialized = FALSE; -static LLTrace::ThreadRecorder* sMasterThreadRecorder = NULL; +static LLTrace::ThreadRecorder* sMasterThreadRecorder = nullptr; //static void LLCommon::initClass() @@ -63,8 +63,8 @@ void LLCommon::initClass() void LLCommon::cleanupClass() { delete sMasterThreadRecorder; - sMasterThreadRecorder = NULL; - LLTrace::set_master_thread_recorder(NULL); + sMasterThreadRecorder = nullptr; + LLTrace::set_master_thread_recorder(nullptr); LLThreadSafeRefCount::cleanupThreadSafeRefCount(); SUBSYSTEM_CLEANUP(LLTimer); if (sAprInitialized) diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 23b6cce6be1cb3fe4980aeccfe60754d198c38e9..31d0e85de7f321fb22d807b0e731bc8878cbcb99 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -86,7 +86,7 @@ LLCoros::Current::Current() // CoroData's constructor in fact initializes its mCoro with a // coroutine with that stack size, no one ever actually enters it by // calling mCoro(). - sCurrent.reset(new CoroData(0, // no prev + sCurrent.reset(new CoroData(nullptr, // no prev "", // not a named coroutine no_op, // no-op callable 1024)); // stacksize moot @@ -327,7 +327,7 @@ LLCoros::CoroData::CoroData(CoroData* prev, const std::string& name, mCoro(boost::bind(toplevel, _1, this, callable), stacksize), // don't consume events unless specifically directed mConsuming(false), - mSelf(0) + mSelf(nullptr) { } diff --git a/indra/llcommon/lldate.h b/indra/llcommon/lldate.h index d9f74287a7e04a2e6d09889a6a3a5ace93c877a8..400f15675233561b5b3c7f91a0191ae7c0e894cf 100644 --- a/indra/llcommon/lldate.h +++ b/indra/llcommon/lldate.h @@ -79,7 +79,7 @@ public: std::string asString() const; std::string asRFC1123() const; void toStream(std::ostream&) const; - bool split(S32 *year, S32 *month = NULL, S32 *day = NULL, S32 *hour = NULL, S32 *min = NULL, S32 *sec = NULL) const; + bool split(S32 *year, S32 *month = nullptr, S32 *day = nullptr, S32 *hour = nullptr, S32 *min = nullptr, S32 *sec = nullptr) const; std::string toHTTPDateString (const std::string& fmt) const; static std::string toHTTPDateString (tm * gmt, const std::string& fmt); /** diff --git a/indra/llcommon/lldependencies.h b/indra/llcommon/lldependencies.h index c4e440722495352e6a1d238074d0ab0a8680d653..30704225dd9de6ca2aa52d81c9f40bfb926269ed 100644 --- a/indra/llcommon/lldependencies.h +++ b/indra/llcommon/lldependencies.h @@ -433,7 +433,7 @@ public: { return &found->second.node; } - return NULL; + return nullptr; } /** @@ -601,7 +601,7 @@ public: using LLDependenciesBase::describe; // unhide virtual std::string describe(bool full=true) const; /// Override base-class describe() with actual implementation - virtual std::ostream& describe(std::ostream& out, bool full=true) const + std::ostream& describe(std::ostream& out, bool full=true) const override { typename DepNodeMap::const_iterator dmi(mNodes.begin()), dmend(mNodes.end()); if (dmi != dmend) diff --git a/indra/llcommon/lldepthstack.h b/indra/llcommon/lldepthstack.h index b65840d342cc7176a383f22aa421b7d2bf3f0fd7..0288c3716e19a6935742d159609a56510ac1457a 100644 --- a/indra/llcommon/lldepthstack.h +++ b/indra/llcommon/lldepthstack.h @@ -71,7 +71,7 @@ public: DATA_TYPE *pop() { - DATA_TYPE *tempp = NULL; + DATA_TYPE *tempp = nullptr; if (!mStack.empty()) { tempp = mStack.back(); diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index 144931bb7a20cd76619cb9e4673e5cf33aef2985..4d6df6cefc768c4fdf05a0ac8f9b628414229936 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -58,7 +58,7 @@ public: const Entry *lookup(Index index) const { const_iterator_t dictionary_iter = map_t::find(index); - if (dictionary_iter == map_t::end()) return NULL; + if (dictionary_iter == map_t::end()) return nullptr; return dictionary_iter->second; } const Index lookup(const std::string &name) const diff --git a/indra/llcommon/lldoubledispatch.h b/indra/llcommon/lldoubledispatch.h index 84a3e3613a917cb2a6539d3eb753fca80fe14906..d7fdf390080d7dee8aa4f149c09b6cd84de164a3 100644 --- a/indra/llcommon/lldoubledispatch.h +++ b/indra/llcommon/lldoubledispatch.h @@ -232,13 +232,13 @@ private: public: Entry(Functor func): mFunc(func) {} /// Is this entry appropriate for these arguments? - virtual bool matches(const ParamBaseType& param1, const ParamBaseType& param2) const + bool matches(const ParamBaseType& param1, const ParamBaseType& param2) const override { return (dynamic_cast<const Type1*>(¶m1) && dynamic_cast<const Type2*>(¶m2)); } /// invocation - virtual ReturnType operator()(ParamBaseType& param1, ParamBaseType& param2) const + ReturnType operator()(ParamBaseType& param1, ParamBaseType& param2) const override { // We perform the downcast so callable can accept leaf param // types, instead of accepting ParamBaseType and downcasting diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index d501f6937a511b5684a7c968294d26e930c4a9c3..512ec4449b69094b52ee78c9a16fea40c564bed1 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -130,9 +130,9 @@ namespace { } bool okay() { return mFile.good(); } - - virtual void recordMessage(LLError::ELevel level, - const std::string& message) + + void recordMessage(LLError::ELevel level, + const std::string& message) override { mFile << message << std::endl; } @@ -149,9 +149,9 @@ namespace { { mWantsTime = timestamp; } - - virtual void recordMessage(LLError::ELevel level, - const std::string& message) + + void recordMessage(LLError::ELevel level, + const std::string& message) override { if (ANSI_PROBE == mUseANSI) mUseANSI = (checkANSI() ? ANSI_YES : ANSI_NO); @@ -209,9 +209,9 @@ namespace { { public: RecordToFixedBuffer(LLLineBuffer* buffer) : mBuffer(buffer) { } - - virtual void recordMessage(LLError::ELevel level, - const std::string& message) + + void recordMessage(LLError::ELevel level, + const std::string& message) override { mBuffer->addLine(message); } @@ -227,8 +227,8 @@ namespace { RecordToWinDebug() {} - virtual void recordMessage(LLError::ELevel level, - const std::string& message) + void recordMessage(LLError::ELevel level, + const std::string& message) override { debugger_print(message); } @@ -315,8 +315,8 @@ namespace public: static LogControlFile& fromDirectory(const std::string& dir); - - virtual bool loadFile(); + + bool loadFile() override; private: LogControlFile(const std::string &filename) @@ -471,7 +471,7 @@ namespace LLError mFileLevelMap(), mTagLevelMap(), mUniqueLogMessages(), - mTimeFunction(NULL), + mTimeFunction(nullptr), mRecorders(), mFileRecorder(), mFixedBufferRecorder(), @@ -935,7 +935,7 @@ namespace std::ostringstream message_stream; - if (show_time && r->wantsTime() && s->mTimeFunction != NULL) + if (show_time && r->wantsTime() && s->mTimeFunction != nullptr) { message_stream << s->mTimeFunction() << " "; } @@ -1278,7 +1278,7 @@ namespace LLError void crashAndLoop(const std::string& message) { // Now, we go kaboom! - int* make_me_crash = NULL; + int* make_me_crash = nullptr; *make_me_crash = 0; @@ -1301,7 +1301,7 @@ namespace LLError std::string utcTime() { - time_t now = time(NULL); + time_t now = time(nullptr); const size_t BUF_SIZE = 64; char time_str[BUF_SIZE]; /* Flawfinder: ignore */ @@ -1315,7 +1315,7 @@ namespace LLError namespace LLError { - char** LLCallStacks::sBuffer = NULL ; + char** LLCallStacks::sBuffer = nullptr ; S32 LLCallStacks::sIndex = 0 ; #define SINGLE_THREADED 1 @@ -1377,7 +1377,7 @@ namespace LLError //static void LLCallStacks::allocateStackBuffer() { - if(sBuffer == NULL) + if(sBuffer == nullptr) { sBuffer = new char*[512] ; sBuffer[0] = new char[512 * 128] ; @@ -1391,11 +1391,11 @@ namespace LLError void LLCallStacks::freeStackBuffer() { - if(sBuffer != NULL) + if(sBuffer != nullptr) { delete [] sBuffer[0] ; delete [] sBuffer ; - sBuffer = NULL ; + sBuffer = nullptr ; } } @@ -1408,7 +1408,7 @@ namespace LLError return; } - if(sBuffer == NULL) + if(sBuffer == nullptr) { allocateStackBuffer(); } @@ -1443,7 +1443,7 @@ namespace LLError return; } - if(sBuffer == NULL) + if(sBuffer == nullptr) { allocateStackBuffer(); } @@ -1465,7 +1465,7 @@ namespace LLError return; } - if (sBuffer != NULL) + if (sBuffer != nullptr) { if (sIndex > 0) { diff --git a/indra/llcommon/llerrorthread.cpp b/indra/llcommon/llerrorthread.cpp index b0ee1af719a4a17ce00043f57b8e5fd639c4a891..7e5c4cbd0a6e152d82e6b0ffa6760f0d51f74d2d 100644 --- a/indra/llcommon/llerrorthread.cpp +++ b/indra/llcommon/llerrorthread.cpp @@ -33,7 +33,7 @@ LLErrorThread::LLErrorThread() : LLThread("Error"), - mUserDatap(NULL) + mUserDatap(nullptr) { } diff --git a/indra/llcommon/llerrorthread.h b/indra/llcommon/llerrorthread.h index 474cef3a5023b7b38a7eca30e4b1d8c37a2f21e9..31269a1406ef49cfa4c365f2f450e2dc30e3eabd 100644 --- a/indra/llcommon/llerrorthread.h +++ b/indra/llcommon/llerrorthread.h @@ -35,7 +35,7 @@ public: LLErrorThread(); ~LLErrorThread(); - /*virtual*/ void run(void); + /*virtual*/ void run(void) override; void setUserData(void *user_data); void *getUserData() const; diff --git a/indra/llcommon/llevent.cpp b/indra/llcommon/llevent.cpp index d157825e23ba21737b9320a161211854108a50d2..3aeef696c8a114f8d87b359f3b9aa538a5f2a4ef 100644 --- a/indra/llcommon/llevent.cpp +++ b/indra/llcommon/llevent.cpp @@ -68,7 +68,7 @@ LLObservable::~LLObservable() if (mDispatcher.notNull()) { mDispatcher->disengage(this); - mDispatcher = NULL; + mDispatcher = nullptr; } } @@ -78,7 +78,7 @@ bool LLObservable::setDispatcher(LLPointer<LLEventDispatcher> dispatcher) if (mDispatcher.notNull()) { mDispatcher->disengage(this); - mDispatcher = NULL; + mDispatcher = nullptr; } if (dispatcher.notNull() || dispatcher->engage(this)) { @@ -157,10 +157,10 @@ class LLSimpleDispatcher : public LLEventDispatcher::Impl public: LLSimpleDispatcher(LLEventDispatcher *parent) : mParent(parent) { } virtual ~LLSimpleDispatcher(); - virtual void addListener(LLEventListener* listener, LLSD filter, const LLSD& userdata); - virtual void removeListener(LLEventListener* listener); - virtual std::vector<LLListenerEntry> getListeners() const; - virtual bool fireEvent(LLPointer<LLEvent> event, LLSD filter); + void addListener(LLEventListener* listener, LLSD filter, const LLSD& userdata) override; + void removeListener(LLEventListener* listener) override; + std::vector<LLListenerEntry> getListeners() const override; + bool fireEvent(LLPointer<LLEvent> event, LLSD filter) override; protected: std::vector<LLListenerEntry> mListeners; @@ -177,7 +177,7 @@ LLSimpleDispatcher::~LLSimpleDispatcher() void LLSimpleDispatcher::addListener(LLEventListener* listener, LLSD filter, const LLSD& userdata) { - if (listener == NULL) return; + if (listener == nullptr) return; removeListener(listener); LLListenerEntry new_entry; new_entry.listener = listener; @@ -240,7 +240,7 @@ LLEventDispatcher::~LLEventDispatcher() if (impl) { delete impl; - impl = NULL; + impl = nullptr; } } diff --git a/indra/llcommon/llevent.h b/indra/llcommon/llevent.h index 28ce7de102e579d7af85e2da3acd90ac508cab9a..ea8b28f9b4bc9a19df87f734ffc5dc866e42757e 100644 --- a/indra/llcommon/llevent.h +++ b/indra/llcommon/llevent.h @@ -90,8 +90,8 @@ class LL_COMMON_API LLSimpleListener : public LLEventListener { public: void clearDispatchers(); - virtual bool handleAttach(LLEventDispatcher *dispatcher); - virtual bool handleDetach(LLEventDispatcher *dispatcher); + bool handleAttach(LLEventDispatcher *dispatcher) override; + bool handleDetach(LLEventDispatcher *dispatcher) override; protected: ~LLSimpleListener(); @@ -187,7 +187,7 @@ class LLValueChangedEvent : public LLEvent { public: LLValueChangedEvent(LLObservable* source, LLSD value) : LLEvent(source, "value_changed"), mValue(value) { } - LLSD getValue() { return mValue; } + LLSD getValue() override { return mValue; } LLSD mValue; }; diff --git a/indra/llcommon/lleventdispatcher.cpp b/indra/llcommon/lleventdispatcher.cpp index aed4070d532acda29045f76a46000335a8063309..49e0004ce32842ed5444596ce77e7414dbf55e6a 100644 --- a/indra/llcommon/lleventdispatcher.cpp +++ b/indra/llcommon/lleventdispatcher.cpp @@ -415,7 +415,7 @@ struct LLEventDispatcher::LLSDDispatchEntry: public LLEventDispatcher::DispatchE Callable mFunc; LLSD mRequired; - virtual void call(const std::string& desc, const LLSD& event) const + void call(const std::string& desc, const LLSD& event) const override { // Validate the syntax of the event itself. std::string mismatch(llsd_matches(mRequired, event)); @@ -427,7 +427,7 @@ struct LLEventDispatcher::LLSDDispatchEntry: public LLEventDispatcher::DispatchE mFunc(event); } - virtual LLSD addMetadata(LLSD meta) const + LLSD addMetadata(LLSD meta) const override { meta["required"] = mRequired; return meta; @@ -447,7 +447,7 @@ struct LLEventDispatcher::ParamsDispatchEntry: public LLEventDispatcher::Dispatc invoker_function mInvoker; - virtual void call(const std::string& desc, const LLSD& event) const + void call(const std::string& desc, const LLSD& event) const override { LLSDArgsSource src(desc, event); mInvoker(std::bind(&LLSDArgsSource::next, std::ref(src))); @@ -468,7 +468,7 @@ struct LLEventDispatcher::ArrayParamsDispatchEntry: public LLEventDispatcher::Pa LLSD::Integer mArity; - virtual LLSD addMetadata(LLSD meta) const + LLSD addMetadata(LLSD meta) const override { LLSD array(LLSD::emptyArray()); // Resize to number of arguments required @@ -533,14 +533,14 @@ struct LLEventDispatcher::MapParamsDispatchEntry: public LLEventDispatcher::Para LLSD mRequired; LLSD mOptional; - virtual void call(const std::string& desc, const LLSD& event) const + void call(const std::string& desc, const LLSD& event) const override { // Just convert from LLSD::Map to LLSD::Array using mMapper, then pass // to base-class call() method. ParamsDispatchEntry::call(desc, mMapper.map(event)); } - virtual LLSD addMetadata(LLSD meta) const + LLSD addMetadata(LLSD meta) const override { meta["required"] = mRequired; meta["optional"] = mOptional; @@ -554,8 +554,7 @@ void LLEventDispatcher::addArrayParamsDispatchEntry(const std::string& name, LLSD::Integer arity) { mDispatch.insert( - DispatchMap::value_type(name, DispatchMap::mapped_type( - new ArrayParamsDispatchEntry(desc, invoker, arity)))); + DispatchMap::value_type(name, std::static_pointer_cast<DispatchEntry>(std::make_shared<ArrayParamsDispatchEntry>(desc, invoker, arity)))); } void LLEventDispatcher::addMapParamsDispatchEntry(const std::string& name, @@ -565,8 +564,7 @@ void LLEventDispatcher::addMapParamsDispatchEntry(const std::string& name, const LLSD& defaults) { mDispatch.insert( - DispatchMap::value_type(name, DispatchMap::mapped_type( - new MapParamsDispatchEntry(name, desc, invoker, params, defaults)))); + DispatchMap::value_type(name, std::static_pointer_cast<DispatchEntry>(std::make_shared<MapParamsDispatchEntry>(name, desc, invoker, params, defaults)))); } /// Register a callable by name @@ -574,8 +572,7 @@ void LLEventDispatcher::add(const std::string& name, const std::string& desc, const Callable& callable, const LLSD& required) { mDispatch.insert( - DispatchMap::value_type(name, DispatchMap::mapped_type( - new LLSDDispatchEntry(desc, callable, required)))); + DispatchMap::value_type(name, std::static_pointer_cast<DispatchEntry>(std::make_shared<LLSDDispatchEntry>(desc, callable, required)))); } void LLEventDispatcher::addFail(const std::string& name, const std::string& classname) const diff --git a/indra/llcommon/lleventfilter.h b/indra/llcommon/lleventfilter.h index 0e96c9b998b5b72c768efd10fe7f7cb68308767b..fd7ff325bb847d7297cbf2da0283130a93bebc20 100644 --- a/indra/llcommon/lleventfilter.h +++ b/indra/llcommon/lleventfilter.h @@ -47,7 +47,7 @@ public: LLEventFilter(LLEventPump& source, const std::string& name="filter", bool tweak=true); /// Post an event to all listeners - virtual bool post(const LLSD& event) = 0; + bool post(const LLSD& event) override = 0; private: LLTempBoundListener mSource; @@ -65,7 +65,7 @@ public: LLEventMatching(LLEventPump& source, const LLSD& pattern); /// Only pass through events matching the pattern - virtual bool post(const LLSD& event); + bool post(const LLSD& event) override; private: LLSD mPattern; @@ -171,7 +171,7 @@ public: void eventAfter(F32 seconds, const LLSD& event); /// Pass event through, canceling the countdown timer - virtual bool post(const LLSD& event); + bool post(const LLSD& event) override; /// Cancel timer without event void cancel(); @@ -207,8 +207,8 @@ public: LLEventTimeout(LLEventPump& source); protected: - virtual void setCountdown(F32 seconds); - virtual bool countdownElapsed() const; + void setCountdown(F32 seconds) override; + bool countdownElapsed() const override; private: LLTimer mTimer; diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index ae7e5f488504e69517434af4eccc0c089a3b28bc..b0d16cd8b225cf41d196f2b67f8ccd9288a5cc36 100644 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -620,7 +620,7 @@ public: virtual ~LLEventStream() {} /// Post an event to all listeners - virtual bool post(const LLSD& event); + bool post(const LLSD& event) override; }; /***************************************************************************** @@ -646,12 +646,12 @@ public: virtual ~LLEventMailDrop() {} /// Post an event to all listeners - virtual bool post(const LLSD& event); + bool post(const LLSD& event) override; protected: - virtual LLBoundListener listen_impl(const std::string& name, const LLEventListener&, + LLBoundListener listen_impl(const std::string& name, const LLEventListener&, const NameList& after, - const NameList& before); + const NameList& before) override; private: typedef std::list<LLSD> EventList; @@ -672,11 +672,11 @@ public: virtual ~LLEventQueue() {} /// Post an event to all listeners - virtual bool post(const LLSD& event); + bool post(const LLSD& event) override; private: /// flush queued events - virtual void flush(); + void flush() override; private: typedef std::deque<LLSD> EventQueue; diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 296db7fd4ff4ce62addb043588ce903b455acdcb..13c93bc660e6ae30e18467444d1731a7b54cf2df 100644 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -71,7 +71,7 @@ U64 BlockTimer::sClockResolution = 1000000000; // Nanosecond resolution U64 BlockTimer::sClockResolution = 1000000; // Microsecond resolution #endif -static LLMutex* sLogLock = NULL; +static LLMutex* sLogLock = nullptr; static std::queue<LLSD> sLogQueue; block_timer_tree_df_iterator_t begin_block_timer_tree_df(BlockTimerStatHandle& id) @@ -132,7 +132,7 @@ struct SortTimerByName } }; -static BlockTimerStatHandle sRootTimer("root", NULL); +static BlockTimerStatHandle sRootTimer("root", nullptr); BlockTimerStatHandle& BlockTimer::getRootTimeBlock() { return sRootTimer; @@ -315,7 +315,7 @@ void BlockTimer::processTimes() BlockTimerStatHandle& timer = static_cast<BlockTimerStatHandle&>(*it); TimeBlockAccumulator& accumulator = timer.getCurrentAccumulator(); - accumulator.mLastCaller = NULL; + accumulator.mLastCaller = nullptr; accumulator.mMoveUpTree = false; } #endif @@ -441,11 +441,11 @@ void BlockTimer::writeLog(std::ostream& os) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// TimeBlockAccumulator::TimeBlockAccumulator() -: mTotalTimeCounter(0), - mSelfTimeCounter(0), +: mParent(nullptr), + mLastCaller(nullptr), + mTotalTimeCounter(0), + mSelfTimeCounter(0), mCalls(0), - mParent(NULL), - mLastCaller(NULL), mActiveCount(0), mMoveUpTree(false) {} diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp index 7d22802c4b747a89c442450b3171164d0fa039e6..af066df30b1c6f6539616613c6285bbd7c7c98a1 100644 --- a/indra/llcommon/llfile.cpp +++ b/indra/llcommon/llfile.cpp @@ -367,7 +367,7 @@ LLFILE * LLFile::_Fiopen(const std::string& filename, { // fopen mode strings corresponding to valid[i] "r", "w", "w", "a", "rb", "wb", "wb", "ab", "r+", "w+", "a+", "r+b", "w+b", "a+b", - 0}; + nullptr}; static const int valid[] = { // valid combinations of open flags std::ios_base::in, @@ -388,7 +388,7 @@ LLFILE * LLFile::_Fiopen(const std::string& filename, | std::ios_base::binary, 0}; - LLFILE *fp = 0; + LLFILE *fp = nullptr; int n; std::ios_base::openmode atendflag = mode & std::ios_base::ate; std::ios_base::openmode norepflag = mode & std::ios_base::_Noreplace; @@ -400,24 +400,24 @@ LLFILE * LLFile::_Fiopen(const std::string& filename, ; // look for a valid mode if (valid[n] == 0) - return (0); // no valid mode + return (nullptr); // no valid mode else if (norepflag && mode & (std::ios_base::out | std::ios_base::app) - && (fp = LLFile::fopen(filename, "r")) != 0) /* Flawfinder: ignore */ + && (fp = LLFile::fopen(filename, "r")) != nullptr) /* Flawfinder: ignore */ { // file must not exist, close and fail fclose(fp); - return (0); + return (nullptr); } - else if (fp != 0 && fclose(fp) != 0) - return (0); // can't close after test open + else if (fp != nullptr && fclose(fp) != 0) + return (nullptr); // can't close after test open // should open with protection here, if other than default - else if ((fp = LLFile::fopen(filename, mods[n])) == 0) /* Flawfinder: ignore */ - return (0); // open failed + else if ((fp = LLFile::fopen(filename, mods[n])) == nullptr) /* Flawfinder: ignore */ + return (nullptr); // open failed if (!atendflag || fseek(fp, 0, SEEK_END) == 0) return (fp); // no need to seek to end, or seek succeeded fclose(fp); // can't position at end - return (0); + return (nullptr); } #endif /* LL_WINDOWS */ diff --git a/indra/llcommon/llfindlocale.cpp b/indra/llcommon/llfindlocale.cpp index 5425f65c469804833209bd1d13ff04ce76d49de7..6aed1ee207bff00a49acea6ff368527902f99d37 100644 --- a/indra/llcommon/llfindlocale.cpp +++ b/indra/llcommon/llfindlocale.cpp @@ -72,7 +72,7 @@ lang_country_variant_from_envstring(const char *str, } *lang = s; } else { - *lang = NULL; + *lang = nullptr; } if (str[end] && str[end]!=':') { /* not at end of str */ @@ -97,7 +97,7 @@ lang_country_variant_from_envstring(const char *str, } *country = s; } else { - *country = NULL; + *country = nullptr; } if (str[end] && str[end]!=':') { /* not at end of str */ @@ -122,16 +122,16 @@ lang_country_variant_from_envstring(const char *str, } *variant = s; } else { - *variant = NULL; + *variant = nullptr; } } static int accumulate_locstring(const char *str, FL_Locale *l) { - char *lang = NULL; - char *country = NULL; - char *variant = NULL; + char *lang = nullptr; + char *country = nullptr; + char *variant = nullptr; if (str) { lang_country_variant_from_envstring(str, &lang, &country, &variant); if (lang) { @@ -460,9 +460,9 @@ FL_FindLocale(FL_Locale **locale, FL_Domain domain) { FL_Locale *rtn = (FL_Locale*)malloc(sizeof(FL_Locale)); if (!rtn) return success; - rtn->lang = NULL; - rtn->country = NULL; - rtn->variant = NULL; + rtn->lang = nullptr; + rtn->country = nullptr; + rtn->variant = nullptr; #ifdef WIN32 /* win32 >= mswindows95 */ @@ -528,7 +528,7 @@ FL_FreeLocale(FL_Locale **locale) { free((void*)l->variant); } free(l); - *locale = NULL; + *locale = nullptr; } } } diff --git a/indra/llcommon/llfixedbuffer.h b/indra/llcommon/llfixedbuffer.h index 35bd1f39e5872a1d02a6d17e22b1558241609435..e7627acd853146466e7331e9a4d639d3f7e3795c 100644 --- a/indra/llcommon/llfixedbuffer.h +++ b/indra/llcommon/llfixedbuffer.h @@ -46,9 +46,9 @@ public: std::deque<F32> mAddTimes; std::deque<S32> mLineLengths; - /*virtual*/ void clear(); // Clear the buffer, and reset it. + /*virtual*/ void clear() override; // Clear the buffer, and reset it. - /*virtual*/ void addLine(const std::string& utf8line); + /*virtual*/ void addLine(const std::string& utf8line) override; void setMaxLines(S32 max_lines); diff --git a/indra/llcommon/llhandle.h b/indra/llcommon/llhandle.h index 49ed92d6a791f22eaf036319aa04729e7d3f2857..55303ac20328ae9f2e468fe0f91d71f4f02cc95e 100644 --- a/indra/llcommon/llhandle.h +++ b/indra/llcommon/llhandle.h @@ -38,7 +38,7 @@ class LLTombStone : public LLRefCount { public: - LLTombStone(void* target = NULL) : mTarget(target) {} + LLTombStone(void* target = nullptr) : mTarget(target) {} void setTarget(void* target) { mTarget = target; } void* getTarget() const { return mTarget; } @@ -92,7 +92,7 @@ public: bool isDead() const { - return mTombStone->getTarget() == NULL; + return mTombStone->getTarget() == nullptr; } void markDead() diff --git a/indra/llcommon/llheteromap.cpp b/indra/llcommon/llheteromap.cpp index 2ec92628ad1ab0be3d6c319dc6754118c6a202bf..04024bc3824a06fdf58f4fe3c32afbd495175fec 100644 --- a/indra/llcommon/llheteromap.cpp +++ b/indra/llcommon/llheteromap.cpp @@ -29,6 +29,6 @@ LLHeteroMap::~LLHeteroMap() // mi->second is the std::pair; mi->second.first is the void*; // mi->second.second points to the deleter function (mi->second.second)(mi->second.first); - mi->second.first = NULL; + mi->second.first = nullptr; } } diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index e95a1628b4137ca8ebcafcb07078c44e824a0873..702d3876beaada52f903ab705b9a0da843f5f0f5 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -73,19 +73,19 @@ namespace LLInitParam mValidationFunc(validation_func), mMinCount(min_count), mMaxCount(max_count), - mUserData(NULL) + mUserData(nullptr) {} ParamDescriptor::ParamDescriptor() : mParamHandle(0), - mMergeFunc(NULL), - mDeserializeFunc(NULL), - mSerializeFunc(NULL), - mInspectFunc(NULL), - mValidationFunc(NULL), + mMergeFunc(nullptr), + mDeserializeFunc(nullptr), + mSerializeFunc(nullptr), + mInspectFunc(nullptr), + mValidationFunc(nullptr), mMinCount(0), mMaxCount(0), - mUserData(NULL) + mUserData(nullptr) {} ParamDescriptor::~ParamDescriptor() @@ -155,7 +155,7 @@ namespace LLInitParam BlockDescriptor::BlockDescriptor() : mMaxParamOffset(0), mInitializationState(UNINITIALIZED), - mCurrentBlockPtr(NULL) + mCurrentBlockPtr(nullptr) {} // called by each derived class in least to most derived order diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index db8b8488cc338fbb9d36cd1160066b5b295f62fc..220192ed5cc85c05d12711711207d28d6bea4404 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -271,7 +271,7 @@ namespace LLInitParam static std::vector<std::string>* getPossibleValues() { - return NULL; + return nullptr; } void assignNamedValue(const Inaccessable& name) @@ -287,7 +287,7 @@ namespace LLInitParam return param_value_t::getValue(); } - static value_name_map_t* getValueNames() {return NULL;} + static value_name_map_t* getValueNames() {return nullptr;} }; // helper class to implement name value lookups @@ -493,7 +493,7 @@ namespace LLInitParam virtual ~Parser(); - template <typename T> bool readValue(T& param, typename std::enable_if<!std::is_enum<T>::value>::type* dummy = 0) + template <typename T> bool readValue(T& param, typename std::enable_if<!std::is_enum<T>::value>::type* dummy = nullptr) { parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T)); if (found_it != mParserReadFuncs->end()) @@ -555,7 +555,7 @@ namespace LLInitParam protected: template <typename T> - void registerParserFuncs(parser_read_func_t read_func, parser_write_func_t write_func = NULL) + void registerParserFuncs(parser_read_func_t read_func, parser_write_func_t write_func = nullptr) { mParserReadFuncs->insert(std::make_pair(&typeid(T), read_func)); mParserWriteFuncs->insert(std::make_pair(&typeid(T), write_func)); @@ -665,7 +665,7 @@ namespace LLInitParam { public: LazyValue() - : mPtr(NULL) + : mPtr(nullptr) {} ~LazyValue() @@ -679,7 +679,7 @@ namespace LLInitParam } LazyValue(const LazyValue& other) - : mPtr(NULL) + : mPtr(nullptr) { *this = other; } @@ -713,7 +713,7 @@ namespace LLInitParam bool empty() const { - return mPtr == NULL; + return mPtr == nullptr; } void set(const T& other) @@ -747,7 +747,7 @@ namespace LLInitParam // lazily allocate an instance of T T* ensureInstance() const { - if (mPtr == NULL) + if (mPtr == nullptr) { mPtr = new T(); } @@ -863,7 +863,7 @@ namespace LLInitParam Param* getParamFromHandle(const param_handle_t param_handle) { - if (param_handle == 0) return NULL; + if (param_handle == 0) return nullptr; U8* baseblock_address = reinterpret_cast<U8*>(this); return reinterpret_cast<Param*>(baseblock_address + param_handle); @@ -890,7 +890,7 @@ namespace LLInitParam } bool deserializeBlock(Parser& p, Parser::name_stack_range_t& name_stack_range, bool new_name); - bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t rule, const BaseBlock* diff_block = NULL) const; + bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t rule, const BaseBlock* diff_block = nullptr) const; bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), S32 min_count = 0, S32 max_count = S32_MAX) const; virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return getBlockDescriptor(); } @@ -1109,7 +1109,7 @@ namespace LLInitParam static void inspectParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, S32 min_count, S32 max_count) { // tell parser about our actual type - parser.inspectValue<T>(name_stack, min_count, max_count, NULL); + parser.inspectValue<T>(name_stack, min_count, max_count, nullptr); // then tell it about string-based alternatives ("red", "blue", etc. for LLColor4) if (named_value_t::getPossibleValues()) { @@ -1155,14 +1155,14 @@ namespace LLInitParam private: void init( BlockDescriptor &block_descriptor, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count, const char* name ) { - ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor( + ParamDescriptorPtr param_descriptor = std::make_shared<ParamDescriptor>( block_descriptor.mCurrentBlockPtr->getHandleFromParam(this), &mergeWith, &deserializeParam, &serializeParam, validate_func, &inspectParam, - min_count, max_count)); + min_count, max_count); block_descriptor.addParam(param_descriptor, name); } }; @@ -1259,7 +1259,7 @@ namespace LLInitParam const self_t& typed_param = static_cast<const self_t&>(param); // tell parser about our actual type - parser.inspectValue<value_t>(name_stack, min_count, max_count, NULL); + parser.inspectValue<value_t>(name_stack, min_count, max_count, nullptr); // then tell it about string-based alternatives ("red", "blue", etc. for LLColor4) if (named_value_t::getPossibleValues()) { @@ -1340,14 +1340,14 @@ namespace LLInitParam private: void init( BlockDescriptor &block_descriptor, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count, const char* name ) { - ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor( + ParamDescriptorPtr param_descriptor = std::make_shared<ParamDescriptor>( block_descriptor.mCurrentBlockPtr->getHandleFromParam(this), &mergeWith, &deserializeParam, &serializeParam, - validate_func, + validate_func, &inspectParam, - min_count, max_count)); + min_count, max_count); block_descriptor.addParam(param_descriptor, name); } }; @@ -1480,7 +1480,7 @@ namespace LLInitParam static void inspectParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, S32 min_count, S32 max_count) { - parser.inspectValue<MULTI_VALUE_T>(name_stack, min_count, max_count, NULL); + parser.inspectValue<MULTI_VALUE_T>(name_stack, min_count, max_count, nullptr); if (named_value_t::getPossibleValues()) { parser.inspectValue<std::string>(name_stack, min_count, max_count, named_value_t::getPossibleValues()); @@ -1571,14 +1571,14 @@ namespace LLInitParam private: void init( BlockDescriptor &block_descriptor, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count, const char* name ) { - ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor( + ParamDescriptorPtr param_descriptor = std::make_shared<ParamDescriptor>( block_descriptor.mCurrentBlockPtr->getHandleFromParam(this), &mergeWith, &deserializeParam, &serializeParam, validate_func, &inspectParam, - min_count, max_count)); + min_count, max_count); block_descriptor.addParam(param_descriptor, name); } }; @@ -1727,7 +1727,7 @@ namespace LLInitParam const param_value_t& value_param = param_value_t(value_t()); // tell parser about our actual type - parser.inspectValue<value_t>(name_stack, min_count, max_count, NULL); + parser.inspectValue<value_t>(name_stack, min_count, max_count, nullptr); // then tell it about string-based alternatives ("red", "blue", etc. for LLColor4) if (named_value_t::getPossibleValues()) { @@ -1827,14 +1827,14 @@ namespace LLInitParam private: void init( BlockDescriptor &block_descriptor, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count, const char* name ) { - ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor( + ParamDescriptorPtr param_descriptor = std::make_shared<ParamDescriptor>( block_descriptor.mCurrentBlockPtr->getHandleFromParam(this), &mergeWith, &deserializeParam, &serializeParam, validate_func, &inspectParam, - min_count, max_count)); + min_count, max_count); block_descriptor.addParam(param_descriptor, name); } }; @@ -2145,14 +2145,14 @@ namespace LLInitParam BlockDescriptor& block_descriptor = DERIVED_BLOCK::getBlockDescriptor(); if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING)) { - ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor( - block_descriptor.mCurrentBlockPtr->getHandleFromParam(this), - NULL, - &deserializeParam, - NULL, - NULL, - NULL, - 0, S32_MAX)); + ParamDescriptorPtr param_descriptor = std::make_shared<ParamDescriptor>( + block_descriptor.mCurrentBlockPtr->getHandleFromParam(this), + nullptr, + &deserializeParam, + nullptr, + nullptr, + nullptr, + 0, S32_MAX); block_descriptor.addParam(param_descriptor, name); } } @@ -2303,7 +2303,7 @@ namespace LLInitParam return mValue.deserializeBlock(p, name_stack_range, new_name); } - bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const self_t* diff_block = NULL) const + bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const self_t* diff_block = nullptr) const { const BaseBlock* base_block = diff_block ? &(diff_block->mValue) @@ -2422,7 +2422,7 @@ namespace LLInitParam } } - bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const self_t* diff_block = NULL) const + bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const self_t* diff_block = nullptr) const { const BaseBlock* base_block = diff_block ? &(diff_block->mValue) @@ -2523,7 +2523,7 @@ namespace LLInitParam return mValue.get().deserializeBlock(p, name_stack_range, new_name); } - bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const self_t* diff_block = NULL) const + bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const self_t* diff_block = nullptr) const { if (mValue.empty()) return false; @@ -2629,7 +2629,7 @@ namespace LLInitParam // block param interface LL_COMMON_API bool deserializeBlock(Parser& p, Parser::name_stack_range_t& name_stack_range, bool new_name); - LL_COMMON_API bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const BaseBlock* diff_block = NULL) const; + LL_COMMON_API bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const BaseBlock* diff_block = nullptr) const; bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), S32 min_count = 0, S32 max_count = S32_MAX) const { //TODO: implement LLSD params as schema type Any @@ -2686,7 +2686,7 @@ namespace LLInitParam return typed_param.BaseBlock::deserializeBlock(parser, name_stack_range, new_name); } - bool serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const BaseBlock* diff_block = NULL) const + bool serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const BaseBlock* diff_block = nullptr) const { const derived_t& typed_param = static_cast<const derived_t&>(*this); const derived_t* diff_param = static_cast<const derived_t*>(diff_block); diff --git a/indra/llcommon/llkeythrottle.h b/indra/llcommon/llkeythrottle.h index 1f576cc19ee235f47d731230df22ac7c7858a18b..41eb0e666482a6e1609198ff4631634fbe8eebe2 100644 --- a/indra/llcommon/llkeythrottle.h +++ b/indra/llcommon/llkeythrottle.h @@ -69,8 +69,8 @@ protected: // prevMap covers the previous interval LLKeyThrottleImpl() : - prevMap(NULL), - currMap(NULL), + prevMap(nullptr), + currMap(nullptr), countLimit(0), intervalLength(1), startTime(0) diff --git a/indra/llcommon/llleap.cpp b/indra/llcommon/llleap.cpp index 81237870d7c992885aa8dda7e6fcbdd9c79ecc7b..873c80413f6482f09a5c23c836a84ad4b719f3ce 100644 --- a/indra/llcommon/llleap.cpp +++ b/indra/llcommon/llleap.cpp @@ -444,7 +444,7 @@ LLLeap* LLLeap::create(const std::string& desc, const std::vector<std::string>& } catch (const LLLeap::Error&) { - return NULL; + return nullptr; } } diff --git a/indra/llcommon/llleaplistener.cpp b/indra/llcommon/llleaplistener.cpp index 57e0ca34980b625d1f3d6f6b108eebf1245bab2e..5cc20b40756ce4aa8ae31ab04be650d922357782 100644 --- a/indra/llcommon/llleaplistener.cpp +++ b/indra/llcommon/llleaplistener.cpp @@ -124,7 +124,7 @@ void LLLeapListener::newpump(const LLSD& request) std::string name = request["name"]; LLSD const & type = request["type"]; - LLEventPump * new_pump = NULL; + LLEventPump * new_pump = nullptr; if (type.asString() == "LLEventQueue") { new_pump = new LLEventQueue(name, true); // tweak name for uniqueness diff --git a/indra/llcommon/lllistenerwrapper.h b/indra/llcommon/lllistenerwrapper.h index 09d074abca07b2bd150e1667189a3f20d5a5bdd2..002d2cd6ae41142faf427503ee042a158f48ce0f 100644 --- a/indra/llcommon/lllistenerwrapper.h +++ b/indra/llcommon/lllistenerwrapper.h @@ -137,7 +137,7 @@ public: {} /// call - virtual bool operator()(const LLSD& event) + bool operator()(const LLSD& event) override { std::cout << "Entering listener " << *super::mName << " with " << event << std::endl; bool handled = super::operator()(event); @@ -179,7 +179,7 @@ public: {} /// call - virtual bool operator()(const LLSD& event) + bool operator()(const LLSD& event) override { LL_DEBUGS("LLLogListener") << "Entering listener " << *super::mName << " with " << event << LL_ENDL; bool handled = super::operator()(event); diff --git a/indra/llcommon/llliveappconfig.h b/indra/llcommon/llliveappconfig.h index 4fd7c26a07e0f0c432044813a244cdbffbabacf0..135f0391a07cf95fae6ee13277bf40882aeeea2d 100644 --- a/indra/llcommon/llliveappconfig.h +++ b/indra/llcommon/llliveappconfig.h @@ -60,7 +60,7 @@ public: ~LLLiveAppConfig(); ///< Destructor protected: - /*virtual*/ bool loadFile(); + /*virtual*/ bool loadFile() override; private: LLApp::OptionPriority mPriority; diff --git a/indra/llcommon/lllivefile.cpp b/indra/llcommon/lllivefile.cpp index 49d3331354879e50bf149e89d1d1f4fdf279ccc2..082cea76bb562d3324484607f16cf435e6dd3240 100644 --- a/indra/llcommon/lllivefile.cpp +++ b/indra/llcommon/lllivefile.cpp @@ -65,7 +65,7 @@ LLLiveFile::Impl::Impl(const std::string& filename, const F32 refresh_period) mLastModTime(0), mLastStatTime(0), mLastExists(false), - mEventTimer(NULL) + mEventTimer(nullptr) { } @@ -172,7 +172,7 @@ namespace : LLEventTimer(refresh), mLiveFile(f) { } - BOOL tick() + BOOL tick() override { mLiveFile.checkAndReload(); return FALSE; diff --git a/indra/llcommon/llmd5.cpp b/indra/llcommon/llmd5.cpp index 39f63fa4dcd361d0aae30d20714f20858504b2f1..b37fe798a72a6a14b2e04676a64250fdc9fecbad 100644 --- a/indra/llcommon/llmd5.cpp +++ b/indra/llcommon/llmd5.cpp @@ -121,7 +121,7 @@ void LLMD5::update (const uint1 *input, const uint4 input_length) { buffer_space = 64 - buffer_index; // how much space is left in buffer // now, transform each 64-byte piece of the input, bypassing the buffer - if (input == NULL || input_length == 0){ + if (input == nullptr || input_length == 0){ std::cerr << "LLMD5::update: Invalid input!" << std::endl; return; } diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index ed7e0697a00f786e7fa8895b0ec3c66d9ae9e6ed..97b7d7942312f3404969aa5207f62cae6528dff2 100644 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -170,7 +170,7 @@ bool LLMemory::isMemoryPoolLow() { static const U32Megabytes LOW_MEMORY_POOL_THRESHOLD(64); const static U32Megabytes MAX_SIZE_CHECKED_MEMORY_BLOCK(64); - static void* last_reserved_address = NULL ; + static void* last_reserved_address = nullptr ; if(!sEnableMemoryFailurePrevention) { diff --git a/indra/llcommon/llmemorystream.h b/indra/llcommon/llmemorystream.h index e28f012192c309469dbf0913b1adcfd0dbdfca7c..55a58b6e7867069e7c99632624a708570fe2bed5 100644 --- a/indra/llcommon/llmemorystream.h +++ b/indra/llcommon/llmemorystream.h @@ -55,7 +55,7 @@ public: void reset(const U8* start, S32 length); protected: - int underflow(); + int underflow() override; //std::streamsize xsgetn(char* dest, std::streamsize n); }; diff --git a/indra/llcommon/llmetricperformancetester.cpp b/indra/llcommon/llmetricperformancetester.cpp index 2f794e2ff83ac5b4274335e3a44f64d103688f2b..c9037ff4d9e5bfcff37fececef49bfd2d8889d57 100644 --- a/indra/llcommon/llmetricperformancetester.cpp +++ b/indra/llcommon/llmetricperformancetester.cpp @@ -86,7 +86,7 @@ LLMetricPerformanceTesterBasic* LLMetricPerformanceTesterBasic::getTester(std::s { return found_it->second ; } - return NULL ; + return nullptr ; } /*static*/ @@ -275,8 +275,8 @@ void LLMetricPerformanceTesterBasic::compareTestResults(llofstream* os, std::str LLMetricPerformanceTesterWithSession::LLMetricPerformanceTesterWithSession(std::string name) : LLMetricPerformanceTesterBasic(name), - mBaseSessionp(NULL), - mCurrentSessionp(NULL) + mBaseSessionp(nullptr), + mCurrentSessionp(nullptr) { } @@ -285,12 +285,12 @@ LLMetricPerformanceTesterWithSession::~LLMetricPerformanceTesterWithSession() if (mBaseSessionp) { delete mBaseSessionp ; - mBaseSessionp = NULL ; + mBaseSessionp = nullptr ; } if (mCurrentSessionp) { delete mCurrentSessionp ; - mCurrentSessionp = NULL ; + mCurrentSessionp = nullptr ; } } @@ -317,12 +317,12 @@ void LLMetricPerformanceTesterWithSession::analyzePerformance(llofstream* os, LL if (mBaseSessionp) { delete mBaseSessionp ; - mBaseSessionp = NULL ; + mBaseSessionp = nullptr ; } if (mCurrentSessionp) { delete mCurrentSessionp ; - mCurrentSessionp = NULL ; + mCurrentSessionp = nullptr ; } } diff --git a/indra/llcommon/llmetricperformancetester.h b/indra/llcommon/llmetricperformancetester.h index 889555b29c5253285a6a424220c1553967df0b73..86c3fd526bbaf28a08cc4ad9e223e72e8c940bda 100644 --- a/indra/llcommon/llmetricperformancetester.h +++ b/indra/llcommon/llmetricperformancetester.h @@ -181,7 +181,7 @@ public: * This will be loading the base and current sessions and compare them using the virtual * abstract methods loadTestSession() and compareTestSessions() */ - virtual void analyzePerformance(llofstream* os, LLSD* base, LLSD* current) ; + void analyzePerformance(llofstream* os, LLSD* base, LLSD* current) override; protected: /** diff --git a/indra/llcommon/llmetrics.cpp b/indra/llcommon/llmetrics.cpp index b8cd5f8f9822edf2e82967176ef7557b044c0345..359743b368d1a896e8b783782d5f4dfe67a757c4 100644 --- a/indra/llcommon/llmetrics.cpp +++ b/indra/llcommon/llmetrics.cpp @@ -141,7 +141,7 @@ LLMetrics::LLMetrics() LLMetrics::~LLMetrics() { delete mImpl; - mImpl = NULL; + mImpl = nullptr; } void LLMetrics::recordEvent(const std::string& location, const std::string& mesg, bool success) diff --git a/indra/llcommon/llnametable.h b/indra/llcommon/llnametable.h index d3283543f3921f2d00e23ee5e1c06a6b3c2dbb64..6e6aba410921ddb6890385b181f710ad1e596a61 100644 --- a/indra/llcommon/llnametable.h +++ b/indra/llcommon/llnametable.h @@ -93,7 +93,7 @@ public: if (iter->second == data) return iter->first; } - return NULL; + return nullptr; } typedef std::map<const char *, DATA> name_map_t; diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h index 9a6453ea482e9ecc97fd8fa027551e65b4be1443..b14765aa771688ecffc4a62db58b282e48574940 100644 --- a/indra/llcommon/llpointer.h +++ b/indra/llcommon/llpointer.h @@ -48,7 +48,7 @@ template <class Type> class LLPointer public: LLPointer() : - mPointer(NULL) + mPointer(nullptr) { } @@ -83,11 +83,11 @@ public: const Type& operator*() const { return *mPointer; } Type& operator*() { return *mPointer; } - operator BOOL() const { return (mPointer != NULL); } - operator bool() const { return (mPointer != NULL); } - bool operator!() const { return (mPointer == NULL); } - bool isNull() const { return (mPointer == NULL); } - bool notNull() const { return (mPointer != NULL); } + operator BOOL() const { return (mPointer != nullptr); } + operator bool() const { return (mPointer != nullptr); } + bool operator!() const { return (mPointer == nullptr); } + bool isNull() const { return (mPointer == nullptr); } + bool notNull() const { return (mPointer != nullptr); } operator Type*() const { return mPointer; } bool operator !=(Type* ptr) const { return (mPointer != ptr); } @@ -154,7 +154,7 @@ protected: Type *temp = mPointer; mPointer = NULL; temp->unref(); - if (mPointer != NULL) + if (mPointer != nullptr) { LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL; unref(); @@ -170,7 +170,7 @@ template <class Type> class LLConstPointer { public: LLConstPointer() : - mPointer(NULL) + mPointer(nullptr) { } @@ -203,11 +203,11 @@ public: const Type* operator->() const { return mPointer; } const Type& operator*() const { return *mPointer; } - operator BOOL() const { return (mPointer != NULL); } - operator bool() const { return (mPointer != NULL); } - bool operator!() const { return (mPointer == NULL); } - bool isNull() const { return (mPointer == NULL); } - bool notNull() const { return (mPointer != NULL); } + operator BOOL() const { return (mPointer != nullptr); } + operator bool() const { return (mPointer != nullptr); } + bool operator!() const { return (mPointer == nullptr); } + bool isNull() const { return (mPointer == nullptr); } + bool notNull() const { return (mPointer != nullptr); } operator const Type*() const { return mPointer; } bool operator !=(const Type* ptr) const { return (mPointer != ptr); } @@ -280,7 +280,7 @@ protected: const Type *tempp = mPointer; mPointer = NULL; tempp->unref(); - if (mPointer != NULL) + if (mPointer != nullptr) { LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL; unref(); diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index a23ff09d13c91cf3f472c1d8577e358bb4380dec..0e8693466ae3146f971a767c55fe6fc087ab31e7 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -162,8 +162,8 @@ public: #endif } - virtual std::ostream& get_ostream() { return mStream; } - virtual size_type size() const { return mStreambuf.size(); } + std::ostream& get_ostream() override { return mStream; } + size_type size() const override { return mStreambuf.size(); } bool tick(const LLSD&) { @@ -273,14 +273,14 @@ public: // Much of the implementation is simply connecting the abstract virtual // methods with implementation data concealed from the base class. - virtual std::istream& get_istream() { return mStream; } - virtual std::string getline() { return LLProcess::getline(mStream); } - virtual LLEventPump& getPump() { return mPump; } - virtual void setLimit(size_type limit) { mLimit = limit; } - virtual size_type getLimit() const { return mLimit; } - virtual size_type size() const { return mStreambuf.size(); } - - virtual std::string read(size_type len) + std::istream& get_istream() override { return mStream; } + std::string getline() override { return LLProcess::getline(mStream); } + LLEventPump& getPump() override { return mPump; } + void setLimit(size_type limit) override { mLimit = limit; } + size_type getLimit() const override { return mLimit; } + size_type size() const override { return mStreambuf.size(); } + + std::string read(size_type len) override { // Read specified number of bytes into a buffer. size_type readlen((std::min)(size(), len)); @@ -297,7 +297,7 @@ public: return std::string(&buffer[0], mStream.gcount()); } - virtual std::string peek(size_type offset=0, size_type len=npos) const + std::string peek(size_type offset=0, size_type len=npos) const override { // Constrain caller's offset and len to overlap actual buffer content. std::size_t real_offset = (std::min)(mStreambuf.size(), std::size_t(offset)); @@ -308,7 +308,7 @@ public: boost::asio::buffers_begin(cbufs) + real_end); } - virtual size_type find(const std::string& seek, size_type offset=0) const + size_type find(const std::string& seek, size_type offset=0) const override { // If we're passing a string of length 1, use find(char), which can // use an O(n) std::find() rather than the O(n^2) std::search(). @@ -332,7 +332,7 @@ public: return (found == end)? npos : (found - begin); } - virtual size_type find(char seek, size_type offset=0) const + size_type find(char seek, size_type offset=0) const override { // If offset is beyond the whole buffer, can't even construct a valid // iterator range; can't possibly find the char we seek. @@ -526,7 +526,7 @@ LLProcess::LLProcess(const LLSDOrParams& params): // constructor call, these push_back() calls should require no new // allocation. for (size_t i = 0; i < mPipes.capacity(); ++i) - mPipes.push_back(0); + mPipes.push_back(nullptr); if (! params.validateBlock(true)) { @@ -536,7 +536,7 @@ LLProcess::LLProcess(const LLSDOrParams& params): mPostend = params.postend; - apr_procattr_t *procattr = NULL; + apr_procattr_t *procattr = nullptr; chkapr(apr_procattr_create(&procattr, gAPRPoolp)); // IQA-490, CHOP-900: On Windows, ask APR to jump through hoops to @@ -670,12 +670,12 @@ LLProcess::LLProcess(const LLSDOrParams& params): } // terminate with a null pointer - argv.push_back(NULL); + argv.push_back(nullptr); // Launch! The NULL would be the environment block, if we were passing // one. Hand-expand chkapr() macro so we can fill in the actual command // string instead of the variable names. - if (ll_apr_warn_status(apr_proc_create(&mProcess, argv[0], &argv[0], NULL, procattr, + if (ll_apr_warn_status(apr_proc_create(&mProcess, argv[0], &argv[0], nullptr, procattr, gAPRPoolp))) { LLTHROW(LLProcessError(STRINGIZE(params << " failed"))); @@ -1036,12 +1036,12 @@ PIPETYPE* LLProcess::getPipePtr(std::string& error, FILESLOT slot) if (slot >= NSLOTS) { error = STRINGIZE(mDesc << " has no slot " << slot); - return NULL; + return nullptr; } if (mPipes.is_null(slot)) { error = STRINGIZE(mDesc << ' ' << whichfile(slot) << " not a monitored pipe"); - return NULL; + return nullptr; } // Make sure we dynamic_cast in pointer domain so we can test, rather than // accepting runtime's exception. @@ -1049,7 +1049,7 @@ PIPETYPE* LLProcess::getPipePtr(std::string& error, FILESLOT slot) if (! ppipe) { error = STRINGIZE(mDesc << ' ' << whichfile(slot) << " not a " << typeid(PIPETYPE).name()); - return NULL; + return nullptr; } error.clear(); @@ -1149,7 +1149,7 @@ LLProcess::handle LLProcess::isRunning(handle h, const std::string& desc) // This direct Windows implementation is because we have no access to the // apr_proc_t struct: we expect it's been destroyed. if (! h) - return 0; + return nullptr; DWORD waitresult = WaitForSingleObject(h, 0); if(waitresult == WAIT_OBJECT_0) @@ -1169,7 +1169,7 @@ LLProcess::handle LLProcess::isRunning(handle h, const std::string& desc) } } CloseHandle(h); - return 0; + return nullptr; } return h; @@ -1202,14 +1202,14 @@ static std::string WindowsErrorString(const std::string& operation) { int result = GetLastError(); - LPTSTR error_str = 0; + LPTSTR error_str = nullptr; if (FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, + nullptr, result, 0, (LPTSTR)&error_str, 0, - NULL) + nullptr) != 0) { // convert from wide-char string to multi-byte string diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index 70d0326fbe6562bfc9b38f2f8609c7735aa37da8..12df6f5ee55e259762af3ca270de8ec971dfac80 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -832,7 +832,7 @@ private: ////////////////////////////////////////////////////// // Interface definition -LLProcessorInfo::LLProcessorInfo() : mImpl(NULL) +LLProcessorInfo::LLProcessorInfo() : mImpl(nullptr) { // *NOTE:Mani - not thread safe. if(!mImpl) diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 683f3bfa7035f6e372df9d03ce4a08a6908f3315..d20f4c24278baed7e320085d5265733d396ce1f7 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -291,7 +291,7 @@ LLQueuedThread::QueuedRequest* LLQueuedThread::getRequest(handle_t handle) { if (handle == nullHandle()) { - return 0; + return nullptr; } lockData(); QueuedRequest* res = (QueuedRequest*)mRequestHash.find(handle); @@ -409,7 +409,7 @@ S32 LLQueuedThread::processNextRequest() while(1) { - req = NULL; + req = nullptr; if (mRequestQueue.empty()) { break; diff --git a/indra/llcommon/llqueuedthread.h b/indra/llcommon/llqueuedthread.h index 120c13694372aa9621f07af9c9990db4a2234bf9..42c9d33e89f9e24d5df8a8df85371491f4778449 100644 --- a/indra/llcommon/llqueuedthread.h +++ b/indra/llcommon/llqueuedthread.h @@ -150,16 +150,16 @@ public: public: LLQueuedThread(const std::string& name, bool threaded = true, bool should_pause = false); - virtual ~LLQueuedThread(); - virtual void shutdown(); + virtual ~LLQueuedThread(); + void shutdown() override; private: // No copy constructor or copy assignment LLQueuedThread(const LLQueuedThread&); LLQueuedThread& operator=(const LLQueuedThread&); - virtual bool runCondition(void); - virtual void run(void); + bool runCondition(void) override; + void run(void) override; virtual void startThread(void); virtual void endThread(void); virtual void threadedUpdate(void); diff --git a/indra/llcommon/llregistry.h b/indra/llcommon/llregistry.h index 2ab49e2e0d35de750098c292a503d478a4b947aa..c3a4c4592adbd093fbf4ce94a70d14256514723d 100644 --- a/indra/llcommon/llregistry.h +++ b/indra/llcommon/llregistry.h @@ -95,7 +95,7 @@ public: { return &(found_it->second); } - return NULL; + return nullptr; } ptr_const_value_t getValue(ref_const_key_t key) const @@ -105,7 +105,7 @@ public: { return &(found_it->second); } - return NULL; + return nullptr; } // if the registry is used to store pointers, and null values are valid entries @@ -145,7 +145,7 @@ public: ++it) { ptr_value_t valuep = (*it)->getValue(key); - if (valuep != NULL) return valuep; + if (valuep != nullptr) return valuep; } return mDefaultRegistrar.getValue(key); } @@ -157,7 +157,7 @@ public: ++it) { ptr_value_t valuep = (*it)->getValue(key); - if (valuep != NULL) return valuep; + if (valuep != nullptr) return valuep; } return mDefaultRegistrar.getValue(key); } @@ -335,10 +335,10 @@ public: protected: // DERIVED_TYPE needs to derive from LLRegistrySingleton LLRegistrySingleton() - : mStaticScope(NULL) + : mStaticScope(nullptr) {} - virtual void initSingleton() + void initSingleton() override { mStaticScope = new ScopedRegistrar(); } diff --git a/indra/llcommon/llsafehandle.h b/indra/llcommon/llsafehandle.h index 9550e6253e8ff8f133bad890111a41c1cc0a899d..04d4a04652c08f4126512d262be67480ff4b0c40 100644 --- a/indra/llcommon/llsafehandle.h +++ b/indra/llcommon/llsafehandle.h @@ -62,18 +62,18 @@ class LLSafeHandle { public: LLSafeHandle() : - mPointer(NULL) + mPointer(nullptr) { } LLSafeHandle(Type* ptr) : - mPointer(NULL) + mPointer(nullptr) { assign(ptr); } LLSafeHandle(const LLSafeHandle<Type>& ptr) : - mPointer(NULL) + mPointer(nullptr) { assign(ptr.mPointer); } @@ -81,7 +81,7 @@ public: // support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. template<typename Subclass> LLSafeHandle(const LLSafeHandle<Subclass>& ptr) : - mPointer(NULL) + mPointer(nullptr) { assign(ptr.get()); } @@ -95,17 +95,17 @@ public: Type* operator->() { return nonNull(mPointer); } Type* get() const { return mPointer; } - void clear() { assign(NULL); } + void clear() { assign(nullptr); } // we disallow these operations as they expose our null objects to direct manipulation // and bypass the reference counting semantics //const Type& operator*() const { return *nonNull(mPointer); } //Type& operator*() { return *nonNull(mPointer); } - operator BOOL() const { return mPointer != NULL; } - operator bool() const { return mPointer != NULL; } - bool operator!() const { return mPointer == NULL; } - bool isNull() const { return mPointer == NULL; } - bool notNull() const { return mPointer != NULL; } + operator BOOL() const { return mPointer != nullptr; } + operator bool() const { return mPointer != nullptr; } + bool operator!() const { return mPointer == nullptr; } + bool isNull() const { return mPointer == nullptr; } + bool notNull() const { return mPointer != nullptr; } operator Type*() const { return mPointer; } @@ -152,7 +152,7 @@ protected: Type *tempp = mPointer; mPointer = NULL; tempp->unref(); - if (mPointer != NULL) + if (mPointer != nullptr) { LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL; unref(); diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index 54baa18f1bc4075476e21129ab82c8e6869052b2..03cc8651d0c8dbdab321bb41aacad4f620725b33 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -184,11 +184,12 @@ namespace public: ImplBase(DataRef value) : mValue(value) { } - - virtual LLSD::Type type() const { return T; } + + LLSD::Type type() const override { return T; } using LLSD::Impl::assign; // Unhiding base class virtuals... - virtual void assign(LLSD::Impl*& var, DataRef value) { + void assign(LLSD::Impl*& var, DataRef value) override + { if (shared()) { Impl::assign(var, value); @@ -206,11 +207,11 @@ namespace { public: ImplBoolean(LLSD::Boolean v) : Base(v) { } - - virtual LLSD::Boolean asBoolean() const { return mValue; } - virtual LLSD::Integer asInteger() const { return mValue ? 1 : 0; } - virtual LLSD::Real asReal() const { return mValue ? 1 : 0; } - virtual LLSD::String asString() const; + + LLSD::Boolean asBoolean() const override { return mValue; } + LLSD::Integer asInteger() const override { return mValue ? 1 : 0; } + LLSD::Real asReal() const override { return mValue ? 1 : 0; } + LLSD::String asString() const override; }; LLSD::String ImplBoolean::asString() const @@ -227,11 +228,11 @@ namespace { public: ImplInteger(LLSD::Integer v) : Base(v) { } - - virtual LLSD::Boolean asBoolean() const { return mValue != 0; } - virtual LLSD::Integer asInteger() const { return mValue; } - virtual LLSD::Real asReal() const { return mValue; } - virtual LLSD::String asString() const; + + LLSD::Boolean asBoolean() const override { return mValue != 0; } + LLSD::Integer asInteger() const override { return mValue; } + LLSD::Real asReal() const override { return mValue; } + LLSD::String asString() const override; }; LLSD::String ImplInteger::asString() const @@ -243,11 +244,11 @@ namespace { public: ImplReal(LLSD::Real v) : Base(v) { } - - virtual LLSD::Boolean asBoolean() const; - virtual LLSD::Integer asInteger() const; - virtual LLSD::Real asReal() const { return mValue; } - virtual LLSD::String asString() const; + + LLSD::Boolean asBoolean() const override; + LLSD::Integer asInteger() const override; + LLSD::Real asReal() const override { return mValue; } + LLSD::String asString() const override; }; LLSD::Boolean ImplReal::asBoolean() const @@ -265,16 +266,16 @@ namespace { public: ImplString(const LLSD::String& v) : Base(v) { } - - virtual LLSD::Boolean asBoolean() const { return !mValue.empty(); } - virtual LLSD::Integer asInteger() const; - virtual LLSD::Real asReal() const; - virtual LLSD::String asString() const { return mValue; } - virtual LLSD::UUID asUUID() const { return LLUUID(mValue); } - virtual LLSD::Date asDate() const { return LLDate(mValue); } - virtual LLSD::URI asURI() const { return LLURI(mValue); } - virtual int size() const { return mValue.size(); } - virtual const LLSD::String& asStringRef() const { return mValue; } + + LLSD::Boolean asBoolean() const override { return !mValue.empty(); } + LLSD::Integer asInteger() const override; + LLSD::Real asReal() const override; + LLSD::String asString() const override { return mValue; } + LLSD::UUID asUUID() const override { return LLUUID(mValue); } + LLSD::Date asDate() const override { return LLDate(mValue); } + LLSD::URI asURI() const override { return LLURI(mValue); } + int size() const override { return mValue.size(); } + const LLSD::String& asStringRef() const override { return mValue; } }; LLSD::Integer ImplString::asInteger() const @@ -309,9 +310,9 @@ namespace { public: ImplUUID(const LLSD::UUID& v) : Base(v) { } - - virtual LLSD::String asString() const{ return mValue.asString(); } - virtual LLSD::UUID asUUID() const { return mValue; } + + LLSD::String asString() const override { return mValue.asString(); } + LLSD::UUID asUUID() const override { return mValue; } }; @@ -322,17 +323,19 @@ namespace ImplDate(const LLSD::Date& v) : ImplBase<LLSD::TypeDate, LLSD::Date, const LLSD::Date&>(v) { } - - virtual LLSD::Integer asInteger() const + + LLSD::Integer asInteger() const override { return (LLSD::Integer)(mValue.secondsSinceEpoch()); } - virtual LLSD::Real asReal() const + + LLSD::Real asReal() const override { return mValue.secondsSinceEpoch(); } - virtual LLSD::String asString() const{ return mValue.asString(); } - virtual LLSD::Date asDate() const { return mValue; } + + LLSD::String asString() const override { return mValue.asString(); } + LLSD::Date asDate() const override { return mValue; } }; @@ -341,9 +344,9 @@ namespace { public: ImplURI(const LLSD::URI& v) : Base(v) { } - - virtual LLSD::String asString() const{ return mValue.asString(); } - virtual LLSD::URI asURI() const { return mValue; } + + LLSD::String asString() const override { return mValue.asString(); } + LLSD::URI asURI() const override { return mValue; } }; @@ -352,8 +355,8 @@ namespace { public: ImplBinary(const LLSD::Binary& v) : Base(v) { } - - virtual const LLSD::Binary& asBinary() const{ return mValue; } + + const LLSD::Binary& asBinary() const override { return mValue; } }; @@ -369,33 +372,33 @@ namespace public: ImplMap() { } - - virtual ImplMap& makeMap(LLSD::Impl*&); - virtual LLSD::Type type() const { return LLSD::TypeMap; } + ImplMap& makeMap(LLSD::Impl*&) override; + + LLSD::Type type() const override { return LLSD::TypeMap; } - virtual LLSD::Boolean asBoolean() const { return !mData.empty(); } + LLSD::Boolean asBoolean() const override { return !mData.empty(); } - virtual bool has(const LLSD::String&) const; + bool has(const LLSD::String&) const override; using LLSD::Impl::get; // Unhiding get(LLSD::Integer) using LLSD::Impl::erase; // Unhiding erase(LLSD::Integer) using LLSD::Impl::ref; // Unhiding ref(LLSD::Integer) - virtual LLSD get(const LLSD::String&) const; + LLSD get(const LLSD::String&) const override; void insert(const LLSD::String& k, const LLSD& v); - virtual void erase(const LLSD::String&); + void erase(const LLSD::String&) override; LLSD& ref(const LLSD::String&); - virtual const LLSD& ref(const LLSD::String&) const; + const LLSD& ref(const LLSD::String&) const override; - virtual int size() const { return mData.size(); } + int size() const override { return mData.size(); } LLSD::map_iterator beginMap() { return mData.begin(); } LLSD::map_iterator endMap() { return mData.end(); } - virtual LLSD::map_const_iterator beginMap() const { return mData.begin(); } - virtual LLSD::map_const_iterator endMap() const { return mData.end(); } + LLSD::map_const_iterator beginMap() const override { return mData.begin(); } + LLSD::map_const_iterator endMap() const override { return mData.end(); } - virtual void dumpStats() const; - virtual void calcStats(S32 type_counts[], S32 share_counts[]) const; + void dumpStats() const override; + void calcStats(S32 type_counts[], S32 share_counts[]) const override; }; ImplMap& ImplMap::makeMap(LLSD::Impl*& var) @@ -490,33 +493,33 @@ namespace public: ImplArray() { } - - virtual ImplArray& makeArray(Impl*&); - virtual LLSD::Type type() const { return LLSD::TypeArray; } + ImplArray& makeArray(Impl*&) override; + + LLSD::Type type() const override { return LLSD::TypeArray; } - virtual LLSD::Boolean asBoolean() const { return !mData.empty(); } + LLSD::Boolean asBoolean() const override { return !mData.empty(); } using LLSD::Impl::get; // Unhiding get(LLSD::String) using LLSD::Impl::erase; // Unhiding erase(LLSD::String) using LLSD::Impl::ref; // Unhiding ref(LLSD::String) - virtual int size() const; - virtual LLSD get(LLSD::Integer) const; + int size() const override; + LLSD get(LLSD::Integer) const override; void set(LLSD::Integer, const LLSD&); void insert(LLSD::Integer, const LLSD&); void append(const LLSD&); - virtual void erase(LLSD::Integer); + void erase(LLSD::Integer) override; LLSD& ref(LLSD::Integer); - virtual const LLSD& ref(LLSD::Integer) const; + const LLSD& ref(LLSD::Integer) const override; LLSD::array_iterator beginArray() { return mData.begin(); } LLSD::array_iterator endArray() { return mData.end(); } LLSD::reverse_array_iterator rbeginArray() { return mData.rbegin(); } LLSD::reverse_array_iterator rendArray() { return mData.rend(); } - virtual LLSD::array_const_iterator beginArray() const { return mData.begin(); } - virtual LLSD::array_const_iterator endArray() const { return mData.end(); } + LLSD::array_const_iterator beginArray() const override { return mData.begin(); } + LLSD::array_const_iterator endArray() const override { return mData.end(); } - virtual void calcStats(S32 type_counts[], S32 share_counts[]) const; + void calcStats(S32 type_counts[], S32 share_counts[]) const override; }; ImplArray& ImplArray::makeArray(Impl*& var) @@ -691,7 +694,7 @@ void LLSD::Impl::assign(Impl*& var, const Impl* other) void LLSD::Impl::assignUndefined(Impl*& var) { - reset(var, 0); + reset(var, nullptr); } void LLSD::Impl::assign(Impl*& var, LLSD::Boolean v) @@ -798,10 +801,10 @@ namespace } -LLSD::LLSD() : impl(0) { ALLOC_LLSD_OBJECT; } -LLSD::~LLSD() { FREE_LLSD_OBJECT; Impl::reset(impl, 0); } +LLSD::LLSD() : impl(nullptr) { ALLOC_LLSD_OBJECT; } +LLSD::~LLSD() { FREE_LLSD_OBJECT; Impl::reset(impl, nullptr); } -LLSD::LLSD(const LLSD& other) : impl(0) { ALLOC_LLSD_OBJECT; assign(other); } +LLSD::LLSD(const LLSD& other) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(other); } void LLSD::assign(const LLSD& other) { Impl::assign(impl, other.impl); } @@ -810,17 +813,17 @@ void LLSD::clear() { Impl::assignUndefined(impl); } LLSD::Type LLSD::type() const { return safe(impl).type(); } // Scalar Constructors -LLSD::LLSD(Boolean v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } -LLSD::LLSD(Integer v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } -LLSD::LLSD(Real v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } -LLSD::LLSD(const UUID& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } -LLSD::LLSD(const String& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } -LLSD::LLSD(const Date& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } -LLSD::LLSD(const URI& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } -LLSD::LLSD(const Binary& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(Boolean v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(Integer v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(Real v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(const UUID& v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(const String& v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(const Date& v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(const URI& v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(const Binary& v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); } // Convenience Constructors -LLSD::LLSD(F32 v) : impl(0) { ALLOC_LLSD_OBJECT; assign((Real)v); } +LLSD::LLSD(F32 v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign((Real)v); } // Scalar Assignment void LLSD::assign(Boolean v) { safe(impl).assign(impl, v); } @@ -845,7 +848,7 @@ const LLSD::Binary& LLSD::asBinary() const { return safe(impl).asBinary(); } const LLSD::String& LLSD::asStringRef() const { return safe(impl).asStringRef(); } // const char * helpers -LLSD::LLSD(const char* v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } +LLSD::LLSD(const char* v) : impl(nullptr) { ALLOC_LLSD_OBJECT; assign(v); } void LLSD::assign(const char* v) { if(v) assign(std::string(v)); @@ -911,7 +914,7 @@ static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat) // sStorage will point to the result of the last call. This will actually // be one leak, but since this is used only when running under the // debugger, it should not be an issue. - static char *sStorage = NULL; + static char *sStorage = nullptr; delete[] sStorage; std::string out_string; { diff --git a/indra/llcommon/llsdparam.cpp b/indra/llcommon/llsdparam.cpp index 6ddeaa7948bda9f08d3dd83f05528fc9987d78f8..12c9343c31bafde3d13e0e1362bc87946d0c0318 100644 --- a/indra/llcommon/llsdparam.cpp +++ b/indra/llcommon/llsdparam.cpp @@ -45,7 +45,7 @@ LLTrace::BlockTimerStatHandle FTM_SD_PARAM_ADAPTOR("LLSD to LLInitParam conversi // LLParamSDParser::LLParamSDParser() : Parser(sReadFuncs, sWriteFuncs, sInspectFuncs), - mCurReadSD(NULL), mWriteRootSD(NULL) + mCurReadSD(nullptr), mWriteRootSD(nullptr) { if (sReadFuncs.empty()) { @@ -95,7 +95,7 @@ void LLParamSDParser::submit(LLInitParam::BaseBlock& block, const LLSD& sd, LLIn void LLParamSDParser::readSD(const LLSD& sd, LLInitParam::BaseBlock& block, bool silent) { - mCurReadSD = NULL; + mCurReadSD = nullptr; mNameStack.clear(); setParseSilently(silent); diff --git a/indra/llcommon/llsdparam.h b/indra/llcommon/llsdparam.h index 87a4d902472c816f0a354f6d0671b5fb1fdb18d9..c6dca68fec6f22d9cd3fd2ee9169a0729c38ed71 100644 --- a/indra/llcommon/llsdparam.h +++ b/indra/llcommon/llsdparam.h @@ -54,7 +54,7 @@ public: void writeSD(LLSD& sd, const BLOCK& block, const LLInitParam::predicate_rule_t rules = LLInitParam::default_parse_rules(), - const LLInitParam::BaseBlock* diff_block = NULL) + const LLInitParam::BaseBlock* diff_block = nullptr) { if (!diff_block && !rules.isAmbivalent(LLInitParam::HAS_DEFAULT_VALUE)) @@ -64,8 +64,8 @@ public: writeSDImpl(sd, block, rules, diff_block); } - /*virtual*/ std::string getCurrentElementName(); - /*virtual*/ std::string getCurrentFileName(){ return LLStringUtil::null; } + /*virtual*/ std::string getCurrentElementName() override; + /*virtual*/ std::string getCurrentFileName() override { return LLStringUtil::null; } private: void writeSDImpl(LLSD& sd, diff --git a/indra/llcommon/llsdserialize.h b/indra/llcommon/llsdserialize.h index 23a0c8cfb1e332ea0346517c1cec74d2e33514b9..b70aecd6e12e903ab8ab0835d266eec6c6c33d0b 100644 --- a/indra/llcommon/llsdserialize.h +++ b/indra/llcommon/llsdserialize.h @@ -244,7 +244,7 @@ protected: * @return Returns the number of LLSD objects parsed into * data. Returns PARSE_FAILURE (-1) on parse failure. */ - virtual S32 doParse(std::istream& istr, LLSD& data) const; + S32 doParse(std::istream& istr, LLSD& data) const override; private: /** @@ -317,12 +317,12 @@ protected: * @return Returns the number of LLSD objects parsed into * data. Returns PARSE_FAILURE (-1) on parse failure. */ - virtual S32 doParse(std::istream& istr, LLSD& data) const; + S32 doParse(std::istream& istr, LLSD& data) const override; /** * @brief Virtual default function for resetting the parser */ - virtual void doReset(); + void doReset() override; private: class Impl; @@ -365,7 +365,7 @@ protected: * @return Returns the number of LLSD objects parsed into * data. Returns -1 on parse failure. */ - virtual S32 doParse(std::istream& istr, LLSD& data) const; + S32 doParse(std::istream& istr, LLSD& data) const override; private: /** @@ -507,7 +507,7 @@ public: * @param ostr The destination stream for the data. * @return Returns The number of LLSD objects fomatted out */ - virtual S32 format(const LLSD& data, std::ostream& ostr, U32 options = LLSDFormatter::OPTIONS_NONE) const; + S32 format(const LLSD& data, std::ostream& ostr, U32 options = LLSDFormatter::OPTIONS_NONE) const override; protected: @@ -555,7 +555,7 @@ public: * @param ostr The destination stream for the data. * @return Returns The number of LLSD objects fomatted out */ - virtual S32 format(const LLSD& data, std::ostream& ostr, U32 options = LLSDFormatter::OPTIONS_NONE) const; + S32 format(const LLSD& data, std::ostream& ostr, U32 options = LLSDFormatter::OPTIONS_NONE) const override; protected: @@ -615,7 +615,7 @@ public: * @param ostr The destination stream for the data. * @return Returns The number of LLSD objects fomatted out */ - virtual S32 format(const LLSD& data, std::ostream& ostr, U32 options = LLSDFormatter::OPTIONS_NONE) const; + S32 format(const LLSD& data, std::ostream& ostr, U32 options = LLSDFormatter::OPTIONS_NONE) const override; protected: /** diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp index 3550b19e71773c5f7682be1246ef10135ec9ec4f..09d57ad4c394aa490593f8fb7823dd84a86446d4 100644 --- a/indra/llcommon/llsdserialize_xml.cpp +++ b/indra/llcommon/llsdserialize_xml.cpp @@ -312,7 +312,7 @@ private: LLSDXMLParser::Impl::Impl(bool emit_errors) : mEmitErrors(emit_errors) { - mParser = XML_ParserCreate(NULL); + mParser = XML_ParserCreate(nullptr); reset(); } @@ -355,7 +355,7 @@ S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data) XML_Status status; static const int BUFFER_SIZE = 1024; - void* buffer = NULL; + void* buffer = nullptr; int count = 0; while (input.good() && !input.eof()) { @@ -521,7 +521,7 @@ void LLSDXMLParser::Impl::startSkipping() const XML_Char* LLSDXMLParser::Impl::findAttribute(const XML_Char* name, const XML_Char** pairs) { - while (NULL != pairs && NULL != *pairs) + while (nullptr != pairs && nullptr != *pairs) { if(0 == strcmp(name, *pairs)) { @@ -529,12 +529,12 @@ LLSDXMLParser::Impl::findAttribute(const XML_Char* name, const XML_Char** pairs) } pairs += 2; } - return NULL; + return nullptr; } void LLSDXMLParser::Impl::parsePart(const char* buf, int len) { - if ( buf != NULL + if ( buf != nullptr && len > 0 ) { XML_Status status = XML_Parse(mParser, buf, len, false); diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index 735dcc1aa33ac3f90728b1a763eabbd759031f3d..7712441f1c3e887a5d40dea30526704e15e38bdc 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -177,7 +177,7 @@ char* ll_pretty_print_sd_ptr(const LLSD* sd) { return ll_pretty_print_sd(*sd); } - return NULL; + return nullptr; } char* ll_pretty_print_sd(const LLSD& sd) diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h index 99cb79aa54c553733964832adaf450e5e8cf6bfe..bf85e00be5e3be2d161f48baffa235448288d55e 100644 --- a/indra/llcommon/llsdutil.h +++ b/indra/llcommon/llsdutil.h @@ -362,7 +362,7 @@ public: // isUndefined() seems like the best way. If you want to pass an // empty string, you can still pass LLSD(""). Without this special // case, though, no LLSD value could pass NULL. - return NULL; + return nullptr; } return _value.c_str(); } diff --git a/indra/llcommon/llsimplehash.h b/indra/llcommon/llsimplehash.h index 727b4568d85eb185d1be5e92300e3f6d2345fe2a..d80489eb3672171f22182090d64870b22e4dcb76 100644 --- a/indra/llcommon/llsimplehash.h +++ b/indra/llcommon/llsimplehash.h @@ -37,7 +37,7 @@ protected: public: LLSimpleHashEntry(HASH_KEY_TYPE key) : mHashKey(key), - mNextEntry(0) + mNextEntry(nullptr) { } virtual ~LLSimpleHashEntry() @@ -101,7 +101,7 @@ public: bool erase(HASH_KEY_TYPE key) { int index = getIndex(key); - LLSimpleHashEntry<HASH_KEY_TYPE>* prev = 0; + LLSimpleHashEntry<HASH_KEY_TYPE>* prev = nullptr; LLSimpleHashEntry<HASH_KEY_TYPE>* res = mEntryTable[index]; while(res && (res->getHashKey() != key)) { @@ -139,7 +139,7 @@ public: return entry; } } - return 0; + return nullptr; } // debugging LLSimpleHashEntry<HASH_KEY_TYPE>* get_element_at_index(S32 index) const diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp index 5f3a8e33498ad60f68659920a420469ec42ef43b..ccd66829a67631bfda0d2472f029b7f36f94ac25 100644 --- a/indra/llcommon/llsingleton.cpp +++ b/indra/llcommon/llsingleton.cpp @@ -282,7 +282,7 @@ LLSingletonBase::vec_t LLSingletonBase::dep_sort() // associated value type in our SingletonDeps, hence the 0. We don't // record the LLSingletons it must follow; rather, we record the ones // it must precede. Copy its mDepends to a KeyList to express that. - sdeps.add(sp, 0, + sdeps.add(sp, nullptr, SingletonDeps::KeyList(), SingletonDeps::KeyList(sp->mDepends.begin(), sp->mDepends.end())); } diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index 859e271e26c661a88a726456bcaf128d61f83672..b07a67afe3dbab09bf916f877283006686bd429c 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -199,7 +199,7 @@ struct LLSingleton_manage_master<LLSingletonBase::MasterList> template <typename DERIVED_TYPE> LLSingletonBase::LLSingletonBase(tag<DERIVED_TYPE>): mCleaned(false), - mDeleteSingleton(NULL) + mDeleteSingleton(nullptr) { // Make this the currently-initializing LLSingleton. LLSingleton_manage_master<DERIVED_TYPE>().push_initializing(this); @@ -377,13 +377,13 @@ public: // should never be uninitialized at this point logerrs("Uninitialized singleton ", demangle(typeid(DERIVED_TYPE).name()).c_str()); - return NULL; + return nullptr; case CONSTRUCTING: logerrs("Tried to access singleton ", demangle(typeid(DERIVED_TYPE).name()).c_str(), " from singleton constructor!"); - return NULL; + return nullptr; case INITIALIZING: // go ahead and flag ourselves as initialized so we can be diff --git a/indra/llcommon/llstacktrace.cpp b/indra/llcommon/llstacktrace.cpp index b0f510f77c25ec2aa4c8592b59437ebd93281ed9..cb698b738cde5b6a8d91e98619c01dd6a2d1ed52 100644 --- a/indra/llcommon/llstacktrace.cpp +++ b/indra/llcommon/llstacktrace.cpp @@ -63,7 +63,7 @@ bool ll_get_stack_trace(std::vector<std::string>& lines) // load the symbols if they're not loaded if(!symbolsLoaded && firstCall) { - symbolsLoaded = SymInitialize(hProc, NULL, true); + symbolsLoaded = SymInitialize(hProc, nullptr, true); firstCall = false; } @@ -71,11 +71,11 @@ bool ll_get_stack_trace(std::vector<std::string>& lines) if(symbolsLoaded) { // create the frames to hold the addresses - void* frames[MAX_STACK_DEPTH] = {0}; + void* frames[MAX_STACK_DEPTH] = {nullptr}; S32 depth = 0; // get the addresses - depth = RtlCaptureStackBackTrace_fn(FRAME_SKIP, MAX_STACK_DEPTH, frames, NULL); + depth = RtlCaptureStackBackTrace_fn(FRAME_SKIP, MAX_STACK_DEPTH, frames, nullptr); IMAGEHLP_LINE64 line; memset(&line, 0, sizeof(IMAGEHLP_LINE64)); @@ -96,7 +96,7 @@ bool ll_get_stack_trace(std::vector<std::string>& lines) BOOL ret; DWORD64 addr = (DWORD64)frames[i]; - ret = SymGetSymFromAddr64(hProc, addr, 0, pSym); + ret = SymGetSymFromAddr64(hProc, addr, nullptr, pSym); if(ret) { stack_line << pSym->Name << " "; @@ -135,18 +135,18 @@ void ll_get_stack_trace_internal(std::vector<std::string>& lines) const S32 STRING_NAME_LENGTH = 256; HANDLE process = GetCurrentProcess(); - SymInitialize( process, NULL, TRUE ); + SymInitialize( process, nullptr, TRUE ); void *stack[MAX_STACK_DEPTH]; - unsigned short frames = RtlCaptureStackBackTrace_fn( 0, MAX_STACK_DEPTH, stack, NULL ); + unsigned short frames = RtlCaptureStackBackTrace_fn( 0, MAX_STACK_DEPTH, stack, nullptr ); SYMBOL_INFO *symbol = (SYMBOL_INFO*)calloc(sizeof(SYMBOL_INFO) + STRING_NAME_LENGTH * sizeof(char), 1); symbol->MaxNameLen = STRING_NAME_LENGTH-1; symbol->SizeOfStruct = sizeof(SYMBOL_INFO); for(unsigned int i = 0; i < frames; i++) { - SymFromAddr(process, (DWORD64)(stack[i]), 0, symbol); + SymFromAddr(process, (DWORD64)(stack[i]), nullptr, symbol); lines.push_back(symbol->Name); } diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index c0d7385e683da0dca0c3084cbeeb63ae26fdcfcc..a942bb96f31d14660b4592d4c974f1dde1e7ab1a 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -667,10 +667,10 @@ std::string ll_convert_wide_to_string(const wchar_t* in, unsigned int code_page) 0, in, len_in, - NULL, + nullptr, 0, - 0, - 0); + nullptr, + nullptr); // We will need two more bytes for the double NULL ending // created in WideCharToMultiByte(). char* pout = new char [len_out + 2]; @@ -684,8 +684,8 @@ std::string ll_convert_wide_to_string(const wchar_t* in, unsigned int code_page) len_in, pout, len_out, - 0, - 0); + nullptr, + nullptr); out.assign(pout); delete[] pout; } @@ -758,7 +758,7 @@ void LLStringOps::setupDatetimeInfo (bool daylight) time_t nowT, localT, gmtT; struct tm * tmpT; - nowT = time (NULL); + nowT = time (nullptr); tmpT = gmtime (&nowT); gmtT = mktime (tmpT); diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 1293b7f3dea1940301febd9e7fb53a78ecda4ffd..dd16af309079f4f719951292ffc18234798961f2 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -545,7 +545,7 @@ LL_COMMON_API S32 utf16str_wstring_length(const llutf16string &utf16str, S32 len LL_COMMON_API S32 wstring_utf16_length(const LLWString & wstr, S32 woffset, S32 wlen); // Length in wstring (i.e., llwchar count) of a part of a wstring specified by utf16 length (i.e., utf16 units.) -LL_COMMON_API S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, S32 woffset, S32 utf16_length, BOOL *unaligned = NULL); +LL_COMMON_API S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, S32 woffset, S32 utf16_length, BOOL *unaligned = nullptr); /** * @brief Properly truncate a utf8 string to a maximum byte count. @@ -818,8 +818,9 @@ public: } /// This implementation uses the answer cached by setiter(). - virtual bool escaped() const { return mIsEsc; } - virtual T next() + bool escaped() const override { return mIsEsc; } + + T next() override { // If we're looking at the escape character of an escape sequence, // skip that character. This is the one time we can modify 'mIter' @@ -835,21 +836,21 @@ public: return result; } - virtual bool is(T ch) const + bool is(T ch) const override { // Like base-class is(), except that an escaped character matches // nothing. return (! done()) && (! mIsEsc) && *mIter == ch; } - virtual bool oneof(const string_type& delims) const + bool oneof(const string_type& delims) const override { // Like base-class oneof(), except that an escaped character matches // nothing. return (! done()) && (! mIsEsc) && LLStringUtilBase<T>::contains(delims, *mIter); } - virtual bool collect_until(string_type& into, const_iterator from, T delim) + bool collect_until(string_type& into, const_iterator from, T delim) override { // Deal with escapes in the characters we collect; that is, an escaped // character must become just that character without the preceding diff --git a/indra/llcommon/llstringtable.cpp b/indra/llcommon/llstringtable.cpp index aa5ce5cc8bb4c9e1a9ed8633f043e9f1be281b99..71d40bead093c21d0523eca153b28e3fe3ef07ea 100644 --- a/indra/llcommon/llstringtable.cpp +++ b/indra/llcommon/llstringtable.cpp @@ -35,7 +35,7 @@ LLStringTable gStringTable(32768); LLStringTableEntry::LLStringTableEntry(const char *str) -: mString(NULL), mCount(1) +: mString(nullptr), mCount(1) { // Copy string U32 length = (U32)strlen(str) + 1; /*Flawfinder: ignore*/ @@ -77,7 +77,7 @@ LLStringTable::LLStringTable(int tablesize) // Clear strings for (i = 0; i < mMaxEntries; i++) { - mStringList[i] = NULL; + mStringList[i] = nullptr; } #endif } @@ -98,7 +98,7 @@ LLStringTable::~LLStringTable() delete mStringList[i]; } delete [] mStringList; - mStringList = NULL; + mStringList = nullptr; } #else // Need to clean up the string hash @@ -144,7 +144,7 @@ char* LLStringTable::checkString(const char *str) } else { - return NULL; + return nullptr; } } @@ -195,7 +195,7 @@ LLStringTableEntry* LLStringTable::checkStringEntry(const char *str) } #endif } - return NULL; + return nullptr; } char* LLStringTable::addString(const std::string& str) @@ -214,7 +214,7 @@ char* LLStringTable::addString(const char *str) } else { - return NULL; + return nullptr; } } @@ -227,7 +227,7 @@ LLStringTableEntry* LLStringTable::addStringEntry(const char *str) { if (str) { - char *ret_val = NULL; + char *ret_val = nullptr; LLStringTableEntry *entry; U32 hash_value = hash_my_string(str, mMaxEntries); #if STRING_TABLE_HASH_MAP @@ -287,7 +287,7 @@ LLStringTableEntry* LLStringTable::addStringEntry(const char *str) } else { - return NULL; + return nullptr; } } diff --git a/indra/llcommon/llstringtable.h b/indra/llcommon/llstringtable.h index 978a1711dfdb4238a0edcdbabcba8c3002bfb588..229eed660210c6bb480ec855eb693e6c63307963 100644 --- a/indra/llcommon/llstringtable.h +++ b/indra/llcommon/llstringtable.h @@ -160,7 +160,7 @@ public: { U32 hashval = makehash(s); LLStdStringHandle result = lookup(hashval, s); - if (result == NULL) + if (result == nullptr) { result = new std::string(s); mStringList[hashval].insert(result); @@ -195,7 +195,7 @@ private: } else { - return NULL; + return nullptr; } } diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index c46f35828d396f330a7ce3cd06dde76be47c5270..81dd11b4b5b3c6b538161e2f04f85f70a13400ef 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -193,7 +193,7 @@ LLOSInfo::LLOSInfo() : PGNSI pGNSI; //pointer object ZeroMemory(&si, sizeof(SYSTEM_INFO)); //zero out the memory in information pGNSI = (PGNSI)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); //load kernel32 get function - if (NULL != pGNSI) //check if it has failed + if (nullptr != pGNSI) //check if it has failed pGNSI(&si); //success else GetSystemInfo(&si); //if it fails get regular system info @@ -1199,9 +1199,9 @@ BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile) std::string tmpfile; const S32 UNCOMPRESS_BUFFER_SIZE = 32768; BOOL retval = FALSE; - gzFile src = NULL; + gzFile src = nullptr; U8 buffer[UNCOMPRESS_BUFFER_SIZE]; - LLFILE *dst = NULL; + LLFILE *dst = nullptr; S32 bytes = 0; tmpfile = dstfile + ".t"; #if LL_WINDOWS @@ -1223,12 +1223,12 @@ BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile) } } while(gzeof(src) == 0); fclose(dst); - dst = NULL; + dst = nullptr; if (LLFile::rename(tmpfile, dstfile) == -1) goto err; /* Flawfinder: ignore */ retval = TRUE; err: - if (src != NULL) gzclose(src); - if (dst != NULL) fclose(dst); + if (src != nullptr) gzclose(src); + if (dst != nullptr) fclose(dst); return retval; } @@ -1238,8 +1238,8 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile) std::string tmpfile; BOOL retval = FALSE; U8 buffer[COMPRESS_BUFFER_SIZE]; - gzFile dst = NULL; - LLFILE *src = NULL; + gzFile dst = nullptr; + LLFILE *src = nullptr; S32 bytes = 0; tmpfile = dstfile + ".t"; #if LL_WINDOWS @@ -1255,7 +1255,7 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile) { if (gzwrite(dst, buffer, bytes) <= 0) { - LL_WARNS() << "gzwrite failed: " << gzerror(dst, NULL) << LL_ENDL; + LL_WARNS() << "gzwrite failed: " << gzerror(dst, nullptr) << LL_ENDL; goto err; } } @@ -1267,7 +1267,7 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile) } gzclose(dst); - dst = NULL; + dst = nullptr; #if LL_WINDOWS // Rename in windows needs the dstfile to not exist. LLFile::remove(dstfile); @@ -1275,7 +1275,7 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile) if (LLFile::rename(tmpfile, dstfile) == -1) goto err; /* Flawfinder: ignore */ retval = TRUE; err: - if (src != NULL) fclose(src); - if (dst != NULL) gzclose(dst); + if (src != nullptr) fclose(src); + if (dst != nullptr) gzclose(dst); return retval; } diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 82720735d963d774f2d7b391226c11044d6f1451..599dfe588874c425cc73287e32e6f9cdc5685edd 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -124,9 +124,9 @@ void LLThread::runWrapper() LLThread::LLThread(const std::string& name, apr_pool_t *poolp) : mPaused(FALSE), mName(name), - mStatus(STOPPED), mRunCondition(std::make_unique<LLCondition>()), - mDataLock(std::make_unique<LLMutex>()) + mDataLock(std::make_unique<LLMutex>()), + mStatus(STOPPED) { // Thread creation probably CAN be paranoid about APR being initialized, if necessary if (poolp) @@ -139,7 +139,7 @@ LLThread::LLThread(const std::string& name, apr_pool_t *poolp) : mIsLocalPool = TRUE; apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread } - mLocalAPRFilePoolp = NULL; + mLocalAPRFilePoolp = nullptr; } @@ -150,7 +150,7 @@ LLThread::~LLThread() if (mLocalAPRFilePoolp) { delete mLocalAPRFilePoolp; - mLocalAPRFilePoolp = NULL; + mLocalAPRFilePoolp = nullptr; } } @@ -227,7 +227,7 @@ void LLThread::shutdown() if (mIsLocalPool && mAPRPoolp) { apr_pool_destroy(mAPRPoolp); - mAPRPoolp = 0; + mAPRPoolp = nullptr; } } @@ -363,7 +363,7 @@ void LLThreadSafeRefCount::initThreadSafeRefCount() void LLThreadSafeRefCount::cleanupThreadSafeRefCount() { delete sMutex; - sMutex = NULL; + sMutex = nullptr; } diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index b4686d2dee0ca082a132d493aebf27a3f79104d9..89b37bb561a69dcd19e271aa16712ac12d1f9e89 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -55,7 +55,7 @@ public: QUITTING= 2 // Someone wants this thread to quit } EThreadStatus; - LLThread(const std::string& name, apr_pool_t *poolp = NULL); + LLThread(const std::string& name, apr_pool_t *poolp = nullptr); virtual ~LLThread(); // Warning! You almost NEVER want to destroy a thread unless it's in the STOPPED state. virtual void shutdown(); // stops the thread diff --git a/indra/llcommon/llthreadlocalstorage.h b/indra/llcommon/llthreadlocalstorage.h index df413ae81ab06dd29655f49e91ef33d536c0e023..d69d2a401d5a120fb3b82477bb2ae1dfca46aeeb 100644 --- a/indra/llcommon/llthreadlocalstorage.h +++ b/indra/llcommon/llthreadlocalstorage.h @@ -83,15 +83,15 @@ public: return sThreadLocalPointer == other; } - bool isNull() const { return sThreadLocalPointer == NULL; } + bool isNull() const { return sThreadLocalPointer == nullptr; } - bool notNull() const { return sThreadLocalPointer != NULL; } + bool notNull() const { return sThreadLocalPointer != nullptr; } private: static LL_THREAD_LOCAL T* sThreadLocalPointer; }; template<typename DERIVED_TYPE> -LL_THREAD_LOCAL DERIVED_TYPE* LLThreadLocalPointer<DERIVED_TYPE>::sThreadLocalPointer = NULL; +LL_THREAD_LOCAL DERIVED_TYPE* LLThreadLocalPointer<DERIVED_TYPE>::sThreadLocalPointer = nullptr; template<typename DERIVED_TYPE> class LLThreadLocalSingletonPointer @@ -112,6 +112,6 @@ private: }; template<typename DERIVED_TYPE> -LL_THREAD_LOCAL DERIVED_TYPE* LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstance = NULL; +LL_THREAD_LOCAL DERIVED_TYPE* LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstance = nullptr; #endif // LL_LLTHREADLOCALSTORAGE_H diff --git a/indra/llcommon/llthreadsafequeue.cpp b/indra/llcommon/llthreadsafequeue.cpp index a9408c592dad8af4ea0c45708fb154508008d473..cfca0b1d93cdeaeca7fe9a216a26115268faa7e2 100644 --- a/indra/llcommon/llthreadsafequeue.cpp +++ b/indra/llcommon/llthreadsafequeue.cpp @@ -37,12 +37,12 @@ LLThreadSafeQueueImplementation::LLThreadSafeQueueImplementation(apr_pool_t * pool, unsigned int capacity): - mOwnsPool(pool == 0), + mOwnsPool(pool == nullptr), mPool(pool), - mQueue(0) + mQueue(nullptr) { if(mOwnsPool) { - apr_status_t status = apr_pool_create(&mPool, 0); + apr_status_t status = apr_pool_create(&mPool, nullptr); if(status != APR_SUCCESS) LLTHROW(LLThreadSafeQueueError("failed to allocate pool")); } else { ; // No op. @@ -55,13 +55,13 @@ LLThreadSafeQueueImplementation::LLThreadSafeQueueImplementation(apr_pool_t * po LLThreadSafeQueueImplementation::~LLThreadSafeQueueImplementation() { - if(mQueue != 0) { + if(mQueue != nullptr) { if(apr_queue_size(mQueue) != 0) LL_WARNS() << "terminating queue which still contains " << apr_queue_size(mQueue) << " elements;" << "memory will be leaked" << LL_ENDL; apr_queue_term(mQueue); } - if(mOwnsPool && (mPool != 0)) apr_pool_destroy(mPool); + if(mOwnsPool && (mPool != nullptr)) apr_pool_destroy(mPool); } diff --git a/indra/llcommon/llthreadsafequeue.h b/indra/llcommon/llthreadsafequeue.h index 37526ab247869b0f728c893da637f4792f1a384e..e1d734bed28780e8449d43b731e561edb77c9ead 100644 --- a/indra/llcommon/llthreadsafequeue.h +++ b/indra/llcommon/llthreadsafequeue.h @@ -100,7 +100,7 @@ public: // If the pool is set to NULL one will be allocated and managed by this // queue. - LLThreadSafeQueue(apr_pool_t * pool = 0, unsigned int capacity = 1024); + LLThreadSafeQueue(apr_pool_t * pool = nullptr, unsigned int capacity = 1024); // Add an element to the front of queue (will block if the queue has // reached capacity). diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index fdbe63f3dd190ea428d89f739541417a86d647e4..e8061af8f9417ddfac7185ba1b4861ff743d28e5 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -51,7 +51,7 @@ const U64 SEC_TO_MICROSEC_U64 = 1000000; //--------------------------------------------------------------------------- S32 gUTCOffset = 0; // viewer's offset from server UTC, in seconds -LLTimer* LLTimer::sTimer = NULL; +LLTimer* LLTimer::sTimer = nullptr; // @@ -242,7 +242,7 @@ U64MicrosecondsImplicit totalTime() // Unix platforms use gettimeofday so they are synced, although this probably isn't a good assumption to // make in the future. - get_timer_info().mTotalTimeClockCount = (U64)(time(NULL) * get_timer_info().mClockFrequency); + get_timer_info().mTotalTimeClockCount = (U64)(time(nullptr) * get_timer_info().mClockFrequency); #endif // Update the last clock count @@ -296,7 +296,7 @@ void LLTimer::initClass() // static void LLTimer::cleanupClass() { - delete sTimer; sTimer = NULL; + delete sTimer; sTimer = nullptr; } // static @@ -436,7 +436,7 @@ BOOL LLTimer::knownBadTimer() L"\0" }; - HKEY hKey = NULL; + HKEY hKey = nullptr; LONG nResult = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE,L"SYSTEM\\CurrentControlSet\\Enum\\PCI", 0, KEY_EXECUTE | KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS, &hKey); @@ -451,7 +451,7 @@ BOOL LLTimer::knownBadTimer() while (nResult == ERROR_SUCCESS) { - nResult = ::RegEnumKeyEx(hKey, key_num++, name, &name_len, NULL, NULL, NULL, &scrap); + nResult = ::RegEnumKeyEx(hKey, key_num++, name, &name_len, nullptr, nullptr, nullptr, &scrap); if (nResult == ERROR_SUCCESS) { @@ -483,7 +483,7 @@ BOOL LLTimer::knownBadTimer() time_t time_corrected() { - return time(NULL) + gUTCOffset; + return time(nullptr) + gUTCOffset; } @@ -491,7 +491,7 @@ time_t time_corrected() // observing daylight savings time? BOOL is_daylight_savings() { - time_t now = time(NULL); + time_t now = time(nullptr); // Internal buffer to local server time struct tm* internal_time = localtime(&now); diff --git a/indra/llcommon/lltrace.cpp b/indra/llcommon/lltrace.cpp index b74846d774c9c4965100b43a5e8c8c12a412a152..7172d636622dada8c323516335ed570d8821b784 100644 --- a/indra/llcommon/lltrace.cpp +++ b/indra/llcommon/lltrace.cpp @@ -55,8 +55,8 @@ const char* StatBase::getUnitLabel() const } TimeBlockTreeNode::TimeBlockTreeNode() -: mBlock(NULL), - mParent(NULL), +: mBlock(nullptr), + mParent(nullptr), mCollapsed(true), mNeedsSorting(false) {} diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index 07e5ef973ee63909445bc2378313f0815ef95ee5..45ce497e1872fd814d2d3d6fd37665afd55c6546 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -126,11 +126,11 @@ public: typedef StatType<EventAccumulator> stat_t; typedef EventStatHandle<T> self_t; - EventStatHandle(const char* name, const char* description = NULL) + EventStatHandle(const char* name, const char* description = nullptr) : stat_t(name, description) {} - /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel<T>::getUnitLabel(); } + /*virtual*/ const char* getUnitLabel() const override { return LLGetUnitLabel<T>::getUnitLabel(); } }; @@ -152,11 +152,11 @@ public: typedef StatType<SampleAccumulator> stat_t; typedef SampleStatHandle<T> self_t; - SampleStatHandle(const char* name, const char* description = NULL) + SampleStatHandle(const char* name, const char* description = nullptr) : stat_t(name, description) {} - /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel<T>::getUnitLabel(); } + /*virtual*/ const char* getUnitLabel() const override { return LLGetUnitLabel<T>::getUnitLabel(); } }; template<typename T, typename VALUE_T> @@ -177,11 +177,11 @@ public: typedef StatType<CountAccumulator> stat_t; typedef CountStatHandle<T> self_t; - CountStatHandle(const char* name, const char* description = NULL) + CountStatHandle(const char* name, const char* description = nullptr) : stat_t(name, description) {} - /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel<T>::getUnitLabel(); } + /*virtual*/ const char* getUnitLabel() const override { return LLGetUnitLabel<T>::getUnitLabel(); } }; template<typename T, typename VALUE_T> @@ -231,7 +231,7 @@ public: setKey(name); } - /*virtual*/ const char* getUnitLabel() const { return "KB"; } + /*virtual*/ const char* getUnitLabel() const override { return "KB"; } StatType<MemAccumulator::AllocationFacet>& allocations() { diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h index 3695476762fe01c08dcf51c93f735e650f10e89f..69478d477d82abd7ba8e27edcb0ba8f0332afb85 100644 --- a/indra/llcommon/lltraceaccumulators.h +++ b/indra/llcommon/lltraceaccumulators.h @@ -57,13 +57,13 @@ namespace LLTrace struct StaticAllocationMarker { }; AccumulatorBuffer(StaticAllocationMarker m) - : mStorage(NULL), + : mStorage(nullptr), mStorageSize(0) {} public: AccumulatorBuffer() - : mStorage(NULL), + : mStorage(nullptr), mStorageSize(0) { const AccumulatorBuffer& other = *getDefaultBuffer(); @@ -95,7 +95,7 @@ namespace LLTrace AccumulatorBuffer(const AccumulatorBuffer& other) - : mStorage(NULL), + : mStorage(nullptr), mStorageSize(0) { resize(sNextStorageSlot); @@ -123,7 +123,7 @@ namespace LLTrace } } - void reset(const AccumulatorBuffer<ACCUMULATOR>* other = NULL) + void reset(const AccumulatorBuffer<ACCUMULATOR>* other = nullptr) { llassert(mStorageSize >= sNextStorageSlot); for (size_t i = 0; i < sNextStorageSlot; i++) @@ -232,7 +232,7 @@ namespace LLTrace }; template<typename ACCUMULATOR> size_t AccumulatorBuffer<ACCUMULATOR>::sNextStorageSlot = 0; - template<typename ACCUMULATOR> AccumulatorBuffer<ACCUMULATOR>* AccumulatorBuffer<ACCUMULATOR>::sDefaultBuffer = NULL; + template<typename ACCUMULATOR> AccumulatorBuffer<ACCUMULATOR>* AccumulatorBuffer<ACCUMULATOR>::sDefaultBuffer = nullptr; class EventAccumulator { @@ -587,7 +587,7 @@ namespace LLTrace void append(const AccumulatorBufferGroup& other); void merge(const AccumulatorBufferGroup& other); - void reset(AccumulatorBufferGroup* other = NULL); + void reset(AccumulatorBufferGroup* other = nullptr); void sync(); AccumulatorBuffer<CountAccumulator> mCounts; diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 0fd24794a264d98f3acfd6e8d87e7f70d33763b7..21cd55381cfd135217e25f6ff51e604ff831b354 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -50,7 +50,7 @@ extern MemStatHandle gTraceMemStat; Recording::Recording(EPlayState state) : mElapsedSeconds(0), - mActiveBuffers(NULL) + mActiveBuffers(nullptr) { claim_alloc(gTraceMemStat, this); mBuffers = new AccumulatorBufferGroup(); @@ -59,7 +59,7 @@ Recording::Recording(EPlayState state) } Recording::Recording( const Recording& other ) -: mActiveBuffers(NULL) +: mActiveBuffers(nullptr) { claim_alloc(gTraceMemStat, this); *this = other; @@ -151,7 +151,7 @@ void Recording::handleStop() // must have thread recorder running on this thread llassert(LLTrace::get_thread_recorder().notNull()); LLTrace::get_thread_recorder()->deactivate(mBuffers.write()); - mActiveBuffers = NULL; + mActiveBuffers = nullptr; mBuffers.setStayUnique(false); #endif } diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index d0b4a842a64aee82b234b894551b9df94ac1161e..28f592b9bd147dc2a0e3cd117f848a40418c102e 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -311,10 +311,10 @@ namespace LLTrace friend class ThreadRecorder; // implementation for LLStopWatchControlsMixin - /*virtual*/ void handleStart(); - /*virtual*/ void handleStop(); - /*virtual*/ void handleReset(); - /*virtual*/ void handleSplitTo(Recording& other); + /*virtual*/ void handleStart() override; + /*virtual*/ void handleStop() override; + /*virtual*/ void handleReset() override; + /*virtual*/ void handleSplitTo(Recording& other) override; // returns data for current thread class ThreadRecorder* getThreadRecorder(); @@ -604,10 +604,10 @@ namespace LLTrace private: // implementation for LLStopWatchControlsMixin - /*virtual*/ void handleStart(); - /*virtual*/ void handleStop(); - /*virtual*/ void handleReset(); - /*virtual*/ void handleSplitTo(PeriodicRecording& other); + /*virtual*/ void handleStart() override; + /*virtual*/ void handleStop() override; + /*virtual*/ void handleReset() override; + /*virtual*/ void handleSplitTo(PeriodicRecording& other) override; private: std::vector<Recording> mRecordingPeriods; @@ -632,10 +632,10 @@ namespace LLTrace private: // implementation for LLStopWatchControlsMixin - /*virtual*/ void handleStart(); - /*virtual*/ void handleStop(); - /*virtual*/ void handleReset(); - /*virtual*/ void handleSplitTo(ExtendableRecording& other); + /*virtual*/ void handleStart() override; + /*virtual*/ void handleStop() override; + /*virtual*/ void handleReset() override; + /*virtual*/ void handleSplitTo(ExtendableRecording& other) override; private: Recording mAcceptedRecording; @@ -656,10 +656,10 @@ namespace LLTrace private: // implementation for LLStopWatchControlsMixin - /*virtual*/ void handleStart(); - /*virtual*/ void handleStop(); - /*virtual*/ void handleReset(); - /*virtual*/ void handleSplitTo(ExtendablePeriodicRecording& other); + /*virtual*/ void handleStart() override; + /*virtual*/ void handleStop() override; + /*virtual*/ void handleReset() override; + /*virtual*/ void handleSplitTo(ExtendablePeriodicRecording& other) override; private: PeriodicRecording mAcceptedRecording; diff --git a/indra/llcommon/lltracethreadrecorder.cpp b/indra/llcommon/lltracethreadrecorder.cpp index 4a56f59f01227dabe6187b4f5b23a7f20e56b3fc..2f499ab4cd6fd9f292064c329cc8c3c90015f029 100644 --- a/indra/llcommon/lltracethreadrecorder.cpp +++ b/indra/llcommon/lltracethreadrecorder.cpp @@ -35,14 +35,14 @@ namespace LLTrace { extern MemStatHandle gTraceMemStat; -static ThreadRecorder* sMasterThreadRecorder = NULL; +static ThreadRecorder* sMasterThreadRecorder = nullptr; /////////////////////////////////////////////////////////////////////// // ThreadRecorder /////////////////////////////////////////////////////////////////////// ThreadRecorder::ThreadRecorder() -: mParentRecorder(NULL) +: mParentRecorder(nullptr) { init(); } @@ -57,7 +57,7 @@ void ThreadRecorder::init() BlockTimerStackRecord* timer_stack = LLThreadLocalSingletonPointer<BlockTimerStackRecord>::getInstance(); timer_stack->mTimeBlock = &root_time_block; - timer_stack->mActiveTimer = NULL; + timer_stack->mActiveTimer = nullptr; mNumTimeBlockTreeNodes = AccumulatorBuffer<TimeBlockAccumulator>::getDefaultBuffer()->size(); @@ -115,7 +115,7 @@ ThreadRecorder::~ThreadRecorder() mActiveRecordings.clear(); } - set_thread_recorder(NULL); + set_thread_recorder(nullptr); delete[] mTimeBlockTreeNodes; if (mParentRecorder) @@ -133,7 +133,7 @@ TimeBlockTreeNode* ThreadRecorder::getTimeBlockTreeNode( S32 index ) return &mTimeBlockTreeNodes[index]; } #endif - return NULL; + return nullptr; } AccumulatorBufferGroup* ThreadRecorder::activate( AccumulatorBufferGroup* recording) diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp index 6b7e9f9eb4b49e1ef972d0cbfecde39906bd3f13..e32d9f5c0ef180b5a1ffb858c12e6591bb66cd40 100644 --- a/indra/llcommon/lluriparser.cpp +++ b/indra/llcommon/lluriparser.cpp @@ -123,7 +123,7 @@ void LLUriParser::fragment(const std::string& s) void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str) { - if (textRange.first != NULL && textRange.afterLast != NULL && textRange.first < textRange.afterLast) + if (textRange.first != nullptr && textRange.afterLast != nullptr && textRange.first < textRange.afterLast) { const ptrdiff_t len = textRange.afterLast - textRange.first; str.assign(textRange.first, static_cast<std::string::size_type>(len)); @@ -179,7 +179,7 @@ S32 LLUriParser::normalize() { chars_required++; std::vector<char> label_buf(chars_required); - mRes = uriToStringA(&label_buf[0], &mUri, chars_required, NULL); + mRes = uriToStringA(&label_buf[0], &mUri, chars_required, nullptr); if (!mRes) { diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index 2d23563954b60fe4a4a70b9e0cd0b0ec435affc6..7f3ce7756dc0637df20a4f03494ccf0f6463f7c6 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -50,7 +50,7 @@ const LLUUID LLUUID::null; const LLTransactionID LLTransactionID::tnull; // static -LLMutex * LLUUID::mMutex = NULL; +LLMutex * LLUUID::mMutex = nullptr; static const U8 nullUUID[UUID_BYTES] = {}; // <alchemy/> @@ -478,8 +478,8 @@ S32 LLUUID::getNodeID(unsigned char *node_id) GetAdaptersAddresses( AF_INET, flags, - NULL, - NULL, + nullptr, + nullptr, &outBufLen); constexpr U32 MAX_TRIES = 3U; @@ -492,7 +492,7 @@ S32 LLUUID::getNodeID(unsigned char *node_id) } dwRetVal = - GetAdaptersAddresses(family, flags, NULL, pAddresses, &outBufLen); + GetAdaptersAddresses(family, flags, nullptr, pAddresses, &outBufLen); if (dwRetVal == ERROR_BUFFER_OVERFLOW) { free(pAddresses); @@ -928,7 +928,7 @@ U32 LLUUID::getRandomSeed() BOOL LLUUID::parseUUID(const std::string& buf, LLUUID* value) { - if( buf.empty() || value == NULL) + if( buf.empty() || value == nullptr) { return FALSE; } diff --git a/indra/llcommon/llworkerthread.h b/indra/llcommon/llworkerthread.h index 194e009c3891542dc6b42cf391af23a3d52c9e72..1a40fd35acdcbcc08125e9b5fab6b05c934af5f9 100644 --- a/indra/llcommon/llworkerthread.h +++ b/indra/llcommon/llworkerthread.h @@ -62,9 +62,9 @@ public: return mWorkerClass; } - /*virtual*/ bool processRequest(); - /*virtual*/ void finishRequest(bool completed); - /*virtual*/ void deleteRequest(); + /*virtual*/ bool processRequest() override; + /*virtual*/ void finishRequest(bool completed) override; + /*virtual*/ void deleteRequest() override; private: LLWorkerClass* mWorkerClass; @@ -83,7 +83,7 @@ public: LLWorkerThread(const std::string& name, bool threaded = true, bool should_pause = false); ~LLWorkerThread(); - /*virtual*/ S32 update(F32 max_time_ms); + /*virtual*/ S32 update(F32 max_time_ms) override; handle_t addWorkRequest(LLWorkerClass* workerclass, S32 param, U32 priority = PRIORITY_NORMAL); diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp index 1f394abf4e488ab88187e327d9f50e7e046bd53a..5e91bbfaba29ca3ee917e02142e5b93eee28eed1 100644 --- a/indra/llcorehttp/_httplibcurl.cpp +++ b/indra/llcorehttp/_httplibcurl.cpp @@ -55,9 +55,9 @@ HttpLibcurl::HttpLibcurl(HttpService * service) : mService(service), mHandleCache(), mPolicyCount(0), - mMultiHandles(NULL), - mActiveHandles(NULL), - mDirtyPolicy(NULL) + mMultiHandles(nullptr), + mActiveHandles(nullptr), + mDirtyPolicy(nullptr) {} @@ -65,7 +65,7 @@ HttpLibcurl::~HttpLibcurl() { shutdown(); - mService = NULL; + mService = nullptr; } @@ -86,18 +86,18 @@ void HttpLibcurl::shutdown() if (mMultiHandles[policy_class]) { curl_multi_cleanup(mMultiHandles[policy_class]); - mMultiHandles[policy_class] = 0; + mMultiHandles[policy_class] = nullptr; } } delete [] mMultiHandles; - mMultiHandles = NULL; + mMultiHandles = nullptr; delete [] mActiveHandles; - mActiveHandles = NULL; + mActiveHandles = nullptr; delete [] mDirtyPolicy; - mDirtyPolicy = NULL; + mDirtyPolicy = nullptr; } mPolicyCount = 0; @@ -116,7 +116,7 @@ void HttpLibcurl::start(int policy_count) for (int policy_class(0); policy_class < mPolicyCount; ++policy_class) { - if (NULL == (mMultiHandles[policy_class] = curl_multi_init())) + if (nullptr == (mMultiHandles[policy_class] = curl_multi_init())) { LL_ERRS(LOG_CORE) << "Failed to allocate multi handle in libcurl." << LL_ENDL; @@ -167,7 +167,7 @@ HttpService::ELoopSpeed HttpLibcurl::processTransport() while (0 != running && CURLM_CALL_MULTI_PERFORM == status); // Run completion on anything done - CURLMsg * msg(NULL); + CURLMsg * msg(nullptr); int msgs_in_queue(0); while ((msg = curl_multi_info_read(mMultiHandles[policy_class], &msgs_in_queue))) { @@ -177,7 +177,7 @@ HttpService::ELoopSpeed HttpLibcurl::processTransport() CURLcode result(msg->data.result); completeRequest(mMultiHandles[policy_class], handle, result); - handle = NULL; // No longer valid on return + handle = nullptr; // No longer valid on return ret = HttpService::NORMAL; // If anything completes, we may have a free slot. // Turning around quickly reduces connection gap by 7-10mS. } @@ -281,7 +281,7 @@ void HttpLibcurl::cancelRequest(const HttpOpRequest::ptr_t &op) // Detach from multi and recycle handle curl_multi_remove_handle(mMultiHandles[op->mReqPolicy], op->mCurlHandle); mHandleCache.freeHandle(op->mCurlHandle); - op->mCurlHandle = NULL; + op->mCurlHandle = nullptr; // Tracing if (op->mTracing > HTTP_TRACE_OFF) @@ -301,7 +301,7 @@ void HttpLibcurl::cancelRequest(const HttpOpRequest::ptr_t &op) // Keep them synchronized as necessary. bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode status) { - HttpHandle ophandle(NULL); + HttpHandle ophandle(nullptr); CURLcode ccode(CURLE_OK); @@ -357,7 +357,7 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode { if (http_status >= 100 && http_status <= 999) { - char * cont_type(NULL); + char * cont_type(nullptr); ccode = curl_easy_getinfo(handle, CURLINFO_CONTENT_TYPE, &cont_type); if (ccode == CURLE_OK) { @@ -403,7 +403,7 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode << std::hex << multi_handle << " h:" << std::hex << handle << std::dec << LL_ENDL; } - op->mCurlHandle = NULL; + op->mCurlHandle = nullptr; // Tracing if (op->mTracing > HTTP_TRACE_OFF) @@ -522,7 +522,7 @@ void HttpLibcurl::policyUpdated(int policy_class) // --------------------------------------- HttpLibcurl::HandleCache::HandleCache() - : mHandleTemplate(NULL) + : mHandleTemplate(nullptr) { mCache.reserve(50); } @@ -533,7 +533,7 @@ HttpLibcurl::HandleCache::~HandleCache() if (mHandleTemplate) { curl_easy_cleanup(mHandleTemplate); - mHandleTemplate = NULL; + mHandleTemplate = nullptr; } for (handle_cache_t::iterator it(mCache.begin()); mCache.end() != it; ++it) @@ -546,7 +546,7 @@ HttpLibcurl::HandleCache::~HandleCache() CURL * HttpLibcurl::HandleCache::getHandle() { - CURL * ret(NULL); + CURL * ret(nullptr); if (! mCache.empty()) { diff --git a/indra/llcorehttp/_httpopcancel.h b/indra/llcorehttp/_httpopcancel.h index 86944eb159a3528bcef8039c080ef425daf40b36..4420a3e545c4b78e622d5124275fe3b3f5d50799 100644 --- a/indra/llcorehttp/_httpopcancel.h +++ b/indra/llcorehttp/_httpopcancel.h @@ -59,7 +59,7 @@ public: virtual ~HttpOpCancel(); // Use release() public: - virtual void stageFromRequest(HttpService *); + void stageFromRequest(HttpService *) override; public: // Request data diff --git a/indra/llcorehttp/_httpoperation.h b/indra/llcorehttp/_httpoperation.h index f843160fea8db909c5a79776d9b08cdf9e895789..852d3543bde6b956a8f1fb51b1629037896262f9 100644 --- a/indra/llcorehttp/_httpoperation.h +++ b/indra/llcorehttp/_httpoperation.h @@ -229,7 +229,7 @@ private: void operator=(const HttpOpStop &) = delete; // Not defined public: - virtual void stageFromRequest(HttpService *); + void stageFromRequest(HttpService *) override; }; // end class HttpOpStop @@ -251,7 +251,7 @@ private: void operator=(const HttpOpNull &) = delete; // Not defined public: - virtual void stageFromRequest(HttpService *); + void stageFromRequest(HttpService *) override; }; // end class HttpOpNull @@ -273,7 +273,7 @@ private: void operator=(const HttpOpSpin &) = delete; // Not defined public: - virtual void stageFromRequest(HttpService *); + void stageFromRequest(HttpService *) override; protected: int mMode; diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h index b37f55d6cc5110f832641f781e6f4f5806ecf1eb..fa76dc2e4cd6fa9742ea54566fc19fc3b7d12eea 100644 --- a/indra/llcorehttp/_httpoprequest.h +++ b/indra/llcorehttp/_httpoprequest.h @@ -87,12 +87,12 @@ public: HOR_COPY, HOR_MOVE }; - - virtual void stageFromRequest(HttpService *); - virtual void stageFromReady(HttpService *); - virtual void stageFromActive(HttpService *); - virtual void visitNotifier(HttpRequest * request); + void stageFromRequest(HttpService *) override; + void stageFromReady(HttpService *) override; + void stageFromActive(HttpService *) override; + + void visitNotifier(HttpRequest * request) override; public: /// Setup Methods @@ -162,8 +162,8 @@ public: // Threading: called by worker thread // HttpStatus prepareRequest(HttpService * service); - - virtual HttpStatus cancel(); + + HttpStatus cancel() override; protected: // Common setup for all the request methods. diff --git a/indra/llcorehttp/_httpopsetget.h b/indra/llcorehttp/_httpopsetget.h index 5e26b5e22a12eb3e362bf4f683e7240b4e5b65d8..4ac26e38faeb8dc53c999aba2efa6877433a448f 100644 --- a/indra/llcorehttp/_httpopsetget.h +++ b/indra/llcorehttp/_httpopsetget.h @@ -69,7 +69,7 @@ public: HttpStatus setupSet(HttpRequest::EPolicyOption opt, HttpRequest::policy_t pclass, long value); HttpStatus setupSet(HttpRequest::EPolicyOption opt, HttpRequest::policy_t pclass, const std::string & value); - virtual void stageFromRequest(HttpService *); + void stageFromRequest(HttpService *) override; public: // Request data diff --git a/indra/llcorehttp/_httpopsetpriority.h b/indra/llcorehttp/_httpopsetpriority.h index 48de90fcc96a9c7f6f7868698d09f782c31688fe..678fe9500e0fd81aed761c0f231db719302d0f45 100644 --- a/indra/llcorehttp/_httpopsetpriority.h +++ b/indra/llcorehttp/_httpopsetpriority.h @@ -58,7 +58,7 @@ private: void operator=(const HttpOpSetPriority &) = delete; // Not defined public: - virtual void stageFromRequest(HttpService *); + void stageFromRequest(HttpService *) override; protected: // Request Data diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp index f722a798b306e3d6e8983582190491949a0063df..407d5e61a67cd7bfe79bebe1f11204e7cf48e847 100644 --- a/indra/llcorehttp/_httppolicy.cpp +++ b/indra/llcorehttp/_httppolicy.cpp @@ -93,7 +93,7 @@ HttpPolicy::~HttpPolicy() } mClasses.clear(); - mService = NULL; + mService = nullptr; } diff --git a/indra/llcorehttp/_httprequestqueue.cpp b/indra/llcorehttp/_httprequestqueue.cpp index cc840010355c7a69d0fcf72bc9e9265b5c3abb71..ba7b5f7c933f6be52791bdbb88bbd3fd821e81b0 100644 --- a/indra/llcorehttp/_httprequestqueue.cpp +++ b/indra/llcorehttp/_httprequestqueue.cpp @@ -37,7 +37,7 @@ using namespace LLCoreInt; namespace LLCore { -HttpRequestQueue * HttpRequestQueue::sInstance(NULL); +HttpRequestQueue * HttpRequestQueue::sInstance(nullptr); HttpRequestQueue::HttpRequestQueue() @@ -65,7 +65,7 @@ void HttpRequestQueue::term() if (sInstance) { sInstance->release(); - sInstance = NULL; + sInstance = nullptr; } } diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp index 28b30cd81f133453bf7773199b69e1e80dd8631f..f91b9e1a2872f2cb97f66ef0fccc2bc4acfed4d2 100644 --- a/indra/llcorehttp/_httpservice.cpp +++ b/indra/llcorehttp/_httpservice.cpp @@ -63,15 +63,15 @@ const HttpService::OptionDescriptor HttpService::sOptionDesc[] = { true, true, false, true, false }, // PO_THROTTLE_RATE { false, false, true, false, true } // PO_SSL_VERIFY_CALLBACK }; -HttpService * HttpService::sInstance(NULL); +HttpService * HttpService::sInstance(nullptr); volatile HttpService::EState HttpService::sState(NOT_INITIALIZED); HttpService::HttpService() - : mRequestQueue(NULL), + : mRequestQueue(nullptr), mExitRequested(0U), - mThread(NULL), - mPolicy(NULL), - mTransport(NULL), + mThread(nullptr), + mPolicy(nullptr), + mTransport(nullptr), mLastPolicy(0) {} @@ -120,19 +120,19 @@ HttpService::~HttpService() if (mRequestQueue) { mRequestQueue->release(); - mRequestQueue = NULL; + mRequestQueue = nullptr; } delete mTransport; - mTransport = NULL; + mTransport = nullptr; delete mPolicy; - mPolicy = NULL; + mPolicy = nullptr; if (mThread) { mThread->release(); - mThread = NULL; + mThread = nullptr; } } @@ -171,7 +171,7 @@ void HttpService::term() } delete sInstance; - sInstance = NULL; + sInstance = nullptr; } sState = NOT_INITIALIZED; } diff --git a/indra/llcorehttp/bufferarray.cpp b/indra/llcorehttp/bufferarray.cpp index 444876953181efba500a30dfd8e90a8b53653335..b8f94d73c390244ff1b3fd3671cc8d013d40a931 100644 --- a/indra/llcorehttp/bufferarray.cpp +++ b/indra/llcorehttp/bufferarray.cpp @@ -104,7 +104,7 @@ BufferArray::~BufferArray() ++it) { delete *it; - *it = NULL; + *it = nullptr; } mBlocks.clear(); } diff --git a/indra/llcorehttp/bufferstream.cpp b/indra/llcorehttp/bufferstream.cpp index 24914328d4e2ee1b6a4ff93b669d49d99e891809..03802c6b89c41b9461e2ad0cd5c9e35b32f8a426 100644 --- a/indra/llcorehttp/bufferstream.cpp +++ b/indra/llcorehttp/bufferstream.cpp @@ -38,9 +38,9 @@ BufferArrayStreamBuf::BufferArrayStreamBuf(BufferArray * array) : mBufferArray(array), mReadCurPos(0), mReadCurBlock(-1), - mReadBegin(NULL), - mReadCur(NULL), - mReadEnd(NULL), + mReadBegin(nullptr), + mReadCur(nullptr), + mReadEnd(nullptr), mWriteCurPos(0) { if (array) @@ -56,7 +56,7 @@ BufferArrayStreamBuf::~BufferArrayStreamBuf() if (mBufferArray) { mBufferArray->release(); - mBufferArray = NULL; + mBufferArray = nullptr; } } @@ -73,7 +73,7 @@ BufferArrayStreamBuf::int_type BufferArrayStreamBuf::underflow() // Find the next block with actual data or leave // mCurBlock/mCur/mEnd unchanged if we're at the end // of any block chain. - const char * new_begin(NULL), * new_end(NULL); + const char * new_begin(nullptr), * new_end(nullptr); int new_cur_block(mReadCurBlock + 1); while (mBufferArray->getBlockStartEnd(new_cur_block, &new_begin, &new_end)) @@ -123,7 +123,7 @@ BufferArrayStreamBuf::int_type BufferArrayStreamBuf::pbackfail(int_type ch) // Find the previous block with actual data or leave // mCurBlock/mBegin/mCur/mEnd unchanged if we're at the // beginning of any block chain. - const char * new_begin(NULL), * new_end(NULL); + const char * new_begin(nullptr), * new_end(nullptr); int new_cur_block(mReadCurBlock - 1); while (mBufferArray->getBlockStartEnd(new_cur_block, &new_begin, &new_end)) @@ -228,7 +228,7 @@ std::streampos BufferArrayStreamBuf::seekoff(std::streamoff off, int block(mBufferArray->findBlock(pos, &ba_offset)); if (block < 0) return ret; - const char * start(NULL), * end(NULL); + const char * start(nullptr), * end(nullptr); if (! mBufferArray->getBlockStartEnd(block, &start, &end)) return ret; mReadCurBlock = block; diff --git a/indra/llcorehttp/bufferstream.h b/indra/llcorehttp/bufferstream.h index a026f9ab337b40005ae205baaf680c300dbea920..c94d0daf440f87f562d7ff6bd64f587418b8f636 100644 --- a/indra/llcorehttp/bufferstream.h +++ b/indra/llcorehttp/bufferstream.h @@ -96,17 +96,17 @@ private: public: // Input interfaces from std::streambuf - int_type underflow(); - int_type uflow(); - int_type pbackfail(int_type ch); - std::streamsize showmanyc(); + int_type underflow() override; + int_type uflow() override; + int_type pbackfail(int_type ch) override; + std::streamsize showmanyc() override; // Output interfaces from std::streambuf - int_type overflow(int c); - std::streamsize xsputn(const char * src, std::streamsize count); + int_type overflow(int c) override; + std::streamsize xsputn(const char * src, std::streamsize count) override; // Common/misc interfaces from std::streambuf - std::streampos seekoff(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which); + std::streampos seekoff(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which) override; protected: BufferArray * mBufferArray; // Ref counted diff --git a/indra/llcorehttp/httpcommon.cpp b/indra/llcorehttp/httpcommon.cpp index 9e7578ce0b70e556dedaa2c9c7122c54542821cb..a49764a30d58b883d102b0d10bf69f324c46d068 100644 --- a/indra/llcorehttp/httpcommon.cpp +++ b/indra/llcorehttp/httpcommon.cpp @@ -272,12 +272,12 @@ namespace { CURL *getCurlTemplateHandle() { - static CURL *curlpTemplateHandle = NULL; + static CURL *curlpTemplateHandle = nullptr; - if (curlpTemplateHandle == NULL) + if (curlpTemplateHandle == nullptr) { // Late creation of the template curl handle curlpTemplateHandle = curl_easy_init(); - if (curlpTemplateHandle == NULL) + if (curlpTemplateHandle == nullptr) { LL_WARNS() << "curl error calling curl_easy_init()" << LL_ENDL; } @@ -316,7 +316,7 @@ CURL *getCurlTemplateHandle() LLMutex *getCurlMutex() { - static LLMutex* sHandleMutexp = NULL; + static LLMutex* sHandleMutexp = nullptr; if (!sHandleMutexp) { diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index 4fd50a2944acde3aa806506ab72d3e0a724b5c79..d853c94eb722cbd57d71f33206352669d21a2d68 100644 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -194,6 +194,7 @@ #include <boost/function.hpp> #include <string> #include <curl/curl.h> +#include <boost/make_shared.hpp> namespace LLCore { @@ -299,25 +300,25 @@ struct HttpStatus HttpStatus() { - mDetails = boost::shared_ptr<Details>(new Details(LLCORE, HE_SUCCESS)); + mDetails = boost::make_shared<Details>(LLCORE, HE_SUCCESS); } HttpStatus(type_enum_t type, short status) { - mDetails = boost::shared_ptr<Details>(new Details(type, status)); + mDetails = boost::make_shared<Details>(type, status); } HttpStatus(int http_status) { - mDetails = boost::shared_ptr<Details>(new Details(http_status, - (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR)); + mDetails = boost::make_shared<Details>(http_status, + http_status >= 200 && http_status <= 299 ? HE_SUCCESS : HE_REPLY_ERROR); llassert(http_status >= 100 && http_status <= 999); } HttpStatus(int http_status, const std::string &message) { - mDetails = boost::shared_ptr<Details>(new Details(http_status, - (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR)); + mDetails = boost::make_shared<Details>(http_status, + http_status >= 200 && http_status <= 299 ? HE_SUCCESS : HE_REPLY_ERROR); llassert(http_status >= 100 && http_status <= 999); mDetails->mMessage = message; } @@ -339,7 +340,7 @@ struct HttpStatus HttpStatus & clone(const HttpStatus &rhs) { - mDetails = boost::shared_ptr<Details>(new Details(*rhs.mDetails)); + mDetails = boost::make_shared<Details>(*rhs.mDetails); return *this; } @@ -467,7 +468,7 @@ private: mType(type), mStatus(status), mMessage(), - mErrorData(NULL) + mErrorData(nullptr) {} Details(const Details &rhs) : diff --git a/indra/llcorehttp/httpheaders.cpp b/indra/llcorehttp/httpheaders.cpp index 4ce368a7e32ab3eebabe2302d3e7fe3cf05e618b..542cc1554d3d57638d102a1d3eca0bbac0138d00 100644 --- a/indra/llcorehttp/httpheaders.cpp +++ b/indra/llcorehttp/httpheaders.cpp @@ -116,7 +116,7 @@ const std::string * HttpHeaders::find(const std::string &name) const return &(*iter).second; } } - return NULL; + return nullptr; } void HttpHeaders::remove(const char *name) diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp index a7f5960d8cce75e924faaeda6f4910a0755100d6..3b91e3edff300f191a75beadbdf14b1a1fdcdb5c 100644 --- a/indra/llcorehttp/httprequest.cpp +++ b/indra/llcorehttp/httprequest.cpp @@ -58,7 +58,7 @@ namespace LLCore HttpRequest::HttpRequest() : mReplyQueue(), - mRequestQueue(NULL) + mRequestQueue(nullptr) { mRequestQueue = HttpRequestQueue::instanceOf(); mRequestQueue->addRef(); @@ -72,7 +72,7 @@ HttpRequest::~HttpRequest() if (mRequestQueue) { mRequestQueue->release(); - mRequestQueue = NULL; + mRequestQueue = nullptr; } mReplyQueue.reset(); diff --git a/indra/llcorehttp/httpresponse.cpp b/indra/llcorehttp/httpresponse.cpp index ae526316df254282059ea0c082d177587ea5cf5e..48d484299f41ac9d418650143e7d282b6e4c2382 100644 --- a/indra/llcorehttp/httpresponse.cpp +++ b/indra/llcorehttp/httpresponse.cpp @@ -40,7 +40,7 @@ HttpResponse::HttpResponse() mReplyOffset(0U), mReplyLength(0U), mReplyFullLength(0U), - mBufferArray(NULL), + mBufferArray(nullptr), mHeaders(), mRetries(0U), m503Retries(0U), @@ -50,7 +50,7 @@ HttpResponse::HttpResponse() HttpResponse::~HttpResponse() { - setBody(NULL); + setBody(nullptr); //setHeaders(); } diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index a798ae77941dd9e3f342c5ac98af1212bcf4cfbf..67f4efe05a63be8d8fe59885ac8d9f6842c91e4e 100644 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -64,8 +64,8 @@ public: LLCrashLoggerHandler() {} protected: - virtual void onSuccess(LLCore::HttpResponse * response, const LLSD &content); - virtual void onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status); + void onSuccess(LLCore::HttpResponse * response, const LLSD &content) override; + void onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status) override; }; @@ -236,12 +236,12 @@ void LLCrashLogger::gatherFiles() if(mDebugLog.has("CAFilename")) { LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_CA_FILE, - LLCore::HttpRequest::GLOBAL_POLICY_ID, mDebugLog["CAFilename"].asString(), NULL); + LLCore::HttpRequest::GLOBAL_POLICY_ID, mDebugLog["CAFilename"].asString(), nullptr); } else { LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_CA_FILE, - LLCore::HttpRequest::GLOBAL_POLICY_ID, gDirUtilp->getCAFile(), NULL); + LLCore::HttpRequest::GLOBAL_POLICY_ID, gDirUtilp->getCAFile(), nullptr); } LL_INFOS("CRASHREPORT") << "Using log file from debug log " << mFileMap["SecondLifeLog"] << LL_ENDL; @@ -251,7 +251,7 @@ void LLCrashLogger::gatherFiles() { // Figure out the filename of the second life log LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_CA_FILE, - LLCore::HttpRequest::GLOBAL_POLICY_ID, gDirUtilp->getCAFile(), NULL); + LLCore::HttpRequest::GLOBAL_POLICY_ID, gDirUtilp->getCAFile(), nullptr); mFileMap["SecondLifeLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"Alchemy.log"); mFileMap["SettingsXml"] = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings.xml"); @@ -422,7 +422,7 @@ bool LLCrashLogger::runCrashLogPost(std::string host, LLSD data, std::string msg LL_INFOS("CRASHREPORT") << "POST crash data to " << host << LL_ENDL; LLCore::HttpHandle handle = LLCoreHttpUtil::requestPostWithLLSD(httpRequest.get(), LLCore::HttpRequest::DEFAULT_POLICY_ID, 0, - host, data, httpOpts, LLCore::HttpHeaders::ptr_t(), LLCore::HttpHandler::ptr_t(new LLCrashLoggerHandler)); + host, data, httpOpts, LLCore::HttpHeaders::ptr_t(), boost::static_pointer_cast<LLCore::HttpHandler>(boost::make_shared<LLCrashLoggerHandler>())); if (handle == LLCORE_HTTP_HANDLE_INVALID) { diff --git a/indra/llcrashlogger/llcrashlogger.h b/indra/llcrashlogger/llcrashlogger.h index d96e986777860e57b42f655f4049296b4c466379..658fae867b5915a7de1b16c96937d9a5a6b7b06b 100644 --- a/indra/llcrashlogger/llcrashlogger.h +++ b/indra/llcrashlogger/llcrashlogger.h @@ -56,9 +56,9 @@ public: bool sendCrashLogs(); LLSD constructPostData(); virtual void updateApplication(const std::string& message = LLStringUtil::null); - virtual bool init(); - virtual bool frame() = 0; - virtual bool cleanup() = 0; + bool init() override; + bool frame() override = 0; + bool cleanup() override = 0; void commonCleanup(); void setUserText(const std::string& text) { mCrashInfo["UserNotes"] = text; } S32 getCrashBehavior() { return mCrashBehavior; } diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index b720547297c69f7ad20aa8a0892ebcaaa3e2cf00..92b460e13db272f495d12dc5aa484a903fa1b1a8 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -587,7 +587,7 @@ static void bilinear_scale(const U8 *src, U32 srcW, U32 srcH, U32 srcCh, U32 src //static std::string LLImage::sLastErrorMessage; -LLMutex* LLImage::sMutex = NULL; +LLMutex* LLImage::sMutex = nullptr; bool LLImage::sUseNewByteRange = false; S32 LLImage::sMinimalReverseByteRangePercent = 75; @@ -603,7 +603,7 @@ void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_ void LLImage::cleanupClass() { delete sMutex; - sMutex = NULL; + sMutex = nullptr; } //static @@ -626,7 +626,7 @@ void LLImage::setLastError(const std::string& message) LLImageBase::LLImageBase() : LLTrace::MemTrackable<LLImageBase>("LLImage"), - mData(NULL), + mData(nullptr), mDataSize(0), mWidth(0), mHeight(0), @@ -677,7 +677,7 @@ void LLImageBase::deleteData() ll_aligned_free_16(mData) ; disclaimMem(mDataSize); mDataSize = 0; - mData = NULL; + mData = nullptr; } // virtual @@ -726,7 +726,7 @@ U8* LLImageBase::allocateData(S32 size) { size = 0; mWidth = mHeight = 0; - mData = NULL; + mData = nullptr; } mDataSize = size; claimMem(mDataSize); @@ -741,7 +741,7 @@ U8* LLImageBase::reallocateData(S32 size) if (!new_datap) { LL_WARNS() << "Out of memory in LLImageBase::reallocateData" << LL_ENDL; - return 0; + return nullptr; } if (mData) { @@ -761,7 +761,7 @@ const U8* LLImageBase::getData() const if(mBadBufferAllocation) { LL_WARNS() << "Bad memory allocation for the image buffer!" << LL_ENDL ; - return NULL; + return nullptr; } return mData; @@ -772,7 +772,7 @@ U8* LLImageBase::getData() if(mBadBufferAllocation) { LL_WARNS() << "Bad memory allocation for the image buffer!" << LL_ENDL; - return NULL; + return nullptr; } return mData; @@ -780,7 +780,7 @@ U8* LLImageBase::getData() bool LLImageBase::isBufferInvalid() const { - return mBadBufferAllocation || mData == NULL ; + return mBadBufferAllocation || mData == nullptr ; } void LLImageBase::setSize(S32 width, S32 height, S32 ncomponents) @@ -1443,7 +1443,7 @@ bool LLImageRaw::scale( S32 new_width, S32 new_height, bool scale_image_data ) if (new_data_size > 0) { U8 *new_data = (U8*)ll_aligned_malloc_16(new_data_size); - if(NULL == new_data) + if(nullptr == new_data) { return false; } @@ -1924,7 +1924,7 @@ LLImageFormatted* LLImageFormatted::createFromType(S8 codec) image = new LLImageDXT(); break; default: - image = NULL; + image = nullptr; break; } return image; @@ -2100,7 +2100,7 @@ bool LLImageFormatted::load(const std::string &filename, int load_size) S32 file_size = 0; LLAPRFile infile ; - infile.open(filename, LL_APR_RB, NULL, &file_size); + infile.open(filename, LL_APR_RB, nullptr, &file_size); apr_file_t* apr_file = infile.getFileHandle(); if (!apr_file) { diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index b09a3932b436084802602b3efbb9a6b3431c68b4..176bf01cc54c108354f356153ada9b7cb0d070e9 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -187,9 +187,9 @@ public: // Construct using createFromFile (used by tools) //LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only = false); - /*virtual*/ void deleteData(); - /*virtual*/ U8* allocateData(S32 size = -1); - /*virtual*/ U8* reallocateData(S32 size); + /*virtual*/ void deleteData() override; + /*virtual*/ U8* allocateData(S32 size = -1) override; + /*virtual*/ U8* reallocateData(S32 size) override; bool resize(U16 width, U16 height, S8 components); @@ -292,12 +292,12 @@ public: LLImageFormatted(S8 codec); // LLImageBase - /*virtual*/ void deleteData(); - /*virtual*/ U8* allocateData(S32 size = -1); - /*virtual*/ U8* reallocateData(S32 size); + /*virtual*/ void deleteData() override; + /*virtual*/ U8* allocateData(S32 size = -1) override; + /*virtual*/ U8* reallocateData(S32 size) override; - /*virtual*/ void dump(); - /*virtual*/ void sanityCheck(); + /*virtual*/ void dump() override; + /*virtual*/ void sanityCheck() override; // New methods // subclasses must return a prefered file extension (lowercase without a leading dot) diff --git a/indra/llimage/llimagebmp.cpp b/indra/llimage/llimagebmp.cpp index 27631d2fcd7217c49518f11807a33102aee3f671..ea9d1b9701df98193ca8945c4e7d3056075a6c67 100644 --- a/indra/llimage/llimagebmp.cpp +++ b/indra/llimage/llimagebmp.cpp @@ -77,7 +77,7 @@ LLImageBMP::LLImageBMP() : LLImageFormatted(IMG_CODEC_BMP), mColorPaletteColors( 0 ), - mColorPalette( NULL ), + mColorPalette(nullptr ), mBitmapOffset( 0 ), mBitsPerPixel( 0 ), mOriginAtTop( false ) diff --git a/indra/llimage/llimagebmp.h b/indra/llimage/llimagebmp.h index 6a5fa4697d10872ad323f80f9ffe770ed4fb843e..84d8be92b294c3abe89b16ce0f996ca1b78aa956 100644 --- a/indra/llimage/llimagebmp.h +++ b/indra/llimage/llimagebmp.h @@ -39,10 +39,10 @@ protected: public: LLImageBMP(); - /*virtual*/ std::string getExtension() { return std::string("bmp"); } - /*virtual*/ bool updateData(); - /*virtual*/ bool decode(LLImageRaw* raw_image, F32 decode_time); - /*virtual*/ bool encode(const LLImageRaw* raw_image, F32 encode_time); + /*virtual*/ std::string getExtension() override { return std::string("bmp"); } + /*virtual*/ bool updateData() override; + /*virtual*/ bool decode(LLImageRaw* raw_image, F32 decode_time) override; + /*virtual*/ bool encode(const LLImageRaw* raw_image, F32 encode_time) override; protected: bool decodeColorTable8( U8* dst, U8* src ); diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp index 1bb7e31323f18d5e390d50145a6039825709aaab..f2f5bb9e7359f169b60ba2bd5f11926089c76bf4 100644 --- a/indra/llimage/llimagedimensionsinfo.cpp +++ b/indra/llimage/llimagedimensionsinfo.cpp @@ -42,7 +42,7 @@ bool LLImageDimensionsInfo::load(const std::string& src_filename,U32 codec) mSrcFilename = src_filename; S32 file_size = 0; - apr_status_t s = mInfile.open(src_filename, LL_APR_RB, NULL, &file_size); + apr_status_t s = mInfile.open(src_filename, LL_APR_RB, nullptr, &file_size); if (s != APR_SUCCESS) { @@ -166,7 +166,7 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg() sJpegErrorEncountered = false; clean(); FILE *fp = fopen (mSrcFilename.c_str(), "rb"); - if (fp == NULL) + if (fp == nullptr) { setLastError("Unable to open file for reading", mSrcFilename); return false; diff --git a/indra/llimage/llimagedimensionsinfo.h b/indra/llimage/llimagedimensionsinfo.h index 53fe8964e0ef1e0a17d8cc74058a1ae66a11b970..708b822002f18c12fb4bc976c915d7baa3de089d 100644 --- a/indra/llimage/llimagedimensionsinfo.h +++ b/indra/llimage/llimagedimensionsinfo.h @@ -38,7 +38,7 @@ class LLImageDimensionsInfo { public: LLImageDimensionsInfo() - : mData(NULL) + : mData(nullptr) , mWidth(0) , mHeight(0) {} @@ -61,7 +61,7 @@ protected: { mInfile.close(); delete[] mData; - mData = NULL; + mData = nullptr; mWidth = 0; mHeight = 0; } diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp index 4a9941204c742760de5405f410846c8c37d38696..da2f81529f7092f14c0173ce40314ba1755e58cb 100644 --- a/indra/llimage/llimagedxt.cpp +++ b/indra/llimage/llimagedxt.cpp @@ -273,7 +273,7 @@ bool LLImageDXT::decode(LLImageRaw* raw_image, F32 time) S32 width = getWidth(), height = getHeight(); S32 ncomponents = getComponents(); - U8* data = NULL; + U8* data = nullptr; if (mDiscardLevel >= 0) { data = getData() + getMipOffset(mDiscardLevel); @@ -373,7 +373,7 @@ bool LLImageDXT::encodeDXT(const LLImageRaw* raw_image, F32 time, bool explicit_ header->maxwidth = width; header->maxheight = height; - U8* prev_mipdata = 0; + U8* prev_mipdata = nullptr; w = width, h = height; for (S32 mip=0; mip<nmips; mip++) { diff --git a/indra/llimage/llimagedxt.h b/indra/llimage/llimagedxt.h index a4a9bcf99c4b6c5876d843dea5cce41a9ee35fce..ebd23cd60b3a67e01bf5c982302f6947364f09e9 100644 --- a/indra/llimage/llimagedxt.h +++ b/indra/llimage/llimagedxt.h @@ -98,14 +98,14 @@ private: public: LLImageDXT(); - /*virtual*/ std::string getExtension() { return std::string("dxt"); } - /*virtual*/ bool updateData(); + /*virtual*/ std::string getExtension() override { return std::string("dxt"); } + /*virtual*/ bool updateData() override; - /*virtual*/ bool decode(LLImageRaw* raw_image, F32 decode_time); - /*virtual*/ bool encode(const LLImageRaw* raw_image, F32 encode_time); + /*virtual*/ bool decode(LLImageRaw* raw_image, F32 decode_time) override; + /*virtual*/ bool encode(const LLImageRaw* raw_image, F32 encode_time) override; - /*virtual*/ S32 calcHeaderSize(); - /*virtual*/ S32 calcDataSize(S32 discard_level = 0); + /*virtual*/ S32 calcHeaderSize() override; + /*virtual*/ S32 calcDataSize(S32 discard_level = 0) override; bool getMipData(LLPointer<LLImageRaw>& raw, S32 discard=-1); diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 51945299e39aad8e4b24bf1255d9370dece56d8e..7136562aa6fba88506b6566b288016dd802fa7f9 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -42,7 +42,7 @@ LLImageJ2CImpl* fallbackCreateLLImageJ2CImpl(); // Test data gathering handle -LLImageCompressionTester* LLImageJ2C::sTesterp = NULL ; +LLImageCompressionTester* LLImageJ2C::sTesterp = nullptr ; const std::string sTesterName("ImageCompressionTester"); //static @@ -77,7 +77,7 @@ LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C), if (!sTesterp->isValid()) { delete sTesterp; - sTesterp = NULL; + sTesterp = nullptr; } } } @@ -215,7 +215,7 @@ bool LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 fir bool LLImageJ2C::encode(const LLImageRaw *raw_imagep, F32 encode_time) { - return encode(raw_imagep, NULL, encode_time); + return encode(raw_imagep, nullptr, encode_time); } @@ -356,7 +356,7 @@ bool LLImageJ2C::loadAndValidate(const std::string &filename) S32 file_size = 0; LLAPRFile infile ; - infile.open(filename, LL_APR_RB, NULL, &file_size); + infile.open(filename, LL_APR_RB, nullptr, &file_size); apr_file_t* apr_file = infile.getFileHandle() ; if (!apr_file) { @@ -473,7 +473,7 @@ LLImageCompressionTester::LLImageCompressionTester() : LLMetricPerformanceTester LLImageCompressionTester::~LLImageCompressionTester() { outputTestResults(); - LLImageJ2C::sTesterp = NULL; + LLImageJ2C::sTesterp = nullptr; } //virtual diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index 45850a0c245cb53bc97b48a644f63c9f084cf587..e351594b205b712ea494f6346be74b5e4ad3fd91 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -46,18 +46,18 @@ public: LLImageJ2C(); // Base class overrides - /*virtual*/ std::string getExtension() { return std::string("j2c"); } - /*virtual*/ bool updateData(); - /*virtual*/ bool decode(LLImageRaw *raw_imagep, F32 decode_time); - /*virtual*/ bool decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count); - /*virtual*/ bool encode(const LLImageRaw *raw_imagep, F32 encode_time); - /*virtual*/ S32 calcHeaderSize(); - /*virtual*/ S32 calcDataSize(S32 discard_level = 0); - /*virtual*/ S32 calcDiscardLevelBytes(S32 bytes); - /*virtual*/ S8 getRawDiscardLevel(); + /*virtual*/ std::string getExtension() override { return std::string("j2c"); } + /*virtual*/ bool updateData() override; + /*virtual*/ bool decode(LLImageRaw *raw_imagep, F32 decode_time) override; + /*virtual*/ bool decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count) override; + /*virtual*/ bool encode(const LLImageRaw *raw_imagep, F32 encode_time) override; + /*virtual*/ S32 calcHeaderSize() override; + /*virtual*/ S32 calcDataSize(S32 discard_level = 0) override; + /*virtual*/ S32 calcDiscardLevelBytes(S32 bytes) override; + /*virtual*/ S8 getRawDiscardLevel() override; // Override these so that we don't try to set a global variable from a DLL - /*virtual*/ void resetLastError(); - /*virtual*/ void setLastError(const std::string& message, const std::string& filename = std::string()); + /*virtual*/ void resetLastError() override; + /*virtual*/ void setLastError(const std::string& message, const std::string& filename = std::string()) override; bool initDecode(LLImageRaw &raw_image, int discard_level, int* region); bool initEncode(LLImageRaw &raw_image, int blocks_size, int precincts_size, int levels); @@ -121,7 +121,7 @@ protected: virtual bool decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count) = 0; virtual bool encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0, bool reversible=false) = 0; - virtual bool initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = NULL) = 0; + virtual bool initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = nullptr) = 0; virtual bool initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0) = 0; virtual std::string getEngineInfo() const = 0; @@ -148,7 +148,7 @@ class LLImageCompressionTester : public LLMetricPerformanceTesterBasic void updateCompressionStats(const S32 bytesIn, const S32 bytesOut) ; protected: - /*virtual*/ void outputTestRecord(LLSD* sd); + /*virtual*/ void outputTestRecord(LLSD* sd) override; private: // diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp index db10f15b9293e37f8d869a592197bab3a4b15533..c1252c0349df35579fbd8109ec17b607ed8f6a15 100644 --- a/indra/llimage/llimagejpeg.cpp +++ b/indra/llimage/llimagejpeg.cpp @@ -35,7 +35,7 @@ jmp_buf LLImageJPEG::sSetjmpBuffer ; LLImageJPEG::LLImageJPEG(S32 quality) : LLImageFormatted(IMG_CODEC_JPEG), - mOutputBuffer( NULL ), + mOutputBuffer(nullptr ), mOutputBufferSize( 0 ), mEncodeQuality( quality ) // on a scale from 1 to 100 { @@ -91,7 +91,7 @@ bool LLImageJPEG::updateData() //////////////////////////////////////// // Step 2: specify data source // (Code is modified version of jpeg_stdio_src(); - if (cinfo.src == NULL) + if (cinfo.src == nullptr) { cinfo.src = (struct jpeg_source_mgr *) (*cinfo.mem->alloc_small) ((j_common_ptr) &cinfo, JPOOL_PERMANENT, @@ -198,7 +198,7 @@ bool LLImageJPEG::decode(LLImageRaw* raw_image, F32 decode_time) } S32 row_stride = 0; - U8* raw_image_data = NULL; + U8* raw_image_data = nullptr; //////////////////////////////////////// // Step 1: allocate and initialize JPEG decompression object @@ -232,7 +232,7 @@ bool LLImageJPEG::decode(LLImageRaw* raw_image, F32 decode_time) //////////////////////////////////////// // Step 2: specify data source // (Code is modified version of jpeg_stdio_src(); - if (cinfo.src == NULL) + if (cinfo.src == nullptr) { cinfo.src = (struct jpeg_source_mgr *) (*cinfo.mem->alloc_small) ((j_common_ptr) &cinfo, JPOOL_PERMANENT, @@ -502,7 +502,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time ) claimMem(mOutputBufferSize); mOutputBuffer = new U8[ mOutputBufferSize ]; - const U8* raw_image_data = NULL; + const U8* raw_image_data = nullptr; S32 row_stride = 0; //////////////////////////////////////// @@ -535,7 +535,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time ) // We need to clean up the JPEG object, close the input file, and return. jpeg_destroy_compress(&cinfo); delete[] mOutputBuffer; - mOutputBuffer = NULL; + mOutputBuffer = nullptr; disclaimMem(mOutputBufferSize); mOutputBufferSize = 0; return false; @@ -550,7 +550,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time ) //////////////////////////////////////// // Step 2: specify data destination // (code is a modified form of jpeg_stdio_dest() ) - if( cinfo.dest == NULL) + if( cinfo.dest == nullptr) { cinfo.dest = (struct jpeg_destination_mgr *) (*cinfo.mem->alloc_small) ((j_common_ptr) &cinfo, JPOOL_PERMANENT, @@ -638,7 +638,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time ) // After finish_compress, we can release the temp output buffer. delete[] mOutputBuffer; - mOutputBuffer = NULL; + mOutputBuffer = nullptr; disclaimMem(mOutputBufferSize); mOutputBufferSize = 0; @@ -651,7 +651,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time ) { jpeg_destroy_compress(&cinfo); delete[] mOutputBuffer; - mOutputBuffer = NULL; + mOutputBuffer = nullptr; disclaimMem(mOutputBufferSize); mOutputBufferSize = 0; return false; diff --git a/indra/llimage/llimagejpeg.h b/indra/llimage/llimagejpeg.h index 7a849a84212aa8f43123baf41dd2e3029cf2cef0..8dc0c561a4d97d0056ec2ee7d738112811f68ec8 100644 --- a/indra/llimage/llimagejpeg.h +++ b/indra/llimage/llimagejpeg.h @@ -50,10 +50,10 @@ protected: public: LLImageJPEG(S32 quality = 75); - /*virtual*/ std::string getExtension() { return std::string("jpg"); } - /*virtual*/ bool updateData(); - /*virtual*/ bool decode(LLImageRaw* raw_image, F32 decode_time); - /*virtual*/ bool encode(const LLImageRaw* raw_image, F32 encode_time); + /*virtual*/ std::string getExtension() override { return std::string("jpg"); } + /*virtual*/ bool updateData() override; + /*virtual*/ bool decode(LLImageRaw* raw_image, F32 decode_time) override; + /*virtual*/ bool encode(const LLImageRaw* raw_image, F32 encode_time) override; void setEncodeQuality( S32 q ) { mEncodeQuality = q; } // on a scale from 1 to 100 S32 getEncodeQuality() { return mEncodeQuality; } diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp index 0b3655fa3f2edf6a7ae504bcea52d7ad3a9741ed..756fae5cfb9e293b9a3f8297631d86d1f903ccf0 100644 --- a/indra/llimage/llimagepng.cpp +++ b/indra/llimage/llimagepng.cpp @@ -69,7 +69,7 @@ bool LLImagePNG::updateData() } LLPngWrapper::ImageInfo infop; - if (! pngWrapper.readPng(getData(), getDataSize(), NULL, &infop)) + if (! pngWrapper.readPng(getData(), getDataSize(), nullptr, &infop)) { setLastError(pngWrapper.getErrorMessage()); return false; diff --git a/indra/llimage/llimagepng.h b/indra/llimage/llimagepng.h index ef16f2996f9a533fff0b4a88ad8ea0dc84184605..3a0db6aa942c5a1c0aaac180f8d618dd5e1cabe3 100644 --- a/indra/llimage/llimagepng.h +++ b/indra/llimage/llimagepng.h @@ -37,10 +37,10 @@ protected: public: LLImagePNG(); - /*virtual*/ std::string getExtension() { return std::string("png"); } - /*virtual*/ bool updateData(); - /*virtual*/ bool decode(LLImageRaw* raw_image, F32 decode_time); - /*virtual*/ bool encode(const LLImageRaw* raw_image, F32 encode_time); + /*virtual*/ std::string getExtension() override { return std::string("png"); } + /*virtual*/ bool updateData() override; + /*virtual*/ bool decode(LLImageRaw* raw_image, F32 decode_time) override; + /*virtual*/ bool encode(const LLImageRaw* raw_image, F32 encode_time) override; }; #endif diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp index f86bd08dcec6eaed7cbbda5efd976c501176faf5..5b70c04a80830a9e98234c9837501897a2ea2b8a 100644 --- a/indra/llimage/llimagetga.cpp +++ b/indra/llimage/llimagetga.cpp @@ -91,7 +91,7 @@ LLImageTGA::LLImageTGA() LLImageTGA::LLImageTGA(const std::string& file_name) : LLImageFormatted(IMG_CODEC_TGA), - mColorMap( NULL ), + mColorMap(nullptr ), mColorMapStart( 0 ), mColorMapLength( 0 ), mColorMapBytesPerEntry( 0 ), diff --git a/indra/llimage/llimagetga.h b/indra/llimage/llimagetga.h index b1f34dcdaddf1f90e974fe6d3579021f49d02afb..5f2d3f426e074dacaa212ce3bfb51f653df2683f 100644 --- a/indra/llimage/llimagetga.h +++ b/indra/llimage/llimagetga.h @@ -40,10 +40,10 @@ public: LLImageTGA(); LLImageTGA(const std::string& file_name); - /*virtual*/ std::string getExtension() { return std::string("tga"); } - /*virtual*/ bool updateData(); - /*virtual*/ bool decode(LLImageRaw* raw_image, F32 decode_time=0.0); - /*virtual*/ bool encode(const LLImageRaw* raw_image, F32 encode_time=0.0); + /*virtual*/ std::string getExtension() override { return std::string("tga"); } + /*virtual*/ bool updateData() override; + /*virtual*/ bool decode(LLImageRaw* raw_image, F32 decode_time=0.0) override; + /*virtual*/ bool encode(const LLImageRaw* raw_image, F32 encode_time=0.0) override; bool decodeAndProcess(LLImageRaw* raw_image, F32 domain, F32 weight); diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index c9cf54a1d2c0ddc380be8c19512efc567b43ce83..50f501c684721e9042ba0473fc24b11c94373caa 100644 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -109,9 +109,9 @@ LLImageDecodeThread::ImageRequest::ImageRequest(handle_t handle, LLImageFormatte LLImageDecodeThread::ImageRequest::~ImageRequest() { - mDecodedImageRaw = NULL; - mDecodedImageAux = NULL; - mFormattedImage = NULL; + mDecodedImageRaw = nullptr; + mDecodedImageAux = nullptr; + mFormattedImage = nullptr; } //---------------------------------------------------------------------------- diff --git a/indra/llimage/llimageworker.h b/indra/llimage/llimageworker.h index 1bfb0ddfd3f28ca36ff3dd1b760a61dd7cff32fa..7e1603f8028cd9e9ad4671888dcc3548fa102c2e 100644 --- a/indra/llimage/llimageworker.h +++ b/indra/llimage/llimageworker.h @@ -52,8 +52,8 @@ public: U32 priority, S32 discard, BOOL needs_aux, LLImageDecodeThread::Responder* responder); - /*virtual*/ bool processRequest(); - /*virtual*/ void finishRequest(bool completed); + /*virtual*/ bool processRequest() override; + /*virtual*/ void finishRequest(bool completed) override; // Used by unit tests to check the consitency of the request instance bool tut_isOK(); @@ -78,7 +78,7 @@ public: handle_t decodeImage(LLImageFormatted* image, U32 priority, S32 discard, BOOL needs_aux, Responder* responder); - S32 update(F32 max_time_ms); + S32 update(F32 max_time_ms) override; // Used by unit tests to check the consistency of the thread instance S32 tut_size(); diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp index 06cd7cac15fa53accff2f1c42b76baa8c9fe3e9f..3d5282c081b76135e892c0fbd553f0006553ce49 100644 --- a/indra/llimage/llpngwrapper.cpp +++ b/indra/llimage/llpngwrapper.cpp @@ -48,11 +48,11 @@ struct PngError: public LLContinueError // --------------------------------------------------------------------------- LLPngWrapper::LLPngWrapper() - : mReadPngPtr( NULL ), - mReadInfoPtr( NULL ), - mWritePngPtr( NULL ), - mWriteInfoPtr( NULL ), - mRowPointers( NULL ), + : mReadPngPtr(nullptr ), + mReadInfoPtr(nullptr ), + mWritePngPtr(nullptr ), + mWriteInfoPtr(nullptr ), + mRowPointers(nullptr ), mWidth( 0 ), mHeight( 0 ), mBitDepth( 0 ), @@ -144,8 +144,8 @@ BOOL LLPngWrapper::readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInf { // Create and initialize the png structures mReadPngPtr = png_create_read_struct(PNG_LIBPNG_VER_STRING, - this, &errorHandler, NULL); - if (mReadPngPtr == NULL) + this, &errorHandler, nullptr); + if (mReadPngPtr == nullptr) { LLTHROW(PngError("Problem creating png read structure")); } @@ -175,7 +175,7 @@ BOOL LLPngWrapper::readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInf // If a raw object is supplied, read the PNG image into its // data space - if (rawImage != NULL) + if (rawImage != nullptr) { rawImage->resize(static_cast<U16>(mWidth), static_cast<U16>(mHeight), mChannels); @@ -192,11 +192,11 @@ BOOL LLPngWrapper::readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInf png_read_image(mReadPngPtr, mRowPointers); // Finish up, ensures all metadata are updated - png_read_end(mReadPngPtr, NULL); + png_read_end(mReadPngPtr, nullptr); } // If an info object is supplied, copy the relevant info - if (infop != NULL) + if (infop != nullptr) { infop->mHeight = static_cast<U16>(mHeight); infop->mWidth = static_cast<U16>(mWidth); @@ -307,7 +307,7 @@ BOOL LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest, size_t destSiz } mWritePngPtr = png_create_write_struct(PNG_LIBPNG_VER_STRING, - NULL, &errorHandler, NULL); + nullptr, &errorHandler, nullptr); if (!mWritePngPtr) { LLTHROW(PngError("Problem creating png write structure")); @@ -371,22 +371,22 @@ void LLPngWrapper::releaseResources() { if (mReadPngPtr || mReadInfoPtr) { - png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, NULL); - mReadPngPtr = NULL; - mReadInfoPtr = NULL; + png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, nullptr); + mReadPngPtr = nullptr; + mReadInfoPtr = nullptr; } if (mWritePngPtr || mWriteInfoPtr) { png_destroy_write_struct(&mWritePngPtr, &mWriteInfoPtr); - mWritePngPtr = NULL; - mWriteInfoPtr = NULL; + mWritePngPtr = nullptr; + mWriteInfoPtr = nullptr; } if (mRowPointers) { delete[] mRowPointers; - mRowPointers = NULL; + mRowPointers = nullptr; } } diff --git a/indra/llimage/llpngwrapper.h b/indra/llimage/llpngwrapper.h index 983a59e1300b4680d94933dfa69db1259b283bf2..8bc3097aed2eee6c2e0675dfc267508833082806 100644 --- a/indra/llimage/llpngwrapper.h +++ b/indra/llimage/llpngwrapper.h @@ -44,7 +44,7 @@ public: }; BOOL isValidPng(U8* src); - BOOL readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInfo *infop = NULL); + BOOL readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInfo *infop = nullptr); BOOL writePng(const LLImageRaw* rawImage, U8* dst, size_t destSize); U32 getFinalSize(); const std::string& getErrorMessage(); diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 68a39b8246f898b2b7059992ac07f408198e46d5..3d2cd91dd8a61f510733687b700ecd56ff7f9cb0 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -160,10 +160,10 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod opj_dparameters_t parameters; /* decompression parameters */ opj_event_mgr_t event_mgr = { }; /* event manager */ - opj_image_t *image = NULL; + opj_image_t *image = nullptr; - opj_dinfo_t* dinfo = NULL; /* handle to a decompressor */ - opj_cio_t *cio = NULL; + opj_dinfo_t* dinfo = nullptr; /* handle to a decompressor */ + opj_cio_t *cio = nullptr; /* configure the event callbacks (not required) */ @@ -359,7 +359,7 @@ bool LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con // OPJ_COLOR_SPACE color_space = CLRSPC_SRGB; opj_image_cmptparm_t cmptparm[MAX_COMPS]; - opj_image_t * image = NULL; + opj_image_t * image = nullptr; S32 numcomps = raw_image.getComponents(); S32 width = raw_image.getWidth(); S32 height = raw_image.getHeight(); @@ -403,7 +403,7 @@ bool LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con /* ---------------------------- */ int codestream_length; - opj_cio_t *cio = NULL; + opj_cio_t *cio = nullptr; /* get a J2K compressor handle */ opj_cinfo_t* cinfo = opj_create_compress(CODEC_J2K); @@ -416,10 +416,10 @@ bool LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con /* open a byte stream for writing */ /* allocate memory for all tiles */ - cio = opj_cio_open((opj_common_ptr)cinfo, NULL, 0); + cio = opj_cio_open((opj_common_ptr)cinfo, nullptr, 0); /* encode the image */ - bool bSuccess = opj_encode(cinfo, cio, image, NULL); + bool bSuccess = opj_encode(cinfo, cio, image, nullptr); if (!bSuccess) { opj_cio_close(cio); @@ -526,10 +526,10 @@ bool LLImageJ2COJ::getMetadata(LLImageJ2C &base) opj_dparameters_t parameters; /* decompression parameters */ opj_event_mgr_t event_mgr = { }; /* event manager */ - opj_image_t *image = NULL; + opj_image_t *image = nullptr; - opj_dinfo_t* dinfo = NULL; /* handle to a decompressor */ - opj_cio_t *cio = NULL; + opj_dinfo_t* dinfo = nullptr; /* handle to a decompressor */ + opj_cio_t *cio = nullptr; /* configure the event callbacks (not required) */ diff --git a/indra/llimagej2coj/llimagej2coj.h b/indra/llimagej2coj/llimagej2coj.h index 5c6193944e3222a062090e06fec90b458dcee6a8..a4adcca6949b3632cdeac5e9f73a6162792b0073 100644 --- a/indra/llimagej2coj/llimagej2coj.h +++ b/indra/llimagej2coj/llimagej2coj.h @@ -35,13 +35,13 @@ public: LLImageJ2COJ(); virtual ~LLImageJ2COJ(); protected: - virtual bool getMetadata(LLImageJ2C &base); - virtual bool decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count); - virtual bool encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0, - bool reversible = false); - virtual bool initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = NULL); - virtual bool initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0); - virtual std::string getEngineInfo() const; + bool getMetadata(LLImageJ2C &base) override; + bool decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count) override; + bool encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0, + bool reversible = false) override; + bool initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = nullptr) override; + bool initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0) override; + std::string getEngineInfo() const override; }; #endif diff --git a/indra/llinventory/llcategory.cpp b/indra/llinventory/llcategory.cpp index 4c283243a292fb51932a72c7d15858f7822e009f..62888e516dc72f2eed5fcfcdeb91f8d4050d80c6 100644 --- a/indra/llinventory/llcategory.cpp +++ b/indra/llinventory/llcategory.cpp @@ -68,7 +68,7 @@ const char* CATEGORY_NAME[] = "Sound", "Landmark", "Component", // object - NULL + nullptr }; ///---------------------------------------------------------------------------- diff --git a/indra/llinventory/lleconomy.h b/indra/llinventory/lleconomy.h index cdfde171c1834371f9af16ecce60999935577252..0adbd3b07496f63ddb737e124dbdcefe9c0a0ae6 100644 --- a/indra/llinventory/lleconomy.h +++ b/indra/llinventory/lleconomy.h @@ -115,7 +115,7 @@ public: static void processEconomyData(LLMessageSystem *msg, void **user_data); static void processEconomyDataRequest(LLMessageSystem *msg, void **user_data); - void print(); + void print() override; BOOL hasData() const; F32 getPriceObjectRent() const { return mPriceObjectRent; } diff --git a/indra/llinventory/llfoldertype.cpp b/indra/llinventory/llfoldertype.cpp index fdc4eef8c4e8f5c9ce01eb08daaf6c34466fa67b..75add91e9faacf2595e0410b160615ba973e961a 100644 --- a/indra/llinventory/llfoldertype.cpp +++ b/indra/llinventory/llfoldertype.cpp @@ -55,7 +55,7 @@ class LLFolderDictionary : public LLSingleton<LLFolderDictionary>, { LLSINGLETON(LLFolderDictionary); protected: - virtual LLFolderType::EType notFound() const + LLFolderType::EType notFound() const override { return LLFolderType::FT_NONE; } diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index af99af6f91ef58b3656fd1e2dbb50c5ebec06228..513f00d56bb3c11210766bd182ad6a70ad21c9e2 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -623,7 +623,7 @@ BOOL LLInventoryItem::importFile(LLFILE* fp) mAssetUUID.setNull(); while(success && (!feof(fp))) { - if (fgets(buffer, MAX_STRING, fp) == NULL) + if (fgets(buffer, MAX_STRING, fp) == nullptr) { buffer[0] = '\0'; } @@ -1276,7 +1276,7 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size) // Early exit on an empty binary bucket. if (bin_bucket_size <= 1) return; - if (NULL == bin_bucket) + if (nullptr == bin_bucket) { LL_ERRS() << "unpackBinaryBucket failed. bin_bucket is NULL." << LL_ENDL; return; @@ -1316,11 +1316,11 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size) LLUUID owner_id((*(iter++)).c_str()); LLUUID last_owner_id((*(iter++)).c_str()); LLUUID group_id((*(iter++)).c_str()); - PermissionMask mask_base = strtoul((*(iter++)).c_str(), NULL, 16); - PermissionMask mask_owner = strtoul((*(iter++)).c_str(), NULL, 16); - PermissionMask mask_group = strtoul((*(iter++)).c_str(), NULL, 16); - PermissionMask mask_every = strtoul((*(iter++)).c_str(), NULL, 16); - PermissionMask mask_next = strtoul((*(iter++)).c_str(), NULL, 16); + PermissionMask mask_base = strtoul((*(iter++)).c_str(), nullptr, 16); + PermissionMask mask_owner = strtoul((*(iter++)).c_str(), nullptr, 16); + PermissionMask mask_group = strtoul((*(iter++)).c_str(), nullptr, 16); + PermissionMask mask_every = strtoul((*(iter++)).c_str(), nullptr, 16); + PermissionMask mask_next = strtoul((*(iter++)).c_str(), nullptr, 16); LLPermissions perm; perm.init(creator_id, owner_id, last_owner_id, group_id); perm.initMasks(mask_base, mask_owner, mask_group, mask_every, mask_next); @@ -1339,10 +1339,10 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size) LLSaleInfo sale_info(sale_type, price); setSaleInfo(sale_info); - U32 flags = strtoul((*(iter++)).c_str(), NULL, 16); + U32 flags = strtoul((*(iter++)).c_str(), nullptr, 16); setFlags(flags); - time_t now = time(NULL); + time_t now = time(nullptr); setCreationDate(now); } @@ -1483,7 +1483,7 @@ BOOL LLInventoryCategory::importFile(LLFILE* fp) valuestr[0] = '\0'; while(!feof(fp)) { - if (fgets(buffer, MAX_STRING, fp) == NULL) + if (fgets(buffer, MAX_STRING, fp) == nullptr) { buffer[0] = '\0'; } diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index 2e921f2b04662283cd2d7a1967bd84d23200bcbe..1b2bb5530679d6598f6a9fba7a906e5b68514752 100644 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -153,7 +153,7 @@ protected: // Accessors //-------------------------------------------------------------------- public: - virtual const LLUUID& getLinkedUUID() const; + const LLUUID& getLinkedUUID() const override; virtual const LLPermissions& getPermissions() const; virtual const LLUUID& getCreatorUUID() const; virtual const LLUUID& getAssetUUID() const; @@ -162,7 +162,7 @@ public: virtual const LLSaleInfo& getSaleInfo() const; virtual LLInventoryType::EType getInventoryType() const; virtual U32 getFlags() const; - virtual time_t getCreationDate() const; + time_t getCreationDate() const override; virtual U32 getCRC32() const; // really more of a checksum. //-------------------------------------------------------------------- @@ -198,16 +198,16 @@ public: //-------------------------------------------------------------------- public: virtual BOOL importFile(LLFILE* fp); - virtual BOOL exportFile(LLFILE* fp, BOOL include_asset_key = TRUE) const; - virtual BOOL importLegacyStream(std::istream& input_stream); - virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const; + BOOL exportFile(LLFILE* fp, BOOL include_asset_key = TRUE) const override; + BOOL importLegacyStream(std::istream& input_stream) override; + BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const override; //-------------------------------------------------------------------- // Helper Functions //-------------------------------------------------------------------- public: // Pack all information needed to reconstruct this item into the given binary bucket. - S32 packBinaryBucket(U8* bin_bucket, LLPermissions* perm_override = NULL) const; + S32 packBinaryBucket(U8* bin_bucket, LLPermissions* perm_override = nullptr) const; void unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size); LLSD asLLSD() const; void asLLSD( LLSD& sd ) const; @@ -271,9 +271,9 @@ public: //-------------------------------------------------------------------- public: virtual BOOL importFile(LLFILE* fp); - virtual BOOL exportFile(LLFILE* fp, BOOL include_asset_key = TRUE) const; - virtual BOOL importLegacyStream(std::istream& input_stream); - virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const; + BOOL exportFile(LLFILE* fp, BOOL include_asset_key = TRUE) const override; + BOOL importLegacyStream(std::istream& input_stream) override; + BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const override; //-------------------------------------------------------------------- // Member Variables diff --git a/indra/llinventory/lllandmark.cpp b/indra/llinventory/lllandmark.cpp index 77bf33adea71305cffd4e9076e059e13ac05d6b7..939185794620b8a6798ac30b32b244bbb635b533 100644 --- a/indra/llinventory/lllandmark.cpp +++ b/indra/llinventory/lllandmark.cpp @@ -158,7 +158,7 @@ LLLandmark* LLLandmark::constructFromString(const char *buffer) error: LL_INFOS() << "Bad Landmark Asset: bad _DATA_ block." << LL_ENDL; - return NULL; + return nullptr; } diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index 97f4c432b45dd966d1cd44ddca9b078fcd6ff6d1..b1ceffcaede46d387af8d6f36a375c311025b1a1 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -992,7 +992,7 @@ void LLParcel::startSale(const LLUUID& buyer_id, BOOL is_buyer_group) mSaleTimerExpires.start(); mSaleTimerExpires.setTimerExpirySec(U64Microseconds(DEFAULT_USEC_SALE_TIMEOUT)); mStatus = OS_LEASE_PENDING; - mClaimDate = time(NULL); + mClaimDate = time(nullptr); setAuctionID(0); // clear the autoreturn whenever land changes hands setCleanOtherTime(0); diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp index 6fcbef314e55a0476aab89a0f80d7e44c51e1565..ed4c75df97a00028576814af66752317c5326e3a 100644 --- a/indra/llinventory/llpermissions.cpp +++ b/indra/llinventory/llpermissions.cpp @@ -589,7 +589,7 @@ BOOL LLPermissions::importFile(LLFILE* fp) while (!feof(fp)) { - if (fgets(buffer, BUFSIZE, fp) == NULL) + if (fgets(buffer, BUFSIZE, fp) == nullptr) { buffer[0] = '\0'; } diff --git a/indra/llinventory/llsaleinfo.cpp b/indra/llinventory/llsaleinfo.cpp index 24851393a293212b5e283b4856e0364fe6e27258..e292fda15d6b10feb16543260c34a7f234f7ac06 100644 --- a/indra/llinventory/llsaleinfo.cpp +++ b/indra/llinventory/llsaleinfo.cpp @@ -149,7 +149,7 @@ BOOL LLSaleInfo::importFile(LLFILE* fp, BOOL& has_perm_mask, U32& perm_mask) valuestr[0] = '\0'; while(success && (!feof(fp))) { - if (fgets(buffer, MAX_STRING, fp) == NULL) + if (fgets(buffer, MAX_STRING, fp) == nullptr) { buffer[0] = '\0'; } @@ -327,7 +327,7 @@ const char* LLSaleInfo::lookup(EForSale type) } else { - return NULL; + return nullptr; } } diff --git a/indra/llmath/llcalc.cpp b/indra/llmath/llcalc.cpp index b3f40c2058b7a6f4ea3cc353fbd75b8342b28ab8..be4a8a76e91bcf4ab5d2f2a807f389beccf04e65 100644 --- a/indra/llmath/llcalc.cpp +++ b/indra/llmath/llcalc.cpp @@ -70,7 +70,7 @@ const char* LLCalc::TEX_ROTATION = "trot"; const char* LLCalc::TEX_TRANSPARENCY = "trns"; const char* LLCalc::TEX_GLOW = "glow"; -LLCalc* LLCalc::sInstance = NULL; +LLCalc* LLCalc::sInstance = nullptr; //TODO: Make this a static global class LLCalc::LLCalc() : mLastErrorPos(0) @@ -95,7 +95,7 @@ LLCalc::~LLCalc() void LLCalc::cleanUp() { delete sInstance; - sInstance = NULL; + sInstance = nullptr; } //static diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h index 321b8ddcc43799d136716010cacd5a857ee27349..7083c6d495f20097bac6e913865933b8452ec851 100644 --- a/indra/llmath/llcamera.h +++ b/indra/llmath/llcamera.h @@ -203,9 +203,9 @@ public: S32 sphereInFrustum(const LLVector3 ¢er, const F32 radius) const; S32 pointInFrustum(const LLVector3 &point) const { return sphereInFrustum(point, 0.0f); } S32 sphereInFrustumFull(const LLVector3 ¢er, const F32 radius) const { return sphereInFrustum(center, radius); } - S32 AABBInFrustum(const LLVector4a& center, const LLVector4a& radius, const LLPlane* planes = NULL); + S32 AABBInFrustum(const LLVector4a& center, const LLVector4a& radius, const LLPlane* planes = nullptr); S32 AABBInRegionFrustum(const LLVector4a& center, const LLVector4a& radius); - S32 AABBInFrustumNoFarClip(const LLVector4a& center, const LLVector4a& radius, const LLPlane* planes = NULL); + S32 AABBInFrustumNoFarClip(const LLVector4a& center, const LLVector4a& radius, const LLPlane* planes = nullptr); S32 AABBInRegionFrustumNoFarClip(const LLVector4a& center, const LLVector4a& radius); //does a quick 'n dirty sphere-sphere check diff --git a/indra/llmath/llinterp.h b/indra/llmath/llinterp.h index 518764617961e86949169d104f233a482766f38f..6653aded7905f33bc704cd53c8347f2c755f5649 100644 --- a/indra/llmath/llinterp.h +++ b/indra/llmath/llinterp.h @@ -88,7 +88,7 @@ template <typename Type> class LLInterpLinear : public LLInterp<Type> { public: - /*virtual*/ void start(); + /*virtual*/ void start() override; void update(const F32 time); F32 getCurFrac() const; protected: @@ -108,7 +108,7 @@ class LLInterpAttractor : public LLInterp<Type> { public: LLInterpAttractor(); - /*virtual*/ void start(); + /*virtual*/ void start() override; void setStartVel(const Type &vel); void setForce(const F32 force); void update(const F32 time); @@ -363,7 +363,7 @@ template <class Type> LLInterpFunc<Type>::LLInterpFunc() : LLInterp<Type>() { mFunc = NULL; - mData = NULL; + mData = nullptr; } template <class Type> diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index d99301410bbacc50e663671d78afe4c6b6d8f556..d6af1cb213f6f6bc43fee063b07ad00c21bfa75a 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -75,7 +75,7 @@ template <class T> class LLOctreeTravelerDepthFirst : public LLOctreeTraveler<T> { public: - virtual void traverse(const LLOctreeNode<T>* node); + void traverse(const LLOctreeNode<T>* node) override; virtual ~LLOctreeTravelerDepthFirst() {} }; @@ -241,7 +241,7 @@ public: bool contains(F32 radius) { - if (mParent == NULL) + if (mParent == nullptr) { //root node contains nothing return false; } @@ -342,10 +342,10 @@ public: return node; } - - virtual bool insert(T* data) + + bool insert(T* data) override { - if (data == NULL || data->getBinIndex() != -1) + if (data == nullptr || data->getBinIndex() != -1) { OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE BRANCH !!!" << LL_ENDL; return false; @@ -369,7 +369,7 @@ public: else { //find a child to give it to - oct_node* child = NULL; + oct_node* child = nullptr; for (U32 i = 0; i < getChildCount(); ++i) { child = getChild(i); @@ -467,7 +467,7 @@ public: checkAlive(); } - bool remove(T* data) + bool remove(T* data) override { S32 i = data->getBinIndex(); @@ -499,7 +499,7 @@ public: oct_node* parent = getOctParent(); oct_node* node = this; - while (parent != NULL) + while (parent != nullptr) { node = parent; parent = node->getOctParent(); @@ -729,7 +729,7 @@ public: } #endif - bool balance() + bool balance() override { if (this->getChildCount() == 1 && !(this->mChild[0]->isLeaf()) && @@ -763,9 +763,9 @@ public: } // LLOctreeRoot::insert - bool insert(T* data) + bool insert(T* data) override { - if (data == NULL) + if (data == nullptr) { OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE ROOT !!!" << LL_ENDL; return false; diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index 1bf1ad3176f5bfa840f2225a13a29a424ed301c4..2cde47ca33a1bc78471df661dbeee7a53dcd2e9e 100644 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp @@ -787,7 +787,7 @@ LLQuaternion mayaQ(F32 xRot, F32 yRot, F32 zRot, LLQuaternion::Order order) const char *OrderToString( const LLQuaternion::Order order ) { - const char *p = NULL; + const char *p = nullptr; switch( order ) { default: @@ -938,7 +938,7 @@ void LLQuaternion::unpackFromVector3( const LLVector3& vec ) BOOL LLQuaternion::parseQuat(const std::string& buf, LLQuaternion* value) { - if( buf.empty() || value == NULL) + if( buf.empty() || value == nullptr) { return FALSE; } diff --git a/indra/llmath/lltreenode.h b/indra/llmath/lltreenode.h index 0b479c4564fe6aa4946e87400b83e9985a5650d6..b26070752182c75dfe38b0d5384ee2aa81d5aea6 100644 --- a/indra/llmath/lltreenode.h +++ b/indra/llmath/lltreenode.h @@ -63,7 +63,7 @@ public: { return mListeners[index]; } - return NULL; + return nullptr; } virtual void addListener(LLTreeListener<T>* listener) { mListeners.push_back(listener); } diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h index b3447788ab5f8da738c55a754e89170ff9d314fd..dd1a71efe9528fea7f7ac6a65f2f25976827f800 100644 --- a/indra/llmath/llvector4a.h +++ b/indra/llmath/llvector4a.h @@ -243,7 +243,7 @@ public: // Normalize this vector with respect to the x, y, and z components only. Accurate only to 10-12 bits of precision. W component is destroyed // Same as above except substitutes default vector contents if the vector is non-finite or degenerate due to zero length. // - inline void normalize3fast_checked(LLVector4a* d = 0); + inline void normalize3fast_checked(LLVector4a* d = nullptr); // Return true if this vector is normalized with respect to x,y,z up to tolerance inline LLBool32 isNormalized3( F32 tolerance = 1e-3 ) const; diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index c791e4662fac93f6e3f6bc57cb72d5eef74e2050..c6ceaefcbe34326a9fb5dcd474e52bb544981e7c 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -383,7 +383,7 @@ public: mFace = face; } - virtual void visit(const LLOctreeNode<LLVolumeTriangle>* branch) + void visit(const LLOctreeNode<LLVolumeTriangle>* branch) override { //this is a depth first traversal, so it's safe to assum all children have complete //bounding data @@ -1109,7 +1109,7 @@ BOOL LLProfileParams::importFile(LLFILE *fp) while (!feof(fp)) { - if (fgets(buffer, BUFSIZE, fp) == NULL) + if (fgets(buffer, BUFSIZE, fp) == nullptr) { buffer[0] = '\0'; } @@ -1709,7 +1709,7 @@ BOOL LLPathParams::importFile(LLFILE *fp) while (!feof(fp)) { - if (fgets(buffer, BUFSIZE, fp) == NULL) + if (fgets(buffer, BUFSIZE, fp) == nullptr) { buffer[0] = '\0'; } @@ -2052,8 +2052,8 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge mSurfaceArea = 1.f; //only calculated for sculpts, defaults to 1 for all other prims mIsMeshAssetLoaded = FALSE; mLODScaleBias.setVec(1,1,1); - mHullPoints = NULL; - mHullIndices = NULL; + mHullPoints = nullptr; + mHullIndices = nullptr; mNumHullPoints = 0; mNumHullIndices = 0; @@ -2105,14 +2105,14 @@ LLVolume::~LLVolume() delete mProfilep; profile_delete_lock.fetch_sub(1); - mPathp = NULL; - mProfilep = NULL; + mPathp = nullptr; + mProfilep = nullptr; mVolumeFaces.clear(); ll_aligned_free_16(mHullPoints); - mHullPoints = NULL; + mHullPoints = nullptr; ll_aligned_free_16(mHullIndices); - mHullIndices = NULL; + mHullIndices = nullptr; } BOOL LLVolume::generate() @@ -2232,13 +2232,13 @@ void LLVolumeFace::VertexData::init() LLVolumeFace::VertexData::VertexData() { - mData = NULL; + mData = nullptr; init(); } LLVolumeFace::VertexData::VertexData(const VertexData& rhs) { - mData = NULL; + mData = nullptr; *this = rhs; } @@ -2256,7 +2256,7 @@ const LLVolumeFace::VertexData& LLVolumeFace::VertexData::operator=(const LLVolu LLVolumeFace::VertexData::~VertexData() { ll_aligned_free_16(mData); - mData = NULL; + mData = nullptr; } LLVector4a& LLVolumeFace::VertexData::getPosition() @@ -3113,7 +3113,7 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, BOOL data_is_empty = FALSE; - if (sculpt_width == 0 || sculpt_height == 0 || sculpt_components < 3 || sculpt_data == NULL) + if (sculpt_width == 0 || sculpt_height == 0 || sculpt_components < 3 || sculpt_data == nullptr) { sculpt_level = -1; data_is_empty = TRUE; @@ -3960,7 +3960,7 @@ S32 LLVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& en if (LLLineSegmentBoxIntersect(start, end, box_center, box_size)) { - if (tangent_out != NULL) // if the caller wants tangents, we may need to generate them + if (tangent_out != nullptr) // if the caller wants tangents, we may need to generate them { genTangents(i); } @@ -3991,7 +3991,7 @@ S32 LLVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& en closest_t = t; hit_face = i; - if (intersection != NULL) + if (intersection != nullptr) { LLVector4a intersect = dir; intersect.mul(closest_t); @@ -4000,7 +4000,7 @@ S32 LLVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& en } - if (tex_coord != NULL) + if (tex_coord != nullptr) { LLVector2* tc = (LLVector2*) face.mTexCoords; *tex_coord = ((1.f - a - b) * tc[idx0] + @@ -4009,7 +4009,7 @@ S32 LLVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& en } - if (normal!= NULL) + if (normal!= nullptr) { LLVector4a* norm = face.mNormals; @@ -4029,7 +4029,7 @@ S32 LLVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& en *normal = n1; } - if (tangent_out != NULL) + if (tangent_out != nullptr) { LLVector4a* tangents = face.mTangents; @@ -4183,7 +4183,7 @@ BOOL LLVolumeParams::importFile(LLFILE *fp) while (!feof(fp)) { - if (fgets(buffer, BUFSIZE, fp) == NULL) + if (fgets(buffer, BUFSIZE, fp) == nullptr) { buffer[0] = '\0'; } @@ -4603,14 +4603,14 @@ LLVolumeFace::LLVolumeFace() : mNumVertices(0), mNumAllocatedVertices(0), mNumIndices(0), - mPositions(NULL), - mNormals(NULL), - mTangents(NULL), - mTexCoords(NULL), - mIndices(NULL), - mWeights(NULL), + mPositions(nullptr), + mNormals(nullptr), + mTangents(nullptr), + mTexCoords(nullptr), + mIndices(nullptr), + mWeights(nullptr), mWeightsScrubbed(FALSE), - mOctree(NULL), + mOctree(nullptr), mOptimized(FALSE) { mExtents = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*3); @@ -4629,14 +4629,14 @@ LLVolumeFace::LLVolumeFace(const LLVolumeFace& src) mNumVertices(0), mNumAllocatedVertices(0), mNumIndices(0), - mPositions(NULL), - mNormals(NULL), - mTangents(NULL), - mTexCoords(NULL), - mIndices(NULL), - mWeights(NULL), + mPositions(nullptr), + mNormals(nullptr), + mTangents(nullptr), + mTexCoords(nullptr), + mIndices(nullptr), + mWeights(nullptr), mWeightsScrubbed(FALSE), - mOctree(NULL), + mOctree(nullptr), mOptimized(FALSE) { mExtents = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*3); @@ -4717,7 +4717,7 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src) LLVolumeFace::~LLVolumeFace() { ll_aligned_free_16(mExtents); - mExtents = NULL; + mExtents = nullptr; freeData(); } @@ -4730,14 +4730,14 @@ void LLVolumeFace::freeData() allocateIndices(0); delete mOctree; - mOctree = NULL; + mOctree = nullptr; } BOOL LLVolumeFace::create(LLVolume* volume, BOOL partial_build) { //tree for this face is no longer valid delete mOctree; - mOctree = NULL; + mOctree = nullptr; LL_CHECK_MEMORY BOOL ret = FALSE ; @@ -4876,14 +4876,14 @@ void LLVolumeFace::optimize(F32 angle_cutoff) { // Now alloc'd with positions //ll_aligned_free_16(new_face.mNormals); - new_face.mNormals = NULL; + new_face.mNormals = nullptr; } if (!mTexCoords) { // Now alloc'd with positions //ll_aligned_free_16(new_face.mTexCoords); - new_face.mTexCoords = NULL; + new_face.mTexCoords = nullptr; } // Only swap data if we've actually optimized the mesh @@ -4926,7 +4926,7 @@ public: { mActive = true; mScore = 0.0; - mVertex[0] = mVertex[1] = mVertex[2] = NULL; + mVertex[0] = mVertex[1] = mVertex[2] = nullptr; } void complete() @@ -4998,7 +4998,7 @@ public: mMisses = 0; for (U32 i = 0; i < MaxSizeVertexCache; ++i) { - mCache[i] = NULL; + mCache[i] = nullptr; } } @@ -5043,10 +5043,10 @@ public: { for (U32 i = 0; i < MaxSizeVertexCache+3; ++i) { - mCache[i] = NULL; + mCache[i] = nullptr; } - mBestTriangle = NULL; + mBestTriangle = nullptr; mMisses = 0; } @@ -5114,7 +5114,7 @@ public: } } - mBestTriangle = NULL; + mBestTriangle = nullptr; //update triangle scores data_iter = mCache; end_data = mCache+MaxSizeVertexCache+3; @@ -5151,7 +5151,7 @@ public: if (data) { llassert(data->mCacheTag == -1); - *data_iter = NULL; + *data_iter = nullptr; } ++data_iter; } @@ -5292,21 +5292,21 @@ void LLVolumeFace::cacheOptimize() LLVector4a* old_pos = mPositions; LLVector4a* old_norm = old_pos + num_verts; LLVector2* old_tc = (LLVector2*)(old_norm + num_verts); - mPositions = NULL; + mPositions = nullptr; if (old_pos) { allocateVertices(num_verts); } LLVector4a* old_wght = mWeights; - mWeights = NULL; + mWeights = nullptr; if (old_wght) { allocateWeights(num_verts); } LLVector4a* old_tangent = mTangents; - mTangents = NULL; + mTangents = nullptr; if (old_tangent) { allocateTangents(num_verts); @@ -5364,7 +5364,7 @@ void LLVolumeFace::createOctree(F32 scaler, const LLVector4a& center, const LLVe return; } - mOctree = new LLOctreeRoot<LLVolumeTriangle>(center, size, NULL); + mOctree = new LLOctreeRoot<LLVolumeTriangle>(center, size, nullptr); new LLVolumeOctreeListener(mOctree); for (U32 i = 0; i < mNumIndices; i+= 3) @@ -6196,7 +6196,7 @@ void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, con void LLVolumeFace::allocateTangents(S32 num_verts) { ll_aligned_free_16(mTangents); - mTangents = NULL; + mTangents = nullptr; if (num_verts) { mTangents = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); @@ -6206,7 +6206,7 @@ void LLVolumeFace::allocateTangents(S32 num_verts) void LLVolumeFace::allocateWeights(S32 num_verts) { ll_aligned_free_16(mWeights); - mWeights = NULL; + mWeights = nullptr; if (num_verts) { mWeights = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); @@ -6218,9 +6218,9 @@ void LLVolumeFace::allocateVertices(S32 num_verts, bool copy) if (!copy || !num_verts) { ll_aligned_free<64>(mPositions); - mPositions = NULL; - mNormals = NULL; - mTexCoords = NULL; + mPositions = nullptr; + mNormals = nullptr; + mTexCoords = nullptr; } if (num_verts) @@ -6273,7 +6273,7 @@ void LLVolumeFace::allocateIndices(S32 num_indices, bool copy) return; } ll_aligned_free_16(mIndices); - mIndices = NULL; + mIndices = nullptr; if (num_indices) { mIndices = (U16*)ll_aligned_malloc_16(new_size); diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index d2565a9a932db369e333f8297f5880f720521737..7bb31f929cadd2385945ac6630f4312718fba50b 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -814,7 +814,7 @@ class LLDynamicPath : public LLPath public: LLDynamicPath() : LLPath() { } /*virtual*/ BOOL generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0, - BOOL is_sculpted = FALSE, S32 sculpt_size = 0); + BOOL is_sculpted = FALSE, S32 sculpt_size = 0) override; }; // Yet another "face" class - caches volume-specific, but not instance-specific data for faces) @@ -1020,7 +1020,7 @@ public: static void getLoDTriangleCounts(const LLVolumeParams& params, S32* counts); - S32 getNumTriangles(S32* vcount = NULL) const; + S32 getNumTriangles(S32* vcount = nullptr) const; void generateSilhouetteVertices(std::vector<LLVector3> &vertices, std::vector<LLVector3> &normals, @@ -1034,10 +1034,10 @@ public: //Line segment must be in volume space. S32 lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face = -1, // which face to check, -1 = ALL_SIDES - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point + LLVector4a* intersection = nullptr, // return the intersection point + LLVector2* tex_coord = nullptr, // return the texture coordinates of the intersection point + LLVector4a* normal = nullptr, // return the surface normal at the intersection point + LLVector4a* tangent = nullptr // return the surface tangent at the intersection point ); LLFaceID generateFaceMask(); diff --git a/indra/llmath/llvolumemgr.cpp b/indra/llmath/llvolumemgr.cpp index 602d64264a0d78c906260c31879b8b517a26bf1e..cf33edc0bebcc35c009adf2bab2d7c7d9345e2e2 100644 --- a/indra/llmath/llvolumemgr.cpp +++ b/indra/llmath/llvolumemgr.cpp @@ -46,7 +46,7 @@ F32 LLVolumeLODGroup::mDetailScales[NUM_LODS] = {1.f, 1.5f, 2.5f, 4.f}; //============================================================================ LLVolumeMgr::LLVolumeMgr() -: mDataMutex(NULL) +: mDataMutex(nullptr) { // the LLMutex magic interferes with easy unit testing, // so you now must manually call useMutex() to use it @@ -58,7 +58,7 @@ LLVolumeMgr::~LLVolumeMgr() cleanup(); delete mDataMutex; - mDataMutex = NULL; + mDataMutex = nullptr; } BOOL LLVolumeMgr::cleanup() @@ -117,7 +117,7 @@ LLVolume* LLVolumeMgr::refVolume(const LLVolumeParams &volume_params, const S32 // virtual LLVolumeLODGroup* LLVolumeMgr::getGroup( const LLVolumeParams& volume_params ) const { - LLVolumeLODGroup* volgroupp = NULL; + LLVolumeLODGroup* volgroupp = nullptr; if (mDataMutex) { mDataMutex->lock(); @@ -280,7 +280,7 @@ bool LLVolumeLODGroup::cleanupRefs() { LL_WARNS() << " LOD " << i << " refs = " << mLODRefs[i] << LL_ENDL; mLODRefs[i] = 0; - mVolumeLODs[i] = NULL; + mVolumeLODs[i] = nullptr; } } LL_WARNS() << *getVolumeParams() << LL_ENDL; diff --git a/indra/llmath/llvolumeoctree.cpp b/indra/llmath/llvolumeoctree.cpp index b2e86584acc688af8b3474e875f661346ba1ecae..af18f274953e35ac98602f8d91e46af97cae00b4 100644 --- a/indra/llmath/llvolumeoctree.cpp +++ b/indra/llmath/llvolumeoctree.cpp @@ -143,7 +143,7 @@ void LLOctreeTriangleRayIntersect::visit(const LLOctreeNode<LLVolumeTriangle>* n *mClosestT = t; mHitFace = true; - if (mIntersection != NULL) + if (mIntersection != nullptr) { LLVector4a intersect = mDir; intersect.mul(*mClosestT); @@ -155,7 +155,7 @@ void LLOctreeTriangleRayIntersect::visit(const LLOctreeNode<LLVolumeTriangle>* n U32 idx1 = tri->mIndex[1]; U32 idx2 = tri->mIndex[2]; - if (mTexCoord != NULL) + if (mTexCoord != nullptr) { LLVector2* tc = (LLVector2*) mFace->mTexCoords; *mTexCoord = ((1.f - a - b) * tc[idx0] + @@ -164,7 +164,7 @@ void LLOctreeTriangleRayIntersect::visit(const LLOctreeNode<LLVolumeTriangle>* n } - if (mNormal != NULL) + if (mNormal != nullptr) { LLVector4a* norm = mFace->mNormals; @@ -184,7 +184,7 @@ void LLOctreeTriangleRayIntersect::visit(const LLOctreeNode<LLVolumeTriangle>* n *mNormal = n1; } - if (mTangent != NULL) + if (mTangent != nullptr) { LLVector4a* tangents = mFace->mTangents; diff --git a/indra/llmath/llvolumeoctree.h b/indra/llmath/llvolumeoctree.h index 74486464b74f03b4a23b806cc0032aa7fb69e84a..5f0ce1879fd67d5cdcca25ebc0ea6ee8f358a29b 100644 --- a/indra/llmath/llvolumeoctree.h +++ b/indra/llmath/llvolumeoctree.h @@ -115,14 +115,16 @@ public: } //LISTENER FUNCTIONS - virtual void handleChildAddition(const LLOctreeNode<LLVolumeTriangle>* parent, - LLOctreeNode<LLVolumeTriangle>* child); - virtual void handleStateChange(const LLTreeNode<LLVolumeTriangle>* node) { } - virtual void handleChildRemoval(const LLOctreeNode<LLVolumeTriangle>* parent, - const LLOctreeNode<LLVolumeTriangle>* child) { } - virtual void handleInsertion(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) { } - virtual void handleRemoval(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) { } - virtual void handleDestruction(const LLTreeNode<LLVolumeTriangle>* node) { } + void handleChildAddition(const LLOctreeNode<LLVolumeTriangle>* parent, + LLOctreeNode<LLVolumeTriangle>* child) override; + void handleStateChange(const LLTreeNode<LLVolumeTriangle>* node) override { } + + void handleChildRemoval(const LLOctreeNode<LLVolumeTriangle>* parent, + const LLOctreeNode<LLVolumeTriangle>* child) override { } + + void handleInsertion(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) override { } + void handleRemoval(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) override { } + void handleDestruction(const LLTreeNode<LLVolumeTriangle>* node) override { } public: @@ -148,15 +150,15 @@ public: const LLVolumeFace* face, F32* closest_t, LLVector4a* intersection,LLVector2* tex_coord, LLVector4a* normal, LLVector4a* tangent); - void traverse(const LLOctreeNode<LLVolumeTriangle>* node); + void traverse(const LLOctreeNode<LLVolumeTriangle>* node) override; - virtual void visit(const LLOctreeNode<LLVolumeTriangle>* node); + void visit(const LLOctreeNode<LLVolumeTriangle>* node) override; virtual ~LLOctreeTriangleRayIntersect() {} }; class LLVolumeOctreeValidate : public LLOctreeTraveler<LLVolumeTriangle> { - virtual void visit(const LLOctreeNode<LLVolumeTriangle>* branch); + void visit(const LLOctreeNode<LLVolumeTriangle>* branch) override; public: virtual ~LLVolumeOctreeValidate() {} diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h index d5934ddbf88997eb4cb873ec8a7ad2aaf05f2cb3..6813237515089e72016970131623fae3e8634e56 100644 --- a/indra/llmath/v3color.h +++ b/indra/llmath/v3color.h @@ -194,11 +194,11 @@ inline LLColor3::LLColor3(const char* color_string) // takes a string of format char tempstr[7]; strncpy(tempstr,color_string,6); /* Flawfinder: ignore */ tempstr[6] = '\0'; - mV[VZ] = (F32)strtol(&tempstr[4],NULL,16)/255.f; + mV[VZ] = (F32)strtol(&tempstr[4], nullptr,16)/255.f; tempstr[4] = '\0'; - mV[VY] = (F32)strtol(&tempstr[2],NULL,16)/255.f; + mV[VY] = (F32)strtol(&tempstr[2], nullptr,16)/255.f; tempstr[2] = '\0'; - mV[VX] = (F32)strtol(&tempstr[0],NULL,16)/255.f; + mV[VX] = (F32)strtol(&tempstr[0], nullptr,16)/255.f; } inline const LLColor3& LLColor3::setToBlack(void) diff --git a/indra/llmath/v3dmath.cpp b/indra/llmath/v3dmath.cpp index 5b9438e9061a3928dd4d47f226fc771203d035f0..6aef2a6bd1f4965e317745ed40ca9d5b2d76dde4 100644 --- a/indra/llmath/v3dmath.cpp +++ b/indra/llmath/v3dmath.cpp @@ -131,7 +131,7 @@ const LLVector3d& LLVector3d::rotVec(F64 angle, F64 x, F64 y, F64 z) BOOL LLVector3d::parseVector3d(const std::string& buf, LLVector3d* value) { - if( buf.empty() || value == NULL) + if( buf.empty() || value == nullptr) { return FALSE; } diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp index c8e098ea67d52c24fe991ca6a781d80545d15182..c06ee817812c094836aead84aba1b61d69898edf 100644 --- a/indra/llmath/v3math.cpp +++ b/indra/llmath/v3math.cpp @@ -356,7 +356,7 @@ const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot) // static BOOL LLVector3::parseVector3(const std::string& buf, LLVector3* value) { - if( buf.empty() || value == NULL) + if( buf.empty() || value == nullptr) { return FALSE; } diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp index 4ba1697ad53beec8259171e18b00c59b250f323d..4d27402cbb9fd616876059be04fe1dc48a64cffd 100644 --- a/indra/llmath/v4color.cpp +++ b/indra/llmath/v4color.cpp @@ -385,7 +385,7 @@ void LLColor4::calcHSL(F32* hue, F32* saturation, F32* luminance) const // static BOOL LLColor4::parseColor(const std::string& buf, LLColor4* color) { - if( buf.empty() || color == NULL) + if( buf.empty() || color == nullptr) { return FALSE; } @@ -712,7 +712,7 @@ BOOL LLColor4::parseColor(const std::string& buf, LLColor4* color) // static BOOL LLColor4::parseColor4(const std::string& buf, LLColor4* value) { - if( buf.empty() || value == NULL) + if( buf.empty() || value == nullptr) { return FALSE; } diff --git a/indra/llmath/v4coloru.cpp b/indra/llmath/v4coloru.cpp index 360754b1e44cb42788ae194e23bf30656c2584fa..6d2b52b44401df3fe57ef1faba64c346de06db16 100644 --- a/indra/llmath/v4coloru.cpp +++ b/indra/llmath/v4coloru.cpp @@ -92,7 +92,7 @@ std::ostream& operator<<(std::ostream& s, const LLColor4U &a) // static BOOL LLColor4U::parseColor4U(const std::string& buf, LLColor4U* value) { - if( buf.empty() || value == NULL) + if( buf.empty() || value == nullptr) { return FALSE; } diff --git a/indra/llmath/xform.h b/indra/llmath/xform.h index 90d7cf125752a249feb707cdbede94620b21384e..02702a1bbf873317a7aa6b0b42d2d3311fec2adc 100644 --- a/indra/llmath/xform.h +++ b/indra/llmath/xform.h @@ -75,7 +75,7 @@ public: void init() { - mParent = NULL; + mParent = nullptr; mChanged = UNCHANGED; mPosition.setVec(0,0,0); mRotation.loadIdentity(); diff --git a/indra/llmessage/llaescipher.cpp b/indra/llmessage/llaescipher.cpp index 3ec9ee46fa6e528ced2f2bb133905e8a2ba74bf6..d6be829bb132add5b1fa2bf5a3a74b42ae291d73 100644 --- a/indra/llmessage/llaescipher.cpp +++ b/indra/llmessage/llaescipher.cpp @@ -52,10 +52,10 @@ LLAESCipher::LLAESCipher(const U8* secret, size_t secret_size, const U8* iv, siz LLAESCipher::~LLAESCipher() { delete [] mSecret; - mSecret = NULL; + mSecret = nullptr; delete [] mInitialVector; - mInitialVector = NULL; + mInitialVector = nullptr; } // virtual @@ -67,10 +67,10 @@ U32 LLAESCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) // OpenSSL uses "cipher contexts" to hold encryption parameters. EVP_CIPHER_CTX* context = EVP_CIPHER_CTX_new(); - EVP_EncryptInit_ex(context, EVP_aes_256_ofb(), NULL, NULL, NULL); + EVP_EncryptInit_ex(context, EVP_aes_256_ofb(), nullptr, nullptr, nullptr); EVP_CIPHER_CTX_set_key_length(context, (int)mSecretSize); - EVP_EncryptInit_ex(context, NULL, NULL, mSecret, mInitialVector); + EVP_EncryptInit_ex(context, nullptr, nullptr, mSecret, mInitialVector); int blocksize = EVP_CIPHER_CTX_block_size(context); int keylen = EVP_CIPHER_CTX_key_length(context); @@ -114,10 +114,10 @@ U32 LLAESCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) EVP_CIPHER_CTX* context = EVP_CIPHER_CTX_new(); - EVP_DecryptInit_ex(context, EVP_aes_256_ofb(), NULL, NULL, NULL); + EVP_DecryptInit_ex(context, EVP_aes_256_ofb(), nullptr, nullptr, nullptr); EVP_CIPHER_CTX_set_key_length(context, (int)mSecretSize); - EVP_DecryptInit_ex(context, NULL, NULL, mSecret, mInitialVector); + EVP_DecryptInit_ex(context, nullptr, nullptr, mSecret, mInitialVector); int blocksize = EVP_CIPHER_CTX_block_size(context); int keylen = EVP_CIPHER_CTX_key_length(context); diff --git a/indra/llmessage/llaescipher.h b/indra/llmessage/llaescipher.h index 4c144d36b6cae8413f20af8447bbe60419886e4d..5fca5f739866705cd01ec57e36fee9c70fe32c0e 100644 --- a/indra/llmessage/llaescipher.h +++ b/indra/llmessage/llaescipher.h @@ -39,9 +39,9 @@ public: LLAESCipher(const U8* secret, size_t secret_size, const U8* iv, size_t iv_size); virtual ~LLAESCipher(); - /*virtual*/ U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len); - /*virtual*/ U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len); - /*virtual*/ U32 requiredEncryptionSpace(U32 src_len) const; + /*virtual*/ U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) override; + /*virtual*/ U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) override; + /*virtual*/ U32 requiredEncryptionSpace(U32 src_len) const override; private: U8* mSecret; diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index e2571835340c96f18a7cdbf054c93d6c792f5090..efb67c1487d3cf5ceb46584f726daaa92ca546b8 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -54,8 +54,8 @@ #include "llmetrics.h" #include "lltrace.h" -LLAssetStorage *gAssetStorage = NULL; -LLMetrics *LLAssetStorage::metric_recipient = NULL; +LLAssetStorage *gAssetStorage = nullptr; +LLMetrics *LLAssetStorage::metric_recipient = nullptr; static LLTrace::CountStatHandle<> sFailedDownloadCount("faileddownloads", "Number of times LLAssetStorage::getAssetData() has failed"); @@ -166,8 +166,8 @@ void LLAssetInfo::setFromNameValue( const LLNameValue& nv ) LLBaseDownloadRequest::LLBaseDownloadRequest(const LLUUID &uuid, const LLAssetType::EType type) : mUUID(uuid), mType(type), -mDownCallback(NULL), -mUserData(NULL), +mDownCallback(nullptr), +mUserData(nullptr), mHost(), mIsTemp(FALSE), mIsPriority(FALSE), @@ -197,8 +197,8 @@ LLBaseDownloadRequest* LLBaseDownloadRequest::getCopy() LLAssetRequest::LLAssetRequest(const LLUUID &uuid, const LLAssetType::EType type) : LLBaseDownloadRequest(uuid, type), - mUpCallback( NULL ), - mInfoCallback( NULL ), + mUpCallback(nullptr ), + mInfoCallback(nullptr ), mIsLocal(FALSE), mIsUserWaiting(FALSE), mTimeout(LL_ASSET_STORAGE_TIMEOUT) @@ -338,7 +338,7 @@ LLAssetStorage::~LLAssetStorage() { // Warning! This won't work if there's more than one asset storage. // unregister our callbacks with the message system - gMessageSystem->setHandlerFuncFast(_PREHASH_AssetUploadComplete, NULL, NULL); + gMessageSystem->setHandlerFuncFast(_PREHASH_AssetUploadComplete, nullptr, nullptr); } // Clear the toxic asset map @@ -1076,7 +1076,7 @@ LLAssetStorage::request_list_t* LLAssetStorage::getRequestList(LLAssetStorage::E return &mPendingLocalUploads; default: LL_WARNS() << "Unable to find request list for request type '" << rt << "'" << LL_ENDL; - return NULL; + return nullptr; } } @@ -1092,7 +1092,7 @@ const LLAssetStorage::request_list_t* LLAssetStorage::getRequestList(LLAssetStor return &mPendingLocalUploads; default: LL_WARNS() << "Unable to find request list for request type '" << rt << "'" << LL_ENDL; - return NULL; + return nullptr; } } @@ -1201,7 +1201,7 @@ const LLAssetRequest* LLAssetStorage::findRequest(const LLAssetStorage::request_ } } } - return NULL; + return nullptr; } // static @@ -1224,7 +1224,7 @@ LLAssetRequest* LLAssetStorage::findRequest(LLAssetStorage::request_list_t* requ } } } - return NULL; + return nullptr; } diff --git a/indra/llmessage/llassetstorage.h b/indra/llmessage/llassetstorage.h index af9ad99e5fb2b4fe1ee44a0a4cde30707a882ec4..8199aa7ac68141f14edb8bbff4f12d3f5be94992 100644 --- a/indra/llmessage/llassetstorage.h +++ b/indra/llmessage/llassetstorage.h @@ -126,7 +126,7 @@ public: void setTimeout(F64Seconds timeout) { mTimeout = timeout; } - virtual LLBaseDownloadRequest* getCopy(); + LLBaseDownloadRequest* getCopy() override; void (*mUpCallback)(const LLUUID&, void *, S32, LLExtStat); void (*mInfoCallback)(LLAssetInfo *, void *, S32); @@ -157,7 +157,7 @@ public: LLInvItemRequest(const LLUUID &uuid, const LLAssetType::EType at); virtual ~LLInvItemRequest(); - virtual LLBaseDownloadRequest* getCopy(); + LLBaseDownloadRequest* getCopy() override; }; class LLEstateAssetRequest : public LLBaseDownloadRequest @@ -168,7 +168,7 @@ public: LLAssetType::EType getAType() const { return mType; } - virtual LLBaseDownloadRequest* getCopy(); + LLBaseDownloadRequest* getCopy() override; protected: EstateAssetType mEstateAssetType; @@ -402,7 +402,7 @@ public: // Temp assets are stored on sim nodes, they have agent ID and location data associated with them. // This is a no-op for non-http asset systems - virtual void addTempAssetData(const LLUUID& asset_id, const LLUUID& agent_id, const std::string& host_name); + void addTempAssetData(const LLUUID& asset_id, const LLUUID& agent_id, const std::string& host_name) override; virtual BOOL hasTempAssetData(const LLUUID& texture_id) const; virtual std::string getTempAssetHostName(const LLUUID& texture_id) const; virtual LLUUID getTempAssetAgentID(const LLUUID& texture_id) const; diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 6a70d9501c857ec0386e8afc3fdc7ad103fa3cdf..7834b6a4816c03ab7f65d88ebec738ad4d854051 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -344,7 +344,7 @@ void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName& sSignalMap.erase(agent_id); delete signal; - signal = NULL; + signal = nullptr; } } @@ -469,9 +469,9 @@ void LLAvatarNameCache::initClass(bool running, bool usePeopleAPI) sRunning = running; sUsePeopleAPI = usePeopleAPI; - sHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest()); - sHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); - sHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); + sHttpRequest = boost::make_shared<LLCore::HttpRequest>(); + sHttpHeaders = boost::make_shared<LLCore::HttpHeaders>(); + sHttpOptions = boost::make_shared<LLCore::HttpOptions>(); sHttpPolicy = LLCore::HttpRequest::DEFAULT_POLICY_ID; sHttpPriority = 0; } diff --git a/indra/llmessage/llbuffer.cpp b/indra/llmessage/llbuffer.cpp index 64071d8c1f49d709010fb07aa0c2b44ab31aa850..00b025ed7f25a6d938363cd5f6fcf16fa2aa73ea 100644 --- a/indra/llmessage/llbuffer.cpp +++ b/indra/llmessage/llbuffer.cpp @@ -42,16 +42,16 @@ * LLSegment */ LLSegment::LLSegment() : - mChannel(0), - mData(NULL), - mSize(0) + mData(nullptr), + mSize(0), + mChannel(0) { } LLSegment::LLSegment(S32 channel, U8* data, S32 data_len) : - mChannel(channel), mData(data), - mSize(data_len) + mSize(data_len), + mChannel(channel) { } @@ -98,9 +98,9 @@ bool LLSegment::operator==(const LLSegment& rhs) const * LLHeapBuffer */ LLHeapBuffer::LLHeapBuffer() : - mBuffer(NULL), + mBuffer(nullptr), mSize(0), - mNextFree(NULL), + mNextFree(nullptr), mReclaimedBytes(0) { const S32 DEFAULT_HEAP_BUFFER_SIZE = 16384; @@ -108,18 +108,18 @@ LLHeapBuffer::LLHeapBuffer() : } LLHeapBuffer::LLHeapBuffer(S32 size) : - mBuffer(NULL), + mBuffer(nullptr), mSize(0), - mNextFree(NULL), + mNextFree(nullptr), mReclaimedBytes(0) { allocate(size); } LLHeapBuffer::LLHeapBuffer(const U8* src, S32 len) : - mBuffer(NULL), + mBuffer(nullptr), mSize(0), - mNextFree(NULL), + mNextFree(nullptr), mReclaimedBytes(0) { if((len > 0) && src) @@ -136,9 +136,9 @@ LLHeapBuffer::LLHeapBuffer(const U8* src, S32 len) : LLHeapBuffer::~LLHeapBuffer() { delete[] mBuffer; - mBuffer = NULL; + mBuffer = nullptr; mSize = 0; - mNextFree = NULL; + mNextFree = nullptr; } S32 LLHeapBuffer::bytesLeft() const @@ -224,7 +224,7 @@ void LLHeapBuffer::allocate(S32 size) */ LLBufferArray::LLBufferArray() : mNextBaseChannel(0), - mMutexp(NULL) + mMutexp(nullptr) { } @@ -278,7 +278,7 @@ void LLBufferArray::setThreaded(bool threaded) if(mMutexp) { delete mMutexp ; - mMutexp = NULL ; + mMutexp = nullptr ; } } } @@ -659,7 +659,7 @@ U8* LLBufferArray::seek( it = getSegment(start); if((it == end) || !(*it).isOnChannel(channel)) { - rv = NULL; + rv = nullptr; } } else @@ -704,7 +704,7 @@ U8* LLBufferArray::seek( { // start is NULL, and delta indicates seeking backwards - // return NULL. - return NULL; + return nullptr; } else { @@ -733,7 +733,7 @@ U8* LLBufferArray::seek( if(delta && (it == end)) { // Whoops - sought past end. - rv = NULL; + rv = nullptr; } } else //if(delta < 0) @@ -764,7 +764,7 @@ U8* LLBufferArray::seek( if(delta && (rit == rend)) { // sought past the beginning. - rv = NULL; + rv = nullptr; } } return rv; diff --git a/indra/llmessage/llbuffer.h b/indra/llmessage/llbuffer.h index fde9f904ef97eeea94e8258640f264de5674b3d2..309969cacc5f2cc1db0e309f633e4a3e90369a3b 100644 --- a/indra/llmessage/llbuffer.h +++ b/indra/llmessage/llbuffer.h @@ -245,7 +245,7 @@ public: * @param segment[out] The out-value from the operation * @return Returns true if a segment was found. */ - virtual bool createSegment(S32 channel, S32 size, LLSegment& segment); + bool createSegment(S32 channel, S32 size, LLSegment& segment) override; /** * @brief reclaim a segment from this buffer. @@ -261,7 +261,7 @@ public: * @param segment The contiguous buffer segment to reclaim. * @return Returns true if the call was successful. */ - virtual bool reclaimSegment(const LLSegment& segment); + bool reclaimSegment(const LLSegment& segment) override; /** * @brief Test if a segment is inside this buffer. @@ -269,12 +269,12 @@ public: * @param segment The contiguous buffer segment to test. * @return Returns true if the segment is in the bufffer. */ - virtual bool containsSegment(const LLSegment& segment) const; + bool containsSegment(const LLSegment& segment) const override; /** * @brief Return the current number of bytes allocated. */ - virtual S32 capacity() const { return mSize; } + S32 capacity() const override { return mSize; } protected: U8* mBuffer; @@ -415,7 +415,7 @@ public: */ S32 count(S32 channel) const { - return countAfter(channel, NULL); + return countAfter(channel, nullptr); } /** diff --git a/indra/llmessage/llbufferstream.cpp b/indra/llmessage/llbufferstream.cpp index 2deac0c696b6f93f1f38a6ac830da43f8ba970fc..df806a2cf91afe2840e115a31c4c212989c3111b 100644 --- a/indra/llmessage/llbufferstream.cpp +++ b/indra/llmessage/llbufferstream.cpp @@ -205,7 +205,7 @@ int LLBufferStreamBuf::sync() // set the put pointer so that we force an overflow on the next // write. U8* address = (U8*)pptr(); - setp(NULL, NULL); + setp(nullptr, nullptr); // *NOTE: I bet we could just --address if address is not NULL. // Need to think about that. @@ -253,10 +253,10 @@ streampos LLBufferStreamBuf::seekoff( { return -1; } - U8* address = NULL; + U8* address = nullptr; if(which & std::ios::in) { - U8* base_addr = NULL; + U8* base_addr = nullptr; switch(way) { case std::ios::end: @@ -289,7 +289,7 @@ streampos LLBufferStreamBuf::seekoff( } if(which & std::ios::out) { - U8* base_addr = NULL; + U8* base_addr = nullptr; switch(way) { case std::ios::end: diff --git a/indra/llmessage/llbufferstream.h b/indra/llmessage/llbufferstream.h index bdf396ced4373bf1ca974e935f808674b7342b53..3b57fae53efae871eadc72416f5328b65b52dd35 100644 --- a/indra/llmessage/llbufferstream.h +++ b/indra/llmessage/llbufferstream.h @@ -61,7 +61,7 @@ protected: * * @return Returns the character at the current position or EOF. */ - virtual int underflow(); + int underflow() override; /* * @brief called when we hit the end of output @@ -69,14 +69,14 @@ protected: * @param c The character to store at the current put position * @return Returns EOF if the function failed. Any other value on success. */ - virtual int overflow(int c); + int overflow(int c) override; /* * @brief synchronize the buffer * * @return Returns 0 on success or -1 on failure. */ - virtual int sync(); + int sync() override; /* * @brief Seek to an offset position in a stream. @@ -88,10 +88,10 @@ protected: * @return Returns the new position or an invalid position on failure. */ #if( LL_WINDOWS || __GNUC__ > 2) - virtual pos_type seekoff( + pos_type seekoff( off_type off, std::ios::seekdir way, - std::ios::openmode which); + std::ios::openmode which) override; #else virtual streampos seekoff( streamoff off, diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 39bf2b39bae98d7e76cd1490827060364a4f03bc..3fab8491846a027afa97dda217bd04ae9b0cdcf9 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -52,7 +52,7 @@ static const std::string NAME("name"); const U32 PENDING_TIMEOUT_SECS = 5 * 60; // Globals -LLCacheName* gCacheName = NULL; +LLCacheName* gCacheName = nullptr; std::map<std::string, std::string> LLCacheName::sCacheName; /// --------------------------------------------------------------------------- @@ -313,7 +313,7 @@ bool LLCacheName::importFile(std::istream& istr) } // We'll expire entries more than a week old - U32 now = (U32)time(NULL); + U32 now = (U32)time(nullptr); const U32 SECS_PER_DAY = 60 * 60 * 24; U32 delete_before_time = now - (7 * SECS_PER_DAY); @@ -465,7 +465,7 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) // this group name was loaded from a name cache that did not // bother to save the group name ==> we must ask for it LL_DEBUGS() << "LLCacheName queuing HACK group request: " << id << LL_ENDL; - entry = NULL; + entry = nullptr; } if (entry) @@ -684,7 +684,7 @@ void LLCacheName::processPending() void LLCacheName::deleteEntriesOlderThan(S32 secs) { - U32 now = (U32)time(NULL); + U32 now = (U32)time(nullptr); U32 expire_time = now - secs; for(Cache::iterator iter = impl.mCache.begin(); iter != impl.mCache.end(); ) { @@ -862,7 +862,7 @@ void LLCacheName::Impl::sendRequest( bool LLCacheName::Impl::isRequestPending(const LLUUID& id) { - U32 now = (U32)time(NULL); + U32 now = (U32)time(nullptr); U32 expire_time = now - PENDING_TIMEOUT_SECS; PendingQueue::iterator iter = mPendingQueue.find(id); @@ -950,7 +950,7 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup) mPendingQueue.erase(id); entry->mIsGroup = isGroup; - entry->mCreateTime = (U32)time(NULL); + entry->mCreateTime = (U32)time(nullptr); if (!isGroup) { msg->getStringFast(_PREHASH_UUIDNameBlock, _PREHASH_FirstName, entry->mFirstName, i); diff --git a/indra/llmessage/llchainio.h b/indra/llmessage/llchainio.h index 6e4d6c2013868de590fb649554e17d8a2523ae9a..5e4743e1a223b3849df1316f170a7d8e5456bc49 100644 --- a/indra/llmessage/llchainio.h +++ b/indra/llmessage/llchainio.h @@ -102,7 +102,7 @@ template<class Pipe> class LLSimpleIOFactory : public LLChainIOFactory { public: - virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const + bool build(LLPumpIO::chain_t& chain, LLSD context) const override { chain.push_back(LLIOPipe::ptr_t(new Pipe)); return true; @@ -121,7 +121,7 @@ public: mHandle(original), mOriginal(original) {} - virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const + bool build(LLPumpIO::chain_t& chain, LLSD context) const override { chain.push_back(LLIOPipe::ptr_t(new Pipe(*mOriginal))); return true; diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp index eacd0186935eba0deab910205503b95b037bbe44..28fa2cd4f18b017914510c7796c333ee7a5332e3 100644 --- a/indra/llmessage/llcircuit.cpp +++ b/indra/llmessage/llcircuit.cpp @@ -73,8 +73,8 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id, mPacketsOutID(0), mPacketsInID(in_id), mHighestPacketID(in_id), - mTimeoutCallback(NULL), - mTimeoutUserData(NULL), + mTimeoutCallback(nullptr), + mTimeoutUserData(nullptr), mTrusted(FALSE), mbAllowTimeout(TRUE), mbAlive(TRUE), @@ -128,7 +128,7 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id, LLCircuitData::~LLCircuitData() { - LLReliablePacket *packetp = NULL; + LLReliablePacket *packetp = nullptr; // Clean up all pending transfers. gTransferManager.cleanupConnection(mHost); @@ -431,7 +431,7 @@ S32 LLCircuitData::resendUnackedPackets(const F64Seconds now) LLCircuit::LLCircuit(const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout) -: mLastCircuit(NULL), +: mLastCircuit(nullptr), mHeartbeatInterval(circuit_heartbeat_interval), mHeartbeatTimeout(circuit_timeout) {} @@ -457,7 +457,7 @@ LLCircuitData *LLCircuit::addCircuitData(const LLHost &host, TPACKETID in_id) void LLCircuit::removeCircuitData(const LLHost &host) { LL_INFOS() << "LLCircuit::removeCircuitData for " << host << LL_ENDL; - mLastCircuit = NULL; + mLastCircuit = nullptr; circuit_data_map::iterator it = mCircuitData.find(host); if(it != mCircuitData.end()) { @@ -485,7 +485,7 @@ void LLCircuit::removeCircuitData(const LLHost &host) // this circuit, and the setting of mLastCircuit. We don't check // if the host matches, but we don't really care because mLastCircuit // is an optimization, and this happens VERY rarely. - mLastCircuit = NULL; + mLastCircuit = nullptr; } void LLCircuitData::setAlive(BOOL b_alive) @@ -625,7 +625,7 @@ LLCircuitData* LLCircuit::findCircuit(const LLHost& host) const circuit_data_map::const_iterator it = mCircuitData.find(host); if(it == mCircuitData.end()) { - return NULL; + return nullptr; } mLastCircuit = it->second; return mLastCircuit; diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 20cc48fccee4e49a612efdb23f6122d1e47953f5..4c35d13050c3627b5dbe7a965f8abb95031ba094 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -335,7 +335,7 @@ LLUUID LLCoprocedurePool::enqueueCoprocedure(const std::string &name, LLCoproced { LLUUID id(LLUUID::generateNewID()); - mPendingCoprocs.push_back(QueuedCoproc::ptr_t(new QueuedCoproc(name, id, proc))); + mPendingCoprocs.push_back(boost::make_shared<QueuedCoproc>(name, id, proc)); LL_INFOS() << "Coprocedure(" << name << ") enqueued with id=" << id.asString() << " in pool \"" << mPoolName << "\"" << LL_ENDL; mWakeupTrigger.post(LLSD()); diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp index 933b7097db7bbcd63630032ec83af25716069a99..9a63a0b504960bd39055557895568a143325925b 100644 --- a/indra/llmessage/llcorehttputil.cpp +++ b/indra/llmessage/llcorehttputil.cpp @@ -393,8 +393,8 @@ public: HttpCoroLLSDHandler(LLEventStream &reply); protected: - virtual LLSD handleSuccess(LLCore::HttpResponse * response, LLCore::HttpStatus &status); - virtual LLSD parseBody(LLCore::HttpResponse *response, bool &success); + LLSD handleSuccess(LLCore::HttpResponse * response, LLCore::HttpStatus &status) override; + LLSD parseBody(LLCore::HttpResponse *response, bool &success) override; }; //------------------------------------------------------------------------- @@ -500,8 +500,8 @@ class HttpCoroRawHandler : public HttpCoroHandler public: HttpCoroRawHandler(LLEventStream &reply); - virtual LLSD handleSuccess(LLCore::HttpResponse * response, LLCore::HttpStatus &status); - virtual LLSD parseBody(LLCore::HttpResponse *response, bool &success); + LLSD handleSuccess(LLCore::HttpResponse * response, LLCore::HttpStatus &status) override; + LLSD parseBody(LLCore::HttpResponse *response, bool &success) override; }; //------------------------------------------------------------------------- @@ -575,8 +575,8 @@ class HttpCoroJSONHandler : public HttpCoroHandler public: HttpCoroJSONHandler(LLEventStream &reply); - virtual LLSD handleSuccess(LLCore::HttpResponse * response, LLCore::HttpStatus &status); - virtual LLSD parseBody(LLCore::HttpResponse *response, bool &success); + LLSD handleSuccess(LLCore::HttpResponse * response, LLCore::HttpStatus &status) override; + LLSD parseBody(LLCore::HttpResponse *response, bool &success) override; }; //------------------------------------------------------------------------- diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp index b68a2d704e4bd21904036b885ac3e891afec2c27..2763ce2b2e976e2f0abf3f2d9c40e7673a462d4e 100644 --- a/indra/llmessage/lldatapacker.cpp +++ b/indra/llmessage/lldatapacker.cpp @@ -1965,7 +1965,7 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v return FALSE; } - if (fgets(buffer, DP_BUFSIZE, mFP) == NULL) + if (fgets(buffer, DP_BUFSIZE, mFP) == nullptr) { buffer[0] = '\0'; } diff --git a/indra/llmessage/lldatapacker.h b/indra/llmessage/lldatapacker.h index 5140f56c015c92049648a758f1a1e3a4181ef089..290ea4eeab9220017f46ef1b1ab2888187fe4b02 100644 --- a/indra/llmessage/lldatapacker.h +++ b/indra/llmessage/lldatapacker.h @@ -117,61 +117,62 @@ public: LLDataPackerBinaryBuffer() : LLDataPacker(), - mBufferp(NULL), - mCurBufferp(NULL), + mBufferp(nullptr), + mCurBufferp(nullptr), mBufferSize(0) { } - /*virtual*/ BOOL packString(const std::string& value, const char *name); - /*virtual*/ BOOL unpackString(std::string& value, const char *name); + /*virtual*/ BOOL packString(const std::string& value, const char *name) override; + /*virtual*/ BOOL unpackString(std::string& value, const char *name) override; - /*virtual*/ BOOL packBinaryData(const U8 *value, S32 size, const char *name); - /*virtual*/ BOOL unpackBinaryData(U8 *value, S32 &size, const char *name); + /*virtual*/ BOOL packBinaryData(const U8 *value, S32 size, const char *name) override; + /*virtual*/ BOOL unpackBinaryData(U8 *value, S32 &size, const char *name) override; // Constant size binary data packing - /*virtual*/ BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name); - /*virtual*/ BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name); + /*virtual*/ BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name) override; + /*virtual*/ BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name) override; - /*virtual*/ BOOL packU8(const U8 value, const char *name); - /*virtual*/ BOOL unpackU8(U8 &value, const char *name); + /*virtual*/ BOOL packU8(const U8 value, const char *name) override; + /*virtual*/ BOOL unpackU8(U8 &value, const char *name) override; - /*virtual*/ BOOL packU16(const U16 value, const char *name); - /*virtual*/ BOOL unpackU16(U16 &value, const char *name); + /*virtual*/ BOOL packU16(const U16 value, const char *name) override; + /*virtual*/ BOOL unpackU16(U16 &value, const char *name) override; - /*virtual*/ BOOL packU32(const U32 value, const char *name); - /*virtual*/ BOOL unpackU32(U32 &value, const char *name); + /*virtual*/ BOOL packU32(const U32 value, const char *name) override; + /*virtual*/ BOOL unpackU32(U32 &value, const char *name) override; - /*virtual*/ BOOL packS32(const S32 value, const char *name); - /*virtual*/ BOOL unpackS32(S32 &value, const char *name); + /*virtual*/ BOOL packS32(const S32 value, const char *name) override; + /*virtual*/ BOOL unpackS32(S32 &value, const char *name) override; - /*virtual*/ BOOL packF32(const F32 value, const char *name); - /*virtual*/ BOOL unpackF32(F32 &value, const char *name); + /*virtual*/ BOOL packF32(const F32 value, const char *name) override; + /*virtual*/ BOOL unpackF32(F32 &value, const char *name) override; - /*virtual*/ BOOL packColor4(const LLColor4 &value, const char *name); - /*virtual*/ BOOL unpackColor4(LLColor4 &value, const char *name); + /*virtual*/ BOOL packColor4(const LLColor4 &value, const char *name) override; + /*virtual*/ BOOL unpackColor4(LLColor4 &value, const char *name) override; - /*virtual*/ BOOL packColor4U(const LLColor4U &value, const char *name); - /*virtual*/ BOOL unpackColor4U(LLColor4U &value, const char *name); + /*virtual*/ BOOL packColor4U(const LLColor4U &value, const char *name) override; + /*virtual*/ BOOL unpackColor4U(LLColor4U &value, const char *name) override; - /*virtual*/ BOOL packVector2(const LLVector2 &value, const char *name); - /*virtual*/ BOOL unpackVector2(LLVector2 &value, const char *name); + /*virtual*/ BOOL packVector2(const LLVector2 &value, const char *name) override; + /*virtual*/ BOOL unpackVector2(LLVector2 &value, const char *name) override; - /*virtual*/ BOOL packVector3(const LLVector3 &value, const char *name); - /*virtual*/ BOOL unpackVector3(LLVector3 &value, const char *name); + /*virtual*/ BOOL packVector3(const LLVector3 &value, const char *name) override; + /*virtual*/ BOOL unpackVector3(LLVector3 &value, const char *name) override; - /*virtual*/ BOOL packVector4(const LLVector4 &value, const char *name); - /*virtual*/ BOOL unpackVector4(LLVector4 &value, const char *name); + /*virtual*/ BOOL packVector4(const LLVector4 &value, const char *name) override; + /*virtual*/ BOOL unpackVector4(LLVector4 &value, const char *name) override; - /*virtual*/ BOOL packUUID(const LLUUID &value, const char *name); - /*virtual*/ BOOL unpackUUID(LLUUID &value, const char *name); + /*virtual*/ BOOL packUUID(const LLUUID &value, const char *name) override; + /*virtual*/ BOOL unpackUUID(LLUUID &value, const char *name) override; S32 getCurrentSize() const { return (S32)(mCurBufferp - mBufferp); } S32 getBufferSize() const { return mBufferSize; } const U8* getBuffer() const { return mBufferp; } - void reset() { mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != NULL); } + void reset() override + { mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != nullptr); } void shift(S32 offset) { reset(); mCurBufferp += offset;} - void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = FALSE; } + void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = nullptr; mBufferSize = 0; mWriteEnabled = FALSE; } void assignBuffer(U8 *bufferp, S32 size) { if(mBufferp && mBufferp != bufferp) @@ -185,9 +186,9 @@ public: } const LLDataPackerBinaryBuffer& operator=(const LLDataPackerBinaryBuffer &a); - /*virtual*/ BOOL hasNext() const { return getCurrentSize() < getBufferSize(); } + /*virtual*/ BOOL hasNext() const override { return getCurrentSize() < getBufferSize(); } - /*virtual*/ void dumpBufferToLog(); + /*virtual*/ void dumpBufferToLog() override; protected: inline BOOL verifyLength(const S32 data_size, const char *name); @@ -223,56 +224,56 @@ public: LLDataPackerAsciiBuffer() { - mBufferp = NULL; - mCurBufferp = NULL; + mBufferp = nullptr; + mCurBufferp = nullptr; mBufferSize = 0; mPassFlags = 0; mIncludeNames = FALSE; mWriteEnabled = FALSE; } - /*virtual*/ BOOL packString(const std::string& value, const char *name); - /*virtual*/ BOOL unpackString(std::string& value, const char *name); + /*virtual*/ BOOL packString(const std::string& value, const char *name) override; + /*virtual*/ BOOL unpackString(std::string& value, const char *name) override; - /*virtual*/ BOOL packBinaryData(const U8 *value, S32 size, const char *name); - /*virtual*/ BOOL unpackBinaryData(U8 *value, S32 &size, const char *name); + /*virtual*/ BOOL packBinaryData(const U8 *value, S32 size, const char *name) override; + /*virtual*/ BOOL unpackBinaryData(U8 *value, S32 &size, const char *name) override; // Constant size binary data packing - /*virtual*/ BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name); - /*virtual*/ BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name); + /*virtual*/ BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name) override; + /*virtual*/ BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name) override; - /*virtual*/ BOOL packU8(const U8 value, const char *name); - /*virtual*/ BOOL unpackU8(U8 &value, const char *name); + /*virtual*/ BOOL packU8(const U8 value, const char *name) override; + /*virtual*/ BOOL unpackU8(U8 &value, const char *name) override; - /*virtual*/ BOOL packU16(const U16 value, const char *name); - /*virtual*/ BOOL unpackU16(U16 &value, const char *name); + /*virtual*/ BOOL packU16(const U16 value, const char *name) override; + /*virtual*/ BOOL unpackU16(U16 &value, const char *name) override; - /*virtual*/ BOOL packU32(const U32 value, const char *name); - /*virtual*/ BOOL unpackU32(U32 &value, const char *name); + /*virtual*/ BOOL packU32(const U32 value, const char *name) override; + /*virtual*/ BOOL unpackU32(U32 &value, const char *name) override; - /*virtual*/ BOOL packS32(const S32 value, const char *name); - /*virtual*/ BOOL unpackS32(S32 &value, const char *name); + /*virtual*/ BOOL packS32(const S32 value, const char *name) override; + /*virtual*/ BOOL unpackS32(S32 &value, const char *name) override; - /*virtual*/ BOOL packF32(const F32 value, const char *name); - /*virtual*/ BOOL unpackF32(F32 &value, const char *name); + /*virtual*/ BOOL packF32(const F32 value, const char *name) override; + /*virtual*/ BOOL unpackF32(F32 &value, const char *name) override; - /*virtual*/ BOOL packColor4(const LLColor4 &value, const char *name); - /*virtual*/ BOOL unpackColor4(LLColor4 &value, const char *name); + /*virtual*/ BOOL packColor4(const LLColor4 &value, const char *name) override; + /*virtual*/ BOOL unpackColor4(LLColor4 &value, const char *name) override; - /*virtual*/ BOOL packColor4U(const LLColor4U &value, const char *name); - /*virtual*/ BOOL unpackColor4U(LLColor4U &value, const char *name); + /*virtual*/ BOOL packColor4U(const LLColor4U &value, const char *name) override; + /*virtual*/ BOOL unpackColor4U(LLColor4U &value, const char *name) override; - /*virtual*/ BOOL packVector2(const LLVector2 &value, const char *name); - /*virtual*/ BOOL unpackVector2(LLVector2 &value, const char *name); + /*virtual*/ BOOL packVector2(const LLVector2 &value, const char *name) override; + /*virtual*/ BOOL unpackVector2(LLVector2 &value, const char *name) override; - /*virtual*/ BOOL packVector3(const LLVector3 &value, const char *name); - /*virtual*/ BOOL unpackVector3(LLVector3 &value, const char *name); + /*virtual*/ BOOL packVector3(const LLVector3 &value, const char *name) override; + /*virtual*/ BOOL unpackVector3(LLVector3 &value, const char *name) override; - /*virtual*/ BOOL packVector4(const LLVector4 &value, const char *name); - /*virtual*/ BOOL unpackVector4(LLVector4 &value, const char *name); + /*virtual*/ BOOL packVector4(const LLVector4 &value, const char *name) override; + /*virtual*/ BOOL unpackVector4(LLVector4 &value, const char *name) override; - /*virtual*/ BOOL packUUID(const LLUUID &value, const char *name); - /*virtual*/ BOOL unpackUUID(LLUUID &value, const char *name); + /*virtual*/ BOOL packUUID(const LLUUID &value, const char *name) override; + /*virtual*/ BOOL unpackUUID(LLUUID &value, const char *name) override; void setIncludeNames(BOOL b) { mIncludeNames = b; } @@ -280,9 +281,10 @@ public: S32 getCurrentSize() const { return (S32)(mCurBufferp - mBufferp) + 1; } S32 getBufferSize() const { return mBufferSize; } - /*virtual*/ void reset() { mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != NULL); } + /*virtual*/ void reset() override + { mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != nullptr); } - /*virtual*/ BOOL hasNext() const { return getCurrentSize() < getBufferSize(); } + /*virtual*/ BOOL hasNext() const override { return getCurrentSize() < getBufferSize(); } inline void freeBuffer(); inline void assignBuffer(char* bufferp, S32 size); @@ -304,7 +306,7 @@ protected: inline void LLDataPackerAsciiBuffer::freeBuffer() { delete [] mBufferp; - mBufferp = mCurBufferp = NULL; + mBufferp = mCurBufferp = nullptr; mBufferSize = 0; mWriteEnabled = FALSE; } @@ -336,17 +338,17 @@ public: : LLDataPacker(), mIndent(indent), mFP(fp), - mOutputStream(NULL), - mInputStream(NULL) + mOutputStream(nullptr), + mInputStream(nullptr) { } LLDataPackerAsciiFile(std::ostream& output_stream, const S32 indent = 2) : LLDataPacker(), mIndent(indent), - mFP(NULL), + mFP(nullptr), mOutputStream(&output_stream), - mInputStream(NULL) + mInputStream(nullptr) { mWriteEnabled = TRUE; } @@ -354,58 +356,58 @@ public: LLDataPackerAsciiFile(std::istream& input_stream, const S32 indent = 2) : LLDataPacker(), mIndent(indent), - mFP(NULL), - mOutputStream(NULL), + mFP(nullptr), + mOutputStream(nullptr), mInputStream(&input_stream) { } - /*virtual*/ BOOL packString(const std::string& value, const char *name); - /*virtual*/ BOOL unpackString(std::string& value, const char *name); + /*virtual*/ BOOL packString(const std::string& value, const char *name) override; + /*virtual*/ BOOL unpackString(std::string& value, const char *name) override; - /*virtual*/ BOOL packBinaryData(const U8 *value, S32 size, const char *name); - /*virtual*/ BOOL unpackBinaryData(U8 *value, S32 &size, const char *name); + /*virtual*/ BOOL packBinaryData(const U8 *value, S32 size, const char *name) override; + /*virtual*/ BOOL unpackBinaryData(U8 *value, S32 &size, const char *name) override; - /*virtual*/ BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name); - /*virtual*/ BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name); + /*virtual*/ BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name) override; + /*virtual*/ BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name) override; - /*virtual*/ BOOL packU8(const U8 value, const char *name); - /*virtual*/ BOOL unpackU8(U8 &value, const char *name); + /*virtual*/ BOOL packU8(const U8 value, const char *name) override; + /*virtual*/ BOOL unpackU8(U8 &value, const char *name) override; - /*virtual*/ BOOL packU16(const U16 value, const char *name); - /*virtual*/ BOOL unpackU16(U16 &value, const char *name); + /*virtual*/ BOOL packU16(const U16 value, const char *name) override; + /*virtual*/ BOOL unpackU16(U16 &value, const char *name) override; - /*virtual*/ BOOL packU32(const U32 value, const char *name); - /*virtual*/ BOOL unpackU32(U32 &value, const char *name); + /*virtual*/ BOOL packU32(const U32 value, const char *name) override; + /*virtual*/ BOOL unpackU32(U32 &value, const char *name) override; - /*virtual*/ BOOL packS32(const S32 value, const char *name); - /*virtual*/ BOOL unpackS32(S32 &value, const char *name); + /*virtual*/ BOOL packS32(const S32 value, const char *name) override; + /*virtual*/ BOOL unpackS32(S32 &value, const char *name) override; - /*virtual*/ BOOL packF32(const F32 value, const char *name); - /*virtual*/ BOOL unpackF32(F32 &value, const char *name); + /*virtual*/ BOOL packF32(const F32 value, const char *name) override; + /*virtual*/ BOOL unpackF32(F32 &value, const char *name) override; - /*virtual*/ BOOL packColor4(const LLColor4 &value, const char *name); - /*virtual*/ BOOL unpackColor4(LLColor4 &value, const char *name); + /*virtual*/ BOOL packColor4(const LLColor4 &value, const char *name) override; + /*virtual*/ BOOL unpackColor4(LLColor4 &value, const char *name) override; - /*virtual*/ BOOL packColor4U(const LLColor4U &value, const char *name); - /*virtual*/ BOOL unpackColor4U(LLColor4U &value, const char *name); + /*virtual*/ BOOL packColor4U(const LLColor4U &value, const char *name) override; + /*virtual*/ BOOL unpackColor4U(LLColor4U &value, const char *name) override; - /*virtual*/ BOOL packVector2(const LLVector2 &value, const char *name); - /*virtual*/ BOOL unpackVector2(LLVector2 &value, const char *name); + /*virtual*/ BOOL packVector2(const LLVector2 &value, const char *name) override; + /*virtual*/ BOOL unpackVector2(LLVector2 &value, const char *name) override; - /*virtual*/ BOOL packVector3(const LLVector3 &value, const char *name); - /*virtual*/ BOOL unpackVector3(LLVector3 &value, const char *name); + /*virtual*/ BOOL packVector3(const LLVector3 &value, const char *name) override; + /*virtual*/ BOOL unpackVector3(LLVector3 &value, const char *name) override; - /*virtual*/ BOOL packVector4(const LLVector4 &value, const char *name); - /*virtual*/ BOOL unpackVector4(LLVector4 &value, const char *name); + /*virtual*/ BOOL packVector4(const LLVector4 &value, const char *name) override; + /*virtual*/ BOOL unpackVector4(LLVector4 &value, const char *name) override; - /*virtual*/ BOOL packUUID(const LLUUID &value, const char *name); - /*virtual*/ BOOL unpackUUID(LLUUID &value, const char *name); + /*virtual*/ BOOL packUUID(const LLUUID &value, const char *name) override; + /*virtual*/ BOOL unpackUUID(LLUUID &value, const char *name) override; protected: void writeIndentedName(const char *name); BOOL getValueStr(const char *name, char *out_value, const S32 value_len); - /*virtual*/ BOOL hasNext() const { return true; } + /*virtual*/ BOOL hasNext() const override { return true; } protected: S32 mIndent; diff --git a/indra/llmessage/lldispatcher.cpp b/indra/llmessage/lldispatcher.cpp index c05a88f3c70b521b8cd5289d28168131a25c0abf..e6b0ef7abf140b21642f4f1cfb777c96d63f689a 100644 --- a/indra/llmessage/lldispatcher.cpp +++ b/indra/llmessage/lldispatcher.cpp @@ -85,7 +85,7 @@ LLDispatchHandler* LLDispatcher::addHandler( const key_t& name, LLDispatchHandler* func) { dispatch_map_t::iterator it = mHandlers.find(name); - LLDispatchHandler* old_handler = NULL; + LLDispatchHandler* old_handler = nullptr; if(it != mHandlers.end()) { old_handler = (*it).second; diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index 2e021cf41e3c7f9b305d834efc5b24aae871ebfc..6be9e3faefe0637bae13d792b3227b11ea346416 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -524,7 +524,7 @@ void LLExperienceCache::get(const LLUUID& key, LLExperienceCache::ExperienceGetF fetch(key); - signal_ptr signal = signal_ptr(new callback_signal_t()); + signal_ptr signal = boost::make_shared<callback_signal_t>(); std::pair<signal_map_t::iterator, bool> result = mSignalMap.insert(signal_map_t::value_type(key, signal)); if (!result.second) diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 0643e406cbf4b691072045011fe56aa10cb83198..307e2b47a8491afceae1d8540d6d553a81acb08c 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -105,7 +105,7 @@ public: private: virtual ~LLExperienceCache(); - virtual void initSingleton(); + void initSingleton() override; typedef boost::function<LLSD(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, LLCore::HttpRequest::ptr_t, std::string)> permissionInvoker_fn; diff --git a/indra/llmessage/llfiltersd2xmlrpc.cpp b/indra/llmessage/llfiltersd2xmlrpc.cpp index 305e95fe81c9240fa283b4b05d9395e7a815d912..6fe0c6e6df5470246929d61e6721c8eef8527e7a 100644 --- a/indra/llmessage/llfiltersd2xmlrpc.cpp +++ b/indra/llmessage/llfiltersd2xmlrpc.cpp @@ -606,11 +606,11 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl( // *FIX: This technique for reading data is far from optimal. We // need to have some kind of istream interface into the xml // parser... - S32 bytes = buffer->countAfter(channels.in(), NULL); + S32 bytes = buffer->countAfter(channels.in(), nullptr); if(!bytes) return STATUS_ERROR; char* buf = new char[bytes + 1]; buf[bytes] = '\0'; - buffer->readAfter(channels.in(), NULL, (U8*)buf, bytes); + buffer->readAfter(channels.in(), nullptr, (U8*)buf, bytes); //LL_DEBUGS() << "xmlrpc response: " << buf << LL_ENDL; @@ -618,7 +618,7 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl( XMLRPC_REQUEST response = XMLRPC_REQUEST_FromXML( buf, bytes, - NULL); + nullptr); if(!response) { LL_WARNS() << "XML -> SD Response unable to parse xml." << LL_ENDL; @@ -690,11 +690,11 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl( // *FIX: This technique for reading data is far from optimal. We // need to have some kind of istream interface into the xml // parser... - S32 bytes = buffer->countAfter(channels.in(), NULL); + S32 bytes = buffer->countAfter(channels.in(), nullptr); if(!bytes) return STATUS_ERROR; char* buf = new char[bytes + 1]; buf[bytes] = '\0'; - buffer->readAfter(channels.in(), NULL, (U8*)buf, bytes); + buffer->readAfter(channels.in(), nullptr, (U8*)buf, bytes); //LL_DEBUGS() << "xmlrpc request: " << buf << LL_ENDL; @@ -720,7 +720,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl( XMLRPC_REQUEST request = XMLRPC_REQUEST_FromXML( buf, bytes, - NULL); + nullptr); if(!request) { LL_WARNS() << "XML -> SD Request process parse error." << LL_ENDL; diff --git a/indra/llmessage/llfiltersd2xmlrpc.h b/indra/llmessage/llfiltersd2xmlrpc.h index 0c9a0dc95bcf2f50b8f1cad4263735e0951b68ef..cfd65797fd98362e9dd5c5def3f463792594930f 100644 --- a/indra/llmessage/llfiltersd2xmlrpc.h +++ b/indra/llmessage/llfiltersd2xmlrpc.h @@ -98,12 +98,12 @@ protected: /** * @brief Process the data in buffer. */ - virtual EStatus process_impl( + EStatus process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, bool& eos, LLSD& context, - LLPumpIO* pump); + LLPumpIO* pump) override; //@} }; @@ -157,12 +157,12 @@ protected: /** * @brief Process the data in buffer. */ - virtual EStatus process_impl( + EStatus process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, bool& eos, LLSD& context, - LLPumpIO* pump); + LLPumpIO* pump) override; //@} protected: @@ -201,12 +201,12 @@ protected: /** * @brief Process the data in buffer. */ - virtual EStatus process_impl( + EStatus process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, bool& eos, LLSD& context, - LLPumpIO* pump); + LLPumpIO* pump) override; //@} protected: @@ -244,12 +244,12 @@ protected: /** * @brief Process the data in buffer. */ - virtual EStatus process_impl( + EStatus process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, bool& eos, LLSD& context, - LLPumpIO* pump); + LLPumpIO* pump) override; //@} protected: diff --git a/indra/llmessage/llhttpnode.cpp b/indra/llmessage/llhttpnode.cpp index d4a060c952a539a007b8ccc6173c53b450a69808..c9cfe924d560216e82aab8bb54f37dfef89ffe6b 100644 --- a/indra/llmessage/llhttpnode.cpp +++ b/indra/llmessage/llhttpnode.cpp @@ -58,7 +58,7 @@ public: std::string mWildcardKey; LLHTTPNode* mParentNode; - Impl() : mWildcardChild(NULL), mParentNode(NULL) { } + Impl() : mWildcardChild(nullptr), mParentNode(nullptr) { } LLHTTPNode* findNamedChild(const std::string& name) const; }; @@ -219,7 +219,7 @@ LLHTTPNode* LLHTTPNode::getChild(const std::string& name, LLSD& context) const return impl.mWildcardChild; } - return NULL; + return nullptr; } @@ -429,7 +429,7 @@ void LLHTTPNode::describe(Description& desc) const const LLChainIOFactory* LLHTTPNode::getProtocolHandler() const { - return NULL; + return nullptr; } diff --git a/indra/llmessage/llhttpnode.h b/indra/llmessage/llhttpnode.h index 1144d88be16dfb62864b36e4c85ae065efab14c7..839ccb9f2c79c925ce5205dc137354eb7e19a912 100644 --- a/indra/llmessage/llhttpnode.h +++ b/indra/llmessage/llhttpnode.h @@ -303,10 +303,10 @@ class LLSimpleResponse : public LLHTTPNode::Response public: static LLPointer<LLSimpleResponse> create(); - void result(const LLSD& result); - void extendedResult(S32 code, const std::string& body, const LLSD& headers); - void extendedResult(S32 code, const LLSD& result, const LLSD& headers); - void status(S32 code, const std::string& message); + void result(const LLSD& result) override; + void extendedResult(S32 code, const std::string& body, const LLSD& headers) override; + void extendedResult(S32 code, const LLSD& result, const LLSD& headers) override; + void status(S32 code, const std::string& message) override; void print(std::ostream& out) const; @@ -373,7 +373,7 @@ private: class ThisNodeFactory : public LLHTTPRegistrar::NodeFactory { public: - virtual LLHTTPNode* build() const { return new NodeType; } + LLHTTPNode* build() const override { return new NodeType; } }; ThisNodeFactory mFactory; @@ -394,7 +394,7 @@ private: { public: ThisNodeFactory(LLSD params) : mParams(params) {} - virtual LLHTTPNode* build() const { return new NodeType(mParams); } + LLHTTPNode* build() const override { return new NodeType(mParams); } private: LLSD mParams; }; diff --git a/indra/llmessage/llhttpnodeadapter.h b/indra/llmessage/llhttpnodeadapter.h index 22984c4478cf5f668a2a88780f11f3e0d6bcb4cf..873048003859213b3783a7c1adc1a1c1df32bfc0 100644 --- a/indra/llmessage/llhttpnodeadapter.h +++ b/indra/llmessage/llhttpnodeadapter.h @@ -34,15 +34,15 @@ class LLHTTPNodeAdapter : public LLHTTPNode { public: - virtual bool validate(const std::string& name, LLSD& context) const + bool validate(const std::string& name, LLSD& context) const override { T node; return node.validate(name, context); } - - virtual void post(LLHTTPNode::ResponsePtr response, + + void post(LLHTTPNode::ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { T node; return node.post(response, context, input); diff --git a/indra/llmessage/llhttpsdhandler.h b/indra/llmessage/llhttpsdhandler.h index ce40bdfc08f98c3736f78fd99d13e7ced3398893..032449277da43dc5ceefc10c69454639613338a6 100644 --- a/indra/llmessage/llhttpsdhandler.h +++ b/indra/llmessage/llhttpsdhandler.h @@ -41,7 +41,7 @@ class LLHttpSDHandler : public LLCore::HttpHandler //, { public: - virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) override; protected: LLHttpSDHandler(); diff --git a/indra/llmessage/llinstantmessage.cpp b/indra/llmessage/llinstantmessage.cpp index d1d7383ffa8be56c5c5d2a8c307207fb4d555ba3..14ff652d53a68801ad36726249235d6eb78f775c 100644 --- a/indra/llmessage/llinstantmessage.cpp +++ b/indra/llmessage/llinstantmessage.cpp @@ -239,7 +239,7 @@ void pack_instant_message_block( } else { - msg->addStringFast(_PREHASH_Message, NULL); + msg->addStringFast(_PREHASH_Message, nullptr); } const U8* bb; if(binary_bucket) diff --git a/indra/llmessage/lliobuffer.cpp b/indra/llmessage/lliobuffer.cpp index 5f318cc7cb7276eaa4c8184682ed83f54d381d19..fbfc4271d06442e86e2d0f3454996bf2a270065f 100644 --- a/indra/llmessage/lliobuffer.cpp +++ b/indra/llmessage/lliobuffer.cpp @@ -35,10 +35,10 @@ // LLIOBuffer // LLIOBuffer::LLIOBuffer() : - mBuffer(NULL), + mBuffer(nullptr), mBufferSize(0L), - mReadHead(NULL), - mWriteHead(NULL) + mReadHead(nullptr), + mWriteHead(nullptr) { } diff --git a/indra/llmessage/lliobuffer.h b/indra/llmessage/lliobuffer.h index 334984894791130cc640173b514f14e3d347f5e0..9c166692d743e4c1aa3e3723323bc1f24bbdb6b8 100644 --- a/indra/llmessage/lliobuffer.h +++ b/indra/llmessage/lliobuffer.h @@ -117,12 +117,12 @@ protected: /** * @brief Process the data in buffer */ - virtual EStatus process_impl( + EStatus process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, bool& eos, LLSD& context, - LLPumpIO* pump); + LLPumpIO* pump) override; //@} protected: diff --git a/indra/llmessage/lliohttpserver.h b/indra/llmessage/lliohttpserver.h index a23eafe58a2c53cd3e5bd9b94681b7acbee89a3a..2b37566cc11f59afd44a2b69a4225495666d6a5f 100644 --- a/indra/llmessage/lliohttpserver.h +++ b/indra/llmessage/lliohttpserver.h @@ -95,7 +95,7 @@ template<class Pipe> class LLChainIOFactoryForPipe : public LLChainIOFactory { public: - virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const + bool build(LLPumpIO::chain_t& chain, LLSD context) const override { chain.push_back(LLIOPipe::ptr_t(new Pipe)); return true; @@ -106,8 +106,8 @@ template<class Factory> class LLHTTPNodeForFactory : public LLHTTPNode { public: - const LLChainIOFactory* getProtocolHandler() const - { return &mProtocolHandler; } + const LLChainIOFactory* getProtocolHandler() const override + { return &mProtocolHandler; } private: Factory mProtocolHandler; diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp index 7c308db35e16f05443cf276b686f70d5237aa42b..182ec22fe5e7b04855a8e0ddb36d7dfa33e54a2a 100644 --- a/indra/llmessage/lliosocket.cpp +++ b/indra/llmessage/lliosocket.cpp @@ -106,8 +106,8 @@ void ll_debug_socket(const char* msg, apr_socket_t* apr_sock) LLSocket::ptr_t LLSocket::create(apr_pool_t* pool, EType type, U16 port) { LLSocket::ptr_t rv; - apr_socket_t* socket = NULL; - apr_pool_t* new_pool = NULL; + apr_socket_t* socket = nullptr; + apr_pool_t* new_pool = nullptr; apr_status_t status = APR_EGENERAL; // create a pool for the socket @@ -149,7 +149,7 @@ LLSocket::ptr_t LLSocket::create(apr_pool_t* pool, EType type, U16 port) rv = ptr_t(new LLSocket(socket, new_pool)); if(port > 0) { - apr_sockaddr_t* sa = NULL; + apr_sockaddr_t* sa = nullptr; status = apr_sockaddr_info_get( &sa, APR_ANYADDR, @@ -217,7 +217,7 @@ LLSocket::ptr_t LLSocket::create(apr_socket_t* socket, apr_pool_t* pool) bool LLSocket::blockingConnect(const LLHost& host) { if(!mSocket) return false; - apr_sockaddr_t* sa = NULL; + apr_sockaddr_t* sa = nullptr; std::string ip_address; ip_address = host.getIPString(); if(ll_apr_warn_status(apr_sockaddr_info_get( @@ -252,7 +252,7 @@ LLSocket::~LLSocket() { ll_debug_socket("Destroying socket", mSocket); apr_socket_close(mSocket); - mSocket = NULL; + mSocket = nullptr; } if(mPool) { @@ -324,12 +324,12 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl( LL_DEBUGS() << "Initializing poll descriptor for LLIOSocketReader." << LL_ENDL; apr_pollfd_t poll_fd; - poll_fd.p = NULL; + poll_fd.p = nullptr; poll_fd.desc_type = APR_POLL_SOCKET; poll_fd.reqevents = APR_POLLIN; poll_fd.rtnevents = 0x0; poll_fd.desc.s = mSource->getSocket(); - poll_fd.client_data = NULL; + poll_fd.client_data = nullptr; pump->setConditional(this, &poll_fd); } } @@ -359,7 +359,7 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl( // *FIX: Should we shut down the socket read? if(pump) { - pump->setConditional(this, NULL); + pump->setConditional(this, nullptr); } rv = STATUS_DONE; eos = true; @@ -389,7 +389,7 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl( LLIOSocketWriter::LLIOSocketWriter(LLSocket::ptr_t socket) : mDestination(socket), - mLastWritten(NULL), + mLastWritten(nullptr), mInitialized(false) { } @@ -423,12 +423,12 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl( LL_DEBUGS() << "Initializing poll descriptor for LLIOSocketWriter." << LL_ENDL; apr_pollfd_t poll_fd; - poll_fd.p = NULL; + poll_fd.p = nullptr; poll_fd.desc_type = APR_POLL_SOCKET; poll_fd.reqevents = APR_POLLOUT; poll_fd.rtnevents = 0x0; poll_fd.desc.s = mDestination->getSocket(); - poll_fd.client_data = NULL; + poll_fd.client_data = nullptr; pump->setConditional(this, &poll_fd); } } @@ -580,12 +580,12 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( LL_DEBUGS() << "Initializing poll descriptor for LLIOServerSocket." << LL_ENDL; apr_pollfd_t poll_fd; - poll_fd.p = NULL; + poll_fd.p = nullptr; poll_fd.desc_type = APR_POLL_SOCKET; poll_fd.reqevents = APR_POLLIN; poll_fd.rtnevents = 0x0; poll_fd.desc.s = mListenSocket->getSocket(); - poll_fd.client_data = NULL; + poll_fd.client_data = nullptr; pump->setConditional(this, &poll_fd); mInitialized = true; return STATUS_OK; @@ -596,7 +596,7 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( LL_DEBUGS() << "accepting socket" << LL_ENDL; PUMP_DEBUG; - apr_pool_t* new_pool = NULL; + apr_pool_t* new_pool = nullptr; apr_status_t status = apr_pool_create(&new_pool, mPool); if(ll_apr_warn_status(status)) { @@ -607,7 +607,7 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( return STATUS_ERROR; } - apr_socket_t* socket = NULL; + apr_socket_t* socket = nullptr; status = apr_socket_accept( &socket, mListenSocket->getSocket(), diff --git a/indra/llmessage/lliosocket.h b/indra/llmessage/lliosocket.h index 95495c69807fa21562d8432147aa666096688d01..14627250734c4638fabd27c4339ee3ec60388166 100644 --- a/indra/llmessage/lliosocket.h +++ b/indra/llmessage/lliosocket.h @@ -220,12 +220,12 @@ protected: * @param context A data structure to pass structured data * @return STATUS_OK unless the preconditions are not met. */ - virtual EStatus process_impl( + EStatus process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, bool& eos, LLSD& context, - LLPumpIO* pump); + LLPumpIO* pump) override; //@} protected: @@ -266,12 +266,12 @@ protected: * @param context A data structure to pass structured data * @return A return code for the write. */ - virtual EStatus process_impl( + EStatus process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, bool& eos, LLSD& context, - LLPumpIO* pump); + LLPumpIO* pump) override; //@} protected: @@ -325,12 +325,12 @@ protected: /** * @brief Process the data in buffer */ - virtual EStatus process_impl( + EStatus process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, bool& eos, LLSD& context, - LLPumpIO* pump); + LLPumpIO* pump) override; //@} protected: diff --git a/indra/llmessage/llioutil.h b/indra/llmessage/llioutil.h index e8d245f530bdf0deb829fb4b8b7ac731def1f7bb..ffe1a1683fd9a1f328e816f0bbbe6c10e11018c3 100644 --- a/indra/llmessage/llioutil.h +++ b/indra/llmessage/llioutil.h @@ -59,7 +59,7 @@ protected: buffer_ptr_t& buffer, bool& eos, LLSD& context, - LLPumpIO* pump); + LLPumpIO* pump) override; //@} protected: }; @@ -88,7 +88,7 @@ protected: buffer_ptr_t& buffer, bool& eos, LLSD& context, - LLPumpIO* pump); + LLPumpIO* pump) override; //@} protected: F64 mSeconds; @@ -120,7 +120,7 @@ protected: buffer_ptr_t& buffer, bool& eos, LLSD& context, - LLPumpIO* pump); + LLPumpIO* pump) override; //@} protected: diff --git a/indra/llmessage/llmessageconfig.h b/indra/llmessage/llmessageconfig.h index 19f17ba9a8618b350cc3ae86377f06519a849e35..edb5628062756277ea8e9f3d4dee03b8420fc1ec 100644 --- a/indra/llmessage/llmessageconfig.h +++ b/indra/llmessage/llmessageconfig.h @@ -80,7 +80,7 @@ public: static LLMessageConfigFile& instance(); // return the singleton configuration file - /* virtual */ bool loadFile(); + /* virtual */ bool loadFile() override; void loadServerDefaults(const LLSD& data); void loadMaxQueuedEvents(const LLSD& data); void loadMessages(const LLSD& data); diff --git a/indra/llmessage/llmessagelog.cpp b/indra/llmessage/llmessagelog.cpp index 856f25a1876faba8ddb39c344a80f780179840b5..1e8bb5067cdebc1efbd87a723860b082879789dd 100644 --- a/indra/llmessage/llmessagelog.cpp +++ b/indra/llmessage/llmessagelog.cpp @@ -28,7 +28,7 @@ LLMessageLogEntry::LLMessageLogEntry() mFromHost(LLHost()), mToHost(LLHost()), mDataSize(0), - mData(NULL) + mData(nullptr) { } @@ -37,7 +37,7 @@ LLMessageLogEntry::LLMessageLogEntry(EType type, LLHost from_host, LLHost to_hos mFromHost(from_host), mToHost(to_host), mDataSize(data_size), - mData(NULL) + mData(nullptr) { if(data) { @@ -61,11 +61,11 @@ LLMessageLogEntry::LLMessageLogEntry(EType type, const std::string& url, const L if(buffer.get()) { S32 channel = type == HTTP_REQUEST ? channels.out() : channels.in(); - mDataSize = buffer->countAfter(channel, NULL); + mDataSize = buffer->countAfter(channel, nullptr); if (mDataSize > 0) { mData = new U8[mDataSize + 1]; - buffer->readAfter(channel, NULL, mData, mDataSize); + buffer->readAfter(channel, nullptr, mData, mDataSize); //make sure this is null terminated, since it's going to be used stringified mData[mDataSize] = '\0'; @@ -92,14 +92,14 @@ LLMessageLogEntry::LLMessageLogEntry(const LLMessageLogEntry& entry) LLMessageLogEntry::~LLMessageLogEntry() { delete[] mData; - mData = NULL; + mData = nullptr; } -LogCallback LLMessageLog::sCallback = NULL; +LogCallback LLMessageLog::sCallback = nullptr; void LLMessageLog::setCallback(LogCallback callback) { - if (callback != NULL) + if (callback != nullptr) { for (auto& m : sRingBuffer) { @@ -111,9 +111,9 @@ void LLMessageLog::setCallback(LogCallback callback) void LLMessageLog::log(LLHost from_host, LLHost to_host, U8* data, S32 data_size) { - if(!data_size || data == NULL) return; + if(!data_size || data == nullptr) return; - LogPayload payload = LogPayload(new LLMessageLogEntry(LLMessageLogEntry::TEMPLATE, from_host, to_host, data, data_size)); + LogPayload payload = std::make_shared<LLMessageLogEntry>(LLMessageLogEntry::TEMPLATE, from_host, to_host, data, data_size); if(sCallback) sCallback(payload); @@ -123,8 +123,8 @@ void LLMessageLog::log(LLHost from_host, LLHost to_host, U8* data, S32 data_size void LLMessageLog::logHTTPRequest(const std::string& url, EHTTPMethod method, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer, const LLSD& headers, U64 request_id) { - LogPayload payload = LogPayload(new LLMessageLogEntry(LLMessageLogEntry::HTTP_REQUEST, url, channels, buffer, - headers, request_id, method)); + LogPayload payload = std::make_shared<LLMessageLogEntry>(LLMessageLogEntry::HTTP_REQUEST, url, channels, buffer, + headers, request_id, method); if (sCallback) sCallback(payload); sRingBuffer.push_back(std::move(payload)); @@ -133,8 +133,8 @@ void LLMessageLog::logHTTPRequest(const std::string& url, EHTTPMethod method, co void LLMessageLog::logHTTPResponse(U32 status_code, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer, const LLSD& headers, U64 request_id) { - LogPayload payload = LogPayload(new LLMessageLogEntry(LLMessageLogEntry::HTTP_RESPONSE, "", channels, buffer, - headers, request_id, HTTP_INVALID, status_code)); + LogPayload payload = std::make_shared<LLMessageLogEntry>(LLMessageLogEntry::HTTP_RESPONSE, "", channels, buffer, + headers, request_id, HTTP_INVALID, status_code); if (sCallback) sCallback(payload); sRingBuffer.push_back(std::move(payload)); diff --git a/indra/llmessage/llmessagelog.h b/indra/llmessage/llmessagelog.h index 3f131f95de46c07ec0a4f730829e003b1568e97a..5de391413602015816716b6af593cbdbf1656953 100644 --- a/indra/llmessage/llmessagelog.h +++ b/indra/llmessage/llmessagelog.h @@ -74,7 +74,7 @@ public: static void logHTTPResponse(U32 status_code, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer, const LLSD& headers, U64 request_id); - static bool haveLogger(){return sCallback != NULL;} + static bool haveLogger(){return sCallback != nullptr;} private: static LogCallback sCallback; diff --git a/indra/llmessage/llmessagetemplate.h b/indra/llmessage/llmessagetemplate.h index 37a18ee0c91b2c818387100eb713dafe1c60e834..3c051eb05fb23c977f694d29eb6146a404e3ae33 100644 --- a/indra/llmessage/llmessagetemplate.h +++ b/indra/llmessage/llmessagetemplate.h @@ -34,11 +34,11 @@ class LLMsgVarData { public: - LLMsgVarData() : mName(NULL), mSize(-1), mDataSize(-1), mData(NULL), mType(MVT_U8) + LLMsgVarData() : mName(nullptr), mSize(-1), mDataSize(-1), mData(nullptr), mType(MVT_U8) { } - LLMsgVarData(const char *name, EMsgVariableType type) : mSize(-1), mDataSize(-1), mData(NULL), mType(type) + LLMsgVarData(const char *name, EMsgVariableType type) : mSize(-1), mDataSize(-1), mData(nullptr), mType(type) { mName = (char *)name; } @@ -51,7 +51,7 @@ public: void deleteData() { delete[] mData; - mData = NULL; + mData = nullptr; } void addData(const void *indata, S32 size, EMsgVariableType type, S32 data_size = -1); @@ -139,7 +139,7 @@ public: class LLMessageVariable { public: - LLMessageVariable() : mName(NULL), mType(MVT_NULL), mSize(-1) + LLMessageVariable() : mName(nullptr), mType(MVT_NULL), mSize(-1) { } @@ -192,7 +192,7 @@ public: void addVariable(char *name, const EMsgVariableType type, const S32 size) { LLMessageVariable** varp = &mMemberVariables[name]; - if (*varp != NULL) + if (*varp != nullptr) { LL_ERRS() << name << " has already been used as a variable name!" << LL_ENDL; } @@ -270,7 +270,7 @@ public: LLMessageTemplate(const char *name, U32 message_number, EMsgFrequency freq) : //mMemberBlocks(), - mName(NULL), + mName(nullptr), mFrequency(freq), mTrust(MT_NOTRUST), mEncoding(ME_ZEROCODED), @@ -298,7 +298,7 @@ public: void addBlock(LLMessageBlock *blockp) { LLMessageBlock** member_blockp = &mMemberBlocks[blockp->mName]; - if (*member_blockp != NULL) + if (*member_blockp != nullptr) { LL_ERRS() << "Block " << blockp->mName << "has already been used as a block name!" << LL_ENDL; diff --git a/indra/llmessage/llmessagetemplateparser.cpp b/indra/llmessage/llmessagetemplateparser.cpp index 86fcd95acfa21f4516bfaf9990ab8dfc95d33fc7..d21762ebccec720aaabd4bd66089f13f62476170 100644 --- a/indra/llmessage/llmessagetemplateparser.cpp +++ b/indra/llmessage/llmessagetemplateparser.cpp @@ -431,10 +431,10 @@ LLTemplateParser::message_iterator LLTemplateParser::getMessagesEnd() const // static LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) { - LLMessageTemplate *templatep = NULL; + LLMessageTemplate *templatep = nullptr; if(!tokens.want("{")) { - return NULL; + return nullptr; } // name first @@ -467,7 +467,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) } // TODO more explicit checking here pls - U32 message_number = strtoul(tokens.next().c_str(),NULL,0); + U32 message_number = strtoul(tokens.next().c_str(), nullptr,0); switch (frequency) { case MFT_HIGH: @@ -555,11 +555,11 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) // static LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens) { - LLMessageBlock * blockp = NULL; + LLMessageBlock * blockp = nullptr; if(!tokens.want("{")) { - return NULL; + return nullptr; } // name first @@ -629,10 +629,10 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens) // static LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens) { - LLMessageVariable * varp = NULL; + LLMessageVariable * varp = nullptr; if(!tokens.want("{")) { - return NULL; + return nullptr; } std::string var_name = tokens.next(); diff --git a/indra/llmessage/llnamevalue.cpp b/indra/llmessage/llnamevalue.cpp index e882993c829ba669f99be246b5a52d93ae6c7b02..43cb3e3ae6ae83b203d44f3ea22b583f5bd664e1 100644 --- a/indra/llmessage/llnamevalue.cpp +++ b/indra/llmessage/llnamevalue.cpp @@ -92,8 +92,8 @@ void LLNameValue::baseInit() { mNVNameTable = &gNVNameTable; - mName = NULL; - mNameValueReference.string = NULL; + mName = nullptr; + mNameValueReference.string = nullptr; mType = NVT_NULL; mStringType = NameValueTypeStrings[NVT_NULL]; @@ -299,37 +299,37 @@ LLNameValue::LLNameValue(const char *name, const char *type, const char *nvclass if (!strcmp(mStringType, "STRING")) { mType = NVT_STRING; - mNameValueReference.string = NULL; + mNameValueReference.string = nullptr; } else if (!strcmp(mStringType, "F32")) { mType = NVT_F32; - mNameValueReference.f32 = NULL; + mNameValueReference.f32 = nullptr; } else if (!strcmp(mStringType, "S32")) { mType = NVT_S32; - mNameValueReference.s32 = NULL; + mNameValueReference.s32 = nullptr; } else if (!strcmp(mStringType, "VEC3")) { mType = NVT_VEC3; - mNameValueReference.vec3 = NULL; + mNameValueReference.vec3 = nullptr; } else if (!strcmp(mStringType, "U32")) { mType = NVT_U32; - mNameValueReference.u32 = NULL; + mNameValueReference.u32 = nullptr; } else if (!strcmp(mStringType, "U64")) { mType = NVT_U64; - mNameValueReference.u64 = NULL; + mNameValueReference.u64 = nullptr; } else if(!strcmp(mStringType, (const char*)NameValueTypeStrings[NVT_ASSET])) { mType = NVT_ASSET; - mNameValueReference.string = NULL; + mNameValueReference.string = nullptr; } else { @@ -537,41 +537,41 @@ LLNameValue::LLNameValue(const char *data) LLNameValue::~LLNameValue() { mNVNameTable->removeString(mName); - mName = NULL; + mName = nullptr; switch(mType) { case NVT_STRING: case NVT_ASSET: delete [] mNameValueReference.string; - mNameValueReference.string = NULL; + mNameValueReference.string = nullptr; break; case NVT_F32: delete mNameValueReference.f32; - mNameValueReference.string = NULL; + mNameValueReference.string = nullptr; break; case NVT_S32: delete mNameValueReference.s32; - mNameValueReference.string = NULL; + mNameValueReference.string = nullptr; break; case NVT_VEC3: delete mNameValueReference.vec3; - mNameValueReference.string = NULL; + mNameValueReference.string = nullptr; break; case NVT_U32: delete mNameValueReference.u32; - mNameValueReference.u32 = NULL; + mNameValueReference.u32 = nullptr; break; case NVT_U64: delete mNameValueReference.u64; - mNameValueReference.u64 = NULL; + mNameValueReference.u64 = nullptr; break; default: break; } delete[] mNameValueReference.string; - mNameValueReference.string = NULL; + mNameValueReference.string = nullptr; } char *LLNameValue::getString() @@ -583,7 +583,7 @@ char *LLNameValue::getString() else { LL_ERRS() << mName << " not a string!" << LL_ENDL; - return NULL; + return nullptr; } } @@ -596,7 +596,7 @@ const char *LLNameValue::getAsset() const else { LL_ERRS() << mName << " not an asset!" << LL_ENDL; - return NULL; + return nullptr; } } @@ -609,7 +609,7 @@ F32 *LLNameValue::getF32() else { LL_ERRS() << mName << " not a F32!" << LL_ENDL; - return NULL; + return nullptr; } } @@ -622,7 +622,7 @@ S32 *LLNameValue::getS32() else { LL_ERRS() << mName << " not a S32!" << LL_ENDL; - return NULL; + return nullptr; } } @@ -635,7 +635,7 @@ U32 *LLNameValue::getU32() else { LL_ERRS() << mName << " not a U32!" << LL_ENDL; - return NULL; + return nullptr; } } @@ -648,7 +648,7 @@ U64 *LLNameValue::getU64() else { LL_ERRS() << mName << " not a U64!" << LL_ENDL; - return NULL; + return nullptr; } } @@ -673,7 +673,7 @@ LLVector3 *LLNameValue::getVec3() else { LL_ERRS() << mName << " not a Vec3!" << LL_ENDL; - return NULL; + return nullptr; } } @@ -707,7 +707,7 @@ LLNameValue &LLNameValue::operator=(const LLNameValue &a) delete [] mNameValueReference.string; mNameValueReference.string = new char [strlen(a.mNameValueReference.string) + 1]; /* Flawfinder: ignore */ - if(mNameValueReference.string != NULL) + if(mNameValueReference.string != nullptr) { strcpy(mNameValueReference.string, a.mNameValueReference.string); /* Flawfinder: ignore */ } @@ -751,7 +751,7 @@ void LLNameValue::setString(const char *a) } mNameValueReference.string = new char [strlen(a) + 1]; /* Flawfinder: ignore */ - if(mNameValueReference.string != NULL) + if(mNameValueReference.string != nullptr) { strcpy(mNameValueReference.string, a); /* Flawfinder: ignore */ } @@ -788,7 +788,7 @@ void LLNameValue::setAsset(const char *a) delete [] mNameValueReference.string; } mNameValueReference.string = new char [strlen(a) + 1]; /* Flawfinder: ignore */ - if(mNameValueReference.string != NULL) + if(mNameValueReference.string != nullptr) { strcpy(mNameValueReference.string, a); /* Flawfinder: ignore */ } diff --git a/indra/llmessage/llnullcipher.h b/indra/llmessage/llnullcipher.h index a9f9a1ce037fe95c7a55fb8443228ed76557b915..fbbb6ff70597cd0cdab77cbcd4e1ffdc77dd274f 100644 --- a/indra/llmessage/llnullcipher.h +++ b/indra/llmessage/llnullcipher.h @@ -40,9 +40,9 @@ class LLNullCipher : public LLCipher public: LLNullCipher() {} virtual ~LLNullCipher() {} - virtual U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len); - virtual U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len); - virtual U32 requiredEncryptionSpace(U32 src_len) const; + U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) override; + U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) override; + U32 requiredEncryptionSpace(U32 src_len) const override; }; #endif diff --git a/indra/llmessage/llpacketack.cpp b/indra/llmessage/llpacketack.cpp index 51f07f55c91529bc53ca059ead47c7d112f2bc59..4f091a08c1d8681c30c23969e0860c891dccb9d5 100644 --- a/indra/llmessage/llpacketack.cpp +++ b/indra/llmessage/llpacketack.cpp @@ -44,7 +44,7 @@ LLReliablePacket::LLReliablePacket( U8* buf_ptr, S32 buf_len, LLReliablePacketParams* params) : - mBuffer(NULL), + mBuffer(nullptr), mBufferLength(0) { if (params) @@ -62,9 +62,9 @@ LLReliablePacket::LLReliablePacket( mRetries = 0; mPingBasedRetry = TRUE; mTimeout = F32Seconds(0.f); - mCallback = NULL; - mCallbackData = NULL; - mMessageName = NULL; + mCallback = nullptr; + mCallbackData = nullptr; + mMessageName = nullptr; } mExpirationTime = (F64Seconds)totalTime() + mTimeout; @@ -76,7 +76,7 @@ LLReliablePacket::LLReliablePacket( if (mRetries) { mBuffer = new U8[buf_len]; - if (mBuffer != NULL) + if (mBuffer != nullptr) { memcpy(mBuffer,buf_ptr,buf_len); /*Flawfinder: ignore*/ mBufferLength = buf_len; diff --git a/indra/llmessage/llpacketack.h b/indra/llmessage/llpacketack.h index f0ed923f19385274015d981d754daddec855ff99..87a5073ff12d5dc5bf7bcd2df1aeed09d9f29012 100644 --- a/indra/llmessage/llpacketack.h +++ b/indra/llmessage/llpacketack.h @@ -55,9 +55,9 @@ public: mRetries = 0; mPingBasedRetry = TRUE; mTimeout = F32Seconds(0.f); - mCallback = NULL; - mCallbackData = NULL; - mMessageName = NULL; + mCallback = nullptr; + mCallbackData = nullptr; + mMessageName = nullptr; }; void set( @@ -88,9 +88,9 @@ public: LLReliablePacketParams* params); ~LLReliablePacket() { - mCallback = NULL; + mCallback = nullptr; delete [] mBuffer; - mBuffer = NULL; + mBuffer = nullptr; }; friend class LLCircuitData; diff --git a/indra/llmessage/llpacketbuffer.cpp b/indra/llmessage/llpacketbuffer.cpp index ccaf9803707b57c086ee237c68f6bf407bcb161c..37690426d2747b60a90d2b4b7499f594eb469db4 100644 --- a/indra/llmessage/llpacketbuffer.cpp +++ b/indra/llmessage/llpacketbuffer.cpp @@ -47,7 +47,7 @@ LLPacketBuffer::LLPacketBuffer(const LLHost &host, const char *datap, const S32 } else { - if (datap != NULL) + if (datap != nullptr) { memcpy(mData, datap, size); mSize = size; diff --git a/indra/llmessage/llpacketring.cpp b/indra/llmessage/llpacketring.cpp index 015469e7e0b91a5a7c9acae2e3f1309641d70f9a..3e4859bc030264d23b1bc4cb0f99a8d4c1427561 100644 --- a/indra/llmessage/llpacketring.cpp +++ b/indra/llmessage/llpacketring.cpp @@ -130,7 +130,7 @@ S32 LLPacketRing::receiveFromRing (S32 socket, char *datap) return 0; } - LLPacketBuffer *packetp = NULL; + LLPacketBuffer *packetp = nullptr; if (mReceiveQueue.empty()) { // No packets on the queue, don't give them any. @@ -141,7 +141,7 @@ S32 LLPacketRing::receiveFromRing (S32 socket, char *datap) packetp = mReceiveQueue.front(); mReceiveQueue.pop(); packet_size = packetp->getSize(); - if (packetp->getData() != NULL) + if (packetp->getData() != nullptr) { memcpy(datap, packetp->getData(), packet_size); /*Flawfinder: ignore*/ } @@ -186,7 +186,7 @@ S32 LLPacketRing::receivePacket (S32 socket, char *datap) if (mPacketsToDrop) { delete packetp; - packetp = NULL; + packetp = nullptr; packet_size = 0; mPacketsToDrop--; } @@ -201,7 +201,7 @@ S32 LLPacketRing::receivePacket (S32 socket, char *datap) // Toss it. LL_WARNS() << "Throwing away packet, overflowing buffer" << LL_ENDL; delete packetp; - packetp = NULL; + packetp = nullptr; } else if (packetp->getSize()) { @@ -211,7 +211,7 @@ S32 LLPacketRing::receivePacket (S32 socket, char *datap) else { delete packetp; - packetp = NULL; + packetp = nullptr; done = true; } } @@ -287,7 +287,7 @@ BOOL LLPacketRing::sendPacket(int h_socket, char * send_buffer, S32 buf_size, LL else { mActualBitsOut += buf_size * 8; - LLPacketBuffer *packetp = NULL; + LLPacketBuffer *packetp = nullptr; // See if we've got enough throttle to send a packet. while (!mOutThrottle.checkOverflow(0.f)) { diff --git a/indra/llmessage/llproxy.cpp b/indra/llmessage/llproxy.cpp index 5f0b0d4698472263936b26daf5c0f094bebb59e7..c82135c09223d7843008b14d7ab10116443b1b7c 100644 --- a/indra/llmessage/llproxy.cpp +++ b/indra/llmessage/llproxy.cpp @@ -516,7 +516,7 @@ static apr_status_t tcp_blocking_handshake(LLSocket::ptr_t handle, char * dataou */ static LLSocket::ptr_t tcp_open_channel(LLHost host) { - LLSocket::ptr_t socket = LLSocket::create(NULL, LLSocket::STREAM_TCP); + LLSocket::ptr_t socket = LLSocket::create(nullptr, LLSocket::STREAM_TCP); bool connected = socket->blockingConnect(host); if (!connected) { diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index 52b4e6a424d8b323797f2c5b4ed618b4d1116332..968bc55b11eb70601d0ae8759947551789eb4148 100644 --- a/indra/llmessage/llpumpio.cpp +++ b/indra/llmessage/llpumpio.cpp @@ -128,8 +128,8 @@ public: { return LLRunner::run_ptr_t(new LLChainSleeper(pump, key)); } - - virtual void run(LLRunner* runner, S64 handle) + + void run(LLRunner* runner, S64 handle) override { mPump->clearLock(mKey); } @@ -161,12 +161,12 @@ struct ll_delete_apr_pollset_fd_client_data LLPumpIO::LLPumpIO(apr_pool_t* pool) : mState(LLPumpIO::NORMAL), mRebuildPollset(false), - mPollset(NULL), + mPollset(nullptr), mPollsetClientID(0), mNextLock(0), mCurrentChain(mRunningChains.end()), - mPool(NULL), - mCurrentPool(NULL), + mPool(nullptr), + mCurrentPool(nullptr), mCurrentPoolReallocCount(0) #if LL_THREADS_PUMPIO mChainsMutex(NULL), @@ -187,7 +187,7 @@ bool LLPumpIO::prime(apr_pool_t* pool) { cleanup(); initialize(pool); - return ((pool == NULL) ? false : true); + return ((pool == nullptr) ? false : true); } bool LLPumpIO::addChain(const chain_t& chain, F32 timeout, bool has_curl_request) @@ -200,7 +200,7 @@ bool LLPumpIO::addChain(const chain_t& chain, F32 timeout, bool has_curl_request LLChainInfo info; info.mHasCurlRequest = has_curl_request; info.setTimeoutSeconds(timeout); - info.mData = LLIOPipe::buffer_ptr_t(new LLBufferArray); + info.mData = std::make_shared<LLBufferArray>(); info.mData->setThreaded(has_curl_request); LLLinkInfo link; #if LL_DEBUG_PIPE_TYPE_IN_PUMP @@ -519,7 +519,7 @@ void LLPumpIO::pump(const S32& poll_timeout) PUMP_DEBUG; typedef std::map<S32, S32> signal_client_t; signal_client_t signalled_client; - const apr_pollfd_t* poll_fd = NULL; + const apr_pollfd_t* poll_fd = nullptr; if(mPollset) { PUMP_DEBUG; @@ -738,7 +738,7 @@ void LLPumpIO::pump(const S32& poll_timeout) bool LLPumpIO::respond(LLIOPipe* pipe) { - if(NULL == pipe) return false; + if(nullptr == pipe) return false; #if LL_THREADS_PUMPIO LLMutexLock lock(mCallbackMutex); @@ -846,14 +846,14 @@ void LLPumpIO::cleanup() { // LL_DEBUGS() << "cleaning up pollset" << LL_ENDL; apr_pollset_destroy(mPollset); - mPollset = NULL; + mPollset = nullptr; } if(mCurrentPool) { apr_pool_destroy(mCurrentPool); - mCurrentPool = NULL; + mCurrentPool = nullptr; } - mPool = NULL; + mPool = nullptr; } void LLPumpIO::rebuildPollset() @@ -863,7 +863,7 @@ void LLPumpIO::rebuildPollset() { //LL_DEBUGS() << "destroying pollset" << LL_ENDL; apr_pollset_destroy(mPollset); - mPollset = NULL; + mPollset = nullptr; } U32 size = 0; running_chains_t::iterator run_it = mRunningChains.begin(); @@ -881,7 +881,7 @@ void LLPumpIO::rebuildPollset() && (0 == (++mCurrentPoolReallocCount % POLLSET_POOL_RECYCLE_COUNT))) { apr_pool_destroy(mCurrentPool); - mCurrentPool = NULL; + mCurrentPool = nullptr; mCurrentPoolReallocCount = 0; } if(!mCurrentPool) diff --git a/indra/llmessage/llsdappservices.cpp b/indra/llmessage/llsdappservices.cpp index fff2f419301329ff30bbf8ca1693e104c229056b..7b204d3d15d33e47cf3f0144028e71d51cf44cc5 100644 --- a/indra/llmessage/llsdappservices.cpp +++ b/indra/llmessage/llsdappservices.cpp @@ -45,14 +45,14 @@ void LLSDAppServices::useServices() class LLHTTPConfigService : public LLHTTPNode { public: - virtual void describe(Description& desc) const + void describe(Description& desc) const override { desc.shortInfo("GET an array of all the options in priority order."); desc.getAPI(); desc.source(__FILE__, __LINE__); } - - virtual LLSD simpleGet() const + + LLSD simpleGet() const override { LLSD result; LLApp* app = LLApp::instance(); @@ -70,24 +70,24 @@ LLHTTPRegistration<LLHTTPConfigService> class LLHTTPConfigRuntimeService : public LLHTTPNode { public: - virtual void describe(Description& desc) const + void describe(Description& desc) const override { desc.shortInfo("Manipulate a map of runtime-override options."); desc.getAPI(); desc.postAPI(); desc.source(__FILE__, __LINE__); } - - virtual LLSD simpleGet() const + + LLSD simpleGet() const override { return LLApp::instance()->getOptionData( LLApp::PRIORITY_RUNTIME_OVERRIDE); } - virtual void post( + void post( LLHTTPNode::ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { LLSD result = LLApp::instance()->getOptionData( LLApp::PRIORITY_RUNTIME_OVERRIDE); @@ -110,7 +110,7 @@ LLHTTPRegistration<LLHTTPConfigRuntimeService> class LLHTTPConfigRuntimeSingleService : public LLHTTPNode { public: - virtual void describe(Description& desc) const + void describe(Description& desc) const override { desc.shortInfo("Manipulate a single runtime-override option."); desc.getAPI(); @@ -118,8 +118,8 @@ public: desc.delAPI(); desc.source(__FILE__, __LINE__); } - - virtual bool validate(const std::string& name, LLSD& context) const + + bool validate(const std::string& name, LLSD& context) const override { //LL_INFOS() << "validate: " << name << ", " // << LLSDOStreamer<LLSDNotationFormatter>(context) << LL_ENDL; @@ -137,9 +137,9 @@ public: } } - virtual void get( + void get( LLHTTPNode::ResponsePtr response, - const LLSD& context) const + const LLSD& context) const override { std::string name = context[CONTEXT_REQUEST][CONTEXT_WILDCARD]["option-name"]; LLSD options = LLApp::instance()->getOptionData( @@ -147,10 +147,10 @@ public: response->result(options[name]); } - virtual void put( + void put( LLHTTPNode::ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { std::string name = context[CONTEXT_REQUEST][CONTEXT_WILDCARD]["option-name"]; LLSD options = LLApp::instance()->getOptionData( @@ -162,9 +162,9 @@ public: response->result(input); } - virtual void del( + void del( LLHTTPNode::ResponsePtr response, - const LLSD& context) const + const LLSD& context) const override { std::string name = context[CONTEXT_REQUEST][CONTEXT_WILDCARD]["option-name"]; LLSD options = LLApp::instance()->getOptionData( @@ -185,16 +185,16 @@ template<int PRIORITY> class LLHTTPConfigPriorityService : public LLHTTPNode { public: - virtual void describe(Description& desc) const + void describe(Description& desc) const override { desc.shortInfo("Get a map of the options at this priority."); desc.getAPI(); desc.source(__FILE__, __LINE__); } - virtual void get( + void get( LLHTTPNode::ResponsePtr response, - const LLSD& context) const + const LLSD& context) const override { response->result(LLApp::instance()->getOptionData( (LLApp::OptionPriority)PRIORITY)); @@ -215,16 +215,16 @@ LLHTTPRegistration< LLHTTPConfigPriorityService<LLApp::PRIORITY_DEFAULT> > class LLHTTPLiveConfigService : public LLHTTPNode { public: - virtual void describe(Description& desc) const + void describe(Description& desc) const override { desc.shortInfo("Get a map of the currently live options."); desc.getAPI(); desc.source(__FILE__, __LINE__); } - virtual void get( + void get( LLHTTPNode::ResponsePtr response, - const LLSD& context) const + const LLSD& context) const override { LLSD result; LLApp* app = LLApp::instance(); @@ -250,14 +250,14 @@ LLHTTPRegistration<LLHTTPLiveConfigService> class LLHTTPLiveConfigSingleService : public LLHTTPNode { public: - virtual void describe(Description& desc) const + void describe(Description& desc) const override { desc.shortInfo("Get the named live option."); desc.getAPI(); desc.source(__FILE__, __LINE__); } - virtual bool validate(const std::string& name, LLSD& context) const + bool validate(const std::string& name, LLSD& context) const override { LL_INFOS() << "LLHTTPLiveConfigSingleService::validate(" << name << ")" << LL_ENDL; @@ -266,9 +266,9 @@ public: else return false; } - virtual void get( + void get( LLHTTPNode::ResponsePtr response, - const LLSD& context) const + const LLSD& context) const override { std::string name = context[CONTEXT_REQUEST][CONTEXT_WILDCARD]["option-name"]; response->result(LLApp::instance()->getOption(name)); diff --git a/indra/llmessage/llsdhttpserver.cpp b/indra/llmessage/llsdhttpserver.cpp index 2a7a309acd81c4b471a1913016ba2b5114020adc..48386d07392eb072df065c17d1de649cbe99fdff 100644 --- a/indra/llmessage/llsdhttpserver.cpp +++ b/indra/llmessage/llsdhttpserver.cpp @@ -50,15 +50,15 @@ void LLHTTPStandardServices::useServices() class LLHTTPHelloService : public LLHTTPNode { public: - virtual void describe(Description& desc) const + void describe(Description& desc) const override { desc.shortInfo("says hello"); desc.getAPI(); desc.output("\"hello\""); desc.source(__FILE__, __LINE__); } - - virtual LLSD simpleGet() const + + LLSD simpleGet() const override { LLSD result = "hello"; return result; @@ -73,7 +73,7 @@ LLHTTPRegistration<LLHTTPHelloService> class LLHTTPEchoService : public LLHTTPNode { public: - virtual void describe(Description& desc) const + void describe(Description& desc) const override { desc.shortInfo("echo input"); desc.postAPI(); @@ -81,8 +81,8 @@ public: desc.output("<the input>"); desc.source(__FILE__, __LINE__); } - - virtual LLSD simplePost(const LLSD& params) const + + LLSD simplePost(const LLSD& params) const override { return params; } @@ -96,7 +96,7 @@ LLHTTPRegistration<LLHTTPEchoService> class LLAPIService : public LLHTTPNode { public: - virtual void describe(Description& desc) const + void describe(Description& desc) const override { desc.shortInfo("information about the URLs this server supports"); desc.getAPI(); @@ -104,13 +104,13 @@ public: desc.source(__FILE__, __LINE__); } - virtual bool handles(const LLSD& remainder, LLSD& context) const + bool handles(const LLSD& remainder, LLSD& context) const override { - return followRemainder(remainder) != NULL; + return followRemainder(remainder) != nullptr; } - virtual void get(ResponsePtr response, const LLSD& context) const - { + void get(ResponsePtr response, const LLSD& context) const override + { const LLSD& remainder = context[CONTEXT_REQUEST]["remainder"]; if (remainder.size() > 0) diff --git a/indra/llmessage/llsdmessagebuilder.cpp b/indra/llmessage/llsdmessagebuilder.cpp index 3b6df0540526202f04a968bcb7513d2b7f9ed5d3..6d9e2a25a8ee85c55b8af9e442caf38a06a86a22 100644 --- a/indra/llmessage/llsdmessagebuilder.cpp +++ b/indra/llmessage/llsdmessagebuilder.cpp @@ -43,7 +43,7 @@ LLSDMessageBuilder::LLSDMessageBuilder() : mCurrentMessage(LLSD::emptyMap()), - mCurrentBlock(NULL), + mCurrentBlock(nullptr), mCurrentMessageName(""), mCurrentBlockName(""), mbSBuilt(FALSE), @@ -235,7 +235,7 @@ void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data) // copy the blocks // counting variables used to encode multiple block info S32 block_count = 0; - char* block_name = NULL; + char* block_name = nullptr; // loop through msg blocks to loop through variables, totalling up size // data and filling the new (send) message diff --git a/indra/llmessage/llsdmessagebuilder.h b/indra/llmessage/llsdmessagebuilder.h index d21f0b78de62028aea7c03502118ec8ab3e8d662..fef10e8e8aa695975a371862869b7f38ec56e79e 100644 --- a/indra/llmessage/llsdmessagebuilder.h +++ b/indra/llmessage/llsdmessagebuilder.h @@ -43,55 +43,55 @@ public: LLSDMessageBuilder(); virtual ~LLSDMessageBuilder(); - virtual void newMessage(const char* name); + void newMessage(const char* name) override; - virtual void nextBlock(const char* blockname); - virtual BOOL removeLastBlock(); // TODO: babbage: remove this horror... + void nextBlock(const char* blockname) override; + BOOL removeLastBlock() override; // TODO: babbage: remove this horror... /** All add* methods expect pointers to canonical varname strings. */ - virtual void addBinaryData( + void addBinaryData( const char* varname, const void* data, - S32 size); - virtual void addBOOL(const char* varname, BOOL b); - virtual void addS8(const char* varname, S8 s); - virtual void addU8(const char* varname, U8 u); - virtual void addS16(const char* varname, S16 i); - virtual void addU16(const char* varname, U16 i); - virtual void addF32(const char* varname, F32 f); - virtual void addS32(const char* varname, S32 s); - virtual void addU32(const char* varname, U32 u); - virtual void addU64(const char* varname, U64 lu); - virtual void addF64(const char* varname, F64 d); - virtual void addVector3(const char* varname, const LLVector3& vec); - virtual void addVector4(const char* varname, const LLVector4& vec); - virtual void addVector3d(const char* varname, const LLVector3d& vec); - virtual void addQuat(const char* varname, const LLQuaternion& quat); - virtual void addUUID(const char* varname, const LLUUID& uuid); - virtual void addIPAddr(const char* varname, const U32 ip); - virtual void addIPPort(const char* varname, const U16 port); - virtual void addString(const char* varname, const char* s); - virtual void addString(const char* varname, const std::string& s); - - virtual BOOL isMessageFull(const char* blockname) const; - virtual void compressMessage(U8*& buf_ptr, U32& buffer_length); - - virtual BOOL isBuilt() const; - virtual BOOL isClear() const; - virtual U32 buildMessage(U8* buffer, U32 buffer_size, U8 offset_to_data); + S32 size) override; + void addBOOL(const char* varname, BOOL b) override; + void addS8(const char* varname, S8 s) override; + void addU8(const char* varname, U8 u) override; + void addS16(const char* varname, S16 i) override; + void addU16(const char* varname, U16 i) override; + void addF32(const char* varname, F32 f) override; + void addS32(const char* varname, S32 s) override; + void addU32(const char* varname, U32 u) override; + void addU64(const char* varname, U64 lu) override; + void addF64(const char* varname, F64 d) override; + void addVector3(const char* varname, const LLVector3& vec) override; + void addVector4(const char* varname, const LLVector4& vec) override; + void addVector3d(const char* varname, const LLVector3d& vec) override; + void addQuat(const char* varname, const LLQuaternion& quat) override; + void addUUID(const char* varname, const LLUUID& uuid) override; + void addIPAddr(const char* varname, const U32 ip) override; + void addIPPort(const char* varname, const U16 port) override; + void addString(const char* varname, const char* s) override; + void addString(const char* varname, const std::string& s) override; + + BOOL isMessageFull(const char* blockname) const override; + void compressMessage(U8*& buf_ptr, U32& buffer_length) override; + + BOOL isBuilt() const override; + BOOL isClear() const override; + U32 buildMessage(U8* buffer, U32 buffer_size, U8 offset_to_data) override; /**< Null implementation which returns 0. */ - - virtual void clearMessage(); + + void clearMessage() override; // TODO: babbage: remove this horror. - virtual void setBuilt(BOOL b); + void setBuilt(BOOL b) override; - virtual S32 getMessageSize(); - virtual const char* getMessageName() const; + S32 getMessageSize() override; + const char* getMessageName() const override; - virtual void copyFromMessageData(const LLMsgData& data); + void copyFromMessageData(const LLMsgData& data) override; - virtual void copyFromLLSD(const LLSD& msg); + void copyFromLLSD(const LLSD& msg) override; const LLSD& getMessage() const; private: diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp index b1215eb124a5e506386af242449bd887b513958d..6d8c396a333016c73c5dee1e2c8d41942ab6c5c9 100644 --- a/indra/llmessage/llsdmessagereader.cpp +++ b/indra/llmessage/llsdmessagereader.cpp @@ -43,7 +43,7 @@ #include "v4color.h" LLSDMessageReader::LLSDMessageReader() : - mMessageName(NULL) + mMessageName(nullptr) { } @@ -57,12 +57,12 @@ LLSD getLLSD(const LLSD& input, const char* block, const char* var, S32 blocknum { // babbage: log error to LL_ERRS() if variable not found to mimic // LLTemplateMessageReader::getData behaviour - if(NULL == block) + if(nullptr == block) { LL_ERRS() << "NULL block name" << LL_ENDL; return LLSD(); } - if(NULL == var) + if(nullptr == var) { LL_ERRS() << "NULL var name" << LL_ENDL; return LLSD(); diff --git a/indra/llmessage/llsdmessagereader.h b/indra/llmessage/llsdmessagereader.h index cf0c3d5e4ef00ce5ce5afbf26eda034709c72444..f94681e385278e3146fb39aeaa740db6425a0534 100644 --- a/indra/llmessage/llsdmessagereader.h +++ b/indra/llmessage/llsdmessagereader.h @@ -41,59 +41,59 @@ public: virtual ~LLSDMessageReader(); /** All get* methods expect pointers to canonical strings. */ - virtual void getBinaryData(const char *block, const char *var, + void getBinaryData(const char *block, const char *var, void *datap, S32 size, S32 blocknum = 0, - S32 max_size = S32_MAX); - virtual void getBOOL(const char *block, const char *var, BOOL &data, - S32 blocknum = 0); - virtual void getS8(const char *block, const char *var, S8 &data, - S32 blocknum = 0); - virtual void getU8(const char *block, const char *var, U8 &data, - S32 blocknum = 0); - virtual void getS16(const char *block, const char *var, S16 &data, - S32 blocknum = 0); - virtual void getU16(const char *block, const char *var, U16 &data, - S32 blocknum = 0); - virtual void getS32(const char *block, const char *var, S32 &data, - S32 blocknum = 0); - virtual void getF32(const char *block, const char *var, F32 &data, - S32 blocknum = 0); - virtual void getU32(const char *block, const char *var, U32 &data, - S32 blocknum = 0); - virtual void getU64(const char *block, const char *var, U64 &data, - S32 blocknum = 0); - virtual void getF64(const char *block, const char *var, F64 &data, - S32 blocknum = 0); - virtual void getVector3(const char *block, const char *var, - LLVector3 &vec, S32 blocknum = 0); - virtual void getVector4(const char *block, const char *var, - LLVector4 &vec, S32 blocknum = 0); - virtual void getVector3d(const char *block, const char *var, - LLVector3d &vec, S32 blocknum = 0); - virtual void getQuat(const char *block, const char *var, LLQuaternion &q, - S32 blocknum = 0); - virtual void getUUID(const char *block, const char *var, LLUUID &uuid, - S32 blocknum = 0); - virtual void getIPAddr(const char *block, const char *var, U32 &ip, - S32 blocknum = 0); - virtual void getIPPort(const char *block, const char *var, U16 &port, - S32 blocknum = 0); - virtual void getString(const char *block, const char *var, - S32 buffer_size, char *buffer, S32 blocknum = 0); - virtual void getString(const char *block, const char *var, std::string& outstr, - S32 blocknum = 0); + S32 max_size = S32_MAX) override; + void getBOOL(const char *block, const char *var, BOOL &data, + S32 blocknum = 0) override; + void getS8(const char *block, const char *var, S8 &data, + S32 blocknum = 0) override; + void getU8(const char *block, const char *var, U8 &data, + S32 blocknum = 0) override; + void getS16(const char *block, const char *var, S16 &data, + S32 blocknum = 0) override; + void getU16(const char *block, const char *var, U16 &data, + S32 blocknum = 0) override; + void getS32(const char *block, const char *var, S32 &data, + S32 blocknum = 0) override; + void getF32(const char *block, const char *var, F32 &data, + S32 blocknum = 0) override; + void getU32(const char *block, const char *var, U32 &data, + S32 blocknum = 0) override; + void getU64(const char *block, const char *var, U64 &data, + S32 blocknum = 0) override; + void getF64(const char *block, const char *var, F64 &data, + S32 blocknum = 0) override; + void getVector3(const char *block, const char *var, + LLVector3 &vec, S32 blocknum = 0) override; + void getVector4(const char *block, const char *var, + LLVector4 &vec, S32 blocknum = 0) override; + void getVector3d(const char *block, const char *var, + LLVector3d &vec, S32 blocknum = 0) override; + void getQuat(const char *block, const char *var, LLQuaternion &q, + S32 blocknum = 0) override; + void getUUID(const char *block, const char *var, LLUUID &uuid, + S32 blocknum = 0) override; + void getIPAddr(const char *block, const char *var, U32 &ip, + S32 blocknum = 0) override; + void getIPPort(const char *block, const char *var, U16 &port, + S32 blocknum = 0) override; + void getString(const char *block, const char *var, + S32 buffer_size, char *buffer, S32 blocknum = 0) override; + void getString(const char *block, const char *var, std::string& outstr, + S32 blocknum = 0) override; - virtual S32 getNumberOfBlocks(const char *blockname); - virtual S32 getSize(const char *blockname, const char *varname); - virtual S32 getSize(const char *blockname, S32 blocknum, - const char *varname); + S32 getNumberOfBlocks(const char *blockname) override; + S32 getSize(const char *blockname, const char *varname) override; + S32 getSize(const char *blockname, S32 blocknum, + const char *varname) override; - virtual void clearMessage(); + void clearMessage() override; - virtual const char* getMessageName() const; - virtual S32 getMessageSize() const; + const char* getMessageName() const override; + S32 getMessageSize() const override; - virtual void copyToBuilder(LLMessageBuilder&) const; + void copyToBuilder(LLMessageBuilder&) const override; /** Expects a pointer to a canonical name string */ void setMessage(const char* name, const LLSD& msg); diff --git a/indra/llmessage/llservice.cpp b/indra/llmessage/llservice.cpp index 7d417dc6931e782d02e045922b4c6edac69264b3..76ed352de62fc4a030634922e75b07424e24cd91 100644 --- a/indra/llmessage/llservice.cpp +++ b/indra/llmessage/llservice.cpp @@ -67,10 +67,10 @@ LLIOPipe* LLService::activate( if(name.empty()) { LL_INFOS() << "LLService::activate - no service specified." << LL_ENDL; - return NULL; + return nullptr; } creators_t::iterator it = sCreatorFunctors.find(name); - LLIOPipe* rv = NULL; + LLIOPipe* rv = nullptr; if(it != sCreatorFunctors.end()) { if((*it).second->build(chain, context)) diff --git a/indra/llmessage/lltemplatemessagebuilder.cpp b/indra/llmessage/lltemplatemessagebuilder.cpp index 7133bbc716bd84f5cf25dafd1cc2ee49578da20a..e01f492bca9aa24904916886ef437e2c46bb26b1 100644 --- a/indra/llmessage/lltemplatemessagebuilder.cpp +++ b/indra/llmessage/lltemplatemessagebuilder.cpp @@ -39,11 +39,11 @@ #include "v4math.h" LLTemplateMessageBuilder::LLTemplateMessageBuilder(const message_template_name_map_t& name_template_map) : - mCurrentSMessageData(NULL), - mCurrentSMessageTemplate(NULL), - mCurrentSDataBlock(NULL), - mCurrentSMessageName(NULL), - mCurrentSBlockName(NULL), + mCurrentSMessageData(nullptr), + mCurrentSMessageTemplate(nullptr), + mCurrentSDataBlock(nullptr), + mCurrentSMessageName(nullptr), + mCurrentSBlockName(nullptr), mbSBuilt(FALSE), mbSClear(TRUE), mCurrentSendTotal(0), @@ -55,7 +55,7 @@ LLTemplateMessageBuilder::LLTemplateMessageBuilder(const message_template_name_m LLTemplateMessageBuilder::~LLTemplateMessageBuilder() { delete mCurrentSMessageData; - mCurrentSMessageData = NULL; + mCurrentSMessageData = nullptr; } // virtual @@ -67,7 +67,7 @@ void LLTemplateMessageBuilder::newMessage(const char *name) mCurrentSendTotal = 0; delete mCurrentSMessageData; - mCurrentSMessageData = NULL; + mCurrentSMessageData = nullptr; char* namep = (char*)name; if (mMessageTemplates.count(namep) > 0) @@ -75,8 +75,8 @@ void LLTemplateMessageBuilder::newMessage(const char *name) mCurrentSMessageTemplate = mMessageTemplates.find(name)->second; mCurrentSMessageData = new LLMsgData(namep); mCurrentSMessageName = namep; - mCurrentSDataBlock = NULL; - mCurrentSBlockName = NULL; + mCurrentSDataBlock = nullptr; + mCurrentSBlockName = nullptr; // add at one of each block const LLMessageTemplate* msg_template = mMessageTemplates.find(name)->second; @@ -110,14 +110,14 @@ void LLTemplateMessageBuilder::clearMessage() mCurrentSendTotal = 0; - mCurrentSMessageTemplate = NULL; + mCurrentSMessageTemplate = nullptr; delete mCurrentSMessageData; - mCurrentSMessageData = NULL; + mCurrentSMessageData = nullptr; - mCurrentSMessageName = NULL; - mCurrentSDataBlock = NULL; - mCurrentSBlockName = NULL; + mCurrentSMessageName = nullptr; + mCurrentSDataBlock = nullptr; + mCurrentSBlockName = nullptr; } // virtual @@ -460,7 +460,7 @@ void LLTemplateMessageBuilder::addString(const char* varname, const char* s) if (s) addData( varname, (void *)s, MVT_VARIABLE, (S32)strlen(s) + 1); /* Flawfinder: ignore */ else - addData( varname, NULL, MVT_VARIABLE, 0); + addData( varname, nullptr, MVT_VARIABLE, 0); } void LLTemplateMessageBuilder::addString(const char* varname, const std::string& s) @@ -468,7 +468,7 @@ void LLTemplateMessageBuilder::addString(const char* varname, const std::string& if (s.size()) addData( varname, (void *)s.c_str(), MVT_VARIABLE, (S32)(s.size()) + 1); else - addData( varname, NULL, MVT_VARIABLE, 0); + addData( varname, nullptr, MVT_VARIABLE, 0); } void LLTemplateMessageBuilder::addVector3(const char *varname, const LLVector3& vec) @@ -708,7 +708,7 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat } // if there is any data to pack, pack it - if((mvci.getData() != NULL) && mvci.getSize()) + if((mvci.getData() != nullptr) && mvci.getSize()) { if(result + mvci.getSize() < buffer_size) { @@ -835,7 +835,7 @@ void LLTemplateMessageBuilder::copyFromMessageData(const LLMsgData& data) // copy the blocks // counting variables used to encode multiple block info S32 block_count = 0; - char *block_name = NULL; + char *block_name = nullptr; // loop through msg blocks to loop through variables, totalling up size // data and filling the new (send) message diff --git a/indra/llmessage/lltemplatemessagebuilder.h b/indra/llmessage/lltemplatemessagebuilder.h index 6ff39d6851d85933e4e3a8b77ee050728ce5e62d..2c8643e296fa4051a776e265f4485a768a4788db 100644 --- a/indra/llmessage/lltemplatemessagebuilder.h +++ b/indra/llmessage/lltemplatemessagebuilder.h @@ -44,52 +44,52 @@ public: LLTemplateMessageBuilder(const message_template_name_map_t&); virtual ~LLTemplateMessageBuilder(); - virtual void newMessage(const char* name); + void newMessage(const char* name) override; - virtual void nextBlock(const char* blockname); - virtual BOOL removeLastBlock(); // TODO: babbage: remove this horror... + void nextBlock(const char* blockname) override; + BOOL removeLastBlock() override; // TODO: babbage: remove this horror... /** All add* methods expect pointers to canonical varname strings. */ - virtual void addBinaryData(const char *varname, const void *data, - S32 size); - virtual void addBOOL(const char* varname, BOOL b); - virtual void addS8(const char* varname, S8 s); - virtual void addU8(const char* varname, U8 u); - virtual void addS16(const char* varname, S16 i); - virtual void addU16(const char* varname, U16 i); - virtual void addF32(const char* varname, F32 f); - virtual void addS32(const char* varname, S32 s); - virtual void addU32(const char* varname, U32 u); - virtual void addU64(const char* varname, U64 lu); - virtual void addF64(const char* varname, F64 d); - virtual void addVector3(const char* varname, const LLVector3& vec); - virtual void addVector4(const char* varname, const LLVector4& vec); - virtual void addVector3d(const char* varname, const LLVector3d& vec); - virtual void addQuat(const char* varname, const LLQuaternion& quat); - virtual void addUUID(const char* varname, const LLUUID& uuid); - virtual void addIPAddr(const char* varname, const U32 ip); - virtual void addIPPort(const char* varname, const U16 port); - virtual void addString(const char* varname, const char* s); - virtual void addString(const char* varname, const std::string& s); - - virtual BOOL isMessageFull(const char* blockname) const; - virtual void compressMessage(U8*& buf_ptr, U32& buffer_length); - - virtual BOOL isBuilt() const; - virtual BOOL isClear() const; - virtual U32 buildMessage(U8* buffer, U32 buffer_size, U8 offset_to_data); + void addBinaryData(const char *varname, const void *data, + S32 size) override; + void addBOOL(const char* varname, BOOL b) override; + void addS8(const char* varname, S8 s) override; + void addU8(const char* varname, U8 u) override; + void addS16(const char* varname, S16 i) override; + void addU16(const char* varname, U16 i) override; + void addF32(const char* varname, F32 f) override; + void addS32(const char* varname, S32 s) override; + void addU32(const char* varname, U32 u) override; + void addU64(const char* varname, U64 lu) override; + void addF64(const char* varname, F64 d) override; + void addVector3(const char* varname, const LLVector3& vec) override; + void addVector4(const char* varname, const LLVector4& vec) override; + void addVector3d(const char* varname, const LLVector3d& vec) override; + void addQuat(const char* varname, const LLQuaternion& quat) override; + void addUUID(const char* varname, const LLUUID& uuid) override; + void addIPAddr(const char* varname, const U32 ip) override; + void addIPPort(const char* varname, const U16 port) override; + void addString(const char* varname, const char* s) override; + void addString(const char* varname, const std::string& s) override; + + BOOL isMessageFull(const char* blockname) const override; + void compressMessage(U8*& buf_ptr, U32& buffer_length) override; + + BOOL isBuilt() const override; + BOOL isClear() const override; + U32 buildMessage(U8* buffer, U32 buffer_size, U8 offset_to_data) override; /**< Return built message size */ - - virtual void clearMessage(); + + void clearMessage() override; // TODO: babbage: remove this horror. - virtual void setBuilt(BOOL b); + void setBuilt(BOOL b) override; - virtual S32 getMessageSize(); - virtual const char* getMessageName() const; + S32 getMessageSize() override; + const char* getMessageName() const override; - virtual void copyFromMessageData(const LLMsgData& data); - virtual void copyFromLLSD(const LLSD&); + void copyFromMessageData(const LLMsgData& data) override; + void copyFromLLSD(const LLSD&) override; LLMsgData* getCurrentMessage() const { return mCurrentSMessageData; } private: diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp index c25ad3a69ec1dc05022a707a0cc86f7921274356..f24f89ce9934638e8329b37d8836ec730f3020d1 100644 --- a/indra/llmessage/lltemplatemessagereader.cpp +++ b/indra/llmessage/lltemplatemessagereader.cpp @@ -43,8 +43,8 @@ LLTemplateMessageReader::LLTemplateMessageReader(message_template_number_map_t& number_template_map) : mReceiveSize(0), - mCurrentRMessageTemplate(NULL), - mCurrentRMessageData(NULL), + mCurrentRMessageTemplate(nullptr), + mCurrentRMessageData(nullptr), mMessageNumbers(number_template_map) { } @@ -53,16 +53,16 @@ LLTemplateMessageReader::LLTemplateMessageReader(message_template_number_map_t& LLTemplateMessageReader::~LLTemplateMessageReader() { delete mCurrentRMessageData; - mCurrentRMessageData = NULL; + mCurrentRMessageData = nullptr; } //virtual void LLTemplateMessageReader::clearMessage() { mReceiveSize = -1; - mCurrentRMessageTemplate = NULL; + mCurrentRMessageTemplate = nullptr; delete mCurrentRMessageData; - mCurrentRMessageData = NULL; + mCurrentRMessageData = nullptr; } void LLTemplateMessageReader::getData(const char *blockname, const char *varname, void *datap, S32 size, S32 blocknum, S32 max_size) @@ -602,7 +602,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender, return FALSE; } - LLMsgBlkData* cur_data_block = NULL; + LLMsgBlkData* cur_data_block = nullptr; // now loop through the block for (i = 0; i < repeat_number; i++) @@ -836,7 +836,7 @@ bool LLTemplateMessageReader::isUdpBanned() const //virtual void LLTemplateMessageReader::copyToBuilder(LLMessageBuilder& builder) const { - if(NULL == mCurrentRMessageTemplate) + if(nullptr == mCurrentRMessageTemplate) { return; } diff --git a/indra/llmessage/lltemplatemessagereader.h b/indra/llmessage/lltemplatemessagereader.h index 49da2a33f9c6ebc5a789a860dde22836bebc5f3b..3583f931bc6d675e54c87da81f6219f224d8d3f1 100644 --- a/indra/llmessage/lltemplatemessagereader.h +++ b/indra/llmessage/lltemplatemessagereader.h @@ -42,59 +42,59 @@ public: virtual ~LLTemplateMessageReader(); /** All get* methods expect pointers to canonical strings. */ - virtual void getBinaryData(const char *blockname, const char *varname, + void getBinaryData(const char *blockname, const char *varname, void *datap, S32 size, S32 blocknum = 0, - S32 max_size = S32_MAX); - virtual void getBOOL(const char *block, const char *var, BOOL &data, - S32 blocknum = 0); - virtual void getS8(const char *block, const char *var, S8 &data, - S32 blocknum = 0); - virtual void getU8(const char *block, const char *var, U8 &data, - S32 blocknum = 0); - virtual void getS16(const char *block, const char *var, S16 &data, - S32 blocknum = 0); - virtual void getU16(const char *block, const char *var, U16 &data, - S32 blocknum = 0); - virtual void getS32(const char *block, const char *var, S32 &data, - S32 blocknum = 0); - virtual void getF32(const char *block, const char *var, F32 &data, - S32 blocknum = 0); - virtual void getU32(const char *block, const char *var, U32 &data, - S32 blocknum = 0); - virtual void getU64(const char *block, const char *var, U64 &data, - S32 blocknum = 0); - virtual void getF64(const char *block, const char *var, F64 &data, - S32 blocknum = 0); - virtual void getVector3(const char *block, const char *var, - LLVector3 &vec, S32 blocknum = 0); - virtual void getVector4(const char *block, const char *var, - LLVector4 &vec, S32 blocknum = 0); - virtual void getVector3d(const char *block, const char *var, - LLVector3d &vec, S32 blocknum = 0); - virtual void getQuat(const char *block, const char *var, LLQuaternion &q, - S32 blocknum = 0); - virtual void getUUID(const char *block, const char *var, LLUUID &uuid, - S32 blocknum = 0); - virtual void getIPAddr(const char *block, const char *var, U32 &ip, - S32 blocknum = 0); - virtual void getIPPort(const char *block, const char *var, U16 &port, - S32 blocknum = 0); - virtual void getString(const char *block, const char *var, - S32 buffer_size, char *buffer, S32 blocknum = 0); - virtual void getString(const char *block, const char *var, std::string& outstr, - S32 blocknum = 0); - - virtual S32 getNumberOfBlocks(const char *blockname); - virtual S32 getSize(const char *blockname, const char *varname); - virtual S32 getSize(const char *blockname, S32 blocknum, - const char *varname); - - virtual void clearMessage(); - - virtual const char* getMessageName() const; - virtual S32 getMessageSize() const; - - virtual void copyToBuilder(LLMessageBuilder&) const; + S32 max_size = S32_MAX) override; + void getBOOL(const char *block, const char *var, BOOL &data, + S32 blocknum = 0) override; + void getS8(const char *block, const char *var, S8 &data, + S32 blocknum = 0) override; + void getU8(const char *block, const char *var, U8 &data, + S32 blocknum = 0) override; + void getS16(const char *block, const char *var, S16 &data, + S32 blocknum = 0) override; + void getU16(const char *block, const char *var, U16 &data, + S32 blocknum = 0) override; + void getS32(const char *block, const char *var, S32 &data, + S32 blocknum = 0) override; + void getF32(const char *block, const char *var, F32 &data, + S32 blocknum = 0) override; + void getU32(const char *block, const char *var, U32 &data, + S32 blocknum = 0) override; + void getU64(const char *block, const char *var, U64 &data, + S32 blocknum = 0) override; + void getF64(const char *block, const char *var, F64 &data, + S32 blocknum = 0) override; + void getVector3(const char *block, const char *var, + LLVector3 &vec, S32 blocknum = 0) override; + void getVector4(const char *block, const char *var, + LLVector4 &vec, S32 blocknum = 0) override; + void getVector3d(const char *block, const char *var, + LLVector3d &vec, S32 blocknum = 0) override; + void getQuat(const char *block, const char *var, LLQuaternion &q, + S32 blocknum = 0) override; + void getUUID(const char *block, const char *var, LLUUID &uuid, + S32 blocknum = 0) override; + void getIPAddr(const char *block, const char *var, U32 &ip, + S32 blocknum = 0) override; + void getIPPort(const char *block, const char *var, U16 &port, + S32 blocknum = 0) override; + void getString(const char *block, const char *var, + S32 buffer_size, char *buffer, S32 blocknum = 0) override; + void getString(const char *block, const char *var, std::string& outstr, + S32 blocknum = 0) override; + + S32 getNumberOfBlocks(const char *blockname) override; + S32 getSize(const char *blockname, const char *varname) override; + S32 getSize(const char *blockname, S32 blocknum, + const char *varname) override; + + void clearMessage() override; + + const char* getMessageName() const override; + S32 getMessageSize() const override; + + void copyToBuilder(LLMessageBuilder&) const override; BOOL validateMessage(const U8* buffer, S32 buffer_size, const LLHost& sender, bool trusted = false, BOOL custom = FALSE); diff --git a/indra/llmessage/lltransfermanager.cpp b/indra/llmessage/lltransfermanager.cpp index ad962b29fb80f0353abc877e8ef856977fe62a18..f23455dedcb8514bc165143894cba50d4f984327 100644 --- a/indra/llmessage/lltransfermanager.cpp +++ b/indra/llmessage/lltransfermanager.cpp @@ -81,10 +81,10 @@ void LLTransferManager::init() mValid = TRUE; // Register message system handlers - gMessageSystem->setHandlerFunc("TransferRequest", processTransferRequest, NULL); - gMessageSystem->setHandlerFunc("TransferInfo", processTransferInfo, NULL); - gMessageSystem->setHandlerFunc("TransferPacket", processTransferPacket, NULL); - gMessageSystem->setHandlerFunc("TransferAbort", processTransferAbort, NULL); + gMessageSystem->setHandlerFunc("TransferRequest", processTransferRequest, nullptr); + gMessageSystem->setHandlerFunc("TransferInfo", processTransferInfo, nullptr); + gMessageSystem->setHandlerFunc("TransferPacket", processTransferPacket, nullptr); + gMessageSystem->setHandlerFunc("TransferAbort", processTransferAbort, nullptr); } @@ -152,7 +152,7 @@ LLTransferSourceChannel *LLTransferManager::getSourceChannel(const LLHost &host, LLTransferConnection *tcp = getTransferConnection(host); if (!tcp) { - return NULL; + return nullptr; } return tcp->getSourceChannel(type); } @@ -164,7 +164,7 @@ LLTransferTargetChannel *LLTransferManager::getTargetChannel(const LLHost &host, LLTransferConnection *tcp = getTransferConnection(host); if (!tcp) { - return NULL; + return nullptr; } return tcp->getTargetChannel(type); } @@ -195,7 +195,7 @@ LLTransferSource *LLTransferManager::findTransferSource(const LLUUID &transfer_i } } - return NULL; + return nullptr; } // @@ -384,7 +384,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) size = packetp->mSize; if (size) { - if ((packetp->mDatap != NULL) && (size<(S32)sizeof(tmp_data))) + if ((packetp->mDatap != nullptr) && (size<(S32)sizeof(tmp_data))) { memcpy(tmp_data, packetp->mDatap, size); /*Flawfinder: ignore*/ } @@ -563,7 +563,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) size = packetp->mSize; if (size) { - if ((packetp->mDatap != NULL) && (size<(S32)sizeof(tmp_data))) + if ((packetp->mDatap != nullptr) && (size<(S32)sizeof(tmp_data))) { memcpy(tmp_data, packetp->mDatap, size); /*Flawfinder: ignore*/ } @@ -629,7 +629,7 @@ void LLTransferManager::reliablePacketCallback(void **user_data, S32 result) { LLUUID *transfer_idp = (LLUUID *)user_data; if (result && - transfer_idp != NULL) + transfer_idp != nullptr) { LLTransferSource *tsp = gTransferManager.findTransferSource(*transfer_idp); if (tsp) @@ -809,7 +809,7 @@ void LLTransferSourceChannel::updateTransfers() next++; LLTransferSource *tsp = iter->second; - U8 *datap = NULL; + U8 *datap = nullptr; S32 data_size = 0; BOOL delete_data = FALSE; S32 packet_id = 0; @@ -853,10 +853,10 @@ void LLTransferSourceChannel::updateTransfers() if (delete_data) { delete[] datap; - datap = NULL; + datap = nullptr; } - if (findTransferSource(transaction_id) == NULL) + if (findTransferSource(transaction_id) == nullptr) { //Warning! In the case of an aborted transfer, the sendReliable call above calls //AbortTransfer which in turn calls deleteTransfer which means that somewhere way @@ -915,7 +915,7 @@ LLTransferSource *LLTransferSourceChannel::findTransferSource(const LLUUID &tran return tsp; } } - return NULL; + return nullptr; } @@ -1035,7 +1035,7 @@ LLTransferTarget *LLTransferTargetChannel::findTransferTarget(const LLUUID &tran return ttp; } } - return NULL; + return nullptr; } @@ -1071,7 +1071,7 @@ LLTransferSource::LLTransferSource(const LLTransferSourceType type, const F32 priority) : mType(type), mID(transfer_id), - mChannelp(NULL), + mChannelp(nullptr), mPriority(priority), mSize(0), mLastPacketID(-1) @@ -1166,7 +1166,7 @@ LLTransferSource *LLTransferSource::createSource(const LLTransferSourceType styp { // Use the callback to create the source type if it's not there. LL_WARNS() << "Unknown transfer source type: " << stype << LL_ENDL; - return NULL; + return nullptr; } return (sSourceCreateMap[stype])(id, priority); } @@ -1195,7 +1195,7 @@ F32 LLTransferSource::sGetPriority(LLTransferSource *&tsp) LLTransferPacket::LLTransferPacket(const S32 packet_id, const LLTSCode status, const U8 *datap, const S32 size) : mPacketID(packet_id), mStatus(status), - mDatap(NULL), + mDatap(nullptr), mSize(size) { if (size == 0) @@ -1204,7 +1204,7 @@ LLTransferPacket::LLTransferPacket(const S32 packet_id, const LLTSCode status, c } mDatap = new U8[size]; - if (mDatap != NULL) + if (mDatap != nullptr) { memcpy(mDatap, datap, size); /*Flawfinder: ignore*/ } @@ -1226,7 +1226,7 @@ LLTransferTarget::LLTransferTarget( mType(type), mSourceType(source_type), mID(transfer_id), - mChannelp(NULL), + mChannelp(nullptr), mGotInfo(FALSE), mSize(0), mLastPacketID(-1) @@ -1310,7 +1310,7 @@ LLTransferTarget* LLTransferTarget::createTarget( return new LLTransferTargetVFile(id, source_type); default: LL_WARNS() << "Unknown transfer target type: " << type << LL_ENDL; - return NULL; + return nullptr; } } diff --git a/indra/llmessage/lltransfermanager.h b/indra/llmessage/lltransfermanager.h index 4eb9fef864530427ed8015ca2ea0da975224632b..96e3980086eaa557e46e1e5abe21b37bd34a0d62 100644 --- a/indra/llmessage/lltransfermanager.h +++ b/indra/llmessage/lltransfermanager.h @@ -436,8 +436,8 @@ class LLTransferSourceParamsInvItem: public LLTransferSourceParams public: LLTransferSourceParamsInvItem(); virtual ~LLTransferSourceParamsInvItem() {} - /*virtual*/ void packParams(LLDataPacker &dp) const; - /*virtual*/ BOOL unpackParams(LLDataPacker &dp); + /*virtual*/ void packParams(LLDataPacker &dp) const override; + /*virtual*/ BOOL unpackParams(LLDataPacker &dp) override; void setAgentSession(const LLUUID &agent_id, const LLUUID &session_id); void setInvItem(const LLUUID &owner_id, const LLUUID &task_id, const LLUUID &item_id); @@ -468,8 +468,8 @@ class LLTransferSourceParamsEstate: public LLTransferSourceParams public: LLTransferSourceParamsEstate(); virtual ~LLTransferSourceParamsEstate() {} - /*virtual*/ void packParams(LLDataPacker &dp) const; - /*virtual*/ BOOL unpackParams(LLDataPacker &dp); + /*virtual*/ void packParams(LLDataPacker &dp) const override; + /*virtual*/ BOOL unpackParams(LLDataPacker &dp) override; void setAgentSession(const LLUUID &agent_id, const LLUUID &session_id); void setEstateAssetType(const EstateAssetType etype); diff --git a/indra/llmessage/lltransfersourceasset.cpp b/indra/llmessage/lltransfersourceasset.cpp index 044651762cf942fa0d26eb344f40e5b4380306dd..c00e53ad0ae83fdf654fdfdccdbd26be80cfcf1e 100644 --- a/indra/llmessage/lltransfersourceasset.cpp +++ b/indra/llmessage/lltransfersourceasset.cpp @@ -129,7 +129,7 @@ LLTSCode LLTransferSourceAsset::dataCallback(const S32 packet_id, { // Read failure, need to deal with it. delete[] tmpp; - *data_handle = NULL; + *data_handle = nullptr; returned_bytes = 0; delete_returned = FALSE; return LLTS_ERROR; @@ -144,7 +144,7 @@ LLTSCode LLTransferSourceAsset::dataCallback(const S32 packet_id, if (!returned_bytes) { delete[] tmpp; - *data_handle = NULL; + *data_handle = nullptr; returned_bytes = 0; delete_returned = FALSE; } @@ -179,7 +179,7 @@ void LLTransferSourceAsset::responderCallback(LLVFS *vfs, const LLUUID& uuid, LL LLUUID *tidp = ((LLUUID*) user_data); LLUUID transfer_id = *(tidp); delete tidp; - tidp = NULL; + tidp = nullptr; LLTransferSourceAsset *tsap = (LLTransferSourceAsset *) gTransferManager.findTransferSource(transfer_id); diff --git a/indra/llmessage/lltransfersourceasset.h b/indra/llmessage/lltransfersourceasset.h index 3abda83cf8dd189ac5869ab240ea8eb542d296be..a7f005fb178f3e7cc884409cd1ca83a33b29ccaf 100644 --- a/indra/llmessage/lltransfersourceasset.h +++ b/indra/llmessage/lltransfersourceasset.h @@ -37,8 +37,8 @@ class LLTransferSourceParamsAsset : public LLTransferSourceParams public: LLTransferSourceParamsAsset(); virtual ~LLTransferSourceParamsAsset() {} - /*virtual*/ void packParams(LLDataPacker &dp) const; - /*virtual*/ BOOL unpackParams(LLDataPacker &dp); + /*virtual*/ void packParams(LLDataPacker &dp) const override; + /*virtual*/ BOOL unpackParams(LLDataPacker &dp) override; void setAsset(const LLUUID &asset_id, const LLAssetType::EType asset_type); @@ -59,17 +59,17 @@ public: static void responderCallback(LLVFS *vfs, const LLUUID& uuid, LLAssetType::EType type, void *user_data, S32 result, LLExtStat ext_status ); protected: - /*virtual*/ void initTransfer(); - /*virtual*/ F32 updatePriority(); + /*virtual*/ void initTransfer() override; + /*virtual*/ F32 updatePriority() override; /*virtual*/ LLTSCode dataCallback(const S32 packet_id, const S32 max_bytes, U8 **datap, S32 &returned_bytes, - BOOL &delete_returned); - /*virtual*/ void completionCallback(const LLTSCode status); + BOOL &delete_returned) override; + /*virtual*/ void completionCallback(const LLTSCode status) override; - virtual void packParams(LLDataPacker& dp) const; - /*virtual*/ BOOL unpackParams(LLDataPacker &dp); + void packParams(LLDataPacker& dp) const override; + /*virtual*/ BOOL unpackParams(LLDataPacker &dp) override; protected: LLTransferSourceParamsAsset mParams; diff --git a/indra/llmessage/lltransfersourcefile.cpp b/indra/llmessage/lltransfersourcefile.cpp index 393e60619969d8e1f30fb858f30f5ed73018f8a9..f1460a5546cd5dfed9f12246e234e870ade50fa0 100644 --- a/indra/llmessage/lltransfersourcefile.cpp +++ b/indra/llmessage/lltransfersourcefile.cpp @@ -37,7 +37,7 @@ LLTransferSourceFile::LLTransferSourceFile(const LLUUID &request_id, const F32 priority) : LLTransferSource(LLTST_FILE, request_id, priority), - mFP(NULL) + mFP(nullptr) { } @@ -111,7 +111,7 @@ LLTSCode LLTransferSourceFile::dataCallback(const S32 packet_id, if (!returned_bytes) { delete[] tmpp; - *data_handle = NULL; + *data_handle = nullptr; returned_bytes = 0; delete_returned = FALSE; return LLTS_DONE; @@ -127,7 +127,7 @@ void LLTransferSourceFile::completionCallback(const LLTSCode status) if (mFP) { fclose(mFP); - mFP = NULL; + mFP = nullptr; } // Delete the file iff the filename begins with "TEMP" diff --git a/indra/llmessage/lltransfersourcefile.h b/indra/llmessage/lltransfersourcefile.h index 985042417eff81c70751db76482c94fe8e759f7e..fdd36f7c0a6096b99f8875ef2b48a682bb9fd97b 100644 --- a/indra/llmessage/lltransfersourcefile.h +++ b/indra/llmessage/lltransfersourcefile.h @@ -34,8 +34,8 @@ class LLTransferSourceParamsFile : public LLTransferSourceParams public: LLTransferSourceParamsFile(); virtual ~LLTransferSourceParamsFile() {} - /*virtual*/ void packParams(LLDataPacker &dp) const; - /*virtual*/ BOOL unpackParams(LLDataPacker &dp); + /*virtual*/ void packParams(LLDataPacker &dp) const override; + /*virtual*/ BOOL unpackParams(LLDataPacker &dp) override; void setFilename(const std::string &filename) { mFilename = filename; } std::string getFilename() const { return mFilename; } @@ -55,17 +55,17 @@ public: virtual ~LLTransferSourceFile(); protected: - /*virtual*/ void initTransfer(); - /*virtual*/ F32 updatePriority(); + /*virtual*/ void initTransfer() override; + /*virtual*/ F32 updatePriority() override; /*virtual*/ LLTSCode dataCallback(const S32 packet_id, const S32 max_bytes, U8 **datap, S32 &returned_bytes, - BOOL &delete_returned); - /*virtual*/ void completionCallback(const LLTSCode status); + BOOL &delete_returned) override; + /*virtual*/ void completionCallback(const LLTSCode status) override; - virtual void packParams(LLDataPacker& dp) const; - /*virtual*/ BOOL unpackParams(LLDataPacker &dp); + void packParams(LLDataPacker& dp) const override; + /*virtual*/ BOOL unpackParams(LLDataPacker &dp) override; protected: LLTransferSourceParamsFile mParams; diff --git a/indra/llmessage/lltransfertargetfile.cpp b/indra/llmessage/lltransfertargetfile.cpp index 7847cb2332ee0c67e108b547b6380f5059de559d..39fa3b6ec9f5432149b6b5e08d36241be9bc1669 100644 --- a/indra/llmessage/lltransfertargetfile.cpp +++ b/indra/llmessage/lltransfertargetfile.cpp @@ -38,7 +38,7 @@ LLTransferTargetFile::LLTransferTargetFile( const LLUUID& uuid, LLTransferSourceType src_type) : LLTransferTarget(LLTTT_FILE, uuid, src_type), - mFP(NULL) + mFP(nullptr) { } @@ -48,7 +48,7 @@ LLTransferTargetFile::~LLTransferTargetFile() { LL_ERRS() << "LLTransferTargetFile::~LLTransferTargetFile - Should have been cleaned up in completion callback" << LL_ENDL; fclose(mFP); - mFP = NULL; + mFP = nullptr; } } @@ -125,7 +125,7 @@ void LLTransferTargetFile::completionCallback(const LLTSCode status) break; } - mFP = NULL; + mFP = nullptr; if (mParams.mCompleteCallback) { mParams.mCompleteCallback(status, mParams.mUserData); diff --git a/indra/llmessage/lltransfertargetfile.h b/indra/llmessage/lltransfertargetfile.h index 6d03ff2d2ec67bcf2f7333c5c56b1cb210ef8a5f..c8cd3536ce41081f2e370476c8f547157e33f4c6 100644 --- a/indra/llmessage/lltransfertargetfile.h +++ b/indra/llmessage/lltransfertargetfile.h @@ -37,8 +37,8 @@ public: LLTransferTargetParamsFile() : LLTransferTargetParams(LLTTT_FILE), - mCompleteCallback(NULL), - mUserData(NULL) + mCompleteCallback(nullptr), + mUserData(nullptr) {} void setFilename(const std::string& filename) { mFilename = filename; } void setCallback(LLTTFCompleteCallback cb, void *user_data) { mCompleteCallback = cb; mUserData = user_data; } @@ -62,10 +62,10 @@ public: const LLTransferSourceParams &source_params, LLTTFCompleteCallback callback); protected: - virtual bool unpackParams(LLDataPacker& dp); - /*virtual*/ void applyParams(const LLTransferTargetParams ¶ms); - /*virtual*/ LLTSCode dataCallback(const S32 packet_id, U8 *in_datap, const S32 in_size); - /*virtual*/ void completionCallback(const LLTSCode status); + bool unpackParams(LLDataPacker& dp) override; + /*virtual*/ void applyParams(const LLTransferTargetParams ¶ms) override; + /*virtual*/ LLTSCode dataCallback(const S32 packet_id, U8 *in_datap, const S32 in_size) override; + /*virtual*/ void completionCallback(const LLTSCode status) override; LLTransferTargetParamsFile mParams; diff --git a/indra/llmessage/lltransfertargetvfile.cpp b/indra/llmessage/lltransfertargetvfile.cpp index 5f857e6c2f2d470baad97a1c778bd8029e0bf6c9..2279e29029fe054395f0611b3b050bec18b40d18 100644 --- a/indra/llmessage/lltransfertargetvfile.cpp +++ b/indra/llmessage/lltransfertargetvfile.cpp @@ -43,8 +43,8 @@ void LLTransferTargetVFile::updateQueue(bool shutdown) LLTransferTargetParamsVFile::LLTransferTargetParamsVFile() : LLTransferTargetParams(LLTTT_VFILE), mAssetType(LLAssetType::AT_NONE), - mCompleteCallback(NULL), - mRequestDatap(NULL), + mCompleteCallback(nullptr), + mRequestDatap(nullptr), mErrCode(0) { } @@ -108,7 +108,7 @@ LLTransferTargetVFile::~LLTransferTargetVFile() { // TODO: Consider doing it in LLTransferTargetParamsVFile's destructor delete mParams.mRequestDatap; - mParams.mRequestDatap = NULL; + mParams.mRequestDatap = nullptr; } } @@ -232,6 +232,6 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status) LL_EXSTAT_NONE); } delete mParams.mRequestDatap; - mParams.mRequestDatap = NULL; + mParams.mRequestDatap = nullptr; } } diff --git a/indra/llmessage/lltransfertargetvfile.h b/indra/llmessage/lltransfertargetvfile.h index c819c1e2f269917c61cca08a362139ec1b832ea0..94a13297f05c4c126532c768432df6e6bff80762 100644 --- a/indra/llmessage/lltransfertargetvfile.h +++ b/indra/llmessage/lltransfertargetvfile.h @@ -79,10 +79,10 @@ public: static void updateQueue(bool shutdown = false); protected: - virtual bool unpackParams(LLDataPacker& dp); - /*virtual*/ void applyParams(const LLTransferTargetParams& params); - /*virtual*/ LLTSCode dataCallback(const S32 packet_id, U8* in_datap, const S32 in_size); - /*virtual*/ void completionCallback(const LLTSCode status); + bool unpackParams(LLDataPacker& dp) override; + /*virtual*/ void applyParams(const LLTransferTargetParams& params) override; + /*virtual*/ LLTSCode dataCallback(const S32 packet_id, U8* in_datap, const S32 in_size) override; + /*virtual*/ void completionCallback(const LLTSCode status) override; LLTransferTargetParamsVFile mParams; diff --git a/indra/llmessage/lluseroperation.cpp b/indra/llmessage/lluseroperation.cpp index 3696932bde6d79bce0d08541b7ca8d39edd95938..2990ca920d9f450f7169c7504d0e92016d5cd2b4 100644 --- a/indra/llmessage/lluseroperation.cpp +++ b/indra/llmessage/lluseroperation.cpp @@ -34,7 +34,7 @@ /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -LLUserOperationMgr* gUserOperationMgr = NULL; +LLUserOperationMgr* gUserOperationMgr = nullptr; ///---------------------------------------------------------------------------- /// Class LLUserOperation @@ -126,7 +126,7 @@ LLUserOperation* LLUserOperationMgr::findOperation(const LLUUID& tid) if (iter != mUserOperationList.end()) return iter->second; else - return NULL; + return nullptr; } @@ -138,7 +138,7 @@ BOOL LLUserOperationMgr::deleteOperation(LLUserOperation* op) LLUUID id = op->getTransactionID(); rv = mUserOperationList.erase(id); delete op; - op = NULL; + op = nullptr; } return rv ? TRUE : FALSE; } @@ -147,7 +147,7 @@ void LLUserOperationMgr::deleteExpiredOperations() { const S32 MAX_OPS_CONSIDERED = 2000; S32 ops_left = MAX_OPS_CONSIDERED; - LLUserOperation* op = NULL; + LLUserOperation* op = nullptr; user_operation_list_t::iterator it; if(mLastOperationConsidered.isNull()) { diff --git a/indra/llmessage/llxfer.cpp b/indra/llmessage/llxfer.cpp index 9b1073f7b4c214688fd4d1c2ffb19085eb7f61d9..87f5d7f70aa2e14b911649a5d08f6e5019339df1 100644 --- a/indra/llmessage/llxfer.cpp +++ b/indra/llmessage/llxfer.cpp @@ -65,15 +65,15 @@ void LLXfer::init (S32 chunk_size) mXferSize = 0; mStatus = e_LL_XFER_UNINITIALIZED; - mNext = NULL; + mNext = nullptr; mWaitingForACK = FALSE; - mCallback = NULL; - mCallbackDataHandle = NULL; + mCallback = nullptr; + mCallbackDataHandle = nullptr; mCallbackResult = 0; mBufferContainsEOF = FALSE; - mBuffer = NULL; + mBuffer = nullptr; mBufferLength = 0; mBufferStartOffset = 0; @@ -93,7 +93,7 @@ void LLXfer::cleanup () if (mBuffer) { delete[] mBuffer; - mBuffer = NULL; + mBuffer = nullptr; } } @@ -135,7 +135,7 @@ S32 LLXfer::receiveData (char *datap, S32 data_size) if (!retval) { - if (datap != NULL) + if (datap != nullptr) { memcpy(&mBuffer[mBufferLength],datap,data_size); /*Flawfinder: ignore*/ mBufferLength += data_size; diff --git a/indra/llmessage/llxfer_file.cpp b/indra/llmessage/llxfer_file.cpp index 4bfb5a9bebee0522986db470c362b3ae6c336eee..a6982b9d22bbc3add9cd7f4f105928ac0b921307 100644 --- a/indra/llmessage/llxfer_file.cpp +++ b/indra/llmessage/llxfer_file.cpp @@ -72,7 +72,7 @@ LLXfer_File::~LLXfer_File () void LLXfer_File::init (const std::string& local_filename, BOOL delete_local_on_completion, S32 chunk_size) { - mFp = NULL; + mFp = nullptr; mLocalFilename.clear(); mRemoteFilename.clear(); mRemotePath = LL_PATH_NONE; @@ -97,7 +97,7 @@ void LLXfer_File::cleanup () if (mFp) { fclose(mFp); - mFp = NULL; + mFp = nullptr; } LLFile::remove(mTempFilename, ENOENT); @@ -146,7 +146,7 @@ S32 LLXfer_File::initializeRequest(U64 xfer_id, if (mBuffer) { delete(mBuffer); - mBuffer = NULL; + mBuffer = nullptr; } mBuffer = new char[LL_MAX_XFER_FILE_BUFFER]; @@ -167,7 +167,7 @@ S32 LLXfer_File::startDownload() if (mFp) { fclose(mFp); - mFp = NULL; + mFp = nullptr; gMessageSystem->newMessageFast(_PREHASH_RequestXfer); gMessageSystem->nextBlockFast(_PREHASH_XferID); @@ -294,7 +294,7 @@ S32 LLXfer_File::flush() // LL_INFOS() << "******* wrote " << mBufferLength << " bytes of file xfer" << LL_ENDL; fclose(mFp); - mFp = NULL; + mFp = nullptr; mBufferLength = 0; } @@ -369,7 +369,7 @@ S32 LLXfer_File::processEOF() if (mFp) { fclose(mFp); - mFp = NULL; + mFp = nullptr; } retval = LLXfer::processEOF(); diff --git a/indra/llmessage/llxfer_file.h b/indra/llmessage/llxfer_file.h index a37dda67328fe7715a54a86d6b606bb529a88df1..c05aa48f13dc8e32994c5420df2c4d2e7aa2d6dd 100644 --- a/indra/llmessage/llxfer_file.h +++ b/indra/llmessage/llxfer_file.h @@ -48,7 +48,7 @@ class LLXfer_File : public LLXfer virtual ~LLXfer_File(); virtual void init(const std::string& local_filename, BOOL delete_local_on_completion, S32 chunk_size); - virtual void cleanup(); + void cleanup() override; virtual S32 initializeRequest(U64 xfer_id, const std::string& local_filename, @@ -58,23 +58,23 @@ class LLXfer_File : public LLXfer BOOL delete_remote_on_completion, void (*callback)(void**,S32,LLExtStat), void** user_data); - virtual S32 startDownload(); + S32 startDownload() override; - virtual S32 processEOF(); - - virtual S32 startSend (U64 xfer_id, const LLHost &remote_host); + S32 processEOF() override; - virtual S32 suck(S32 start_position); - virtual S32 flush(); + S32 startSend (U64 xfer_id, const LLHost &remote_host) override; + + S32 suck(S32 start_position) override; + S32 flush() override; virtual BOOL matchesLocalFilename(const std::string& filename); virtual BOOL matchesRemoteFilename(const std::string& filename, ELLPath remote_path); - virtual S32 getMaxBufferSize(); + S32 getMaxBufferSize() override; - virtual U32 getXferTypeTag(); + U32 getXferTypeTag() override; - virtual std::string getFileName(); + std::string getFileName() override; }; #endif diff --git a/indra/llmessage/llxfer_mem.cpp b/indra/llmessage/llxfer_mem.cpp index ae66cc1c31cbacd1c6e3b883ab267fce0409f670..f168655bb6890ec5997a3a76d57f9939dd23383c 100644 --- a/indra/llmessage/llxfer_mem.cpp +++ b/indra/llmessage/llxfer_mem.cpp @@ -52,7 +52,7 @@ LLXfer_Mem::~LLXfer_Mem () void LLXfer_Mem::init () { - mCallback = NULL; + mCallback = nullptr; mRemoteFilename.clear(); mRemotePath = LL_PATH_NONE; mDeleteRemoteOnCompletion = FALSE; @@ -170,7 +170,7 @@ S32 LLXfer_Mem::initializeRequest(U64 xfer_id, LL_INFOS() << "Requesting file: " << remote_filename << LL_ENDL; delete [] mBuffer; - mBuffer = NULL; + mBuffer = nullptr; mBufferLength = 0; mPacketNum = 0; diff --git a/indra/llmessage/llxfer_mem.h b/indra/llmessage/llxfer_mem.h index b5adf837dfb17a0e6228e645cf21b18a1ad7ae45..593851a45d8ed1b002e799f0710212f3e433a879 100644 --- a/indra/llmessage/llxfer_mem.h +++ b/indra/llmessage/llxfer_mem.h @@ -50,11 +50,11 @@ class LLXfer_Mem : public LLXfer virtual ~LLXfer_Mem(); virtual void init(); - virtual void cleanup(); + void cleanup() override; - virtual S32 startSend (U64 xfer_id, const LLHost &remote_host); + S32 startSend (U64 xfer_id, const LLHost &remote_host) override; virtual U64 registerXfer(U64 xfer_id, const void *datap, const S32 length); - virtual void setXferSize (S32 data_size); + void setXferSize (S32 data_size) override; virtual S32 initializeRequest(U64 xfer_id, const std::string& remote_filename, @@ -63,11 +63,11 @@ class LLXfer_Mem : public LLXfer BOOL delete_remote_on_completion, void (*callback)(void*,S32,void**,S32,LLExtStat), void** user_data); - virtual S32 startDownload(); + S32 startDownload() override; - virtual S32 processEOF(); + S32 processEOF() override; - virtual U32 getXferTypeTag(); + U32 getXferTypeTag() override; }; #endif diff --git a/indra/llmessage/llxfer_vfile.cpp b/indra/llmessage/llxfer_vfile.cpp index 63f2c821b91cb7aa9ea763fb581282f04bc2e1f9..799298f7755cdd66dbb86a1beb920089cb1ceb1a 100644 --- a/indra/llmessage/llxfer_vfile.cpp +++ b/indra/llmessage/llxfer_vfile.cpp @@ -44,7 +44,7 @@ const U32 LL_MAX_XFER_FILE_BUFFER = 65536; LLXfer_VFile::LLXfer_VFile () : LLXfer(-1) { - init(NULL, LLUUID::null, LLAssetType::AT_NONE); + init(nullptr, LLUUID::null, LLAssetType::AT_NONE); } LLXfer_VFile::LLXfer_VFile (LLVFS *vfs, const LLUUID &local_id, LLAssetType::EType type) @@ -69,7 +69,7 @@ void LLXfer_VFile::init (LLVFS *vfs, const LLUUID &local_id, LLAssetType::EType mLocalID = local_id; mType = type; - mVFile = NULL; + mVFile = nullptr; std::string id_string; mLocalID.toString(id_string); @@ -85,7 +85,7 @@ void LLXfer_VFile::cleanup () file.remove(); delete mVFile; - mVFile = NULL; + mVFile = nullptr; LLXfer::cleanup(); } @@ -125,7 +125,7 @@ S32 LLXfer_VFile::initializeRequest(U64 xfer_id, if (mBuffer) { delete[] mBuffer; - mBuffer = NULL; + mBuffer = nullptr; } mBuffer = new char[LL_MAX_XFER_FILE_BUFFER]; @@ -179,7 +179,7 @@ S32 LLXfer_VFile::startSend (U64 xfer_id, const LLHost &remote_host) mBufferStartOffset = 0; delete mVFile; - mVFile = NULL; + mVFile = nullptr; if(mVFS->getExists(mLocalID, mType)) { mVFile = new LLVFile(mVFS, mLocalID, mType, LLVFile::READ); @@ -187,7 +187,7 @@ S32 LLXfer_VFile::startSend (U64 xfer_id, const LLHost &remote_host) if (mVFile->getSize() <= 0) { delete mVFile; - mVFile = NULL; + mVFile = nullptr; return LL_ERR_FILE_EMPTY; } @@ -301,7 +301,7 @@ S32 LLXfer_VFile::processEOF() if (mVFile) { delete mVFile; - mVFile = NULL; + mVFile = nullptr; } retval = LLXfer::processEOF(); diff --git a/indra/llmessage/llxfer_vfile.h b/indra/llmessage/llxfer_vfile.h index 048bf49dcc9b0ae38326044d912aad06198454ab..c83e5f2f4d1849b13b31f382b8426813c2ccac0e 100644 --- a/indra/llmessage/llxfer_vfile.h +++ b/indra/llmessage/llxfer_vfile.h @@ -53,7 +53,7 @@ class LLXfer_VFile : public LLXfer virtual ~LLXfer_VFile(); virtual void init(LLVFS *vfs, const LLUUID &local_id, LLAssetType::EType type); - virtual void cleanup(); + void cleanup() override; virtual S32 initializeRequest(U64 xfer_id, LLVFS *vfs, @@ -63,24 +63,24 @@ class LLXfer_VFile : public LLXfer const LLHost &remote_host, void (*callback)(void **,S32,LLExtStat), void **user_data); - virtual S32 startDownload(); + S32 startDownload() override; - virtual S32 processEOF(); - - virtual S32 startSend (U64 xfer_id, const LLHost &remote_host); + S32 processEOF() override; + + S32 startSend (U64 xfer_id, const LLHost &remote_host) override; - virtual S32 suck(S32 start_position); - virtual S32 flush(); + S32 suck(S32 start_position) override; + S32 flush() override; virtual BOOL matchesLocalFile(const LLUUID &id, LLAssetType::EType type); virtual BOOL matchesRemoteFile(const LLUUID &id, LLAssetType::EType type); - virtual void setXferSize(S32 xfer_size); - virtual S32 getMaxBufferSize(); + void setXferSize(S32 xfer_size) override; + S32 getMaxBufferSize() override; - virtual U32 getXferTypeTag(); + U32 getXferTypeTag() override; - virtual std::string getFileName(); + std::string getFileName() override; }; #endif diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp index dabaf4f75c1a1f9ceea4a954d3ad426cd8beb2ee..a608b55d2f50f7d75663540c17e273b482a6572c 100644 --- a/indra/llmessage/llxfermanager.cpp +++ b/indra/llmessage/llxfermanager.cpp @@ -68,8 +68,8 @@ LLXferManager::~LLXferManager () void LLXferManager::init (LLVFS *vfs) { - mSendList = NULL; - mReceiveList = NULL; + mSendList = nullptr; + mReceiveList = nullptr; setMaxOutgoingXfersPerCircuit(LL_DEFAULT_MAX_SIMULTANEOUS_XFERS); setMaxIncomingXfers(LL_DEFAULT_MAX_REQUEST_FIFO_XFERS); @@ -98,7 +98,7 @@ void LLXferManager::cleanup () delete delp; delp = xferp; } - mSendList = NULL; + mSendList = nullptr; delp = mReceiveList; while (delp) @@ -107,7 +107,7 @@ void LLXferManager::cleanup () delete delp; delp = xferp; } - mReceiveList = NULL; + mReceiveList = nullptr; } /////////////////////////////////////////////////////////// @@ -151,7 +151,7 @@ void LLXferManager::setAckThrottleBPS(const F32 bps) void LLXferManager::updateHostStatus() { LLXfer *xferp; - LLHostStatus *host_statusp = NULL; + LLHostStatus *host_statusp = nullptr; for_each(mOutgoingHosts.begin(), mOutgoingHosts.end(), DeletePointer()); mOutgoingHosts.clear(); @@ -195,7 +195,7 @@ void LLXferManager::updateHostStatus() void LLXferManager::printHostStatus() { - LLHostStatus *host_statusp = NULL; + LLHostStatus *host_statusp = nullptr; if (!mOutgoingHosts.empty()) { LL_INFOS() << "Outgoing Xfers:" << LL_ENDL; @@ -221,7 +221,7 @@ LLXfer *LLXferManager::findXfer (U64 id, LLXfer *list_head) return(xferp); } } - return(NULL); + return(nullptr); } @@ -276,7 +276,7 @@ U32 LLXferManager::numActiveListEntries(LLXfer *list_head) S32 LLXferManager::numPendingXfers(const LLHost &host) { - LLHostStatus *host_statusp = NULL; + LLHostStatus *host_statusp = nullptr; for (status_list_t::iterator iter = mOutgoingHosts.begin(); iter != mOutgoingHosts.end(); ++iter) @@ -294,7 +294,7 @@ S32 LLXferManager::numPendingXfers(const LLHost &host) S32 LLXferManager::numActiveXfers(const LLHost &host) { - LLHostStatus *host_statusp = NULL; + LLHostStatus *host_statusp = nullptr; for (status_list_t::iterator iter = mOutgoingHosts.begin(); iter != mOutgoingHosts.end(); ++iter) @@ -312,7 +312,7 @@ S32 LLXferManager::numActiveXfers(const LLHost &host) void LLXferManager::changeNumActiveXfers(const LLHost &host, S32 delta) { - LLHostStatus *host_statusp = NULL; + LLHostStatus *host_statusp = nullptr; for (status_list_t::iterator iter = mOutgoingHosts.begin(); iter != mOutgoingHosts.end(); ++iter) @@ -329,10 +329,10 @@ void LLXferManager::changeNumActiveXfers(const LLHost &host, S32 delta) void LLXferManager::registerCallbacks(LLMessageSystem *msgsystem) { - msgsystem->setHandlerFuncFast(_PREHASH_ConfirmXferPacket, process_confirm_packet, NULL); - msgsystem->setHandlerFuncFast(_PREHASH_RequestXfer, process_request_xfer, NULL); - msgsystem->setHandlerFuncFast(_PREHASH_SendXferPacket, continue_file_receive, NULL); - msgsystem->setHandlerFuncFast(_PREHASH_AbortXfer, process_abort_xfer, NULL); + msgsystem->setHandlerFuncFast(_PREHASH_ConfirmXferPacket, process_confirm_packet, nullptr); + msgsystem->setHandlerFuncFast(_PREHASH_RequestXfer, process_request_xfer, nullptr); + msgsystem->setHandlerFuncFast(_PREHASH_SendXferPacket, continue_file_receive, nullptr); + msgsystem->setHandlerFuncFast(_PREHASH_AbortXfer, process_abort_xfer, nullptr); } /////////////////////////////////////////////////////////// @@ -838,7 +838,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user if (uuid != LLUUID::null) { - if(NULL == LLAssetType::lookup(type)) + if(nullptr == LLAssetType::lookup(type)) { LL_WARNS() << "Invalid type for xfer request: " << uuid << ":" << type_s16 << " to " << mesgsys->getSender() << LL_ENDL; @@ -1228,7 +1228,7 @@ void LLXferManager::addToList(LLXfer* xferp, LLXfer*& head, BOOL is_priority) { if(is_priority) { - xferp->mNext = NULL; + xferp->mNext = nullptr; LLXfer* next = head; if(next) { @@ -1254,7 +1254,7 @@ void LLXferManager::addToList(LLXfer* xferp, LLXfer*& head, BOOL is_priority) // Globals and C routines /////////////////////////////////////////////////////////// -LLXferManager *gXferManager = NULL; +LLXferManager *gXferManager = nullptr; void start_xfer_manager(LLVFS *vfs) @@ -1267,7 +1267,7 @@ void cleanup_xfer_manager() if (gXferManager) { delete(gXferManager); - gXferManager = NULL; + gXferManager = nullptr; } } diff --git a/indra/llmessage/llxorcipher.cpp b/indra/llmessage/llxorcipher.cpp index 2fa0623c89c28ab7a5861ea1e695234748808726..0cb85b25a8a5ee4cadb1eb33c61386a87d808755 100644 --- a/indra/llmessage/llxorcipher.cpp +++ b/indra/llmessage/llxorcipher.cpp @@ -37,8 +37,8 @@ ///---------------------------------------------------------------------------- LLXORCipher::LLXORCipher(const U8* pad, U32 pad_len) : - mPad(NULL), - mHead(NULL), + mPad(nullptr), + mHead(nullptr), mPadLen(0) { init(pad, pad_len); @@ -47,12 +47,12 @@ LLXORCipher::LLXORCipher(const U8* pad, U32 pad_len) : // Destroys the object LLXORCipher::~LLXORCipher() { - init(NULL, 0); + init(nullptr, 0); } LLXORCipher::LLXORCipher(const LLXORCipher& cipher) : - mPad(NULL), - mHead(NULL), + mPad(nullptr), + mHead(nullptr), mPadLen(0) { init(cipher.mPad, cipher.mPadLen); @@ -94,14 +94,14 @@ void LLXORCipher::init(const U8* pad, U32 pad_len) if(mPad) { delete [] mPad; - mPad = NULL; + mPad = nullptr; mPadLen = 0; } if(pad && pad_len) { mPadLen = pad_len; mPad = new U8[mPadLen]; - if (mPad != NULL) + if (mPad != nullptr) { memcpy(mPad, pad, mPadLen); /* Flawfinder : ignore */ } diff --git a/indra/llmessage/llxorcipher.h b/indra/llmessage/llxorcipher.h index c5b0700f0d431edb5485254276c8dd079bd26c4d..fb6c536af3bdac79cd4d8d6e6d22d5736d282a2f 100644 --- a/indra/llmessage/llxorcipher.h +++ b/indra/llmessage/llxorcipher.h @@ -43,9 +43,9 @@ public: LLXORCipher& operator=(const LLXORCipher& cipher); // Cipher functions - /*virtual*/ U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len); - /*virtual*/ U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len); - /*virtual*/ U32 requiredEncryptionSpace(U32 src_len) const; + /*virtual*/ U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) override; + /*virtual*/ U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) override; + /*virtual*/ U32 requiredEncryptionSpace(U32 src_len) const override; // special syntactic-sugar since xor can be performed in place. BOOL encrypt(U8* buf, U32 len) { return encrypt((const U8*)buf, len, buf, len); } diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 2d0ba6284689e6bbadb7554a8dd04823d4ba311d..8c9392680bca6e1df3d615cdd1411055ce966c45 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -100,11 +100,11 @@ public: class LLMessageHandlerBridge : public LLHTTPNode { - virtual bool validate(const std::string& name, LLSD& context) const - { return true; } + bool validate(const std::string& name, LLSD& context) const override + { return true; } - virtual void post(LLHTTPNode::ResponsePtr response, const LLSD& context, - const LLSD& input) const; + void post(LLHTTPNode::ResponsePtr response, const LLSD& context, + const LLSD& input) const override; }; //virtual @@ -186,11 +186,11 @@ void LLMessageSystem::init() mMessageFileVersionNumber = 0.f; - mTimingCallback = NULL; - mTimingCallbackData = NULL; + mTimingCallback = nullptr; + mTimingCallbackData = nullptr; - mMessageBuilder = NULL; - mMessageReader = NULL; + mMessageBuilder = nullptr; + mMessageReader = nullptr; } // Read file and build message templates @@ -227,11 +227,11 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, mTemplateMessageBuilder = new LLTemplateMessageBuilder(mMessageTemplates); mLLSDMessageBuilder = new LLSDMessageBuilder(); - mMessageBuilder = NULL; + mMessageBuilder = nullptr; mTemplateMessageReader = new LLTemplateMessageReader(mMessageNumbers); mLLSDMessageReader = new LLSDMessageReader(); - mMessageReader = NULL; + mMessageReader = nullptr; // initialize various bits of net info mSocket = 0; @@ -253,7 +253,7 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, LL_ERRS("Messaging") << "No APR pool before message system initialization!" << LL_ENDL; ll_init_apr(); } - apr_socket_t *aprSocketp = NULL; + apr_socket_t *aprSocketp = nullptr; apr_os_sock_put(&aprSocketp, (apr_os_sock_t*)&mSocket, gAPRPoolp); mPollInfop = new LLMessagePollInfo; @@ -263,7 +263,7 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, mPollInfop->mPollFD.reqevents = APR_POLLIN; mPollInfop->mPollFD.rtnevents = 0; mPollInfop->mPollFD.desc.s = aprSocketp; - mPollInfop->mPollFD.client_data = NULL; + mPollInfop->mPollFD.client_data = nullptr; F64Seconds mt_sec = getMessageTimeSeconds(); mResendDumpTime = mt_sec; @@ -330,21 +330,21 @@ LLMessageSystem::~LLMessageSystem() mSocket = 0; delete mTemplateMessageReader; - mTemplateMessageReader = NULL; - mMessageReader = NULL; + mTemplateMessageReader = nullptr; + mMessageReader = nullptr; delete mTemplateMessageBuilder; - mTemplateMessageBuilder = NULL; - mMessageBuilder = NULL; + mTemplateMessageBuilder = nullptr; + mMessageBuilder = nullptr; delete mLLSDMessageReader; - mLLSDMessageReader = NULL; + mLLSDMessageReader = nullptr; delete mLLSDMessageBuilder; - mLLSDMessageBuilder = NULL; + mLLSDMessageBuilder = nullptr; delete mPollInfop; - mPollInfop = NULL; + mPollInfop = nullptr; mIncomingCompressedSize = 0; mCurrentRecvPacketID = 0; @@ -383,7 +383,7 @@ BOOL LLMessageSystem::poll(F32 seconds) bool LLMessageSystem::isTrustedSender(const LLHost& host) const { LLCircuitData* cdp = mCircuitInfo.findCircuit(host); - if(NULL == cdp) + if(nullptr == cdp) { return false; } @@ -406,7 +406,7 @@ findTemplate(const LLMessageSystem::message_template_name_map_t& templates, std::string name) { const char* namePrehash = LLMessageStringTable::getInstance()->getString(name.c_str()); - if(NULL == namePrehash) {return templates.end();} + if(nullptr == namePrehash) {return templates.end();} return templates.find(namePrehash); } @@ -462,7 +462,7 @@ LLCircuitData* LLMessageSystem::findCircuit(const LLHost& host, if (mbProtected) { // don't accept packets from unexpected sources - cdp = NULL; + cdp = nullptr; } else { @@ -927,7 +927,7 @@ LLStoredMessagePtr LLMessageSystem::getReceivedMessage() const const std::string& name = mMessageReader->getMessageName(); LLSD message = wrapReceivedTemplateData(); - return LLStoredMessagePtr(new LLStoredMessage(name, message)); + return std::make_shared<LLStoredMessage>(name, message); } LLStoredMessagePtr LLMessageSystem::getBuiltMessage() const @@ -935,7 +935,7 @@ LLStoredMessagePtr LLMessageSystem::getBuiltMessage() const const std::string& name = mMessageBuilder->getMessageName(); LLSD message = wrapBuiltTemplateData(); - return LLStoredMessagePtr(new LLStoredMessage(name, message)); + return std::make_shared<LLStoredMessage>(name, message); } S32 LLMessageSystem::sendMessage(const LLHost &host, LLStoredMessagePtr message) @@ -963,8 +963,8 @@ void LLMessageSystem::nextBlock(const char *blockname) BOOL LLMessageSystem::isSendFull(const char* blockname) { - char* stringTableName = NULL; - if(NULL != blockname) + char* stringTableName = nullptr; + if(nullptr != blockname) { stringTableName = LLMessageStringTable::getInstance()->getString(blockname); } @@ -986,7 +986,7 @@ BOOL LLMessageSystem::removeLastBlock() S32 LLMessageSystem::sendReliable(const LLHost &host) { - return sendReliable(host, LL_DEFAULT_RELIABLE_RETRIES, TRUE, LL_PING_BASED_TIMEOUT_DUMMY, NULL, NULL); + return sendReliable(host, LL_DEFAULT_RELIABLE_RETRIES, TRUE, LL_PING_BASED_TIMEOUT_DUMMY, nullptr, nullptr); } @@ -2204,7 +2204,7 @@ S32 LLMessageSystem::sendError( { LL_WARNS("Messaging") << "Data and message were too large -- data removed." << LL_ENDL; - addBinaryData("Data", NULL, 0); + addBinaryData("Data", nullptr, 0); } return sendReliable(host); } @@ -2505,23 +2505,23 @@ bool start_messaging_system( } } - gMessageSystem->setHandlerFuncFast(_PREHASH_StartPingCheck, process_start_ping_check, NULL); - gMessageSystem->setHandlerFuncFast(_PREHASH_CompletePingCheck, process_complete_ping_check, NULL); - gMessageSystem->setHandlerFuncFast(_PREHASH_OpenCircuit, open_circuit, NULL); - gMessageSystem->setHandlerFuncFast(_PREHASH_CloseCircuit, close_circuit, NULL); + gMessageSystem->setHandlerFuncFast(_PREHASH_StartPingCheck, process_start_ping_check, nullptr); + gMessageSystem->setHandlerFuncFast(_PREHASH_CompletePingCheck, process_complete_ping_check, nullptr); + gMessageSystem->setHandlerFuncFast(_PREHASH_OpenCircuit, open_circuit, nullptr); + gMessageSystem->setHandlerFuncFast(_PREHASH_CloseCircuit, close_circuit, nullptr); //gMessageSystem->setHandlerFuncFast(_PREHASH_AssignCircuitCode, LLMessageSystem::processAssignCircuitCode); gMessageSystem->setHandlerFuncFast(_PREHASH_AddCircuitCode, LLMessageSystem::processAddCircuitCode); //gMessageSystem->setHandlerFuncFast(_PREHASH_AckAddCircuitCode, ack_add_circuit_code, NULL); gMessageSystem->setHandlerFuncFast(_PREHASH_UseCircuitCode, LLMessageSystem::processUseCircuitCode, (void**)responder); - gMessageSystem->setHandlerFuncFast(_PREHASH_PacketAck, process_packet_ack, NULL); + gMessageSystem->setHandlerFuncFast(_PREHASH_PacketAck, process_packet_ack, nullptr); //gMessageSystem->setHandlerFuncFast(_PREHASH_LogMessages, process_log_messages, NULL); gMessageSystem->setHandlerFuncFast(_PREHASH_CreateTrustedCircuit, process_create_trusted_circuit, - NULL); + nullptr); gMessageSystem->setHandlerFuncFast(_PREHASH_DenyTrustedCircuit, process_deny_trusted_circuit, - NULL); + nullptr); gMessageSystem->setHandlerFunc("Error", LLMessageSystem::processError); // We can hand this to the null_message_callback since it is a @@ -2530,7 +2530,7 @@ bool start_messaging_system( gMessageSystem->setHandlerFunc( "RequestTrustedCircuit", null_message_callback, - NULL); + nullptr); // Initialize the transfer manager gTransferManager.init(); @@ -2667,7 +2667,7 @@ void end_messaging_system(bool print_summary) } delete static_cast<LLMessageSystem*>(gMessageSystem); - gMessageSystem = NULL; + gMessageSystem = nullptr; } } @@ -3101,7 +3101,7 @@ bool LLMessageSystem::generateDigestForNumberAndUUIDs( memset(digest, 0, MD5HEX_STR_SIZE); - if( secret != NULL) + if( secret != nullptr) { d.update(secret, (U32)strlen((char *) secret)); /* Flawfinder: ignore */ } @@ -3112,13 +3112,13 @@ bool LLMessageSystem::generateDigestForNumberAndUUIDs( d.update((unsigned char *) tbuf, (U32)strlen(tbuf)); /* Flawfinder: ignore */ d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */ - if( (char*) id1str != NULL) + if( (char*) id1str != nullptr) { d.update(id1str, (U32)strlen((char *) id1str)); /* Flawfinder: ignore */ } d.update((const unsigned char *) colon, (U32)strlen(colon)); /* Flawfinder: ignore */ - if( (char*) id2str != NULL) + if( (char*) id2str != nullptr) { d.update(id2str, (U32)strlen((char *) id2str)); /* Flawfinder: ignore */ } @@ -3139,7 +3139,7 @@ bool LLMessageSystem::generateDigestForWindowAndUUIDs(char* digest, const S32 wi LL_ERRS("Messaging") << "Trying to generate complex digest on a machine without a shared secret!" << LL_ENDL; } - U32 now = (U32)time(NULL); + U32 now = (U32)time(nullptr); now /= window; @@ -3159,7 +3159,7 @@ bool LLMessageSystem::isMatchingDigestForWindowAndUUIDs(const char* digest, cons } char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ - U32 now = (U32)time(NULL); + U32 now = (U32)time(nullptr); now /= window; @@ -3205,7 +3205,7 @@ bool LLMessageSystem::generateDigestForWindow(char* digest, const S32 window) co LL_ERRS("Messaging") << "Trying to generate simple digest on a machine without a shared secret!" << LL_ENDL; } - U32 now = (U32)time(NULL); + U32 now = (U32)time(nullptr); now /= window; @@ -3225,7 +3225,7 @@ bool LLMessageSystem::isMatchingDigestForWindow(const char* digest, S32 const wi } char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ - U32 now = (S32)time(NULL); + U32 now = (S32)time(nullptr); now /= window; @@ -3311,9 +3311,9 @@ void LLMessageSystem::establishBidirectionalTrust(const LLHost &host, S64 frame_ LLTimer timeout; timeout.setTimerExpirySec(20.0); - setHandlerFuncFast(_PREHASH_StartPingCheck, null_message_callback, NULL); + setHandlerFuncFast(_PREHASH_StartPingCheck, null_message_callback, nullptr); setHandlerFuncFast(_PREHASH_CompletePingCheck, null_message_callback, - NULL); + nullptr); while (! timeout.hasExpired()) { @@ -3339,11 +3339,11 @@ void LLMessageSystem::establishBidirectionalTrust(const LLHost &host, S64 frame_ newMessage("RequestTrustedCircuit"); sendMessage(host); reallySendDenyTrustedCircuit(host); - setHandlerFuncFast(_PREHASH_StartPingCheck, process_start_ping_check, NULL); - setHandlerFuncFast(_PREHASH_CompletePingCheck, process_complete_ping_check, NULL); + setHandlerFuncFast(_PREHASH_StartPingCheck, process_start_ping_check, nullptr); + setHandlerFuncFast(_PREHASH_CompletePingCheck, process_complete_ping_check, nullptr); timeout.setTimerExpirySec(2.0); - LLCircuitData* cdp = NULL; + LLCircuitData* cdp = nullptr; while(!timeout.hasExpired()) { cdp = mCircuitInfo.findCircuit(host); @@ -4052,7 +4052,7 @@ void LLMessageSystem::sendUntrustedSimulatorMessageCoro(std::string url, std::st LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("untrustedSimulatorMessage", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = boost::make_shared<LLCore::HttpOptions>(); if (url.empty()) diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index 7a1ddfd4e7c84a3de429933f56da6090009ce290..d1a109c07e2f5dc80bcc137175eebd90e0a71939 100644 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -292,8 +292,8 @@ public: // methods for building, sending, receiving, and handling messages - void setHandlerFuncFast(const char *name, void (*handler_func)(LLMessageSystem *msgsystem, void **user_data), void **user_data = NULL); - void setHandlerFunc(const char *name, void (*handler_func)(LLMessageSystem *msgsystem, void **user_data), void **user_data = NULL) + void setHandlerFuncFast(const char *name, void (*handler_func)(LLMessageSystem *msgsystem, void **user_data), void **user_data = nullptr); + void setHandlerFunc(const char *name, void (*handler_func)(LLMessageSystem *msgsystem, void **user_data), void **user_data = nullptr) { setHandlerFuncFast(LLMessageStringTable::getInstance()->getString(name), handler_func, user_data); } @@ -305,7 +305,7 @@ public: } // Set a callback function for a message system exception. - void setExceptionFunc(EMessageException exception, msg_exception_callback func, void* data = NULL); + void setExceptionFunc(EMessageException exception, msg_exception_callback func, void* data = nullptr); // Call the specified exception func, and return TRUE if a // function was found and called. Otherwise return FALSE. BOOL callExceptionFunc(EMessageException exception); @@ -314,7 +314,7 @@ public: // hashed message name and the time spent in the processing handler function // measured in seconds. JC typedef void (*msg_timing_callback)(const char* hashed_name, F32 time, void* data); - void setTimingFunc(msg_timing_callback func, void* data = NULL); + void setTimingFunc(msg_timing_callback func, void* data = nullptr); msg_timing_callback getTimingCallback() { return mTimingCallback; @@ -332,7 +332,7 @@ public: bool addCircuitCode(U32 code, const LLUUID& session_id); BOOL poll(F32 seconds); // Number of seconds that we want to block waiting for data, returns if data was received - BOOL checkMessages( S64 frame_count = 0, bool faked_message = false, U8 fake_buffer[MAX_BUFFER_SIZE] = NULL, LLHost fake_host = LLHost(), S32 fake_size = 0 ); + BOOL checkMessages( S64 frame_count = 0, bool faked_message = false, U8 fake_buffer[MAX_BUFFER_SIZE] = nullptr, LLHost fake_host = LLHost(), S32 fake_size = 0 ); void processAcks(F32 collect_time = 0.f); BOOL isMessageFast(const char *msg); @@ -371,7 +371,7 @@ public: public: LLStoredMessagePtr getReceivedMessage() const; LLStoredMessagePtr getBuiltMessage() const; - S32 sendMessage(const LLHost &host, LLStoredMessagePtr message); + S32 sendMessage(const LLHost &host, LLStoredMessagePtr message) override; private: LLSD getReceivedMessageLLSD() const; @@ -446,8 +446,8 @@ public: // you need to go to the next block type or need to start a new // message. Specify the current blockname to check block counts, // otherwise the method only checks against MTU. - BOOL isSendFull(const char* blockname = NULL); - BOOL isSendFullFast(const char* blockname = NULL); + BOOL isSendFull(const char* blockname = nullptr); + BOOL isSendFullFast(const char* blockname = nullptr); BOOL removeLastBlock(); diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp index e0fd821f86ed3c49c1d9cc0e34fe78ee4ea8397f..d3304b8d2bd170c6f7c81a0fe5f9ff0998dca500 100644 --- a/indra/llmessage/net.cpp +++ b/indra/llmessage/net.cpp @@ -118,7 +118,7 @@ const char* u32_to_ip_string(U32 ip) char* result = inet_ntoa(in); // NULL indicates error in conversion - if (result != NULL) + if (result != nullptr) { strncpy( buffer, result, MAXADDRSTR ); /* Flawfinder: ignore */ buffer[MAXADDRSTR-1] = '\0'; @@ -142,7 +142,7 @@ char *u32_to_ip_string(U32 ip, char *ip_string) result = inet_ntoa(in); // NULL indicates error in conversion - if (result != NULL) + if (result != nullptr) { //the function signature needs to change to pass in the lengfth of first and last. strcpy(ip_string, result); /*Flawfinder: ignore*/ @@ -150,7 +150,7 @@ char *u32_to_ip_string(U32 ip, char *ip_string) } else { - return NULL; + return nullptr; } } diff --git a/indra/llmessage/partsyspacket.cpp b/indra/llmessage/partsyspacket.cpp index 654b1ed3e5e929cc073e88d1b1e549c5ecb0feec..6be4935938617266da7d6acd5df2320b6de80361 100644 --- a/indra/llmessage/partsyspacket.cpp +++ b/indra/llmessage/partsyspacket.cpp @@ -1266,7 +1266,7 @@ BOOL LLPartSysCompressedPacket::toLLPartInitData(LLPartInitData *out, U32 *bytes BOOL LLPartSysCompressedPacket::fromUnsignedBytes(U8 *in, U32 bytesUsed) { - if ((in != NULL) && (bytesUsed <= sizeof(mData))) + if ((in != nullptr) && (bytesUsed <= sizeof(mData))) { memcpy(mData, in, bytesUsed); /* Flawfinder: ignore */ mNumBytes = bytesUsed; diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 293db252bd068b3108f65fb0bb9e72d6159f8ef5..e0513c39cc8959ae0310885444327d5b4a22ef9e 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -165,7 +165,7 @@ void LLPluginClassMedia::idle(void) mPlugin->idle(); } - if((mMediaWidth == -1) || (!mTextureParamsReceived) || (mPlugin == NULL) || (mPlugin->isBlocked()) || (mOwner == NULL)) + if((mMediaWidth == -1) || (!mTextureParamsReceived) || (mPlugin == nullptr) || (mPlugin->isBlocked()) || (mOwner == nullptr)) { // Can't process a size change at this time } @@ -285,8 +285,8 @@ int LLPluginClassMedia::getTextureHeight() const unsigned char* LLPluginClassMedia::getBitsData() { - unsigned char *result = NULL; - if((mPlugin != NULL) && !mTextureSharedMemoryName.empty()) + unsigned char *result = nullptr; + if((mPlugin != nullptr) && !mTextureSharedMemoryName.empty()) { result = (unsigned char*)mPlugin->getSharedMemoryAddress(mTextureSharedMemoryName); } @@ -377,7 +377,7 @@ bool LLPluginClassMedia::textureValid(void) mMediaHeight <= 0 || mRequestedMediaWidth != mMediaWidth || mRequestedMediaHeight != mMediaHeight || - getBitsData() == NULL + getBitsData() == nullptr ) return false; @@ -388,7 +388,7 @@ bool LLPluginClassMedia::getDirty(LLRect *dirty_rect) { bool result = !mDirtyRect.isEmpty(); - if(dirty_rect != NULL) + if(dirty_rect != nullptr) { *dirty_rect = mDirtyRect; } diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index d7395ac705e43b35e13ffc520c7df7877b2123d7..57f6e1803a46f07d020ba2db31768e5f8bca8e07 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -96,7 +96,7 @@ public: // until you call idle() again. bool textureValid(void); - bool getDirty(LLRect *dirty_rect = NULL); + bool getDirty(LLRect *dirty_rect = nullptr); void resetDirty(void); typedef enum @@ -154,9 +154,9 @@ public: void setDisableTimeout(bool disable) { if(mPlugin) mPlugin->setDisableTimeout(disable); }; // Inherited from LLPluginProcessParentOwner - /* virtual */ void receivePluginMessage(const LLPluginMessage &message); - /* virtual */ void pluginLaunchFailed(); - /* virtual */ void pluginDied(); + /* virtual */ void receivePluginMessage(const LLPluginMessage &message) override; + /* virtual */ void pluginLaunchFailed() override; + /* virtual */ void pluginDied() override; typedef enum diff --git a/indra/llplugin/llplugincookiestore.cpp b/indra/llplugin/llplugincookiestore.cpp index 0d4ee136f8cf0c12cd28ca1a2a3969eb82319351..ecfe6e850195810ae120d8f046d1e13e1102abc5 100644 --- a/indra/llplugin/llplugincookiestore.cpp +++ b/indra/llplugin/llplugincookiestore.cpp @@ -67,7 +67,7 @@ LLPluginCookieStore::Cookie *LLPluginCookieStore::Cookie::createFromString(const if(!result->parse(host)) { delete result; - result = NULL; + result = nullptr; } return result; @@ -201,7 +201,7 @@ bool LLPluginCookieStore::Cookie::parse(const std::string &host) // HACK: LLDate apparently can't PARSE an rfc1123-format date, even though it can GENERATE one. // The curl function curl_getdate can do this, but I'm hesitant to unilaterally introduce a curl dependency in LLDate. #if 1 - time_t date = curl_getdate(date_string.c_str(), NULL ); + time_t date = curl_getdate(date_string.c_str(), nullptr ); mDate.secondsSinceEpoch((F64)date); LL_DEBUGS("CookieStoreParse") << " expire date parsed to: " << mDate.asRFC1123() << LL_ENDL; #else @@ -601,7 +601,7 @@ void LLPluginCookieStore::setOneCookie(const std::string &s, std::string::size_t removeCookie(key); delete cookie; - cookie = NULL; + cookie = nullptr; LL_DEBUGS("CookieStoreUpdate") << " removing" << LL_ENDL; } @@ -618,7 +618,7 @@ void LLPluginCookieStore::setOneCookie(const std::string &s, std::string::size_t // The new cookie is identical to the old -- don't mark as changed. // Just leave the old one in the map. delete cookie; - cookie = NULL; + cookie = nullptr; LL_DEBUGS("CookieStoreUpdate") << " unchanged" << LL_ENDL; } diff --git a/indra/llplugin/llplugininstance.cpp b/indra/llplugin/llplugininstance.cpp index 488125ffd8868317ca64bc1c0bc36fabfeab9b68..6b9eb84fea0be7e2bf2629efa695fa441dd2f18d 100644 --- a/indra/llplugin/llplugininstance.cpp +++ b/indra/llplugin/llplugininstance.cpp @@ -54,9 +54,9 @@ const char *LLPluginInstance::PLUGIN_INIT_FUNCTION_NAME = "LLPluginInitEntryPoin * @param[in] owner Plugin instance. TODO:DOC is this a good description of what "owner" is? */ LLPluginInstance::LLPluginInstance(LLPluginInstanceMessageListener *owner) : - mDSOHandle(NULL), - mPluginUserData(NULL), - mPluginSendMessageFunction(NULL) + mDSOHandle(nullptr), + mPluginUserData(nullptr), + mPluginSendMessageFunction(nullptr) { mOwner = owner; } @@ -66,10 +66,10 @@ LLPluginInstance::LLPluginInstance(LLPluginInstanceMessageListener *owner) : */ LLPluginInstance::~LLPluginInstance() { - if(mDSOHandle != NULL) + if(mDSOHandle != nullptr) { apr_dso_unload(mDSOHandle); - mDSOHandle = NULL; + mDSOHandle = nullptr; } } @@ -81,7 +81,7 @@ LLPluginInstance::~LLPluginInstance() */ int LLPluginInstance::load(const std::string& plugin_dir, std::string &plugin_file) { - pluginInitFunction init_function = NULL; + pluginInitFunction init_function = nullptr; if ( plugin_dir.length() ) { diff --git a/indra/llplugin/llpluginmessage.cpp b/indra/llplugin/llpluginmessage.cpp index bfe00e87e8c4e159dffff42bcb81b6ce09ded016..f1edbcfbdb9ba70d2ab57fe6fb98d48a24b86dbf 100644 --- a/indra/llplugin/llpluginmessage.cpp +++ b/indra/llplugin/llpluginmessage.cpp @@ -285,7 +285,7 @@ U32 LLPluginMessage::getValueU32(const std::string &key) const { std::string value = mMessage["params"][key].asString(); - result = (U32)strtoul(value.c_str(), NULL, 16); + result = (U32)strtoul(value.c_str(), nullptr, 16); } return result; @@ -338,13 +338,13 @@ F64 LLPluginMessage::getValueReal(const std::string &key) const */ void* LLPluginMessage::getValuePointer(const std::string &key) const { - void* result = NULL; + void* result = nullptr; if(mMessage["params"].has(key)) { std::string value = mMessage["params"][key].asString(); - result = (void*)llstrtou64(value.c_str(), NULL, 16); + result = (void*)llstrtou64(value.c_str(), nullptr, 16); } return result; diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp index 9f0532ea0d85510cf23cfb24237ea540bd242b9e..3fd304172530c3f4e3d76988d1e7c6395ba4d79c 100644 --- a/indra/llplugin/llpluginmessagepipe.cpp +++ b/indra/llplugin/llpluginmessagepipe.cpp @@ -37,7 +37,7 @@ static const char MESSAGE_DELIMITER = '\0'; LLPluginMessagePipeOwner::LLPluginMessagePipeOwner() : - mMessagePipe(NULL), + mMessagePipe(nullptr), mSocketError(APR_SUCCESS) { } @@ -64,13 +64,13 @@ void LLPluginMessagePipeOwner::setMessagePipe(LLPluginMessagePipe *read_pipe) bool LLPluginMessagePipeOwner::canSendMessage(void) { - return (mMessagePipe != NULL); + return (mMessagePipe != nullptr); } bool LLPluginMessagePipeOwner::writeMessageRaw(const std::string &message) { bool result = true; - if(mMessagePipe != NULL) + if(mMessagePipe != nullptr) { result = mMessagePipe->addMessage(message); } @@ -85,10 +85,10 @@ bool LLPluginMessagePipeOwner::writeMessageRaw(const std::string &message) void LLPluginMessagePipeOwner::killMessagePipe(void) { - if(mMessagePipe != NULL) + if(mMessagePipe != nullptr) { delete mMessagePipe; - mMessagePipe = NULL; + mMessagePipe = nullptr; } } @@ -104,9 +104,9 @@ LLPluginMessagePipe::LLPluginMessagePipe(LLPluginMessagePipeOwner *owner, LLSock LLPluginMessagePipe::~LLPluginMessagePipe() { - if(mOwner != NULL) + if(mOwner != nullptr) { - mOwner->setMessagePipe(NULL); + mOwner->setMessagePipe(nullptr); } } @@ -131,7 +131,7 @@ bool LLPluginMessagePipe::addMessage(const std::string &message) void LLPluginMessagePipe::clearOwner(void) { // The owner is done with this pipe. The next call to process_impl should send any remaining data and exit. - mOwner = NULL; + mOwner = nullptr; } void LLPluginMessagePipe::setSocketTimeout(apr_interval_time_t timeout_usec) diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp index 217b508d76a867d3cccfd8a08257a87c8c951ec2..1f614b72b9fa7883ed05492d274edf170f613002 100644 --- a/indra/llplugin/llpluginprocesschild.cpp +++ b/indra/llplugin/llpluginprocesschild.cpp @@ -42,7 +42,7 @@ static const F32 PLUGIN_IDLE_SECONDS = 1.0f / 100.0f; // Each call to idle will LLPluginProcessChild::LLPluginProcessChild() { mState = STATE_UNINITIALIZED; - mInstance = NULL; + mInstance = nullptr; mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); mSleepTime = PLUGIN_IDLE_SECONDS; // default: send idle messages at 100Hz mCPUElapsed = 0.0f; @@ -52,7 +52,7 @@ LLPluginProcessChild::LLPluginProcessChild() LLPluginProcessChild::~LLPluginProcessChild() { - if(mInstance != NULL) + if(mInstance != nullptr) { sendMessageToPlugin(LLPluginMessage("base", "cleanup")); @@ -94,7 +94,7 @@ void LLPluginProcessChild::idle(void) setState(STATE_ERROR); } - if((mState > STATE_INITIALIZED) && (mMessagePipe == NULL)) + if((mState > STATE_INITIALIZED) && (mMessagePipe == nullptr)) { // The pipe has been closed -- we're done. // TODO: This could be slightly more subtle, but I'm not sure it needs to be. @@ -107,7 +107,7 @@ void LLPluginProcessChild::idle(void) // When in doubt, don't do it. idle_again = false; - if(mInstance != NULL) + if(mInstance != nullptr) { // Provide some time to the plugin mInstance->idle(); @@ -169,7 +169,7 @@ void LLPluginProcessChild::idle(void) break; case STATE_RUNNING: - if(mInstance != NULL) + if(mInstance != nullptr) { // Provide some time to the plugin LLPluginMessage message("base", "idle"); @@ -200,11 +200,11 @@ void LLPluginProcessChild::idle(void) break; case STATE_SHUTDOWNREQ: - if (mInstance != NULL) + if (mInstance != nullptr) { sendMessageToPlugin(LLPluginMessage("base", "cleanup")); delete mInstance; - mInstance = NULL; + mInstance = nullptr; } setState(STATE_UNLOADING); mWaitGoodbye.setTimerExpirySec(GOODBYE_SECONDS); @@ -450,7 +450,7 @@ void LLPluginProcessChild::receiveMessageRaw(const std::string &message) } } - if(passMessage && mInstance != NULL) + if(passMessage && mInstance != nullptr) { LLTimer elapsed; @@ -555,7 +555,7 @@ void LLPluginProcessChild::receivePluginMessage(const std::string &message) // The plugin wants to block and wait for a response to this message. sleep(mSleepTime); // this will pump the message pipe and process messages - if(mBlockingResponseReceived || mSocketError != APR_SUCCESS || (mMessagePipe == NULL)) + if(mBlockingResponseReceived || mSocketError != APR_SUCCESS || (mMessagePipe == nullptr)) { // Response has been received, or we've hit an error state. Stop waiting. mBlockingRequest = false; diff --git a/indra/llplugin/llpluginprocesschild.h b/indra/llplugin/llpluginprocesschild.h index b916cc9528fc51f5549a01035326e6af1188045e..d92bb2ea397cab592e337381a6e7e6ecd4138c11 100644 --- a/indra/llplugin/llpluginprocesschild.h +++ b/indra/llplugin/llpluginprocesschild.h @@ -64,10 +64,10 @@ public: void sendMessageToParent(const LLPluginMessage &message); // Inherited from LLPluginMessagePipeOwner - /* virtual */ void receiveMessageRaw(const std::string &message); + /* virtual */ void receiveMessageRaw(const std::string &message) override; // Inherited from LLPluginInstanceMessageListener - /* virtual */ void receivePluginMessage(const std::string &message); + /* virtual */ void receivePluginMessage(const std::string &message) override; private: diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index fa5c42f68fd5c4bbd303e3efb8b9f6a70c4b9a66..bc108c7f70155d1b0577e6b26276c40f8a069caa 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -46,11 +46,11 @@ LLPluginProcessParentOwner::~LLPluginProcessParentOwner() } bool LLPluginProcessParent::sUseReadThread = false; -apr_pollset_t *LLPluginProcessParent::sPollSet = NULL; +apr_pollset_t *LLPluginProcessParent::sPollSet = nullptr; bool LLPluginProcessParent::sPollsetNeedsRebuild = false; LLMutex *LLPluginProcessParent::sInstancesMutex; LLPluginProcessParent::mapInstances_t LLPluginProcessParent::sInstances; -LLThread *LLPluginProcessParent::sReadThread = NULL; +LLThread *LLPluginProcessParent::sReadThread = nullptr; class LLPluginProcessParentPollThread: public LLThread @@ -62,7 +62,7 @@ public: } protected: // Inherited from LLThread - /*virtual*/ void run(void) + /*virtual*/ void run(void) override { while(!isQuitting() && LLPluginProcessParent::getUseReadThread()) { @@ -75,7 +75,7 @@ protected: } // Inherited from LLThread - /*virtual*/ bool runCondition(void) + /*virtual*/ bool runCondition(void) override { return(LLPluginProcessParent::canPollThreadRun()); } @@ -99,7 +99,7 @@ LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner): mDebug = false; mBlocked = false; mPolledInput = false; - mPollFD.client_data = NULL; + mPollFD.client_data = nullptr; mPluginLaunchTimeout = 60.0f; mPluginLockupTimeout = 15.0f; @@ -120,7 +120,7 @@ LLPluginProcessParent::~LLPluginProcessParent() // destroy the shared memory region iter->second->destroy(); delete iter->second; - iter->second = NULL; + iter->second = nullptr; // and remove it from our map mSharedMemoryRegions.erase(iter); @@ -165,7 +165,7 @@ void LLPluginProcessParent::shutdown() void LLPluginProcessParent::requestShutdown() { setState(STATE_GOODBYE); - mOwner = NULL; + mOwner = nullptr; if (LLApp::isQuitting()) { // if we're quitting, run the idle once more @@ -265,7 +265,7 @@ bool LLPluginProcessParent::accept() bool result = false; apr_status_t status = APR_EGENERAL; - apr_socket_t *new_socket = NULL; + apr_socket_t *new_socket = nullptr; status = apr_socket_accept( &new_socket, @@ -279,7 +279,7 @@ bool LLPluginProcessParent::accept() // Success. Create a message pipe on the new socket // we MUST create a new pool for the LLSocket, since it will take ownership of it and delete it in its destructor! - apr_pool_t* new_pool = NULL; + apr_pool_t* new_pool = nullptr; status = apr_pool_create(&new_pool, gAPRPoolp); mSocket = LLSocket::create(new_socket, new_pool); @@ -368,7 +368,7 @@ void LLPluginProcessParent::idle(void) { apr_status_t status = APR_SUCCESS; - apr_sockaddr_t* addr = NULL; + apr_sockaddr_t* addr = nullptr; mListenSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); mBoundPort = 0; @@ -402,7 +402,7 @@ void LLPluginProcessParent::idle(void) // Get the actual port the socket was bound to { - apr_sockaddr_t* bound_addr = NULL; + apr_sockaddr_t* bound_addr = nullptr; if(ll_apr_warn_status(apr_socket_addr_get(&bound_addr, APR_LOCAL, mListenSocket->getSocket()))) { killSockets(); @@ -579,7 +579,7 @@ void LLPluginProcessParent::idle(void) break; case STATE_LAUNCH_FAILURE: - if(mOwner != NULL) + if(mOwner != nullptr) { mOwner->pluginLaunchFailed(); } @@ -587,7 +587,7 @@ void LLPluginProcessParent::idle(void) break; case STATE_ERROR: - if(mOwner != NULL) + if(mOwner != nullptr) { mOwner->pluginDied(); } @@ -689,12 +689,12 @@ void LLPluginProcessParent::setMessagePipe(LLPluginMessagePipe *message_pipe) if(mMessagePipe) { // Unsetting an existing message pipe -- remove from the pollset - mPollFD.client_data = NULL; + mPollFD.client_data = nullptr; // pollset needs an update update_pollset = true; } - if(message_pipe != NULL) + if(message_pipe != nullptr) { // Set up the apr_pollfd_t mPollFD.p = gAPRPoolp; @@ -743,7 +743,7 @@ void LLPluginProcessParent::updatePollset() LL_DEBUGS("PluginPoll") << "destroying pollset " << sPollSet << LL_ENDL; // delete the existing pollset. apr_pollset_destroy(sPollSet); - sPollSet = NULL; + sPollSet = nullptr; } mapInstances_t::iterator iter; @@ -771,7 +771,7 @@ void LLPluginProcessParent::updatePollset() { #endif // APR_POLLSET_NOCOPY LL_WARNS("PluginPoll") << "Couldn't create pollset. Falling back to non-pollset mode." << LL_ENDL; - sPollSet = NULL; + sPollSet = nullptr; #ifdef APR_POLLSET_NOCOPY } else @@ -827,7 +827,7 @@ void LLPluginProcessParent::setUseReadThread(bool use_read_thread) // shut down the read thread LL_INFOS("PluginPoll") << "destroying read thread " << LL_ENDL; delete sReadThread; - sReadThread = NULL; + sReadThread = nullptr; } } @@ -917,7 +917,7 @@ void LLPluginProcessParent::servicePoll() apr_pollset_remove(sPollSet, &mPollFD); // and tell the code not to re-add it - mPollFD.client_data = NULL; + mPollFD.client_data = nullptr; } } @@ -961,7 +961,7 @@ void LLPluginProcessParent::receiveMessageEarly(const LLPluginMessage &message) { // Call out to the owner and see if they to reply // TODO: Should this only happen when blocked? - if(mOwner != NULL) + if(mOwner != nullptr) { handled = mOwner->receivePluginMessageEarly(message); } @@ -1050,7 +1050,7 @@ void LLPluginProcessParent::receiveMessage(const LLPluginMessage &message) // destroy the shared memory region iter->second->destroy(); delete iter->second; - iter->second = NULL; + iter->second = nullptr; // and remove it from our map mSharedMemoryRegions.erase(iter); @@ -1063,7 +1063,7 @@ void LLPluginProcessParent::receiveMessage(const LLPluginMessage &message) } else { - if(mOwner != NULL) + if(mOwner != nullptr) { mOwner->receivePluginMessage(message); } @@ -1129,7 +1129,7 @@ size_t LLPluginProcessParent::getSharedMemorySize(const std::string &name) } void *LLPluginProcessParent::getSharedMemoryAddress(const std::string &name) { - void *result = NULL; + void *result = nullptr; sharedMemoryRegionsType::iterator iter = mSharedMemoryRegions.find(name); if(iter != mSharedMemoryRegions.end()) diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index df1630255cc52ff165c557cd9d85ba62519b1a18..1d5cd6df73f0381ad66255c36f535c9b07519b7d 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -99,9 +99,9 @@ public: void requestShutdown(); // Inherited from LLPluginMessagePipeOwner - /*virtual*/ void receiveMessageRaw(const std::string &message); + /*virtual*/ void receiveMessageRaw(const std::string &message) override; /*virtual*/ void receiveMessageEarly(const LLPluginMessage &message); - /*virtual*/ void setMessagePipe(LLPluginMessagePipe *message_pipe) ; + /*virtual*/ void setMessagePipe(LLPluginMessagePipe *message_pipe) override; // This adds a memory segment shared with the client, generating a name for the segment. The name generated is guaranteed to be unique on the host. // The caller must call removeSharedMemory first (and wait until getSharedMemorySize returns 0 for the indicated name) before re-adding a segment with the same name. diff --git a/indra/llplugin/llpluginsharedmemory.cpp b/indra/llplugin/llpluginsharedmemory.cpp index 0d49530a540569b3f0b8b7fb065433d6719609a0..54ed27132deccb886d226e90c7764d8c25ef8092 100644 --- a/indra/llplugin/llpluginsharedmemory.cpp +++ b/indra/llplugin/llpluginsharedmemory.cpp @@ -118,7 +118,7 @@ public: LLPluginSharedMemory::LLPluginSharedMemory() { mSize = 0; - mMappedAddress = NULL; + mMappedAddress = nullptr; mNeedsDestroy = false; mImpl = new LLPluginSharedMemoryPlatformImpl; @@ -383,7 +383,7 @@ bool LLPluginSharedMemory::detach(void) LLPluginSharedMemoryPlatformImpl::LLPluginSharedMemoryPlatformImpl() { - mMapFile = NULL; + mMapFile = nullptr; } LLPluginSharedMemoryPlatformImpl::~LLPluginSharedMemoryPlatformImpl() @@ -400,7 +400,7 @@ bool LLPluginSharedMemory::map(void) 0, mSize); - if(mMappedAddress == NULL) + if(mMappedAddress == nullptr) { LL_WARNS("Plugin") << "MapViewOfFile failed: " << GetLastError() << LL_ENDL; return false; @@ -413,10 +413,10 @@ bool LLPluginSharedMemory::map(void) bool LLPluginSharedMemory::unmap(void) { - if(mMappedAddress != NULL) + if(mMappedAddress != nullptr) { UnmapViewOfFile(mMappedAddress); - mMappedAddress = NULL; + mMappedAddress = nullptr; } return true; @@ -424,10 +424,10 @@ bool LLPluginSharedMemory::unmap(void) bool LLPluginSharedMemory::close(void) { - if(mImpl->mMapFile != NULL) + if(mImpl->mMapFile != nullptr) { CloseHandle(mImpl->mMapFile); - mImpl->mMapFile = NULL; + mImpl->mMapFile = nullptr; } return true; @@ -448,13 +448,13 @@ bool LLPluginSharedMemory::create(size_t size) mImpl->mMapFile = CreateFileMappingW( INVALID_HANDLE_VALUE, // use paging file - NULL, // default security + nullptr, // default security PAGE_READWRITE, // read/write access 0, // max. object size mSize, // buffer size utf8str_to_utf16str(mName).c_str()); // name of mapping object - if(mImpl->mMapFile == NULL) + if(mImpl->mMapFile == nullptr) { LL_WARNS("Plugin") << "CreateFileMapping failed: " << GetLastError() << LL_ENDL; return false; @@ -482,7 +482,7 @@ bool LLPluginSharedMemory::attach(const std::string &name, size_t size) FALSE, // do not inherit the name utf8str_to_utf16str(mName).c_str()); // name of mapping object - if(mImpl->mMapFile == NULL) + if(mImpl->mMapFile == nullptr) { LL_WARNS("Plugin") << "OpenFileMapping failed: " << GetLastError() << LL_ENDL; return false; diff --git a/indra/llplugin/llpluginsharedmemory.h b/indra/llplugin/llpluginsharedmemory.h index c6cd49cabb7e119b0f9c326cc3ea358ed9f408d7..9805aa47a389a7c7b83ad9cc7380b482a41963da 100644 --- a/indra/llplugin/llpluginsharedmemory.h +++ b/indra/llplugin/llpluginsharedmemory.h @@ -82,7 +82,7 @@ public: * * @return True if memory address is non-null, false otherwise. */ - bool isMapped(void) const { return (mMappedAddress != NULL); }; + bool isMapped(void) const { return (mMappedAddress != nullptr); }; /** * Get pointer to shared memory. * diff --git a/indra/llplugin/slplugin/slplugin.cpp b/indra/llplugin/slplugin/slplugin.cpp index c5851e4d21ad94714da9add67cb9b89048bceca8..7f37daa13423b0853261efddaad6594ad249075a 100644 --- a/indra/llplugin/slplugin/slplugin.cpp +++ b/indra/llplugin/slplugin/slplugin.cpp @@ -82,9 +82,9 @@ LONG WINAPI myWin32ExceptionHandler( struct _EXCEPTION_POINTERS* exception_infop static BOOL PreventSetUnhandledExceptionFilter() { HMODULE hKernel32 = LoadLibrary(TEXT("kernel32.dll")); - if (hKernel32 == NULL) return FALSE; + if (hKernel32 == nullptr) return FALSE; void *pOrgEntry = GetProcAddress(hKernel32, "SetUnhandledExceptionFilter"); - if (pOrgEntry == NULL) return FALSE; + if (pOrgEntry == nullptr) return FALSE; #ifdef _M_IX86 // Code for x86: @@ -111,7 +111,7 @@ static BOOL PreventSetUnhandledExceptionFilter() void initExceptionHandler() { TCHAR szExeFileName[MAX_PATH]; - GetModuleFileName(NULL, szExeFileName, MAX_PATH); + GetModuleFileName(nullptr, szExeFileName, MAX_PATH); std::wstring exename(szExeFileName); size_t path_end = exename.find_last_of('\\'); if (path_end != std::string::npos) @@ -151,10 +151,10 @@ bool checkExceptionHandler() ok = false; } - if (prev_filter == NULL) + if (prev_filter == nullptr) { ok = FALSE; - if (NULL == myWin32ExceptionHandler) + if (nullptr == myWin32ExceptionHandler) { LL_WARNS("AppInit") << "Exception handler uninitialized." << LL_ENDL; } diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 144f0c41c5b669c3e57f6e4ec5ed31775d57a8ff..723d262f61346f9c2d274e4bfc7dff723650a45d 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -167,9 +167,9 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa S32 tc_offset = -1; S32 norm_offset = -1; - domSource* pos_source = NULL; - domSource* tc_source = NULL; - domSource* norm_source = NULL; + domSource* pos_source = nullptr; + domSource* tc_source = nullptr; + domSource* norm_source = nullptr; S32 idx_stride = 0; @@ -301,13 +301,13 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa if (!norm_source) { //ll_aligned_free_16(new_face.mNormals); - new_face.mNormals = NULL; + new_face.mNormals = nullptr; } if (!tc_source) { //ll_aligned_free_16(new_face.mTexCoords); - new_face.mTexCoords = NULL; + new_face.mTexCoords = nullptr; } face = LLVolumeFace(); @@ -332,13 +332,13 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa if (!norm_source) { //ll_aligned_free_16(new_face.mNormals); - new_face.mNormals = NULL; + new_face.mNormals = nullptr; } if (!tc_source) { //ll_aligned_free_16(new_face.mTexCoords); - new_face.mTexCoords = NULL; + new_face.mTexCoords = nullptr; } } @@ -364,9 +364,9 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac S32 tc_offset = -1; S32 norm_offset = -1; - domSource* pos_source = NULL; - domSource* tc_source = NULL; - domSource* norm_source = NULL; + domSource* pos_source = nullptr; + domSource* tc_source = nullptr; + domSource* norm_source = nullptr; S32 idx_stride = 0; @@ -545,13 +545,13 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac if (!norm_source) { //ll_aligned_free_16(new_face.mNormals); - new_face.mNormals = NULL; + new_face.mNormals = nullptr; } if (!tc_source) { //ll_aligned_free_16(new_face.mTexCoords); - new_face.mTexCoords = NULL; + new_face.mTexCoords = nullptr; } face = LLVolumeFace(); @@ -579,13 +579,13 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac if (!norm_source) { //ll_aligned_free_16(new_face.mNormals); - new_face.mNormals = NULL; + new_face.mNormals = nullptr; } if (!tc_source) { //ll_aligned_free_16(new_face.mTexCoords); - new_face.mTexCoords = NULL; + new_face.mTexCoords = nullptr; } } @@ -604,9 +604,9 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac S32 n_offset = -1; S32 t_offset = -1; - domListOfFloats* v = NULL; - domListOfFloats* n = NULL; - domListOfFloats* t = NULL; + domListOfFloats* v = nullptr; + domListOfFloats* n = nullptr; + domListOfFloats* t = nullptr; U32 stride = 0; for (U32 i = 0; i < inputs.getCount(); ++i) @@ -796,13 +796,13 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac if (!n) { //ll_aligned_free_16(new_face.mNormals); - new_face.mNormals = NULL; + new_face.mNormals = nullptr; } if (!t) { //ll_aligned_free_16(new_face.mTexCoords); - new_face.mTexCoords = NULL; + new_face.mTexCoords = nullptr; } } @@ -903,7 +903,7 @@ bool LLDAELoader::OpenFile(const std::string& filename) daeDatabase* db = dae.getDatabase(); - daeInt count = db->getElementCount(NULL, COLLADA_TYPE_MESH); + daeInt count = db->getElementCount(nullptr, COLLADA_TYPE_MESH); daeDocument* doc = dae.getDoc(tmp_file); if (!doc) @@ -921,12 +921,12 @@ bool LLDAELoader::OpenFile(const std::string& filename) //Verify some basic properties of the dae //1. Basic validity check on controller - daeUInt controllerCount = db->getElementCount( NULL, "controller" ); + daeUInt controllerCount = db->getElementCount(nullptr, "controller" ); bool result = false; for (daeUInt i = 0; i < controllerCount; ++i) { - domController* pController = NULL; - db->getElement( (daeElement**) &pController, (daeInt) i , NULL, "controller" ); + domController* pController = nullptr; + db->getElement( (daeElement**) &pController, (daeInt) i , nullptr, "controller" ); result = verifyController( pController ); if (!result) { @@ -979,8 +979,8 @@ bool LLDAELoader::OpenFile(const std::string& filename) U32 submodel_limit = count > 0 ? mGeneratedModelLimit/count : 0; for (daeInt idx = 0; idx < count; ++idx) { //build map of domEntities to LLModel - domMesh* mesh = NULL; - db->getElement((daeElement**) &mesh, idx, NULL, COLLADA_TYPE_MESH); + domMesh* mesh = nullptr; + db->getElement((daeElement**) &mesh, idx, nullptr, COLLADA_TYPE_MESH); if (mesh) { @@ -1036,11 +1036,11 @@ bool LLDAELoader::OpenFile(const std::string& filename) model_iter++; } - count = db->getElementCount(NULL, COLLADA_TYPE_SKIN); + count = db->getElementCount(nullptr, COLLADA_TYPE_SKIN); for (daeInt idx = 0; idx < count; ++idx) { //add skinned meshes as instances - domSkin* skin = NULL; - db->getElement((daeElement**) &skin, idx, NULL, COLLADA_TYPE_SKIN); + domSkin* skin = nullptr; + db->getElement((daeElement**) &skin, idx, nullptr, COLLADA_TYPE_SKIN); if (skin) { @@ -1169,16 +1169,16 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do //Some collada setup for accessing the skeleton - daeUInt skeleton_count = dae->getDatabase()->getElementCount( NULL, "skeleton" ); + daeUInt skeleton_count = dae->getDatabase()->getElementCount(nullptr, "skeleton" ); std::vector<domInstance_controller::domSkeleton*> skeletons; for (daeUInt i = 0; i < skeleton_count; i++) { - daeElement* pElement = 0; - dae->getDatabase()->getElement( &pElement, (daeInt) i, 0, "skeleton" ); + daeElement* pElement = nullptr; + dae->getDatabase()->getElement( &pElement, (daeInt) i, nullptr, "skeleton" ); //Try to get at the skeletal instance controller domInstance_controller::domSkeleton* pSkeleton = daeSafeCast<domInstance_controller::domSkeleton>( pElement ); - daeElement* pSkeletonRootNode = NULL; + daeElement* pSkeletonRootNode = nullptr; if (pSkeleton) { pSkeletonRootNode = pSkeleton->getValue().getElement(); @@ -1508,7 +1508,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do if (weights) { domInputLocalOffset_Array& inputs = weights->getInput_array(); - domFloat_array* vertex_weights = NULL; + domFloat_array* vertex_weights = nullptr; for (size_t i = 0; i < inputs.getCount(); ++i) { if (strcmp(inputs[i]->getSemantic(), COMMON_PROFILE_INPUT_WEIGHT) == 0) @@ -1820,7 +1820,7 @@ void LLDAELoader::extractTranslationViaSID( daeElement* pElement, LLMatrix4& tra //----------------------------------------------------------------------------- void LLDAELoader::processJointNode( domNode* pNode, JointTransformMap& jointTransforms ) { - if (pNode->getName() == NULL) + if (pNode->getName() == nullptr) { LL_WARNS() << "nameless node, can't process" << LL_ENDL; return; @@ -1909,7 +1909,7 @@ daeElement* LLDAELoader::getChildFromElement( daeElement* pElement, std::string return pChildOfElement; } LL_DEBUGS("Mesh")<< "Could not find a child [" << name << "] for the element: \"" << pElement->getAttribute("id") << "\"" << LL_ENDL; - return NULL; + return nullptr; } void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* dae ) @@ -2106,7 +2106,7 @@ std::map<std::string, LLImportMaterial> LLDAELoader::getMaterials(LLModel* model { LLImportMaterial import_material; - domInstance_material* instance_mat = NULL; + domInstance_material* instance_mat = nullptr; domBind_material::domTechnique_common* technique = daeSafeCast<domBind_material::domTechnique_common>(instance_geo->getDescendant(daeElement::matchType(domBind_material::domTechnique_common::ID()))); @@ -2202,7 +2202,7 @@ LLImportMaterial LLDAELoader::profileToMaterial(domProfile_COMMON* material, DAE } else if (texture->getTexture()) { - domImage* image = NULL; + domImage* image = nullptr; dae->getDatabase()->getElement((daeElement**) &image, 0, texture->getTexture(), COLLADA_TYPE_IMAGE); if (image) { diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h index 4e990dbe5e51b887f40ec09501bdd8eabd4b9350..8ab3cd4e8eb7922f69f5754b0b67c112caf7cc04 100644 --- a/indra/llprimitive/lldaeloader.h +++ b/indra/llprimitive/lldaeloader.h @@ -62,7 +62,7 @@ public: bool preprocess); virtual ~LLDAELoader() ; - virtual bool OpenFile(const std::string& filename); + bool OpenFile(const std::string& filename) override; protected: diff --git a/indra/llprimitive/llmaterialtable.cpp b/indra/llprimitive/llmaterialtable.cpp index f1fc2105562db5cb456b6ad8636a8e6f2286c18e..3117f58b976b1456318dbdef89f1d7a25955c734 100644 --- a/indra/llprimitive/llmaterialtable.cpp +++ b/indra/llprimitive/llmaterialtable.cpp @@ -88,9 +88,9 @@ F32 const LLMaterialTable::DEFAULT_FRICTION = 0.5f; F32 const LLMaterialTable::DEFAULT_RESTITUTION = 0.4f; LLMaterialTable::LLMaterialTable() - : mCollisionSoundMatrix(NULL), - mSlidingSoundMatrix(NULL), - mRollingSoundMatrix(NULL) + : mCollisionSoundMatrix(nullptr), + mSlidingSoundMatrix(nullptr), + mRollingSoundMatrix(nullptr) { } @@ -104,19 +104,19 @@ LLMaterialTable::~LLMaterialTable() if (mCollisionSoundMatrix) { delete [] mCollisionSoundMatrix; - mCollisionSoundMatrix = NULL; + mCollisionSoundMatrix = nullptr; } if (mSlidingSoundMatrix) { delete [] mSlidingSoundMatrix; - mSlidingSoundMatrix = NULL; + mSlidingSoundMatrix = nullptr; } if (mRollingSoundMatrix) { delete [] mRollingSoundMatrix; - mRollingSoundMatrix = NULL; + mRollingSoundMatrix = nullptr; } for_each(mMaterialInfoList.begin(), mMaterialInfoList.end(), DeletePointer()); diff --git a/indra/llprimitive/llmediaentry.cpp b/indra/llprimitive/llmediaentry.cpp index 6c9120e1715887323b621cfce63b5e8c2b991f8f..3dceb15f9cd809abe78aa75d587daa1da87d3d1b 100644 --- a/indra/llprimitive/llmediaentry.cpp +++ b/indra/llprimitive/llmediaentry.cpp @@ -96,12 +96,12 @@ LLMediaEntry::LLMediaEntry() : // mWhiteList mPermsInteract(PERM_ALL), mPermsControl(PERM_ALL), - mMediaIDp(NULL) + mMediaIDp(nullptr) { } LLMediaEntry::LLMediaEntry(const LLMediaEntry &rhs) : - mMediaIDp(NULL) + mMediaIDp(nullptr) { // "general" fields mAltImageEnable = rhs.mAltImageEnable; @@ -127,7 +127,7 @@ LLMediaEntry::LLMediaEntry(const LLMediaEntry &rhs) : LLMediaEntry::~LLMediaEntry() { - if (NULL != mMediaIDp) + if (nullptr != mMediaIDp) { delete mMediaIDp; } @@ -588,7 +588,7 @@ U32 LLMediaEntry::setHeightPixels(U16 height) const LLUUID &LLMediaEntry::getMediaID() const { // Lazily generate media ID - if (NULL == mMediaIDp) + if (nullptr == mMediaIDp) { mMediaIDp = new LLUUID(); mMediaIDp->generate(); diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index ca700099ac9c2e3455eadbf97a4a3b8d73962203..a268feb34dfeec88a436e3002a372fac6f2aceac 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -384,7 +384,7 @@ void LLModel::setVolumeFaceData( else { //ll_aligned_free_16(face.mNormals); - face.mNormals = NULL; + face.mNormals = nullptr; } if (tc.get()) @@ -395,7 +395,7 @@ void LLModel::setVolumeFaceData( else { //ll_aligned_free_16(face.mTexCoords); - face.mTexCoords = NULL; + face.mTexCoords = nullptr; } U32 size = (num_indices*2+0xF)&~0xF; @@ -594,7 +594,7 @@ void LLModel::generateNormals(F32 angle_cutoff) else { //ll_aligned_free_16(new_face.mTexCoords); - new_face.mTexCoords = NULL; + new_face.mTexCoords = nullptr; } //generate normals for new face @@ -702,7 +702,7 @@ LLSD LLModel::writeModel( mdl["physics_convex"] = decomp.asLLSD(); if (!decomp.mHull.empty() && !as_slm) { //convex decomposition exists, physics mesh will not be used (unless this is an slm file) - model[LLModel::LOD_PHYSICS] = NULL; + model[LLModel::LOD_PHYSICS] = nullptr; } } else if (submodel_id) @@ -711,7 +711,7 @@ LLSD LLModel::writeModel( mdl["secondary"] = true; mdl["submodel_id"] = submodel_id; mdl["physics_convex"] = fake_decomp.asLLSD(); - model[LLModel::LOD_PHYSICS] = NULL; + model[LLModel::LOD_PHYSICS] = nullptr; } if (as_slm) @@ -724,7 +724,7 @@ LLSD LLModel::writeModel( for (U32 idx = 0; idx < MODEL_NAMES_LENGTH; ++idx) { - if (model[idx] && (model[idx]->getNumVolumeFaces() > 0) && model[idx]->getVolumeFace(0).mPositions != NULL) + if (model[idx] && (model[idx]->getNumVolumeFaces() > 0) && model[idx]->getVolumeFace(0).mPositions != nullptr) { LLVector3 min_pos = LLVector3(model[idx]->getVolumeFace(0).mPositions[0].getF32ptr()); LLVector3 max_pos = min_pos; diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp index 5be1e2d0b402d2d878872683393167f6261b68a8..d5dab5309eabd06c836d17c72b4d5d6a091752d0 100644 --- a/indra/llprimitive/llmodelloader.cpp +++ b/indra/llprimitive/llmodelloader.cpp @@ -113,13 +113,16 @@ LLModelLoader::LLModelLoader( JointNameSet& jointsFromNodes, JointMap& legalJointNamesMap, U32 maxJointsPerMesh) -: mJointList( jointTransformMap ) -, mJointsFromNode( jointsFromNodes ) -, LLThread("Model Loader") +: LLThread("Model Loader") , mFilename(filename) , mLod(lod) -, mTrySLM(false) , mFirstTransform(TRUE) +, mTrySLM(false) +, mCacheOnlyHitIfRigged(false) +, mJointMap(legalJointNamesMap) +, mJointList( jointTransformMap ) +, mJointsFromNode( jointsFromNodes ) +, mMaxJointsPerMesh(maxJointsPerMesh) , mNumOfFetchingTextures(0) , mLoadCallback(load_cb) , mJointLookupFunc(joint_lookup_func) @@ -130,9 +133,6 @@ LLModelLoader::LLModelLoader( , mLegacyRigValid(true) , mNoNormalize(false) , mNoOptimize(false) -, mCacheOnlyHitIfRigged(false) -, mMaxJointsPerMesh(maxJointsPerMesh) -, mJointMap(legalJointNamesMap) { assert_main_thread(); sActiveLoaderList.push_back(this) ; @@ -293,7 +293,7 @@ bool LLModelLoader::loadFromSLM(const std::string& filename) } else { - instance_list[i].mLOD[lod] = NULL; + instance_list[i].mLOD[lod] = nullptr; } continue; } diff --git a/indra/llprimitive/llmodelloader.h b/indra/llprimitive/llmodelloader.h index 5d0f592a64681cd03607565a1e86e86311f97362..0574dd7161f8e8e0626cfc6aeef5fbd4d7c8c166 100644 --- a/indra/llprimitive/llmodelloader.h +++ b/indra/llprimitive/llmodelloader.h @@ -135,7 +135,7 @@ public: virtual void setNoNormalize() { mNoNormalize = true; } virtual void setNoOptimize() { mNoOptimize = true; } - virtual void run(); + void run() override; static bool getSLMFilename(const std::string& model_filename, std::string& slm_filename); @@ -180,7 +180,7 @@ public: //----------------------------------------------------------------------------- bool isNodeAJoint(const char* name) { - return name != NULL && mJointMap.find(name) != mJointMap.end(); + return name != nullptr && mJointMap.find(name) != mJointMap.end(); } protected: diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 47334a38b581345748f587ade3614a4ca614e2dd..b44f962ae362a349c49008020038927678333dac 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -123,7 +123,7 @@ const F32 TEXTURE_ROTATION_PACK_FACTOR = ((F32) 0x08000); //static // LEGACY: by default we use the LLVolumeMgr::gVolumeMgr global // TODO -- eliminate this global from the codebase! -LLVolumeMgr* LLPrimitive::sVolumeManager = NULL; +LLVolumeMgr* LLPrimitive::sVolumeManager = nullptr; // static void LLPrimitive::setVolumeManager( LLVolumeMgr* volume_manager ) @@ -143,7 +143,7 @@ bool LLPrimitive::cleanupVolumeManager() { res = sVolumeManager->cleanup(); delete sVolumeManager; - sVolumeManager = NULL; + sVolumeManager = nullptr; } return res; } @@ -153,13 +153,13 @@ bool LLPrimitive::cleanupVolumeManager() LLPrimitive::LLPrimitive() : mTextureList(), mNumTEs(0), - mMiscFlags(0), - mNumBumpmapTEs(0) + mNumBumpmapTEs(0), + mMiscFlags(0) { mPrimitiveCode = 0; mMaterial = LL_MCODE_STONE; - mVolumep = NULL; + mVolumep = nullptr; mChanged = UNCHANGED; @@ -182,7 +182,7 @@ LLPrimitive::~LLPrimitive() { sVolumeManager->unrefVolume(mVolumep); } - mVolumep = NULL; + mVolumep = nullptr; } void LLPrimitive::clearTextureList() diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index ce7f14d7502f6a932efd4666cb9a0d12075ac312..0bd327352f3844c635c811e8e71f871dd39af6e5 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -142,10 +142,10 @@ protected: public: LLLightParams(); - /*virtual*/ BOOL pack(LLDataPacker &dp) const; - /*virtual*/ BOOL unpack(LLDataPacker &dp); - /*virtual*/ bool operator==(const LLNetworkData& data) const; - /*virtual*/ void copy(const LLNetworkData& data); + /*virtual*/ BOOL pack(LLDataPacker &dp) const override; + /*virtual*/ BOOL unpack(LLDataPacker &dp) override; + /*virtual*/ bool operator==(const LLNetworkData& data) const override; + /*virtual*/ void copy(const LLNetworkData& data) override; // LLSD implementations here are provided by Eddy Stryker. // NOTE: there are currently unused in protocols LLSD asLLSD() const; @@ -236,10 +236,10 @@ public: //------ the constructor for the structure ------------ LLFlexibleObjectData(); - BOOL pack(LLDataPacker &dp) const; - BOOL unpack(LLDataPacker &dp); - bool operator==(const LLNetworkData& data) const; - void copy(const LLNetworkData& data); + BOOL pack(LLDataPacker &dp) const override; + BOOL unpack(LLDataPacker &dp) override; + bool operator==(const LLNetworkData& data) const override; + void copy(const LLNetworkData& data) override; LLSD asLLSD() const; operator LLSD() const { return asLLSD(); } bool fromLLSD(LLSD& sd); @@ -255,10 +255,10 @@ protected: public: LLSculptParams(); - /*virtual*/ BOOL pack(LLDataPacker &dp) const; - /*virtual*/ BOOL unpack(LLDataPacker &dp); - /*virtual*/ bool operator==(const LLNetworkData& data) const; - /*virtual*/ void copy(const LLNetworkData& data); + /*virtual*/ BOOL pack(LLDataPacker &dp) const override; + /*virtual*/ BOOL unpack(LLDataPacker &dp) override; + /*virtual*/ bool operator==(const LLNetworkData& data) const override; + /*virtual*/ void copy(const LLNetworkData& data) override; LLSD asLLSD() const; operator LLSD() const { return asLLSD(); } bool fromLLSD(LLSD& sd); @@ -276,10 +276,10 @@ protected: public: LLLightImageParams(); - /*virtual*/ BOOL pack(LLDataPacker &dp) const; - /*virtual*/ BOOL unpack(LLDataPacker &dp); - /*virtual*/ bool operator==(const LLNetworkData& data) const; - /*virtual*/ void copy(const LLNetworkData& data); + /*virtual*/ BOOL pack(LLDataPacker &dp) const override; + /*virtual*/ BOOL unpack(LLDataPacker &dp) override; + /*virtual*/ bool operator==(const LLNetworkData& data) const override; + /*virtual*/ void copy(const LLNetworkData& data) override; LLSD asLLSD() const; operator LLSD() const { return asLLSD(); } bool fromLLSD(LLSD& sd); diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp index 693ff3fc73133912b02b926a11ff6426a525bfbd..ee2364202822ec0b6bcb777fc7fa1dbc2f4f667a 100644 --- a/indra/llprimitive/llprimtexturelist.cpp +++ b/indra/llprimitive/llprimtexturelist.cpp @@ -72,7 +72,7 @@ void LLPrimTextureList::clear() while (itr != mEntryList.end()) { delete (*itr); - (*itr) = NULL; + (*itr) = nullptr; ++itr; } mEntryList.clear(); @@ -175,7 +175,7 @@ LLTextureEntry* LLPrimTextureList::getTexture(const U8 index) const { return mEntryList[index]; } - return NULL; + return nullptr; } //virtual diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp index b15fae66d4446da50126a38b6d13f0f83fd702a0..33d13e59deae15317d4f49ff56712c23bebc7d5d 100644 --- a/indra/llprimitive/lltextureentry.cpp +++ b/indra/llprimitive/lltextureentry.cpp @@ -62,25 +62,25 @@ LLTextureEntry* LLTextureEntry::newTextureEntry() //=============================================================== LLTextureEntry::LLTextureEntry() - : mMediaEntry(NULL) - , mSelected(false) + : mSelected(false) , mMaterialUpdatePending(false) + , mMediaEntry(nullptr) { init(LLUUID::null,1.f,1.f,0.f,0.f,0.f,DEFAULT_BUMP_CODE); } LLTextureEntry::LLTextureEntry(const LLUUID& tex_id) - : mMediaEntry(NULL) - , mSelected(false) + : mSelected(false) , mMaterialUpdatePending(false) + , mMediaEntry(nullptr) { init(tex_id,1.f,1.f,0.f,0.f,0.f,DEFAULT_BUMP_CODE); } LLTextureEntry::LLTextureEntry(const LLTextureEntry &rhs) - : mMediaEntry(NULL) - , mSelected(false) + : mSelected(false) , mMaterialUpdatePending(false) + , mMediaEntry(nullptr) { mID = rhs.mID; mScaleS = rhs.mScaleS; @@ -94,7 +94,7 @@ LLTextureEntry::LLTextureEntry(const LLTextureEntry &rhs) mGlow = rhs.mGlow; mMaterialID = rhs.mMaterialID; mMaterial = rhs.mMaterial; - if (rhs.mMediaEntry != NULL) { + if (rhs.mMediaEntry != nullptr) { // Make a copy mMediaEntry = new LLMediaEntry(*rhs.mMediaEntry); } @@ -116,15 +116,15 @@ LLTextureEntry &LLTextureEntry::operator=(const LLTextureEntry &rhs) mGlow = rhs.mGlow; mMaterialID = rhs.mMaterialID; mMaterial = rhs.mMaterial; - if (mMediaEntry != NULL) { + if (mMediaEntry != nullptr) { delete mMediaEntry; } - if (rhs.mMediaEntry != NULL) { + if (rhs.mMediaEntry != nullptr) { // Make a copy mMediaEntry = new LLMediaEntry(*rhs.mMediaEntry); } else { - mMediaEntry = NULL; + mMediaEntry = nullptr; } } @@ -146,10 +146,10 @@ void LLTextureEntry::init(const LLUUID& tex_id, F32 scale_s, F32 scale_t, F32 of mMaterialID.clear(); setColor(LLColor4(1.f, 1.f, 1.f, 1.f)); - if (mMediaEntry != NULL) { + if (mMediaEntry != nullptr) { delete mMediaEntry; } - mMediaEntry = NULL; + mMediaEntry = nullptr; } LLTextureEntry::~LLTextureEntry() @@ -157,7 +157,7 @@ LLTextureEntry::~LLTextureEntry() if(mMediaEntry) { delete mMediaEntry; - mMediaEntry = NULL; + mMediaEntry = nullptr; } } @@ -214,7 +214,7 @@ void LLTextureEntry::asLLSD(LLSD& sd) const sd["media_flags"] = mMediaFlags; if (hasMedia()) { LLSD mediaData; - if (NULL != getMediaData()) { + if (nullptr != getMediaData()) { getMediaData()->asLLSD(mediaData); } sd[TEXTURE_MEDIA_DATA_KEY] = mediaData; @@ -502,14 +502,14 @@ S32 LLTextureEntry::setMediaFlags(U8 media_flags) mMediaFlags |= media_flags; // Special code for media handling - if( hasMedia() && mMediaEntry == NULL) + if( hasMedia() && mMediaEntry == nullptr) { mMediaEntry = new LLMediaEntry; } - else if ( ! hasMedia() && mMediaEntry != NULL) + else if ( ! hasMedia() && mMediaEntry != nullptr) { delete mMediaEntry; - mMediaEntry = NULL; + mMediaEntry = nullptr; } return TEM_CHANGE_MEDIA; @@ -570,7 +570,7 @@ S32 LLTextureEntry::setMaterialParams(const LLMaterialPtr pMaterialParams) void LLTextureEntry::setMediaData(const LLMediaEntry &media_entry) { mMediaFlags |= MF_HAS_MEDIA; - if (NULL != mMediaEntry) + if (nullptr != mMediaEntry) { delete mMediaEntry; } @@ -587,7 +587,7 @@ bool LLTextureEntry::updateMediaData(const LLSD& media_data) } else { mMediaFlags |= MF_HAS_MEDIA; - if (mMediaEntry == NULL) + if (mMediaEntry == nullptr) { mMediaEntry = new LLMediaEntry; } @@ -601,16 +601,16 @@ bool LLTextureEntry::updateMediaData(const LLSD& media_data) void LLTextureEntry::clearMediaData() { mMediaFlags &= ~MF_HAS_MEDIA; - if (mMediaEntry != NULL) { + if (mMediaEntry != nullptr) { delete mMediaEntry; } - mMediaEntry = NULL; + mMediaEntry = nullptr; } void LLTextureEntry::mergeIntoMediaData(const LLSD& media_fields) { mMediaFlags |= MF_HAS_MEDIA; - if (mMediaEntry == NULL) + if (mMediaEntry == nullptr) { mMediaEntry = new LLMediaEntry; } @@ -645,7 +645,7 @@ U32 LLTextureEntry::getVersionFromMediaVersionString(const std::string &version_ { found = version_string.find_first_of('/', found); std::string v = version_string.substr(MEDIA_VERSION_STRING_PREFIX.length(), found); - version = strtoul(v.c_str(),NULL,10); + version = strtoul(v.c_str(), nullptr,10); } } return version; diff --git a/indra/llprimitive/llvolumemessage.cpp b/indra/llprimitive/llvolumemessage.cpp index 2b0a562085fc3ac00567f9d10eb3329b3629e1f5..0a02380799450489f42433a4d4d1ff8a135f69d7 100644 --- a/indra/llprimitive/llvolumemessage.cpp +++ b/indra/llprimitive/llvolumemessage.cpp @@ -499,8 +499,8 @@ bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLMessageSy } else { - packPathParams(0, mesgsys); - packProfileParams(0, mesgsys); + packPathParams(nullptr, mesgsys); + packProfileParams(nullptr, mesgsys); } return true; } @@ -515,8 +515,8 @@ bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLDataPacke } else { - packPathParams(0, dp); - packProfileParams(0, dp); + packPathParams(nullptr, dp); + packProfileParams(nullptr, dp); } return true; } diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index aaa80807534495f877f47e06d507c6ebe31ac456..0036ac006b1ffa47e999b074252ac51b0467d8e1 100644 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp @@ -494,6 +494,6 @@ void LLCubeMap::destroyGL() { for (S32 i = 0; i < 6; i++) { - mImages[i] = NULL; + mImages[i] = nullptr; } } diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp index d4d5bd560ba766e9317a6a6853ab22391da47cb2..d7d8d718009160bd710da60ece534c4996ad142b 100644 --- a/indra/llrender/llfontbitmapcache.cpp +++ b/indra/llrender/llfontbitmapcache.cpp @@ -62,7 +62,7 @@ void LLFontBitmapCache::init(S32 num_components, LLImageRaw *LLFontBitmapCache::getImageRaw(U32 bitmap_num) const { if (bitmap_num >= mImageRawVec.size()) - return NULL; + return nullptr; return mImageRawVec[bitmap_num]; } @@ -70,7 +70,7 @@ LLImageRaw *LLFontBitmapCache::getImageRaw(U32 bitmap_num) const LLImageGL *LLFontBitmapCache::getImageGL(U32 bitmap_num) const { if (bitmap_num >= mImageGLVec.size()) - return NULL; + return nullptr; return mImageGLVec[bitmap_num]; } diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 9131a54fe90c93958a500502761cdda622e26a10..43bde7d14f58204190fbd3f53324e818b691f4ff 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -44,9 +44,9 @@ #include "llfontbitmapcache.h" #include "llgl.h" -LLFontManager *gFontManagerp = NULL; +LLFontManager *gFontManagerp = nullptr; -FT_Library gFTLibrary = NULL; +FT_Library gFTLibrary = nullptr; //static void LLFontManager::initClass() @@ -61,7 +61,7 @@ void LLFontManager::initClass() void LLFontManager::cleanupClass() { delete gFontManagerp; - gFontManagerp = NULL; + gFontManagerp = nullptr; } LLFontManager::LLFontManager() @@ -98,16 +98,16 @@ LLFontGlyphInfo::LLFontGlyphInfo(U32 index) LLFontFreetype::LLFontFreetype() : LLTrace::MemTrackable<LLFontFreetype>("LLFontFreetype"), - mFontBitmapCachep(new LLFontBitmapCache), + mStyle(0), + mPointSize(0), mAscender(0.f), mDescender(0.f), mLineHeight(0.f), + mFTFace(nullptr), mIsFallback(FALSE), - mFTFace(NULL), + mFontBitmapCachep(new LLFontBitmapCache), mRenderGlyphCount(0), - mAddGlyphCount(0), - mStyle(0), - mPointSize(0) + mAddGlyphCount(0) { mCharGlyphInfoMap.reserve(500); } @@ -118,7 +118,7 @@ LLFontFreetype::~LLFontFreetype() // Clean up freetype libs. if (mFTFace) FT_Done_Face(mFTFace); - mFTFace = NULL; + mFTFace = nullptr; // Delete glyph info std::for_each(mCharGlyphInfoMap.begin(), mCharGlyphInfoMap.end(), DeletePairedPointer()); @@ -135,7 +135,7 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v if (mFTFace) { FT_Done_Face(mFTFace); - mFTFace = NULL; + mFTFace = nullptr; } int error; @@ -163,7 +163,7 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v { // Clean up freetype libs. FT_Done_Face(mFTFace); - mFTFace = NULL; + mFTFace = nullptr; return FALSE; } @@ -246,7 +246,7 @@ F32 LLFontFreetype::getDescenderHeight() const F32 LLFontFreetype::getXAdvance(llwchar wch) const { - if (mFTFace == NULL) + if (mFTFace == nullptr) return 0.0; // Return existing info only if it is current @@ -270,7 +270,7 @@ F32 LLFontFreetype::getXAdvance(llwchar wch) const F32 LLFontFreetype::getXAdvance(const LLFontGlyphInfo* glyph) const { - if (mFTFace == NULL) + if (mFTFace == nullptr) return 0.0; return glyph->mXAdvance; @@ -278,7 +278,7 @@ F32 LLFontFreetype::getXAdvance(const LLFontGlyphInfo* glyph) const F32 LLFontFreetype::getXKerning(llwchar char_left, llwchar char_right) const { - if (mFTFace == NULL) + if (mFTFace == nullptr) return 0.0; //llassert(!mIsFallback); @@ -303,7 +303,7 @@ F32 LLFontFreetype::getXKerning(llwchar char_left, llwchar char_right) const F32 LLFontFreetype::getXKerning(const LLFontGlyphInfo* left_glyph_info, const LLFontGlyphInfo* right_glyph_info) const { - if (mFTFace == NULL) + if (mFTFace == nullptr) return 0.0; U32 left_glyph = left_glyph_info ? left_glyph_info->mGlyphIndex : 0; @@ -330,7 +330,7 @@ BOOL LLFontFreetype::hasGlyph(llwchar wch) const LLFontGlyphInfo* LLFontFreetype::addGlyph(llwchar wch) const { - if (mFTFace == NULL) + if (mFTFace == nullptr) return FALSE; llassert(!mIsFallback); @@ -358,13 +358,13 @@ LLFontGlyphInfo* LLFontFreetype::addGlyph(llwchar wch) const { return addGlyphFromFont(this, wch, glyph_index); } - return NULL; + return nullptr; } LLFontGlyphInfo* LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, llwchar wch, U32 glyph_index) const { - if (mFTFace == NULL) - return NULL; + if (mFTFace == nullptr) + return nullptr; llassert(!mIsFallback); fontp->renderGlyph(glyph_index); @@ -398,7 +398,7 @@ LLFontGlyphInfo* LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, l { U8 *buffer_data = fontp->mFTFace->glyph->bitmap.buffer; S32 buffer_row_stride = fontp->mFTFace->glyph->bitmap.pitch; - U8 *tmp_graydata = NULL; + U8 *tmp_graydata = nullptr; if (fontp->mFTFace->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_MONO) @@ -495,7 +495,7 @@ void LLFontFreetype::insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const void LLFontFreetype::renderGlyph(U32 glyph_index) const { - if (mFTFace == NULL) + if (mFTFace == nullptr) return; if (FT_Load_Glyph(mFTFace, glyph_index, FT_LOAD_RENDER) != 0) @@ -579,7 +579,7 @@ U8 LLFontFreetype::getStyle() const std::string LLFontFreetype::getVersionString() { - if (gFTLibrary != NULL) + if (gFTLibrary != nullptr) { int major, minor, patch; FT_Library_Version(gFTLibrary, &major, &minor, &patch); diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 9bec3ac17c2cea7ac090f7b927092a724d166503..3229a9dac0b0ab2ab989e929c18d1e435cda94bb 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -57,7 +57,7 @@ BOOL LLFontGL::sDisplayFont = TRUE ; std::string LLFontGL::sAppDir; LLColor4 LLFontGL::sShadowColor(0.f, 0.f, 0.f, 1.f); -LLFontRegistry* LLFontGL::sFontRegistry = NULL; +LLFontRegistry* LLFontGL::sFontRegistry = nullptr; LLCoordGL LLFontGL::sCurOrigin; F32 LLFontGL::sCurDepth; @@ -157,7 +157,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons if (shadow != NO_SHADOW) { F32 luminance; - color.calcHSL(NULL, NULL, &luminance); + color.calcHSL(nullptr, nullptr, &luminance); drop_shadow_strength = clamp_rescale(luminance, 0.35f, 0.6f, 0.f, 1.f); if (luminance < 0.35f) { @@ -257,7 +257,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons } } - const LLFontGlyphInfo* next_glyph = NULL; + const LLFontGlyphInfo* next_glyph = nullptr; const S32 GLYPH_BATCH_SIZE = 30; static LL_ALIGN_16(LLVector4a vertices[GLYPH_BATCH_SIZE * GLYPH_VERTICES]); @@ -273,7 +273,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons llwchar wch = wstr[i]; const LLFontGlyphInfo* fgi = next_glyph; - next_glyph = NULL; + next_glyph = nullptr; if(!fgi) { fgi = mFontFreetype->getGlyphInfo(wch); @@ -410,7 +410,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons S32 LLFontGL::render(const LLWString &text, S32 begin_offset, F32 x, F32 y, const LLColor4 &color) const { - return render(text, begin_offset, x, y, color, LEFT, BASELINE, NORMAL, NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); + return render(text, begin_offset, x, y, color, LEFT, BASELINE, NORMAL, NO_SHADOW, S32_MAX, S32_MAX, nullptr, FALSE); } S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, ShadowType shadow, S32 max_chars, S32 max_pixels, F32* right_x, BOOL use_ellipses) const @@ -420,12 +420,12 @@ S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, F32 x, F32 y S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y, const LLColor4 &color) const { - return renderUTF8(text, begin_offset, (F32)x, (F32)y, color, LEFT, BASELINE, NORMAL, NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); + return renderUTF8(text, begin_offset, (F32)x, (F32)y, color, LEFT, BASELINE, NORMAL, NO_SHADOW, S32_MAX, S32_MAX, nullptr, FALSE); } S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, ShadowType shadow) const { - return renderUTF8(text, begin_offset, (F32)x, (F32)y, color, halign, valign, style, shadow, S32_MAX, S32_MAX, NULL, FALSE); + return renderUTF8(text, begin_offset, (F32)x, (F32)y, color, halign, valign, style, shadow, S32_MAX, S32_MAX, nullptr, FALSE); } // font metrics - override for LLFontFreetype that returns units of virtual pixels @@ -491,7 +491,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars F32 cur_x = 0; const S32 max_index = begin_offset + max_chars; - const LLFontGlyphInfo* next_glyph = NULL; + const LLFontGlyphInfo* next_glyph = nullptr; F32 width_padding = 0.f; for (S32 i = begin_offset; i < max_index && wchars[i] != 0; i++) @@ -499,7 +499,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars llwchar wch = wchars[i]; const LLFontGlyphInfo* fgi = next_glyph; - next_glyph = NULL; + next_glyph = nullptr; if(!fgi) { fgi = mFontFreetype->getGlyphInfo(wch); @@ -556,7 +556,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch F32 scaled_max_pixels = max_pixels * sScaleX; F32 width_padding = 0.f; - LLFontGlyphInfo* next_glyph = NULL; + LLFontGlyphInfo* next_glyph = nullptr; S32 i; for (i=0; (i < max_chars); i++) @@ -601,12 +601,12 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch } LLFontGlyphInfo* fgi = next_glyph; - next_glyph = NULL; + next_glyph = nullptr; if(!fgi) { fgi = mFontFreetype->getGlyphInfo(wch); - if (NULL == fgi) + if (nullptr == fgi) { return 0; } @@ -736,7 +736,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t F32 scaled_max_pixels = max_pixels * sScaleX; - const LLFontGlyphInfo* next_glyph = NULL; + const LLFontGlyphInfo* next_glyph = nullptr; S32 pos; for (pos = begin_offset; pos < max_index; pos++) @@ -748,7 +748,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t } const LLFontGlyphInfo* glyph = next_glyph; - next_glyph = NULL; + next_glyph = nullptr; if(!glyph) { glyph = mFontFreetype->getGlyphInfo(wch); @@ -827,13 +827,13 @@ void LLFontGL::initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::st bool LLFontGL::loadDefaultFonts() { bool succ = true; - succ &= (NULL != getFontSansSerifSmall()); - succ &= (NULL != getFontSansSerif()); - succ &= (NULL != getFontSansSerifBig()); - succ &= (NULL != getFontSansSerifHuge()); - succ &= (NULL != getFontSansSerifBold()); - succ &= (NULL != getFontMonospace()); - succ &= (NULL != getFontExtChar()); + succ &= (nullptr != getFontSansSerifSmall()); + succ &= (nullptr != getFontSansSerif()); + succ &= (nullptr != getFontSansSerifBig()); + succ &= (nullptr != getFontSansSerifHuge()); + succ &= (nullptr != getFontSansSerifBold()); + succ &= (nullptr != getFontMonospace()); + succ &= (nullptr != getFontExtChar()); return succ; } @@ -842,7 +842,7 @@ void LLFontGL::destroyDefaultFonts() { // Remove the actual fonts. delete sFontRegistry; - sFontRegistry = NULL; + sFontRegistry = nullptr; } //static @@ -1054,7 +1054,7 @@ LLFontGL* LLFontGL::getFontByName(const std::string& name) } else { - return NULL; + return nullptr; } } @@ -1071,7 +1071,7 @@ std::string LLFontGL::getFontPathSystem() std::string system_path; // Try to figure out where the system's font files are stored. - char *system_root = NULL; + char *system_root = nullptr; #if LL_WINDOWS system_root = getenv("SystemRoot"); /* Flawfinder: ignore */ if (!system_root) diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index da8f7820faf1829c432ca9e1cff2b39bee632a13..18af3368237a2ceca7b1e5aee25630695117553d 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -95,7 +95,7 @@ public: HAlign halign = LEFT, VAlign valign = BASELINE, U8 style = NORMAL, ShadowType shadow = NO_SHADOW, S32 max_chars = S32_MAX, - F32* right_x=NULL, + F32* right_x= nullptr, BOOL use_ellipses = FALSE) const; S32 render(const LLWString &text, S32 begin_offset, @@ -104,7 +104,7 @@ public: HAlign halign = LEFT, VAlign valign = BASELINE, U8 style = NORMAL, ShadowType shadow = NO_SHADOW, S32 max_chars = S32_MAX, - F32* right_x=NULL, + F32* right_x= nullptr, BOOL use_ellipses = FALSE) const; S32 render(const LLWString &text, S32 begin_offset, @@ -113,7 +113,7 @@ public: HAlign halign = LEFT, VAlign valign = BASELINE, U8 style = NORMAL, ShadowType shadow = NO_SHADOW, S32 max_chars = S32_MAX, S32 max_pixels = S32_MAX, - F32* right_x=NULL, + F32* right_x= nullptr, BOOL use_ellipses = FALSE) const; S32 render(const LLWString &text, S32 begin_offset, F32 x, F32 y, const LLColor4 &color) const; diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index 4069a4ca5eabb1cc4457da91e31fe1950da58998..567b147952d0698da7b7dbe189c9912a29096ef8 100644 --- a/indra/llrender/llfontregistry.cpp +++ b/indra/llrender/llfontregistry.cpp @@ -52,8 +52,8 @@ LLFontDescriptor::LLFontDescriptor(const std::string& name, const string_vec_t& file_names): mName(name), mSize(size), - mStyle(style), - mFileNames(file_names) + mFileNames(file_names), + mStyle(style) { } @@ -190,7 +190,7 @@ bool LLFontRegistry::parseFontInfo(const std::string& xml_filename) ++path_it) { LLXMLNodePtr root; - bool parsed_file = LLXMLNode::parseFile(*path_it, root, NULL); + bool parsed_file = LLXMLNode::parseFile(*path_it, root, nullptr); if (!parsed_file) continue; @@ -287,10 +287,10 @@ bool init_from_xml(LLFontRegistry* registry, LLXMLNodePtr node) // if this is the first time we've seen this font name, // create a new template map entry for it. const LLFontDescriptor *match_desc = registry->getMatchingFontDesc(desc); - if (match_desc == NULL) + if (match_desc == nullptr) { // Create a new entry (with no corresponding font). - registry->mFontMap[norm_desc] = NULL; + registry->mFontMap[norm_desc] = nullptr; } // otherwise, find the existing entry and combine data. else @@ -306,7 +306,7 @@ bool init_from_xml(LLFontRegistry* registry, LLXMLNodePtr node) LLFontDescriptor new_desc = *match_desc; new_desc.getFileNames() = match_file_names; registry->mFontMap.erase(*match_desc); - registry->mFontMap[new_desc] = NULL; + registry->mFontMap[new_desc] = nullptr; } } } @@ -351,7 +351,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) if (!found_size) { LL_WARNS() << "createFont unrecognized size " << norm_desc.getSize() << LL_ENDL; - return NULL; + return nullptr; } LL_INFOS() << "createFont " << norm_desc.getName() << " size " << norm_desc.getSize() << " style " << ((S32) norm_desc.getStyle()) << LL_ENDL; F32 fallback_scale = 1.0; @@ -364,7 +364,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) { LL_WARNS() << "createFont failed, no template found for " << norm_desc.getName() << " style [" << ((S32)norm_desc.getStyle()) << "]" << LL_ENDL; - return NULL; + return nullptr; } // See whether this best-match font has already been instantiated in the requested size. @@ -374,7 +374,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) // If we fail to find a font in the fonts directory, it->second might be NULL. // We shouldn't construcnt a font with a NULL mFontFreetype. // This may not be the best solution, but it at least prevents a crash. - if (it != mFontMap.end() && it->second != NULL) + if (it != mFontMap.end() && it->second != nullptr) { LL_INFOS() << "-- matching font exists: " << nearest_exact_desc.getName() << " size " << nearest_exact_desc.getSize() << " style " << ((S32) nearest_exact_desc.getStyle()) << LL_ENDL; @@ -409,11 +409,11 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) if (file_names.empty()) { LL_WARNS() << "createFont failed, no file names specified" << LL_ENDL; - return NULL; + return nullptr; } LLFontFreetype::font_vector_t fontlist; - LLFontGL *result = NULL; + LLFontGL *result = nullptr; // Snarf all fonts we can into fontlist. First will get pulled // off the list and become the "head" font, set to non-fallback. @@ -445,7 +445,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) { LL_INFOS_ONCE("LLFontRegistry") << "Couldn't load font " << *file_name_it << LL_ENDL; delete fontp; - fontp = NULL; + fontp = nullptr; } } @@ -460,7 +460,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) { fontlist.push_back(fontp->mFontFreetype); delete fontp; - fontp = NULL; + fontp = nullptr; } } } @@ -545,7 +545,7 @@ const LLFontDescriptor *LLFontRegistry::getMatchingFontDesc(const LLFontDescript if (it != mFontMap.end()) return &(it->first); else - return NULL; + return nullptr; } static U32 bitCount(U8 c) @@ -581,7 +581,7 @@ const LLFontDescriptor *LLFontRegistry::getClosestFontTemplate(const LLFontDescr LLFontDescriptor norm_desc = desc.normalize(); - const LLFontDescriptor *best_match_desc = NULL; + const LLFontDescriptor *best_match_desc = nullptr; for (font_reg_map_t::iterator it = mFontMap.begin(); it != mFontMap.end(); ++it) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 5ff59c4d88cbacdd4901c53240e0b7c79174bfda..33329a7b8a3a40908a173d1bd3347dd948728257 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -486,7 +486,7 @@ bool LLGLManager::initGL() if (mHasDebugOutput && gDebugGL) { //setup debug output callback //glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW_ARB, 0, NULL, GL_TRUE); - glDebugMessageCallbackARB((GLDEBUGPROCARB) gl_debug_callback, NULL); + glDebugMessageCallbackARB((GLDEBUGPROCARB) gl_debug_callback, nullptr); if (mIsNVIDIA) { GLuint annoyingspam[1] = { 131185 }; @@ -1858,7 +1858,7 @@ LLGLUserClipPlane::~LLGLUserClipPlane() } LLGLDepthTest::LLGLDepthTest(GLboolean depth_enabled, GLboolean write_enabled, GLenum depth_func) -: mPrevDepthEnabled(sDepthEnabled), mPrevDepthFunc(sDepthFunc), mPrevWriteEnabled(sWriteEnabled) +: mPrevDepthFunc(sDepthFunc), mPrevDepthEnabled(sDepthEnabled), mPrevWriteEnabled(sWriteEnabled) { stop_glerror(); @@ -1967,7 +1967,7 @@ LLGLSquashToFarClip::~LLGLSquashToFarClip() LLGLSyncFence::LLGLSyncFence() { #ifdef GL_ARB_sync - mSync = 0; + mSync = nullptr; #endif } diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index af17cde1f646890409545bc8f3f19fd88612cb07..ace3d7c1db37193e77d8c7e864df1c58a44c09a7 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -405,9 +405,9 @@ public: LLGLSyncFence(); virtual ~LLGLSyncFence(); - void placeFence(); - bool isCompleted(); - void wait(); + void placeFence() override; + bool isCompleted() override; + void wait() override; }; extern LLMatrix4 gGLObliqueProjectionInverse; diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 1cf9e1c4269b8a51aacfe08ca588196189343bb4..9aaf61aa93fa0c1b001340ae98a42861974c73b7 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -46,7 +46,7 @@ #endif GLuint LLGLSLShader::sCurBoundShader = 0; -LLGLSLShader* LLGLSLShader::sCurBoundShaderPtr = NULL; +LLGLSLShader* LLGLSLShader::sCurBoundShaderPtr = nullptr; S32 LLGLSLShader::sIndexedTextureChannels = 0; bool LLGLSLShader::sNoFixedFunction = false; bool LLGLSLShader::sProfileEnabled = false; @@ -301,19 +301,19 @@ void LLGLSLShader::readProfileQuery(U32 count, U32 mode) LLGLSLShader::LLGLSLShader() - : mProgramObject(0), + : mLightHash(0), + mProgramObject(0), mAttributeMask(0), - mTotalUniformSize(0), + mTotalUniformSize(0), mActiveTextureChannels(0), mShaderLevel(0), - mShaderGroup(SG_DEFAULT), + mShaderGroup(SG_DEFAULT), mUniformsDirty(FALSE), mTimerQuery(0), - mLightHash(0), + mSamplesQuery(0), mTimeElapsed(0), mTrianglesDrawn(0), mSamplesDrawn(0), - mSamplesQuery(0), mDrawCalls(0), mTextureStateFetched(false) @@ -566,7 +566,7 @@ BOOL LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString> * attri BOOL res = link(); mAttribute.clear(); - U32 numAttributes = (attributes == NULL) ? 0 : attributes->size(); + U32 numAttributes = (attributes == nullptr) ? 0 : attributes->size(); mAttribute.resize(shader_mgr->mReservedAttribs.size() + numAttributes, -1); if (res) @@ -586,7 +586,7 @@ BOOL LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString> * attri LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL; } } - if (attributes != NULL) + if (attributes != nullptr) { for (U32 i = 0; i < numAttributes; i++) { @@ -697,7 +697,7 @@ void LLGLSLShader::mapUniform(GLint index, const std::vector<LLStaticHashedStrin } } - if (uniforms != NULL) + if (uniforms != nullptr) { for (U32 i = 0; i < uniforms->size(); i++) { @@ -747,7 +747,7 @@ BOOL LLGLSLShader::mapUniforms(const std::vector<LLStaticHashedString> * uniform mTexture.clear(); mValue.clear(); //initialize arrays - U32 numUniforms = (uniforms == NULL) ? 0 : uniforms->size(); + U32 numUniforms = (uniforms == nullptr) ? 0 : uniforms->size(); mUniform.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1); mTexture.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1); @@ -915,7 +915,7 @@ void LLGLSLShader::unbind() LLVertexBuffer::unbind(); glUseProgram(0); sCurBoundShader = 0; - sCurBoundShaderPtr = NULL; + sCurBoundShaderPtr = nullptr; stop_glerror(); } } @@ -927,7 +927,7 @@ void LLGLSLShader::bindNoShader(void) { glUseProgram(0); sCurBoundShader = 0; - sCurBoundShaderPtr = NULL; + sCurBoundShaderPtr = nullptr; } } diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index c26f9fd7be1b5342557f0799efaad8f2ec50cc06..7a8f7fae1aebd3c157e89ca8bdadd75b99b034a6 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -95,10 +95,10 @@ public: BOOL createShader(std::vector<LLStaticHashedString> * attributes, std::vector<LLStaticHashedString> * uniforms, U32 varying_count = 0, - const char** varyings = NULL); + const char** varyings = nullptr); BOOL attachShader(const std::string& shader); void attachShader(GLuint shader); - void attachShaders(GLuint* shader = NULL, S32 count = 0); + void attachShaders(GLuint* shader = nullptr, S32 count = 0); BOOL mapAttributes(const std::vector<LLStaticHashedString> * attributes); BOOL mapUniforms(const std::vector<LLStaticHashedString> *); void mapUniform(GLint index, const std::vector<LLStaticHashedString> *); diff --git a/indra/llrender/llgltexture.h b/indra/llrender/llgltexture.h index 366234ab4a71d48b62ca865e9c0df74681b3d7b3..7d3ccfd345faa20df7560d42f43d86e6c78ae1cb 100644 --- a/indra/llrender/llgltexture.h +++ b/indra/llrender/llgltexture.h @@ -115,8 +115,8 @@ public: //--------------------------------------------------------------------------------------------- //functions to access LLImageGL //--------------------------------------------------------------------------------------------- - /*virtual*/S32 getWidth(S32 discard_level = -1) const; - /*virtual*/S32 getHeight(S32 discard_level = -1) const; + /*virtual*/S32 getWidth(S32 discard_level = -1) const override; + /*virtual*/S32 getHeight(S32 discard_level = -1) const override; BOOL hasGLTexture() const ; LLGLuint getTexName() const ; @@ -154,7 +154,7 @@ public: //--------------------------------------------------------------------------------------------- //----------------- - /*virtual*/ void setActive() ; + /*virtual*/ void setActive() override; void forceActive() ; void setNoDelete() ; void dontDiscard() { mDontDiscard = 1; mTextureState = NO_DELETE; } @@ -175,7 +175,7 @@ protected: void setTexelsPerImage(); //note: do not make this function public. - /*virtual*/ LLImageGL* getGLTexture() const ; + /*virtual*/ LLImageGL* getGLTexture() const override; protected: S32 mBoostLevel; // enum describing priority level diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 8d8ba39ad014ee4ace1bbf3a1acfbf37a8f7a485..d4f54de4760f5199d1b8ef31442edb9c6901d3a3 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -67,7 +67,7 @@ S32 LLImageGL::sCount = 0; BOOL LLImageGL::sGlobalUseAnisotropic = FALSE; F32 LLImageGL::sLastFrameTime = 0.f; BOOL LLImageGL::sAllowReadBackRaw = FALSE ; -LLImageGL* LLImageGL::sDefaultGLTexture = NULL ; +LLImageGL* LLImageGL::sDefaultGLTexture = nullptr ; bool LLImageGL::sCompressTextures = false; std::set<LLImageGL*> LLImageGL::sImageList; @@ -293,7 +293,7 @@ void LLImageGL::destroyGL(BOOL save_state) if(!glimage->readBackRaw(glimage->mCurrentDiscardLevel, glimage->mSaveData, false)) //necessary, keep it. { glimage->disclaimMem(glimage->mSaveData); - glimage->mSaveData = NULL ; + glimage->mSaveData = nullptr ; } } @@ -322,7 +322,7 @@ void LLImageGL::restoreGL() glimage->createGLTexture(glimage->mCurrentDiscardLevel, glimage->mSaveData, 0, TRUE, glimage->getCategory()); stop_glerror(); } - glimage->mSaveData = NULL; // deletes data + glimage->mSaveData = nullptr; // deletes data } } } @@ -367,7 +367,7 @@ BOOL LLImageGL::create(LLPointer<LLImageGL>& dest, const LLImageRaw* imageraw, B LLImageGL::LLImageGL(BOOL usemipmaps) : LLTrace::MemTrackable<LLImageGL>("LLImageGL"), - mSaveData(0) + mSaveData(nullptr) { init(usemipmaps); setSize(0, 0, 0); @@ -377,7 +377,7 @@ LLImageGL::LLImageGL(BOOL usemipmaps) LLImageGL::LLImageGL(U32 width, U32 height, U8 components, BOOL usemipmaps) : LLTrace::MemTrackable<LLImageGL>("LLImageGL"), - mSaveData(0) + mSaveData(nullptr) { llassert( components <= 4 ); init(usemipmaps); @@ -388,7 +388,7 @@ LLImageGL::LLImageGL(U32 width, U32 height, U8 components, BOOL usemipmaps) LLImageGL::LLImageGL(const LLImageRaw* imageraw, BOOL usemipmaps) : LLTrace::MemTrackable<LLImageGL>("LLImageGL"), - mSaveData(0) + mSaveData(nullptr) { init(usemipmaps); setSize(0, 0, 0); @@ -417,7 +417,7 @@ void LLImageGL::init(BOOL usemipmaps) mTextureMemory = (S32Bytes)0; mLastBindTime = 0.f; - mPickMask = NULL; + mPickMask = nullptr; mPickMaskWidth = 0; mPickMaskHeight = 0; mUseMipMaps = usemipmaps; @@ -474,7 +474,7 @@ void LLImageGL::cleanup() } freePickMask(); - mSaveData = NULL; // deletes data + mSaveData = nullptr; // deletes data } //---------------------------------------------------------------------------- @@ -774,11 +774,11 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) S32 w = width, h = height; - const U8* new_data = 0; + const U8* new_data = nullptr; (void)new_data; - const U8* prev_mip_data = 0; - const U8* cur_mip_data = 0; + const U8* prev_mip_data = nullptr; + const U8* cur_mip_data = nullptr; #ifdef SHOW_ASSERT S32 cur_mip_size = 0; #endif @@ -853,7 +853,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) if (prev_mip_data && prev_mip_data != data_in) { delete[] prev_mip_data; - prev_mip_data = NULL; + prev_mip_data = nullptr; } } } @@ -913,7 +913,7 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3 //LL_WARNS() << "Setting subimage on image without GL texture" << LL_ENDL; return FALSE; } - if (datap == NULL) + if (datap == nullptr) { // *TODO: Re-enable warning? Ran into thread locking issues? DK 2011-02-18 //LL_WARNS() << "Setting subimage on image with NULL datap" << LL_ENDL; @@ -1911,12 +1911,12 @@ U32 LLImageGL::createPickMask(S32 pWidth, S32 pHeight) void LLImageGL::freePickMask() { // pickmask validity depends on old image size, delete it - if (mPickMask != NULL) + if (mPickMask != nullptr) { disclaimMem((mPickMaskWidth * mPickMaskHeight + 7) / 8); delete [] mPickMask; } - mPickMask = NULL; + mPickMask = nullptr; mPickMaskWidth = mPickMaskHeight = 0; } diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index f426773a0f7be5efadce4f01fdd78c9c5bae6f11..ed291463234634711a8fe4a197c64e4f99d4a852 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -106,13 +106,13 @@ static const GLenum sGLBlendFactor[] = }; LLTexUnit::LLTexUnit(S32 index) - : mCurrTexType(TT_NONE), mCurrBlendType(TB_MULT), - mCurrColorOp(TBO_MULT), mCurrAlphaOp(TBO_MULT), - mCurrColorSrc1(TBS_TEX_COLOR), mCurrColorSrc2(TBS_PREV_COLOR), - mCurrAlphaSrc1(TBS_TEX_ALPHA), mCurrAlphaSrc2(TBS_PREV_ALPHA), - mCurrColorScale(1), mCurrAlphaScale(1), mCurrTexture(0), - mHasMipMaps(false), - mIndex(index) + : mIndex(index), mCurrTexture(0), + mCurrTexType(TT_NONE), mCurrBlendType(TB_MULT), + mCurrColorOp(TBO_MULT), mCurrColorSrc1(TBS_TEX_COLOR), + mCurrColorSrc2(TBS_PREV_COLOR), mCurrAlphaOp(TBO_MULT), + mCurrAlphaSrc1(TBS_TEX_ALPHA), mCurrAlphaSrc2(TBS_PREV_ALPHA), mCurrColorScale(1), + mCurrAlphaScale(1), + mHasMipMaps(false) { llassert_always(index < (S32)LL_NUM_TEXTURE_LAYERS); } @@ -234,9 +234,9 @@ bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind) { gGL.flush(); - LLImageGL* gl_tex = NULL ; + LLImageGL* gl_tex = nullptr ; - if (texture != NULL && (gl_tex = texture->getGLTexture())) + if (texture != nullptr && (gl_tex = texture->getGLTexture())) { if (gl_tex->getTexName()) //if texture exists { @@ -346,7 +346,7 @@ bool LLTexUnit::bind(LLCubeMap* cubeMap) gGL.flush(); - if (cubeMap == NULL) + if (cubeMap == nullptr) { LL_WARNS() << "NULL LLTexUnit::bind cubemap" << LL_ENDL; return false; @@ -1031,8 +1031,8 @@ LLRender::LLRender() mCount(0), mMode(LLRender::TRIANGLES), mCurrTextureUnitIndex(0), - mMaxAnisotropy(0.f), - mLineWidth(1.f), + mLineWidth(1.f), + mMaxAnisotropy(0.f), mPrimitiveReset(false) { mTexUnits.reserve(LL_NUM_TEXTURE_LAYERS); @@ -1097,14 +1097,14 @@ void LLRender::shutdown() } mTexUnits.clear(); delete mDummyTexUnit; - mDummyTexUnit = NULL; + mDummyTexUnit = nullptr; for (U32 i = 0; i < mLightState.size(); ++i) { delete mLightState[i]; } mLightState.clear(); - mBuffer = NULL ; + mBuffer = nullptr ; } void LLRender::refreshState(void) @@ -1129,7 +1129,7 @@ void LLRender::refreshState(void) void LLRender::resetVertexBuffers() { - mBuffer = NULL; + mBuffer = nullptr; } void LLRender::restoreVertexBuffers() @@ -1774,7 +1774,7 @@ LLLightState* LLRender::getLight(U32 index) return mLightState[index]; } - return NULL; + return nullptr; } void LLRender::setAmbientLightColor(const LLColor4& color) diff --git a/indra/llrender/llrender2dutils.h b/indra/llrender/llrender2dutils.h index cce3b4ed511154d3887ce44259836c1a42135289..1e86d5a97c737a6515233bbca4e628f4bc5ab409 100644 --- a/indra/llrender/llrender2dutils.h +++ b/indra/llrender/llrender2dutils.h @@ -74,7 +74,7 @@ void gl_draw_image(S32 x, S32 y, LLTexture* image, const LLColor4& color = UI_VE void gl_draw_scaled_target(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* target, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); -void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), LLRenderTarget* target = NULL); +void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), LLRenderTarget* target = nullptr); void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), bool scale_inner = true); void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f), bool scale_inner = true); diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index fc78b3800814438481800b95f7df03628e726615..8747c5013420c79ee1d3d66d68eb41635b9cb458 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -32,7 +32,7 @@ #include "llrender.h" #include "llgl.h" -LLRenderTarget* LLRenderTarget::sBoundTarget = NULL; +LLRenderTarget* LLRenderTarget::sBoundTarget = nullptr; U32 LLRenderTarget::sBytesAllocated = 0; void check_framebuffer_status() @@ -53,13 +53,13 @@ void check_framebuffer_status() } bool LLRenderTarget::sUseFBO = false; -LLRenderTarget* LLRenderTarget::sCurFBO = 0; +LLRenderTarget* LLRenderTarget::sCurFBO = nullptr; LLRenderTarget::LLRenderTarget() : mResX(0), mResY(0), mFBO(0), - mPreviousFBO(0), + mPreviousFBO(nullptr), mDepth(0), mStencil(0), mUseDepth(false), @@ -86,7 +86,7 @@ void LLRenderTarget::resize(U32 resx, U32 resy) for (U32 i = 0; i < mTex.size(); ++i) { //resize color attachments gGL.getTexUnit(0)->bindManual(mUsage, mTex[i]); - LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, mInternalFormat[i], mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false); + LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, mInternalFormat[i], mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, nullptr, false); sBytesAllocated += pix_diff*4; } @@ -103,7 +103,7 @@ void LLRenderTarget::resize(U32 resx, U32 resy) { gGL.getTexUnit(0)->bindManual(mUsage, mDepth); U32 internal_type = LLTexUnit::getInternalType(mUsage); - LLImageGL::setManualImage(internal_type, 0, GL_DEPTH_COMPONENT24, mResX, mResY, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL, false); + LLImageGL::setManualImage(internal_type, 0, GL_DEPTH_COMPONENT24, mResX, mResY, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, nullptr, false); } sBytesAllocated += pix_diff*4; @@ -196,7 +196,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt) { clear_glerror(); - LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, color_fmt, mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false); + LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, color_fmt, mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, nullptr, false); if (glGetError() != GL_NO_ERROR) { LL_WARNS() << "Could not allocate color buffer for render target." << LL_ENDL; @@ -271,7 +271,7 @@ bool LLRenderTarget::allocateDepth() U32 internal_type = LLTexUnit::getInternalType(mUsage); stop_glerror(); clear_glerror(); - LLImageGL::setManualImage(internal_type, 0, GL_DEPTH_COMPONENT24, mResX, mResY, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL, false); + LLImageGL::setManualImage(internal_type, 0, GL_DEPTH_COMPONENT24, mResX, mResY, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, nullptr, false); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); } @@ -404,7 +404,7 @@ void LLRenderTarget::release() mResX = mResY = 0; - sBoundTarget = NULL; + sBoundTarget = nullptr; } void LLRenderTarget::bindTarget() @@ -520,7 +520,7 @@ void LLRenderTarget::flush(bool fetch_depth) if (mPreviousFBO) { glViewport(0, 0, mPreviousFBO->mResX, mPreviousFBO->mResY); - mPreviousFBO = NULL; + mPreviousFBO = nullptr; } else { diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 4e9e81950e1fdc65919938e0630c8db48d630e38..d0c302de4f6ff938d8872196cdc89a0a95648bb2 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -43,7 +43,7 @@ #define UNIFORM_ERRS LL_ERRS("Shader") #endif -LLShaderMgr * LLShaderMgr::sInstance = NULL; +LLShaderMgr * LLShaderMgr::sInstance = nullptr; LLShaderMgr::LLShaderMgr() { @@ -57,7 +57,7 @@ LLShaderMgr::~LLShaderMgr() // static LLShaderMgr * LLShaderMgr::instance() { - if(NULL == sInstance) + if(nullptr == sInstance) { LL_ERRS("Shaders") << "LLShaderMgr should already have been instantiated by the application!" << LL_ENDL; } @@ -600,7 +600,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev //read in from file - LLFILE* file = NULL; + LLFILE* file = nullptr; S32 try_gpu_class = shader_level; S32 gpu_class; @@ -621,7 +621,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev } } - if (file == NULL) + if (file == nullptr) { LL_WARNS("ShaderLoading") << "GLSL Shader file not found: " << filename << LL_ENDL; return 0; @@ -944,7 +944,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev } //copy file into memory - while( fgets((char *)buff, 1024, file) != NULL && count < LL_ARRAY_SIZE(text) ) + while( fgets((char *)buff, 1024, file) != nullptr && count < LL_ARRAY_SIZE(text) ) { text[count++] = (GLchar*)strdup((char *)buff); } @@ -966,7 +966,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev //load source if(ret) { - glShaderSource(ret, count, (const GLchar**) text, NULL); + glShaderSource(ret, count, (const GLchar**) text, nullptr); if (gDebugGL) { diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index 6ef114dc66423f0265e3d762d4eff6259b299def..59484c7f7e54ecfa9b466f3233d8eb5cebe4a8c2 100644 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -233,7 +233,7 @@ public: void dumpShaderLog(GLuint ret, BOOL warns = TRUE, const std::string& filename = ""); BOOL linkProgram(GLuint program, BOOL suppress_errors = FALSE); BOOL validateProgramObject(GLuint program); - GLuint loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, boost::unordered_map<std::string, std::string>* defines = NULL, S32 texture_index_channels = -1); + GLuint loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, boost::unordered_map<std::string, std::string>* defines = nullptr, S32 texture_index_channels = -1); void cleanupShaderSources(); // Implemented in the application to actually point to the shader directory. diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp index 62735702909d0b29d0eda83a186cecdd380d6c3e..751b7b0d4a680813a2ddd73a508a09e6afe2a8f9 100644 --- a/indra/llrender/lluiimage.cpp +++ b/indra/llrender/lluiimage.cpp @@ -36,11 +36,11 @@ #include "llrender2dutils.h" LLUIImage::LLUIImage(const std::string& name, LLPointer<LLTexture> image) -: mName(name), - mImage(image), +: mImageLoaded(nullptr), + mName(name), mScaleRegion(0.f, 1.f, 1.f, 0.f), mClipRegion(0.f, 1.f, 1.f, 0.f), - mImageLoaded(NULL), + mImage(image), mScaleStyle(SCALE_INNER) {} @@ -197,7 +197,7 @@ namespace LLInitParam // do not default to current value. Used to overwrite template images. if (name() == "none") { - updateValue(NULL); + updateValue(nullptr); return; } @@ -210,7 +210,7 @@ namespace LLInitParam void ParamValue<LLUIImage*>::updateBlockFromValue(bool make_block_authoritative) { - if (getValue() == NULL) + if (getValue() == nullptr) { name.set("none", make_block_authoritative); } diff --git a/indra/llrender/lluiimage.h b/indra/llrender/lluiimage.h index d8a91ccb1578468850f2c85801a69997f9962b4e..8bdf3a560554cb3d1c96c76564c83caa58b5f421 100644 --- a/indra/llrender/lluiimage.h +++ b/indra/llrender/lluiimage.h @@ -107,7 +107,7 @@ namespace LLInitParam public: Optional<std::string> name; - ParamValue(LLUIImage* const& image = NULL) + ParamValue(LLUIImage* const& image = nullptr) : super_t(image) { updateBlockFromValue(false); diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index d699023c4ffceec76e9b43bd01e9f4655c62bf47..feafd48b7ad38e90a6b23acb1b5934d82f298de3 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -137,7 +137,7 @@ void LLVBOPool::deleteBuffer(U32 name) LLVertexBuffer::unbind(); glBindBufferARB(mType, name); - glBufferDataARB(mType, 0, NULL, mUsage); + glBufferDataARB(mType, 0, nullptr, mUsage); glBindBufferARB(mType, 0); glDeleteBuffersARB(1, &name); @@ -156,7 +156,7 @@ volatile U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) { llassert(vbo_block_size(size) == size); - volatile U8* ret = NULL; + volatile U8* ret = nullptr; U32 i = vbo_block_index(size); @@ -189,12 +189,12 @@ volatile U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) if (LLVertexBuffer::sDisableVBOMapping || mUsage != GL_DYNAMIC_DRAW_ARB) { - glBufferDataARB(mType, size, 0, mUsage); + glBufferDataARB(mType, size, nullptr, mUsage); ret = (U8*) ll_aligned_malloc<64>(size); } else { //always use a true hint of static draw when allocating non-client-backed buffers - glBufferDataARB(mType, size, 0, GL_STATIC_DRAW_ARB); + glBufferDataARB(mType, size, nullptr, GL_STATIC_DRAW_ARB); } glBindBufferARB(mType, 0); @@ -958,8 +958,8 @@ S32 LLVertexBuffer::determineUsage(S32 usage) } LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) -: LLTrace::MemTrackable<LLVertexBuffer>("LLVertexBuffer"), - LLRefCount(), +: LLRefCount(), + LLTrace::MemTrackable<LLVertexBuffer>("LLVertexBuffer"), mNumVerts(0), mNumIndices(0), @@ -972,8 +972,8 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) mGLBuffer(0), mGLIndices(0), mGLArray(0), - mMappedData(NULL), - mMappedIndexData(NULL), + mMappedData(nullptr), + mMappedIndexData(nullptr), mMappedDataUsingVBOs(false), mMappedIndexDataUsingVBOs(false), mVertexLocked(false), @@ -981,7 +981,7 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) mFinal(false), mEmpty(true), mMappable(false), - mFence(NULL) + mFence(nullptr) { mMappable = (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping); @@ -1059,7 +1059,7 @@ LLVertexBuffer::~LLVertexBuffer() delete mFence; } - mFence = NULL; + mFence = nullptr; sVertexCount -= mNumVerts; sIndexCount -= mNumIndices; @@ -1139,7 +1139,7 @@ void LLVertexBuffer::releaseBuffer() } mGLBuffer = 0; - mMappedData = NULL; + mMappedData = nullptr; sGLCount--; } @@ -1156,7 +1156,7 @@ void LLVertexBuffer::releaseIndices() } mGLIndices = 0; - mMappedIndexData = NULL; + mMappedIndexData = nullptr; sGLCount--; } @@ -1237,7 +1237,7 @@ void LLVertexBuffer::destroyGLBuffer() else { ll_aligned_free_16((void*) mMappedData); - mMappedData = NULL; + mMappedData = nullptr; mEmpty = true; } } @@ -1257,7 +1257,7 @@ void LLVertexBuffer::destroyGLIndices() else { ll_aligned_free_16((void*) mMappedIndexData); - mMappedIndexData = NULL; + mMappedIndexData = nullptr; mEmpty = true; } } @@ -1561,7 +1561,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo } else { - volatile U8* src = NULL; + volatile U8* src = nullptr; waitFence(); if (gGLManager.mHasMapBufferRange) { @@ -1750,7 +1750,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range } else { - volatile U8* src = NULL; + volatile U8* src = nullptr; waitFence(); if (gGLManager.mHasMapBufferRange) { @@ -1885,7 +1885,7 @@ void LLVertexBuffer::unmapBuffer() else { stop_glerror(); - glBufferDataARB(GL_ARRAY_BUFFER_ARB, getSize(), NULL, mUsage); // <alchemy/> + glBufferDataARB(GL_ARRAY_BUFFER_ARB, getSize(), nullptr, mUsage); // <alchemy/> glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, getSize(), (U8*) mMappedData); stop_glerror(); } @@ -1925,7 +1925,7 @@ void LLVertexBuffer::unmapBuffer() glUnmapBufferARB(GL_ARRAY_BUFFER_ARB); stop_glerror(); - mMappedData = NULL; + mMappedData = nullptr; } mVertexLocked = false; @@ -1954,7 +1954,7 @@ void LLVertexBuffer::unmapBuffer() else { stop_glerror(); - glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, getIndicesSize(), NULL, mUsage); // <alchemy/> + glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, getIndicesSize(), nullptr, mUsage); // <alchemy/> glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, getIndicesSize(), (U8*) mMappedIndexData); stop_glerror(); } @@ -1995,7 +1995,7 @@ void LLVertexBuffer::unmapBuffer() glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB); stop_glerror(); - mMappedIndexData = NULL; + mMappedIndexData = nullptr; } mIndexLocked = false; @@ -2024,7 +2024,7 @@ struct VertexBufferStrider volatile U8* ptr = vbo.mapVertexBuffer(type, index, count, map_range); - if (ptr == NULL) + if (ptr == nullptr) { LL_WARNS() << "mapVertexBuffer failed!" << LL_ENDL; return false; @@ -2052,7 +2052,7 @@ struct VertexBufferStrider<T, LLVertexBuffer::TYPE_INDEX> { volatile U8* ptr = vbo.mapIndexBuffer(index, count, map_range); - if (ptr == NULL) + if (ptr == nullptr) { LL_WARNS() << "mapIndexBuffer failed!" << LL_ENDL; return false; diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index d9178c186602807a9927f1b87a134b0028a6625b..22833d2748c47bae9d64e6ca377f348d8a83979c 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -51,10 +51,10 @@ LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) , mFitParent(params.fit_parent) , mAutoScrolling( false ) , mAutoScrollRate( 0.f ) - , mSelectedTab( NULL ) - , mTabComparator( NULL ) - , mNoVisibleTabsHelpText(NULL) + , mNoVisibleTabsHelpText(nullptr) , mNoVisibleTabsOrigString(params.no_visible_tabs_text.initial_value().asString()) + , mSelectedTab(nullptr ) + , mTabComparator(nullptr ) { initNoTabsWidget(params.no_matched_tabs_text); @@ -68,8 +68,8 @@ LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) LLAccordionCtrl::LLAccordionCtrl() : LLPanel() , mAutoScrolling( false ) , mAutoScrollRate( 0.f ) - , mSelectedTab( NULL ) - , mNoVisibleTabsHelpText(NULL) + , mNoVisibleTabsHelpText(nullptr) + , mSelectedTab(nullptr ) { initNoTabsWidget(LLTextBox::Params()); @@ -136,7 +136,7 @@ BOOL LLAccordionCtrl::postBuild() getChildList()->end() != it; ++it) { LLAccordionCtrlTab* accordion_tab = dynamic_cast<LLAccordionCtrlTab*>(*it); - if(accordion_tab == NULL) + if(accordion_tab == nullptr) continue; if(std::find(mAccordionTabs.begin(),mAccordionTabs.end(),accordion_tab) == mAccordionTabs.end()) { @@ -363,7 +363,7 @@ void LLAccordionCtrl::removeCollapsibleCtrl(LLView* view) // if removed is selected - reset selection if (mSelectedTab == view) { - mSelectedTab = NULL; + mSelectedTab = nullptr; } } @@ -583,7 +583,7 @@ BOOL LLAccordionCtrl::handleDragAndDrop (S32 x, S32 y, MASK mask, if( !handled ) { handled = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, - cargo_data, accept, tooltip_msg) != NULL; + cargo_data, accept, tooltip_msg) != nullptr; } return TRUE; } @@ -660,7 +660,7 @@ void LLAccordionCtrl::onOpen (const LLSD& key) { LLAccordionCtrlTab* accordion_tab = dynamic_cast<LLAccordionCtrlTab*>(mAccordionTabs[i]); LLPanel* panel = dynamic_cast<LLPanel*>(accordion_tab->getAccordionView()); - if(panel!=NULL) + if(panel!= nullptr) { panel->onOpen(key); } @@ -756,7 +756,7 @@ S32 LLAccordionCtrl::notifyParent(const LLSD& info) if (mSelectedTab) { mSelectedTab->setSelected(false); - mSelectedTab = NULL; + mSelectedTab = nullptr; return 1; } return 0; @@ -858,7 +858,7 @@ const LLAccordionCtrlTab* LLAccordionCtrl::getExpandedTab() const { typedef std::vector<LLAccordionCtrlTab*>::const_iterator tabs_const_iterator; - const LLAccordionCtrlTab* result = 0; + const LLAccordionCtrlTab* result = nullptr; for (tabs_const_iterator i = mAccordionTabs.begin(); i != mAccordionTabs.end(); ++i) { diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index c59c54955bf70bfb68ad9aaa3b021c3262a1911f..245582e7a3e5d14e7f8f61ce0742cf17048bfa1f 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -84,32 +84,32 @@ public: LLAccordionCtrl(); virtual ~LLAccordionCtrl(); - virtual BOOL postBuild(); - - virtual BOOL handleRightMouseDown ( S32 x, S32 y, MASK mask); - virtual BOOL handleScrollWheel ( S32 x, S32 y, S32 clicks ); - virtual BOOL handleKeyHere (KEY key, MASK mask); - virtual BOOL handleDragAndDrop (S32 x, S32 y, MASK mask, BOOL drop, + BOOL postBuild() override; + + BOOL handleRightMouseDown ( S32 x, S32 y, MASK mask) override; + BOOL handleScrollWheel ( S32 x, S32 y, S32 clicks ) override; + BOOL handleKeyHere (KEY key, MASK mask) override; + BOOL handleDragAndDrop (S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; // // Call reshape after changing splitter's size - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; void addCollapsibleCtrl(LLView* view, bool arrange_now = true); void removeCollapsibleCtrl(LLView* view); void arrange(); - void draw(); + void draw() override; void onScrollPosChangeCallback(S32, LLScrollbar*); - void onOpen (const LLSD& key); - S32 notifyParent(const LLSD& info); + void onOpen (const LLSD& key) override; + S32 notifyParent(const LLSD& info) override; void reset (); void expandDefaultTab(); diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 0d3d5eeca0d102e1167690338db7a28aa75d8bef..fa16880b9e0f3a4382527aa3df96de4dd671987b 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -64,11 +64,11 @@ public: virtual ~LLAccordionCtrlTabHeader(); - virtual void draw(); + void draw() override; - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; - virtual BOOL postBuild(); + BOOL postBuild() override; std::string getTitle(); void setTitle(const std::string& title, const std::string& hl); @@ -79,14 +79,14 @@ public: void setSelected(bool is_selected) { mIsSelected = is_selected; } - virtual void onMouseEnter(S32 x, S32 y, MASK mask); - virtual void onMouseLeave(S32 x, S32 y, MASK mask); - virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + void onMouseEnter(S32 x, S32 y, MASK mask) override; + void onMouseLeave(S32 x, S32 y, MASK mask) override; + BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent) override; + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; private: LLTextBox* mHeaderTextbox; @@ -121,17 +121,17 @@ LLAccordionCtrlTab::LLAccordionCtrlTabHeader::Params::Params() LLAccordionCtrlTab::LLAccordionCtrlTabHeader::LLAccordionCtrlTabHeader( const LLAccordionCtrlTabHeader::Params& p) : LLUICtrl(p) -, mHeaderBGColor(p.header_bg_color()) -, mNeedsHighlight(false) -, mIsSelected(false), - mImageCollapsed(p.header_collapse_img), - mImageCollapsedPressed(p.header_collapse_img_pressed), - mImageExpanded(p.header_expand_img), +, mImageCollapsed(p.header_collapse_img) +, mImageExpanded(p.header_expand_img) +, mImageCollapsedPressed(p.header_collapse_img_pressed), mImageExpandedPressed(p.header_expand_img_pressed), mImageHeader(p.header_image), mImageHeaderOver(p.header_image_over), mImageHeaderPressed(p.header_image_pressed), - mImageHeaderFocused(p.header_image_focused) + mImageHeaderFocused(p.header_image_focused), + mHeaderBGColor(p.header_bg_color()), + mNeedsHighlight(false), + mIsSelected(false) { LLTextBox::Params textboxParams; textboxParams.name(DD_TEXTBOX_NAME); @@ -316,19 +316,12 @@ BOOL LLAccordionCtrlTab::LLAccordionCtrlTabHeader::handleDragAndDrop(S32 x, S32 cargo_data, accept, tooltip_msg); } LLAccordionCtrlTab::Params::Params() - : title("title") - ,display_children("expanded", true) - ,header_height("header_height", HEADER_HEIGHT), - min_width("min_width", 0), - min_height("min_height", 0) + : display_children("expanded", true) ,collapsible("collapsible", true) - ,header_bg_color("header_bg_color") - ,dropdown_bg_color("dropdown_bg_color") - ,header_visible("header_visible",true) - ,padding_left("padding_left",2) - ,padding_right("padding_right",2) - ,padding_top("padding_top",2) - ,padding_bottom("padding_bottom",2) + ,title("title"), + header_height("header_height", HEADER_HEIGHT), + min_width("min_width", 0) + ,min_height("min_height", 0) ,header_expand_img("header_expand_img") ,header_expand_img_pressed("header_expand_img_pressed") ,header_collapse_img("header_collapse_img") @@ -337,29 +330,36 @@ LLAccordionCtrlTab::Params::Params() ,header_image_over("header_image_over") ,header_image_pressed("header_image_pressed") ,header_image_focused("header_image_focused") + ,header_bg_color("header_bg_color") ,header_text_color("header_text_color") + ,dropdown_bg_color("dropdown_bg_color") + ,header_visible("header_visible",true) ,fit_panel("fit_panel",true) ,selection_enabled("selection_enabled", false) + ,padding_left("padding_left",2) + ,padding_right("padding_right",2) + ,padding_top("padding_top",2) + ,padding_bottom("padding_bottom",2) { changeDefault(mouse_opaque, false); } LLAccordionCtrlTab::LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&p) : LLUICtrl(p) + ,mExpandedHeight(0) ,mDisplayChildren(p.display_children) ,mCollapsible(p.collapsible) - ,mExpandedHeight(0) - ,mDropdownBGColor(p.dropdown_bg_color()) ,mHeaderVisible(p.header_visible) + ,mCanOpenClose(true) + ,mFitPanel(p.fit_panel) ,mPaddingLeft(p.padding_left) ,mPaddingRight(p.padding_right) ,mPaddingTop(p.padding_top) ,mPaddingBottom(p.padding_bottom) - ,mCanOpenClose(true) - ,mFitPanel(p.fit_panel) ,mSelectionEnabled(p.selection_enabled) - ,mContainerPanel(NULL) - ,mScrollbar(NULL) + ,mScrollbar(nullptr) + ,mContainerPanel(nullptr) + ,mDropdownBGColor(p.dropdown_bg_color()) { mStoredOpenCloseState = false; mWasStateStored = false; @@ -584,7 +584,7 @@ LLView* LLAccordionCtrlTab::findContainerView() continue; return child; } - return NULL; + return nullptr; } void LLAccordionCtrlTab::selectOnFocusReceived() diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index 89b71875f75bd7bf421e004a52c6babd42dd4076..9062828e30ff3e6dd32211b39619a3d078fb1f54 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -133,13 +133,13 @@ public: void canOpenClose(bool can_open_close) { mCanOpenClose = can_open_close;}; bool canOpenClose() const { return mCanOpenClose; }; - virtual BOOL postBuild(); + BOOL postBuild() override; - S32 notifyParent(const LLSD& info); - S32 notify(const LLSD& info); - bool notifyChildren(const LLSD& info); + S32 notifyParent(const LLSD& info) override; + S32 notify(const LLSD& info) override; + bool notifyChildren(const LLSD& info) override; - void draw(); + void draw() override; void storeOpenCloseState (); void restoreOpenCloseState (); @@ -152,24 +152,24 @@ protected: public: // Call reshape after changing size - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; /** * Raises notifyParent event with "child_visibility_change" = new_visibility */ - void onVisibilityChange(BOOL new_visibility); + void onVisibilityChange(BOOL new_visibility) override; // Changes expand/collapse state and triggers expand/collapse callbacks - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent) override; - virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); - virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); + BOOL handleToolTip(S32 x, S32 y, MASK mask) override; + BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ) override; - virtual bool addChild(LLView* child, S32 tab_group = 0 ); + bool addChild(LLView* child, S32 tab_group = 0 ) override; bool isExpanded() const { return mDisplayChildren; } diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp index ae2a100e80b55ce432b4ce03f414ac773c952782..5603909b040d32f4b69b45894447c141efb6c36e 100644 --- a/indra/llui/llbadge.cpp +++ b/indra/llui/llbadge.cpp @@ -42,9 +42,9 @@ template class LLBadge* LLView::getChild<class LLBadge>(const std::string& name, LLBadge::Params::Params() - : image("image") - , border_image("border_image") + : border_image("border_image") , border_color("border_color") + , image("image") , image_color("image_color") , label("label") , label_color("label_color") @@ -86,7 +86,6 @@ bool LLBadge::Params::equals(const Params& a) const LLBadge::LLBadge(const LLBadge::Params& p) : LLUICtrl(p) - , mOwner(p.owner) , mBorderImage(p.border_image) , mBorderColor(p.border_color) , mGLFont(p.font) @@ -101,9 +100,10 @@ LLBadge::LLBadge(const LLBadge::Params& p) , mLocationOffsetVCenter(BADGE_OFFSET_NOT_SPECIFIED) , mLocationPercentHCenter(0.5f) , mLocationPercentVCenter(0.5f) + , mOwner(p.owner) , mPaddingHoriz(p.padding_horiz) , mPaddingVert(p.padding_vert) - , mParentScroller(NULL) + , mParentScroller(nullptr) { if (mImage.isNull()) { @@ -168,7 +168,7 @@ bool LLBadge::addToView(LLView * view) LLView * parent = mOwner.get(); - while ((parent != NULL) && ((mParentScroller = dynamic_cast<LLScrollContainer *>(parent)) == NULL)) + while ((parent != nullptr) && ((mParentScroller = dynamic_cast<LLScrollContainer *>(parent)) == nullptr)) { parent = parent->getParent(); } @@ -241,7 +241,7 @@ void LLBadge::draw() S32 badge_label_begin_offset = 0; S32 badge_char_length = S32_MAX; S32 badge_pixel_length = S32_MAX; - F32 *right_position_out = NULL; + F32 *right_position_out = nullptr; BOOL do_not_use_ellipses = false; F32 badge_width = (2.0f * mPaddingHoriz) + @@ -260,7 +260,7 @@ void LLBadge::draw() S32 location_offset_vert = mLocationOffsetVCenter; // If we're in a scroll container, do some math to keep us in the same place on screen if applicable - if (mParentScroller != NULL) + if (mParentScroller != nullptr) { LLRect visibleRect = mParentScroller->getVisibleContentRect(); diff --git a/indra/llui/llbadge.h b/indra/llui/llbadge.h index 4b21a71aaa3c4ef5a37d1d56d5cb4562c5504bb9..7b0e3bb251653b05be770f0b363e397565b8d3e3 100644 --- a/indra/llui/llbadge.h +++ b/indra/llui/llbadge.h @@ -132,7 +132,7 @@ public: bool addToView(LLView * view); - virtual void draw(); + void draw() override; const std::string getLabel() const { return wstring_to_utf8str(mLabel); } void setLabel( const LLStringExplicit& label); diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp index 6bb24f30d9c65914eb92b8472b5afca0e5fc098a..9bdafabf00354e534a685a6c851064cd321f0193 100644 --- a/indra/llui/llbadgeowner.cpp +++ b/indra/llui/llbadgeowner.cpp @@ -38,7 +38,7 @@ LLBadgeOwner::LLBadgeOwner(LLHandle< LLView > viewHandle) : mHasBadgeHolderParent(false), - mBadge(NULL), + mBadge(nullptr), mBadgeOwnerView(viewHandle) { } @@ -72,7 +72,7 @@ void LLBadgeOwner::addBadgeToParentHolder() if (mBadge && owner_view) { - LLBadgeHolder * badge_holder = NULL; + LLBadgeHolder * badge_holder = nullptr; // Find the appropriate holder for the badge LLView * parent = owner_view->getParent(); diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 2672f5a9ea1df675ff3194214feb0072104bfc60..5b1eb3fdcf4e3dc4e61642f2bf146d91927c7565 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -78,37 +78,37 @@ LLButton::Params::Params() image_pressed("image_pressed"), image_pressed_selected("image_pressed_selected"), image_overlay("image_overlay"), - image_overlay_enable("image_overlay_enable", true), image_overlay_alignment("image_overlay_alignment", std::string("center")), - image_top_pad("image_top_pad"), - image_bottom_pad("image_bottom_pad"), - imgoverlay_label_space("imgoverlay_label_space", 1), + image_overlay_enable("image_overlay_enable", true), label_color("label_color"), - label_color_selected("label_color_selected"), // requires is_toggle true + label_color_selected("label_color_selected"), label_color_disabled("label_color_disabled"), label_color_disabled_selected("label_color_disabled_selected"), - image_color("image_color"), + image_color("image_color"), // requires is_toggle true image_color_disabled("image_color_disabled"), image_overlay_color("image_overlay_color", LLColor4::white % 0.75f), - image_overlay_disabled_color("image_overlay_disabled_color", LLColor4::white % 0.3f), image_overlay_selected_color("image_overlay_selected_color", LLColor4::white), + image_overlay_disabled_color("image_overlay_disabled_color", LLColor4::white % 0.3f), flash_color("flash_color"), pad_right("pad_right", LLUI::sSettingGroups["config"]->getS32("ButtonHPad")), pad_left("pad_left", LLUI::sSettingGroups["config"]->getS32("ButtonHPad")), pad_bottom("pad_bottom"), + image_top_pad("image_top_pad"), + image_bottom_pad("image_bottom_pad"), + imgoverlay_label_space("imgoverlay_label_space", 1), click_callback("click_callback"), mouse_down_callback("mouse_down_callback"), mouse_up_callback("mouse_up_callback"), mouse_held_callback("mouse_held_callback"), is_toggle("is_toggle", false), scale_image("scale_image", true), - hover_glow_amount("hover_glow_amount"), commit_on_return("commit_on_return", true), display_pressed_state("display_pressed_state", true), + hover_glow_amount("hover_glow_amount"), + held_down_delay("held_down_delay"), use_draw_context_alpha("use_draw_context_alpha", true), badge("badge"), handle_right_mouse("handle_right_mouse"), - held_down_delay("held_down_delay"), button_flash_enable("button_flash_enable", false), button_flash_count("button_flash_count"), button_flash_rate("button_flash_rate") @@ -121,63 +121,63 @@ LLButton::Params::Params() LLButton::LLButton(const LLButton::Params& p) : LLUICtrl(p), LLBadgeOwner(getHandle()), - mMouseDownFrame(0), - mMouseHeldDownCount(0), - mBorderEnabled( FALSE ), - mFlashing( FALSE ), - mCurGlowStrength(0.f), mNeedsHighlight(FALSE), - mUnselectedLabel(p.label()), - mSelectedLabel(p.label_selected()), + mMouseDownSignal(nullptr), + mMouseUpSignal(nullptr), + mHeldDownSignal(nullptr), mGLFont(p.font), - mHeldDownDelay(p.held_down_delay.seconds), // seconds until held-down callback is called + mMouseDownFrame(0), + mMouseHeldDownCount(0), + mHeldDownDelay(p.held_down_delay.seconds), mHeldDownFrameDelay(p.held_down_delay.frames), + mLastDrawCharsCount(0), // seconds until held-down callback is called + mImageOverlayEnable(p.image_overlay_enable), + mImageOverlay(p.image_overlay()), + mImageOverlayAlignment(LLFontGL::hAlignFromName(p.image_overlay_alignment)), + mImageOverlayColor(p.image_overlay_color()), + mImageOverlaySelectedColor(p.image_overlay_selected_color()), + mImageOverlayDisabledColor(p.image_overlay_disabled_color()), mImageUnselected(p.image_unselected), + mUnselectedLabel(p.label()), + mUnselectedLabelColor(p.label_color()), mImageSelected(p.image_selected), - mImageDisabled(p.image_disabled), - mImageDisabledSelected(p.image_disabled_selected), - mImageFlash(p.image_flash), - mImagePressed(p.image_pressed), - mImagePressedSelected(p.image_pressed_selected), + mSelectedLabel(p.label_selected()), + mSelectedLabelColor(p.label_color_selected()), mImageHoverSelected(p.image_hover_selected), mImageHoverUnselected(p.image_hover_unselected), - mUnselectedLabelColor(p.label_color()), - mSelectedLabelColor(p.label_color_selected()), + mImageDisabled(p.image_disabled), mDisabledLabelColor(p.label_color_disabled()), + mImageDisabledSelected(p.image_disabled_selected), mDisabledSelectedLabelColor(p.label_color_disabled_selected()), - mImageColor(p.image_color()), + mImagePressed(p.image_pressed), + mImagePressedSelected(p.image_pressed_selected), + mImageFlash(p.image_flash), mFlashBgColor(p.flash_color()), + mImageColor(p.image_color()), mDisabledImageColor(p.image_color_disabled()), - mImageOverlay(p.image_overlay()), - mImageOverlayEnable(p.image_overlay_enable), - mImageOverlayColor(p.image_overlay_color()), - mImageOverlayDisabledColor(p.image_overlay_disabled_color()), - mImageOverlaySelectedColor(p.image_overlay_selected_color()), - mImageOverlayAlignment(LLFontGL::hAlignFromName(p.image_overlay_alignment)), - mImageOverlayTopPad(p.image_top_pad), - mImageOverlayBottomPad(p.image_bottom_pad), - mImgOverlayLabelSpace(p.imgoverlay_label_space), mIsToggle(p.is_toggle), mScaleImage(p.scale_image), mDropShadowedText(p.label_shadow), mAutoResize(p.auto_resize), mUseEllipses( p.use_ellipses ), + mBorderEnabled( FALSE ), + mFlashing( FALSE ), mHAlign(p.font_halign), mLeftHPad(p.pad_left), mRightHPad(p.pad_right), mBottomVPad(p.pad_bottom), + mImageOverlayTopPad(p.image_top_pad), + mImageOverlayBottomPad(p.image_bottom_pad), + mUseDrawContextAlpha(p.use_draw_context_alpha), + mImgOverlayLabelSpace(p.imgoverlay_label_space), mHoverGlowStrength(p.hover_glow_amount), + mCurGlowStrength(0.f), mCommitOnReturn(p.commit_on_return), mFadeWhenDisabled(FALSE), mForcePressedState(false), mDisplayPressedState(p.display_pressed_state), - mLastDrawCharsCount(0), - mMouseDownSignal(NULL), - mMouseUpSignal(NULL), - mHeldDownSignal(NULL), - mUseDrawContextAlpha(p.use_draw_context_alpha), - mHandleRightMouse(p.handle_right_mouse), - mFlashingTimer(NULL) + mFlashingTimer(nullptr), + mHandleRightMouse(p.handle_right_mouse) { if (p.button_flash_enable) { @@ -472,7 +472,7 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask) if( hasMouseCapture() ) { // Always release the mouse - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); /* * ATTENTION! This call fires another mouse up callback. @@ -545,7 +545,7 @@ BOOL LLButton::handleRightMouseUp(S32 x, S32 y, MASK mask) if( hasMouseCapture() ) { // Always release the mouse - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); // if (pointInView(x, y)) // { @@ -647,7 +647,7 @@ void LLButton::draw() LLColor4 highlighting_color = LLUIColorTable::instance().getColor("ButtonHighlightColor", LLColor4::white); // <alchemy/> LLColor4 glow_color = LLUIColorTable::instance().getColor("ButtonGlowColor", LLColor4::white); // <alchemy/> LLRender::eBlendType glow_type = LLRender::BT_ADD_WITH_ALPHA; - LLUIImage* imagep = NULL; + LLUIImage* imagep = nullptr; // Cancel sticking of color, if the button is pressed, // or when a flashing of the previously selected button is ended @@ -796,7 +796,7 @@ void LLButton::draw() // Draw button image, if available. // Otherwise draw basic rectangular button. - if (imagep != NULL) + if (imagep != nullptr) { // apply automatic 50% alpha fade to disabled image LLColor4 disabled_color = mFadeWhenDisabled ? mDisabledImageColor.get() % 0.5f : mDisabledImageColor.get(); @@ -943,7 +943,7 @@ void LLButton::draw() LLFontGL::NORMAL, mDropShadowedText ? LLFontGL::DROP_SHADOW_SOFT : LLFontGL::NO_SHADOW, S32_MAX, text_width, - NULL, mUseEllipses); + nullptr, mUseEllipses); } LLUICtrl::draw(); @@ -951,7 +951,7 @@ void LLButton::draw() void LLButton::drawBorder(LLUIImage* imagep, const LLColor4& color, S32 size) { - if (imagep == NULL) return; + if (imagep == nullptr) return; if (mScaleImage) { imagep->drawBorder(getLocalRect(), color, size); @@ -1152,7 +1152,7 @@ void LLButton::setImageOverlay(const std::string& image_name, LLFontGL::HAlign a { if (image_name.empty()) { - mImageOverlay = NULL; + mImageOverlay = nullptr; } else { @@ -1166,7 +1166,7 @@ void LLButton::setImageOverlay(const LLUUID& image_id, LLFontGL::HAlign alignmen { if (image_id.isNull()) { - mImageOverlay = NULL; + mImageOverlay = nullptr; } else { diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index ddad6716ce0787c3aab4e71c9448ef880bcf8030..3fc4f3126a551d86050ba369618207e42bf5b2b3 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -154,21 +154,21 @@ public: void addImageAttributeToXML(LLXMLNodePtr node, const std::string& imageName, const LLUUID& imageID,const std::string& xmlTagName) const; - virtual BOOL handleUnicodeCharHere(llwchar uni_char); - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual void draw(); - /*virtual*/ BOOL postBuild(); - - virtual void onMouseLeave(S32 x, S32 y, MASK mask); - virtual void onMouseCaptureLost(); - - virtual void onCommit(); + BOOL handleUnicodeCharHere(llwchar uni_char) override; + BOOL handleKeyHere(KEY key, MASK mask) override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + void draw() override; + /*virtual*/ BOOL postBuild() override; + + void onMouseLeave(S32 x, S32 y, MASK mask) override; + void onMouseCaptureLost() override; + + void onCommit() override; void setUnselectedLabelColor( const LLColor4& c ) { mUnselectedLabelColor = c; } void setSelectedLabelColor( const LLColor4& c ) { mSelectedLabelColor = c; } @@ -221,7 +221,7 @@ public: void setImageColor(const std::string& color_control); void setImageColor(const LLColor4& c); - /*virtual*/ void setColor(const LLColor4& c); + /*virtual*/ void setColor(const LLColor4& c) override; void setImages(const std::string &image_name, const std::string &selected_name); @@ -237,7 +237,7 @@ public: void autoResize(); // resize with label of current btn state void resize(LLUIString label); // resize with label input void setLabel( const LLStringExplicit& label); - virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); + BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ) override; void setLabelUnselected(const LLStringExplicit& label); void setLabelSelected(const LLStringExplicit& label); void setDisabledLabelColor( const LLColor4& c ) { mDisabledLabelColor = c; } diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp index 67b0ee37fc9ccb204f5ec5e778d998ccbc6a2ab0..165362cca225917eda1bafa6a4e49d3900028697 100644 --- a/indra/llui/llchatentry.cpp +++ b/indra/llui/llchatentry.cpp @@ -41,12 +41,12 @@ LLChatEntry::Params::Params() LLChatEntry::LLChatEntry(const Params& p) : LLTextEditor(p), - mTextExpandedSignal(NULL), + mTextExpandedSignal(nullptr), mHasHistory(p.has_history), mIsExpandable(p.is_expandable), + mSingleLineMode(false), mExpandLinesCount(p.expand_lines_count), - mPrevLinesCount(0), - mSingleLineMode(false), + mPrevLinesCount(0), mPrevExpandedLineCount(S32_MAX) { // Initialize current history line iterator diff --git a/indra/llui/llchatentry.h b/indra/llui/llchatentry.h index 3f13691a3051287526707b84aba491c200c4c630..5d05c69f2e45cb77bf1eb15152937914c0610da2 100644 --- a/indra/llui/llchatentry.h +++ b/indra/llui/llchatentry.h @@ -54,16 +54,16 @@ protected: friend class LLUICtrlFactory; LLChatEntry(const Params& p); - /*virtual*/ void beforeValueChange(); - /*virtual*/ void onValueChange(S32 start, S32 end); - /*virtual*/ bool useLabel() const; + /*virtual*/ void beforeValueChange() override; + /*virtual*/ void onValueChange(S32 start, S32 end) override; + /*virtual*/ bool useLabel() const override; public: - virtual void draw(); - virtual void onCommit(); - /*virtual*/ void onFocusReceived(); - /*virtual*/ void onFocusLost(); + void draw() override; + void onCommit() override; + /*virtual*/ void onFocusReceived() override; + /*virtual*/ void onFocusLost() override; void enableSingleLineMode(bool single_line_mode); boost::signals2::connection setTextExpandedCallback(const commit_signal_t::slot_type& cb); @@ -84,7 +84,7 @@ private: */ void updateHistory(); - BOOL handleSpecialKey(const KEY key, const MASK mask); + BOOL handleSpecialKey(const KEY key, const MASK mask) override; // Fired when text height expanded to mExpandLinesCount diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 95d96d7f5c3658cd0c17f032b3e3c6313227a999..5326a091234bb9f53028e3c825259117030a3e5c 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -59,9 +59,9 @@ LLCheckBoxCtrl::Params::Params() LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p) : LLUICtrl(p), + mFont(p.font()), mTextEnabledColor(p.label_text.text_color()), - mTextDisabledColor(p.label_text.text_readonly_color()), - mFont(p.font()) + mTextDisabledColor(p.label_text.text_readonly_color()) { mViewModel->setValue(LLSD(p.initial_value)); mViewModel->resetDirty(); diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h index 5ce45b21351ce3f929a84e9e6a3f3d271a95a8d6..eed3f4731f06d26142fbce01af73ac1e0970e02c 100644 --- a/indra/llui/llcheckboxctrl.h +++ b/indra/llui/llcheckboxctrl.h @@ -71,23 +71,23 @@ protected: public: // LLView interface - virtual void setEnabled( BOOL b ); + void setEnabled( BOOL b ) override; - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; // LLUICtrl interface - virtual void setValue(const LLSD& value ); - virtual LLSD getValue() const; + void setValue(const LLSD& value ) override; + LLSD getValue() const override; BOOL get() { return (BOOL)getValue().asBoolean(); } void set(BOOL value) { setValue(value); } - virtual void setTentative(BOOL b); - virtual BOOL getTentative() const; + void setTentative(BOOL b) override; + BOOL getTentative() const override; - virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); + BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ) override; - virtual void clear(); - virtual void onCommit(); + void clear() override; + void onCommit() override; // LLCheckBoxCtrl interface virtual BOOL toggle() { return mButton->toggleState(); } // returns new state @@ -100,11 +100,11 @@ public: void setFont( const LLFontGL* font ) { mFont = font; } const LLFontGL* getFont() { return mFont; } - - virtual void setControlName(const std::string& control_name, LLView* context); - virtual BOOL isDirty() const; // Returns TRUE if the user has modified this control. - virtual void resetDirty(); // Clear dirty state + void setControlName(const std::string& control_name, LLView* context) override; + + BOOL isDirty() const override; // Returns TRUE if the user has modified this control. + void resetDirty() override; // Clear dirty state protected: // note: value is stored in toggle state of button diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 721f957fd933c5594f6e8771444b4d3c7f6085ff..47af468bb5095f268c777fa69be91418ffe6111d 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -72,15 +72,15 @@ LLComboBox::ItemParams::ItemParams() LLComboBox::Params::Params() : allow_text_entry("allow_text_entry", false), - allow_new_values("allow_new_values", false), show_text_as_tentative("show_text_as_tentative", true), + allow_new_values("allow_new_values", false), max_chars("max_chars", 20), list_position("list_position", BELOW), - items("item"), combo_button("combo_button"), combo_list("combo_list"), combo_editor("combo_editor"), - drop_down_button("drop_down_button") + drop_down_button("drop_down_button"), + items("item") { addSynonym(items, "combo_item"); } @@ -88,18 +88,18 @@ LLComboBox::Params::Params() LLComboBox::LLComboBox(const LLComboBox::Params& p) : LLUICtrl(p), - mTextEntry(NULL), - mTextEntryTentative(p.show_text_as_tentative), + mTextEntry(nullptr), + mListPosition(p.list_position), + mLabel(p.label), mHasAutocompletedText(false), mAllowTextEntry(p.allow_text_entry), mAllowNewValues(p.allow_new_values), mMaxChars(p.max_chars), + mTextEntryTentative(p.show_text_as_tentative), mPrearrangeCallback(p.prearrange_callback()), mTextEntryCallback(p.text_entry_callback()), mTextChangedCallback(p.text_changed_callback()), - mListPosition(p.list_position), - mLastSelectedIndex(-1), - mLabel(p.label) + mLastSelectedIndex(-1) { // Text label button @@ -563,7 +563,7 @@ void* LLComboBox::getCurrentUserdata() { return item->getUserdata(); } - return NULL; + return nullptr; } @@ -861,7 +861,7 @@ void LLComboBox::setTextEntry(const LLStringExplicit& text) void LLComboBox::onTextEntry(LLLineEditor* line_editor) { - if (mTextEntryCallback != NULL) + if (mTextEntryCallback != nullptr) { (mTextEntryCallback)(line_editor, LLSD()); } @@ -881,7 +881,7 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor) mList->deselectAllItems(); mLastSelectedIndex = -1; } - if (mTextChangedCallback != NULL) + if (mTextChangedCallback != nullptr) { (mTextChangedCallback)(line_editor, LLSD()); } @@ -929,7 +929,7 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor) // RN: presumably text entry updateSelection(); } - if (mTextChangedCallback != NULL) + if (mTextChangedCallback != nullptr) { (mTextChangedCallback)(line_editor, LLSD()); } diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index df3539c9f911be52164f775f341f2f2046cafa9a..adc7b140991b304b07502e6e7c4c84f11abd2d7d 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -91,7 +91,7 @@ public: virtual ~LLComboBox(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; protected: friend class LLUICtrlFactory; @@ -101,29 +101,29 @@ protected: public: // LLView interface - virtual void onFocusLost(); + void onFocusLost() override; - virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual BOOL handleUnicodeCharHere(llwchar uni_char); - virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + BOOL handleToolTip(S32 x, S32 y, MASK mask) override; + BOOL handleKeyHere(KEY key, MASK mask) override; + BOOL handleUnicodeCharHere(llwchar uni_char) override; + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; // LLUICtrl interface - virtual void clear(); // select nothing - virtual void onCommit(); - virtual BOOL acceptsTextInput() const { return mAllowTextEntry; } - virtual BOOL isDirty() const; // Returns TRUE if the user has modified this control. - virtual void resetDirty(); // Clear dirty state + void clear() override; // select nothing + void onCommit() override; + BOOL acceptsTextInput() const override { return mAllowTextEntry; } + BOOL isDirty() const override; // Returns TRUE if the user has modified this control. + void resetDirty() override; // Clear dirty state - virtual void setFocus(BOOL b); + void setFocus(BOOL b) override; // Selects item by underlying LLSD value, using LLSD::asString() matching. // For simple items, this is just the name of the label. - virtual void setValue(const LLSD& value ); + void setValue(const LLSD& value ) override; // Gets underlying LLSD value for currently selected items. For simple // items, this is just the label. - virtual LLSD getValue() const; + LLSD getValue() const override; void setTextEntry(const LLStringExplicit& text); @@ -161,34 +161,34 @@ public: void createLineEditor(const Params&); //======================================================================== - LLCtrlSelectionInterface* getSelectionInterface() { return (LLCtrlSelectionInterface*)this; }; - LLCtrlListInterface* getListInterface() { return (LLCtrlListInterface*)this; }; + LLCtrlSelectionInterface* getSelectionInterface() override { return (LLCtrlSelectionInterface*)this; }; + LLCtrlListInterface* getListInterface() override { return (LLCtrlListInterface*)this; }; // LLCtrlListInterface functions // See llscrolllistctrl.h - virtual S32 getItemCount() const; + S32 getItemCount() const override; // Overwrites the default column (See LLScrollListCtrl for format) - virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); - virtual void clearColumns(); - virtual void setColumnLabel(const std::string& column, const std::string& label); - virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); - virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); - virtual void clearRows(); - virtual void sortByColumn(const std::string& name, BOOL ascending); + void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM) override; + void clearColumns() override; + void setColumnLabel(const std::string& column, const std::string& label) override; + LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = nullptr) override; + LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()) override; + void clearRows() override; + void sortByColumn(const std::string& name, BOOL ascending) override; // LLCtrlSelectionInterface functions - virtual BOOL getCanSelect() const { return TRUE; } - virtual BOOL selectFirstItem() { return setCurrentByIndex(0); } - virtual BOOL selectNthItem( S32 index ) { return setCurrentByIndex(index); } - virtual BOOL selectItemRange( S32 first, S32 last ); - virtual S32 getFirstSelectedIndex() const { return getCurrentIndex(); } - virtual BOOL setCurrentByID( const LLUUID& id ); - virtual LLUUID getCurrentID() const; // LLUUID::null if no items in menu - virtual BOOL setSelectedByValue(const LLSD& value, BOOL selected); - virtual LLSD getSelectedValue(); - virtual BOOL isSelected(const LLSD& value) const; - virtual BOOL operateOnSelection(EOperation op); - virtual BOOL operateOnAll(EOperation op); + BOOL getCanSelect() const override { return TRUE; } + BOOL selectFirstItem() override { return setCurrentByIndex(0); } + BOOL selectNthItem( S32 index ) override { return setCurrentByIndex(index); } + BOOL selectItemRange( S32 first, S32 last ) override; + S32 getFirstSelectedIndex() const override { return getCurrentIndex(); } + BOOL setCurrentByID( const LLUUID& id ) override; + LLUUID getCurrentID() const override; // LLUUID::null if no items in menu + BOOL setSelectedByValue(const LLSD& value, BOOL selected) override; + LLSD getSelectedValue() override; + BOOL isSelected(const LLSD& value) const override; + BOOL operateOnSelection(EOperation op) override; + BOOL operateOnAll(EOperation op) override; //======================================================================== @@ -254,7 +254,7 @@ public: Params(); }; - /*virtual*/ const std::string getSelectedItemLabel(S32 column = 0) const; + /*virtual*/ const std::string getSelectedItemLabel(S32 column = 0) const override; private: enum EColumnIndex diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 4ba179260acb46fe6e9b6099f4c764f951f1c798..7e0fe90e2e38fa39c8422b3fe2c0344cca68f585 100644 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -119,7 +119,7 @@ LLCommand * LLCommandManager::getCommand(U32 commandIndex) LLCommand * LLCommandManager::getCommand(const LLCommandId& commandId) { - LLCommand * command_match = NULL; + LLCommand * command_match = nullptr; CommandIndexMap::const_iterator found = mCommandIndices.find(commandId.uuid()); @@ -133,7 +133,7 @@ LLCommand * LLCommandManager::getCommand(const LLCommandId& commandId) LLCommand * LLCommandManager::getCommand(const std::string& name) { - LLCommand * command_match = NULL; + LLCommand * command_match = nullptr; for (auto it = mCommands.cbegin(), it_end = mCommands.cend(); it != it_end; ++it) { diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index 6e1abc68a614cbc329c897f2c7afe30ff2feeb04..9811899dc2fef19a8d9162360bc8bb5b5d60659d 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -51,15 +51,15 @@ // Used for LCD display extern void AddNewDebugConsoleToLCD(const LLWString &newLine); -LLConsole* gConsole = NULL; // Created and destroyed in LLViewerWindow. +LLConsole* gConsole = nullptr; // Created and destroyed in LLViewerWindow. const F32 FADE_DURATION = 2.f; static LLDefaultChildRegistry::Register<LLConsole> r("console"); LLConsole::LLConsole(const LLConsole::Params& p) -: LLUICtrl(p), - LLFixedBuffer(p.max_lines), +: LLFixedBuffer(p.max_lines), + LLUICtrl(p), mLinePersistTime(p.persist_time), // seconds mFont(p.font), mConsoleWidth(0), @@ -120,7 +120,7 @@ void LLConsole::setFontSize(S32 size_index) mFont = LLFontGL::getFontSansSerifHuge(); } // Make sure the font exists - if (mFont == NULL) + if (mFont == nullptr) { mFont = LLFontGL::getFontDefault(); } @@ -281,7 +281,7 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, b if ( mParagraphText.empty() || mParagraphColorSegments.empty() - || font == NULL) + || font == nullptr) { return; //Not enough info to complete. } diff --git a/indra/llui/llconsole.h b/indra/llui/llconsole.h index 5ff05698b05b39cf5d95b463c56ef0071cae6e4f..9068a0ba86ec06e9e2d91d98130139e477447d20 100644 --- a/indra/llui/llconsole.h +++ b/indra/llui/llconsole.h @@ -132,14 +132,14 @@ public: // each line lasts this long after being added void setLinePersistTime(F32 seconds); - void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; // -1 = monospace, 0 means small, font size = 1 means big void setFontSize(S32 size_index); // Overrides - /*virtual*/ void draw(); + /*virtual*/ void draw() override; private: void update(); diff --git a/indra/llui/llcontainerview.cpp b/indra/llui/llcontainerview.cpp index e19aaaf1f8753586f16cfbabaf8162d376d20f25..26196cd03e8085a131f8b41d83effdf69c5d51a0 100644 --- a/indra/llui/llcontainerview.cpp +++ b/indra/llui/llcontainerview.cpp @@ -48,10 +48,10 @@ static ContainerViewRegistry::Register<LLPanel> r3("panel", &LLPanel::fromXML); LLContainerView::LLContainerView(const LLContainerView::Params& p) : LLView(p), mShowLabel(p.show_label), - mLabel(p.label), - mDisplayChildren(p.display_children) + mDisplayChildren(p.display_children), + mLabel(p.label) { - mScrollContainer = NULL; + mScrollContainer = nullptr; } LLContainerView::~LLContainerView() @@ -86,7 +86,7 @@ BOOL LLContainerView::handleMouseDown(S32 x, S32 y, MASK mask) BOOL handled = FALSE; if (mDisplayChildren) { - handled = (LLView::childrenHandleMouseDown(x, y, mask) != NULL); + handled = (LLView::childrenHandleMouseDown(x, y, mask) != nullptr); } if (!handled) { @@ -105,7 +105,7 @@ BOOL LLContainerView::handleMouseUp(S32 x, S32 y, MASK mask) BOOL handled = FALSE; if (mDisplayChildren) { - handled = (LLView::childrenHandleMouseUp(x, y, mask) != NULL); + handled = (LLView::childrenHandleMouseUp(x, y, mask) != nullptr); } return handled; } diff --git a/indra/llui/llcontainerview.h b/indra/llui/llcontainerview.h index 99267d978aa49f7c5283f846441bd15e81a7044c..a0e32cd56654f650ef0ff0221a1db9485283302e 100644 --- a/indra/llui/llcontainerview.h +++ b/indra/llui/llcontainerview.h @@ -65,16 +65,16 @@ protected: public: ~LLContainerView(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0) override; - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; - /*virtual*/ void draw(); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options. + /*virtual*/ void draw() override; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + /*virtual*/ LLRect getRequiredRect() override; // Return the height of this object, given the set options. void setLabel(const std::string& label); void showLabel(BOOL show) { mShowLabel = show; } diff --git a/indra/llui/llctrlselectioninterface.h b/indra/llui/llctrlselectioninterface.h index a7b089c8f92571f166644ad8b9fdf0151d13e16b..0a3e2114d66645b1b1ae251d0ad9dafe6a550b02 100644 --- a/indra/llui/llctrlselectioninterface.h +++ b/indra/llui/llctrlselectioninterface.h @@ -81,7 +81,7 @@ public: virtual void clearColumns() = 0; virtual void setColumnLabel(const std::string& column, const std::string& label) = 0; // TomY TODO: Document this - virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL) = 0; + virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = nullptr) = 0; LLScrollListItem* addSimpleElement(const std::string& value); // defaults to bottom LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos); // defaults to no LLSD() id diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index d11d7e73f45e7ae62873b049720a03d34110f671..ce78c070b412d142a6a331c9833d6c4ec05efa75 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -37,7 +37,7 @@ LLHandle<LLFloater> LLDockableFloater::sInstanceHandle; //static void LLDockableFloater::init() { - this->setDocked(this->mDockControl.get() != NULL + this->setDocked(this->mDockControl.get() != nullptr && this->mDockControl.get()->isDockVisible()); this->resetInstance(); @@ -67,7 +67,7 @@ LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, bool uniqueDock LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, bool uniqueDocking, bool useTongue, const LLSD& key, const Params& params) : - LLFloater(key, params), mDockControl(dockControl), mUseTongue(useTongue), mUniqueDocking(uniqueDocking) + LLFloater(key, params), mDockControl(dockControl), mUniqueDocking(uniqueDocking), mUseTongue(useTongue) { init(); } @@ -79,7 +79,7 @@ LLDockableFloater::~LLDockableFloater() BOOL LLDockableFloater::postBuild() { // Remember we should force docking when the floater is opened for the first time - if (mIsDockedStateForcedCallback != NULL && mIsDockedStateForcedCallback()) + if (mIsDockedStateForcedCallback != nullptr && mIsDockedStateForcedCallback()) { mForceDocking = true; } @@ -98,17 +98,17 @@ void LLDockableFloater::toggleInstance(const LLSD& sdname) LLDockableFloater* instance = dynamic_cast<LLDockableFloater*> (LLFloaterReg::findInstance(name)); // if floater closed or docked - if (instance == NULL || (instance && instance->isDocked())) + if (instance == nullptr || (instance && instance->isDocked())) { LLFloaterReg::toggleInstance(name, key); // restore button toggle state - if (instance != NULL) + if (instance != nullptr) { instance->storeVisibilityControl(); } } // if floater undocked - else if (instance != NULL) + else if (instance != nullptr) { instance->setMinimized(FALSE); if (instance->getVisible()) @@ -127,7 +127,7 @@ void LLDockableFloater::resetInstance() { if (mUniqueDocking && sInstanceHandle.get() != this) { - if (sInstanceHandle.get() != NULL && sInstanceHandle.get()->isDocked()) + if (sInstanceHandle.get() != nullptr && sInstanceHandle.get()->isDocked()) { sInstanceHandle.get()->setVisible(FALSE); } @@ -150,7 +150,7 @@ void LLDockableFloater::setVisible(BOOL visible) resetInstance(); } - if (visible && mDockControl.get() != NULL) + if (visible && mDockControl.get() != nullptr) { mDockControl.get()->repositionDockable(); } @@ -177,8 +177,8 @@ void LLDockableFloater::setMinimized(BOOL minimize) LLView * LLDockableFloater::getDockWidget() { - LLView * res = NULL; - if (getDockControl() != NULL) { + LLView * res = nullptr; + if (getDockControl() != nullptr) { res = getDockControl()->getDock(); } @@ -200,7 +200,7 @@ void LLDockableFloater::onDockShown() void LLDockableFloater::setDocked(bool docked, bool pop_on_undock) { - if (mDockControl.get() != NULL && mDockControl.get()->isDockVisible()) + if (mDockControl.get() != nullptr && mDockControl.get()->isDockVisible()) { if (docked) { @@ -224,7 +224,7 @@ void LLDockableFloater::setDocked(bool docked, bool pop_on_undock) void LLDockableFloater::draw() { - if (mDockControl.get() != NULL) + if (mDockControl.get() != nullptr) { mDockControl.get()->repositionDockable(); if (isDocked()) diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index c83dd7b51273fe17f73a63e94b002dfd1792c354..64af6ce6ca4ee992fce2e4a5caf92f33b719b307 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -80,21 +80,21 @@ public: * If descendant class overrides postBuild() in order to perform specific * construction then it must still invoke its superclass' implementation. */ - /* virtula */BOOL postBuild(); - /* virtual */void setDocked(bool docked, bool pop_on_undock = true); - /* virtual */void draw(); + /* virtula */BOOL postBuild() override; + /* virtual */void setDocked(bool docked, bool pop_on_undock = true) override; + /* virtual */void draw() override; /** * If descendant class overrides setVisible() then it must still invoke its * superclass' implementation. */ - /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ void setVisible(BOOL visible) override; /** * If descendant class overrides setMinimized() then it must still invoke its * superclass' implementation. */ - /*virtual*/ void setMinimized(BOOL minimize); + /*virtual*/ void setMinimized(BOOL minimize) override; LLView * getDockWidget(); diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index b0a5601c8e56c79fa1da946146233f309044d6cb..4ff9c436a20b580f32e71745dd9bca149e7990a9 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -43,7 +43,7 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater, { mDockAt = dockAt; - if (dockWidget != NULL) + if (dockWidget != nullptr) { mDockWidgetHandle = dockWidget->getHandle(); } @@ -66,12 +66,12 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater, mGetAllowedRectCallback = get_allowed_rect_callback; } - if (dockWidget != NULL) + if (dockWidget != nullptr) { repositionDockable(); } - if (getDock() != NULL) + if (getDock() != nullptr) { mDockWidgetVisible = isDockVisible(); } @@ -87,7 +87,7 @@ LLDockControl::~LLDockControl() void LLDockControl::setDock(LLView* dockWidget) { - if (dockWidget != NULL) + if (dockWidget != nullptr) { mDockWidgetHandle = dockWidget->getHandle(); repositionDockable(); @@ -133,7 +133,7 @@ void LLDockControl::repositionDockable() off(); LLDockableFloater* dockable_floater = dynamic_cast<LLDockableFloater*> (mDockableFloater); - if(dockable_floater != NULL) + if(dockable_floater != nullptr) { dockable_floater->onDockHidden(); } @@ -146,7 +146,7 @@ void LLDockControl::repositionDockable() } LLDockableFloater* dockable_floater = dynamic_cast<LLDockableFloater*> (mDockableFloater); - if(dockable_floater != NULL) + if(dockable_floater != nullptr) { dockable_floater->onDockShown(); } @@ -164,7 +164,7 @@ bool LLDockControl::isDockVisible() { bool res = true; - if (getDock() != NULL) + if (getDock() != nullptr) { //we should check all hierarchy res = getDock()->isInVisibleChain(); @@ -210,7 +210,7 @@ void LLDockControl::moveDockable() bool use_tongue = false; LLDockableFloater* dockable_floater = dynamic_cast<LLDockableFloater*> (mDockableFloater); - if (dockable_floater != NULL) + if (dockable_floater != nullptr) { use_tongue = dockable_floater->getUseTongue(); } @@ -379,7 +379,7 @@ void LLDockControl::drawToungue() bool use_tongue = false; LLDockableFloater* dockable_floater = dynamic_cast<LLDockableFloater*> (mDockableFloater); - if (dockable_floater != NULL) + if (dockable_floater != nullptr) { use_tongue = dockable_floater->getUseTongue(); } diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index 8948b50f483822cd26574deaa00ce5637852af94..d5b74512ca49af8581056c664311753ca1a041fc 100644 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -53,15 +53,15 @@ S32 LLDragHandle::sSnapMargin = 5; LLDragHandle::LLDragHandle(const LLDragHandle::Params& p) : LLView(p), + mTitleBox(nullptr ), mDragLastScreenX( 0 ), mDragLastScreenY( 0 ), mLastMouseScreenX( 0 ), mLastMouseScreenY( 0 ), - mTitleBox( NULL ), - mMaxTitleWidth( 0 ), - mForeground( TRUE ), mDragHighlightColor(p.drag_highlight_color()), - mDragShadowColor(p.drag_shadow_color()) + mDragShadowColor(p.drag_shadow_color()), + mMaxTitleWidth( 0 ), + mForeground( TRUE ) { static LLUICachedControl<S32> snap_margin ("SnapMargin", 0); @@ -119,7 +119,7 @@ void LLDragHandleTop::setTitle(const std::string& title) std::string LLDragHandleTop::getTitle() const { - return mTitleBox == NULL ? LLStringUtil::null : mTitleBox->getText(); + return mTitleBox == nullptr ? LLStringUtil::null : mTitleBox->getText(); } @@ -129,7 +129,7 @@ void LLDragHandleLeft::setTitle(const std::string& ) { removeChild(mTitleBox); delete mTitleBox; - mTitleBox = NULL; + mTitleBox = nullptr; } /* no title on left edge */ } @@ -292,7 +292,7 @@ BOOL LLDragHandle::handleMouseUp(S32 x, S32 y, MASK mask) if( hasMouseCapture() ) { // Release the mouse - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); } // Note: don't pass on to children diff --git a/indra/llui/lldraghandle.h b/indra/llui/lldraghandle.h index e095e577b1e555d711bf56c87567ec1f396ba4fa..14d2da57f5ece5cbe0199408462cb33f608deb7b 100644 --- a/indra/llui/lldraghandle.h +++ b/indra/llui/lldraghandle.h @@ -72,9 +72,9 @@ public: virtual void setTitle( const std::string& title ) = 0; virtual std::string getTitle() const = 0; - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; protected: LLDragHandle(const Params&); @@ -108,10 +108,10 @@ protected: LLDragHandleTop(const Params& p) : LLDragHandle(p) {} friend class LLUICtrlFactory; public: - virtual void setTitle( const std::string& title ); - virtual std::string getTitle() const; - virtual void draw(); - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void setTitle( const std::string& title ) override; + std::string getTitle() const override; + void draw() override; + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; private: void reshapeTitleBox(); @@ -126,10 +126,10 @@ protected: LLDragHandleLeft(const Params& p) : LLDragHandle(p) {} friend class LLUICtrlFactory; public: - virtual void setTitle( const std::string& title ); - virtual std::string getTitle() const; - virtual void draw(); - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void setTitle( const std::string& title ) override; + std::string getTitle() const override; + void draw() override; + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; }; diff --git a/indra/llui/lleditmenuhandler.cpp b/indra/llui/lleditmenuhandler.cpp index c85d0a3b0a631335ca1aba7efee2709057fa2fe0..d80dfaf9a5f05d02bfb2aae1b20437cd364fbe49 100644 --- a/indra/llui/lleditmenuhandler.cpp +++ b/indra/llui/lleditmenuhandler.cpp @@ -31,12 +31,12 @@ #include "lleditmenuhandler.h" /* static */ -LLEditMenuHandler* LLEditMenuHandler::gEditMenuHandler = NULL; +LLEditMenuHandler* LLEditMenuHandler::gEditMenuHandler = nullptr; LLEditMenuHandler::~LLEditMenuHandler() { if (gEditMenuHandler == this) { - gEditMenuHandler = NULL; + gEditMenuHandler = nullptr; } } diff --git a/indra/llui/llf32uictrl.h b/indra/llui/llf32uictrl.h index 6e648f910290c0ecce2d2da504475bd2323b0f18..60b918a7fd18cf4cf6717237f78febfd90234cfe 100644 --- a/indra/llui/llf32uictrl.h +++ b/indra/llui/llf32uictrl.h @@ -53,8 +53,8 @@ protected: public: virtual F32 getValueF32() const; - virtual void setValue(const LLSD& value ) { mViewModel->setValue(value); } - virtual LLSD getValue() const { return LLSD(getValueF32()); } + void setValue(const LLSD& value ) override { mViewModel->setValue(value); } + LLSD getValue() const override { return LLSD(getValueF32()); } virtual void setMinValue(const LLSD& min_value) { setMinValue((F32)min_value.asReal()); } virtual void setMaxValue(const LLSD& max_value) { setMaxValue((F32)max_value.asReal()); } diff --git a/indra/llui/llfiltereditor.h b/indra/llui/llfiltereditor.h index 3a05bc05a165efa6466d27639f9be4692b955d01..59ff6035351d7020a41d99b0e4a06926339e1eeb 100644 --- a/indra/llui/llfiltereditor.h +++ b/indra/llui/llfiltereditor.h @@ -48,7 +48,7 @@ protected: LLFilterEditor(const Params&); friend class LLUICtrlFactory; - /*virtual*/ void handleKeystroke(); + /*virtual*/ void handleKeystroke() override; }; #endif // LL_FILTEREDITOR_H diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp index e6ac73a78cffd8b3cc3c8a01e5266487a0b043d0..88e30f8e43125b28505e9bf893730f210135c628 100644 --- a/indra/llui/llflashtimer.cpp +++ b/indra/llui/llflashtimer.cpp @@ -36,8 +36,8 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period) : LLEventTimer(period), mCallback(cb), mCurrentTickCount(0), - mIsFlashingInProgress(false), mIsCurrentlyHighlighted(false), + mIsFlashingInProgress(false), mUnset(false) { mEventTimer.stop(); diff --git a/indra/llui/llflashtimer.h b/indra/llui/llflashtimer.h index 2ec2687b1eb293054f04e163a5e963e0926721ce..164c95357b29801a8e74d845a4a097e014c2998c 100644 --- a/indra/llui/llflashtimer.h +++ b/indra/llui/llflashtimer.h @@ -45,7 +45,7 @@ public: LLFlashTimer(callback_t cb = NULL, S32 count = 0, F32 period = 0.0); ~LLFlashTimer() {}; - /*virtual*/ BOOL tick(); + /*virtual*/ BOOL tick() override; void startFlashing(); void stopFlashing(); diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index 5ed12759a7d1fb5a0ffd0a8c4c2f31c29200397d..3d3f3bd6c530187f6a6a3a76a843d9c2866193f7 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -42,11 +42,11 @@ const LLSD UNSELECTED_EVENT = LLSD().with("selected", false); bool llsds_are_equal(const LLSD& llsd_1, const LLSD& llsd_2); LLFlatListView::Params::Params() -: item_pad("item_pad"), - allow_select("allow_select"), +: allow_select("allow_select"), multi_select("multi_select"), keep_one_selected("keep_one_selected"), keep_selection_visible_on_reshape("keep_selection_visible_on_reshape",false), + item_pad("item_pad"), no_items_text("no_items_text") {}; @@ -256,11 +256,11 @@ bool LLFlatListView::removeItemByUUID(const LLUUID& uuid, bool rearrange) LLPanel* LLFlatListView::getItemByValue(const LLSD& value) const { - if (value.isUndefined()) return NULL; + if (value.isUndefined()) return nullptr; item_pair_t* pair = getItemPair(value); if (pair) return pair->first; - return NULL; + return nullptr; } bool LLFlatListView::selectItem(LLPanel* item, bool select /*= true*/) @@ -333,7 +333,7 @@ void LLFlatListView::getSelectedUUIDs(uuid_vec_t& selected_uuids) const LLPanel* LLFlatListView::getSelectedItem() const { - if (mSelectedItemPairs.empty()) return NULL; + if (mSelectedItemPairs.empty()) return nullptr; return mSelectedItemPairs.front()->first; } @@ -450,17 +450,17 @@ bool LLFlatListView::updateValue(const LLSD& old_value, const LLSD& new_value) LLFlatListView::LLFlatListView(const LLFlatListView::Params& p) : LLScrollContainer(p) - , mItemComparator(NULL) - , mItemsPanel(NULL) + , mItemComparator(nullptr) + , mItemsPanel(nullptr) , mItemPad(p.item_pad) , mAllowSelection(p.allow_select) , mMultipleSelection(p.multi_select) - , mKeepOneItemSelected(p.keep_one_selected) , mCommitOnSelectionChange(false) - , mPrevNotifyParentRect(LLRect()) - , mNoItemsCommentTextbox(NULL) + , mKeepOneItemSelected(p.keep_one_selected) , mIsConsecutiveSelection(false) , mKeepSelectionVisibleOnReshape(p.keep_selection_visible_on_reshape) + , mPrevNotifyParentRect(LLRect()) + , mNoItemsCommentTextbox(nullptr) { mBorderThickness = getBorderWidth(); @@ -790,7 +790,7 @@ LLFlatListView::item_pair_t* LLFlatListView::getItemPair(LLPanel* item) const item_pair_t* item_pair = *it; if (item_pair->first == item) return item_pair; } - return NULL; + return nullptr; } //compares two LLSD's @@ -832,7 +832,7 @@ LLFlatListView::item_pair_t* LLFlatListView::getItemPair(const LLSD& value) cons item_pair_t* item_pair = *it; if (llsds_are_equal(item_pair->second, value)) return item_pair; } - return NULL; + return nullptr; } bool LLFlatListView::selectItemPair(item_pair_t* item_pair, bool select) @@ -963,8 +963,8 @@ bool LLFlatListView::selectNextItemPair(bool is_up_direction, bool reset_selecti if ( mSelectedItemPairs.size() ) { - item_pair_t* to_sel_pair = NULL; - item_pair_t* cur_sel_pair = NULL; + item_pair_t* to_sel_pair = nullptr; + item_pair_t* cur_sel_pair = nullptr; // Take the last selected pair cur_sel_pair = mSelectedItemPairs.back(); @@ -1205,7 +1205,7 @@ void LLFlatListView::onFocusLost() // Route menu back to the default if( gEditMenuHandler == this ) { - gEditMenuHandler = NULL; + gEditMenuHandler = nullptr; } } @@ -1269,7 +1269,7 @@ void LLFlatListView::detachItems(std::vector<LLPanel*>& detached_items) iter_end = mItemPairs.end(); iter != iter_end; ++iter) { - (*iter)->first = NULL; + (*iter)->first = nullptr; delete *iter; } mItemPairs.clear(); @@ -1298,7 +1298,7 @@ void LLFlatListView::detachItems(std::vector<LLPanel*>& detached_items) if (item_pair->first == pDetachedItem) { mItemPairs.erase(iter); - item_pair->first = NULL; + item_pair->first = nullptr; delete item_pair; break; } diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h index d47c1cf3332204de198085efeeab357765e52ee8..1cdebc5fdf5e0f51a99d639f55160d3faae1d20f 100644 --- a/indra/llui/llflatlistview.h +++ b/indra/llui/llflatlistview.h @@ -79,7 +79,7 @@ public: ItemReverseComparator(const ItemComparator& comparator) : mComparator(comparator) {}; virtual ~ItemReverseComparator() {}; - virtual bool compare(const LLPanel* item1, const LLPanel* item2) const + bool compare(const LLPanel* item1, const LLPanel* item2) const override { return mComparator.compare(item2, item1); } @@ -113,7 +113,7 @@ public: }; // disable traversal when finding widget to hand focus off to - /*virtual*/ BOOL canFocusChildren() const { return FALSE; } + /*virtual*/ BOOL canFocusChildren() const override { return FALSE; } /** * Connects callback to signal called when Return key is pressed. @@ -121,12 +121,12 @@ public: boost::signals2::connection setReturnCallback( const commit_signal_t::slot_type& cb ) { return mOnReturnSignal.connect(cb); } /** Overridden LLPanel's reshape, height is ignored, the list sets its height to accommodate all items */ - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; /** Returns full rect of child panel */ const LLRect& getItemsRect() const; - LLRect getRequiredRect() { return getItemsRect(); } + LLRect getRequiredRect() override { return getItemsRect(); } /** Returns distance between items */ const S32 getItemsPad() { return mItemPad; } @@ -270,7 +270,7 @@ public: U32 size(const bool only_visible_items = true) const; /** Removes all items from the list */ - virtual void clear(); + void clear() override; /** * Removes all items that can be detached from the list but doesn't destroy @@ -297,7 +297,7 @@ public: void selectFirstItem (); void selectLastItem (); - virtual S32 notify(const LLSD& info) ; + S32 notify(const LLSD& info) override; virtual ~LLFlatListView(); protected: @@ -345,8 +345,8 @@ protected: virtual bool selectNextItemPair(bool is_up_direction, bool reset_selection); - virtual BOOL canSelectAll() const; - virtual void selectAll(); + BOOL canSelectAll() const override; + void selectAll() override; virtual bool isSelected(item_pair_t* item_pair) const; @@ -363,15 +363,15 @@ protected: */ void notifyParentItemsRectChanged(); - virtual BOOL handleKeyHere(KEY key, MASK mask); + BOOL handleKeyHere(KEY key, MASK mask) override; - virtual BOOL postBuild(); + BOOL postBuild() override; - virtual void onFocusReceived(); + void onFocusReceived() override; - virtual void onFocusLost(); + void onFocusLost() override; - virtual void draw(); + void draw() override; LLRect getLastSelectedItemRect(); diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 3c51041fa000fd369b05ccc289561030356a835e..d3e796ca653505f80507f70202751444ba4ab4b8 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -78,14 +78,14 @@ LLFloater* LLFloaterReg::getLastFloaterInGroup(const std::string& name) } } } - return NULL; + return nullptr; } LLFloater* LLFloaterReg::getLastFloaterCascading() { LLRect candidate_rect; candidate_rect.mTop = 100000; - LLFloater* candidate_floater = NULL; + LLFloater* candidate_floater = nullptr; std::map<std::string,std::string>::const_iterator it = sGroupMap.begin(), it_end = sGroupMap.end(); for( ; it != it_end; ++it) @@ -117,7 +117,7 @@ LLFloater* LLFloaterReg::getLastFloaterCascading() //static LLFloater* LLFloaterReg::findInstance(const std::string& name, const LLSD& key) { - LLFloater* res = NULL; + LLFloater* res = nullptr; const std::string& groupname = sGroupMap[name]; if (!groupname.empty()) { @@ -154,13 +154,13 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) if (!res) { LL_WARNS() << "Failed to build floater type: '" << name << "'." << LL_ENDL; - return NULL; + return nullptr; } bool success = res->buildFromFile(xui_file); if (!success) { LL_WARNS() << "Failed to build floater type: '" << name << "'." << LL_ENDL; - return NULL; + return nullptr; } // Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe @@ -190,7 +190,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) //static LLFloater* LLFloaterReg::removeInstance(const std::string& name, const LLSD& key) { - LLFloater* res = NULL; + LLFloater* res = nullptr; const std::string& groupname = sGroupMap[name]; if (!groupname.empty()) { @@ -248,7 +248,7 @@ LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, if( sBlockShowFloaters // see EXT-7090 && sAlwaysShowableList.find(name) == sAlwaysShowableList.end()) - return 0;// + return nullptr;// LLFloater* instance = getInstance(name, key); if (instance) { @@ -268,7 +268,7 @@ bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key) { instance->closeHostedFloater(); } - return (instance != NULL); + return (instance != nullptr); } //static diff --git a/indra/llui/llflyoutbutton.cpp b/indra/llui/llflyoutbutton.cpp index 6e0d0b2db75f3af55ff52a0294efff70b39f5e01..d9908e76ee30cf55a33954af26880d0729e54895 100644 --- a/indra/llui/llflyoutbutton.cpp +++ b/indra/llui/llflyoutbutton.cpp @@ -37,8 +37,8 @@ const S32 FLYOUT_BUTTON_ARROW_WIDTH = 24; LLFlyoutButton::LLFlyoutButton(const Params& p) : LLComboBox(p), - mToggleState(FALSE), - mActionButton(NULL) + mActionButton(nullptr), + mToggleState(FALSE) { // Always use text box // Text label button diff --git a/indra/llui/llflyoutbutton.h b/indra/llui/llflyoutbutton.h index 36998eba2e42a7a62ed64100cbd62ff3e79f93a1..b8e240234f0a726731e0f12a515b4f6c81819f14 100644 --- a/indra/llui/llflyoutbutton.h +++ b/indra/llui/llflyoutbutton.h @@ -54,7 +54,7 @@ protected: LLFlyoutButton(const Params&); friend class LLUICtrlFactory; public: - virtual void draw(); + void draw() override; void setToggleState(BOOL state); diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index ff38fe4691884e0c2dcb7cecb225d248ad9e5f0b..d4ca3a95df5b6c447091a6f1fd41ea27d152ad45 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -35,10 +35,10 @@ const F32 FOCUS_FADE_TIME = 0.3f; LLFocusableElement::LLFocusableElement() -: mFocusLostCallback(NULL), - mFocusReceivedCallback(NULL), - mFocusChangedCallback(NULL), - mTopLostCallback(NULL) +: mFocusLostCallback(nullptr), + mFocusReceivedCallback(nullptr), + mFocusChangedCallback(nullptr), + mTopLostCallback(nullptr) { } @@ -146,13 +146,13 @@ struct LLFocusMgr::Impl LLFocusMgr gFocusMgr; LLFocusMgr::LLFocusMgr() -: mLockedView( NULL ), - mMouseCaptor( NULL ), - mKeyboardFocus( NULL ), - mLastKeyboardFocus( NULL ), - mDefaultKeyboardFocus( NULL ), +: mLockedView(nullptr ), + mMouseCaptor(nullptr ), + mKeyboardFocus(nullptr ), + mLastKeyboardFocus(nullptr ), + mDefaultKeyboardFocus(nullptr ), mKeystrokesOnly(FALSE), - mTopCtrl( NULL ), + mTopCtrl(nullptr ), mAppHasFocus(TRUE), // Macs don't seem to notify us that we've gotten focus, so default to true mImpl(new LLFocusMgr::Impl) { @@ -162,22 +162,22 @@ LLFocusMgr::~LLFocusMgr() { mImpl->mFocusHistory.clear(); delete mImpl; - mImpl = NULL; + mImpl = nullptr; } void LLFocusMgr::releaseFocusIfNeeded( LLView* view ) { if( childHasMouseCapture( view ) ) { - setMouseCapture( NULL ); + setMouseCapture(nullptr ); } if( childHasKeyboardFocus( view )) { if (view == mLockedView) { - mLockedView = NULL; - setKeyboardFocus( NULL ); + mLockedView = nullptr; + setKeyboardFocus(nullptr ); } else { @@ -197,7 +197,7 @@ void LLFocusMgr::setKeyboardFocus(LLFocusableElement* new_focus, BOOL lock, BOOL focus_dirty = false; if (mLockedView && - (new_focus == NULL || + (new_focus == nullptr || (new_focus != mLockedView && dynamic_cast<LLView*>(new_focus) && !dynamic_cast<LLView*>(new_focus)->hasAncestor(mLockedView)))) @@ -269,7 +269,7 @@ void LLFocusMgr::setKeyboardFocus(LLFocusableElement* new_focus, BOOL lock, BOOL // If we've got a default keyboard focus, and the caller is // releasing keyboard focus, move to the default. - if (mDefaultKeyboardFocus != NULL && mKeyboardFocus == NULL) + if (mDefaultKeyboardFocus != nullptr && mKeyboardFocus == nullptr) { mDefaultKeyboardFocus->setFocus(TRUE); } @@ -321,7 +321,7 @@ BOOL LLFocusMgr::childHasKeyboardFocus(const LLView* parent ) const // Returns TRUE is parent or any descedent of parent is the mouse captor. BOOL LLFocusMgr::childHasMouseCapture( const LLView* parent ) const { - if( mMouseCaptor && dynamic_cast<LLView*>(mMouseCaptor) != NULL ) + if( mMouseCaptor && dynamic_cast<LLView*>(mMouseCaptor) != nullptr ) { LLView* captor_view = (LLView*)mMouseCaptor; while( captor_view ) @@ -342,12 +342,12 @@ void LLFocusMgr::removeKeyboardFocusWithoutCallback( const LLFocusableElement* f // in order to unlock it if (focus == mLockedView) { - mLockedView = NULL; + mLockedView = nullptr; } if( mKeyboardFocus == focus ) { - mKeyboardFocus = NULL; + mKeyboardFocus = nullptr; } } @@ -397,7 +397,7 @@ void LLFocusMgr::removeMouseCaptureWithoutCallback( const LLMouseHandler* captor { if( mMouseCaptor == captor ) { - mMouseCaptor = NULL; + mMouseCaptor = nullptr; } } @@ -437,7 +437,7 @@ void LLFocusMgr::removeTopCtrlWithoutCallback( const LLUICtrl* top_view ) { if( mTopCtrl == top_view ) { - mTopCtrl = NULL; + mTopCtrl = nullptr; } } @@ -448,7 +448,7 @@ void LLFocusMgr::lockFocus() void LLFocusMgr::unlockFocus() { - mLockedView = NULL; + mLockedView = nullptr; } F32 LLFocusMgr::getFocusFlashAmt() const @@ -499,7 +499,7 @@ LLView* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const return found_it->second.get(); } } - return NULL; + return nullptr; } void LLFocusMgr::clearLastFocusForGroup(LLView* subtree_root) diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h index 0e3d7d8e590be9cef09dc713940e94daa3bbad8a..470021500346e359eb8b0d2325e055b6ea1000d8 100644 --- a/indra/llui/llfocusmgr.h +++ b/indra/llui/llfocusmgr.h @@ -125,7 +125,7 @@ public: void releaseFocusIfNeeded( LLView* top_view ); void lockFocus(); void unlockFocus(); - BOOL focusLocked() const { return mLockedView != NULL; } + BOOL focusLocked() const { return mLockedView != nullptr; } bool keyboardFocusHasAccelerators() const; diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index fe86ec429b2e34bdbaf9a6e09eb01e0e91e6f53e..898897d8945998a16bc5e78e96acdc042f5e306d 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -88,8 +88,8 @@ class LLCloseAllFoldersFunctor : public LLFolderViewFunctor public: LLCloseAllFoldersFunctor(BOOL close) { mOpen = !close; } virtual ~LLCloseAllFoldersFunctor() {} - virtual void doFolder(LLFolderViewFolder* folder); - virtual void doItem(LLFolderViewItem* item); + void doFolder(LLFolderViewFolder* folder) override; + void doItem(LLFolderViewItem* item) override; BOOL mOpen; }; @@ -149,31 +149,31 @@ LLFolderView::Params::Params() // Default constructor LLFolderView::LLFolderView(const Params& p) : LLFolderViewFolder(p), - mScrollContainer( NULL ), + mScrollContainer(nullptr ), mPopupMenuHandle(), mAllowMultiSelect(p.allow_multiselect), mShowEmptyMessage(p.show_empty_message), mShowFolderHierarchy(FALSE), - mRenameItem( NULL ), mNeedsScroll( FALSE ), - mUseLabelSuffix(p.use_label_suffix), mPinningSelectedItem(FALSE), mNeedsAutoSelect( FALSE ), mAutoSelectOverride(FALSE), mNeedsAutoRename(FALSE), + mUseLabelSuffix(p.use_label_suffix), + mDragAndDropThisFrame(FALSE), + mShowItemLinkOverlays(p.show_item_link_overlays), mShowSelectionContext(FALSE), mShowSingleSelection(FALSE), + mRenameItem(nullptr ), mArrangeGeneration(0), mSignalSelectCallback(0), mMinWidth(0), - mDragAndDropThisFrame(FALSE), - mCallbackRegistrar(NULL), - mUseEllipses(p.use_ellipses), - mDraggingOverItem(NULL), - mStatusTextBox(NULL), - mShowItemLinkOverlays(p.show_item_link_overlays), mViewModel(p.view_model), - mGroupedItemModel(p.grouped_item_model) + mGroupedItemModel(p.grouped_item_model), + mUseEllipses(p.use_ellipses), + mDraggingOverItem(nullptr), + mCallbackRegistrar(nullptr), + mStatusTextBox(nullptr) { claimMem(mViewModel); LLPanel* panel = p.parent_panel; @@ -186,7 +186,7 @@ LLFolderView::LLFolderView(const Params& p) setRect( rect ); reshape(rect.getWidth(), rect.getHeight()); mAutoOpenItems.setDepth(AUTO_OPEN_STACK_DEPTH); - mAutoOpenCandidate = NULL; + mAutoOpenCandidate = nullptr; mAutoOpenTimer.stop(); mKeyboardSelection = FALSE; mIndentation = getParentFolder() ? getParentFolder()->getIndentation() + mLocalIndentation : 0; @@ -254,10 +254,10 @@ LLFolderView::~LLFolderView( void ) // destroyed scollcontainer. Just null it out here, and no worries // about calling into the invalid scroll container. // Same with the renamer. - mScrollContainer = NULL; - mRenameItem = NULL; - mRenamer = NULL; - mStatusTextBox = NULL; + mScrollContainer = nullptr; + mRenameItem = nullptr; + mRenamer = nullptr; + mStatusTextBox = nullptr; if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die(); @@ -267,7 +267,7 @@ LLFolderView::~LLFolderView( void ) mFolders.clear(); //mViewModel->setFolderView(NULL); - mViewModel = NULL; + mViewModel = nullptr; } BOOL LLFolderView::canFocusChildren() const @@ -411,7 +411,7 @@ LLFolderViewItem* LLFolderView::getCurSelectedItem( void ) llassert(itemp->getIsCurSelection()); return itemp; } - return NULL; + return nullptr; } LLFolderView::selected_items_t& LLFolderView::getSelectedItems( void ) @@ -513,7 +513,7 @@ void LLFolderView::sanitizeSelection() // ensure that each ancestor is open and potentially passes filtering BOOL visible = false; - if(item->getViewModelItem() != NULL) + if(item->getViewModelItem() != nullptr) { visible = item->getViewModelItem()->potentiallyVisible(); // initialize from filter state for this item } @@ -567,7 +567,7 @@ void LLFolderView::sanitizeSelection() if (mSelectedItems.empty()) { // ...select first available parent of original selection - LLFolderViewItem* new_selection = NULL; + LLFolderViewItem* new_selection = nullptr; if (original_selected_item) { for(LLFolderViewFolder* parent_folder = original_selected_item->getParentFolder(); @@ -593,7 +593,7 @@ void LLFolderView::sanitizeSelection() } else { - new_selection = NULL; + new_selection = nullptr; } if (new_selection) @@ -642,7 +642,7 @@ bool LLFolderView::startDrag() void LLFolderView::commitRename( const LLSD& data ) { finishRenamingItem(); - arrange( NULL, NULL ); + arrange(nullptr, nullptr ); } @@ -743,14 +743,14 @@ void LLFolderView::removeSelectedItems() if(getVisible() && getEnabled()) { // just in case we're removing the renaming item. - mRenameItem = NULL; + mRenameItem = nullptr; // create a temporary structure which we will use to remove // items, since the removal will futz with internal data // structures. std::vector<LLFolderViewItem*> items; if(mSelectedItems.empty()) return; - LLFolderViewItem* item = NULL; + LLFolderViewItem* item = nullptr; selected_items_t::iterator item_it; for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) { @@ -852,7 +852,7 @@ void LLFolderView::closeAutoOpenedFolders() { mAutoOpenCandidate->setAutoOpenCountdown(0.f); } - mAutoOpenCandidate = NULL; + mAutoOpenCandidate = nullptr; mAutoOpenTimer.stop(); } @@ -912,7 +912,7 @@ void LLFolderView::copy() S32 count = mSelectedItems.size(); if(getVisible() && getEnabled() && (count > 0)) { - LLFolderViewModelItem* listener = NULL; + LLFolderViewModelItem* listener = nullptr; selected_items_t::iterator item_it; for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) { @@ -1018,7 +1018,7 @@ void LLFolderView::paste() { LLFolderViewItem* item = *selected_it; LLFolderViewFolder* folder = dynamic_cast<LLFolderViewFolder*>(item); - if (folder == NULL) + if (folder == nullptr) { folder = item->getParentFolder(); } @@ -1045,7 +1045,7 @@ void LLFolderView::startRenamingSelectedItem( void ) scrollToShowSelection(); S32 count = mSelectedItems.size(); - LLFolderViewItem* item = NULL; + LLFolderViewItem* item = nullptr; if(count > 0) { item = mSelectedItems.front(); @@ -1359,7 +1359,7 @@ BOOL LLFolderView::search(LLFolderViewItem* first_item, const std::string &searc if (!search_item) { // start from first item - search_item = getNextFromChild(NULL); + search_item = getNextFromChild(nullptr); } // search over all open nodes for first substring match (with wrapping) @@ -1372,11 +1372,11 @@ BOOL LLFolderView::search(LLFolderViewItem* first_item, const std::string &searc { if (backward) { - search_item = getPreviousFromChild(NULL); + search_item = getPreviousFromChild(nullptr); } else { - search_item = getNextFromChild(NULL); + search_item = getNextFromChild(nullptr); } if (!search_item || search_item == original_search_item) { @@ -1425,7 +1425,7 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) // this way, we know when to stop auto-updating a search mParentPanel.get()->setFocus(TRUE); - BOOL handled = childrenHandleRightMouseDown(x, y, mask) != NULL; + BOOL handled = childrenHandleRightMouseDown(x, y, mask) != nullptr; S32 count = mSelectedItems.size(); LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get(); if ( handled @@ -1452,7 +1452,7 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) { menu->setVisible(FALSE); } - setSelection(NULL, FALSE, TRUE); + setSelection(nullptr, FALSE, TRUE); } return handled; } @@ -1461,7 +1461,7 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) BOOL LLFolderView::addNoOptions(LLMenuGL* menu) const { const std::string nooptions_str = "--no options--"; - LLView *nooptions_item = NULL; + LLView *nooptions_item = nullptr; const LLView::child_list_t *list = menu->getChildList(); for (LLView::child_list_t::const_iterator itor = list->begin(); @@ -1518,10 +1518,10 @@ void LLFolderView::deleteAllChildren() closeRenamer(); if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die(); mPopupMenuHandle.markDead(); - mScrollContainer = NULL; - mRenameItem = NULL; - mRenamer = NULL; - mStatusTextBox = NULL; + mScrollContainer = nullptr; + mRenameItem = nullptr; + mRenamer = nullptr; + mStatusTextBox = nullptr; clearSelection(); LLView::deleteAllChildren(); @@ -1616,7 +1616,7 @@ void LLFolderView::update() LL_RECORD_BLOCK_TIME(FTM_INVENTORY); // If there's no model, the view is in suspended state (being deleted) and shouldn't be updated - if (getFolderViewModel() == NULL) + if (getFolderViewModel() == nullptr) { return; } @@ -1864,7 +1864,7 @@ bool LLFolderView::selectFirstItem() LLFolderViewFolder* folder = (*iter ); if (folder->getVisible()) { - LLFolderViewItem* itemp = folder->getNextFromChild(0,true); + LLFolderViewItem* itemp = folder->getNextFromChild(nullptr,true); if(itemp) setSelection(itemp,FALSE,TRUE); return true; @@ -1901,7 +1901,7 @@ bool LLFolderView::selectLastItem() LLFolderViewFolder* folder = (*iter); if (folder->getVisible()) { - LLFolderViewItem* itemp = folder->getPreviousFromChild(0,true); + LLFolderViewItem* itemp = folder->getPreviousFromChild(nullptr,true); if(itemp) setSelection(itemp,FALSE,TRUE); return true; @@ -1953,7 +1953,7 @@ void LLFolderView::onRenamerLost() if( mRenameItem ) { setSelection( mRenameItem, TRUE ); - mRenameItem = NULL; + mRenameItem = nullptr; } } diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 3083c0178611f7f008644e183dbd7d71d39a0277..e44f1c9288d527b423c5e5898ce3cb6b43d9acdc 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -67,7 +67,7 @@ class LLFolderViewScrollContainer : public LLScrollContainer { public: /*virtual*/ ~LLFolderViewScrollContainer() {}; - /*virtual*/ const LLRect getScrolledViewRect() const; + /*virtual*/ const LLRect getScrolledViewRect() const override; protected: LLFolderViewScrollContainer(const LLScrollContainer::Params& p); @@ -107,10 +107,10 @@ public: LLFolderView(const Params&); virtual ~LLFolderView( void ); - virtual BOOL canFocusChildren() const; + BOOL canFocusChildren() const override; - virtual const LLFolderView* getRoot() const { return this; } - virtual LLFolderView* getRoot() { return this; } + const LLFolderView* getRoot() const override { return this; } + LLFolderView* getRoot() override { return this; } LLFolderViewModelInterface* getFolderViewModel() { return mViewModel; } const LLFolderViewModelInterface* getFolderViewModel() const { return mViewModel; } @@ -129,12 +129,12 @@ public: void openAllFolders(); // <alchemy/> void openTopLevelFolders(); - virtual void addFolder( LLFolderViewFolder* folder); + void addFolder( LLFolderViewFolder* folder) override; // Find width and height of this object and its children. Also // makes sure that this view and its children are the right size. - virtual S32 arrange( S32* width, S32* height ); - virtual S32 getItemHeight(); + S32 arrange( S32* width, S32* height ) override; + S32 getItemHeight() override; void arrangeAll() { mArrangeGeneration++; } S32 getArrangeGeneration() { return mArrangeGeneration; } @@ -147,14 +147,14 @@ public: selected_items_t& getSelectedItems( void ); // Record the selected item and pass it down the hierarchy. - virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, - BOOL take_keyboard_focus = TRUE); + BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, + BOOL take_keyboard_focus = TRUE) override; // This method is used to toggle the selection of an item. Walks // children, and keeps track of selected objects. - virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected); + BOOL changeSelection(LLFolderViewItem* selection, BOOL selected) override; - virtual std::set<LLFolderViewItem*> getSelectionList() const; + std::set<LLFolderViewItem*> getSelectionList() const override; // Make sure if ancestor is selected, descendants are not void sanitizeSelection(); @@ -173,17 +173,17 @@ public: void autoOpenItem(LLFolderViewFolder* item); void closeAutoOpenedFolders(); BOOL autoOpenTest(LLFolderViewFolder* item); - BOOL isOpen() const { return TRUE; } // root folder always open + BOOL isOpen() const override { return TRUE; } // root folder always open // Copy & paste - virtual BOOL canCopy() const; - virtual void copy(); + BOOL canCopy() const override; + void copy() override; - virtual BOOL canCut() const; - virtual void cut(); + BOOL canCut() const override; + void cut() override; - virtual BOOL canPaste() const; - virtual void paste(); + BOOL canPaste() const override; + void paste() override; LLFolderViewItem* getNextUnselectedItem(); @@ -192,21 +192,21 @@ public: // LLView functionality ///*virtual*/ BOOL handleKey( KEY key, MASK mask, BOOL called_from_parent ); - /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ); - /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); - /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ); + /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ) override; + /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char) override; + /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + /*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask ) override; + /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ) override; + /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ) override; /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) { setShowSelectionContext(FALSE); } - virtual void draw(); - virtual void deleteAllChildren(); + std::string& tooltip_msg) override; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override { setShowSelectionContext(FALSE); } + void draw() override; + void deleteAllChildren() override; void scrollToShowSelection(); void scrollToShowItem(LLFolderViewItem* item, const LLRect& constraint_rect); @@ -238,7 +238,7 @@ public: // DEBUG only void dumpSelectionInformation(); - virtual S32 notify(const LLSD& info) ; + S32 notify(const LLSD& info) override; bool useLabelSuffix() { return mUseLabelSuffix; } virtual void updateMenu(); @@ -361,8 +361,8 @@ class LLSelectFirstFilteredItem : public LLFolderViewFunctor public: LLSelectFirstFilteredItem() : mItemSelected(FALSE), mFolderSelected(FALSE) {} virtual ~LLSelectFirstFilteredItem() {} - virtual void doFolder(LLFolderViewFolder* folder); - virtual void doItem(LLFolderViewItem* item); + void doFolder(LLFolderViewFolder* folder) override; + void doItem(LLFolderViewItem* item) override; BOOL wasItemSelected() { return mItemSelected || mFolderSelected; } protected: BOOL mItemSelected; @@ -374,8 +374,8 @@ class LLOpenFilteredFolders : public LLFolderViewFunctor public: LLOpenFilteredFolders() {} virtual ~LLOpenFilteredFolders() {} - virtual void doFolder(LLFolderViewFolder* folder); - virtual void doItem(LLFolderViewItem* item); + void doFolder(LLFolderViewFolder* folder) override; + void doItem(LLFolderViewItem* item) override; }; class LLSaveFolderState : public LLFolderViewFunctor @@ -383,8 +383,8 @@ class LLSaveFolderState : public LLFolderViewFunctor public: LLSaveFolderState() : mApply(FALSE) {} virtual ~LLSaveFolderState() {} - virtual void doFolder(LLFolderViewFolder* folder); - virtual void doItem(LLFolderViewItem* item) {} + void doFolder(LLFolderViewFolder* folder) override; + void doItem(LLFolderViewItem* item) override {} void setApply(BOOL apply); void clearOpenFolders() { mOpenFolders.clear(); } protected: @@ -397,8 +397,8 @@ class LLOpenFoldersWithSelection : public LLFolderViewFunctor public: LLOpenFoldersWithSelection() {} virtual ~LLOpenFoldersWithSelection() {} - virtual void doFolder(LLFolderViewFolder* folder); - virtual void doItem(LLFolderViewItem* item); + void doFolder(LLFolderViewFolder* folder) override; + void doItem(LLFolderViewItem* item) override; }; // Flags for buildContextMenu() diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 8cf43276c5f5c035d5843abe4f61da5c204d813c..11e60b32ce4c25a777eb4d81fa4fe536460913c8 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -98,11 +98,11 @@ void LLFolderViewItem::cleanupClass() // NOTE: Optimize this, we call it a *lot* when opening a large inventory LLFolderViewItem::Params::Params() -: root(), +: folder_arrow_image("folder_arrow_image"), + selection_image("selection_image"), + root(), listener(), - folder_arrow_image("folder_arrow_image"), folder_indentation("folder_indentation"), - selection_image("selection_image"), item_height("item_height"), item_top_pad("item_top_pad"), creation_date(), @@ -122,38 +122,38 @@ LLFolderViewItem::Params::Params() // Default constructor LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) : LLView(p), + mLabel(p.name), mLabelWidth(0), - mLabelWidthDirty(false), - mLabelPaddingRight(DEFAULT_LABEL_PADDING_RIGHT), - mParentFolder( NULL ), - mIsSelected( FALSE ), - mIsCurSelection( FALSE ), - mSelectPending(FALSE), - mIsItemCut(false), - mCutGeneration(0), + mLabelWidthDirty(false), + mLabelPaddingRight(DEFAULT_LABEL_PADDING_RIGHT), + mParentFolder(nullptr ), + mViewModelItem(p.listener), mLabelStyle( LLFontGL::NORMAL ), - mHasVisibleChildren(FALSE), - mIsFolderComplete(true), - mLocalIndentation(p.folder_indentation), + mLocalIndentation(p.folder_indentation), mIndentation(0), mItemHeight(p.item_height), + mLeftPad(p.left_pad), + mIconPad(p.icon_pad), + mIconWidth(p.icon_width), + mTextPad(p.text_pad), + mTextPadRight(p.text_pad_right), + mArrowSize(p.arrow_size), + mMaxFolderItemOverlap(p.max_folder_item_overlap), mControlLabelRotation(0.f), - mDragAndDropTarget(FALSE), - mLabel(p.name), mRoot(p.root), - mViewModelItem(p.listener), + mHasVisibleChildren(FALSE), + mIsFolderComplete(true), + mIsCurSelection( FALSE ), + mDragAndDropTarget(FALSE), mIsMouseOverTitle(false), mAllowWear(p.allow_wear), mAllowDrop(p.allow_drop), - mFontColor(p.font_color), - mFontHighlightColor(p.font_highlight_color), - mLeftPad(p.left_pad), - mIconPad(p.icon_pad), - mIconWidth(p.icon_width), - mTextPad(p.text_pad), - mTextPadRight(p.text_pad_right), - mArrowSize(p.arrow_size), - mMaxFolderItemOverlap(p.max_folder_item_overlap) + mSelectPending(FALSE), + mIsItemCut(false), + mCutGeneration(0), + mFontColor(p.font_color), + mFontHighlightColor(p.font_highlight_color), + mIsSelected( FALSE ) { if (!sColorSetInitialized) { @@ -178,7 +178,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) // Destroys the object LLFolderViewItem::~LLFolderViewItem() { - mViewModelItem = NULL; + mViewModelItem = nullptr; } BOOL LLFolderViewItem::postBuild() @@ -216,7 +216,7 @@ LLFolderViewItem* LLFolderViewItem::getNextOpenNode(BOOL include_children) { if (!mParentFolder) { - return NULL; + return nullptr; } LLFolderViewItem* itemp = mParentFolder->getNextFromChild( this, include_children ); @@ -238,7 +238,7 @@ LLFolderViewItem* LLFolderViewItem::getPreviousOpenNode(BOOL include_children) { if (!mParentFolder) { - return NULL; + return nullptr; } LLFolderViewItem* itemp = mParentFolder->getPreviousFromChild( this, include_children ); @@ -563,13 +563,13 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) && root->startDrag()) { // RN: when starting drag and drop, clear out last auto-open - root->autoOpenTest(NULL); + root->autoOpenTest(nullptr); root->setShowSelectionContext(TRUE); // Release keyboard focus, so that if stuff is dropped into the // world, pressing the delete key won't blow away the inventory // item. - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); getWindow()->setCursor(UI_CURSOR_ARROW); } @@ -629,7 +629,7 @@ BOOL LLFolderViewItem::handleMouseUp( S32 x, S32 y, MASK mask ) { getRoot()->setShowSelectionContext(FALSE); } - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); } return TRUE; } @@ -662,7 +662,7 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, // store this item to get it in LLFolderBridge::dragItemIntoFolder on drop event. mRoot->setDraggingOverItem(this); handled = mParentFolder->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg); - mRoot->setDraggingOverItem(NULL); + mRoot->setDraggingOverItem(nullptr); } if (handled) { @@ -1275,7 +1275,7 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, BOOL selec LLFolderViewFolder* LLFolderViewFolder::getCommonAncestor(LLFolderViewItem* item_a, LLFolderViewItem* item_b, bool& reverse) { - if (!item_a->getParentFolder() || !item_b->getParentFolder()) return NULL; + if (!item_a->getParentFolder() || !item_b->getParentFolder()) return nullptr; std::deque<LLFolderViewFolder*> item_a_ancestors; @@ -1360,12 +1360,12 @@ LLFolderViewFolder* LLFolderViewFolder::getCommonAncestor(LLFolderViewItem* item item_b_ancestors.pop_front(); } - return NULL; + return nullptr; } void LLFolderViewFolder::gatherChildRangeExclusive(LLFolderViewItem* start, LLFolderViewItem* end, bool reverse, std::vector<LLFolderViewItem*>& items) { - bool selecting = start == NULL; + bool selecting = start == nullptr; if (reverse) { for (items_t::reverse_iterator it = mItems.rbegin(), end_it = mItems.rend(); @@ -1454,7 +1454,7 @@ void LLFolderViewFolder::extendSelectionTo(LLFolderViewItem* new_selection) if (getRoot()->getAllowMultiSelect() == FALSE) return; LLFolderViewItem* cur_selected_item = getRoot()->getCurSelectedItem(); - if (cur_selected_item == NULL) + if (cur_selected_item == nullptr) { cur_selected_item = new_selection; } @@ -1471,7 +1471,7 @@ void LLFolderViewFolder::extendSelectionTo(LLFolderViewItem* new_selection) while(cur_folder != common_ancestor) { - cur_folder->gatherChildRangeExclusive(last_selected_item_from_cur, NULL, reverse, items_to_select_forward); + cur_folder->gatherChildRangeExclusive(last_selected_item_from_cur, nullptr, reverse, items_to_select_forward); last_selected_item_from_cur = cur_folder; cur_folder = cur_folder->getParentFolder(); @@ -1483,7 +1483,7 @@ void LLFolderViewFolder::extendSelectionTo(LLFolderViewItem* new_selection) cur_folder = new_selection->getParentFolder(); while(cur_folder != common_ancestor) { - cur_folder->gatherChildRangeExclusive(last_selected_item_from_new, NULL, !reverse, items_to_select_reverse); + cur_folder->gatherChildRangeExclusive(last_selected_item_from_new, nullptr, !reverse, items_to_select_reverse); last_selected_item_from_new = cur_folder; cur_folder = cur_folder->getParentFolder(); @@ -1770,7 +1770,7 @@ BOOL LLFolderViewFolder::handleDragAndDropFromChild(MASK mask, } // drag and drop to child item, so clear pending auto-opens - getRoot()->autoOpenTest(NULL); + getRoot()->autoOpenTest(nullptr); return TRUE; } @@ -1826,7 +1826,7 @@ BOOL LLFolderViewFolder::handleDragAndDrop(S32 x, S32 y, MASK mask, if (isOpen()) { - handled = (childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) != NULL); + handled = (childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) != nullptr); } if (!handled) @@ -1880,7 +1880,7 @@ BOOL LLFolderViewFolder::handleRightMouseDown( S32 x, S32 y, MASK mask ) if( isOpen() ) { - handled = childrenHandleRightMouseDown( x, y, mask ) != NULL; + handled = childrenHandleRightMouseDown( x, y, mask ) != nullptr; } if (!handled) { @@ -1910,7 +1910,7 @@ BOOL LLFolderViewFolder::handleMouseDown( S32 x, S32 y, MASK mask ) BOOL handled = FALSE; if( isOpen() ) { - handled = childrenHandleMouseDown(x,y,mask) != NULL; + handled = childrenHandleMouseDown(x,y,mask) != nullptr; } if( !handled ) { @@ -1934,7 +1934,7 @@ BOOL LLFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask ) BOOL handled = FALSE; if( isOpen() ) { - handled = childrenHandleDoubleClick( x, y, mask ) != NULL; + handled = childrenHandleDoubleClick( x, y, mask ) != nullptr; } if( !handled ) { @@ -1974,9 +1974,9 @@ LLFolderViewItem* LLFolderViewFolder::getNextFromChild( LLFolderViewItem* item, { BOOL found_item = FALSE; - LLFolderViewItem* result = NULL; + LLFolderViewItem* result = nullptr; // when not starting from a given item, start at beginning - if(item == NULL) + if(item == nullptr) { found_item = TRUE; } @@ -2001,7 +2001,7 @@ LLFolderViewItem* LLFolderViewFolder::getNextFromChild( LLFolderViewItem* item, if (include_children && (*fit)->isOpen()) { // look for first descendant - return (*fit)->getNextFromChild(NULL, TRUE); + return (*fit)->getNextFromChild(nullptr, TRUE); } // otherwise advance to next folder ++fit; @@ -2031,7 +2031,7 @@ LLFolderViewItem* LLFolderViewFolder::getNextFromChild( LLFolderViewItem* item, // you should never call this method with an item that isn't a child // so we should always find something llassert(FALSE); - return NULL; + return nullptr; } // at this point, either iit or fit point to a candidate "next" item @@ -2079,9 +2079,9 @@ LLFolderViewItem* LLFolderViewFolder::getPreviousFromChild( LLFolderViewItem* it { BOOL found_item = FALSE; - LLFolderViewItem* result = NULL; + LLFolderViewItem* result = nullptr; // when not starting from a given item, start at end - if(item == NULL) + if(item == nullptr) { found_item = TRUE; } @@ -2129,7 +2129,7 @@ LLFolderViewItem* LLFolderViewFolder::getPreviousFromChild( LLFolderViewItem* it // you should never call this method with an item that isn't a child // so we should always find something llassert(FALSE); - return NULL; + return nullptr; } // at this point, either iit or fit point to a candidate "next" item @@ -2161,7 +2161,7 @@ LLFolderViewItem* LLFolderViewFolder::getPreviousFromChild( LLFolderViewItem* it // try selecting child element of this folder if ((*fit)->isOpen() && include_children) { - result = (*fit)->getPreviousFromChild(NULL); + result = (*fit)->getPreviousFromChild(nullptr); } else { diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index 1b2a47d31ccf7179ad16af5234e99639a2787fbd..e34c71af2d485d67281210800dbf534ec9089b30 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -160,7 +160,7 @@ public: static void initClass(); static void cleanupClass(); - BOOL postBuild(); + BOOL postBuild() override; virtual void openItem( void ); @@ -230,7 +230,7 @@ public: // This method returns the actual name of the thing being // viewed. This method will ask the viewed object itself. - const std::string& getName( void ) const; + const std::string& getName( void ) const override; // This method returns the label displayed on the view. This // method was primarily added to allow sorting on the folder @@ -270,26 +270,26 @@ public: virtual void refresh(); // LLView functionality - virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleHover( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); - virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); + BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ) override; + BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + BOOL handleHover( S32 x, S32 y, MASK mask ) override; + BOOL handleMouseUp( S32 x, S32 y, MASK mask ) override; + BOOL handleDoubleClick( S32 x, S32 y, MASK mask ) override; - virtual void onMouseLeave(S32 x, S32 y, MASK mask); + void onMouseLeave(S32 x, S32 y, MASK mask) override; //virtual LLView* findChildView(const std::string& name, BOOL recurse) const { return LLView::findChildView(name, recurse); } // virtual void handleDropped(); - virtual void draw(); + void draw() override; void drawOpenFolderArrow(const Params& default_params, const LLUIColor& fg_color); void drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &selectColor, const LLUIColor &flashColor, const LLUIColor &outlineColor, const LLUIColor &mouseOverColor); void drawLabel(const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x); - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; private: static std::map<U8, LLFontGL*> sFonts; // map of styles to fonts @@ -344,11 +344,11 @@ public: LLFolderViewItem* getPreviousFromChild( LLFolderViewItem*, BOOL include_children = TRUE ); // addToFolder() returns TRUE if it succeeds. FALSE otherwise - virtual void addToFolder(LLFolderViewFolder* folder); + void addToFolder(LLFolderViewFolder* folder) override; // Finds width and height of this object and it's children. Also // makes sure that this view and it's children are the right size. - virtual S32 arrange( S32* width, S32* height ); + S32 arrange( S32* width, S32* height ) override; BOOL needsArrange(); @@ -358,25 +358,25 @@ public: // selection information if necessary. // Returns TRUE if this object (or a child) ends up being selected. // If 'openitem' is TRUE then folders are opened up along the way to the selection. - virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus = TRUE); + BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus = TRUE) override; // This method is used to change the selection of an item. // Recursively traverse all children; if 'selection' is 'this' then change // the select status if necessary. // Returns TRUE if the selection state of this folder, or of a child, was changed. - virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected); + BOOL changeSelection(LLFolderViewItem* selection, BOOL selected) override; // this method is used to group select items void extendSelectionTo(LLFolderViewItem* selection); // Returns true is this object and all of its children can be removed. - virtual BOOL isRemovable(); + BOOL isRemovable() override; // Returns true is this object and all of its children can be moved - virtual BOOL isMovable(); + BOOL isMovable() override; // destroys this folder, and all children - virtual void destroyView(); + void destroyView() override; // extractItem() removes the specified item from the folder, but // doesn't delete it. @@ -392,7 +392,7 @@ public: virtual void toggleOpen(); // Force a folder open or closed - virtual void setOpen(BOOL openitem = TRUE); + void setOpen(BOOL openitem = TRUE) override; // Called when a child is refreshed. virtual void requestArrange(); @@ -404,7 +404,7 @@ public: virtual void setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse = RECURSE_NO); // Get the current state of the folder. - virtual BOOL isOpen() const { return mIsOpen; } + BOOL isOpen() const override { return mIsOpen; } // special case if an object is dropped on the child. BOOL handleDragAndDropFromChild(MASK mask, @@ -420,26 +420,26 @@ public: // apply this functor to the folder's descendants. void applyFunctorRecursively(LLFolderViewFunctor& functor); - virtual void openItem( void ); + void openItem( void ) override; // LLView functionality - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ) override; + BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + BOOL handleDoubleClick( S32 x, S32 y, MASK mask ) override; + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; BOOL handleDragAndDropToThisFolder(MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg); - virtual void draw(); + void draw() override; folders_t::iterator getFoldersBegin() { return mFolders.begin(); } folders_t::iterator getFoldersEnd() { return mFolders.end(); } @@ -455,8 +455,8 @@ public: // internal functions for tracking folders and items separately // use addToFolder() virtual method to ensure folders are always added to mFolders // and not mItems - void addItem(LLFolderViewItem* item); - void addFolder( LLFolderViewFolder* folder); + void addItem(LLFolderViewItem* item) override; + void addFolder( LLFolderViewFolder* folder) override; //WARNING: do not call directly...use the appropriate LLFolderViewModel-derived class instead template<typename SORT_FUNC> void sortFolders(const SORT_FUNC& func) { mFolders.sort(func); } diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index 2b2757ea0a65f3170f4253d2de4c2e82787b5687..d7b735e0636ec1a1e05f01bd2c427fc63480bfef 100644 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -42,21 +42,21 @@ LLIconCtrl::Params::Params() : image("image_name"), color("color"), use_draw_context_alpha("use_draw_context_alpha", true), - scale_image("scale_image"), min_width("min_width", 0), - min_height("min_height", 0) + min_height("min_height", 0), + scale_image("scale_image") {} LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p) : LLUICtrl(p), - mColor(p.color()), - mImagep(p.image), - mUseDrawContextAlpha(p.use_draw_context_alpha), mPriority(0), mMinWidth(p.min_width), mMinHeight(p.min_height), mMaxWidth(0), - mMaxHeight(0) + mMaxHeight(0), + mUseDrawContextAlpha(p.use_draw_context_alpha), + mColor(p.color()), + mImagep(p.image) { if (mImagep.notNull()) { @@ -66,7 +66,7 @@ LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p) LLIconCtrl::~LLIconCtrl() { - mImagep = NULL; + mImagep = nullptr; } diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index 491a09e46f04e1c2536c2a33f52e4537b39ff874..292319fad6569eb6a0f7a89a967d9abc3b743fa3 100644 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -67,14 +67,14 @@ public: virtual ~LLIconCtrl(); // llview overrides - virtual void draw(); + void draw() override; // lluictrl overrides - virtual void setValue(const LLSD& value ); + void setValue(const LLSD& value ) override; std::string getImageName() const; - void setColor(const LLColor4& color) { mColor = color; } + void setColor(const LLColor4& color) override { mColor = color; } void setImage(LLPointer<LLUIImage> image) { mImagep = image; } const LLPointer<LLUIImage> getImage() { return mImagep; } diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 6fc73a885e80d04f09113de95d21a91487d16f8e..b0549a2e25e509e812e6c4648d037e551a2bab75 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -504,7 +504,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW if( *cur == '\n' ) { LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(cur-base); - text_segment->setToken( 0 ); + text_segment->setToken( nullptr ); insertSegment( *seg_list, text_segment, text_len, defaultColor, editor); cur++; if( !*cur || *cur == '\n' ) @@ -567,7 +567,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW // Check against delimiters { S32 seg_start = 0; - LLKeywordToken* cur_delimiter = NULL; + LLKeywordToken* cur_delimiter = nullptr; for (token_list_t::iterator iter = mDelimiterTokenList.begin(); iter != mDelimiterTokenList.end(); ++iter) { diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 1472033e315db0ba1503d615fb9a95c16109d264..8ab097583793fffbbf50732b1a5bc58828b80c30 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -60,18 +60,18 @@ LLLayoutPanel::Params::Params() LLLayoutPanel::LLLayoutPanel(const Params& p) : LLPanel(p), - mExpandedMinDim(p.expanded_min_dim.isProvided() ? p.expanded_min_dim : p.min_dim), - mMinDim(p.min_dim), - mAutoResize(p.auto_resize), - mUserResize(p.user_resize), + mAutoResize(p.auto_resize), + mUserResize(p.user_resize), + mExpandedMinDim(p.expanded_min_dim.isProvided() ? p.expanded_min_dim : p.min_dim), + mMinDim(p.min_dim), mCollapsed(FALSE), - mCollapseAmt(0.f), - mVisibleAmt(1.f), // default to fully visible - mResizeBar(NULL), + mVisibleAmt(1.f), + mCollapseAmt(0.f), // default to fully visible mFractionalSize(0.f), mTargetDim(0), mIgnoreReshape(false), - mOrientation(LLLayoutStack::HORIZONTAL) + mOrientation(LLLayoutStack::HORIZONTAL), + mResizeBar(nullptr) { // panels initialized as hidden should not start out partially visible if (!getVisible()) @@ -91,7 +91,7 @@ LLLayoutPanel::~LLLayoutPanel() { // probably not necessary, but... delete mResizeBar; - mResizeBar = NULL; + mResizeBar = nullptr; } F32 LLLayoutPanel::getAutoResizeFactor() const @@ -207,12 +207,12 @@ void LLLayoutPanel::handleReshape(const LLRect& new_rect, bool by_user) LLLayoutStack::Params::Params() : orientation("orientation"), + border_size("border_size", LLCachedControl<S32>(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0)), animate("animate", true), clip("clip", true), open_time_constant("open_time_constant", 0.02f), close_time_constant("close_time_constant", 0.03f), resize_bar_overlap("resize_bar_overlap", 1), - border_size("border_size", LLCachedControl<S32>(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0)), show_drag_handle("show_drag_handle", false), drag_handle_first_indent("drag_handle_first_indent", 0), drag_handle_second_indent("drag_handle_second_indent", 0), @@ -224,14 +224,14 @@ LLLayoutStack::Params::Params() LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) : LLView(p), - mPanelSpacing(p.border_size), mOrientation(p.orientation), - mAnimate(p.animate), + mPanelSpacing(p.border_size), mAnimatedThisFrame(false), - mNeedsLayout(true), + mAnimate(p.animate), mClip(p.clip), mOpenTimeConstant(p.open_time_constant), mCloseTimeConstant(p.close_time_constant), + mNeedsLayout(true), mResizeBarOverlap(p.resize_bar_overlap), mShowDragHandle(p.show_drag_handle), mDragHandleFirstIndent(p.drag_handle_first_indent), @@ -350,7 +350,7 @@ public: LLImagePanel(const Params& p) : LLPanel(p), mHorizontal(p.horizontal) {} virtual ~LLImagePanel() {} - void draw() + void draw() override { const LLRect& parent_rect = getParent()->getRect(); const LLRect& rect = getRect(); @@ -511,7 +511,7 @@ void LLLayoutStack::updateLayout() LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const { - if (!panelp) return NULL; + if (!panelp) return nullptr; for (LLLayoutPanel* p : mPanels) { @@ -520,12 +520,12 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const return p; } } - return NULL; + return nullptr; } LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) const { - LLLayoutPanel* result = NULL; + LLLayoutPanel* result = nullptr; for (LLLayoutPanel* p : mPanels) { @@ -543,7 +543,7 @@ void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp) { for (LLLayoutPanel* lp : mPanels) { - if (lp->mResizeBar == NULL) + if (lp->mResizeBar == nullptr) { LLResizeBar::Params resize_params; resize_params.name("resize"); @@ -806,8 +806,8 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& F32 delta_auto_resize_headroom = 0.f; F32 old_auto_resize_headroom = 0.f; - LLLayoutPanel* other_resize_panel = NULL; - LLLayoutPanel* following_panel = NULL; + LLLayoutPanel* other_resize_panel = nullptr; + LLLayoutPanel* following_panel = nullptr; for(LLLayoutPanel* panelp : boost::adaptors::reverse(mPanels)) { @@ -965,7 +965,7 @@ void LLLayoutStack::reshape(S32 width, S32 height, BOOL called_from_parent) void LLLayoutStack::updateResizeBarLimits() { - LLLayoutPanel* previous_visible_panelp = NULL; + LLLayoutPanel* previous_visible_panelp = nullptr; for(LLLayoutPanel* visible_panelp : boost::adaptors::reverse(mPanels)) { if (!visible_panelp->getVisible() || visible_panelp->mCollapsed) diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index e7af361878492a454a086bba4f12dfc2cd5087ed..2b19e3c53c74c11e5846d89b96f039fff49d575e 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -83,19 +83,21 @@ template class LLLineEditor* LLView::getChild<class LLLineEditor>( // LLLineEditor::Params::Params() -: max_length(""), - keystroke_callback("keystroke_callback"), +: default_text("default_text"), + max_length(""), + keystroke_callback("keystroke_callback"), prevalidate_callback("prevalidate_callback"), prevalidate_input_callback("prevalidate_input_callback"), + border(""), background_image("background_image"), background_image_disabled("background_image_disabled"), background_image_focused("background_image_focused"), - bg_image_always_focused("bg_image_always_focused", false), select_on_focus("select_on_focus", false), revert_on_esc("revert_on_esc", true), spellcheck("spellcheck", false), commit_on_focus_lost("commit_on_focus_lost", true), ignore_tab("ignore_tab", true), + bg_image_always_focused("bg_image_always_focused", false), is_password("is_password", false), cursor_color("cursor_color"), text_color("text_color"), @@ -103,11 +105,9 @@ LLLineEditor::Params::Params() text_tentative_color("text_tentative_color"), highlight_color("highlight_color"), preedit_bg_color("preedit_bg_color"), - border(""), - bg_visible("bg_visible"), text_pad_left("text_pad_left"), text_pad_right("text_pad_right"), - default_text("default_text") + bg_visible("bg_visible") { changeDefault(mouse_opaque, true); addSynonym(select_on_focus, "select_all_on_focus_received"); @@ -118,14 +118,17 @@ LLLineEditor::Params::Params() LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) : LLUICtrl(p), + mLabel(p.label), + mHaveHistory(FALSE), + mGLFont(p.font), mMaxLengthBytes(p.max_length.bytes), mMaxLengthChars(p.max_length.chars), mCursorPos( 0 ), - mScrollHPos( 0 ), - mTextPadLeft(p.text_pad_left), + mScrollHPos( 0 ), // computed in updateTextPadding() below + mTextPadLeft(p.text_pad_left), // computed in updateTextPadding() below mTextPadRight(p.text_pad_right), - mTextLeftEdge(0), // computed in updateTextPadding() below - mTextRightEdge(0), // computed in updateTextPadding() below + mTextLeftEdge(0), + mTextRightEdge(0), mCommitOnFocusLost( p.commit_on_focus_lost ), mRevertOnEsc( p.revert_on_esc ), mKeystrokeCallback( p.keystroke_callback() ), @@ -136,32 +139,29 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) mLastSelectionY(-1), mLastSelectionStart(-1), mLastSelectionEnd(-1), + mSpellCheck( p.spellcheck ), + mSpellCheckStart(-1), + mSpellCheckEnd(-1), + mCursorColor(p.cursor_color()), + mFgColor(p.text_color()), + mReadOnlyFgColor(p.text_readonly_color()), + mTentativeFgColor(p.text_tentative_color()), + mHighlightColor(p.highlight_color()), + mPreeditBgColor(p.preedit_bg_color()), mBorderThickness( 0 ), mIgnoreArrowKeys( FALSE ), mIgnoreTab( p.ignore_tab ), mDrawAsterixes( p.is_password ), - mSpellCheck( p.spellcheck ), - mSpellCheckStart(-1), - mSpellCheckEnd(-1), mSelectAllonFocusReceived( p.select_on_focus ), mSelectAllonCommit( TRUE ), mPassDelete(FALSE), mReadOnly(FALSE), + mShowImageFocused( p.bg_image_always_focused ), + mContextMenuHandle(), mBgImage( p.background_image ), mBgImageDisabled( p.background_image_disabled ), mBgImageFocused( p.background_image_focused ), - mShowImageFocused( p.bg_image_always_focused ), - mHaveHistory(FALSE), - mReplaceNewlinesWithSpaces( TRUE ), - mLabel(p.label), - mCursorColor(p.cursor_color()), - mFgColor(p.text_color()), - mReadOnlyFgColor(p.text_readonly_color()), - mTentativeFgColor(p.text_tentative_color()), - mHighlightColor(p.highlight_color()), - mPreeditBgColor(p.preedit_bg_color()), - mGLFont(p.font), - mContextMenuHandle() + mReplaceNewlinesWithSpaces( TRUE ) { llassert( mMaxLengthBytes > 0 ); @@ -217,7 +217,7 @@ LLLineEditor::~LLLineEditor() { menu->hide(); } - setContextMenu(NULL); + setContextMenu(nullptr); // calls onCommit() while LLLineEditor still valid gFocusMgr.releaseFocusIfNeeded( this ); @@ -252,7 +252,7 @@ void LLLineEditor::onFocusLost() if( gEditMenuHandler == this ) { - gEditMenuHandler = NULL; + gEditMenuHandler = nullptr; } getWindow()->showCursorFromMouseMove(); @@ -706,7 +706,7 @@ BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask) BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) { // Check first whether the "clear search" button wants to deal with this. - if(childrenHandleMouseDown(x, y, mask) != NULL) + if(childrenHandleMouseDown(x, y, mask) != nullptr) { return TRUE; } @@ -821,7 +821,7 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask) // Check first whether the "clear search" button wants to deal with this. if(!hasMouseCapture()) { - if(childrenHandleHover(x, y, mask) != NULL) + if(childrenHandleHover(x, y, mask) != nullptr) { return TRUE; } @@ -886,12 +886,12 @@ BOOL LLLineEditor::handleMouseUp(S32 x, S32 y, MASK mask) if( hasMouseCapture() ) { - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); handled = TRUE; } // Check first whether the "clear search" button wants to deal with this. - if(!handled && childrenHandleMouseUp(x, y, mask) != NULL) + if(!handled && childrenHandleMouseUp(x, y, mask) != nullptr) { return TRUE; } @@ -2210,7 +2210,7 @@ void LLLineEditor::setFocus( BOOL new_state ) // but limited paranoia is ok. if( gEditMenuHandler == this ) { - gEditMenuHandler = NULL; + gEditMenuHandler = nullptr; } endSelection(); @@ -2225,7 +2225,7 @@ void LLLineEditor::setFocus( BOOL new_state ) // fine on 1.15.0.2, since all prevalidate func reject any // non-ASCII characters. I'm not sure on future versions, // however. - getWindow()->allowLanguageTextInput(this, mPrevalidateFunc == NULL); + getWindow()->allowLanguageTextInput(this, mPrevalidateFunc == nullptr); } } @@ -2405,7 +2405,7 @@ void LLLineEditor::updateAllowingLanguageInput() // test app, no window available return; } - if (hasFocus() && !mReadOnly && !mDrawAsterixes && mPrevalidateFunc == NULL) + if (hasFocus() && !mReadOnly && !mDrawAsterixes && mPrevalidateFunc == nullptr) { window->allowLanguageTextInput(this, TRUE); } diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 2f101f387ac9db40595b6067106f8caecf053be5..9ed424e70ace0de33bd3ab632681549b1d06b7dd 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -120,50 +120,50 @@ public: virtual ~LLLineEditor(); // mousehandler overrides - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleDoubleClick(S32 x,S32 y,MASK mask); - /*virtual*/ BOOL handleMiddleMouseDown(S32 x,S32 y,MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask ); - /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); - /*virtual*/ void onMouseCaptureLost(); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleDoubleClick(S32 x,S32 y,MASK mask) override; + /*virtual*/ BOOL handleMiddleMouseDown(S32 x,S32 y,MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask ) override; + /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char) override; + /*virtual*/ void onMouseCaptureLost() override; // LLEditMenuHandler overrides - virtual void cut(); - virtual BOOL canCut() const; - virtual void copy(); - virtual BOOL canCopy() const; - virtual void paste(); - virtual BOOL canPaste() const; + void cut() override; + BOOL canCut() const override; + void copy() override; + BOOL canCopy() const override; + void paste() override; + BOOL canPaste() const override; virtual void updatePrimary(); virtual void copyPrimary(); virtual void pastePrimary(); virtual BOOL canPastePrimary() const; - virtual void doDelete(); - virtual BOOL canDoDelete() const; + void doDelete() override; + BOOL canDoDelete() const override; - virtual void selectAll(); - virtual BOOL canSelectAll() const; + void selectAll() override; + BOOL canSelectAll() const override; - virtual void deselect(); - virtual BOOL canDeselect() const; + void deselect() override; + BOOL canDeselect() const override; // LLSpellCheckMenuHandler overrides - /*virtual*/ bool getSpellCheck() const; + /*virtual*/ bool getSpellCheck() const override; - /*virtual*/ const std::string& getSuggestion(U32 index) const; - /*virtual*/ U32 getSuggestionCount() const; - /*virtual*/ void replaceWithSuggestion(U32 index); + /*virtual*/ const std::string& getSuggestion(U32 index) const override; + /*virtual*/ U32 getSuggestionCount() const override; + /*virtual*/ void replaceWithSuggestion(U32 index) override; - /*virtual*/ void addToDictionary(); - /*virtual*/ bool canAddToDictionary() const; + /*virtual*/ void addToDictionary() override; + /*virtual*/ bool canAddToDictionary() const override; - /*virtual*/ void addToIgnore(); - /*virtual*/ bool canAddToIgnore() const; + /*virtual*/ void addToIgnore() override; + /*virtual*/ bool canAddToIgnore() const override; // Spell checking helper functions std::string getMisspelledWord(U32 pos) const; @@ -171,27 +171,27 @@ public: void onSpellCheckSettingsChange(); // view overrides - virtual void draw(); - virtual void reshape(S32 width,S32 height,BOOL called_from_parent=TRUE); - virtual void onFocusReceived(); - virtual void onFocusLost(); - virtual void setEnabled(BOOL enabled); + void draw() override; + void reshape(S32 width,S32 height,BOOL called_from_parent=TRUE) override; + void onFocusReceived() override; + void onFocusLost() override; + void setEnabled(BOOL enabled) override; // UI control overrides - virtual void clear(); - virtual void onTabInto(); - virtual void setFocus( BOOL b ); - virtual void setRect(const LLRect& rect); - virtual BOOL acceptsTextInput() const; - virtual void onCommit(); - virtual BOOL isDirty() const; // Returns TRUE if user changed value at all - virtual void resetDirty(); // Clear dirty state + void clear() override; + void onTabInto() override; + void setFocus( BOOL b ) override; + void setRect(const LLRect& rect) override; + BOOL acceptsTextInput() const override; + void onCommit() override; + BOOL isDirty() const override; // Returns TRUE if user changed value at all + void resetDirty() override; // Clear dirty state // assumes UTF8 text - virtual void setValue(const LLSD& value ); - virtual LLSD getValue() const; - virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); - virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); + void setValue(const LLSD& value ) override; + LLSD getValue() const override; + BOOL setTextArg( const std::string& key, const LLStringExplicit& text ) override; + BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ) override; void setLabel(const LLStringExplicit &new_label) { mLabel = new_label; } const std::string& getLabel() { return mLabel.getString(); } @@ -210,7 +210,7 @@ public: // Selects characters 'start' to 'end'. void setSelection(S32 start, S32 end); - virtual void getSelectionRange(S32 *position, S32 *length) const; + void getSelectionRange(S32 *position, S32 *length) const override; void setCommitOnFocusLost( BOOL b ) { mCommitOnFocusLost = b; } void setRevertOnEsc( BOOL b ) { mRevertOnEsc = b; } @@ -275,7 +275,7 @@ public: void setReplaceNewlinesWithSpaces(BOOL replace); - void resetContextMenu() { setContextMenu(NULL); }; + void resetContextMenu() { setContextMenu(nullptr); }; private: // private helper methods @@ -303,14 +303,14 @@ private: void updateAllowingLanguageInput(); BOOL hasPreeditString() const; // Implementation (overrides) of LLPreeditor - virtual void resetPreedit(); - virtual void updatePreedit(const LLWString &preedit_string, - const segment_lengths_t &preedit_segment_lengths, const standouts_t &preedit_standouts, S32 caret_position); - virtual void markAsPreedit(S32 position, S32 length); - virtual void getPreeditRange(S32 *position, S32 *length) const; - virtual BOOL getPreeditLocation(S32 query_position, LLCoordGL *coord, LLRect *bounds, LLRect *control) const; - virtual S32 getPreeditFontSize() const; - virtual LLWString getPreeditString() const { return getWText(); } + void resetPreedit() override; + void updatePreedit(const LLWString &preedit_string, + const segment_lengths_t &preedit_segment_lengths, const standouts_t &preedit_standouts, S32 caret_position) override; + void markAsPreedit(S32 position, S32 length) override; + void getPreeditRange(S32 *position, S32 *length) const override; + BOOL getPreeditLocation(S32 query_position, LLCoordGL *coord, LLRect *bounds, LLRect *control) const override; + S32 getPreeditFontSize() const override; + LLWString getPreeditString() const override { return getWText(); } void setContextMenu(LLContextMenu* new_context_menu); diff --git a/indra/llui/llloadingindicator.h b/indra/llui/llloadingindicator.h index ffcb329f42d9db879fe99ebba19f3f154280e6d3..b5e86c0ac10943359133658bd279fb4603faf4ae 100644 --- a/indra/llui/llloadingindicator.h +++ b/indra/llui/llloadingindicator.h @@ -74,7 +74,7 @@ public: virtual ~LLLoadingIndicator() {} // llview overrides - virtual void draw(); + void draw() override; /** * Stop spinning. diff --git a/indra/llui/llmenubutton.h b/indra/llui/llmenubutton.h index 67ec1983b3f1e0478a9febf4a5f94a8d79a24406..b8dac4a49962740cc7a0dc50f7680945a72aeebe 100644 --- a/indra/llui/llmenubutton.h +++ b/indra/llui/llmenubutton.h @@ -64,8 +64,8 @@ public: boost::signals2::connection setMouseDownCallback( const mouse_signal_t::slot_type& cb ); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask ); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask ) override; void hideMenu(); diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 7827882d3d64b787a58211933ff6440877b3da9c..51c528243f372fdf26ec2d4180d446c9dd320cde 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -64,7 +64,7 @@ #include <boost/tokenizer.hpp> // static -LLMenuHolderGL *LLMenuGL::sMenuContainer = NULL; +LLMenuHolderGL *LLMenuGL::sMenuContainer = nullptr; view_listener_t::listener_map_t view_listener_t::sListeners; S32 MENU_BAR_HEIGHT = 0; @@ -150,20 +150,20 @@ LLMenuItemGL::Params::Params() // Default constructor LLMenuItemGL::LLMenuItemGL(const LLMenuItemGL::Params& p) : LLUICtrl(p), - mJumpKey(p.jump_key), - mAllowKeyRepeat(p.allow_key_repeat), - mHighlight( FALSE ), - mGotHover( FALSE ), - mBriefItem( FALSE ), - mDrawTextDisabled( FALSE ), - mFont(p.font), mAcceleratorKey(KEY_NONE), mAcceleratorMask(MASK_NONE), mLabel(p.label.isProvided() ? p.label() : p.name()), mEnabledColor(p.enabled_color()), mDisabledColor(p.disabled_color()), mHighlightBackground(p.highlight_bg_color()), - mHighlightForeground(p.highlight_fg_color()) + mHighlightForeground(p.highlight_fg_color()), + mHighlight( FALSE ), + mAllowKeyRepeat(p.allow_key_repeat), + mGotHover( FALSE ), + mBriefItem( FALSE ), + mFont(p.font), + mDrawTextDisabled( FALSE ), + mJumpKey(p.jump_key) { #ifdef LL_DARWIN // See if this Mac accelerator should really use the ctrl key and not get mapped to cmd @@ -266,7 +266,7 @@ BOOL LLMenuItemGL::handleRightMouseUp(S32 x, S32 y, MASK mask) // if not, it will be added to the list BOOL LLMenuItemGL::addToAcceleratorList(std::list <LLKeyBinding*> *listp) { - LLKeyBinding *accelerator = NULL; + LLKeyBinding *accelerator = nullptr; if (mAcceleratorKey != KEY_NONE) { @@ -521,19 +521,19 @@ void LLMenuItemGL::draw( void ) if( !mDrawBoolLabel.empty() ) { mFont->render( mDrawBoolLabel.getWString(), 0, (F32)LEFT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f), color, - LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, nullptr, FALSE ); } mFont->render( mLabel.getWString(), 0, (F32)LEFT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f), color, - LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, nullptr, FALSE ); if( !mDrawAccelLabel.empty() ) { mFont->render( mDrawAccelLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f), color, - LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, nullptr, FALSE ); } if( !mDrawBranchLabel.empty() ) { mFont->render( mDrawBranchLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f), color, - LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, nullptr, FALSE ); } } @@ -673,7 +673,7 @@ class LLMenuItemVerticalSeparatorGL public: LLMenuItemVerticalSeparatorGL( void ); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; } + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override { return FALSE; } }; LLMenuItemVerticalSeparatorGL::LLMenuItemVerticalSeparatorGL( void ) @@ -715,7 +715,7 @@ LLFloater* LLMenuItemTearOffGL::getParentFloater() } } - return NULL; + return nullptr; } void LLMenuItemTearOffGL::onCommit() @@ -1079,7 +1079,7 @@ void LLMenuItemBranchGL::onCommit( void ) // to facilitate fast menu control via jump keys if (LLMenuGL::getKeyboardMode() && getBranch() && !getBranch()->getHighlightedItem()) { - getBranch()->highlightNextItem(NULL); + getBranch()->highlightNextItem(nullptr); } LLUICtrl::onCommit(); @@ -1176,7 +1176,7 @@ void LLMenuItemBranchGL::draw() void LLMenuItemBranchGL::updateBranchParent(LLView* parentp) { - if (getBranch() && getBranch()->getParent() == NULL) + if (getBranch() && getBranch()->getParent() == nullptr) { // make the branch menu a sibling of my parent menu getBranch()->updateParent(parentp); @@ -1234,7 +1234,7 @@ BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) // switch to keyboard navigation mode LLMenuGL::setKeyboardMode(TRUE); - LLMenuItemGL* itemp = branch->highlightNextItem(NULL); + LLMenuItemGL* itemp = branch->highlightNextItem(nullptr); if (itemp) { return TRUE; @@ -1269,7 +1269,7 @@ void LLMenuItemBranchGL::openMenu() { gFloaterView->bringToFront(branch_parent); // this might not be necessary, as torn off branches don't get focus and hence no highligth - branch->highlightNextItem(NULL); + branch->highlightNextItem(nullptr); } } else if( !branch->getVisible() ) @@ -1347,27 +1347,27 @@ public: // returns the normal width of this control in pixels - this is // used for calculating the widest item, as well as for horizontal // arrangement. - virtual U32 getNominalWidth( void ) const; + U32 getNominalWidth( void ) const override; // called to rebuild the draw label - virtual void buildDrawLabel( void ); + void buildDrawLabel( void ) override; // handles opening, positioning, and arranging the menu branch associated with this item - virtual void openMenu( void ); + void openMenu( void ) override; // set the hover status (called by it's menu) and if the object is // active. This is used for behavior transfer. - virtual void setHighlight( BOOL highlight ); + void setHighlight( BOOL highlight ) override; - virtual BOOL isActive( void ) const; + BOOL isActive( void ) const override; // LLView functionality - virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); - virtual void draw( void ); - virtual BOOL handleKeyHere(KEY key, MASK mask); - - virtual BOOL handleAcceleratorKey(KEY key, MASK mask); + BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + BOOL handleMouseUp( S32 x, S32 y, MASK mask ) override; + void draw( void ) override; + BOOL handleKeyHere(KEY key, MASK mask) override; + + BOOL handleAcceleratorKey(KEY key, MASK mask) override; }; LLMenuItemBranchDownGL::LLMenuItemBranchDownGL( const Params& p) : @@ -1566,7 +1566,7 @@ BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask) { onCommit(); } - getBranch()->highlightNextItem(NULL); + getBranch()->highlightNextItem(nullptr); return TRUE; } else if (key == KEY_UP) @@ -1578,7 +1578,7 @@ BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask) { onCommit(); } - getBranch()->highlightPrevItem(NULL); + getBranch()->highlightPrevItem(nullptr); return TRUE; } } @@ -1662,10 +1662,10 @@ protected: friend class LLUICtrlFactory; public: - /*virtual*/ void draw(); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent); - /*virtual*/ void setEnabled(BOOL enabled); - virtual void onCommit( void ); + /*virtual*/ void draw() override; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent) override; + /*virtual*/ void setEnabled(BOOL enabled) override; + void onCommit( void ) override; private: LLButton* mArrowBtn; @@ -1738,33 +1738,33 @@ void LLMenuScrollItem::onCommit( void ) LLMenuGL::LLMenuGL(const LLMenuGL::Params& p) : LLUICtrl(p), - mBackgroundColor( p.bg_color() ), - mBgVisible( p.bg_visible ), - mDropShadowed( p.drop_shadow ), - mHasSelection(false), - mHorizontalLayout( p.horizontal_layout ), - mScrollable(mHorizontalLayout ? FALSE : p.scrollable), // Scrolling is supported only for vertical layout + mFirstVisibleItem(nullptr), + mArrowUpItem(nullptr), + mArrowDownItem(nullptr), + mLastMouseX(0), + mLastMouseY(0), + mMouseVelX(0), // Scrolling is supported only for vertical layout + mMouseVelY(0), mMaxScrollableItems(p.max_scrollable_items), mPreferredWidth(p.preferred_width), + mHorizontalLayout( p.horizontal_layout ), + mScrollable(mHorizontalLayout ? FALSE : p.scrollable), mKeepFixedSize( p.keep_fixed_size ), + mNeedsArrange(FALSE), + mAlwaysShowMenu(FALSE), + mBackgroundColor( p.bg_color() ), + mBgVisible( p.bg_visible ), mLabel (p.label), - mLastMouseX(0), - mLastMouseY(0), - mMouseVelX(0), - mMouseVelY(0), + mDropShadowed( p.drop_shadow ), + mHasSelection(false), mTornOff(FALSE), - mTearOffItem(NULL), - mSpilloverBranch(NULL), - mFirstVisibleItem(NULL), - mArrowUpItem(NULL), - mArrowDownItem(NULL), - mSpilloverMenu(NULL), + mTearOffItem(nullptr), + mSpilloverBranch(nullptr), + mSpilloverMenu(nullptr), mJumpKey(p.jump_key), mCreateJumpKeys(p.create_jump_keys), - mNeedsArrange(FALSE), - mAlwaysShowMenu(FALSE), - mResetScrollPositionOnShow(true), - mShortcutPad(p.shortcut_pad) + mShortcutPad(p.shortcut_pad), + mResetScrollPositionOnShow(true) { typedef boost::tokenizer<boost::char_separator<char> > tokenizer; boost::char_separator<char> sep("_"); @@ -1804,18 +1804,18 @@ LLMenuGL::~LLMenuGL( void ) void LLMenuGL::setCanTearOff(BOOL tear_off) { - if (tear_off && mTearOffItem == NULL) + if (tear_off && mTearOffItem == nullptr) { LLMenuItemTearOffGL::Params p; mTearOffItem = LLUICtrlFactory::create<LLMenuItemTearOffGL>(p); addChild(mTearOffItem); } - else if (!tear_off && mTearOffItem != NULL) + else if (!tear_off && mTearOffItem != nullptr) { mItems.remove(mTearOffItem); removeChild(mTearOffItem); delete mTearOffItem; - mTearOffItem = NULL; + mTearOffItem = nullptr; needsArrange(); } } @@ -1954,7 +1954,7 @@ BOOL LLMenuGL::isOpen() bool LLMenuGL::scrollItems(EScrollingDirection direction) { // Slowing down items scrolling when arrow button is held - if (mScrollItemsTimer.hasExpired() && NULL != mFirstVisibleItem) + if (mScrollItemsTimer.hasExpired() && nullptr != mFirstVisibleItem) { mScrollItemsTimer.setTimerExpirySec(.033f); } @@ -1989,7 +1989,7 @@ bool LLMenuGL::scrollItems(EScrollingDirection direction) } case SD_DOWN: { - if (NULL == mFirstVisibleItem) + if (nullptr == mFirstVisibleItem) { mFirstVisibleItem = *mItems.begin(); } @@ -2186,7 +2186,7 @@ void LLMenuGL::arrange( void ) if (mScrollable) { // Determining visible items boundaries - if (NULL == mFirstVisibleItem) + if (nullptr == mFirstVisibleItem) { mFirstVisibleItem = *item_iter; } @@ -2282,7 +2282,7 @@ void LLMenuGL::arrange( void ) if (height_before_first_visible_item > MENU_ITEM_PADDING || height_before_first_visible_item + visible_items_height < (S32)height) { - if (NULL == mArrowUpItem) + if (nullptr == mArrowUpItem) { LLMenuScrollItem::Params item_params; item_params.name(ARROW_UP); @@ -2293,7 +2293,7 @@ void LLMenuGL::arrange( void ) LLUICtrl::addChild(mArrowUpItem); } - if (NULL == mArrowDownItem) + if (nullptr == mArrowDownItem) { LLMenuScrollItem::Params item_params; item_params.name(ARROW_DOWN); @@ -2320,11 +2320,11 @@ void LLMenuGL::arrange( void ) } else { - if (NULL != mArrowUpItem) + if (nullptr != mArrowUpItem) { mArrowUpItem->setVisible(FALSE); } - if (NULL != mArrowDownItem) + if (nullptr != mArrowDownItem) { mArrowDownItem->setVisible(FALSE); } @@ -2433,8 +2433,8 @@ void LLMenuGL::cleanupSpilloverBranch() // Delete the branch, and since the branch will delete the menu, // set the menu* to null. delete mSpilloverBranch; - mSpilloverBranch = NULL; - mSpilloverMenu = NULL; + mSpilloverBranch = nullptr; + mSpilloverMenu = nullptr; } } @@ -2543,9 +2543,9 @@ void LLMenuGL::empty( void ) cleanupSpilloverBranch(); mItems.clear(); - mFirstVisibleItem = NULL; - mArrowUpItem = NULL; - mArrowDownItem = NULL; + mFirstVisibleItem = nullptr; + mArrowUpItem = nullptr; + mArrowDownItem = nullptr; deleteAllChildren(); } @@ -2584,7 +2584,7 @@ void LLMenuGL::insert( S32 position, LLView * ctrl, bool arrange /*= true*/ ) { LLMenuItemGL * item = dynamic_cast<LLMenuItemGL *>(ctrl); - if (NULL == item || position < 0 || position >= mItems.size()) + if (nullptr == item || position < 0 || position >= mItems.size()) { return; } @@ -2780,7 +2780,7 @@ LLMenuItemGL* LLMenuGL::getItem(S32 number) number--; } } - return NULL; + return nullptr; } LLMenuItemGL* LLMenuGL::getHighlightedItem() @@ -2793,12 +2793,12 @@ LLMenuItemGL* LLMenuGL::getHighlightedItem() return (*item_iter); } } - return NULL; + return nullptr; } LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disabled) { - if (mItems.empty()) return NULL; + if (mItems.empty()) return nullptr; // highlighting first item on a torn off menu is the // same as giving focus to it if (!cur_item && getTornOff()) @@ -2834,7 +2834,7 @@ LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disa // and the first item is highlighted. if (mScrollable && !scrollItems(SD_BEGIN)) { - return NULL; + return nullptr; } } // If current item is the last visible, the menu is scrolled one item down @@ -2851,7 +2851,7 @@ LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disa } else { - return NULL; + return nullptr; } } } @@ -2898,12 +2898,12 @@ LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disa } } - return NULL; + return nullptr; } LLMenuItemGL* LLMenuGL::highlightPrevItem(LLMenuItemGL* cur_item, BOOL skip_disabled) { - if (mItems.empty()) return NULL; + if (mItems.empty()) return nullptr; // highlighting first item on a torn off menu is the // same as giving focus to it @@ -2940,7 +2940,7 @@ LLMenuItemGL* LLMenuGL::highlightPrevItem(LLMenuItemGL* cur_item, BOOL skip_disa // and the last item is highlighted. if (mScrollable && !scrollItems(SD_END)) { - return NULL; + return nullptr; } } // If current item is the first visible, the menu is scrolled one item up @@ -2957,7 +2957,7 @@ LLMenuItemGL* LLMenuGL::highlightPrevItem(LLMenuItemGL* cur_item, BOOL skip_disa } else { - return NULL; + return nullptr; } } } @@ -2988,7 +2988,7 @@ LLMenuItemGL* LLMenuGL::highlightPrevItem(LLMenuItemGL* cur_item, BOOL skip_disa } } - return NULL; + return nullptr; } void LLMenuGL::buildDrawLabels() @@ -3212,7 +3212,7 @@ LLMenuGL* LLMenuGL::findChildMenuByName(const std::string& name, BOOL recurse) c } } LL_WARNS() << "Child Menu " << name << " not found in menu " << getName() << LL_ENDL; - return NULL; + return nullptr; } BOOL LLMenuGL::clearHoverItem() @@ -3278,7 +3278,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) // Resetting scrolling position if (menu->isScrollable() && menu->isScrollPositionOnShowReset()) { - menu->mFirstVisibleItem = NULL; + menu->mFirstVisibleItem = nullptr; } // Fix menu rect if needed. @@ -3362,7 +3362,7 @@ BOOL LLMenuBarGL::handleAcceleratorKey(KEY key, MASK mask) { // close menus originating from other menu bars when first opening menu via keyboard LLMenuGL::sMenuContainer->hideMenus(); - highlightNextItem(NULL); + highlightNextItem(nullptr); LLMenuGL::setKeyboardMode(TRUE); } return TRUE; @@ -3473,7 +3473,7 @@ void LLMenuBarGL::checkMenuTrigger() // close menus originating from other menu bars LLMenuGL::sMenuContainer->hideMenus(); - highlightNextItem(NULL); + highlightNextItem(nullptr); LLMenuGL::setKeyboardMode(TRUE); } } @@ -3570,7 +3570,7 @@ BOOL LLMenuBarGL::appendMenu( LLMenuGL* menu ) BOOL LLMenuBarGL::handleHover( S32 x, S32 y, MASK mask ) { BOOL handled = FALSE; - LLView* active_menu = NULL; + LLView* active_menu = nullptr; BOOL no_mouse_data = mLastMouseX == 0 && mLastMouseY == 0; S32 mouse_delta_x = no_mouse_data ? 0 : x - mLastMouseX; @@ -3676,7 +3676,7 @@ void LLMenuHolderGL::draw() BOOL LLMenuHolderGL::handleMouseDown( S32 x, S32 y, MASK mask ) { - BOOL handled = LLView::childrenHandleMouseDown(x, y, mask) != NULL; + BOOL handled = LLView::childrenHandleMouseDown(x, y, mask) != nullptr; if (!handled) { LLMenuGL* visible_menu = (LLMenuGL*)getVisibleMenu(); @@ -3703,7 +3703,7 @@ BOOL LLMenuHolderGL::handleMouseDown( S32 x, S32 y, MASK mask ) BOOL LLMenuHolderGL::handleRightMouseDown( S32 x, S32 y, MASK mask ) { - BOOL handled = LLView::childrenHandleRightMouseDown(x, y, mask) != NULL; + BOOL handled = LLView::childrenHandleRightMouseDown(x, y, mask) != nullptr; if (!handled) { // clicked off of menu, hide them all @@ -3729,7 +3729,7 @@ BOOL LLMenuHolderGL::handleRightMouseUp( S32 x, S32 y, MASK mask ) return TRUE; } - BOOL handled = LLView::childrenHandleRightMouseUp(x, y, mask) != NULL; + BOOL handled = LLView::childrenHandleRightMouseUp(x, y, mask) != nullptr; if (!handled) { // clicked off of menu, hide them all @@ -3762,7 +3762,7 @@ BOOL LLMenuHolderGL::handleKey(KEY key, MASK mask, BOOL called_from_parent) else if (mask == MASK_NONE || (key >= KEY_LEFT && key <= KEY_DOWN)) { //highlight first enabled one - if(pMenu->highlightNextItem(NULL)) + if(pMenu->highlightNextItem(nullptr)) { handled = true; } @@ -3788,12 +3788,12 @@ LLView* const LLMenuHolderGL::getVisibleMenu() const for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { LLView* viewp = *child_it; - if (viewp->getVisible() && dynamic_cast<LLMenuGL*>(viewp) != NULL) + if (viewp->getVisible() && dynamic_cast<LLMenuGL*>(viewp) != nullptr) { return viewp; } } - return NULL; + return nullptr; } @@ -3811,7 +3811,7 @@ BOOL LLMenuHolderGL::hideMenus() for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { LLView* viewp = *child_it; - if (dynamic_cast<LLMenuGL*>(viewp) != NULL && viewp->getVisible()) + if (dynamic_cast<LLMenuGL*>(viewp) != nullptr && viewp->getVisible()) { viewp->setVisible(FALSE); } @@ -3868,7 +3868,7 @@ LLTearOffMenu::LLTearOffMenu(LLMenuGL* menup) : mMenu = menup; // highlight first item (tear off item will be disabled) - mMenu->highlightNextItem(NULL); + mMenu->highlightNextItem(nullptr); // Can't do this in postBuild() because that is only called for floaters // constructed from XML. @@ -3897,7 +3897,7 @@ void LLTearOffMenu::onFocusReceived() // if nothing is highlighted, just highlight first item if (!mMenu->getHighlightedItem()) { - mMenu->highlightNextItem(NULL); + mMenu->highlightNextItem(nullptr); } // parent menu items get highlights so navigation logic keeps working @@ -3936,12 +3936,12 @@ BOOL LLTearOffMenu::handleKeyHere(KEY key, MASK mask) { if (key == KEY_UP) { - mMenu->highlightPrevItem(NULL); + mMenu->highlightPrevItem(nullptr); return TRUE; } else if (key == KEY_DOWN) { - mMenu->highlightNextItem(NULL); + mMenu->highlightNextItem(nullptr); return TRUE; } } @@ -4024,7 +4024,7 @@ void LLContextMenuBranch::buildDrawLabel( void ) void LLContextMenuBranch::showSubMenu() { LLMenuItemGL* menu_item = mBranch.get()->getParentMenuItem(); - if (menu_item != NULL && menu_item->getVisible()) + if (menu_item != nullptr && menu_item->getVisible()) { S32 center_x; S32 center_y; @@ -4066,7 +4066,7 @@ static MenuRegistry::Register<LLContextMenu> context_menu_register2("context_men LLContextMenu::LLContextMenu(const Params& p) : LLMenuGL(p), mHoveredAnyItem(FALSE), - mHoverItem(NULL) + mHoverItem(nullptr) { //setBackgroundVisible(TRUE); } @@ -4153,7 +4153,7 @@ void LLContextMenu::hide() { mHoverItem->setHighlight( FALSE ); } - mHoverItem = NULL; + mHoverItem = nullptr; } @@ -4187,7 +4187,7 @@ BOOL LLContextMenu::handleHover( S32 x, S32 y, MASK mask ) if (mHoverItem) { mHoverItem->setHighlight(FALSE); - mHoverItem = NULL; + mHoverItem = nullptr; } } diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index a85cae272d2093794dc9e73c6a60cb447d318168..320ce3b88662dcfe247f7bb2b6f7fe1276a15eee 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -81,14 +81,14 @@ protected: friend class LLUICtrlFactory; public: // LLView overrides - /*virtual*/ void onVisibilityChange(BOOL new_visibility); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); + /*virtual*/ void onVisibilityChange(BOOL new_visibility) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override; // LLUICtrl overrides - /*virtual*/ void setValue(const LLSD& value); - /*virtual*/ LLSD getValue() const; + /*virtual*/ void setValue(const LLSD& value) override; + /*virtual*/ LLSD getValue() const override; virtual BOOL handleAcceleratorKey(KEY key, MASK mask); @@ -115,7 +115,7 @@ public: // change the label void setLabel( const LLStringExplicit& label ) { mLabel = label; } std::string getLabel( void ) const { return mLabel.getString(); } - virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); + BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ) override; // Get the parent menu for this item virtual class LLMenuGL* getMenu() const; @@ -138,8 +138,8 @@ public: // for branching menu items, bring sub menus up to root level of menu hierarchy virtual void updateBranchParent( LLView* parentp ){}; - - virtual void onCommit( void ); + + void onCommit( void ) override; virtual void setHighlight( BOOL highlight ); virtual BOOL getHighlight() const { return mHighlight; } @@ -153,15 +153,15 @@ public: virtual void setEnabledSubMenus(BOOL enable){}; // LLView Functionality - virtual BOOL handleKeyHere( KEY key, MASK mask ); - virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); - virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); + BOOL handleKeyHere( KEY key, MASK mask ) override; + BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + BOOL handleMouseUp( S32 x, S32 y, MASK mask ) override; + BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ) override; - virtual void onMouseEnter(S32 x, S32 y, MASK mask); - virtual void onMouseLeave(S32 x, S32 y, MASK mask); + void onMouseEnter(S32 x, S32 y, MASK mask) override; + void onMouseLeave(S32 x, S32 y, MASK mask) override; - virtual void draw( void ); + void draw( void ) override; BOOL getHover() const { return mGotHover; } @@ -227,16 +227,16 @@ public: }; LLMenuItemSeparatorGL(const LLMenuItemSeparatorGL::Params& p = LLMenuItemSeparatorGL::Params()); - /*virtual*/ void draw( void ); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + /*virtual*/ void draw( void ) override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; - /*virtual*/ U32 getNominalHeight( void ) const; + /*virtual*/ U32 getNominalHeight( void ) const override; void updateVisible(void); void initFromParams(const Params& p); // called to rebuild the draw label - /*virtual*/ void buildDrawLabel(void); + /*virtual*/ void buildDrawLabel(void) override; private: enable_signal_t mVisibleSignal; }; @@ -272,12 +272,12 @@ public: void initFromParams(const Params& p); // called to rebuild the draw label - virtual void buildDrawLabel( void ); + void buildDrawLabel( void ) override; - virtual void onCommit( void ); + void onCommit( void ) override; - virtual BOOL handleAcceleratorKey(KEY key, MASK mask); - virtual BOOL handleKeyHere(KEY key, MASK mask); + BOOL handleAcceleratorKey(KEY key, MASK mask) override; + BOOL handleKeyHere(KEY key, MASK mask) override; //virtual void draw(); @@ -325,13 +325,13 @@ public: void initFromParams(const Params& p); - virtual void onCommit( void ); - - virtual void setValue(const LLSD& value); - virtual LLSD getValue() const; + void onCommit( void ) override; + + void setValue(const LLSD& value) override; + LLSD getValue() const override; // called to rebuild the draw label - virtual void buildDrawLabel( void ); + void buildDrawLabel( void ) override; boost::signals2::connection setCheckCallback( const enable_signal_t::slot_type& cb ) { @@ -387,10 +387,10 @@ public: bg_visible("bg_visible", true), create_jump_keys("create_jump_keys", false), keep_fixed_size("keep_fixed_size", false), - bg_color("bg_color", LLUIColorTable::instance().getColor( "MenuDefaultBgColor" )), - scrollable("scrollable", false), - max_scrollable_items("max_scrollable_items", U32_MAX), + scrollable("scrollable", false), + max_scrollable_items("max_scrollable_items", U32_MAX), preferred_width("preferred_width", U32_MAX), + bg_color("bg_color", LLUIColorTable::instance().getColor( "MenuDefaultBgColor" )), shortcut_pad("shortcut_pad") { addSynonym(bg_visible, "opaque"); @@ -430,15 +430,15 @@ public: void parseChildXML(LLXMLNodePtr child, LLView* parent); // LLView Functionality - /*virtual*/ BOOL handleUnicodeCharHere( llwchar uni_char ); - /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); - /*virtual*/ void draw( void ); + /*virtual*/ BOOL handleUnicodeCharHere( llwchar uni_char ) override; + /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ) override; + /*virtual*/ BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ) override; + /*virtual*/ void draw( void ) override; /*virtual*/ void drawBackground(LLMenuItemGL* itemp, F32 alpha); - /*virtual*/ void setVisible(BOOL visible); - /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0); - /*virtual*/ void removeChild( LLView* ctrl); - /*virtual*/ BOOL postBuild(); + /*virtual*/ void setVisible(BOOL visible) override; + /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0) override; + /*virtual*/ void removeChild( LLView* ctrl) override; + /*virtual*/ BOOL postBuild() override; virtual BOOL handleAcceleratorKey(KEY key, MASK mask); @@ -521,7 +521,7 @@ public: void setTornOff(BOOL torn_off); BOOL getTornOff() { return mTornOff; } - BOOL getCanTearOff() { return mTearOffItem != NULL; } + BOOL getCanTearOff() { return mTearOffItem != nullptr; } KEY getJumpKey() const { return mJumpKey; } void setJumpKey(KEY key) { mJumpKey = key; } @@ -625,47 +625,47 @@ protected: friend class LLUICtrlFactory; public: virtual ~LLMenuItemBranchGL(); - - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleAcceleratorKey(KEY key, MASK mask); + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + + BOOL handleAcceleratorKey(KEY key, MASK mask) override; // check if we've used these accelerators already - virtual BOOL addToAcceleratorList(std::list <LLKeyBinding*> *listp); + BOOL addToAcceleratorList(std::list <LLKeyBinding*> *listp) override; // called to rebuild the draw label - virtual void buildDrawLabel( void ); + void buildDrawLabel( void ) override; - virtual void onCommit( void ); + void onCommit( void ) override; - virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); - virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); + BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent) override; + BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) override; // set the hover status (called by it's menu) and if the object is // active. This is used for behavior transfer. - virtual void setHighlight( BOOL highlight ); + void setHighlight( BOOL highlight ) override; - virtual BOOL handleKeyHere(KEY key, MASK mask); + BOOL handleKeyHere(KEY key, MASK mask) override; - virtual BOOL isActive() const; + BOOL isActive() const override; - virtual BOOL isOpen() const; + BOOL isOpen() const override; LLMenuGL* getBranch() const { return (LLMenuGL*)mBranchHandle.get(); } - virtual void updateBranchParent( LLView* parentp ); + void updateBranchParent( LLView* parentp ) override; // LLView Functionality - virtual void onVisibilityChange( BOOL curVisibilityIn ); + void onVisibilityChange( BOOL curVisibilityIn ) override; - virtual void draw(); + void draw() override; - virtual void setEnabledSubMenus(BOOL enabled) { if (getBranch()) getBranch()->setEnabledSubMenus(enabled); } + void setEnabledSubMenus(BOOL enabled) override { if (getBranch()) getBranch()->setEnabledSubMenus(enabled); } virtual void openMenu(); - virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE) const; - virtual LLView* findChildView(const std::string& name, BOOL recurse = TRUE) const; + LLView* getChildView(const std::string& name, BOOL recurse = TRUE) const override; + LLView* findChildView(const std::string& name, BOOL recurse = TRUE) const override; private: LLHandle<LLView> mBranchHandle; @@ -698,16 +698,16 @@ public: // LLView Functionality // can't set visibility directly, must call show or hide - virtual void setVisible (BOOL visible); + void setVisible (BOOL visible) override; - virtual void show (S32 x, S32 y, LLView* spawning_view = NULL); + virtual void show (S32 x, S32 y, LLView* spawning_view = nullptr); virtual void hide (); - virtual BOOL handleHover ( S32 x, S32 y, MASK mask ); - virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleRightMouseUp ( S32 x, S32 y, MASK mask ); + BOOL handleHover ( S32 x, S32 y, MASK mask ) override; + BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ) override; + BOOL handleRightMouseUp ( S32 x, S32 y, MASK mask ) override; - virtual bool addChild (LLView* view, S32 tab_group = 0); + bool addChild (LLView* view, S32 tab_group = 0) override; LLHandle<LLContextMenu> getHandle() { return getDerivedHandle<LLContextMenu>(); } @@ -739,13 +739,13 @@ public: {} // called to rebuild the draw label - virtual void buildDrawLabel( void ); + void buildDrawLabel( void ) override; // onCommit() - do the primary funcationality of the menu item. - virtual void onCommit( void ); + void onCommit( void ) override; LLContextMenu* getBranch() { return mBranch.get(); } - void setHighlight( BOOL highlight ); + void setHighlight( BOOL highlight ) override; protected: void showSubMenu(); @@ -768,20 +768,20 @@ public: LLMenuBarGL( const Params& p ); virtual ~LLMenuBarGL(); - /*virtual*/ BOOL handleAcceleratorKey(KEY key, MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); - /*virtual*/ BOOL handleJumpKey(KEY key); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleAcceleratorKey(KEY key, MASK mask) override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask) override; + /*virtual*/ BOOL handleJumpKey(KEY key) override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; - /*virtual*/ void draw(); - /*virtual*/ BOOL jumpKeysActive(); + /*virtual*/ void draw() override; + /*virtual*/ BOOL jumpKeysActive() override; // add a vertical separator to this menu - virtual BOOL addSeparator(); + BOOL addSeparator() override; // LLView Functionality - virtual BOOL handleHover( S32 x, S32 y, MASK mask ); + BOOL handleHover( S32 x, S32 y, MASK mask ) override; // Returns x position of rightmost child, usually Help menu S32 getRightmostMenuEdge(); @@ -790,10 +790,10 @@ public: private: // add a menu - this will create a drop down menu. - virtual BOOL appendMenu( LLMenuGL* menu ); + BOOL appendMenu( LLMenuGL* menu ) override; // rearrange the child rects so they fit the shape of the menu // bar. - virtual void arrange( void ); + void arrange( void ) override; void checkMenuTrigger(); @@ -815,21 +815,21 @@ public: virtual ~LLMenuHolderGL() {} virtual BOOL hideMenus(); - void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; void setCanHide(BOOL can_hide) { mCanHide = can_hide; } // LLView functionality - virtual void draw(); - virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); + void draw() override; + BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ) override; // Close context menus on right mouse up not handled by menus. - /*virtual*/ BOOL handleRightMouseUp( S32 x, S32 y, MASK mask ); + /*virtual*/ BOOL handleRightMouseUp( S32 x, S32 y, MASK mask ) override; - virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); + BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent) override; virtual const LLRect getMenuRect() const { return getLocalRect(); } LLView*const getVisibleMenu() const; - virtual BOOL hasVisibleMenu() const {return getVisibleMenu() != NULL;} + virtual BOOL hasVisibleMenu() const {return getVisibleMenu() != nullptr;} static void setActivatedItem(LLMenuItemGL* item); @@ -856,12 +856,12 @@ public: static LLTearOffMenu* create(LLMenuGL* menup); virtual ~LLTearOffMenu(); - virtual void draw(void); - virtual void onFocusReceived(); - virtual void onFocusLost(); - virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual void translate(S32 x, S32 y); + void draw(void) override; + void onFocusReceived() override; + void onFocusLost() override; + BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) override; + BOOL handleKeyHere(KEY key, MASK mask) override; + void translate(S32 x, S32 y) override; private: LLTearOffMenu(LLMenuGL* menup); @@ -886,10 +886,10 @@ public: {}; LLMenuItemTearOffGL( const Params& ); - - virtual void onCommit(void); - virtual void draw(void); - virtual U32 getNominalHeight() const; + + void onCommit(void) override; + void draw(void) override; + U32 getNominalHeight() const override; LLFloater* getParentFloater(); }; diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index d08b0b1cc80d712748700014f9ddbb46c20413ad..08b59f1fd57a2a66b0cfa905983ac79be122bb54 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -82,7 +82,7 @@ void LLModalDialog::openFloater(const LLSD& key) { // SJB: Hack! Make sure we don't ever host a modal dialog LLMultiFloater* thost = LLFloater::getFloaterHost(); - LLFloater::setFloaterHost(NULL); + LLFloater::setFloaterHost(nullptr); LLFloater::openFloater(key); LLFloater::setFloaterHost(thost); } @@ -164,7 +164,7 @@ void LLModalDialog::setVisible( BOOL visible ) BOOL LLModalDialog::handleMouseDown(S32 x, S32 y, MASK mask) { LLView* popup_menu = LLMenuGL::sMenuContainer->getVisibleMenu(); - if (popup_menu != NULL) + if (popup_menu != nullptr) { S32 mx, my; LLUI::getMousePositionScreen(&mx, &my); @@ -194,14 +194,14 @@ BOOL LLModalDialog::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLModalDialog::handleHover(S32 x, S32 y, MASK mask) { - if( childrenHandleHover(x, y, mask) == NULL ) + if( childrenHandleHover(x, y, mask) == nullptr ) { getWindow()->setCursor(UI_CURSOR_ARROW); LL_DEBUGS("UserInput") << "hover handled by " << getName() << LL_ENDL; } LLView* popup_menu = LLMenuGL::sMenuContainer->getVisibleMenu(); - if (popup_menu != NULL) + if (popup_menu != nullptr) { S32 mx, my; LLUI::getMousePositionScreen(&mx, &my); @@ -211,7 +211,7 @@ BOOL LLModalDialog::handleHover(S32 x, S32 y, MASK mask) S32 local_x = mx - popup_menu->getRect().mLeft; S32 local_y = my - popup_menu->getRect().mBottom; popup_menu->handleHover(local_x, local_y, mask); - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); } } @@ -301,7 +301,7 @@ void LLModalDialog::onAppFocusLost() LLModalDialog* instance = LLModalDialog::sModalStack.front(); if( gFocusMgr.childHasMouseCapture( instance ) ) { - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); } instance->setFocus(FALSE); diff --git a/indra/llui/llmodaldialog.h b/indra/llui/llmodaldialog.h index f81273b96a56cf1b9e336b988e45b8acb8ae54c0..3da7fa6ae93ac8fa6d3ec03a8ac71db7d1f9e7ef 100644 --- a/indra/llui/llmodaldialog.h +++ b/indra/llui/llmodaldialog.h @@ -42,23 +42,23 @@ public: LLModalDialog( const LLSD& key, BOOL modal = true ); virtual ~LLModalDialog(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /*virtual*/ void openFloater(const LLSD& key = LLSD()); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask ); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask ) override; - /*virtual*/ void setVisible(BOOL visible); - /*virtual*/ void draw(); + /*virtual*/ void setVisible(BOOL visible) override; + /*virtual*/ void draw() override; BOOL isModal() const { return mModal; } void stopModal(); diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp index 817e4806165551532d02cca3e7b2676497464d33..4df6f106598f491394d3e5c9d79132e75ff01c02 100644 --- a/indra/llui/llmultifloater.cpp +++ b/indra/llui/llmultifloater.cpp @@ -40,7 +40,7 @@ LLMultiFloater::LLMultiFloater(const LLSD& key, const LLFloater::Params& params) : LLFloater(key), - mTabContainer(NULL), + mTabContainer(nullptr), mTabPos(LLTabContainer::TOP), mAutoResize(TRUE), mOrigMinWidth(params.min_width), @@ -306,7 +306,7 @@ void LLMultiFloater::removeFloater(LLFloater* floaterp) mTabContainer->removeTabPanel(floaterp); floaterp->setBackgroundVisible(TRUE); floaterp->setCanDrag(TRUE); - floaterp->setHost(NULL); + floaterp->setHost(nullptr); floaterp->applyRectControl(); updateResizeLimits(); diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h index c106a6252746f6756a5a845283f839f1b0993f69..de007dbc12f66143dc3fcc0c3e6a4c444e001a0a 100644 --- a/indra/llui/llmultifloater.h +++ b/indra/llui/llmultifloater.h @@ -42,15 +42,15 @@ public: virtual ~LLMultiFloater() {}; void buildTabContainer(); - - virtual BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); - virtual void draw(); - virtual void setVisible(BOOL visible); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); - /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0); - - virtual void setCanResize(BOOL can_resize); + + BOOL postBuild() override; + /*virtual*/ void onClose(bool app_quitting) override; + void draw() override; + void setVisible(BOOL visible) override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask) override; + /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0) override; + + void setCanResize(BOOL can_resize) override; virtual void growToFit(S32 content_width, S32 content_height); virtual void addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp index 86d5ff8649c229488acf837bf7cd031c7340ffa6..f932cca2a57fc1305c60e24d20152fbe58aabaed 100644 --- a/indra/llui/llmultislider.cpp +++ b/indra/llui/llmultislider.cpp @@ -72,21 +72,21 @@ LLMultiSlider::Params::Params() LLMultiSlider::LLMultiSlider(const LLMultiSlider::Params& p) : LLF32UICtrl(p), - mMouseOffset( 0 ), - mDragStartThumbRect( 0, getRect().getHeight(), p.thumb_width, 0 ), mMaxNumSliders(p.max_sliders), mAllowOverlap(p.allow_overlap), mDrawTrack(p.draw_track), mUseTriangle(p.use_triangle), + mMouseOffset( 0 ), + mDragStartThumbRect( 0, getRect().getHeight(), p.thumb_width, 0 ), + mThumbWidth(p.thumb_width), mTrackColor(p.track_color()), mThumbOutlineColor(p.thumb_outline_color()), mThumbCenterColor(p.thumb_center_color()), mThumbCenterSelectedColor(p.thumb_center_selected_color()), mDisabledThumbColor(p.thumb_disabled_color()), mTriangleColor(p.triangle_color()), - mThumbWidth(p.thumb_width), - mMouseDownSignal(NULL), - mMouseUpSignal(NULL) + mMouseDownSignal(nullptr), + mMouseUpSignal(nullptr) { mValue.emptyMap(); mCurSlider = LLStringUtil::null; @@ -374,7 +374,7 @@ BOOL LLMultiSlider::handleMouseUp(S32 x, S32 y, MASK mask) if( gFocusMgr.getMouseCapture() == this ) { - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); if (mMouseUpSignal) (*mMouseUpSignal)( this, LLSD() ); diff --git a/indra/llui/llmultislider.h b/indra/llui/llmultislider.h index 2b422e89c96fe1e1ac9275229e3718da0b8e04bb..7931344f299231cbf6d07885aa1610640f918d73 100644 --- a/indra/llui/llmultislider.h +++ b/indra/llui/llmultislider.h @@ -78,8 +78,8 @@ public: void setCurSlider(const std::string& name); void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mCurSlider, val, from_event); } - /*virtual*/ void setValue(const LLSD& value); - /*virtual*/ LLSD getValue() const { return mValue; } + /*virtual*/ void setValue(const LLSD& value) override; + /*virtual*/ LLSD getValue() const override { return mValue; } boost::signals2::connection setMouseDownCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setMouseUpCallback( const commit_signal_t::slot_type& cb ); @@ -90,13 +90,13 @@ public: void addSlider(F32 val, const std::string& name); void deleteSlider(const std::string& name); void deleteCurSlider() { deleteSlider(mCurSlider); } - void clear(); + void clear() override; - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); - /*virtual*/ void draw(); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask) override; + /*virtual*/ void draw() override; protected: LLSD mValue; diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp index fc3e5c3ce6abf9422e6abf7190cdf31988723c9c..5e36eef2ba2e9f529b9472d5cd10eb777a6722df 100644 --- a/indra/llui/llmultisliderctrl.cpp +++ b/indra/llui/llmultisliderctrl.cpp @@ -49,15 +49,15 @@ static LLDefaultChildRegistry::Register<LLMultiSliderCtrl> r("multi_slider"); const U32 MAX_STRING_LENGTH = 10; LLMultiSliderCtrl::Params::Params() -: text_width("text_width"), - label_width("label_width"), +: label_width("label_width"), + text_width("text_width"), show_text("show_text", true), can_edit_text("can_edit_text", false), + decimal_digits("decimal_digits", 3), max_sliders("max_sliders", 1), allow_overlap("allow_overlap", false), draw_track("draw_track", true), use_triangle("use_triangle", false), - decimal_digits("decimal_digits", 3), text_color("text_color"), text_disabled_color("text_disabled_color"), mouse_down_callback("mouse_down_callback"), @@ -69,9 +69,9 @@ LLMultiSliderCtrl::Params::Params() LLMultiSliderCtrl::LLMultiSliderCtrl(const LLMultiSliderCtrl::Params& p) : LLF32UICtrl(p), - mLabelBox( NULL ), - mEditor( NULL ), - mTextBox( NULL ), + mLabelBox(nullptr ), + mEditor(nullptr ), + mTextBox(nullptr ), mTextEnabledColor(p.text_color()), mTextDisabledColor(p.text_disabled_color()) { diff --git a/indra/llui/llmultisliderctrl.h b/indra/llui/llmultisliderctrl.h index b6a35423765b6660f130cdd7285dfa8907f3d5fe..32e58369290be6d78299cb68aed784b74d967f9b 100644 --- a/indra/llui/llmultisliderctrl.h +++ b/indra/llui/llmultisliderctrl.h @@ -77,26 +77,26 @@ public: F32 getSliderValue(const std::string& name) const; void setSliderValue(const std::string& name, F32 v, BOOL from_event = FALSE); - virtual void setValue(const LLSD& value ); - virtual LLSD getValue() const { return mMultiSlider->getValue(); } - virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); + void setValue(const LLSD& value ) override; + LLSD getValue() const override { return mMultiSlider->getValue(); } + BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ) override; const std::string& getCurSlider() const { return mMultiSlider->getCurSlider(); } F32 getCurSliderValue() const { return mCurValue; } void setCurSlider(const std::string& name); void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mMultiSlider->getCurSlider(), val, from_event); } - virtual void setMinValue(const LLSD& min_value) { setMinValue((F32)min_value.asReal()); } - virtual void setMaxValue(const LLSD& max_value) { setMaxValue((F32)max_value.asReal()); } + void setMinValue(const LLSD& min_value) override { setMinValue((F32)min_value.asReal()); } + void setMaxValue(const LLSD& max_value) override { setMaxValue((F32)max_value.asReal()); } BOOL isMouseHeldDown(); - virtual void setEnabled( BOOL b ); - virtual void clear(); + void setEnabled( BOOL b ) override; + void clear() override; virtual void setPrecision(S32 precision); - void setMinValue(F32 min_value) {mMultiSlider->setMinValue(min_value);} - void setMaxValue(F32 max_value) {mMultiSlider->setMaxValue(max_value);} - void setIncrement(F32 increment) {mMultiSlider->setIncrement(increment);} + void setMinValue(F32 min_value) override {mMultiSlider->setMinValue(min_value);} + void setMaxValue(F32 max_value) override {mMultiSlider->setMaxValue(max_value);} + void setIncrement(F32 increment) override {mMultiSlider->setIncrement(increment);} /// for adding and deleting sliders const std::string& addSlider(); @@ -104,8 +104,8 @@ public: void deleteSlider(const std::string& name); void deleteCurSlider() { deleteSlider(mMultiSlider->getCurSlider()); } - F32 getMinValue() const { return mMultiSlider->getMinValue(); } - F32 getMaxValue() const { return mMultiSlider->getMaxValue(); } + F32 getMinValue() const override { return mMultiSlider->getMinValue(); } + F32 getMaxValue() const override { return mMultiSlider->getMaxValue(); } void setLabel(const std::string& label) { if (mLabelBox) mLabelBox->setText(label); } void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } @@ -114,12 +114,12 @@ public: boost::signals2::connection setSliderMouseDownCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb ); - virtual void onTabInto(); + void onTabInto() override; - virtual void setTentative(BOOL b); // marks value as tentative - virtual void onCommit(); // mark not tentative, then commit + void setTentative(BOOL b) override; // marks value as tentative + void onCommit() override; // mark not tentative, then commit - virtual void setControlName(const std::string& control_name, LLView* context); + void setControlName(const std::string& control_name, LLView* context) override; static void onSliderCommit(LLUICtrl* caller, const LLSD& userdata); diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 3024e66eb805463837613c0ba41bf29d9c19dad0..7562e28ec58e24347105121356b098c23724edbe 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -65,9 +65,9 @@ LLNotificationForm::FormElementBase::FormElementBase() LLNotificationForm::FormIgnore::FormIgnore() : text("text"), + save_option("save_option", false), control("control"), - invert_control("invert_control", false), - save_option("save_option", false) + invert_control("invert_control", false) {} LLNotificationForm::FormButton::FormButton() @@ -83,9 +83,9 @@ LLNotificationForm::FormButton::FormButton() LLNotificationForm::FormInput::FormInput() : type("type"), - text("text"), - max_length_chars("max_length_chars"), width("width", 0), + max_length_chars("max_length_chars"), + text("text"), value("value") {} @@ -414,21 +414,21 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par mFooter(p.footer.value), mLabel(p.label), mIcon(p.icon), - mURL(p.url.value), + mUnique(p.unique.isProvided()), + mCombineBehavior(p.unique.combine), mExpireSeconds(p.duration), mExpireOption(p.expire_option), + mURL(p.url.value), mURLOption(p.url.option), mURLTarget(p.url.target), mForceUrlsExternal(p.force_urls_external), - mUnique(p.unique.isProvided()), - mCombineBehavior(p.unique.combine), - mPriority(p.priority), mPersist(p.persist), mDefaultFunctor(p.functor.isProvided() ? p.functor() : p.name()), + mPriority(p.priority), + mSoundName(""), mLogToChat(p.log_to_chat), mLogToIM(p.log_to_im), - mShowToast(p.show_toast), - mSoundName("") + mShowToast(p.show_toast) { if (p.sound.isProvided() && LLUI::sSettingGroups["config"]->controlExists(p.sound)) @@ -449,7 +449,7 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par mTags.push_back(tag.value); } - mForm = LLNotificationFormPtr(new LLNotificationForm(p.name, p.form_ref.form)); + mForm = std::make_shared<LLNotificationForm>(p.name, p.form_ref.form); } LLNotificationVisibilityRule::LLNotificationVisibilityRule(const LLNotificationVisibilityRule::Rule &p) @@ -479,19 +479,19 @@ LLNotificationVisibilityRule::LLNotificationVisibilityRule(const LLNotificationV } LLNotification::LLNotification(const LLSDParamAdapter<Params>& p) : - mTimestamp(p.time_stamp), - mSubstitutions(p.substitutions), + mId(p.id.isProvided() ? p.id : LLUUID::generateNewID()), mPayload(p.payload), + mSubstitutions(p.substitutions), + mTimestamp(p.time_stamp), mExpiresAt(p.expiry), - mTemporaryResponder(false), - mRespondedTo(false), - mPriority(p.priority), mCancelled(false), + mRespondedTo(false), mIgnored(false), - mResponderObj(NULL), - mId(p.id.isProvided() ? p.id : LLUUID::generateNewID()), + mPriority(p.priority), + mResponderObj(nullptr), mOfferFromAgent(p.offer_from_agent), - mIsDND(p.is_dnd) + mIsDND(p.is_dnd), + mTemporaryResponder(false) { if (p.functor.name.isChosen()) { @@ -860,7 +860,7 @@ void LLNotification::init(const std::string& template_name, const LLSD& form_ele // TODO: something like this so that a missing alert is sensible: //mSubstitutions["_ARGS"] = get_all_arguments_as_text(mSubstitutions); - mForm = LLNotificationFormPtr(new LLNotificationForm(*mTemplatep->mForm)); + mForm = std::make_shared<LLNotificationForm>(*mTemplatep->mForm); mForm->append(form_elements); // apply substitution to form labels @@ -1595,7 +1595,7 @@ bool LLNotifications::loadTemplates() replaceFormText(notification.form_ref.form, "$ignoretext", notification.form_ref.form_template.ignore_text); } } - mTemplates[notification.name] = LLNotificationTemplatePtr(new LLNotificationTemplate(notification)); + mTemplates[notification.name] = std::make_shared<LLNotificationTemplate>(notification); } LL_INFOS() << "...done" << LL_ENDL; @@ -1624,7 +1624,7 @@ bool LLNotifications::loadVisibilityRules() for (LLNotificationVisibilityRule::Rule& rule : params.rules) { - mVisibilityRules.push_back(LLNotificationVisibilityRulePtr(new LLNotificationVisibilityRule(rule))); + mVisibilityRules.push_back(std::make_shared<LLNotificationVisibilityRule>(rule)); } return true; @@ -1675,7 +1675,7 @@ LLNotificationPtr LLNotifications::add(const LLNotification::Params& p) void LLNotifications::add(const LLNotificationPtr pNotif) { - if (pNotif == NULL) return; + if (pNotif == nullptr) return; // first see if we already have it -- if so, that's a problem LLNotificationSet::iterator it=mItems.find(pNotif); @@ -1689,7 +1689,7 @@ void LLNotifications::add(const LLNotificationPtr pNotif) void LLNotifications::cancel(LLNotificationPtr pNotif) { - if (pNotif == NULL || pNotif->isCancelled()) return; + if (pNotif == nullptr || pNotif->isCancelled()) return; LLNotificationSet::iterator it=mItems.find(pNotif); if (it != mItems.end()) @@ -1759,12 +1759,12 @@ void LLNotifications::update(const LLNotificationPtr pNotif) LLNotificationPtr LLNotifications::find(LLUUID uuid) { - LLNotificationPtr target = LLNotificationPtr(new LLNotification(LLNotification::Params().id(uuid))); + LLNotificationPtr target = std::make_shared<LLNotification>(LLNotification::Params().id(uuid)); LLNotificationSet::iterator it=mItems.find(target); if (it == mItems.end()) { LL_DEBUGS("Notifications") << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << LL_ENDL; - return LLNotificationPtr((LLNotification*)NULL); + return LLNotificationPtr((LLNotification*)nullptr); } else { diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 6791458d668d404faefd196b7bd8f18c002de4f2..02737cc9d62bcfeb96ca2d007d4b2a391c5a6b1a 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -330,26 +330,26 @@ public: Params() : name("name"), id("id"), + substitutions("substitutions"), + form_elements("form"), + payload("payload"), priority("priority", NOTIFICATION_PRIORITY_UNSPECIFIED), time_stamp("time"), - payload("payload"), - form_elements("form"), - substitutions("substitutions"), expiry("expiry"), offer_from_agent("offer_from_agent", false), is_dnd("is_dnd", false) { time_stamp = LLDate::now(); - responder = NULL; + responder = nullptr; } Params(const std::string& _name) : name("name"), + substitutions("substitutions"), + form_elements("form"), + payload("payload"), priority("priority", NOTIFICATION_PRIORITY_UNSPECIFIED), time_stamp("time"), - payload("payload"), - form_elements("form"), - substitutions("substitutions"), expiry("expiry"), offer_from_agent("offer_from_agent", false), is_dnd("is_dnd", false) @@ -357,7 +357,7 @@ public: functor.name = _name; name = _name; time_stamp = LLDate::now(); - responder = NULL; + responder = nullptr; } }; @@ -724,8 +724,8 @@ class LLNotificationChannelBase : LOG_CLASS(LLNotificationChannelBase); public: LLNotificationChannelBase(LLNotificationFilter filter) - : mFilter(filter), - mItems() + : mItems(), + mFilter(filter) {} virtual ~LLNotificationChannelBase() {} // you can also connect to a Channel, so you can be notified of @@ -911,7 +911,7 @@ public: /* virtual */ LLNotificationPtr add(const std::string& name, const LLSD& substitutions, const LLSD& payload, - LLNotificationFunctorRegistry::ResponseFunctor functor); + LLNotificationFunctorRegistry::ResponseFunctor functor) override; LLNotificationPtr add(const LLNotification::Params& p); void add(const LLNotificationPtr pNotif); @@ -958,7 +958,7 @@ public: bool isVisibleByRules(LLNotificationPtr pNotification); private: - /*virtual*/ void initSingleton(); + /*virtual*/ void initSingleton() override; void loadPersistentNotifications(); @@ -1101,7 +1101,7 @@ private: return handle_notification; } - void onAdd(LLNotificationPtr p) + void onAdd(LLNotificationPtr p) override { mHistory.push_back(p); } diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h index 69b48feaa5e15645ff964a7c7ae5be835b3f1c56..2f7a643cb8ffd753656a038ad0fb19de2911f142 100644 --- a/indra/llui/llnotificationtemplate.h +++ b/indra/llui/llnotificationtemplate.h @@ -86,9 +86,9 @@ struct LLNotificationTemplate Optional<LLNotification::ECombineBehavior, CombineBehaviorNames> combine; UniquenessConstraint() - : contexts("context"), - combine("combine", LLNotification::REPLACE_WITH_NEW), - dummy_val("") + : dummy_val(""), + contexts("context"), + combine("combine", LLNotification::REPLACE_WITH_NEW) {} }; @@ -206,7 +206,6 @@ struct LLNotificationTemplate functor("functor"), icon("icon"), label("label"), - priority("priority"), sound("sound"), type("type"), value("value"), @@ -215,6 +214,7 @@ struct LLNotificationTemplate url("url"), unique("unique"), form_ref(""), + priority("priority"), tags("tag"), footer("footer") {} @@ -229,8 +229,8 @@ struct LLNotificationTemplate Notifications() : strings("global"), - notifications("notification"), - templates("template") + templates("template"), + notifications("notification") {} }; diff --git a/indra/llui/llprogressbar.cpp b/indra/llui/llprogressbar.cpp index ccdc3ffb7e60e17d7c29e2edff6290bf5838b9f7..6dae460a1aea76127068524e2f58297e06d8bb1c 100644 --- a/indra/llui/llprogressbar.cpp +++ b/indra/llui/llprogressbar.cpp @@ -54,11 +54,11 @@ LLProgressBar::Params::Params() LLProgressBar::LLProgressBar(const LLProgressBar::Params& p) : LLUICtrl(p), + mPercentDone(0.f), mImageBar(p.image_bar), - mImageFill(p.image_fill), - mColorBackground(p.color_bg()), mColorBar(p.color_bar()), - mPercentDone(0.f) + mColorBackground(p.color_bg()), + mImageFill(p.image_fill) {} LLProgressBar::~LLProgressBar() diff --git a/indra/llui/llprogressbar.h b/indra/llui/llprogressbar.h index a8ec83ea00434c169a0cd77bc955daf4a9a0e7e1..44d6d6b441e39b36770f5e6b6002d184fe890914 100644 --- a/indra/llui/llprogressbar.h +++ b/indra/llui/llprogressbar.h @@ -48,9 +48,9 @@ public: LLProgressBar(const Params&); virtual ~LLProgressBar(); - void setValue(const LLSD& value); + void setValue(const LLSD& value) override; - /*virtual*/ void draw(); + /*virtual*/ void draw() override; private: F32 mPercentDone; diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index dd1a7d2eb152fc40d8732bc169929df95308d799..17058137b4b814be6de34ab286e2e8d6363595bf 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -51,10 +51,10 @@ class LLRadioCtrl : public LLCheckBoxCtrl public: typedef LLRadioGroup::ItemParams Params; /*virtual*/ ~LLRadioCtrl(); - /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void setValue(const LLSD& value) override; - /*virtual*/ BOOL postBuild(); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; LLSD getPayload() { return mPayload; } diff --git a/indra/llui/llradiogroup.h b/indra/llui/llradiogroup.h index dcb2f43bfecfeec281a646f69c551db04d0ab762..fee1ddf4de310a6ff7cbb030216ae9d5a8a9cac5 100644 --- a/indra/llui/llradiogroup.h +++ b/indra/llui/llradiogroup.h @@ -63,10 +63,10 @@ public: /*virtual*/ void initFromParams(const Params&); virtual ~LLRadioGroup(); - - virtual BOOL postBuild(); - - virtual BOOL handleKeyHere(KEY key, MASK mask); + + BOOL postBuild() override; + + BOOL handleKeyHere(KEY key, MASK mask) override; void setIndexEnabled(S32 index, BOOL enabled); // return the index value of the selected item @@ -77,29 +77,29 @@ public: void focusSelectedRadioBtn(); // Accept and retrieve strings of the radio group control names - virtual void setValue(const LLSD& value ); - virtual LLSD getValue() const; + void setValue(const LLSD& value ) override; + LLSD getValue() const override; // Update the control as needed. Userdata must be a pointer to the button. void onClickButton(LLUICtrl* clicked_radio); //======================================================================== - LLCtrlSelectionInterface* getSelectionInterface() { return (LLCtrlSelectionInterface*)this; }; + LLCtrlSelectionInterface* getSelectionInterface() override { return (LLCtrlSelectionInterface*)this; }; // LLCtrlSelectionInterface functions - /*virtual*/ S32 getItemCount() const { return mRadioButtons.size(); } - /*virtual*/ BOOL getCanSelect() const { return TRUE; } - /*virtual*/ BOOL selectFirstItem() { return setSelectedIndex(0); } - /*virtual*/ BOOL selectNthItem( S32 index ) { return setSelectedIndex(index); } - /*virtual*/ BOOL selectItemRange( S32 first, S32 last ) { return setSelectedIndex(first); } - /*virtual*/ S32 getFirstSelectedIndex() const { return getSelectedIndex(); } - /*virtual*/ BOOL setCurrentByID( const LLUUID& id ); - /*virtual*/ LLUUID getCurrentID() const; // LLUUID::null if no items in menu - /*virtual*/ BOOL setSelectedByValue(const LLSD& value, BOOL selected); - /*virtual*/ LLSD getSelectedValue(); - /*virtual*/ BOOL isSelected(const LLSD& value) const; - /*virtual*/ BOOL operateOnSelection(EOperation op); - /*virtual*/ BOOL operateOnAll(EOperation op); + /*virtual*/ S32 getItemCount() const override { return mRadioButtons.size(); } + /*virtual*/ BOOL getCanSelect() const override { return TRUE; } + /*virtual*/ BOOL selectFirstItem() override { return setSelectedIndex(0); } + /*virtual*/ BOOL selectNthItem( S32 index ) override { return setSelectedIndex(index); } + /*virtual*/ BOOL selectItemRange( S32 first, S32 last ) override { return setSelectedIndex(first); } + /*virtual*/ S32 getFirstSelectedIndex() const override { return getSelectedIndex(); } + /*virtual*/ BOOL setCurrentByID( const LLUUID& id ) override; + /*virtual*/ LLUUID getCurrentID() const override; // LLUUID::null if no items in menu + /*virtual*/ BOOL setSelectedByValue(const LLSD& value, BOOL selected) override; + /*virtual*/ LLSD getSelectedValue() override; + /*virtual*/ BOOL isSelected(const LLSD& value) const override; + /*virtual*/ BOOL operateOnSelection(EOperation op) override; + /*virtual*/ BOOL operateOnAll(EOperation op) override; private: const LLFontGL* mFont; diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h index 20a2406484a7ce780d0864ceb6a4620ddce23ea2..8a961420885756d393ca8fe17236053ccd2a7a1f 100644 --- a/indra/llui/llresizebar.h +++ b/indra/llui/llresizebar.h @@ -53,10 +53,10 @@ protected: public: - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; void setResizeLimits( S32 min_size, S32 max_size ) { mMinSize = min_size; mMaxSize = max_size; } void setEnableSnapping(BOOL enable) { mSnappingEnabled = enable; } diff --git a/indra/llui/llresizehandle.h b/indra/llui/llresizehandle.h index 7541b9e6c06ac534de59deb50555111596bde1cf..6e9a3b2d8012f7a405c39aa46e178545191994b6 100644 --- a/indra/llui/llresizehandle.h +++ b/indra/llui/llresizehandle.h @@ -49,10 +49,10 @@ protected: LLResizeHandle(const LLResizeHandle::Params&); friend class LLUICtrlFactory; public: - virtual void draw(); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + void draw() override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; void setResizeLimits( S32 min_width, S32 min_height ) { mMinWidth = min_width; mMinHeight = min_height; } diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index f39eed0377f79f76dc4bf6bb4bdc29e45cd42070..2ac2e50e44d4e803f3cdd9cc4e568e9187e79fb6 100644 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -241,9 +241,9 @@ const std::string LLLocale::SYSTEM_LOCALE("C"); LLLocale::LLLocale(const std::string& locale_string) { - mPrevLocaleString = setlocale( LC_ALL, NULL ); + mPrevLocaleString = setlocale( LC_ALL, nullptr ); char* new_locale_string = setlocale( LC_ALL, locale_string.c_str()); - if ( new_locale_string == NULL) + if ( new_locale_string == nullptr) { LL_WARNS_ONCE("LLLocale") << "Failed to set locale " << locale_string << LL_ENDL; setlocale(LC_ALL, SYSTEM_LOCALE.c_str()); diff --git a/indra/llui/llrngwriter.h b/indra/llui/llrngwriter.h index c33aa28613a8b1c3c4e2d6cba4c104d9979c5a5d..7615269c0526f230e2091d027fa719efb8a0cfee 100644 --- a/indra/llui/llrngwriter.h +++ b/indra/llui/llrngwriter.h @@ -37,7 +37,7 @@ public: void writeRNG(const std::string& name, LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const std::string& xml_namespace); void addDefinition(const std::string& type_name, const LLInitParam::BaseBlock& block); - /*virtual*/ std::string getCurrentElementName() { return LLStringUtil::null; } + /*virtual*/ std::string getCurrentElementName() override { return LLStringUtil::null; } LLRNGWriter(); diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index 3b36fbbc84cbf925dfcc528d6c3e4195ae4204ce..acf87731be221fbb577c94806298ffa83fcdacee 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -52,19 +52,19 @@ LLScrollbar::Params::Params() doc_pos ("doc_pos", 0), page_size ("page_size", 0), step_size ("step_size", 1), + thickness("thickness"), thumb_image_vertical("thumb_image_vertical"), thumb_image_horizontal("thumb_image_horizontal"), - track_image_vertical("track_image_vertical"), track_image_horizontal("track_image_horizontal"), + track_image_vertical("track_image_vertical"), + bg_visible("bg_visible", false), track_color("track_color"), thumb_color("thumb_color"), - thickness("thickness"), + bg_color("bg_color", LLColor4::black), up_button("up_button"), down_button("down_button"), left_button("left_button"), - right_button("right_button"), - bg_visible("bg_visible", false), - bg_color("bg_color", LLColor4::black) + right_button("right_button") {} LLScrollbar::LLScrollbar(const Params & p) @@ -78,18 +78,18 @@ LLScrollbar::LLScrollbar(const Params & p) mDocChanged(FALSE), mDragStartX( 0 ), mDragStartY( 0 ), - mLastDelta( 0 ), mHoverGlowStrength(0.15f), mCurGlowStrength(0.f), + mLastDelta( 0 ), mTrackColor( p.track_color() ), mThumbColor ( p.thumb_color() ), + mBGColor(p.bg_color), + mBGVisible(p.bg_visible), mThumbImageV(p.thumb_image_vertical), mThumbImageH(p.thumb_image_horizontal), mTrackImageV(p.track_image_vertical), mTrackImageH(p.track_image_horizontal), - mThickness(p.thickness.isProvided() ? p.thickness : LLUI::sSettingGroups["config"]->getS32("UIScrollbarSize")), - mBGVisible(p.bg_visible), - mBGColor(p.bg_color) + mThickness(p.thickness.isProvided() ? p.thickness : LLUI::sSettingGroups["config"]->getS32("UIScrollbarSize")) { updateThumbRect(); @@ -246,7 +246,7 @@ void LLScrollbar::updateThumbRect() BOOL LLScrollbar::handleMouseDown(S32 x, S32 y, MASK mask) { // Check children first - BOOL handled_by_child = LLView::childrenHandleMouseDown(x, y, mask) != NULL; + BOOL handled_by_child = LLView::childrenHandleMouseDown(x, y, mask) != nullptr; if( !handled_by_child ) { if( mThumbRect.pointInRect(x,y) ) @@ -391,7 +391,7 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask) } else { - handled = childrenHandleHover( x, y, mask ) != NULL; + handled = childrenHandleHover( x, y, mask ) != nullptr; } // Opaque @@ -440,7 +440,7 @@ BOOL LLScrollbar::handleMouseUp(S32 x, S32 y, MASK mask) BOOL handled = FALSE; if( hasMouseCapture() ) { - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); handled = TRUE; } else diff --git a/indra/llui/llscrollbar.h b/indra/llui/llscrollbar.h index 7a9edff8190b51efd174c803881a674c0b0f8609..4ea3a65709a2229bf5615ea9b63e912a52616783 100644 --- a/indra/llui/llscrollbar.h +++ b/indra/llui/llscrollbar.h @@ -79,21 +79,21 @@ protected: public: virtual ~LLScrollbar(); - virtual void setValue(const LLSD& value); + void setValue(const LLSD& value) override; // Overrides from LLView - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string &tooltip_msg); - - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - - virtual void draw(); + BOOL handleKeyHere(KEY key, MASK mask) override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string &tooltip_msg) override; + + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + + void draw() override; // How long the "document" is. void setDocSize( S32 size ); diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index b0fd1068541fc41a0ac53112f8d65607b2c3c4f7..097c6b82da14805c2c6f2baad3059dee74ba50e7 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -69,12 +69,12 @@ static ScrollContainerRegistry::Register<LLPanel> r3("panel", &LLPanel::fromXML) LLScrollContainer::Params::Params() : is_opaque("opaque"), - bg_color("color"), + reserve_scroll_corner("reserve_scroll_corner", false), border_visible("border_visible"), hide_scrollbar("hide_scrollbar"), min_auto_scroll_rate("min_auto_scroll_rate", 100), max_auto_scroll_rate("max_auto_scroll_rate", 1000), - reserve_scroll_corner("reserve_scroll_corner", false), + bg_color("color"), size("size", -1) {} @@ -82,16 +82,16 @@ LLScrollContainer::Params::Params() // Default constructor LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) : LLUICtrl(p), - mAutoScrolling( FALSE ), - mAutoScrollRate( 0.f ), - mBackgroundColor(p.bg_color()), + mScrolledView(nullptr), + mSize(p.size), mIsOpaque(p.is_opaque), - mHideScrollbar(p.hide_scrollbar), + mBackgroundColor(p.bg_color()), mReserveScrollCorner(p.reserve_scroll_corner), + mAutoScrolling( FALSE ), + mAutoScrollRate( 0.f ), mMinAutoScrollRate(p.min_auto_scroll_rate), mMaxAutoScrollRate(p.max_auto_scroll_rate), - mScrolledView(NULL), - mSize(p.size) + mHideScrollbar(p.hide_scrollbar) { static LLUICachedControl<S32> scrollbar_size_control ("UIScrollbarSize", 0); S32 scrollbar_size = (mSize == -1 ? scrollbar_size_control : mSize); @@ -147,9 +147,9 @@ LLScrollContainer::~LLScrollContainer( void ) // destructor takes care of memory deallocation. for( S32 i = 0; i < ORIENTATION_COUNT; i++ ) { - mScrollbar[i] = NULL; + mScrollbar[i] = nullptr; } - mScrolledView = NULL; + mScrolledView = nullptr; } // internal scrollbar handlers @@ -286,7 +286,7 @@ BOOL LLScrollContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, if( !handled ) { handled = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, - cargo_data, accept, tooltip_msg) != NULL; + cargo_data, accept, tooltip_msg) != nullptr; } return TRUE; diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index c4c4d0a136b7ba052bbccc951c7f49644a42a3ac..2b85dc90784be03916b1b66a754c22c7ad795063 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -82,7 +82,7 @@ protected: public: virtual ~LLScrollContainer( void ); - virtual void setValue(const LLSD& value) { mInnerRect.setValue(value); } + void setValue(const LLSD& value) override { mInnerRect.setValue(value); } void setBorderVisible( BOOL b ); @@ -102,18 +102,18 @@ public: S32 getBorderWidth() const; // LLView functionality - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual BOOL handleUnicodeCharHere(llwchar uni_char); - virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + BOOL handleKeyHere(KEY key, MASK mask) override; + BOOL handleUnicodeCharHere(llwchar uni_char) override; + BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ) override; + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; - virtual void draw(); - virtual bool addChild(LLView* view, S32 tab_group = 0); + void draw() override; + bool addChild(LLView* view, S32 tab_group = 0) override; bool autoScroll(S32 x, S32 y); diff --git a/indra/llui/llscrollingpanellist.h b/indra/llui/llscrollingpanellist.h index e8df176ec380595668057e6981ce0ceca832945d..97034ddcc69e68a64c973d8a13d0c22ee07c2d6d 100644 --- a/indra/llui/llscrollingpanellist.h +++ b/indra/llui/llscrollingpanellist.h @@ -60,9 +60,9 @@ public: typedef std::deque<LLScrollingPanel*> panel_list_t; - virtual void setValue(const LLSD& value) {}; + void setValue(const LLSD& value) override {}; - virtual void draw(); + void draw() override; void clearPanels(); S32 addPanel( LLScrollingPanel* panel ); diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h index e16623c94a97ae82a8aac6ad113cd032993b2366..fc18c95803b047e6709d3bfd282ca44420d9a148 100644 --- a/indra/llui/llscrolllistcell.h +++ b/indra/llui/llscrolllistcell.h @@ -80,8 +80,8 @@ public: tool_tip("tool_tip", ""), font("font", LLFontGL::getFontSansSerifSmall()), font_color("font_color", LLColor4::black), - color("color", LLColor4::white), - font_halign("halign", LLFontGL::LEFT) + font_halign("halign", LLFontGL::LEFT), + color("color", LLColor4::white) { addSynonym(column, "name"); addSynonym(font_color, "font-color"); @@ -122,7 +122,7 @@ class LLScrollListSpacer : public LLScrollListCell public: LLScrollListSpacer(const LLScrollListCell::Params& p) : LLScrollListCell(p) {} /*virtual*/ ~LLScrollListSpacer() {}; - /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const {} + /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const override {} }; /* @@ -134,22 +134,24 @@ public: LLScrollListText(const LLScrollListCell::Params&); /*virtual*/ ~LLScrollListText(); - /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const; - /*virtual*/ S32 getContentWidth() const; - /*virtual*/ S32 getHeight() const; - /*virtual*/ void setValue(const LLSD& value); - /*virtual*/ const LLSD getValue() const; - /*virtual*/ BOOL getVisible() const; - /*virtual*/ void highlightText(S32 offset, S32 num_chars); + /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const override; + /*virtual*/ S32 getContentWidth() const override; + /*virtual*/ S32 getHeight() const override; + /*virtual*/ void setValue(const LLSD& value) override; + /*virtual*/ const LLSD getValue() const override; + /*virtual*/ BOOL getVisible() const override; + /*virtual*/ void highlightText(S32 offset, S32 num_chars) override; - /*virtual*/ void setColor(const LLColor4&); - /*virtual*/ BOOL isText() const; - /*virtual*/ const std::string & getToolTip() const; - /*virtual*/ BOOL needsToolTip() const; + /*virtual*/ void setColor(const LLColor4&) override; + /*virtual*/ BOOL isText() const override; + /*virtual*/ const std::string & getToolTip() const override; + /*virtual*/ BOOL needsToolTip() const override; S32 getTextWidth() const { return mTextWidth;} - void setTextWidth(S32 value) { mTextWidth = value;} - virtual void setWidth(S32 width) { LLScrollListCell::setWidth(width); mTextWidth = width; } + void setTextWidth(S32 value) { mTextWidth = value;} + + void setWidth(S32 width) override + { LLScrollListCell::setWidth(width); mTextWidth = width; } void setText(const LLStringExplicit& text); void setFontStyle(const U8 font_style); @@ -178,15 +180,15 @@ class LLScrollListIcon : public LLScrollListCell public: LLScrollListIcon(const LLScrollListCell::Params& p); /*virtual*/ ~LLScrollListIcon(); - /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const; - /*virtual*/ S32 getWidth() const; - /*virtual*/ S32 getHeight() const; - /*virtual*/ const LLSD getValue() const; - /*virtual*/ void setColor(const LLColor4&); - /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const override; + /*virtual*/ S32 getWidth() const override; + /*virtual*/ S32 getHeight() const override; + /*virtual*/ const LLSD getValue() const override; + /*virtual*/ void setColor(const LLColor4&) override; + /*virtual*/ void setValue(const LLSD& value) override; void setClickCallback(BOOL (*callback)(void*), void* user_data); - virtual BOOL handleClick(); + BOOL handleClick() override; private: LLPointer<LLUIImage> mIcon; @@ -205,14 +207,14 @@ class LLScrollListCheck : public LLScrollListCell public: LLScrollListCheck( const LLScrollListCell::Params&); /*virtual*/ ~LLScrollListCheck(); - /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const; - /*virtual*/ S32 getHeight() const { return 0; } - /*virtual*/ const LLSD getValue() const; - /*virtual*/ void setValue(const LLSD& value); - /*virtual*/ void onCommit(); + /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const override; + /*virtual*/ S32 getHeight() const override { return 0; } + /*virtual*/ const LLSD getValue() const override; + /*virtual*/ void setValue(const LLSD& value) override; + /*virtual*/ void onCommit() override; - /*virtual*/ BOOL handleClick(); - /*virtual*/ void setEnabled(BOOL enable); + /*virtual*/ BOOL handleClick() override; + /*virtual*/ void setEnabled(BOOL enable) override; LLCheckBoxCtrl* getCheckBox() { return mCheckBox; } @@ -224,8 +226,8 @@ class LLScrollListDate : public LLScrollListText { public: LLScrollListDate( const LLScrollListCell::Params& p ); - virtual void setValue(const LLSD& value); - virtual const LLSD getValue() const; + void setValue(const LLSD& value) override; + const LLSD getValue() const override; private: LLDate mDate; @@ -236,18 +238,18 @@ class LLScrollListLineEditor : public LLScrollListCell public: LLScrollListLineEditor( const LLScrollListCell::Params&); /*virtual*/ ~LLScrollListLineEditor(); - virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; - virtual S32 getHeight() const { return 0; } - virtual const LLSD getValue() const { return mLineEditor->getValue(); } - virtual void setValue(const LLSD& value) { mLineEditor->setValue(value); } - virtual void onCommit() { mLineEditor->onCommit(); } - virtual BOOL handleClick(); + void draw(const LLColor4& color, const LLColor4& highlight_color) const override; + S32 getHeight() const override { return 0; } + const LLSD getValue() const override { return mLineEditor->getValue(); } + void setValue(const LLSD& value) override { mLineEditor->setValue(value); } + void onCommit() override { mLineEditor->onCommit(); } + BOOL handleClick() override; virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); virtual BOOL handleUnicodeCharHere(llwchar uni_char ); - virtual void setEnabled(BOOL enable) { mLineEditor->setEnabled(enable); } + void setEnabled(BOOL enable) override { mLineEditor->setEnabled(enable); } LLLineEditor* getLineEditor() { return mLineEditor; } - virtual BOOL isText() const { return FALSE; } + BOOL isText() const override { return FALSE; } private: LLLineEditor* mLineEditor; diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp index 9de9e7a8c4ca31a681e494130f09d70d52665ff5..60353955e346d3a7521abfc7ce2ba99a74bd5d2c 100644 --- a/indra/llui/llscrolllistcolumn.cpp +++ b/indra/llui/llscrolllistcolumn.cpp @@ -308,17 +308,17 @@ const LLScrollListColumn::Params& LLScrollListColumn::getDefaultParams() LLScrollListColumn::LLScrollListColumn(const Params& p, LLScrollListCtrl* parent) -: mWidth(0), - mIndex (-1), - mParentCtrl(parent), - mName(p.name), +: mName(p.name), + mSortingColumn(p.sort_column), mLabel(p.header.label), - mHeader(NULL), - mMaxContentWidth(0), - mDynamicWidth(p.width.dynamic_width), mRelWidth(p.width.relative_width), + mDynamicWidth(p.width.dynamic_width), + mMaxContentWidth(0), + mIndex (-1), + mParentCtrl(parent), + mHeader(nullptr), mFontAlignment(p.halign), - mSortingColumn(p.sort_column) + mWidth(0) { if (p.sort_ascending.isProvided()) { diff --git a/indra/llui/llscrolllistcolumn.h b/indra/llui/llscrolllistcolumn.h index b4d4a6d05e7b8168702dfc96356d01669816ebbb..a0579c8bfdf5282d6cf0b762aa5533dacd208c5e 100644 --- a/indra/llui/llscrolllistcolumn.h +++ b/indra/llui/llscrolllistcolumn.h @@ -49,11 +49,11 @@ public: LLScrollColumnHeader(const Params&); ~LLScrollColumnHeader(); - /*virtual*/ void draw(); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); + /*virtual*/ void draw() override; + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; - /*virtual*/ LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding); - /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); + /*virtual*/ LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding) override; + /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false) override; LLScrollListColumn* getColumn() { return mColumn; } void setHasResizableElement(BOOL resizable); @@ -144,7 +144,7 @@ public: static const Params& getDefaultParams(); //NOTE: this is default constructible so we can store it in a map. - LLScrollListColumn(const Params& p = getDefaultParams(), LLScrollListCtrl* = NULL); + LLScrollListColumn(const Params& p = getDefaultParams(), LLScrollListCtrl* = nullptr); void setWidth(S32 width); S32 getWidth() const { return mWidth; } diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index da23ea0025a52a8c49226230ea52bb114006e197..976bc80762c9ec4dc7c8428189304d2a37df2b21 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -153,12 +153,12 @@ public: void sortByColumnIndex(U32 column, BOOL ascending); // LLCtrlListInterface functions - virtual S32 getItemCount() const; + S32 getItemCount() const override; // Adds a single column descriptor: ["name" : string, "label" : string, "width" : integer, "relwidth" : integer ] virtual void addColumn(const LLScrollListColumn::Params& column, EAddPosition pos = ADD_BOTTOM); - virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); - virtual void clearColumns(); - virtual void setColumnLabel(const std::string& column, const std::string& label); + void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM) override; + void clearColumns() override; + void setColumnLabel(const std::string& column, const std::string& label) override; virtual bool preProcessChildNode(LLXMLNodePtr child); virtual LLScrollListColumn* getColumn(S32 index); virtual LLScrollListColumn* getColumn(const std::string& name); @@ -168,28 +168,28 @@ public: // Adds a single element, from an array of: // "columns" => [ "column" => column name, "value" => value, "type" => type, "font" => font, "font-style" => style ], "id" => uuid // Creates missing columns automatically. - virtual LLScrollListItem* addElement(const LLSD& element, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); + LLScrollListItem* addElement(const LLSD& element, EAddPosition pos = ADD_BOTTOM, void* userdata = nullptr) override; virtual LLScrollListItem* addRow(LLScrollListItem *new_item, const LLScrollListItem::Params& value, EAddPosition pos = ADD_BOTTOM); virtual LLScrollListItem* addRow(const LLScrollListItem::Params& value, EAddPosition pos = ADD_BOTTOM); // Simple add element. Takes a single array of: // [ "value" => value, "font" => font, "font-style" => style ] - virtual void clearRows(); // clears all elements - virtual void sortByColumn(const std::string& name, BOOL ascending); + void clearRows() override; // clears all elements + void sortByColumn(const std::string& name, BOOL ascending) override; // These functions take and return an array of arrays of elements, as above - virtual void setValue(const LLSD& value ); - virtual LLSD getValue() const; + void setValue(const LLSD& value ) override; + LLSD getValue() const override; - LLCtrlSelectionInterface* getSelectionInterface() { return (LLCtrlSelectionInterface*)this; } - LLCtrlListInterface* getListInterface() { return (LLCtrlListInterface*)this; } - LLCtrlScrollInterface* getScrollInterface() { return (LLCtrlScrollInterface*)this; } + LLCtrlSelectionInterface* getSelectionInterface() override { return (LLCtrlSelectionInterface*)this; } + LLCtrlListInterface* getListInterface() override { return (LLCtrlListInterface*)this; } + LLCtrlScrollInterface* getScrollInterface() override { return (LLCtrlScrollInterface*)this; } // DEPRECATED: Use setSelectedByValue() below. - BOOL setCurrentByID( const LLUUID& id ) { return selectByID(id); } - virtual LLUUID getCurrentID() const { return getStringUUIDSelectedItem(); } + BOOL setCurrentByID( const LLUUID& id ) override { return selectByID(id); } + LLUUID getCurrentID() const override { return getStringUUIDSelectedItem(); } - BOOL operateOnSelection(EOperation op); - BOOL operateOnAll(EOperation op); + BOOL operateOnSelection(EOperation op) override; + BOOL operateOnAll(EOperation op) override; // returns FALSE if unable to set the max count so low BOOL setMaxItemCount(S32 max_count); @@ -198,16 +198,16 @@ public: // Match item by value.asString(), which should work for string, integer, uuid. // Returns FALSE if not found. - BOOL setSelectedByValue(const LLSD& value, BOOL selected); + BOOL setSelectedByValue(const LLSD& value, BOOL selected) override; BOOL isSorted() const { return mSorted; } - virtual BOOL isSelected(const LLSD& value) const; + BOOL isSelected(const LLSD& value) const override; BOOL handleClick(S32 x, S32 y, MASK mask); - BOOL selectFirstItem(); - BOOL selectNthItem( S32 index ); - BOOL selectItemRange( S32 first, S32 last ); + BOOL selectFirstItem() override; + BOOL selectNthItem( S32 index ) override; + BOOL selectItemRange( S32 first, S32 last ) override; BOOL selectItemAt(S32 x, S32 y, MASK mask); void deleteSingleItem( S32 index ); @@ -231,7 +231,7 @@ public: void swapWithPrevious(S32 index); void setCanSelect(BOOL can_select) { mCanSelect = can_select; } - virtual BOOL getCanSelect() const { return mCanSelect; } + BOOL getCanSelect() const override { return mCanSelect; } S32 getItemIndex( LLScrollListItem* item ) const; S32 getItemIndex( const LLUUID& item_id ) const; @@ -241,14 +241,14 @@ public: // "Simple" interface: use this when you're creating a list that contains only unique strings, only // one of which can be selected at a time. - virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); + LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()) override; BOOL selectItemByLabel( const std::string& item, BOOL case_sensitive = TRUE, S32 column = 0 ); // FALSE if item not found BOOL selectItemByPrefix(const std::string& target, BOOL case_sensitive = TRUE); BOOL selectItemByPrefix(const LLWString& target, BOOL case_sensitive = TRUE); LLScrollListItem* getItemByLabel( const std::string& item, BOOL case_sensitive = TRUE, S32 column = 0 ); const std::string getSelectedItemLabel(S32 column = 0) const; - LLSD getSelectedValue(); + LLSD getSelectedValue() override; // DEPRECATED: Use LLSD versions of setCommentText() and getSelectedValue(). // "StringUUID" interface: use this when you're creating a list that contains non-unique strings each of which @@ -257,7 +257,7 @@ public: LLUUID getStringUUIDSelectedItem() const; LLScrollListItem* getFirstSelected() const; - virtual S32 getFirstSelectedIndex() const; + S32 getFirstSelectedIndex() const override; std::vector<LLScrollListItem*> getAllSelected() const; S32 getNumSelected() const; LLScrollListItem* getLastSelectedItem() const { return mLastSelected; } @@ -293,8 +293,8 @@ public: S32 getMaxSelectable() { return mMaxSelectable; } - virtual S32 getScrollPos() const; - virtual void setScrollPos( S32 pos ); + S32 getScrollPos() const override; + void setScrollPos( S32 pos ) override; S32 getPageLines() { return mPageLines; } S32 getSearchColumn(); void setSearchColumn(S32 column) { mSearchColumn = column; } @@ -310,30 +310,30 @@ public: void setContextMenu(const ContextMenuType &menu) { mContextMenuType = menu; } // Overridden from LLView - /*virtual*/ void draw(); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); - /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); - /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); - /*virtual*/ void setEnabled(BOOL enabled); - /*virtual*/ void setFocus( BOOL b ); - /*virtual*/ void onFocusReceived(); - /*virtual*/ void onFocusLost(); - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - - virtual BOOL isDirty() const; - virtual void resetDirty(); // Clear dirty state + /*virtual*/ void draw() override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask) override; + /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char) override; + /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; + /*virtual*/ void setEnabled(BOOL enabled) override; + /*virtual*/ void setFocus( BOOL b ) override; + /*virtual*/ void onFocusReceived() override; + /*virtual*/ void onFocusLost() override; + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + + BOOL isDirty() const override; + void resetDirty() override; // Clear dirty state virtual void updateLayout(); virtual void fitContents(S32 max_width, S32 max_height); - virtual LLRect getRequiredRect(); + LLRect getRequiredRect() override; static BOOL rowPreceeds(LLScrollListItem *new_row, LLScrollListItem *test_row); LLRect getItemListRect() { return mItemListRect; } @@ -359,17 +359,17 @@ public: void setCollapseEmptyColumns(BOOL collapse); LLScrollListItem* hitItem(S32 x,S32 y); - virtual void scrollToShowSelected(); + void scrollToShowSelected() override; // LLEditMenuHandler functions - virtual void copy(); - virtual BOOL canCopy() const; - virtual void cut(); - virtual BOOL canCut() const; - virtual void selectAll(); - virtual BOOL canSelectAll() const; - virtual void deselect(); - virtual BOOL canDeselect() const; + void copy() override; + BOOL canCopy() const override; + void cut() override; + BOOL canCut() const override; + void selectAll() override; + BOOL canSelectAll() const override; + void deselect() override; + BOOL canDeselect() const override; void setNumDynamicColumns(S32 num) { mNumDynamicWidthColumns = num; } void updateStaticColumnWidth(LLScrollListColumn* col, S32 new_width); diff --git a/indra/llui/llscrolllistitem.cpp b/indra/llui/llscrolllistitem.cpp index 4482a030ea1c27bb69c3b06179a1bf6e3a05fa6a..78bb35d9fd2e934d17db320d4502b641f6144258 100644 --- a/indra/llui/llscrolllistitem.cpp +++ b/indra/llui/llscrolllistitem.cpp @@ -73,7 +73,7 @@ void LLScrollListItem::setNumColumns(S32 columns) for (S32 col = prev_columns; col < columns; ++col) { - mColumns[col] = NULL; + mColumns[col] = nullptr; } } @@ -102,7 +102,7 @@ LLScrollListCell* LLScrollListItem::getColumn(const S32 i) const { return mColumns[i]; } - return NULL; + return nullptr; } std::string LLScrollListItem::getContentsCSV() const diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp index 5bfb206fc266b63cb0846fd9cb715ab75dec2b11..21f8b20054fc445255fa51fa113a3da9a29a6d26 100644 --- a/indra/llui/llsearcheditor.cpp +++ b/indra/llui/llsearcheditor.cpp @@ -35,8 +35,8 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p) : LLUICtrl(p), - mSearchButton(NULL), - mClearButton(NULL) + mSearchButton(nullptr), + mClearButton(nullptr) { S32 srch_btn_top = p.search_button.top_pad + p.search_button.rect.height; S32 srch_btn_right = p.search_button.rect.width + p.search_button.left_pad; diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h index 3b128682256f624d78b07857dacd5a4b7f911bb9..0638e28289aec502f8b0d29a9841f2df21ab2978 100644 --- a/indra/llui/llsearcheditor.h +++ b/indra/llui/llsearcheditor.h @@ -52,8 +52,8 @@ public: Params() : search_button("search_button"), - search_button_visible("search_button_visible"), - clear_button("clear_button"), + clear_button("clear_button"), + search_button_visible("search_button_visible"), clear_button_visible("clear_button_visible") {} }; @@ -67,19 +67,19 @@ protected: public: virtual ~LLSearchEditor() {} - /*virtual*/ void draw(); + /*virtual*/ void draw() override; void setText(const LLStringExplicit &new_text) { mSearchEditor->setText(new_text); } const std::string& getText() const { return mSearchEditor->getText(); } // LLUICtrl interface - virtual void setValue(const LLSD& value ); - virtual LLSD getValue() const; - virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); - virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); + void setValue(const LLSD& value ) override; + LLSD getValue() const override; + BOOL setTextArg( const std::string& key, const LLStringExplicit& text ) override; + BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ) override; virtual void setLabel( const LLStringExplicit &new_label ); - virtual void clear(); - virtual void setFocus( BOOL b ); + void clear() override; + void setFocus( BOOL b ) override; void setKeystrokeCallback( commit_callback_t cb ) { mKeystrokeCallback = cb; } void setTextChangedCallback( commit_callback_t cb ) { mTextChangedCallback = cb; } diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp index 6230d0f984dc4bf47f44f56c53dd697551230812..7426807026f31158dcab2d07bf9a768dda6ffec3 100644 --- a/indra/llui/llslider.cpp +++ b/indra/llui/llslider.cpp @@ -61,10 +61,6 @@ LLSlider::Params::Params() LLSlider::LLSlider(const LLSlider::Params& p) : LLF32UICtrl(p), mMouseOffset( 0 ), - mOrientation ((p.orientation() == "horizontal") ? HORIZONTAL : VERTICAL), - mTrackColor(p.track_color()), - mThumbOutlineColor(p.thumb_outline_color()), - mThumbCenterColor(p.thumb_center_color()), mThumbImage(p.thumb_image), mThumbImagePressed(p.thumb_image_pressed), mThumbImageDisabled(p.thumb_image_disabled), @@ -72,13 +68,17 @@ LLSlider::LLSlider(const LLSlider::Params& p) mTrackImageVertical(p.track_image_vertical), mTrackHighlightHorizontalImage(p.track_highlight_horizontal_image), mTrackHighlightVerticalImage(p.track_highlight_vertical_image), - mMouseDownSignal(NULL), - mMouseUpSignal(NULL) + mOrientation ((p.orientation() == "horizontal") ? HORIZONTAL : VERTICAL), + mTrackColor(p.track_color()), + mThumbOutlineColor(p.thumb_outline_color()), + mThumbCenterColor(p.thumb_center_color()), + mMouseDownSignal(nullptr), + mMouseUpSignal(nullptr) { mViewModel->setValue(p.initial_value); updateThumbRect(); mDragStartThumbRect = mThumbRect; - setControlName(p.control_name, NULL); + setControlName(p.control_name, nullptr); setValue(getValueF32()); if (p.mouse_down_callback.isProvided()) @@ -206,7 +206,7 @@ BOOL LLSlider::handleMouseUp(S32 x, S32 y, MASK mask) if( hasMouseCapture() ) { - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); if (mMouseUpSignal) (*mMouseUpSignal)( this, getValueF32() ); diff --git a/indra/llui/llslider.h b/indra/llui/llslider.h index 3b492d81823a34aacca689ac424c0b9314130847..5c784c67d9b587b673e2c2dd744e8208b4038d1f 100644 --- a/indra/llui/llslider.h +++ b/indra/llui/llslider.h @@ -63,22 +63,26 @@ public: virtual ~LLSlider(); void setValue( F32 value, BOOL from_event = FALSE ); // overrides for LLF32UICtrl methods - virtual void setValue(const LLSD& value ) { setValue((F32)value.asReal(), TRUE); } - - virtual void setMinValue(const LLSD& min_value) { setMinValue((F32)min_value.asReal()); } - virtual void setMaxValue(const LLSD& max_value) { setMaxValue((F32)max_value.asReal()); } - virtual void setMinValue(F32 min_value) { LLF32UICtrl::setMinValue(min_value); updateThumbRect(); } - virtual void setMaxValue(F32 max_value) { LLF32UICtrl::setMaxValue(max_value); updateThumbRect(); } + void setValue(const LLSD& value ) override { setValue((F32)value.asReal(), TRUE); } + + void setMinValue(const LLSD& min_value) override { setMinValue((F32)min_value.asReal()); } + void setMaxValue(const LLSD& max_value) override { setMaxValue((F32)max_value.asReal()); } + + void setMinValue(F32 min_value) override + { LLF32UICtrl::setMinValue(min_value); updateThumbRect(); } + + void setMaxValue(F32 max_value) override + { LLF32UICtrl::setMaxValue(max_value); updateThumbRect(); } boost::signals2::connection setMouseDownCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setMouseUpCallback( const commit_signal_t::slot_type& cb ); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - virtual void draw(); + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleKeyHere(KEY key, MASK mask) override; + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + void draw() override; private: void setValueAndCommit(F32 value); diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index f5b6e68fe804df9339b6848dac47cc66e731fda0..ee93eb52ba2b4a24533978ae39a17335ed21ca5e 100644 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -49,17 +49,17 @@ static LLDefaultChildRegistry::Register<LLSliderCtrl> r("slider"); LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p) : LLF32UICtrl(p), - mLabelBox( NULL ), - mEditor( NULL ), - mTextBox( NULL ), mFont(p.font), mShowText(p.show_text), mCanEditText(p.can_edit_text), mPrecision(p.decimal_digits), + mLabelBox(nullptr ), + mLabelWidth(p.label_width), + mEditor(nullptr ), + mTextBox(nullptr ), mTextEnabledColor(p.text_color()), mTextDisabledColor(p.text_disabled_color()), - mLabelWidth(p.label_width), - mEditorCommitSignal(NULL) + mEditorCommitSignal(nullptr) { S32 top = getRect().getHeight(); S32 bottom = 0; diff --git a/indra/llui/llsliderctrl.h b/indra/llui/llsliderctrl.h index 67cca9ef04efc701fbde13bcd692d0f8330938dd..2991f1f317eb3be36b2628c91ce706e3acdcf40c 100644 --- a/indra/llui/llsliderctrl.h +++ b/indra/llui/llsliderctrl.h @@ -60,21 +60,21 @@ public: Optional<LLTextBox::Params> slider_label; Params() - : text_width("text_width"), + : orientation("orientation", std::string ("horizontal")), label_width("label_width"), + text_width("text_width"), show_text("show_text"), can_edit_text("can_edit_text"), is_volume_slider("volume"), decimal_digits("decimal_digits", 3), text_color("text_color"), text_disabled_color("text_disabled_color"), + mouse_down_callback("mouse_down_callback"), + mouse_up_callback("mouse_up_callback"), slider_bar("slider_bar"), value_editor("value_editor"), value_text("value_text"), - slider_label("slider_label"), - mouse_down_callback("mouse_down_callback"), - mouse_up_callback("mouse_up_callback"), - orientation("orientation", std::string ("horizontal")) + slider_label("slider_label") {} }; protected: @@ -83,28 +83,30 @@ protected: public: virtual ~LLSliderCtrl(); - /*virtual*/ F32 getValueF32() const { return mSlider->getValueF32(); } + /*virtual*/ F32 getValueF32() const override { return mSlider->getValueF32(); } void setValue(F32 v, BOOL from_event = FALSE); - /*virtual*/ void setValue(const LLSD& value) { setValue((F32)value.asReal(), TRUE); } - /*virtual*/ LLSD getValue() const { return LLSD(getValueF32()); } - /*virtual*/ BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); + /*virtual*/ void setValue(const LLSD& value) override { setValue((F32)value.asReal(), TRUE); } + /*virtual*/ LLSD getValue() const override { return LLSD(getValueF32()); } + /*virtual*/ BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ) override; BOOL isMouseHeldDown() const { return mSlider->hasMouseCapture(); } virtual void setPrecision(S32 precision); - /*virtual*/ void setEnabled( BOOL b ); - /*virtual*/ void clear(); + /*virtual*/ void setEnabled( BOOL b ) override; + /*virtual*/ void clear() override; - /*virtual*/ void setMinValue(const LLSD& min_value) { setMinValue((F32)min_value.asReal()); } - /*virtual*/ void setMaxValue(const LLSD& max_value) { setMaxValue((F32)max_value.asReal()); } - /*virtual*/ void setMinValue(F32 min_value) { mSlider->setMinValue(min_value); updateText(); } - /*virtual*/ void setMaxValue(F32 max_value) { mSlider->setMaxValue(max_value); updateText(); } - /*virtual*/ void setIncrement(F32 increment) { mSlider->setIncrement(increment);} + /*virtual*/ void setMinValue(const LLSD& min_value) override { setMinValue((F32)min_value.asReal()); } + /*virtual*/ void setMaxValue(const LLSD& max_value) override { setMaxValue((F32)max_value.asReal()); } + /*virtual*/ void setMinValue(F32 min_value) override + { mSlider->setMinValue(min_value); updateText(); } + /*virtual*/ void setMaxValue(F32 max_value) override + { mSlider->setMaxValue(max_value); updateText(); } + /*virtual*/ void setIncrement(F32 increment) override { mSlider->setIncrement(increment);} - F32 getMinValue() const { return mSlider->getMinValue(); } - F32 getMaxValue() const { return mSlider->getMaxValue(); } + F32 getMinValue() const override { return mSlider->getMinValue(); } + F32 getMaxValue() const override { return mSlider->getMaxValue(); } void setLabel(const LLStringExplicit& label) { if (mLabelBox) mLabelBox->setText(label); } void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } @@ -114,12 +116,12 @@ public: boost::signals2::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setSliderEditorCommitCallback( const commit_signal_t::slot_type& cb ); - /*virtual*/ void onTabInto(); + /*virtual*/ void onTabInto() override; - /*virtual*/ void setTentative(BOOL b); // marks value as tentative - /*virtual*/ void onCommit(); // mark not tentative, then commit + /*virtual*/ void setTentative(BOOL b) override; // marks value as tentative + /*virtual*/ void onCommit() override; // mark not tentative, then commit - /*virtual*/ void setControlName(const std::string& control_name, LLView* context) + /*virtual*/ void setControlName(const std::string& control_name, LLView* context) override { LLUICtrl::setControlName(control_name, context); mSlider->setControlName(control_name, context); diff --git a/indra/llui/llspellcheck.cpp b/indra/llui/llspellcheck.cpp index 6ac5dc16c82c99a5279308978c03d82df98cb89a..402b43214388b306d6de47534167d58d63f82809 100644 --- a/indra/llui/llspellcheck.cpp +++ b/indra/llui/llspellcheck.cpp @@ -55,7 +55,7 @@ LLSD LLSpellChecker::sDictMap; LLSpellChecker::settings_change_signal_t LLSpellChecker::sSettingsChangeSignal; LLSpellChecker::LLSpellChecker() - : mHunspell(NULL) + : mHunspell(nullptr) { // Load initial dictionary information refreshDictionaryMap(); @@ -312,7 +312,7 @@ void LLSpellChecker::initHunspell(const std::string& dict_language) if (mHunspell) { delete mHunspell; - mHunspell = NULL; + mHunspell = nullptr; mDictLanguage.clear(); mDictFile.clear(); mIgnoreList.clear(); diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp index 8250b17e4c3d20ac61fc1821499bd4b159b64dd6..40ebe5a4541910e9f1cb43fa1d25c6a1668c080f 100644 --- a/indra/llui/llspinctrl.cpp +++ b/indra/llui/llspinctrl.cpp @@ -64,11 +64,11 @@ LLSpinCtrl::Params::Params() LLSpinCtrl::LLSpinCtrl(const LLSpinCtrl::Params& p) : LLF32UICtrl(p), - mLabelBox(NULL), - mbHasBeenSet( FALSE ), mPrecision(p.decimal_digits), + mLabelBox(nullptr), mTextEnabledColor(p.text_enabled_color()), - mTextDisabledColor(p.text_disabled_color()) + mTextDisabledColor(p.text_disabled_color()), + mbHasBeenSet( FALSE ) { static LLUICachedControl<S32> spinctrl_spacing ("UISpinctrlSpacing", 0); static LLUICachedControl<S32> spinctrl_btn_width ("UISpinctrlBtnWidth", 0); diff --git a/indra/llui/llspinctrl.h b/indra/llui/llspinctrl.h index e34add879d5155ad039b2d118a01546f1787798b..d31277e3cd51634d77ea7397d1ece0f2ce7ff247 100644 --- a/indra/llui/llspinctrl.h +++ b/indra/llui/llspinctrl.h @@ -62,17 +62,17 @@ public: virtual ~LLSpinCtrl() {} // Children all cleaned up by default view destructor. virtual void forceSetValue(const LLSD& value ) ; - virtual void setValue(const LLSD& value ); + void setValue(const LLSD& value ) override; F32 get() const { return getValueF32(); } void set(F32 value) { setValue(value); mInitialValue = value; } BOOL isMouseHeldDown() const; - virtual void setEnabled( BOOL b ); - virtual void setFocus( BOOL b ); - virtual void clear(); - virtual BOOL isDirty() const { return( getValueF32() != mInitialValue ); } - virtual void resetDirty() { mInitialValue = getValueF32(); } + void setEnabled( BOOL b ) override; + void setFocus( BOOL b ) override; + void clear() override; + BOOL isDirty() const override { return( getValueF32() != mInitialValue ); } + void resetDirty() override { mInitialValue = getValueF32(); } virtual void setPrecision(S32 precision); @@ -81,15 +81,15 @@ public: void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; updateLabelColor();} void setAllowEdit(BOOL allow_edit); - virtual void onTabInto(); + void onTabInto() override; - virtual void setTentative(BOOL b); // marks value as tentative - virtual void onCommit(); // mark not tentative, then commit + void setTentative(BOOL b) override; // marks value as tentative + void onCommit() override; // mark not tentative, then commit void forceEditorCommit(); // for commit on external button - virtual BOOL handleScrollWheel(S32 x,S32 y,S32 clicks); - virtual BOOL handleKeyHere(KEY key, MASK mask); + BOOL handleScrollWheel(S32 x,S32 y,S32 clicks) override; + BOOL handleKeyHere(KEY key, MASK mask) override; void onEditorCommit(const LLSD& data); static void onEditorGainFocus(LLFocusableElement* caller, void *userdata); diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 9f9bf17636a9294d35f97e4fe1db59bfd0a61f04..4654cceb9f0421f1ac1c9be9150504c0576037e2 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -159,10 +159,10 @@ LLStatBar::Params::Params() bar_min("bar_min", 0.f), bar_max("bar_max", 0.f), tick_spacing("tick_spacing", 0.f), - decimal_digits("decimal_digits", 3), show_bar("show_bar", false), show_history("show_history", false), scale_range("scale_range", true), + decimal_digits("decimal_digits", 3), num_frames("num_frames", 200), num_frames_short("num_frames_short", 20), max_height("max_height", 100), @@ -176,29 +176,29 @@ LLStatBar::Params::Params() LLStatBar::LLStatBar(const Params& p) : LLView(p), - mLabel(p.label), - mUnitLabel(p.unit_label), mTargetMinBar(llmin(p.bar_min, p.bar_max)), mTargetMaxBar(llmax(p.bar_max, p.bar_min)), mCurMaxBar(p.bar_max), - mCurMinBar(0), - mDecimalDigits(p.decimal_digits), + mCurMinBar(0), + mTickSpacing(p.tick_spacing), + mDecimalDigits(p.decimal_digits), mNumHistoryFrames(p.num_frames), mNumShortHistoryFrames(p.num_frames_short), mMaxHeight(p.max_height), + mOrientation(p.orientation), + mLastDisplayValue(0.f), + mStatType(STAT_NONE), + mLabel(p.label), + mUnitLabel(p.unit_label), mDisplayBar(p.show_bar), mDisplayHistory(p.show_history), - mOrientation(p.orientation), mAutoScaleMax(!p.bar_max.isProvided()), - mAutoScaleMin(!p.bar_min.isProvided()), - mTickSpacing(p.tick_spacing), - mLastDisplayValue(0.f), - mStatType(STAT_NONE) + mAutoScaleMin(!p.bar_min.isProvided()) { mFloatingTargetMinBar = mTargetMinBar; mFloatingTargetMaxBar = mTargetMaxBar; - mStat.valid = NULL; + mStat.valid = nullptr; // tick value will be automatically calculated later if (!p.tick_spacing.isProvided() && p.bar_min.isProvided() && p.bar_max.isProvided()) { diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 1ff4c67fc5100b82a157b7e4b5e50e00d9753fb8..6a4bb980fc49f72ed385e5c6cb90454354d81ed8 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -59,16 +59,16 @@ public: }; LLStatBar(const Params&); - virtual void draw(); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); + void draw() override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; void setStat(const std::string& stat_name); void setRange(F32 bar_min, F32 bar_max); void getRange(F32& bar_min, F32& bar_max) { bar_min = mTargetMinBar; bar_max = mTargetMaxBar; } - /*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options. + /*virtual*/ LLRect getRequiredRect() override; // Return the height of this object, given the set options. private: void drawLabelAndValue( F32 mean, std::string &unit_label, LLRect &bar_rect, S32 decimal_digits ); diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index 6fb5802d87fdb9892dc11b1625f53b86b441d66f..aae8e3efb0d99d679e9f78e7c24524b1c6141507 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -44,13 +44,13 @@ LLStatGraph::LLStatGraph(const Params& p) : LLView(p), - mMin(p.min), - mMax(p.max), + mNewStatFloatp(p.stat.count_stat_float), mPerSec(p.per_sec), - mPrecision(p.precision), mValue(p.value), + mMin(p.min), + mMax(p.max), mUnits(p.units), - mNewStatFloatp(p.stat.count_stat_float) + mPrecision(p.precision) { setToolTip(p.name()); diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 007921f40f4cf7575652e012c13dcb1cd0fc8e5b..6c802f6edd54482cf2aa13b38e4a133a73454ee0 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -99,7 +99,7 @@ public: void setMin(const F32 min); void setMax(const F32 max); - virtual void draw(); + void draw() override; /*virtual*/ void setValue(const LLSD& value); diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp index a24c89332c930c754956cfc11c45863e499eb6ca..74fa7310eeddba53e2afe2ebe644d690c4bb9655 100644 --- a/indra/llui/llstyle.cpp +++ b/indra/llui/llstyle.cpp @@ -49,14 +49,14 @@ LLStyle::Params::Params() LLStyle::LLStyle(const LLStyle::Params& p) -: mVisible(p.visible), +: mDropShadow(p.drop_shadow), + mVisible(p.visible), mColor(p.color), mReadOnlyColor(p.readonly_color), mSelectedColor(p.selected_color), mFont(p.font()), mLink(p.link_href), mIsLink(p.is_link.isProvided() ? p.is_link : !p.link_href().empty()), - mDropShadow(p.drop_shadow), mImagep(p.image()) {} diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index ba0d206d1dae15279ae32fdbb0c6fc4307ed2824..ad9ee7bd199c59460f13f4b3100f84dfd8f6ac77 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -71,7 +71,7 @@ void LLTabContainer::TabPositions::declareValues() class LLTabTuple { public: - LLTabTuple( LLTabContainer* c, LLPanel* p, LLButton* b, LLTextBox* placeholder = NULL) + LLTabTuple( LLTabContainer* c, LLPanel* p, LLButton* b, LLTextBox* placeholder = nullptr) : mTabContainer(c), mTabPanel(p), @@ -115,7 +115,7 @@ protected: LLCustomButtonIconCtrl(const Params& p) : LLButton(p), - mIcon(NULL), + mIcon(nullptr), mIconAlignment(LLFontGL::HCENTER), mIconCtrlPad(p.icon_ctrl_pad) {} @@ -204,52 +204,52 @@ LLTabContainer::TabParams::TabParams() {} LLTabContainer::Params::Params() -: tab_width("tab_width"), +: tab_position("tab_position"), + tab_width("tab_width"), tab_min_width("tab_min_width"), tab_max_width("tab_max_width"), tab_height("tab_height"), label_pad_bottom("label_pad_bottom"), label_pad_left("label_pad_left"), - tab_position("tab_position"), hide_tabs("hide_tabs", false), hide_scroll_arrows("hide_scroll_arrows", false), tab_padding_right("tab_padding_right"), first_tab("first_tab"), middle_tab("middle_tab"), last_tab("last_tab"), + font_halign("halign"), + use_ellipses("use_ellipses"), use_custom_icon_ctrl("use_custom_icon_ctrl", false), open_tabs_on_drag_and_drop("open_tabs_on_drag_and_drop", false), - tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0), - use_ellipses("use_ellipses"), - font_halign("halign") + tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0) {} LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) : LLPanel(p), mCurrentTabIdx(-1), mTabsHidden(p.hide_tabs), + mHideScrollArrows(p.hide_scroll_arrows), mScrolled(FALSE), mScrollPos(0), mScrollPosPixels(0), mMaxScrollPos(0), - mTitleBox(NULL), + mTitleBox(nullptr), mTopBorderHeight(LLPANEL_BORDER_WIDTH), + mTabPosition(p.tab_position), mLockedTabCount(0), mMinTabWidth(0), + mPrevArrowBtn(nullptr), + mNextArrowBtn(nullptr), + mIsVertical( p.tab_position == LEFT ), + mJumpPrevArrowBtn(nullptr), + mJumpNextArrowBtn(nullptr), + mRightTabBtnOffset(p.tab_padding_right), + // Horizontal Specific mMaxTabWidth(p.tab_max_width), + mTotalTabWidth(0), mTabHeight(p.tab_height), mLabelPadBottom(p.label_pad_bottom), mLabelPadLeft(p.label_pad_left), - mPrevArrowBtn(NULL), - mNextArrowBtn(NULL), - mIsVertical( p.tab_position == LEFT ), - mHideScrollArrows(p.hide_scroll_arrows), - // Horizontal Specific - mJumpPrevArrowBtn(NULL), - mJumpNextArrowBtn(NULL), - mRightTabBtnOffset(p.tab_padding_right), - mTotalTabWidth(0), - mTabPosition(p.tab_position), mFontHalign(p.font_halign), mFont(p.font), mFirstTabParams(p.first_tab), @@ -363,7 +363,7 @@ bool LLTabContainer::addChild(LLView* view, S32 tab_group) if (panelp) { - addTabPanel(TabPanelParams().panel(panelp).label(panelp->getLabel()).is_placeholder(dynamic_cast<LLPlaceHolderPanel*>(view) != NULL)); + addTabPanel(TabPanelParams().panel(panelp).label(panelp->getLabel()).is_placeholder(dynamic_cast<LLPlaceHolderPanel*>(view) != nullptr)); return true; } else @@ -687,7 +687,7 @@ BOOL LLTabContainer::handleMouseUp( S32 x, S32 y, MASK mask ) getTab(getCurrentPanelIndex())->mButton->setFocus(TRUE); } } - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); } if (handled) { // Note: may need to capture local coords here @@ -1009,8 +1009,8 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) // Tab button LLRect btn_rect; // Note: btn_rect.mLeft is just a dummy. Will be updated in draw(). - LLUIImage* tab_img = NULL; - LLUIImage* tab_selected_img = NULL; + LLUIImage* tab_img = nullptr; + LLUIImage* tab_selected_img = nullptr; S32 tab_fudge = 1; // To make new tab art look better, nudge buttons up 1 pel if (mIsVertical) @@ -1033,8 +1033,8 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) tab_selected_img = mMiddleTabParams.tab_bottom_image_selected; } - LLTextBox* textbox = NULL; - LLButton* btn = NULL; + LLTextBox* textbox = nullptr; + LLButton* btn = nullptr; LLCustomButtonIconCtrl::Params custom_btn_params; { custom_btn_params.icon_ctrl_pad(mTabIconCtrlPad); @@ -1243,11 +1243,11 @@ void LLTabContainer::removeTabPanel(LLPanel* child) removeChild( tuple->mButton ); } delete tuple->mButton; - tuple->mButton = NULL; + tuple->mButton = nullptr; removeChild( tuple->mTabPanel ); // delete tuple->mTabPanel; - tuple->mTabPanel = NULL; + tuple->mTabPanel = nullptr; mTabList.erase( iter ); delete tuple; @@ -1309,11 +1309,11 @@ void LLTabContainer::deleteAllTabs() removeChild( tuple->mButton ); delete tuple->mButton; - tuple->mButton = NULL; + tuple->mButton = nullptr; removeChild( tuple->mTabPanel ); // delete tuple->mTabPanel; - tuple->mTabPanel = NULL; + tuple->mTabPanel = nullptr; } // Actually delete the tuples themselves @@ -1330,7 +1330,7 @@ LLPanel* LLTabContainer::getCurrentPanel() { return mTabList[mCurrentTabIdx]->mTabPanel; } - return NULL; + return nullptr; } S32 LLTabContainer::getCurrentPanelIndex() @@ -1349,7 +1349,7 @@ LLPanel* LLTabContainer::getPanelByIndex(S32 index) { return mTabList[index]->mTabPanel; } - return NULL; + return nullptr; } S32 LLTabContainer::getIndexForPanel(LLPanel* panel) @@ -1386,7 +1386,7 @@ LLPanel* LLTabContainer::getPanelByName(const std::string& name) return panel; } } - return NULL; + return nullptr; } // Change the name of the button for the current tab. @@ -1663,7 +1663,7 @@ void LLTabContainer::setTabImage(LLPanel* child, LLIconCtrl* icon) } } - if (!hasButton && (icon != NULL)) + if (!hasButton && (icon != nullptr)) { // It was assumed that the tab's button would take ownership of the icon pointer. // But since the tab did not have a button, kill the icon to prevent the memory @@ -2008,7 +2008,7 @@ LLTabTuple* LLTabContainer::getTabByPanel(LLPanel* child) return tuple; } } - return NULL; + return nullptr; } void LLTabContainer::insertTuple(LLTabTuple * tuple, eInsertionPoint insertion_point) diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 7dcc9598db6e52547f27833380c01b0f5643c7d3..999999c5af9087f052334011a9cb0640b83d0c8e 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -129,23 +129,23 @@ public: /*virtual*/ ~LLTabContainer(); // from LLView - /*virtual*/ void setValue(const LLSD& value); - - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ void draw(); - /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleMouseUp( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ void setValue(const LLSD& value) override; + + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + /*virtual*/ void draw() override; + /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ) override; + /*virtual*/ BOOL handleMouseUp( S32 x, S32 y, MASK mask ) override; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask) override; /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, - EAcceptance* accept, std::string& tooltip); - /*virtual*/ LLView* getChildView(const std::string& name, BOOL recurse = TRUE) const; - /*virtual*/ LLView* findChildView(const std::string& name, BOOL recurse = TRUE) const; + EAcceptance* accept, std::string& tooltip) override; + /*virtual*/ LLView* getChildView(const std::string& name, BOOL recurse = TRUE) const override; + /*virtual*/ LLView* findChildView(const std::string& name, BOOL recurse = TRUE) const override; /*virtual*/ void initFromParams(const LLPanel::Params& p); - /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0); - /*virtual*/ BOOL postBuild(); + /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0) override; + /*virtual*/ BOOL postBuild() override; struct TabPanelParams : public LLInitParam::Block<TabPanelParams> { @@ -159,7 +159,7 @@ public: Optional<void*> user_data; TabPanelParams() - : panel("panel", NULL), + : panel("panel", nullptr), label("label"), select_tab("select_tab"), is_placeholder("is_placeholder"), diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 01f98fa0f905bd81d0745097a8de3710e5ded1fc..995f19245b507aea28c55b18d3d4835b1a7698ee 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -142,31 +142,31 @@ LLTextBase::Params::Params() text_color("text_color"), text_readonly_color("text_readonly_color"), text_tentative_color("text_tentative_color"), - bg_visible("bg_visible", false), - border_visible("border_visible", false), bg_readonly_color("bg_readonly_color"), bg_writeable_color("bg_writeable_color"), bg_focus_color("bg_focus_color"), text_selected_color("text_selected_color"), bg_selected_color("bg_selected_color"), - allow_scroll("allow_scroll", true), - plain_text("plain_text",false), + bg_visible("bg_visible", false), + border_visible("border_visible", false), track_end("track_end", false), read_only("read_only", false), spellcheck("spellcheck", false), - v_pad("v_pad", 0), - h_pad("h_pad", 0), - clip("clip", true), - clip_partial("clip_partial", true), - line_spacing("line_spacing"), - max_text_length("max_length", 255), - font_shadow("font_shadow"), + allow_scroll("allow_scroll", true), + plain_text("plain_text",false), wrap("wrap"), - trusted_content("trusted_content", true), use_ellipses("use_ellipses", false), parse_urls("parse_urls", false), force_urls_external("force_urls_external", false), - parse_highlights("parse_highlights", false) + parse_highlights("parse_highlights", false), + clip("clip", true), + clip_partial("clip_partial", true), + trusted_content("trusted_content", true), + v_pad("v_pad", 0), + h_pad("h_pad", 0), + line_spacing("line_spacing"), + max_text_length("max_length", 255), + font_shadow("font_shadow") { addSynonym(track_end, "track_bottom"); addSynonym(wrap, "word_wrap"); @@ -176,20 +176,11 @@ LLTextBase::Params::Params() LLTextBase::LLTextBase(const LLTextBase::Params &p) : LLUICtrl(p, LLTextViewModelPtr(new LLTextViewModel)), - mURLClickSignal(NULL), - mIsFriendSignal(NULL), - mIsObjectBlockedSignal(NULL), - mMaxTextByteLength( p.max_text_length ), + mStyleDirty(true), mFont(p.font), mFontShadow(p.font_shadow), - mPopupMenuHandle(), - mReadOnly(p.read_only), - mSpellCheck(p.spellcheck), - mSpellCheckStart(-1), - mSpellCheckEnd(-1), mCursorColor(p.cursor_color), mFgColor(p.text_color), - mBorderVisible( p.border_visible ), mReadOnlyFgColor(p.text_readonly_color), mTentativeFgColor(p.text_tentative_color()), mWriteableBgColor(p.bg_writeable_color), @@ -197,33 +188,42 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mFocusBgColor(p.bg_focus_color), mTextSelectedColor(p.text_selected_color), mSelectedBGColor(p.bg_selected_color), - mReflowIndex(S32_MAX), mCursorPos( 0 ), - mScrollNeeded(FALSE), mDesiredXPixel(-1), + mSelectionStart( 0 ), + mSelectionEnd( 0 ), + mIsSelecting( FALSE ), + mSpellCheck(p.spellcheck), + mSpellCheckStart(-1), + mSpellCheckEnd(-1), mHPad(p.h_pad), mVPad(p.v_pad), mHAlign(p.font_halign), mVAlign(p.font_valign), mLineSpacingMult(p.line_spacing.multiple), mLineSpacingPixels(p.line_spacing.pixels), - mClip(p.clip), - mClipPartial(p.clip_partial && !p.allow_scroll), - mTrustedContent(p.trusted_content), - mTrackEnd( p.track_end ), - mScrollIndex(-1), - mSelectionStart( 0 ), - mSelectionEnd( 0 ), - mIsSelecting( FALSE ), - mPlainText ( p.plain_text ), - mWordWrap(p.wrap), - mUseEllipses( p.use_ellipses ), + mBorderVisible( p.border_visible ), mParseHTML(p.parse_urls), mForceUrlsExternal(p.force_urls_external), mParseHighlights(p.parse_highlights), + mWordWrap(p.wrap), + mUseEllipses( p.use_ellipses ), + mTrackEnd( p.track_end ), + mReadOnly(p.read_only), mBGVisible(p.bg_visible), - mScroller(NULL), - mStyleDirty(true) + mClip(p.clip), + mClipPartial(p.clip_partial && !p.allow_scroll), + mTrustedContent(p.trusted_content), + mPlainText ( p.plain_text ), + mMaxTextByteLength( p.max_text_length ), + mPopupMenuHandle(), + mScroller(nullptr), + mReflowIndex(S32_MAX), + mScrollNeeded(FALSE), + mScrollIndex(-1), + mURLClickSignal(nullptr), + mIsFriendSignal(nullptr), + mIsObjectBlockedSignal(nullptr) { if(p.allow_scroll) { @@ -1227,7 +1227,7 @@ void LLTextBase::draw() gl_rect_2d(text_rect, bg_color % alpha, TRUE); } - bool should_clip = mClip || mScroller != NULL; + bool should_clip = mClip || mScroller != nullptr; { LLLocalClipRect clip(text_rect, should_clip); // draw document view @@ -3085,7 +3085,7 @@ const LLColor4& LLTextSegment::getColor() const { return LLColor4::white; } LLStyleConstSP LLTextSegment::getStyle() const {static LLStyleConstSP sp(new LLStyle()); return sp; } void LLTextSegment::setStyle(LLStyleConstSP style) {} void LLTextSegment::setToken( LLKeywordToken* token ) {} -LLKeywordToken* LLTextSegment::getToken() const { return NULL; } +LLKeywordToken* LLTextSegment::getToken() const { return nullptr; } void LLTextSegment::setToolTip( const std::string &msg ) {} void LLTextSegment::dump() const {} BOOL LLTextSegment::handleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; } @@ -3113,9 +3113,9 @@ BOOL LLTextSegment::hasMouseCapture() { return FALSE; } LLNormalTextSegment::LLNormalTextSegment( LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor ) : LLTextSegment(start, end), + mEditor(editor), mStyle( style ), - mToken(NULL), - mEditor(editor) + mToken(nullptr) { mFontHeight = mStyle->getFont()->getLineHeight(); @@ -3128,8 +3128,8 @@ LLNormalTextSegment::LLNormalTextSegment( LLStyleConstSP style, S32 start, S32 e LLNormalTextSegment::LLNormalTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, BOOL is_visible) : LLTextSegment(start, end), - mToken(NULL), - mEditor(editor) + mEditor(editor), + mToken(nullptr) { mStyle = new LLStyle(LLStyle::Params().visible(is_visible).color(color)); @@ -3482,12 +3482,12 @@ BOOL LLOnHoverChangeableTextSegment::handleHover(S32 x, S32 y, MASK mask) LLInlineViewSegment::LLInlineViewSegment(const Params& p, S32 start, S32 end) : LLTextSegment(start, end), - mView(p.view), - mForceNewLine(p.force_newline), mLeftPad(p.left_pad), mRightPad(p.right_pad), mTopPad(p.top_pad), - mBottomPad(p.bottom_pad) + mBottomPad(p.bottom_pad), + mView(p.view), + mForceNewLine(p.force_newline) { } @@ -3601,8 +3601,8 @@ F32 LLLineBreakTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 se LLImageTextSegment::LLImageTextSegment(LLStyleConstSP style,S32 pos,class LLTextBase& editor) : LLTextSegment(pos,pos+1), - mStyle( style ), - mEditor(editor) + mEditor(editor), + mStyle( style ) { } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 61ea51f1a7ef3b58f9eb08d03f0670fbdfabdb0f..6ba02c2815b1150e6cdafaa97a4296dbe2e72c49 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -89,21 +89,21 @@ public: virtual void dump() const; // LLMouseHandler interface - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); - /*virtual*/ const std::string& getName() const; - /*virtual*/ void onMouseCaptureLost(); - /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const; - /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const; - /*virtual*/ BOOL hasMouseCapture(); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; + /*virtual*/ const std::string& getName() const override; + /*virtual*/ void onMouseCaptureLost() override; + /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const override; + /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const override; + /*virtual*/ BOOL hasMouseCapture() override; S32 getStart() const { return mStart; } void setStart(S32 start) { mStart = start; } @@ -122,25 +122,25 @@ public: LLNormalTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, BOOL is_visible = TRUE); virtual ~LLNormalTextSegment(); - /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; - /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const; - /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const; - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); - /*virtual*/ bool canEdit() const { return true; } - /*virtual*/ const LLColor4& getColor() const { return mStyle->getColor(); } - /*virtual*/ LLStyleConstSP getStyle() const { return mStyle; } - /*virtual*/ void setStyle(LLStyleConstSP style) { mStyle = style; } - /*virtual*/ void setToken( LLKeywordToken* token ) { mToken = token; } - /*virtual*/ LLKeywordToken* getToken() const { return mToken; } + /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const override; + /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const override; + /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const override; + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) override; + /*virtual*/ bool canEdit() const override { return true; } + /*virtual*/ const LLColor4& getColor() const override { return mStyle->getColor(); } + /*virtual*/ LLStyleConstSP getStyle() const override { return mStyle; } + /*virtual*/ void setStyle(LLStyleConstSP style) override { mStyle = style; } + /*virtual*/ void setToken( LLKeywordToken* token ) override { mToken = token; } + /*virtual*/ LLKeywordToken* getToken() const override { return mToken; } /*virtual*/ BOOL getToolTip( std::string& msg ) const; - /*virtual*/ void setToolTip(const std::string& tooltip); - /*virtual*/ void dump() const; + /*virtual*/ void setToolTip(const std::string& tooltip) override; + /*virtual*/ void dump() const override; - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; protected: F32 drawClippedSegment(S32 seg_start, S32 seg_end, S32 selection_start, S32 selection_end, LLRectf rect); @@ -168,8 +168,8 @@ public: protected: - /*virtual*/ const LLWString& getWText() const; - /*virtual*/ const S32 getLength() const; + /*virtual*/ const LLWString& getWText() const override; + /*virtual*/ const S32 getLength() const override; }; // Text segment that changes it's style depending of mouse pointer position ( is it inside or outside segment) @@ -177,8 +177,8 @@ class LLOnHoverChangeableTextSegment : public LLNormalTextSegment { public: LLOnHoverChangeableTextSegment( LLStyleConstSP style, LLStyleConstSP normal_style, S32 start, S32 end, LLTextBase& editor ); - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; protected: // Style used for text when mouse pointer is over segment LLStyleConstSP mHoveredStyle; @@ -208,13 +208,13 @@ public: LLInlineViewSegment(const Params& p, S32 start, S32 end); ~LLInlineViewSegment(); - /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; - /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const; - /*virtual*/ void updateLayout(const class LLTextBase& editor); - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); - /*virtual*/ bool canEdit() const { return false; } - /*virtual*/ void unlinkFromDocument(class LLTextBase* editor); - /*virtual*/ void linkToDocument(class LLTextBase* editor); + /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const override; + /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const override; + /*virtual*/ void updateLayout(const class LLTextBase& editor) override; + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) override; + /*virtual*/ bool canEdit() const override { return false; } + /*virtual*/ void unlinkFromDocument(class LLTextBase* editor) override; + /*virtual*/ void linkToDocument(class LLTextBase* editor) override; private: S32 mLeftPad; @@ -232,9 +232,9 @@ public: LLLineBreakTextSegment(LLStyleConstSP style,S32 pos); LLLineBreakTextSegment(S32 pos); ~LLLineBreakTextSegment(); - bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; - S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const; - F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); + bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const override; + S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const override; + F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) override; private: S32 mFontHeight; @@ -245,12 +245,12 @@ class LLImageTextSegment : public LLTextSegment public: LLImageTextSegment(LLStyleConstSP style,S32 pos,class LLTextBase& editor); ~LLImageTextSegment(); - bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; - S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 char_offset, S32 max_chars, S32 line_ind) const; - F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); + bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const override; + S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 char_offset, S32 max_chars, S32 line_ind) const override; + F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) override; - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); - /*virtual*/ void setToolTip(const std::string& tooltip); + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; + /*virtual*/ void setToolTip(const std::string& tooltip) override; private: class LLTextBase& mEditor; @@ -330,49 +330,49 @@ public: }; // LLMouseHandler interface - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; // LLView interface - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ void draw(); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + /*virtual*/ void draw() override; // LLUICtrl interface - /*virtual*/ BOOL acceptsTextInput() const { return !mReadOnly; } - /*virtual*/ void setColor( const LLColor4& c ); + /*virtual*/ BOOL acceptsTextInput() const override { return !mReadOnly; } + /*virtual*/ void setColor( const LLColor4& c ) override; virtual void setReadOnlyColor(const LLColor4 &c); - virtual void onVisibilityChange( BOOL new_visibility ); + void onVisibilityChange( BOOL new_visibility ) override; - /*virtual*/ void setValue(const LLSD& value ); - /*virtual*/ LLTextViewModel* getViewModel() const; + /*virtual*/ void setValue(const LLSD& value ) override; + /*virtual*/ LLTextViewModel* getViewModel() const override; // LLEditMenuHandler interface - /*virtual*/ BOOL canDeselect() const; - /*virtual*/ void deselect(); + /*virtual*/ BOOL canDeselect() const override; + /*virtual*/ void deselect() override; - virtual void onFocusReceived(); - virtual void onFocusLost(); + void onFocusReceived() override; + void onFocusLost() override; // LLSpellCheckMenuHandler overrides - /*virtual*/ bool getSpellCheck() const; + /*virtual*/ bool getSpellCheck() const override; - /*virtual*/ const std::string& getSuggestion(U32 index) const; - /*virtual*/ U32 getSuggestionCount() const; - /*virtual*/ void replaceWithSuggestion(U32 index); + /*virtual*/ const std::string& getSuggestion(U32 index) const override; + /*virtual*/ U32 getSuggestionCount() const override; + /*virtual*/ void replaceWithSuggestion(U32 index) override; - /*virtual*/ void addToDictionary(); - /*virtual*/ bool canAddToDictionary() const; + /*virtual*/ void addToDictionary() override; + /*virtual*/ bool canAddToDictionary() const override; - /*virtual*/ void addToIgnore(); - /*virtual*/ bool canAddToIgnore() const; + /*virtual*/ void addToIgnore() override; + /*virtual*/ bool canAddToIgnore() const override; // Spell checking helper functions std::string getMisspelledWord(U32 pos) const; @@ -404,7 +404,7 @@ public: void appendText(const std::string &new_text, bool prepend_newline, const LLStyle::Params& input_params = LLStyle::Params()); void setLabel(const LLStringExplicit& label); - virtual BOOL setLabelArg(const std::string& key, const LLStringExplicit& text ); + BOOL setLabelArg(const std::string& key, const LLStringExplicit& text ) override; const std::string& getLabel() { return mLabel.getString(); } const LLWString& getWlabel() { return mLabel.getWString();} @@ -557,7 +557,7 @@ protected: void drawText(); // modify contents - S32 insertStringNoUndo(S32 pos, const LLWString &wstr, segment_vec_t* segments = NULL); // returns num of chars actually inserted + S32 insertStringNoUndo(S32 pos, const LLWString &wstr, segment_vec_t* segments = nullptr); // returns num of chars actually inserted S32 removeStringNoUndo(S32 pos, S32 length); S32 overwriteCharNoUndo(S32 pos, llwchar wc); void appendAndHighlightText(const std::string &new_text, S32 highlight_part, const LLStyle::Params& stylep, bool underline_on_hover_only = false); diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index 071e18c638ff1c69f4f0faa138628ea31f0c06e0..44789462540566c8400236e59044ba243b4d1783 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -48,25 +48,25 @@ protected: public: virtual ~LLTextBox(); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; - /*virtual*/ void setEnabled(BOOL enabled); + /*virtual*/ void setEnabled(BOOL enabled) override; - /*virtual*/ void setText( const LLStringExplicit& text, const LLStyle::Params& input_params = LLStyle::Params() ); + /*virtual*/ void setText( const LLStringExplicit& text, const LLStyle::Params& input_params = LLStyle::Params() ) override; void setRightAlign() { mHAlign = LLFontGL::RIGHT; } void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } - void setClickedCallback( boost::function<void (void*)> cb, void* userdata = NULL ); + void setClickedCallback( boost::function<void (void*)> cb, void* userdata = nullptr ); void reshapeToFitText(); S32 getTextPixelWidth(); S32 getTextPixelHeight(); - /*virtual*/ LLSD getValue() const; - /*virtual*/ BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); + /*virtual*/ LLSD getValue() const override; + /*virtual*/ BOOL setTextArg( const std::string& key, const LLStringExplicit& text ) override; protected: void onUrlLabelUpdated(const std::string &url, const std::string &label); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index adaa6f1a418074ae365e0ce05d63a6430cf7f549..7aa577b0d0b23076db1a88933730a336a70626b4 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -90,19 +90,22 @@ public: { } virtual ~TextCmdInsert() {} - virtual BOOL execute( LLTextBase* editor, S32* delta ) + + BOOL execute( LLTextBase* editor, S32* delta ) override { *delta = insert(editor, getPosition(), mWString ); LLWStringUtil::truncate(mWString, *delta); //mWString = wstring_truncate(mWString, *delta); return (*delta != 0); - } - virtual S32 undo( LLTextBase* editor ) + } + + S32 undo( LLTextBase* editor ) override { remove(editor, getPosition(), mWString.length() ); return getPosition(); } - virtual S32 redo( LLTextBase* editor ) + + S32 redo( LLTextBase* editor ) override { insert(editor, getPosition(), mWString ); return getPosition() + mWString.length(); @@ -120,25 +123,29 @@ public: : TextCmd(pos, group_with_next, segment), mWString(1, wc), mBlockExtensions(FALSE) { } - virtual void blockExtensions() + + void blockExtensions() override { mBlockExtensions = TRUE; } - virtual BOOL canExtend(S32 pos) const + + BOOL canExtend(S32 pos) const override { // cannot extend text with custom segments if (!mSegments.empty()) return FALSE; return !mBlockExtensions && (pos == getPosition() + (S32)mWString.length()); } - virtual BOOL execute( LLTextBase* editor, S32* delta ) + + BOOL execute( LLTextBase* editor, S32* delta ) override { *delta = insert(editor, getPosition(), mWString); LLWStringUtil::truncate(mWString, *delta); //mWString = wstring_truncate(mWString, *delta); return (*delta != 0); } - virtual BOOL extendAndExecute( LLTextBase* editor, S32 pos, llwchar wc, S32* delta ) + + BOOL extendAndExecute( LLTextBase* editor, S32 pos, llwchar wc, S32* delta ) override { LLWString ws; ws += wc; @@ -150,12 +157,14 @@ public: } return (*delta != 0); } - virtual S32 undo( LLTextBase* editor ) + + S32 undo( LLTextBase* editor ) override { remove(editor, getPosition(), mWString.length() ); return getPosition(); } - virtual S32 redo( LLTextBase* editor ) + + S32 redo( LLTextBase* editor ) override { insert(editor, getPosition(), mWString ); return getPosition() + mWString.length(); @@ -175,19 +184,21 @@ public: TextCmdOverwriteChar( S32 pos, BOOL group_with_next, llwchar wc) : TextCmd(pos, group_with_next), mChar(wc), mOldChar(0) {} - virtual BOOL execute( LLTextBase* editor, S32* delta ) + BOOL execute( LLTextBase* editor, S32* delta ) override { mOldChar = editor->getWText()[getPosition()]; overwrite(editor, getPosition(), mChar); *delta = 0; return TRUE; - } - virtual S32 undo( LLTextBase* editor ) + } + + S32 undo( LLTextBase* editor ) override { overwrite(editor, getPosition(), mOldChar); return getPosition(); } - virtual S32 redo( LLTextBase* editor ) + + S32 redo( LLTextBase* editor ) override { overwrite(editor, getPosition(), mChar); return getPosition()+1; @@ -208,18 +219,21 @@ public: { std::swap(mSegments, segments); } - virtual BOOL execute( LLTextBase* editor, S32* delta ) + + BOOL execute( LLTextBase* editor, S32* delta ) override { mWString = editor->getWText().substr(getPosition(), mLen); *delta = remove(editor, getPosition(), mLen ); return (*delta != 0); } - virtual S32 undo( LLTextBase* editor ) + + S32 undo( LLTextBase* editor ) override { insert(editor, getPosition(), mWString); return getPosition() + mWString.length(); } - virtual S32 redo( LLTextBase* editor ) + + S32 redo( LLTextBase* editor ) override { remove(editor, getPosition(), mLen ); return getPosition(); @@ -236,11 +250,11 @@ LLTextEditor::Params::Params() prevalidate_callback("prevalidate_callback"), embedded_items("embedded_items", false), ignore_tab("ignore_tab", true), - auto_indent("auto_indent", true), - default_color("default_color"), - commit_on_focus_lost("commit_on_focus_lost", false), + commit_on_focus_lost("commit_on_focus_lost", false), show_context_menu("show_context_menu"), - enable_tooltip_paste("enable_tooltip_paste") + enable_tooltip_paste("enable_tooltip_paste"), + auto_indent("auto_indent", true), + default_color("default_color") { addSynonym(prevalidate_callback, "text_type"); } @@ -248,22 +262,22 @@ LLTextEditor::Params::Params() LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) : LLTextBase(p), mAutoreplaceCallback(), - mBaseDocIsPristine(TRUE), - mPristineCmd( NULL ), - mLastCmd( NULL ), + mMouseDownX(0), + mMouseDownY(0), mDefaultColor( p.default_color() ), mAutoIndent(p.auto_indent), + mBaseDocIsPristine(TRUE), + mPristineCmd(nullptr ), + mLastCmd(nullptr ), + mTabsToNextField(p.ignore_tab), mCommitOnFocusLost( p.commit_on_focus_lost), mAllowEmbeddedItems( p.embedded_items ), - mMouseDownX(0), - mMouseDownY(0), - mTabsToNextField(p.ignore_tab), - mPrevalidateFunc(p.prevalidate_callback()), - mContextMenuHandle(), mShowContextMenu(p.show_context_menu), mEnableTooltipPaste(p.enable_tooltip_paste), mPassDelete(FALSE), - mKeepSelectionOnReturn(false) + mKeepSelectionOnReturn(false), + mPrevalidateFunc(p.prevalidate_callback()), + mContextMenuHandle() { mSourceID.generate(); @@ -886,7 +900,7 @@ BOOL LLTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) if( hasMouseCapture() ) { - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); handled = TRUE; } @@ -1176,7 +1190,7 @@ void LLTextEditor::addChar(llwchar wc) setCursorPos(mCursorPos + addChar( mCursorPos, wc )); - if (!mReadOnly && mAutoreplaceCallback != NULL) + if (!mReadOnly && mAutoreplaceCallback != nullptr) { // autoreplace the text, if necessary S32 replacement_start; @@ -1985,7 +1999,7 @@ void LLTextEditor::doDelete() void LLTextEditor::blockUndo() { mBaseDocIsPristine = FALSE; - mLastCmd = NULL; + mLastCmd = nullptr; std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer()); mUndoStack.clear(); } @@ -1993,7 +2007,7 @@ void LLTextEditor::blockUndo() // virtual BOOL LLTextEditor::canUndo() const { - return !mReadOnly && mLastCmd != NULL; + return !mReadOnly && mLastCmd != nullptr; } void LLTextEditor::undo() @@ -2013,7 +2027,7 @@ void LLTextEditor::undo() if (iter != mUndoStack.end()) mLastCmd = *iter; else - mLastCmd = NULL; + mLastCmd = nullptr; } while( mLastCmd && mLastCmd->groupWithNext() ); @@ -2047,7 +2061,7 @@ void LLTextEditor::redo() if (iter != mUndoStack.begin()) mLastCmd = *(--iter); else - mLastCmd = NULL; + mLastCmd = nullptr; } if( mLastCmd ) @@ -2077,7 +2091,7 @@ void LLTextEditor::focusLostHelper() // Route menu back to the default if( gEditMenuHandler == this ) { - gEditMenuHandler = NULL; + gEditMenuHandler = nullptr; } if (mCommitOnFocusLost) @@ -2335,7 +2349,7 @@ void LLTextEditor::setFocus( BOOL new_state ) // Route menu back to the default if( gEditMenuHandler == this ) { - gEditMenuHandler = NULL; + gEditMenuHandler = nullptr; } endSelection(); @@ -2991,7 +3005,7 @@ BOOL LLTextEditor::isDirty() const } else { - return ( NULL != mLastCmd ); + return (nullptr != mLastCmd ); } } diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 9367c0fb25722a3360fa9e42f355d00465aa30a6..ad4c029327fe5684e57c439d4e29cf943b4234de 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -92,52 +92,52 @@ public: static S32 spacesPerTab(); // mousehandler overrides - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask ); - virtual BOOL handleMiddleMouseDown(S32 x,S32 y,MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask ) override; + BOOL handleMiddleMouseDown(S32 x,S32 y,MASK mask) override; - virtual BOOL handleKeyHere(KEY key, MASK mask ); - virtual BOOL handleUnicodeCharHere(llwchar uni_char); + BOOL handleKeyHere(KEY key, MASK mask ) override; + BOOL handleUnicodeCharHere(llwchar uni_char) override; - virtual void onMouseCaptureLost(); + void onMouseCaptureLost() override; // view overrides - virtual void draw(); - virtual void onFocusReceived(); - virtual void onFocusLost(); - virtual void onCommit(); - virtual void setEnabled(BOOL enabled); + void draw() override; + void onFocusReceived() override; + void onFocusLost() override; + void onCommit() override; + void setEnabled(BOOL enabled) override; // uictrl overrides - virtual void clear(); - virtual void setFocus( BOOL b ); - virtual BOOL isDirty() const; + void clear() override; + void setFocus( BOOL b ) override; + BOOL isDirty() const override; // LLEditMenuHandler interface - virtual void undo(); - virtual BOOL canUndo() const; - virtual void redo(); - virtual BOOL canRedo() const; - - virtual void cut(); - virtual BOOL canCut() const; - virtual void copy(); - virtual BOOL canCopy() const; - virtual void paste(); - virtual BOOL canPaste() const; + void undo() override; + BOOL canUndo() const override; + void redo() override; + BOOL canRedo() const override; + + void cut() override; + BOOL canCut() const override; + void copy() override; + BOOL canCopy() const override; + void paste() override; + BOOL canPaste() const override; virtual void updatePrimary(); virtual void copyPrimary(); virtual void pastePrimary(); virtual BOOL canPastePrimary() const; - virtual void doDelete(); - virtual BOOL canDoDelete() const; - virtual void selectAll(); - virtual BOOL canSelectAll() const; + void doDelete() override; + BOOL canDoDelete() const override; + void selectAll() override; + BOOL canSelectAll() const override; void selectByCursorPosition(S32 prev_cursor_pos, S32 next_cursor_pos); @@ -164,7 +164,7 @@ public: autoreplace_callback_t mAutoreplaceCallback; void setAutoreplaceCallback(autoreplace_callback_t cb) { mAutoreplaceCallback = cb; } - /*virtual*/ void onSpellCheckPerformed(); + /*virtual*/ void onSpellCheckPerformed() override; // // Text manipulation @@ -174,9 +174,9 @@ public: void insertText(const std::string &text); void insertText(LLWString &text); - void appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo); + void appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo) override; // Non-undoable - void setText(const LLStringExplicit &utf8str, const LLStyle::Params& input_params = LLStyle::Params()); + void setText(const LLStringExplicit &utf8str, const LLStyle::Params& input_params = LLStyle::Params()) override; // Removes text from the end of document @@ -257,15 +257,15 @@ protected: BOOL hasPreeditString() const; // Overrides LLPreeditor - virtual void resetPreedit(); - virtual void updatePreedit(const LLWString &preedit_string, - const segment_lengths_t &preedit_segment_lengths, const standouts_t &preedit_standouts, S32 caret_position); - virtual void markAsPreedit(S32 position, S32 length); - virtual void getPreeditRange(S32 *position, S32 *length) const; - virtual void getSelectionRange(S32 *position, S32 *length) const; - virtual BOOL getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect *bounds, LLRect *control) const; - virtual S32 getPreeditFontSize() const; - virtual LLWString getPreeditString() const { return getWText(); } + void resetPreedit() override; + void updatePreedit(const LLWString &preedit_string, + const segment_lengths_t &preedit_segment_lengths, const standouts_t &preedit_standouts, S32 caret_position) override; + void markAsPreedit(S32 position, S32 length) override; + void getPreeditRange(S32 *position, S32 *length) const override; + void getSelectionRange(S32 *position, S32 *length) const override; + BOOL getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect *bounds, LLRect *control) const override; + S32 getPreeditFontSize() const override; + LLWString getPreeditString() const override { return getWText(); } // // Protected data // diff --git a/indra/llui/lltextutil.cpp b/indra/llui/lltextutil.cpp index 7fdcf7345e219dd219f3b8c6dcfde739473cb612..ab0ac878049d1ce7d0f7f452db4bde81c83cd201 100644 --- a/indra/llui/lltextutil.cpp +++ b/indra/llui/lltextutil.cpp @@ -32,7 +32,7 @@ #include "lltextbox.h" #include "llurlmatch.h" -boost::function<bool(LLUrlMatch*,LLTextBase*)> LLTextUtil::TextHelpers::iconCallbackCreationFunction = 0; +boost::function<bool(LLUrlMatch*,LLTextBase*)> LLTextUtil::TextHelpers::iconCallbackCreationFunction = nullptr; void LLTextUtil::textboxSetHighlightedVal(LLTextBox *txtbox, const LLStyle::Params& normal_style, const std::string& text, const std::string& hl) { @@ -96,7 +96,7 @@ const std::string& LLTextUtil::formatPhoneNumber(const std::string& phone_str) bool LLTextUtil::processUrlMatch(LLUrlMatch* match,LLTextBase* text_base, bool is_content_trusted) { - if (match == 0 || text_base == 0) + if (match == nullptr || text_base == nullptr) return false; if(match->getID() != LLUUID::null && TextHelpers::iconCallbackCreationFunction) diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp index c92ab4762145dc151cf548dea7e30e5267ffb321..0a755cca5f0d435a0c1e631040289a342deea97d 100644 --- a/indra/llui/lltextvalidate.cpp +++ b/indra/llui/lltextvalidate.cpp @@ -147,7 +147,7 @@ namespace LLTextValidate } if (success) { - S32 val = strtol(wstring_to_utf8str(trimmed).c_str(), NULL, 10); + S32 val = strtol(wstring_to_utf8str(trimmed).c_str(), nullptr, 10); if (val <= 0) { success = FALSE; @@ -181,7 +181,7 @@ namespace LLTextValidate } if (success) { - S32 val = strtol(wstring_to_utf8str(trimmed).c_str(), NULL, 10); + S32 val = strtol(wstring_to_utf8str(trimmed).c_str(), nullptr, 10); if (val < 0) { success = FALSE; @@ -214,7 +214,7 @@ namespace LLTextValidate } if (success) { - S32 val = strtol(wstring_to_utf8str(test_str).c_str(), NULL, 10); + S32 val = strtol(wstring_to_utf8str(test_str).c_str(), nullptr, 10); if (val < 0) { success = FALSE; diff --git a/indra/llui/lltimectrl.cpp b/indra/llui/lltimectrl.cpp index fbe63f301c91ecbc6b1e5f007a661af6b1777eeb..70d995019faac9b1a3c2b61038f9c7792538c429 100644 --- a/indra/llui/lltimectrl.cpp +++ b/indra/llui/lltimectrl.cpp @@ -64,7 +64,7 @@ LLTimeCtrl::Params::Params() LLTimeCtrl::LLTimeCtrl(const LLTimeCtrl::Params& p) : LLUICtrl(p), - mLabelBox(NULL), + mLabelBox(nullptr), mTextEnabledColor(p.text_enabled_color()), mTextDisabledColor(p.text_disabled_color()), mTime(0), diff --git a/indra/llui/lltimectrl.h b/indra/llui/lltimectrl.h index f18c003165463373fc0cc846e60a6d126944b45f..8d2461141d0c2c36ec55a74f62f9c2ec17f3f2a0 100644 --- a/indra/llui/lltimectrl.h +++ b/indra/llui/lltimectrl.h @@ -80,8 +80,8 @@ private: NONE }; - virtual void onFocusLost(); - virtual BOOL handleKeyHere(KEY key, MASK mask); + void onFocusLost() override; + BOOL handleKeyHere(KEY key, MASK mask) override; void onUpBtn(); void onDownBtn(); diff --git a/indra/llui/lltoggleablemenu.cpp b/indra/llui/lltoggleablemenu.cpp index 9d103a8014464884a501ff173ca3441365e9ba99..dee4f02706525954b7d6599d00dbf27d8efe9590 100644 --- a/indra/llui/lltoggleablemenu.cpp +++ b/indra/llui/lltoggleablemenu.cpp @@ -36,9 +36,9 @@ static LLDefaultChildRegistry::Register<LLToggleableMenu> r("toggleable_menu"); LLToggleableMenu::LLToggleableMenu(const LLToggleableMenu::Params& p) : LLMenuGL(p), + mClosedByButtonClick(false), mButtonRect(), - mVisibilityChangeSignal(NULL), - mClosedByButtonClick(false) + mVisibilityChangeSignal(nullptr) { } diff --git a/indra/llui/lltoggleablemenu.h b/indra/llui/lltoggleablemenu.h index 55a64830219557f492f3dcf3d0c2a93caea96e04..08bedee309425d983dcd0e3411dfd9d6b01d58e7 100644 --- a/indra/llui/lltoggleablemenu.h +++ b/indra/llui/lltoggleablemenu.h @@ -45,9 +45,9 @@ public: boost::signals2::connection setVisibilityChangeCallback( const commit_signal_t::slot_type& cb ); - virtual void onVisibilityChange (BOOL curVisibilityIn); + void onVisibilityChange (BOOL curVisibilityIn) override; - virtual bool addChild (LLView* view, S32 tab_group = 0); + bool addChild (LLView* view, S32 tab_group = 0) override; const LLRect& getButtonRect() const { return mButtonRect; } diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index fac0f3396ad34b366a6d3944097cd6fff0944a08..80ee7096ee635d1c167e0895cc315191e9948d6e 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -62,24 +62,24 @@ public: LLToolBarButton(const Params& p); ~LLToolBarButton(); - BOOL handleMouseDown(S32 x, S32 y, MASK mask); - BOOL handleHover(S32 x, S32 y, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; - void reshape(S32 width, S32 height, BOOL called_from_parent = true); - void setEnabled(BOOL enabled); + void reshape(S32 width, S32 height, BOOL called_from_parent = true) override; + void setEnabled(BOOL enabled) override; void setCommandId(const LLCommandId& id) { mId = id; } LLCommandId getCommandId() { return mId; } void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } - void onMouseEnter(S32 x, S32 y, MASK mask); - void onMouseLeave(S32 x, S32 y, MASK mask); - void onMouseCaptureLost(); + void onMouseEnter(S32 x, S32 y, MASK mask) override; + void onMouseLeave(S32 x, S32 y, MASK mask) override; + void onMouseCaptureLost() override; - void onCommit(); + void onCommit() override; - virtual const std::string getToolTip() const; + const std::string getToolTip() const override; private: void callIfEnabled(LLUICtrl::commit_callback_t commit, LLUICtrl* ctrl, const LLSD& param ); @@ -185,7 +185,7 @@ public: typedef boost::function<void(LLToolBarEnums::EToolBarLocation tb, const LLRect& rect)> reshape_callback_t; virtual ~LLCenterLayoutPanel() {} - /*virtual*/ void handleReshape(const LLRect& rect, bool by_user); + /*virtual*/ void handleReshape(const LLRect& rect, bool by_user) override; void setLocationId(LLToolBarEnums::EToolBarLocation id) { mLocationId = id; } void setReshapeCallback(reshape_callback_t cb) { mReshapeCallback = cb; } @@ -193,7 +193,7 @@ public: protected: friend class LLUICtrlFactory; - LLCenterLayoutPanel(const Params& params) : LLLayoutPanel(params), mLocationId(LLToolBarEnums::TOOLBAR_NONE), mButtonPanel(NULL) {} + LLCenterLayoutPanel(const Params& params) : LLLayoutPanel(params), mLocationId(LLToolBarEnums::TOOLBAR_NONE), mButtonPanel(nullptr) {} private: reshape_callback_t mReshapeCallback; @@ -232,14 +232,14 @@ public: }; // virtuals - void draw(); - void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + void draw() override; + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; static const int RANK_NONE = -1; bool addCommand(const LLCommandId& commandId, int rank = RANK_NONE); diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index e1b055f3caa18d04f2e488912e0272b1d451f991..a2bdbbb95cd8d3cc0123ef6fbb72df93b099c34f 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -47,7 +47,7 @@ // Local globals // -LLToolTipView *gToolTipView = NULL; +LLToolTipView *gToolTipView = nullptr; // // Member functions @@ -142,11 +142,8 @@ static LLDefaultChildRegistry::Register<LLToolTip> register_tooltip("tool_tip"); LLToolTip::Params::Params() -: max_width("max_width", 200), - padding("padding", 4), - wrap("wrap", true), +: message("message"), pos("pos"), - message("message"), delay_time("delay_time", LLUI::sSettingGroups["config"]->getF32( "ToolTipDelay" )), visible_time_over("visible_time_over", LLUI::sSettingGroups["config"]->getF32( "ToolTipVisibleTimeOver" )), visible_time_near("visible_time_near", LLUI::sSettingGroups["config"]->getF32( "ToolTipVisibleTimeNear" )), @@ -156,19 +153,22 @@ LLToolTip::Params::Params() text_color("text_color"), time_based_media("time_based_media", false), web_based_media("web_based_media", false), - media_playing("media_playing", false) + media_playing("media_playing", false), + max_width("max_width", 200), + padding("padding", 4), + wrap("wrap", true) { changeDefault(chrome, true); } LLToolTip::LLToolTip(const LLToolTip::Params& p) : LLPanel(p), + mTextBox(nullptr), + mInfoButton(nullptr), + mPlayMediaButton(nullptr), + mHomePageButton(nullptr), mHasClickCallback(p.click_callback.isProvided()), - mPadding(p.padding), - mTextBox(NULL), - mInfoButton(NULL), - mPlayMediaButton(NULL), - mHomePageButton(NULL) + mPadding(p.padding) { LLTextBox::Params params; params.name = params.initial_value().asString(); @@ -408,7 +408,7 @@ void LLToolTip::getToolTipMessage(std::string & message) LLToolTipMgr::LLToolTipMgr() : mToolTipsBlocked(false), - mToolTip(NULL), + mToolTip(nullptr), mNeedsToolTip(false) {} diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h index 0b1fbe536748946108178440b823c9421846c394..fc3cdb7cca8c51e154b23c81fa82ea578de57ee5 100644 --- a/indra/llui/lltooltip.h +++ b/indra/llui/lltooltip.h @@ -44,15 +44,15 @@ public: Params(); }; LLToolTipView(const LLToolTipView::Params&); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ) override; void drawStickyRect(); - /*virtual*/ void draw(); + /*virtual*/ void draw() override; }; class LLToolTip : public LLPanel @@ -93,10 +93,10 @@ public: Params(); }; - /*virtual*/ void draw(); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); - /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ void draw() override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override; + /*virtual*/ void setVisible(BOOL visible) override; bool isFading(); F32 getVisibleTime(); diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 82264ed09e319cae0bea380867922483da69df74..4510ae198f0d64fb23c9b8860c7d145cc4616fde 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -238,9 +238,9 @@ public: static void initClass(const settings_map_t& settings, LLImageProviderInterface* image_provider, - LLUIAudioCallback audio_callback = NULL, - LLUIAudioCallback deferred_audio_callback = NULL, - const LLVector2 *scale_factor = NULL, + LLUIAudioCallback audio_callback = nullptr, + LLUIAudioCallback deferred_audio_callback = nullptr, + const LLVector2 *scale_factor = nullptr, const std::string& language = LLStringUtil::null); static void cleanupClass(); static void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& ); diff --git a/indra/llui/lluicolor.cpp b/indra/llui/lluicolor.cpp index a6c4e0f0aa6686f58e7430412280927a5fb71a27..03ef7d9405e0799a499e022b1c8ca9ef34650ddc 100644 --- a/indra/llui/lluicolor.cpp +++ b/indra/llui/lluicolor.cpp @@ -31,14 +31,14 @@ #include "lluicolor.h" LLUIColor::LLUIColor() - :mColorPtr(NULL) + :mColorPtr(nullptr) { } LLUIColor::LLUIColor(const LLColor4& color) -: mColor(color), - mColorPtr(NULL) +: mColorPtr(nullptr), + mColor(color) { } @@ -50,7 +50,7 @@ LLUIColor::LLUIColor(const LLUIColor* color) void LLUIColor::set(const LLColor4& color) { mColor = color; - mColorPtr = NULL; + mColorPtr = nullptr; } void LLUIColor::set(const LLUIColor* color) @@ -60,7 +60,7 @@ void LLUIColor::set(const LLUIColor* color) const LLColor4& LLUIColor::get() const { - return (mColorPtr == NULL ? mColor : mColorPtr->get()); + return (mColorPtr == nullptr ? mColor : mColorPtr->get()); } LLUIColor::operator const LLColor4& () const @@ -75,7 +75,7 @@ const LLColor4& LLUIColor::operator()() const bool LLUIColor::isReference() const { - return mColorPtr != NULL; + return mColorPtr != nullptr; } namespace LLInitParam @@ -84,6 +84,6 @@ namespace LLInitParam bool ParamCompare<LLUIColor, false>::equals(const LLUIColor &a, const LLUIColor &b) { // do not detect value equivalence, treat pointers to colors as distinct from color values - return (a.mColorPtr == NULL && b.mColorPtr == NULL ? a.mColor == b.mColor : a.mColorPtr == b.mColorPtr); + return (a.mColorPtr == nullptr && b.mColorPtr == nullptr ? a.mColor == b.mColor : a.mColorPtr == b.mColorPtr); } } diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp index cfd41c08faae40855593a6aaa7304a3e64479466..d891281e3fa177fd5bbad9b0a8eace1af0b9bd67 100644 --- a/indra/llui/lluicolortable.cpp +++ b/indra/llui/lluicolortable.cpp @@ -249,7 +249,7 @@ void LLUIColorTable::saveUserSettings(const bool scrub /* = false */) const const std::string& filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colors.xml"); LLFILE *fp = LLFile::fopen(filename, "w"); - if(fp != NULL) + if(fp != nullptr) { LLXMLNode::writeHeaderToFile(fp); output_node->writeToFile(fp); @@ -294,7 +294,7 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename, string_color_ { LLXMLNodePtr root; - if(!LLXMLNode::parseFile(filename, root, NULL)) + if(!LLXMLNode::parseFile(filename, root, nullptr)) { LL_WARNS() << "Unable to parse color file " << filename << LL_ENDL; return false; diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 4d28b6951338e14f7c52b6b72fa3aef0818840aa..f6c3fe4889be75c1b4ecad854f21fab7b229ca11 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -70,10 +70,10 @@ LLUICtrl::ControlVisibility::ControlVisibility() } LLUICtrl::Params::Params() -: tab_stop("tab_stop", true), +: label("label"), + tab_stop("tab_stop", true), chrome("chrome", false), requests_front("requests_front", false), - label("label"), initial_value("value"), init_callback("init_callback"), commit_callback("commit_callback"), @@ -84,8 +84,8 @@ LLUICtrl::Params::Params() font("font", LLFontGL::getFontSansSerif()), font_halign("halign"), font_valign("valign"), - length("length"), // ignore LLXMLNode cruft - type("type") // ignore LLXMLNode cruft + type("type"), // ignore LLXMLNode cruft + length("length") // ignore LLXMLNode cruft { addSynonym(initial_value, "initial_value"); } @@ -101,25 +101,25 @@ const LLUICtrl::Params& LLUICtrl::getDefaultParams() LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel) : LLView(p), + mCommitSignal(nullptr), + mValidateSignal(nullptr), + mMouseEnterSignal(nullptr), + mMouseLeaveSignal(nullptr), + mMouseDownSignal(nullptr), + mMouseUpSignal(nullptr), + mRightMouseDownSignal(nullptr), + mRightMouseUpSignal(nullptr), + mDoubleClickSignal(nullptr), + mViewModel(viewmodel), + mControlVariable(nullptr), + mEnabledControlVariable(nullptr), + mDisabledControlVariable(nullptr), + mMakeVisibleControlVariable(nullptr), + mMakeInvisibleControlVariable(nullptr), mIsChrome(FALSE), mRequestsFront(p.requests_front), mTabStop(FALSE), mTentative(FALSE), - mViewModel(viewmodel), - mControlVariable(NULL), - mEnabledControlVariable(NULL), - mDisabledControlVariable(NULL), - mMakeVisibleControlVariable(NULL), - mMakeInvisibleControlVariable(NULL), - mCommitSignal(NULL), - mValidateSignal(NULL), - mMouseEnterSignal(NULL), - mMouseLeaveSignal(NULL), - mMouseDownSignal(NULL), - mMouseUpSignal(NULL), - mRightMouseDownSignal(NULL), - mRightMouseUpSignal(NULL), - mDoubleClickSignal(NULL), mTransparencyType(TT_DEFAULT) { claimMem(viewmodel.get()); @@ -476,7 +476,7 @@ void LLUICtrl::setControlVariable(LLControlVariable* control) //RN: this will happen in practice, should we try to avoid it? //LL_WARNS() << "setControlName called twice on same control!" << LL_ENDL; mControlConnection.disconnect(); // disconnect current signal - mControlVariable = NULL; + mControlVariable = nullptr; } if (control) @@ -490,7 +490,7 @@ void LLUICtrl::setControlVariable(LLControlVariable* control) //virtual void LLUICtrl::setControlName(const std::string& control_name, LLView *context) { - if (context == NULL) + if (context == nullptr) { context = this; } @@ -508,7 +508,7 @@ void LLUICtrl::setEnabledControlVariable(LLControlVariable* control) if (mEnabledControlVariable) { mEnabledControlConnection.disconnect(); // disconnect current signal - mEnabledControlVariable = NULL; + mEnabledControlVariable = nullptr; } if (control) { @@ -523,7 +523,7 @@ void LLUICtrl::setDisabledControlVariable(LLControlVariable* control) if (mDisabledControlVariable) { mDisabledControlConnection.disconnect(); // disconnect current signal - mDisabledControlVariable = NULL; + mDisabledControlVariable = nullptr; } if (control) { @@ -538,7 +538,7 @@ void LLUICtrl::setMakeVisibleControlVariable(LLControlVariable* control) if (mMakeVisibleControlVariable) { mMakeVisibleControlConnection.disconnect(); // disconnect current signal - mMakeVisibleControlVariable = NULL; + mMakeVisibleControlVariable = nullptr; } if (control) { @@ -553,7 +553,7 @@ void LLUICtrl::setMakeInvisibleControlVariable(LLControlVariable* control) if (mMakeInvisibleControlVariable) { mMakeInvisibleControlConnection.disconnect(); // disconnect current signal - mMakeInvisibleControlVariable = NULL; + mMakeInvisibleControlVariable = nullptr; } if (control) { @@ -612,19 +612,19 @@ BOOL LLUICtrl::setLabelArg( const std::string& key, const LLStringExplicit& text // virtual LLCtrlSelectionInterface* LLUICtrl::getSelectionInterface() { - return NULL; + return nullptr; } // virtual LLCtrlListInterface* LLUICtrl::getListInterface() { - return NULL; + return nullptr; } // virtual LLCtrlScrollInterface* LLUICtrl::getScrollInterface() { - return NULL; + return nullptr; } BOOL LLUICtrl::hasFocus() const @@ -650,7 +650,7 @@ void LLUICtrl::setFocus(BOOL b) { if( gFocusMgr.childHasKeyboardFocus(this)) { - gFocusMgr.setKeyboardFocus( NULL ); + gFocusMgr.setKeyboardFocus(nullptr ); } } } @@ -817,7 +817,7 @@ BOOL LLUICtrl::focusPrevItem(BOOL text_fields_only) LLUICtrl* LLUICtrl::findRootMostFocusRoot() { - LLUICtrl* focus_root = NULL; + LLUICtrl* focus_root = nullptr; LLUICtrl* next_view = this; while(next_view && next_view->hasTabStop()) { @@ -847,7 +847,7 @@ LLUICtrl* LLUICtrl::getParentUICtrl() const parent = parent->getParent(); } } - return NULL; + return nullptr; } bool LLUICtrl::findHelpTopic(std::string& help_topic_out) @@ -864,7 +864,7 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out) { LLView *child; - LLPanel *subpanel = NULL; + LLPanel *subpanel = nullptr; // does the panel have a sub-panel with a help topic? bfs_tree_iterator_t it = beginTreeBFS(); @@ -889,7 +889,7 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out) } // does the panel have an active tab with a help topic? - LLPanel *tab_panel = NULL; + LLPanel *tab_panel = nullptr; it = beginTreeBFS(); // skip ourselves @@ -897,7 +897,7 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out) for (; it != endTreeBFS(); ++it) { child = *it; - LLPanel *curTabPanel = NULL; + LLPanel *curTabPanel = nullptr; // do we have a tab container? LLTabContainer *tab = dynamic_cast<LLTabContainer *>(child); diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index df01b6331705bb0212c4f99a388693096290cf78..75041219f22436bd8f6207823eb4cac617460bea 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -143,24 +143,24 @@ protected: // We shouldn't ever need to set this directly //virtual void setViewModel(const LLViewModelPtr&); - virtual BOOL postBuild(); + BOOL postBuild() override; public: // LLView interface - /*virtual*/ BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); - /*virtual*/ BOOL isCtrl() const; - /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL canFocusChildren() const; - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ) override; + /*virtual*/ BOOL isCtrl() const override; + /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask) override; + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL canFocusChildren() const override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; // From LLFocusableElement - /*virtual*/ void setFocus( BOOL b ); - /*virtual*/ BOOL hasFocus() const; + /*virtual*/ void setFocus( BOOL b ) override; + /*virtual*/ BOOL hasFocus() const override; // New virtuals @@ -171,7 +171,7 @@ public: bool setControlValue(const LLSD& value); void setControlVariable(LLControlVariable* control); - virtual void setControlName(const std::string& control, LLView *context = NULL); + virtual void setControlName(const std::string& control, LLView *context = nullptr); LLControlVariable* getControlVariable() { return mControlVariable; } @@ -257,7 +257,7 @@ public: class LLTextInputFilter : public LLQueryFilter, public LLSingleton<LLTextInputFilter> { LLSINGLETON_EMPTY_CTOR(LLTextInputFilter); - /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const + /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const override { return filterResult_t(view->isCtrl() && static_cast<const LLUICtrl *>(view)->acceptsTextInput(), TRUE); } @@ -308,8 +308,8 @@ protected: static F32 sActiveControlTransparency; static F32 sInactiveControlTransparency; - - virtual void addInfo(LLSD & info); + + void addInfo(LLSD & info) override; private: diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 9390745b9dbb581695ee3d2a8d10014b30d7559b..e8c07f6127294de3a34315f0a06273f1b23a1c13 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -66,7 +66,7 @@ public: }; LLUICtrlLocate(const Params& p) : LLUICtrl(p) {} - virtual void draw() { } + void draw() override { } }; @@ -79,7 +79,7 @@ template class LLUICtrlFactory* LLSingleton<class LLUICtrlFactory>::getInstance( // LLUICtrlFactory() //----------------------------------------------------------------------------- LLUICtrlFactory::LLUICtrlFactory() - : mDummyPanel(NULL) // instantiated when first needed + : mDummyPanel(nullptr) // instantiated when first needed { } @@ -202,14 +202,14 @@ LLView *LLUICtrlFactory::createFromXML(LLXMLNodePtr node, LLView* parent, const LLStringUtil::toLower(ctrl_type); const LLWidgetCreatorFunc* funcp = registry.getValue(ctrl_type); - if (funcp == NULL) + if (funcp == nullptr) { - return NULL; + return nullptr; } - if (parent == NULL) + if (parent == nullptr) { - if (mDummyPanel == NULL) + if (mDummyPanel == nullptr) { LLPanel::Params p; mDummyPanel = create<LLPanel>(p); @@ -265,13 +265,13 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st { // associate parameter block type with template .xml file std::string* existing_name = LLWidgetNameRegistry::instance().getValue(param_block_type); - if (existing_name != NULL) + if (existing_name != nullptr) { if(*existing_name != name) { std::cerr << "Duplicate entry for T::Params, try creating empty param block in derived classes that inherit T::Params" << std::endl; // forcing crash here - char* foo = 0; + char* foo = nullptr; *foo = 1; } else diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index 32ccb40e7ce1c01907954e6f6520f44322184280..63a998f0dc0bc95884707aa8ab14e845e162842b 100644 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -57,9 +57,9 @@ class LLUIString public: // These methods all perform appropriate argument substitution // and modify mOrig where appropriate - LLUIString() : mArgs(NULL), mNeedsResult(false), mNeedsWResult(false) {} + LLUIString() : mArgs(nullptr), mNeedsResult(false), mNeedsWResult(false) {} LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args); - LLUIString(const std::string& instring) : mArgs(NULL) { assign(instring); } + LLUIString(const std::string& instring) : mArgs(nullptr) { assign(instring); } ~LLUIString() { delete mArgs; } void assign(const std::string& instring); diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index bd0d827a6fb56448fe85f0cc1ae4c0de51258c8e..fd383d3443088803934823827ee3ba8b6b7c45b3 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -136,9 +136,9 @@ class LLUrlEntryHTTP : public LLUrlEntryBase { public: LLUrlEntryHTTP(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getUrl(const std::string &string) const; - /*virtual*/ std::string getTooltip(const std::string &url) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getUrl(const std::string &string) const override; + /*virtual*/ std::string getTooltip(const std::string &url) const override; }; /// @@ -148,20 +148,20 @@ class LLUrlEntryHTTPLabel : public LLUrlEntryBase { public: LLUrlEntryHTTPLabel(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getTooltip(const std::string &string) const; - /*virtual*/ std::string getUrl(const std::string &string) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getTooltip(const std::string &string) const override; + /*virtual*/ std::string getUrl(const std::string &string) const override; }; class LLUrlEntryInvalidSLURL : public LLUrlEntryBase { public: LLUrlEntryInvalidSLURL(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getUrl(const std::string &string) const; - /*virtual*/ std::string getTooltip(const std::string &url) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getUrl(const std::string &string) const override; + /*virtual*/ std::string getTooltip(const std::string &url) const override; - bool isSLURLvalid(const std::string &url) const; + bool isSLURLvalid(const std::string &url) const override; }; /// @@ -171,8 +171,8 @@ class LLUrlEntrySLURL : public LLUrlEntryBase { public: LLUrlEntrySLURL(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getLocation(const std::string &url) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getLocation(const std::string &url) const override; }; /// @@ -182,11 +182,11 @@ class LLUrlEntrySecondlifeURL : public LLUrlEntryBase { public: LLUrlEntrySecondlifeURL(); - /*virtual*/ bool isTrusted() const { return true; } - /*virtual*/ std::string getUrl(const std::string &string) const; - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getQuery(const std::string &url) const; - /*virtual*/ std::string getTooltip(const std::string &url) const; + /*virtual*/ bool isTrusted() const override { return true; } + /*virtual*/ std::string getUrl(const std::string &string) const override; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getQuery(const std::string &url) const override; + /*virtual*/ std::string getTooltip(const std::string &url) const override; }; /// @@ -212,14 +212,14 @@ public: mAvatarNameCacheConnection.disconnect(); } } - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getIcon(const std::string &url); - /*virtual*/ std::string getTooltip(const std::string &string) const; - /*virtual*/ LLStyle::Params getStyle() const; - /*virtual*/ LLUUID getID(const std::string &string) const; - /*virtual*/ bool underlineOnHoverOnly(const std::string &string) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getIcon(const std::string &url) override; + /*virtual*/ std::string getTooltip(const std::string &string) const override; + /*virtual*/ LLStyle::Params getStyle() const override; + /*virtual*/ LLUUID getID(const std::string &string) const override; + /*virtual*/ bool underlineOnHoverOnly(const std::string &string) const override; protected: - /*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon); + /*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon) override; private: void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name); boost::signals2::connection mAvatarNameCacheConnection; @@ -241,8 +241,8 @@ public: mAvatarNameCacheConnection.disconnect(); } } - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ LLStyle::Params getStyle() const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ LLStyle::Params getStyle() const override; protected: // override this to pull out relevant name fields virtual std::string getName(const LLAvatarName& avatar_name) = 0; @@ -262,7 +262,7 @@ class LLUrlEntryAgentCompleteName : public LLUrlEntryAgentName public: LLUrlEntryAgentCompleteName(); private: - /*virtual*/ std::string getName(const LLAvatarName& avatar_name); + /*virtual*/ std::string getName(const LLAvatarName& avatar_name) override; }; class LLUrlEntryAgentLegacyName : public LLUrlEntryAgentName @@ -270,7 +270,7 @@ class LLUrlEntryAgentLegacyName : public LLUrlEntryAgentName public: LLUrlEntryAgentLegacyName(); private: - /*virtual*/ std::string getName(const LLAvatarName& avatar_name); + /*virtual*/ std::string getName(const LLAvatarName& avatar_name) override; }; /// @@ -283,7 +283,7 @@ class LLUrlEntryAgentDisplayName : public LLUrlEntryAgentName public: LLUrlEntryAgentDisplayName(); private: - /*virtual*/ std::string getName(const LLAvatarName& avatar_name); + /*virtual*/ std::string getName(const LLAvatarName& avatar_name) override; }; /// @@ -296,7 +296,7 @@ class LLUrlEntryAgentUserName : public LLUrlEntryAgentName public: LLUrlEntryAgentUserName(); private: - /*virtual*/ std::string getName(const LLAvatarName& avatar_name); + /*virtual*/ std::string getName(const LLAvatarName& avatar_name) override; }; /// @@ -307,7 +307,7 @@ class LLUrlEntryExperienceProfile : public LLUrlEntryBase { public: LLUrlEntryExperienceProfile(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; private: void onExperienceDetails(const LLSD& experience_details); }; @@ -321,9 +321,9 @@ class LLUrlEntryGroup : public LLUrlEntryBase { public: LLUrlEntryGroup(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ LLStyle::Params getStyle() const; - /*virtual*/ LLUUID getID(const std::string &string) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ LLStyle::Params getStyle() const override; + /*virtual*/ LLUUID getID(const std::string &string) const override; private: void onGroupNameReceived(const LLUUID& id, const std::string& name, bool is_group); }; @@ -336,7 +336,7 @@ class LLUrlEntryInventory : public LLUrlEntryBase { public: LLUrlEntryInventory(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; private: }; @@ -348,8 +348,8 @@ class LLUrlEntryObjectIM : public LLUrlEntryBase { public: LLUrlEntryObjectIM(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getLocation(const std::string &url) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getLocation(const std::string &url) const override; private: }; @@ -372,7 +372,7 @@ public: LLUrlEntryParcel(); ~LLUrlEntryParcel(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; // Sends a parcel info request to sim. void sendParcelInfoRequest(const LLUUID& parcel_id); @@ -408,8 +408,8 @@ class LLUrlEntryPlace : public LLUrlEntryBase { public: LLUrlEntryPlace(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getLocation(const std::string &url) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getLocation(const std::string &url) const override; }; /// @@ -420,8 +420,8 @@ class LLUrlEntryRegion : public LLUrlEntryBase { public: LLUrlEntryRegion(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getLocation(const std::string &url) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getLocation(const std::string &url) const override; }; /// @@ -432,8 +432,8 @@ class LLUrlEntryTeleport : public LLUrlEntryBase { public: LLUrlEntryTeleport(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getLocation(const std::string &url) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getLocation(const std::string &url) const override; }; /// @@ -444,7 +444,7 @@ class LLUrlEntrySL : public LLUrlEntryBase { public: LLUrlEntrySL(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; }; /// @@ -455,10 +455,10 @@ class LLUrlEntrySLLabel : public LLUrlEntryBase { public: LLUrlEntrySLLabel(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getUrl(const std::string &string) const; - /*virtual*/ std::string getTooltip(const std::string &string) const; - /*virtual*/ bool underlineOnHoverOnly(const std::string &string) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getUrl(const std::string &string) const override; + /*virtual*/ std::string getTooltip(const std::string &string) const override; + /*virtual*/ bool underlineOnHoverOnly(const std::string &string) const override; }; /// @@ -469,8 +469,8 @@ class LLUrlEntryWorldMap : public LLUrlEntryBase { public: LLUrlEntryWorldMap(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getLocation(const std::string &url) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getLocation(const std::string &url) const override; }; /// @@ -480,9 +480,9 @@ class LLUrlEntryNoLink : public LLUrlEntryBase { public: LLUrlEntryNoLink(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getUrl(const std::string &string) const; - /*virtual*/ LLStyle::Params getStyle() const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getUrl(const std::string &string) const override; + /*virtual*/ LLStyle::Params getStyle() const override; }; /// @@ -492,9 +492,9 @@ class LLUrlEntryIcon : public LLUrlEntryBase { public: LLUrlEntryIcon(); - /*virtual*/ std::string getUrl(const std::string &string) const; - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getIcon(const std::string &url); + /*virtual*/ std::string getUrl(const std::string &string) const override; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getIcon(const std::string &url) override; }; /// @@ -504,8 +504,8 @@ class LLUrlEntryEmail : public LLUrlEntryBase { public: LLUrlEntryEmail(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getUrl(const std::string &string) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getUrl(const std::string &string) const override; }; // <alchemy> @@ -516,9 +516,9 @@ class LLUrlEntryJira : public LLUrlEntryBase { public: LLUrlEntryJira(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getTooltip(const std::string &string) const; - /*virtual*/ std::string getUrl(const std::string &string) const; + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; + /*virtual*/ std::string getTooltip(const std::string &string) const override; + /*virtual*/ std::string getUrl(const std::string &string) const override; }; // </alchemy> diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 2d5bbde9719d62db906b26f484a2b532d757aec3..11a65d372ed6c85e862586da35ba89c5dee34423 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -193,7 +193,7 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL // find the first matching regex from all url entries in the registry U32 match_start = 0, match_end = 0; - LLUrlEntryBase *match_entry = NULL; + LLUrlEntryBase *match_entry = nullptr; std::vector<LLUrlEntryBase *>::iterator it; for (it = mUrlEntry.begin(); it != mUrlEntry.end(); ++it) @@ -210,7 +210,7 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL if (matchRegex(text.c_str(), url_entry->getPattern(), start, end)) { // does this match occur in the string before any other match - if (start < match_start || match_entry == NULL) + if (start < match_start || match_entry == nullptr) { if (mLLUrlEntryInvalidSLURL == *it) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 7f8795d98c172346ca4fbc7189817ea4b11f3fdb..c0001796183fb6278d7972ef3aa44b24ec7bcaf0 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -67,7 +67,7 @@ std::string LLView::sMouseHandlerMessage; BOOL LLView::sForceReshape = FALSE; std::set<LLView*> LLView::sPreviewHighlightedElements; BOOL LLView::sHighlightingDiffs = FALSE; -LLView* LLView::sPreviewClickedElement = NULL; +LLView* LLView::sPreviewClickedElement = nullptr; BOOL LLView::sDrawPreviewHighlights = FALSE; S32 LLView::sLastLeftXML = S32_MIN; S32 LLView::sLastBottomXML = S32_MIN; @@ -106,13 +106,15 @@ LLView::Params::Params() enabled("enabled", true), visible("visible", true), mouse_opaque("mouse_opaque", true), - follows("follows"), - hover_cursor("hover_cursor", "UI_CURSOR_ARROW"), use_bounding_rect("use_bounding_rect", false), + from_xui("from_xui", false), + focus_root("focus_root", false), tab_group("tab_group", 0), default_tab_group("default_tab_group"), tool_tip("tool_tip"), sound_flags("sound_flags", MOUSE_UP), + follows("follows"), + hover_cursor("hover_cursor", "UI_CURSOR_ARROW"), layout("layout"), rect("rect"), bottom_delta("bottom_delta", S32_MAX), @@ -120,8 +122,6 @@ LLView::Params::Params() top_delta("top_delta", S32_MAX), left_pad("left_pad"), left_delta("left_delta", S32_MAX), - from_xui("from_xui", false), - focus_root("focus_root", false), needs_translate("translate"), xmlns("xmlns"), xmlns_xsi("xmlns:xsi"), @@ -134,23 +134,23 @@ LLView::Params::Params() LLView::LLView(const LLView::Params& p) : LLTrace::MemTrackable<LLView>("LLView"), + mHoverCursor(getCursorFromString(p.hover_cursor)), + mParentView(nullptr), mVisible(p.visible), - mInDraw(false), mName(p.name), - mParentView(NULL), mReshapeFlags(FOLLOWS_NONE), - mFromXUI(p.from_xui), - mIsFocusRoot(p.focus_root), - mLastVisible(FALSE), - mHoverCursor(getCursorFromString(p.hover_cursor)), + mDefaultTabGroup(p.default_tab_group), + mLastTabGroup(0), mEnabled(p.enabled), mMouseOpaque(p.mouse_opaque), + mToolTipMsg((LLStringExplicit)p.tool_tip()), mSoundFlags(p.sound_flags), + mFromXUI(p.from_xui), + mIsFocusRoot(p.focus_root), mUseBoundingRect(p.use_bounding_rect), - mDefaultTabGroup(p.default_tab_group), - mLastTabGroup(0), - mToolTipMsg((LLStringExplicit)p.tool_tip()), - mDefaultWidgets(NULL) + mLastVisible(FALSE), + mInDraw(false), + mDefaultWidgets(nullptr) { // create rect first, as this will supply initial follows flags setShape(p.rect); @@ -177,7 +177,7 @@ LLView::~LLView() deleteAllChildren(); - if (mParentView != NULL) + if (mParentView != nullptr) { mParentView->removeChild(this); } @@ -185,7 +185,7 @@ LLView::~LLView() if (mDefaultWidgets) { delete mDefaultWidgets; - mDefaultWidgets = NULL; + mDefaultWidgets = nullptr; } } @@ -342,7 +342,7 @@ void LLView::removeChild(LLView* child) } } // </alchemy> - child->mParentView = NULL; + child->mParentView = nullptr; child_tab_order_t::iterator found = mTabOrder.find(child); if(found != mTabOrder.end()) { @@ -672,7 +672,7 @@ void LLView::setSnappedTo(const LLView* snap_view) BOOL LLView::handleHover(S32 x, S32 y, MASK mask) { - return childrenHandleHover( x, y, mask ) != NULL; + return childrenHandleHover( x, y, mask ) != nullptr; } void LLView::onMouseEnter(S32 x, S32 y, MASK mask) @@ -724,7 +724,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m } } } - return NULL; + return nullptr; } // XDATA might be MASK, or S32 clicks @@ -755,7 +755,7 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA return viewp; } } - return NULL; + return nullptr; } LLView* LLView::childrenHandleToolTip(S32 x, S32 y, MASK mask) @@ -779,7 +779,7 @@ LLView* LLView::childrenHandleToolTip(S32 x, S32 y, MASK mask) return viewp; } } - return NULL; + return nullptr; } LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask, @@ -813,7 +813,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask, return viewp; } } - return NULL; + return nullptr; } LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask) @@ -838,13 +838,13 @@ LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask) return viewp; } } - return NULL; + return nullptr; } LLView* LLView::childFromPoint(S32 x, S32 y, bool recur) { if (!getVisible()) - return NULL; + return nullptr; for (LLView* viewp : mChildList) { @@ -870,7 +870,7 @@ LLView* LLView::childFromPoint(S32 x, S32 y, bool recur) return viewp; } - return NULL; + return nullptr; } BOOL LLView::handleToolTip(S32 x, S32 y, MASK mask) @@ -915,7 +915,7 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent) if( called_from_parent ) { // Downward traversal - handled = childrenHandleKey( key, mask ) != NULL; + handled = childrenHandleKey( key, mask ) != nullptr; } if (!handled) @@ -947,7 +947,7 @@ BOOL LLView::handleKeyUp(KEY key, MASK mask, BOOL called_from_parent) if (called_from_parent) { // Downward traversal - handled = childrenHandleKeyUp(key, mask) != NULL; + handled = childrenHandleKeyUp(key, mask) != nullptr; } if (!handled) @@ -993,7 +993,7 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) if( called_from_parent ) { // Downward traversal - handled = childrenHandleUnicodeChar( uni_char ) != NULL; + handled = childrenHandleUnicodeChar( uni_char ) != nullptr; } if (!handled) @@ -1032,7 +1032,7 @@ BOOL LLView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EAcceptance* accept, std::string& tooltip_msg) { - return childrenHandleDragAndDrop( x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) != NULL; + return childrenHandleDragAndDrop( x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) != nullptr; } void LLView::onMouseCaptureLost() @@ -1048,44 +1048,44 @@ BOOL LLView::handleMouseUp(S32 x, S32 y, MASK mask) { LLView* r = childrenHandleMouseUp( x, y, mask ); - return (r!=NULL); + return (r!= nullptr); } BOOL LLView::handleMouseDown(S32 x, S32 y, MASK mask) { LLView* r= childrenHandleMouseDown(x, y, mask ); - return (r!=NULL); + return (r!= nullptr); } BOOL LLView::handleDoubleClick(S32 x, S32 y, MASK mask) { - return childrenHandleDoubleClick( x, y, mask ) != NULL; + return childrenHandleDoubleClick( x, y, mask ) != nullptr; } BOOL LLView::handleScrollWheel(S32 x, S32 y, S32 clicks) { - return childrenHandleScrollWheel( x, y, clicks ) != NULL; + return childrenHandleScrollWheel( x, y, clicks ) != nullptr; } BOOL LLView::handleRightMouseDown(S32 x, S32 y, MASK mask) { - return childrenHandleRightMouseDown( x, y, mask ) != NULL; + return childrenHandleRightMouseDown( x, y, mask ) != nullptr; } BOOL LLView::handleRightMouseUp(S32 x, S32 y, MASK mask) { - return childrenHandleRightMouseUp( x, y, mask ) != NULL; + return childrenHandleRightMouseUp( x, y, mask ) != nullptr; } BOOL LLView::handleMiddleMouseDown(S32 x, S32 y, MASK mask) { - return childrenHandleMiddleMouseDown( x, y, mask ) != NULL; + return childrenHandleMiddleMouseDown( x, y, mask ) != nullptr; } BOOL LLView::handleMiddleMouseUp(S32 x, S32 y, MASK mask) { - return childrenHandleMiddleMouseUp( x, y, mask ) != NULL; + return childrenHandleMiddleMouseUp( x, y, mask ) != nullptr; } LLView* LLView::childrenHandleScrollWheel(S32 x, S32 y, S32 clicks) @@ -1164,7 +1164,7 @@ void LLView::drawChildren() child_list_reverse_iter_t child = child_iter++; LLView *viewp = *child; - if (viewp == NULL) + if (viewp == nullptr) { continue; } @@ -1284,7 +1284,7 @@ void LLView::drawDebugRect() S32 depth = 0; LLView * viewp = this; - while (NULL != viewp) + while (nullptr != viewp) { viewp = viewp->getParent(); depth++; @@ -1296,7 +1296,7 @@ void LLView::drawDebugRect() debug_rect.getWidth(), debug_rect.getHeight()); LLFontGL::getFontSansSerifSmall()->renderUTF8(debug_text, 0, (F32)x, (F32)y, border_color, LLFontGL::HCENTER, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, - S32_MAX, S32_MAX, NULL, FALSE); + S32_MAX, S32_MAX, nullptr, FALSE); } } LLUI::popMatrix(); @@ -1340,7 +1340,7 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent) // move child views according to reshape flags for (LLView* viewp : mChildList) { - if (viewp != NULL) + if (viewp != nullptr) { LLRect child_rect( viewp->mRect ); @@ -1538,7 +1538,7 @@ BOOL LLView::childHasKeyboardFocus( const std::string& childname ) const { LLView *focus = dynamic_cast<LLView *>(gFocusMgr.getKeyboardFocus()); - while (focus != NULL) + while (focus != nullptr) { if (focus->getName() == childname) { @@ -1555,7 +1555,7 @@ BOOL LLView::childHasKeyboardFocus( const std::string& childname ) const BOOL LLView::hasChild(const std::string& childname, BOOL recurse) const { - return findChildView(childname, recurse) != NULL; + return findChildView(childname, recurse) != nullptr; } //----------------------------------------------------------------------------- @@ -1602,7 +1602,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const } } } - return NULL; + return nullptr; } // </alchemy> @@ -1699,7 +1699,7 @@ LLView* LLView::findPrevSibling(LLView* child) { return *(--prev_it); } - return NULL; + return nullptr; } LLView* LLView::findNextSibling(LLView* child) @@ -1813,7 +1813,7 @@ void LLView::centerWithin(const LLRect& bounds) BOOL LLView::localPointToOtherView( S32 x, S32 y, S32 *other_x, S32 *other_y, const LLView* other_view) const { const LLView* cur_view = this; - const LLView* root_view = NULL; + const LLView* root_view = nullptr; while (cur_view) { @@ -1857,7 +1857,7 @@ BOOL LLView::localRectToOtherView( const LLRect& local, LLRect* other, const LLV { LLRect cur_rect = local; const LLView* cur_view = this; - const LLView* root_view = NULL; + const LLView* root_view = nullptr; while (cur_view) { @@ -1934,7 +1934,7 @@ private: class SortByTabOrder : public LLQuerySorter, public LLSingleton<SortByTabOrder> { LLSINGLETON_EMPTY_CTOR(SortByTabOrder); - /*virtual*/ void sort(LLView * parent, LLView::child_list_t &children) const + /*virtual*/ void sort(LLView * parent, LLView::child_list_t &children) const override { children.sort(CompareByTabOrder(parent->getTabOrder(), parent->getDefaultTabGroup())); } @@ -1958,7 +1958,7 @@ const LLViewQuery & LLView::getTabOrderQuery() class LLFocusRootsFilter : public LLQueryFilter, public LLSingleton<LLFocusRootsFilter> { LLSINGLETON_EMPTY_CTOR(LLFocusRootsFilter); - /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const + /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const override { return filterResult_t(view->isCtrl() && view->isFocusRoot(), !view->isFocusRoot()); } @@ -1996,11 +1996,11 @@ LLView* LLView::findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir, LLView::ESnapType snap_type, S32 threshold, S32 padding) { new_rect = mRect; - LLView* snap_view = NULL; + LLView* snap_view = nullptr; if (!mParentView) { - return NULL; + return nullptr; } S32 delta_x = 0; @@ -2064,10 +2064,10 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna if (!mParentView) { new_edge_val = snap_pos; - return NULL; + return nullptr; } - LLView* snap_view = NULL; + LLView* snap_view = nullptr; // If the view is near the edge of its parent, snap it to // the edge. diff --git a/indra/llui/llview.h b/indra/llui/llview.h index eec38f5eb8c59019d35eb59deb9051d994aae776..aed37c52af6ed174f4ab9bbdd4df4727bd292751 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -371,9 +371,9 @@ public: virtual void setSnappedTo(const LLView* snap_view); // inherited from LLFocusableElement - /* virtual */ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); - /* virtual */ BOOL handleKeyUp(KEY key, MASK mask, BOOL called_from_parent); - /* virtual */ BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); + /* virtual */ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent) override; + /* virtual */ BOOL handleKeyUp(KEY key, MASK mask, BOOL called_from_parent) override; + /* virtual */ BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) override; virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, @@ -414,22 +414,22 @@ public: // LLMouseHandler functions // Default behavior is to pass events to children - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); - - /*virtual*/ const std::string& getName() const; - /*virtual*/ void onMouseCaptureLost(); - /*virtual*/ BOOL hasMouseCapture(); - /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const; - /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; + + /*virtual*/ const std::string& getName() const override; + /*virtual*/ void onMouseCaptureLost() override; + /*virtual*/ BOOL hasMouseCapture() override; + /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const override; + /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const override; virtual LLView* childFromPoint(S32 x, S32 y, bool recur=false); @@ -475,7 +475,7 @@ public: } parent = parent->getParent(); } - return NULL; + return nullptr; } ////////////////////////////////////////////// @@ -704,7 +704,7 @@ template <class T> T* LLView::getChild(const std::string& name, BOOL recurse) co else { LL_WARNS() << "Failed to create dummy " << typeid(T).name() << LL_ENDL; - return NULL; + return nullptr; } getDefaultWidgetContainer().addChild(result); diff --git a/indra/llui/llviewborder.h b/indra/llui/llviewborder.h index 413ce39744a71fbfaa2628bfb353c22ed4154157..874bc4f9fc97133f85a5ee8b5e7f44cce2159f0c 100644 --- a/indra/llui/llviewborder.h +++ b/indra/llui/llviewborder.h @@ -66,10 +66,10 @@ protected: public: virtual void setValue(const LLSD& val) { setRect(LLRect(val)); } - virtual BOOL isCtrl() const { return FALSE; } + BOOL isCtrl() const override { return FALSE; } // llview functionality - virtual void draw(); + void draw() override; static BOOL getBevelFromAttribute(LLXMLNodePtr node, LLViewBorder::EBevel& bevel_style); diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp index 00e31e57ea042ee219cc341dd26ce6eb6bab010f..8303c36250e7a76a0755c4f796011b04e06cf08e 100644 --- a/indra/llui/llviewmodel.cpp +++ b/indra/llui/llviewmodel.cpp @@ -155,13 +155,13 @@ void LLListViewModel::setColumnLabel(const std::string& column, const std::strin LLScrollListItem* LLListViewModel::addElement(const LLSD& value, EAddPosition pos, void* userdata) { - return NULL; + return nullptr; } LLScrollListItem* LLListViewModel::addSimpleElement(const std::string& value, EAddPosition pos, const LLSD& id) { - return NULL; + return nullptr; } void LLListViewModel::clearRows() diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h index 2592b229e9b364e5808fb3eff535a4f5d0f7ba85..fe0c1e6570090d6d7cb0560d388dbb4c3f466506 100644 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -98,8 +98,8 @@ public: LLTextViewModel(const LLSD& value); // LLViewModel functions - virtual void setValue(const LLSD& value); - virtual LLSD getValue() const; + void setValue(const LLSD& value) override; + LLSD getValue() const override; // New functions /// Get the stored value in string form @@ -136,7 +136,7 @@ public: virtual void clearColumns(); virtual void setColumnLabel(const std::string& column, const std::string& label); virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, - void* userdata = NULL); + void* userdata = nullptr); virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos, const LLSD& id); virtual void clearRows(); diff --git a/indra/llui/llviewquery.h b/indra/llui/llviewquery.h index 21bb1be26f8d5c86a17e19c569446d79ecbebf8d..fec51138826d1a6ce13d99f18185d4af01518652 100644 --- a/indra/llui/llviewquery.h +++ b/indra/llui/llviewquery.h @@ -55,45 +55,45 @@ public: class LLLeavesFilter : public LLQueryFilter, public LLSingleton<LLLeavesFilter> { LLSINGLETON_EMPTY_CTOR(LLLeavesFilter); - /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const; + /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const override; }; class LLRootsFilter : public LLQueryFilter, public LLSingleton<LLRootsFilter> { LLSINGLETON_EMPTY_CTOR(LLRootsFilter); - /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const; + /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const override; }; class LLVisibleFilter : public LLQueryFilter, public LLSingleton<LLVisibleFilter> { LLSINGLETON_EMPTY_CTOR(LLVisibleFilter); - /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const; + /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const override; }; class LLEnabledFilter : public LLQueryFilter, public LLSingleton<LLEnabledFilter> { LLSINGLETON_EMPTY_CTOR(LLEnabledFilter); - /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const; + /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const override; }; class LLTabStopFilter : public LLQueryFilter, public LLSingleton<LLTabStopFilter> { LLSINGLETON_EMPTY_CTOR(LLTabStopFilter); - /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const; + /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const override; }; class LLCtrlFilter : public LLQueryFilter, public LLSingleton<LLCtrlFilter> { LLSINGLETON_EMPTY_CTOR(LLCtrlFilter); - /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const; + /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const override; }; template <class T> class LLWidgetTypeFilter : public LLQueryFilter { - /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const + /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const override { - return filterResult_t(dynamic_cast<const T*>(view) != NULL, TRUE); + return filterResult_t(dynamic_cast<const T*>(view) != nullptr, TRUE); } }; diff --git a/indra/llui/llwindowshade.cpp b/indra/llui/llwindowshade.cpp index da72859d90557ba6e01887e22bd8827c47ac12d7..21b7269e58b4bdf8222c4225f99b64a17ce69a76 100644 --- a/indra/llui/llwindowshade.cpp +++ b/indra/llui/llwindowshade.cpp @@ -43,9 +43,9 @@ static LLDefaultChildRegistry::Register<LLWindowShade> r("window_shade"); LLWindowShade::Params::Params() : bg_image("bg_image"), - modal("modal", false), text_color("text_color"), shade_color("shade_color"), + modal("modal", false), can_close("can_close", true) { changeDefault(mouse_opaque, false); diff --git a/indra/llui/llwindowshade.h b/indra/llui/llwindowshade.h index 729bf2734439c8694362c72203f4f325bb1addc5..2ddc4fee9780324a75bc6a5e28936c41d35a7f10 100644 --- a/indra/llui/llwindowshade.h +++ b/indra/llui/llwindowshade.h @@ -49,8 +49,8 @@ public: }; void show(LLNotificationPtr); - BOOL postBuild(); - /*virtual*/ void draw(); + BOOL postBuild() override; + /*virtual*/ void draw() override; void hide(); bool isShown() const; diff --git a/indra/llui/llxuiparser.h b/indra/llui/llxuiparser.h index 7f39873de7a9d14eec97befeb50b963572ffe605..6245dee605c1855a46eadc8305aef5765a47deec 100644 --- a/indra/llui/llxuiparser.h +++ b/indra/llui/llxuiparser.h @@ -61,8 +61,8 @@ class LLXSDWriter : public LLInitParam::Parser public: void writeXSD(const std::string& name, LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const std::string& xml_namespace); - /*virtual*/ std::string getCurrentElementName() { return LLStringUtil::null; } - /*virtual*/ std::string getCurrentFileName() { return LLStringUtil::null; } + /*virtual*/ std::string getCurrentElementName() override { return LLStringUtil::null; } + /*virtual*/ std::string getCurrentFileName() override { return LLStringUtil::null; } LLXSDWriter(); ~LLXSDWriter(); @@ -99,17 +99,17 @@ public: LLXUIParser(); typedef LLInitParam::Parser::name_stack_t name_stack_t; - /*virtual*/ std::string getCurrentElementName(); - /*virtual*/ std::string getCurrentFileName() { return mCurFileName; } - /*virtual*/ void parserWarning(const std::string& message); - /*virtual*/ void parserError(const std::string& message); + /*virtual*/ std::string getCurrentElementName() override; + /*virtual*/ std::string getCurrentFileName() override { return mCurFileName; } + /*virtual*/ void parserWarning(const std::string& message) override; + /*virtual*/ void parserError(const std::string& message) override; void readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, const std::string& filename = LLStringUtil::null, bool silent=false); template<typename BLOCK> void writeXUI(LLXMLNodePtr node, const BLOCK& block, const LLInitParam::predicate_rule_t rules = LLInitParam::default_parse_rules(), - const LLInitParam::BaseBlock* diff_block = NULL) + const LLInitParam::BaseBlock* diff_block = nullptr) { if (!diff_block && !rules.isAmbivalent(LLInitParam::HAS_DEFAULT_VALUE)) @@ -202,10 +202,10 @@ public: LLSimpleXUIParser(element_start_callback_t element_cb = nullptr); virtual ~LLSimpleXUIParser(); - /*virtual*/ std::string getCurrentElementName(); - /*virtual*/ std::string getCurrentFileName() { return mCurFileName; } - /*virtual*/ void parserWarning(const std::string& message); - /*virtual*/ void parserError(const std::string& message); + /*virtual*/ std::string getCurrentElementName() override; + /*virtual*/ std::string getCurrentFileName() override { return mCurFileName; } + /*virtual*/ void parserWarning(const std::string& message) override; + /*virtual*/ void parserError(const std::string& message) override; bool readXUI(const std::string& filename, LLInitParam::BaseBlock& block, bool silent=false); diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp index f939063710e8bc6ec022cc9cb01aed27f3b61ac1..ab11d014797bbe36e6611b92bbfabbce9bdc6f0e 100644 --- a/indra/llvfs/lldir_win32.cpp +++ b/indra/llvfs/lldir_win32.cpp @@ -50,12 +50,12 @@ LLDir_Win32::LLDir_Win32() WCHAR w_str[MAX_PATH]; - WCHAR* pPath = NULL; - if(SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, NULL, &pPath) == S_OK) + WCHAR* pPath = nullptr; + if(SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, nullptr, &pPath) == S_OK) wcscpy_s(w_str, pPath); CoTaskMemFree(pPath); - pPath = NULL; + pPath = nullptr; mOSUserDir = utf16str_to_utf8str(llutf16string(w_str)); @@ -67,11 +67,11 @@ LLDir_Win32::LLDir_Win32() // // We used to store the cache in AppData\Roaming, and the installer // cleans up that version on upgrade. JC - if(SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, NULL, &pPath) == S_OK) + if(SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &pPath) == S_OK) wcscpy_s(w_str, pPath); CoTaskMemFree(pPath); - pPath = NULL; + pPath = nullptr; mOSCacheDir = utf16str_to_utf8str(llutf16string(w_str)); @@ -95,7 +95,7 @@ LLDir_Win32::LLDir_Win32() mWorkingDir = utf16str_to_utf8str(llutf16string(w_str)); // Set the executable directory - S32 size = GetModuleFileName(NULL, w_str, MAX_PATH); + S32 size = GetModuleFileName(nullptr, w_str, MAX_PATH); if (size) { w_str[size] = '\0'; diff --git a/indra/llvfs/lldir_win32.h b/indra/llvfs/lldir_win32.h index 450efaf9da47acafa16b9842f64757651fadca54..fcaf4e9f1434b564fb8dbc62386394418f528ea8 100644 --- a/indra/llvfs/lldir_win32.h +++ b/indra/llvfs/lldir_win32.h @@ -40,14 +40,14 @@ public: virtual ~LLDir_Win32(); /*virtual*/ void initAppDirs(const std::string &app_name, - const std::string& app_read_only_data_dir); + const std::string& app_read_only_data_dir) override; - /*virtual*/ std::string getCurPath(); + /*virtual*/ std::string getCurPath() override; /*virtual*/ U32 countFilesInDir(const std::string &dirname, const std::string &mask); - /*virtual*/ bool fileExists(const std::string &filename) const; + /*virtual*/ bool fileExists(const std::string &filename) const override; - /*virtual*/ std::string getLLPluginLauncher(); - /*virtual*/ std::string getLLPluginFilename(std::string base_name); + /*virtual*/ std::string getLLPluginLauncher() override; + /*virtual*/ std::string getLLPluginFilename(std::string base_name) override; private: void* mDirSearch_h; diff --git a/indra/llvfs/lllfsthread.cpp b/indra/llvfs/lllfsthread.cpp index 517393a61480100bfcf2c335b564b1997c96e516..af00bd0aaca9ef1299be4e220e3987a26f3ca458 100644 --- a/indra/llvfs/lllfsthread.cpp +++ b/indra/llvfs/lllfsthread.cpp @@ -33,7 +33,7 @@ //============================================================================ -/*static*/ LLLFSThread* LLLFSThread::sLocal = NULL; +/*static*/ LLLFSThread* LLLFSThread::sLocal = nullptr; //============================================================================ // Run on MAIN thread @@ -60,7 +60,7 @@ void LLLFSThread::cleanupClass() sLocal->update(0); } delete sLocal; - sLocal = 0; + sLocal = nullptr; } //---------------------------------------------------------------------------- @@ -160,7 +160,7 @@ void LLLFSThread::Request::finishRequest(bool completed) if (mResponder.notNull()) { mResponder->completed(completed ? mBytesRead : 0); - mResponder = NULL; + mResponder = nullptr; } } @@ -173,7 +173,7 @@ void LLLFSThread::Request::deleteRequest() if (mResponder.notNull()) { mResponder->completed(0); - mResponder = NULL; + mResponder = nullptr; } LLQueuedThread::QueuedRequest::deleteRequest(); } diff --git a/indra/llvfs/lllfsthread.h b/indra/llvfs/lllfsthread.h index 4e8fb8ddcc0be4a956c888bc07acce1ce8cdd5ec..98efc86c077c0b7b92fd3771c1f6d3c4a23bcd5d 100644 --- a/indra/llvfs/lllfsthread.h +++ b/indra/llvfs/lllfsthread.h @@ -89,9 +89,9 @@ public: return mFileName; } - /*virtual*/ bool processRequest(); - /*virtual*/ void finishRequest(bool completed); - /*virtual*/ void deleteRequest(); + /*virtual*/ bool processRequest() override; + /*virtual*/ void finishRequest(bool completed) override; + /*virtual*/ void deleteRequest() override; private: LLLFSThread* mThread; diff --git a/indra/llvfs/llpidlock.cpp b/indra/llvfs/llpidlock.cpp index ecbd14ffbb98f81e57871686f99ffca83ff75307..d46045d1f2da27fc9b1d2630ac91850738908f2d 100644 --- a/indra/llvfs/llpidlock.cpp +++ b/indra/llvfs/llpidlock.cpp @@ -63,7 +63,7 @@ class LLPidLockFile mSaving(false), mWaiting(false), mPID(LLApp::getPid()), - mNameTable(NULL), + mNameTable(nullptr), mClean(true) { mLockName = gDirUtilp->getTempDir() + gDirUtilp->getDirDelimiter() + "savelock"; diff --git a/indra/llvfs/llpidlock.h b/indra/llvfs/llpidlock.h index 334f26bb294b13a4bd2c30e16ad581bd97a9c693..9496b68ca5c5b761854541899fcbe26ef1d39b88 100644 --- a/indra/llvfs/llpidlock.h +++ b/indra/llvfs/llpidlock.h @@ -39,7 +39,7 @@ namespace LLPidLock { void initClass(); // { (void) LLPidLockFile::instance(); } - bool requestLock( LLNameTable<void *> *name_table=NULL, bool autosave=TRUE, + bool requestLock( LLNameTable<void *> *name_table= nullptr, bool autosave=TRUE, bool force_immediate=FALSE, F32 timeout=300.0); bool checkLock(); void releaseLock(); diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index 77427253baab3c5bbdbb305099130b975827b096..bdcbdd2c30421c1405e00c688702d3fa831d1408 100644 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -45,7 +45,7 @@ const S32 LLVFile::APPEND = 0x00000006; // 0x00000004 & LLVFile::WRITE static LLTrace::BlockTimerStatHandle FTM_VFILE_WAIT("VFile Wait"); //---------------------------------------------------------------------------- -LLVFSThread* LLVFile::sVFSThread = NULL; +LLVFSThread* LLVFile::sVFSThread = nullptr; BOOL LLVFile::sAllocdVFSThread = FALSE; //---------------------------------------------------------------------------- @@ -135,7 +135,7 @@ U8* LLVFile::readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S if (file_size == 0) { // File is empty. - data = NULL; + data = nullptr; } else { @@ -145,7 +145,7 @@ U8* LLVFile::readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S if (file.getLastBytesRead() != (S32)file_size) { ll_aligned_free_16(data); - data = NULL; + data = nullptr; file_size = 0; } } @@ -396,7 +396,7 @@ void LLVFile::initClass(LLVFSThread* vfsthread) { if (!vfsthread) { - if (LLVFSThread::sLocal != NULL) + if (LLVFSThread::sLocal != nullptr) { vfsthread = LLVFSThread::sLocal; } @@ -416,7 +416,7 @@ void LLVFile::cleanupClass() { delete sVFSThread; } - sVFSThread = NULL; + sVFSThread = nullptr; } bool LLVFile::isLocked(EVFSLock lock) diff --git a/indra/llvfs/llvfile.h b/indra/llvfs/llvfile.h index 821b394bf92a8338f265fc3be0f628719cac24ae..e2ffc6b63308cdebe9b3e82f77510aa064fe6372 100644 --- a/indra/llvfs/llvfile.h +++ b/indra/llvfs/llvfile.h @@ -39,7 +39,7 @@ public: ~LLVFile(); BOOL read(U8 *buffer, S32 bytes, BOOL async = FALSE, F32 priority = 128.f); /* Flawfinder: ignore */ - static U8* readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S32* bytes_read = 0); + static U8* readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S32* bytes_read = nullptr); void setReadPriority(const F32 priority); BOOL isReadComplete(); S32 getLastBytesRead(); @@ -59,7 +59,7 @@ public: bool isLocked(EVFSLock lock); void waitForLock(EVFSLock lock); - static void initClass(LLVFSThread* vfsthread = NULL); + static void initClass(LLVFSThread* vfsthread = nullptr); static void cleanupClass(); static LLVFSThread* getVFSThread() { return sVFSThread; } diff --git a/indra/llvfs/llvfs.cpp b/indra/llvfs/llvfs.cpp index 6f0e05da30042b389b21dc4d659680cef6056bdb..b5eaedeaeed7e7ccab888af445f3ec1f9097e32a 100644 --- a/indra/llvfs/llvfs.cpp +++ b/indra/llvfs/llvfs.cpp @@ -44,7 +44,7 @@ const S32 FILE_BLOCK_MASK = 0x000003FF; // 1024-byte blocks const S32 VFS_CLEANUP_SIZE = 5242880; // how much space we free up in a single stroke const S32 BLOCK_LENGTH_INVALID = -1; // mLength for invalid LLVFSFileBlocks -LLVFS *gVFS = NULL; +LLVFS *gVFS = nullptr; // internal class definitions class LLVFSBlock @@ -118,7 +118,7 @@ public: { mSize = 0; mIndexLocation = -1; - mAccessTime = (U32)time(NULL); + mAccessTime = (U32)time(nullptr); for (S32 i = 0; i < (S32)VFSLOCK_COUNT; i++) { @@ -226,8 +226,8 @@ const S32 LLVFSFileBlock::SERIAL_SIZE = 34; LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename, const BOOL read_only, const U32 presize, const BOOL remove_after_crash) -: mDataFP(NULL), - mIndexFP(NULL), +: mDataFP(nullptr), + mIndexFP(nullptr), mRemoveAfterCrash(remove_after_crash) { mDataMutex = new LLMutex(); @@ -288,7 +288,7 @@ LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename { // marker exists, kill the lock and the VFS files unlockAndClose(mDataFP); - mDataFP = NULL; + mDataFP = nullptr; LL_WARNS("VFS") << "VFS: File left open on last run, removing old VFS file " << mDataFilename << LL_ENDL; LLFile::remove(mIndexFilename); @@ -360,11 +360,11 @@ LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename delete block; unlockAndClose( mIndexFP ); - mIndexFP = NULL; + mIndexFP = nullptr; LLFile::remove( mIndexFilename ); unlockAndClose( mDataFP ); - mDataFP = NULL; + mDataFP = nullptr; LLFile::remove( mDataFilename ); LL_WARNS("VFS") << "Deleted corrupt VFS files " @@ -463,11 +463,11 @@ LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename { // Invalid VFS unlockAndClose( mIndexFP ); - mIndexFP = NULL; + mIndexFP = nullptr; LLFile::remove( mIndexFilename ); unlockAndClose( mDataFP ); - mDataFP = NULL; + mDataFP = nullptr; LLFile::remove( mDataFilename ); LL_WARNS("VFS") << "VFS: overlapping entries" @@ -524,7 +524,7 @@ LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename LL_WARNS("VFS") << "Couldn't open an index file for the VFS, probably a sharing violation!" << LL_ENDL; unlockAndClose( mDataFP ); - mDataFP = NULL; + mDataFP = nullptr; LLFile::remove( mDataFilename ); mValid = VFSVALID_BAD_CANNOT_CREATE; @@ -544,7 +544,7 @@ LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename if (marker_fp) { fclose(marker_fp); - marker_fp = NULL; + marker_fp = nullptr; } } @@ -562,7 +562,7 @@ LLVFS::~LLVFS() } unlockAndClose(mIndexFP); - mIndexFP = NULL; + mIndexFP = nullptr; fileblock_map::const_iterator it; for (it = mFileBlocks.begin(); it != mFileBlocks.end(); ++it) @@ -577,7 +577,7 @@ LLVFS::~LLVFS() mFreeBlocksByLocation.clear(); unlockAndClose(mDataFP); - mDataFP = NULL; + mDataFP = nullptr; // Remove marker file if (!mReadOnly && mRemoveAfterCrash) @@ -622,7 +622,7 @@ LLVFS * LLVFS::createLLVFS(const std::string& index_filename, if( !new_vfs->isValid() ) { delete new_vfs; // Delete bad VFS - new_vfs = NULL; // Total failure + new_vfs = nullptr; // Total failure } return new_vfs; @@ -659,7 +659,7 @@ void LLVFS::presizeDataFile(const U32 size) BOOL LLVFS::getExists(const LLUUID &file_id, const LLAssetType::EType file_type) { - LLVFSFileBlock *block = NULL; + LLVFSFileBlock *block = nullptr; if (!isValid()) { @@ -673,7 +673,7 @@ BOOL LLVFS::getExists(const LLUUID &file_id, const LLAssetType::EType file_type) if (it != mFileBlocks.end()) { block = (*it).second; - block->mAccessTime = (U32)time(NULL); + block->mAccessTime = (U32)time(nullptr); } BOOL res = (block && block->mLength > 0) ? TRUE : FALSE; @@ -701,7 +701,7 @@ S32 LLVFS::getSize(const LLUUID &file_id, const LLAssetType::EType file_type) { LLVFSFileBlock *block = (*it).second; - block->mAccessTime = (U32)time(NULL); + block->mAccessTime = (U32)time(nullptr); size = block->mSize; } @@ -727,7 +727,7 @@ S32 LLVFS::getMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type { LLVFSFileBlock *block = (*it).second; - block->mAccessTime = (U32)time(NULL); + block->mAccessTime = (U32)time(nullptr); size = block->mLength; } @@ -767,7 +767,7 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type lockData(); LLVFSFileSpecifier spec(file_id, file_type); - LLVFSFileBlock *block = NULL; + LLVFSFileBlock *block = nullptr; fileblock_map::iterator it = mFileBlocks.find(spec); if (it != mFileBlocks.end()) { @@ -788,7 +788,7 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type if (block && block->mLength > 0) { - block->mAccessTime = (U32)time(NULL); + block->mAccessTime = (U32)time(nullptr); if (max_size == block->mLength) { @@ -925,7 +925,7 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type // Must call useFreeSpace before sync(), as sync() // unlocks data structures. useFreeSpace(free_block, max_size); - block->mAccessTime = (U32)time(NULL); + block->mAccessTime = (U32)time(nullptr); sync(block); } @@ -997,7 +997,7 @@ void LLVFS::renameFile(const LLUUID &file_id, const LLAssetType::EType file_type src_block->mFileID = new_id; src_block->mFileType = new_type; - src_block->mAccessTime = (U32)time(NULL); + src_block->mAccessTime = (U32)time(nullptr); mFileBlocks.erase(old_spec); mFileBlocks.insert(fileblock_map::value_type(new_spec, src_block)); @@ -1084,7 +1084,7 @@ S32 LLVFS::getData(const LLUUID &file_id, const LLAssetType::EType file_type, U8 { LLVFSFileBlock *block = (*it).second; - block->mAccessTime = (U32)time(NULL); + block->mAccessTime = (U32)time(nullptr); if (location > block->mSize) { @@ -1140,7 +1140,7 @@ S32 LLVFS::storeData(const LLUUID &file_id, const LLAssetType::EType file_type, } llassert(location >= 0); - block->mAccessTime = (U32)time(NULL); + block->mAccessTime = (U32)time(nullptr); if (block->mLength == BLOCK_LENGTH_INVALID) { @@ -1214,7 +1214,7 @@ void LLVFS::incLock(const LLUUID &file_id, const LLAssetType::EType file_type, E { // Create a dummy block which isn't saved block = new LLVFSFileBlock(file_id, file_type, 0, BLOCK_LENGTH_INVALID); - block->mAccessTime = (U32)time(NULL); + block->mAccessTime = (U32)time(nullptr); mFileBlocks.insert(fileblock_map::value_type(spec, block)); } @@ -1323,7 +1323,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block) blocks_location_map_t::iterator next_free_it = mFreeBlocksByLocation.lower_bound(block->mLocation); // We can merge with previous if it ends at our requested location. - LLVFSBlock* prev_block = NULL; + LLVFSBlock* prev_block = nullptr; bool merge_prev = false; if (next_free_it != mFreeBlocksByLocation.begin()) { @@ -1334,7 +1334,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block) } // We can merge with next if our block ends at the next block's location. - LLVFSBlock* next_block = NULL; + LLVFSBlock* next_block = nullptr; bool merge_next = false; if (next_free_it != mFreeBlocksByLocation.end()) { @@ -1352,9 +1352,9 @@ void LLVFS::addFreeBlock(LLVFSBlock *block) prev_block->mLength += block->mLength + next_block->mLength; mFreeBlocksByLength.insert(blocks_length_map_t::value_type(prev_block->mLength, prev_block)); delete block; - block = NULL; + block = nullptr; delete next_block; - next_block = NULL; + next_block = nullptr; } else if (merge_prev) { @@ -1365,7 +1365,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block) prev_block->mLength += block->mLength; mFreeBlocksByLength.insert(blocks_length_map_t::value_type(prev_block->mLength, prev_block)); // multimap insert delete block; - block = NULL; + block = nullptr; } else if (merge_next) { @@ -1379,7 +1379,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block) mFreeBlocksByLocation.insert(blocks_location_map_t::value_type(next_block->mLocation, next_block)); // multimap insert mFreeBlocksByLength.insert(blocks_length_map_t::value_type(next_block->mLength, next_block)); // multimap insert delete block; - block = NULL; + block = nullptr; } else { @@ -1540,7 +1540,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune) LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL; } - LLVFSBlock *block = NULL; + LLVFSBlock *block = nullptr; BOOL have_lru_list = FALSE; typedef std::set<LLVFSFileBlock*, LLVFSFileBlock_less> lru_set; @@ -1596,7 +1596,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune) LL_INFOS() << "LRU: Removing " << file_block->mFileID << ":" << file_block->mFileType << LL_ENDL; lru_list.erase(it); removeFileBlock(file_block); - file_block = NULL; + file_block = nullptr; continue; } @@ -1621,7 +1621,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune) cleaned_up += file_block->mLength; lru_list.erase(it++); removeFileBlock(file_block); - file_block = NULL; + file_block = nullptr; } //mergeFreeBlocks(); } @@ -1720,7 +1720,7 @@ void LLVFS::audit() size_t buf_offset = 0; std::map<LLVFSFileSpecifier, LLVFSFileBlock*> found_files; - U32 cur_time = (U32)time(NULL); + U32 cur_time = (U32)time(nullptr); std::vector<LLVFSFileBlock*> audit_blocks; while (!vfs_corrupt && buf_offset < index_size) @@ -1751,9 +1751,9 @@ void LLVFS::audit() LLVFSFileBlock* dupe = it->second; // try to keep data from being lost unlockAndClose(mIndexFP); - mIndexFP = NULL; + mIndexFP = nullptr; unlockAndClose(mDataFP); - mDataFP = NULL; + mDataFP = nullptr; LL_WARNS() << "VFS: Original block index " << block->mIndexLocation << " location " << block->mLocation << " length " << block->mLength diff --git a/indra/llvfs/llvfs.h b/indra/llvfs/llvfs.h index dca5ff4ad5f9a3ac88ca32c9006ed573ae328ed4..a5963d46513be79666fb44b4cf4012b775d508f6 100644 --- a/indra/llvfs/llvfs.h +++ b/indra/llvfs/llvfs.h @@ -145,7 +145,7 @@ protected: // Can initiate LRU-based file removal to make space. // The immune file block will not be removed. - LLVFSBlock *findFreeBlock(S32 size, LLVFSFileBlock *immune = NULL); + LLVFSBlock *findFreeBlock(S32 size, LLVFSFileBlock *immune = nullptr); // lock/unlock data mutex (mDataMutex) void lockData() { mDataMutex->lock(); } diff --git a/indra/llvfs/llvfsthread.cpp b/indra/llvfs/llvfsthread.cpp index db449b7bcba7bde2d890106164ae2312aa719645..f458bb3cb2f82590801fda0f3a9d3d3810938ac8 100644 --- a/indra/llvfs/llvfsthread.cpp +++ b/indra/llvfs/llvfsthread.cpp @@ -34,7 +34,7 @@ /*static*/ std::string LLVFSThread::sDataPath = ""; -/*static*/ LLVFSThread* LLVFSThread::sLocal = NULL; +/*static*/ LLVFSThread* LLVFSThread::sLocal = nullptr; //============================================================================ // Run on MAIN thread @@ -61,7 +61,7 @@ void LLVFSThread::cleanupClass() sLocal->update(0); } delete sLocal; - sLocal = 0; + sLocal = nullptr; } //---------------------------------------------------------------------------- diff --git a/indra/llvfs/llvfsthread.h b/indra/llvfs/llvfsthread.h index 0d3642c9993d1c1ded600beae7b503d67d296446..0fb1c44971ee6cd11667e0c1b5ca830e4ef48688 100644 --- a/indra/llvfs/llvfsthread.h +++ b/indra/llvfs/llvfsthread.h @@ -80,9 +80,9 @@ public: return tstring; } - /*virtual*/ bool processRequest(); - /*virtual*/ void finishRequest(bool completed); - /*virtual*/ void deleteRequest(); + /*virtual*/ bool processRequest() override; + /*virtual*/ void finishRequest(bool completed) override; + /*virtual*/ void deleteRequest() override; private: operation_t mOperation; diff --git a/indra/llwindow/lldragdropwin32.cpp b/indra/llwindow/lldragdropwin32.cpp index adbe6771fc40d37b3fcc8b33c96ff1211f6e3fcf..5bec6c838c5931a5b8b4a55e468f1b1fecff9c06 100644 --- a/indra/llwindow/lldragdropwin32.cpp +++ b/indra/llwindow/lldragdropwin32.cpp @@ -57,14 +57,14 @@ class LLDragDropWin32Target: //////////////////////////////////////////////////////////////////////////////// // - ULONG __stdcall AddRef( void ) + ULONG __stdcall AddRef( void ) override { return InterlockedIncrement( &mRefCount ); }; //////////////////////////////////////////////////////////////////////////////// // - ULONG __stdcall Release( void ) + ULONG __stdcall Release( void ) override { LONG count = InterlockedDecrement( &mRefCount ); @@ -81,7 +81,7 @@ class LLDragDropWin32Target: //////////////////////////////////////////////////////////////////////////////// // - HRESULT __stdcall QueryInterface( REFIID iid, void** ppvObject ) + HRESULT __stdcall QueryInterface( REFIID iid, void** ppvObject ) override { if ( iid == IID_IUnknown || iid == IID_IDropTarget ) { @@ -91,16 +91,16 @@ class LLDragDropWin32Target: } else { - *ppvObject = 0; + *ppvObject = nullptr; return E_NOINTERFACE; }; }; //////////////////////////////////////////////////////////////////////////////// // - HRESULT __stdcall DragEnter( IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect ) + HRESULT __stdcall DragEnter( IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect ) override { - FORMATETC fmtetc = { CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; + FORMATETC fmtetc = { CF_TEXT, nullptr, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; // support CF_TEXT using a HGLOBAL? if ( S_OK == pDataObject->QueryGetData( &fmtetc ) ) @@ -116,7 +116,7 @@ class LLDragDropWin32Target: mDropUrl = std::string( (char*)data ); // XXX MAJOR MAJOR HACK! LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr(mAppWindowHandle, GWLP_USERDATA); // <alchemy/> - if (NULL != window_imp) + if (nullptr != window_imp) { LLCoordGL gl_coord( 0, 0 ); @@ -165,13 +165,13 @@ class LLDragDropWin32Target: //////////////////////////////////////////////////////////////////////////////// // - HRESULT __stdcall DragOver( DWORD grfKeyState, POINTL pt, DWORD* pdwEffect ) + HRESULT __stdcall DragOver( DWORD grfKeyState, POINTL pt, DWORD* pdwEffect ) override { if ( mAllowDrop ) { // XXX MAJOR MAJOR HACK! LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr(mAppWindowHandle, GWLP_USERDATA); // <alchemy/> - if (NULL != window_imp) + if (nullptr != window_imp) { LLCoordGL gl_coord( 0, 0 ); @@ -214,11 +214,11 @@ class LLDragDropWin32Target: //////////////////////////////////////////////////////////////////////////////// // - HRESULT __stdcall DragLeave( void ) + HRESULT __stdcall DragLeave( void ) override { // XXX MAJOR MAJOR HACK! LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr(mAppWindowHandle, GWLP_USERDATA); // <alchemy/> - if (NULL != window_imp) + if (nullptr != window_imp) { LLCoordGL gl_coord( 0, 0 ); MASK mask = gKeyboard->currentMask(TRUE); @@ -229,13 +229,13 @@ class LLDragDropWin32Target: //////////////////////////////////////////////////////////////////////////////// // - HRESULT __stdcall Drop( IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect ) + HRESULT __stdcall Drop( IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect ) override { if ( mAllowDrop ) { // window impl stored in Window data (neat!) LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( mAppWindowHandle, GWLP_USERDATA ); // <alchemy/> - if ( NULL != window_imp ) + if (nullptr != window_imp ) { POINT pt_client; pt_client.x = pt.x; @@ -297,8 +297,8 @@ class LLDragDropWin32Target: //////////////////////////////////////////////////////////////////////////////// // LLDragDropWin32::LLDragDropWin32() : - mDropTarget( NULL ), - mDropWindowHandle( NULL ) + mDropTarget(nullptr ), + mDropWindowHandle(nullptr ) { } @@ -313,7 +313,7 @@ LLDragDropWin32::~LLDragDropWin32() // bool LLDragDropWin32::init( HWND hWnd ) { - if ( NOERROR != OleInitialize( NULL ) ) + if ( NOERROR != OleInitialize(nullptr ) ) return false; try diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp index 3f56b10b1e307368e59e4b8ca8ee74097b552f37..327e86bb9deece7aedba5d0ef0f80facd362869d 100644 --- a/indra/llwindow/lldxhardware.cpp +++ b/indra/llwindow/lldxhardware.cpp @@ -48,7 +48,7 @@ #include "llstl.h" #include "lltimer.h" -void (*gWriteDebug)(const char* msg) = NULL; +void (*gWriteDebug)(const char* msg) = nullptr; LLDXHardware gDXHardware; //----------------------------------------------------------------------------- @@ -72,7 +72,7 @@ HRESULT GetVideoMemoryViaWMI( WCHAR* strInputDeviceID, DWORD* pdwAdapterRam ) BSTR pNamespace = nullptr; *pdwAdapterRam = 0; - hrCoInitialize = CoInitialize( 0 ); + hrCoInitialize = CoInitialize( nullptr ); hr = CoCreateInstance( CLSID_WbemLocator, nullptr, @@ -88,12 +88,12 @@ HRESULT GetVideoMemoryViaWMI( WCHAR* strInputDeviceID, DWORD* pdwAdapterRam ) // Using the locator, connect to WMI in the given namespace. pNamespace = SysAllocString( L"\\\\.\\root\\cimv2" ); - hr = pIWbemLocator->ConnectServer( pNamespace, nullptr, nullptr, 0L, + hr = pIWbemLocator->ConnectServer( pNamespace, nullptr, nullptr, nullptr, 0L, nullptr, nullptr, &pIWbemServices ); #ifdef PRINTF_DEBUGGING if( FAILED( hr ) ) wprintf( L"WMI: pIWbemLocator->ConnectServer failed: 0x%0.8x\n", hr ); #endif - if( SUCCEEDED( hr ) && pIWbemServices != 0 ) + if( SUCCEEDED( hr ) && pIWbemServices != nullptr ) { HINSTANCE hinstOle32 = LoadLibraryW( L"ole32.dll" ); if( hinstOle32 ) @@ -101,7 +101,7 @@ HRESULT GetVideoMemoryViaWMI( WCHAR* strInputDeviceID, DWORD* pdwAdapterRam ) PfnCoSetProxyBlanket pfnCoSetProxyBlanket = nullptr; pfnCoSetProxyBlanket = ( PfnCoSetProxyBlanket )GetProcAddress( hinstOle32, "CoSetProxyBlanket" ); - if( pfnCoSetProxyBlanket != 0 ) + if( pfnCoSetProxyBlanket != nullptr ) { // Switch security level to IMPERSONATE. pfnCoSetProxyBlanket( pIWbemServices, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, nullptr, @@ -124,7 +124,7 @@ HRESULT GetVideoMemoryViaWMI( WCHAR* strInputDeviceID, DWORD* pdwAdapterRam ) if( SUCCEEDED( hr ) && pEnumVideoControllers ) { - IWbemClassObject* pVideoControllers[10] = {0}; + IWbemClassObject* pVideoControllers[10] = {nullptr}; DWORD uReturned = 0; BSTR pPropName = nullptr; @@ -156,7 +156,7 @@ HRESULT GetVideoMemoryViaWMI( WCHAR* strInputDeviceID, DWORD* pdwAdapterRam ) #endif if( SUCCEEDED( hr ) ) { - if( wcsstr( var.bstrVal, strInputDeviceID ) != 0 ) + if( wcsstr( var.bstrVal, strInputDeviceID ) != nullptr ) bFound = true; } VariantClear( &var ); @@ -377,13 +377,13 @@ LLDXDriverFile *LLDXDevice::findDriver(const std::string &driver) } } - return NULL; + return nullptr; } LLDXHardware::LLDXHardware() { mVRAM = 0; - gWriteDebug = NULL; + gWriteDebug = nullptr; } void LLDXHardware::cleanup() @@ -449,7 +449,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) BOOL ok = FALSE; HRESULT hr; - hr = CoInitialize(NULL); + hr = CoInitialize(nullptr); if (FAILED(hr)) { LL_WARNS() << "COM initialization failure!" << LL_ENDL; @@ -457,18 +457,18 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) return ok; } - IDxDiagProvider *dx_diag_providerp = NULL; - IDxDiagContainer *dx_diag_rootp = NULL; - IDxDiagContainer *devices_containerp = NULL; + IDxDiagProvider *dx_diag_providerp = nullptr; + IDxDiagContainer *dx_diag_rootp = nullptr; + IDxDiagContainer *devices_containerp = nullptr; // IDxDiagContainer *system_device_containerp= NULL; - IDxDiagContainer *device_containerp = NULL; + IDxDiagContainer *device_containerp = nullptr; //IDxDiagContainer *file_containerp = NULL; - IDxDiagContainer *driver_containerp = NULL; + IDxDiagContainer *driver_containerp = nullptr; // CoCreate a IDxDiagProvider* LL_DEBUGS("AppInit") << "CoCreateInstance IID_IDxDiagProvider" << LL_ENDL; hr = CoCreateInstance(CLSID_DxDiagProvider, - NULL, + nullptr, CLSCTX_INPROC_SERVER, IID_IDxDiagProvider, (LPVOID*) &dx_diag_providerp); @@ -491,7 +491,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) dx_diag_init_params.dwSize = sizeof(DXDIAG_INIT_PARAMS); dx_diag_init_params.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION; dx_diag_init_params.bAllowWHQLChecks = TRUE; - dx_diag_init_params.pReserved = NULL; + dx_diag_init_params.pReserved = nullptr; LL_DEBUGS("AppInit") << "dx_diag_providerp->Initialize" << LL_ENDL; hr = dx_diag_providerp->Initialize(&dx_diag_init_params); @@ -713,7 +713,7 @@ LLSD LLDXHardware::getDisplayInfo() LLTimer hw_timer; HRESULT hr; LLSD ret; - hr = CoInitialize(NULL); + hr = CoInitialize(nullptr); if (FAILED(hr)) { LL_WARNS() << "COM initialization failure!" << LL_ENDL; @@ -721,17 +721,17 @@ LLSD LLDXHardware::getDisplayInfo() return ret; } - IDxDiagProvider *dx_diag_providerp = NULL; - IDxDiagContainer *dx_diag_rootp = NULL; - IDxDiagContainer *devices_containerp = NULL; - IDxDiagContainer *device_containerp = NULL; - IDxDiagContainer *file_containerp = NULL; - IDxDiagContainer *driver_containerp = NULL; + IDxDiagProvider *dx_diag_providerp = nullptr; + IDxDiagContainer *dx_diag_rootp = nullptr; + IDxDiagContainer *devices_containerp = nullptr; + IDxDiagContainer *device_containerp = nullptr; + IDxDiagContainer *file_containerp = nullptr; + IDxDiagContainer *driver_containerp = nullptr; // CoCreate a IDxDiagProvider* LL_INFOS() << "CoCreateInstance IID_IDxDiagProvider" << LL_ENDL; hr = CoCreateInstance(CLSID_DxDiagProvider, - NULL, + nullptr, CLSCTX_INPROC_SERVER, IID_IDxDiagProvider, reinterpret_cast<void**>(&dx_diag_providerp)); @@ -754,7 +754,7 @@ LLSD LLDXHardware::getDisplayInfo() dx_diag_init_params.dwSize = sizeof(DXDIAG_INIT_PARAMS); dx_diag_init_params.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION; dx_diag_init_params.bAllowWHQLChecks = FALSE; - dx_diag_init_params.pReserved = NULL; + dx_diag_init_params.pReserved = nullptr; LL_INFOS() << "dx_diag_providerp->Initialize" << LL_ENDL; hr = dx_diag_providerp->Initialize(&dx_diag_init_params); @@ -814,8 +814,8 @@ LLSD LLDXHardware::getDisplayInfo() // get the value DWORD dwType = REG_SZ; DWORD dwSize = sizeof(WCHAR) * RV_SIZE; - if(ERROR_SUCCESS == RegQueryValueEx(hKey, TEXT("ReleaseVersion"), - NULL, &dwType, (LPBYTE)release_version, &dwSize)) + if(ERROR_SUCCESS == RegQueryValueEx(hKey, TEXT("ReleaseVersion"), + nullptr, &dwType, (LPBYTE)release_version, &dwSize)) { // print the value // windows doesn't guarantee to be null terminated diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp index 593136fe311d8d0aeca7acd86a9ebe614b7b5b17..e4217efc77dddb726e3d000bcc75696c0afbb269 100644 --- a/indra/llwindow/llkeyboard.cpp +++ b/indra/llwindow/llkeyboard.cpp @@ -36,19 +36,19 @@ // Globals // -LLKeyboard *gKeyboard = NULL; +LLKeyboard *gKeyboard = nullptr; //static std::map<KEY,std::string> LLKeyboard::sKeysToNames; std::map<std::string,KEY> LLKeyboard::sNamesToKeys; -LLKeyStringTranslatorFunc* LLKeyboard::mStringTranslator = NULL; // Used for l10n + PC/Mac/Linux accelerator labeling +LLKeyStringTranslatorFunc* LLKeyboard::mStringTranslator = nullptr; // Used for l10n + PC/Mac/Linux accelerator labeling // // Class Implementation // -LLKeyboard::LLKeyboard() : mCallbacks(NULL) +LLKeyboard::LLKeyboard() : mCallbacks(nullptr) { S32 i; @@ -338,7 +338,7 @@ std::string LLKeyboard::stringFromKey(KEY key) } LLKeyStringTranslatorFunc *trans = gKeyboard->mStringTranslator; - if (trans != NULL) + if (trans != nullptr) { res = trans(res.c_str()); } @@ -360,7 +360,7 @@ std::string LLKeyboard::stringFromAccelerator( MASK accel_mask, KEY key ) LLKeyStringTranslatorFunc *trans = gKeyboard->mStringTranslator; - if( trans == NULL ) + if( trans == nullptr ) { LL_ERRS() << "No mKeyStringTranslator" << LL_ENDL; return res; diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp index 5bdf4b14fdc4e99de87e4e9755c71a3540af3068..90858ee68beb9079c8ab199cb69dd6b690d92746 100644 --- a/indra/llwindow/llkeyboardwin32.cpp +++ b/indra/llwindow/llkeyboardwin32.cpp @@ -249,7 +249,7 @@ void LLKeyboardWin32::scanKeyboard() { S32 key; MSG msg; - BOOL pending_key_events = PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE | PM_NOYIELD); + BOOL pending_key_events = PeekMessage(&msg, nullptr, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE | PM_NOYIELD); for (key = 0; key < KEY_COUNT; key++) { // On Windows, verify key down state. JC diff --git a/indra/llwindow/llkeyboardwin32.h b/indra/llwindow/llkeyboardwin32.h index 7683ce132d448ae4d135363718fe64605376545e..8914ff0120ef077d7cf417bd02285935cec5a95b 100644 --- a/indra/llwindow/llkeyboardwin32.h +++ b/indra/llwindow/llkeyboardwin32.h @@ -39,11 +39,11 @@ public: LLKeyboardWin32(); /*virtual*/ ~LLKeyboardWin32() {}; - /*virtual*/ BOOL handleKeyUp(const U32 key, MASK mask); - /*virtual*/ BOOL handleKeyDown(const U32 key, MASK mask); - /*virtual*/ void resetMaskKeys(); - /*virtual*/ MASK currentMask(BOOL for_mouse_event); - /*virtual*/ void scanKeyboard(); + /*virtual*/ BOOL handleKeyUp(const U32 key, MASK mask) override; + /*virtual*/ BOOL handleKeyDown(const U32 key, MASK mask) override; + /*virtual*/ void resetMaskKeys() override; + /*virtual*/ MASK currentMask(BOOL for_mouse_event) override; + /*virtual*/ void scanKeyboard() override; BOOL translateExtendedKey(const U32 os_key, const MASK mask, KEY *translated_key); U32 inverseTranslateExtendedKey(const KEY translated_key); diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 433398a24df3cedb21debb263f831f904df9d5b1..345162394bbeefc60ee0c0f41d066a2752e3e4a2 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -89,7 +89,7 @@ public: BOOL setSize(LLCoordScreen size); BOOL setSize(LLCoordWindow size); virtual void setMinSize(U32 min_width, U32 min_height, bool enforce_immediately = true); - virtual BOOL switchContext(U32 window_mode, const LLCoordScreen &size, U32 vsync_setting, const LLCoordScreen * const posp = NULL) = 0; + virtual BOOL switchContext(U32 window_mode, const LLCoordScreen &size, U32 vsync_setting, const LLCoordScreen * const posp = nullptr) = 0; virtual BOOL setCursorPosition(LLCoordWindow position) = 0; virtual BOOL getCursorPosition(LLCoordWindow *position) = 0; virtual void showCursor() = 0; diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index 18bfc0168bea30e4ca6d4dfd626ba2f4bd23a41b..617d22f064db1b0dd0f4ebb4af0d3d0f0da208a7 100644 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -32,66 +32,66 @@ class LLWindowHeadless : public LLWindow { public: - /*virtual*/ void show() {}; - /*virtual*/ void hide() {}; - /*virtual*/ void close() {}; - /*virtual*/ BOOL getVisible() {return FALSE;}; - /*virtual*/ BOOL getMinimized() {return FALSE;}; - /*virtual*/ BOOL getMaximized() {return FALSE;}; - /*virtual*/ BOOL maximize() {return FALSE;}; - /*virtual*/ void minimize() {}; - /*virtual*/ void restore() {}; + /*virtual*/ void show() override {}; + /*virtual*/ void hide() override {}; + /*virtual*/ void close() override {}; + /*virtual*/ BOOL getVisible() override {return FALSE;}; + /*virtual*/ BOOL getMinimized() override {return FALSE;}; + /*virtual*/ BOOL getMaximized() override {return FALSE;}; + /*virtual*/ BOOL maximize() override {return FALSE;}; + /*virtual*/ void minimize() override {}; + /*virtual*/ void restore() override {}; /*virtual*/ BOOL getFullscreen() {return FALSE;}; - /*virtual*/ BOOL getPosition(LLCoordScreen *position) {return FALSE;}; - /*virtual*/ BOOL getSize(LLCoordScreen *size) {return FALSE;}; - /*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;}; - /*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;}; - /*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;}; - /*virtual*/ BOOL setSizeImpl(LLCoordWindow size) {return FALSE;}; - /*virtual*/ BOOL switchContext(U32 windows_mode, const LLCoordScreen &size, U32 vsync_setting, const LLCoordScreen * const posp = NULL) { return FALSE; }; - /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;}; - /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;}; - /*virtual*/ void showCursor() {}; - /*virtual*/ void hideCursor() {}; - /*virtual*/ void showCursorFromMouseMove() {}; - /*virtual*/ void hideCursorUntilMouseMove() {}; - /*virtual*/ BOOL isCursorHidden() {return FALSE;}; - /*virtual*/ void updateCursor() {}; + /*virtual*/ BOOL getPosition(LLCoordScreen *position) override {return FALSE;}; + /*virtual*/ BOOL getSize(LLCoordScreen *size) override {return FALSE;}; + /*virtual*/ BOOL getSize(LLCoordWindow *size) override {return FALSE;}; + /*virtual*/ BOOL setPosition(LLCoordScreen position) override {return FALSE;}; + /*virtual*/ BOOL setSizeImpl(LLCoordScreen size) override {return FALSE;}; + /*virtual*/ BOOL setSizeImpl(LLCoordWindow size) override {return FALSE;}; + /*virtual*/ BOOL switchContext(U32 windows_mode, const LLCoordScreen &size, U32 vsync_setting, const LLCoordScreen * const posp = nullptr) override { return FALSE; }; + /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) override {return FALSE;}; + /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) override {return FALSE;}; + /*virtual*/ void showCursor() override {}; + /*virtual*/ void hideCursor() override {}; + /*virtual*/ void showCursorFromMouseMove() override {}; + /*virtual*/ void hideCursorUntilMouseMove() override {}; + /*virtual*/ BOOL isCursorHidden() override {return FALSE;}; + /*virtual*/ void updateCursor() override {}; //virtual ECursorType getCursor() { return mCurrentCursor; }; - /*virtual*/ void captureMouse() {}; - /*virtual*/ void releaseMouse() {}; - /*virtual*/ void setMouseClipping( BOOL b ) {}; - /*virtual*/ BOOL isClipboardTextAvailable() {return FALSE; }; - /*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst) {return FALSE; }; - /*virtual*/ void setWindowTitle(const std::string& title) {} - /*virtual*/ BOOL copyTextToClipboard(const LLWString &src) {return FALSE; }; - /*virtual*/ void flashIcon(F32 seconds) {}; - /*virtual*/ F32 getGamma() {return 1.0f; }; - /*virtual*/ BOOL setGamma(const F32 gamma) {return FALSE; }; // Set the gamma - /*virtual*/ void setFSAASamples(const U32 fsaa_samples) { } - /*virtual*/ U32 getFSAASamples() { return 0; } - /*virtual*/ BOOL restoreGamma() {return FALSE; }; // Restore original gamma table (before updating gamma) + /*virtual*/ void captureMouse() override {}; + /*virtual*/ void releaseMouse() override {}; + /*virtual*/ void setMouseClipping( BOOL b ) override {}; + /*virtual*/ BOOL isClipboardTextAvailable() override {return FALSE; }; + /*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst) override {return FALSE; }; + /*virtual*/ void setWindowTitle(const std::string& title) override {} + /*virtual*/ BOOL copyTextToClipboard(const LLWString &src) override {return FALSE; }; + /*virtual*/ void flashIcon(F32 seconds) override {}; + /*virtual*/ F32 getGamma() override {return 1.0f; }; + /*virtual*/ BOOL setGamma(const F32 gamma) override {return FALSE; }; // Set the gamma + /*virtual*/ void setFSAASamples(const U32 fsaa_samples) override { } + /*virtual*/ U32 getFSAASamples() override { return 0; } + /*virtual*/ BOOL restoreGamma() override {return FALSE; }; // Restore original gamma table (before updating gamma) //virtual ESwapMethod getSwapMethod() { return mSwapMethod; } - /*virtual*/ void gatherInput() {}; - /*virtual*/ void delayInputProcessing() {}; - /*virtual*/ void swapBuffers(); + /*virtual*/ void gatherInput() override {}; + /*virtual*/ void delayInputProcessing() override {}; + /*virtual*/ void swapBuffers() override; // handy coordinate space conversion routines - /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; }; - /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; }; - /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to) { return FALSE; }; - /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordWindow *to) { return FALSE; }; - /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordGL *to) { return FALSE; }; - /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordScreen *to) { return FALSE; }; + /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) override { return FALSE; }; + /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) override { return FALSE; }; + /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to) override { return FALSE; }; + /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordWindow *to) override { return FALSE; }; + /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordGL *to) override { return FALSE; }; + /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordScreen *to) override { return FALSE; }; - /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) { return NULL; }; - /*virtual*/ F32 getNativeAspectRatio() { return 1.0f; }; - /*virtual*/ F32 getPixelAspectRatio() { return 1.0f; }; - /*virtual*/ void setNativeAspectRatio(F32 ratio) {} + /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) override { return nullptr; }; + /*virtual*/ F32 getNativeAspectRatio() override { return 1.0f; }; + /*virtual*/ F32 getPixelAspectRatio() override { return 1.0f; }; + /*virtual*/ void setNativeAspectRatio(F32 ratio) override {} - /*virtual*/ void *getPlatformWindow() { return 0; }; - /*virtual*/ void bringToFront() {}; + /*virtual*/ void *getPlatformWindow() override { return nullptr; }; + /*virtual*/ void bringToFront() override {}; LLWindowHeadless(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, @@ -110,9 +110,9 @@ public: LLSplashScreenHeadless() {}; virtual ~LLSplashScreenHeadless() {}; - /*virtual*/ void showImpl() {}; - /*virtual*/ void updateImpl(const std::string& mesg) {}; - /*virtual*/ void hideImpl() {}; + /*virtual*/ void showImpl() override {}; + /*virtual*/ void updateImpl(const std::string& mesg) override {}; + /*virtual*/ void hideImpl() override {}; }; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 668a9fcab2db4621197a820158ec9b414a3b87b1..52afd80ccf464cbb974d1b55a4e3a3aea7461448 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -118,7 +118,7 @@ HGLRC SafeCreateContext(HDC hdc) } __except(EXCEPTION_EXECUTE_HANDLER) { - return NULL; + return nullptr; } } @@ -127,7 +127,7 @@ BOOL LLWindowWin32::sIsClassRegistered = FALSE; BOOL LLWindowWin32::sLanguageTextInputAllowed = TRUE; BOOL LLWindowWin32::sWinIMEOpened = FALSE; -HKL LLWindowWin32::sWinInputLocale = 0; +HKL LLWindowWin32::sWinInputLocale = nullptr; DWORD LLWindowWin32::sWinIMEConversionMode = IME_CMODE_NATIVE; DWORD LLWindowWin32::sWinIMESentenceMode = IME_SMODE_AUTOMATIC; LLCoordWindow LLWindowWin32::sWinIMEWindowPosition(-1,-1); @@ -144,7 +144,7 @@ LLCoordWindow LLWindowWin32::sWinIMEWindowPosition(-1,-1); class LLWinImm { public: - static bool isAvailable() { return sTheInstance.mHImmDll != NULL; } + static bool isAvailable() { return sTheInstance.mHImmDll != nullptr; } public: // Wrappers for IMM API. @@ -193,14 +193,14 @@ private: LLWinImm LLWinImm::sTheInstance; -LLWinImm::LLWinImm() : mHImmDll(NULL) +LLWinImm::LLWinImm() : mHImmDll(nullptr) { // Check system metrics if ( !GetSystemMetrics( SM_IMMENABLED ) ) return; mHImmDll = LoadLibraryW(TEXT("Imm32")); - if (mHImmDll != NULL) + if (mHImmDll != nullptr) { mImmIsIME = (BOOL (WINAPI *)(HKL)) GetProcAddress(mHImmDll, "ImmIsIME"); mImmGetDefaultIMEWnd = (HWND (WINAPI *)(HWND)) GetProcAddress(mHImmDll, "ImmGetDefaultIMEWnd"); @@ -218,21 +218,21 @@ LLWinImm::LLWinImm() : mHImmDll(NULL) mImmSetCandidateWindow = (BOOL (WINAPI *)(HIMC, LPCANDIDATEFORM)) GetProcAddress(mHImmDll, "ImmSetCandidateWindow"); mImmNotifyIME = (BOOL (WINAPI *)(HIMC, DWORD, DWORD, DWORD)) GetProcAddress(mHImmDll, "ImmNotifyIME"); - if (mImmIsIME == NULL || - mImmGetDefaultIMEWnd == NULL || - mImmGetContext == NULL || - mImmReleaseContext == NULL || - mImmGetOpenStatus == NULL || - mImmSetOpenStatus == NULL || - mImmGetConversionStatus == NULL || - mImmSetConversionStatus == NULL || - mImmGetCompostitionWindow == NULL || - mImmSetCompostitionWindow == NULL || - mImmGetCompositionString == NULL || - mImmSetCompositionString == NULL || - mImmSetCompositionFont == NULL || - mImmSetCandidateWindow == NULL || - mImmNotifyIME == NULL) + if (mImmIsIME == nullptr || + mImmGetDefaultIMEWnd == nullptr || + mImmGetContext == nullptr || + mImmReleaseContext == nullptr || + mImmGetOpenStatus == nullptr || + mImmSetOpenStatus == nullptr || + mImmGetConversionStatus == nullptr || + mImmSetConversionStatus == nullptr || + mImmGetCompostitionWindow == nullptr || + mImmSetCompostitionWindow == nullptr || + mImmGetCompositionString == nullptr || + mImmSetCompositionString == nullptr || + mImmSetCompositionFont == nullptr || + mImmSetCandidateWindow == nullptr || + mImmNotifyIME == nullptr) { // If any of the above API entires are not found, we can't use IMM API. // So, turn off the IMM support. We should log some warning message in @@ -242,24 +242,24 @@ LLWinImm::LLWinImm() : mHImmDll(NULL) // the logging channel (LL_WARNS()), and we can't do it here... Yes, this // is one of disadvantages to use static constraction to DLL loading. FreeLibrary(mHImmDll); - mHImmDll = NULL; + mHImmDll = nullptr; // If we unload the library, make sure all the function pointers are cleared - mImmIsIME = NULL; - mImmGetDefaultIMEWnd = NULL; - mImmGetContext = NULL; - mImmReleaseContext = NULL; - mImmGetOpenStatus = NULL; - mImmSetOpenStatus = NULL; - mImmGetConversionStatus = NULL; - mImmSetConversionStatus = NULL; - mImmGetCompostitionWindow = NULL; - mImmSetCompostitionWindow = NULL; - mImmGetCompositionString = NULL; - mImmSetCompositionString = NULL; - mImmSetCompositionFont = NULL; - mImmSetCandidateWindow = NULL; - mImmNotifyIME = NULL; + mImmIsIME = nullptr; + mImmGetDefaultIMEWnd = nullptr; + mImmGetContext = nullptr; + mImmReleaseContext = nullptr; + mImmGetOpenStatus = nullptr; + mImmSetOpenStatus = nullptr; + mImmGetConversionStatus = nullptr; + mImmSetConversionStatus = nullptr; + mImmGetCompostitionWindow = nullptr; + mImmSetCompostitionWindow = nullptr; + mImmGetCompositionString = nullptr; + mImmSetCompositionString = nullptr; + mImmSetCompositionFont = nullptr; + mImmSetCandidateWindow = nullptr; + mImmNotifyIME = nullptr; } } } @@ -278,7 +278,7 @@ HIMC LLWinImm::getContext(HWND hwnd) { if ( sTheInstance.mImmGetContext ) return sTheInstance.mImmGetContext(hwnd); - return 0; + return nullptr; } //static @@ -385,10 +385,10 @@ BOOL LLWinImm::notifyIME(HIMC himc, DWORD action, DWORD index, DWORD value) // ---------------------------------------------------------------------------------------- LLWinImm::~LLWinImm() { - if (mHImmDll != NULL) + if (mHImmDll != nullptr) { FreeLibrary(mHImmDll); - mHImmDll = NULL; + mHImmDll = nullptr; } } @@ -412,12 +412,12 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, mNativeAspectRatio = 0.f; mMousePositionModified = FALSE; mInputProcessingPaused = FALSE; - mPreeditor = NULL; + mPreeditor = nullptr; mKeyCharCode = 0; mKeyScanCode = 0; mKeyVirtualKey = 0; - mhDC = NULL; - mhRC = NULL; + mhDC = nullptr; + mhRC = nullptr; // Initialize the keyboard gKeyboard = new LLKeyboardWin32(); @@ -464,8 +464,8 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, SetRect( &mOldMouseClip, 0, 0, 0, 0 ); // Make an instance of our window then define the window class - mhInstance = GetModuleHandle(NULL); - mWndProc = NULL; + mhInstance = GetModuleHandle(nullptr); + mWndProc = nullptr; mSwapMethod = SWAP_METHOD_UNDEFINED; @@ -509,7 +509,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, wc.hIcon = LoadIcon(mhInstance, mIconResource); // We will set the cursor ourselves - wc.hCursor = NULL; + wc.hCursor = nullptr; // background color is not used if (clearBg) @@ -518,11 +518,11 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, } else { - wc.hbrBackground = (HBRUSH) NULL; + wc.hbrBackground = (HBRUSH)nullptr; } // we don't use windows menus - wc.lpszMenuName = NULL; + wc.lpszMenuName = nullptr; wc.lpszClassName = mWindowClassName; @@ -543,7 +543,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, ::ZeroMemory(&dev_mode, sizeof(DEVMODE)); dev_mode.dmSize = sizeof(DEVMODE); DWORD current_refresh; - if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode)) + if (EnumDisplaySettings(nullptr, ENUM_CURRENT_SETTINGS, &dev_mode)) { current_refresh = dev_mode.dmDisplayFrequency; mNativeAspectRatio = ((F32)dev_mode.dmPelsWidth) / ((F32)dev_mode.dmPelsHeight); @@ -565,7 +565,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, for (S32 mode_num = 0;; mode_num++) { - if (!EnumDisplaySettings(NULL, mode_num, &dev_mode)) + if (!EnumDisplaySettings(nullptr, mode_num, &dev_mode)) { break; } @@ -588,7 +588,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, LL_WARNS("Window") << "Couldn't find display mode " << width << " by " << height << " at " << BITS_PER_PIXEL << " bits per pixel" << LL_ENDL; //success = FALSE; - if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode)) + if (!EnumDisplaySettings(nullptr, ENUM_CURRENT_SETTINGS, &dev_mode)) { success = FALSE; } @@ -617,7 +617,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, // Keep a copy of the actual current device mode in case we minimize // and change the screen resolution. JC - EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode); + EnumDisplaySettings(nullptr, ENUM_CURRENT_SETTINGS, &dev_mode); // If it failed, we don't want to run fullscreen if (success) @@ -679,7 +679,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, // Initialize (boot strap) the Language text input management, // based on the system's (or user's) default settings. - allowLanguageTextInput(NULL, FALSE); + allowLanguageTextInput(nullptr, FALSE); } @@ -688,13 +688,13 @@ LLWindowWin32::~LLWindowWin32() delete mDragDrop; delete [] mWindowTitle; - mWindowTitle = NULL; + mWindowTitle = nullptr; delete [] mSupportedResolutions; - mSupportedResolutions = NULL; + mSupportedResolutions = nullptr; delete [] mWindowClassName; - mWindowClassName = NULL; + mWindowClassName = nullptr; } void LLWindowWin32::show() @@ -757,7 +757,7 @@ void LLWindowWin32::close() LL_DEBUGS("Window") << "Releasing Context" << LL_ENDL; if (mhRC) { - if (!wglMakeCurrent(NULL, NULL)) + if (!wglMakeCurrent(nullptr, nullptr)) { LL_WARNS("Window") << "Release of DC and RC failed" << LL_ENDL; } @@ -767,7 +767,7 @@ void LLWindowWin32::close() LL_WARNS("Window") << "Release of rendering context failed" << LL_ENDL; } - mhRC = NULL; + mhRC = nullptr; } // Restore gamma to the system values. @@ -776,7 +776,7 @@ void LLWindowWin32::close() if (mhDC && !ReleaseDC(mWindowHandle, mhDC)) { LL_WARNS("Window") << "Release of ghDC failed" << LL_ENDL; - mhDC = NULL; + mhDC = nullptr; } LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL; @@ -795,12 +795,12 @@ void LLWindowWin32::close() OSMB_OK); } - mWindowHandle = NULL; + mWindowHandle = nullptr; } BOOL LLWindowWin32::isValid() { - return (mWindowHandle != NULL); + return (mWindowHandle != nullptr); } BOOL LLWindowWin32::getVisible() @@ -846,7 +846,7 @@ BOOL LLWindowWin32::getPosition(LLCoordScreen *position) if (!mWindowHandle || !GetWindowRect(mWindowHandle, &window_rect) || - NULL == position) + nullptr == position) { return FALSE; } @@ -862,7 +862,7 @@ BOOL LLWindowWin32::getSize(LLCoordScreen *size) if (!mWindowHandle || !GetWindowRect(mWindowHandle, &window_rect) || - NULL == size) + nullptr == size) { return FALSE; } @@ -878,7 +878,7 @@ BOOL LLWindowWin32::getSize(LLCoordWindow *size) if (!mWindowHandle || !GetClientRect(mWindowHandle, &client_rect) || - NULL == size) + nullptr == size) { return FALSE; } @@ -956,7 +956,7 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 resetDisplayResolution(); } - if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode)) + if (EnumDisplaySettings(nullptr, ENUM_CURRENT_SETTINGS, &dev_mode)) { current_refresh = dev_mode.dmDisplayFrequency; } @@ -969,7 +969,7 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 //destroy gl context if (mhRC) { - if (!wglMakeCurrent(NULL, NULL)) + if (!wglMakeCurrent(nullptr, nullptr)) { LL_WARNS("Window") << "Release of DC and RC failed" << LL_ENDL; } @@ -979,7 +979,7 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 LL_WARNS("Window") << "Release of rendering context failed" << LL_ENDL; } - mhRC = NULL; + mhRC = nullptr; } if (window_mode == E_WINDOW_FULLSCREEN_EXCLUSIVE) @@ -990,7 +990,7 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 for (S32 mode_num = 0;; mode_num++) { - if (!EnumDisplaySettings(NULL, mode_num, &dev_mode)) + if (!EnumDisplaySettings(nullptr, mode_num, &dev_mode)) { break; } @@ -1022,7 +1022,7 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 // Keep a copy of the actual current device mode in case we minimize // and change the screen resolution. JC - EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode); + EnumDisplaySettings(nullptr, ENUM_CURRENT_SETTINGS, &dev_mode); if (success) { @@ -1088,10 +1088,10 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 window_rect.top, // y pos window_rect.right - window_rect.left, // width window_rect.bottom - window_rect.top, // height - NULL, - NULL, + nullptr, + nullptr, mhInstance, - NULL); + nullptr); LL_INFOS("Window") << "window is created." << LL_ENDL ; @@ -1273,7 +1273,7 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 U32 num_formats = 0; // First we try and get a 32 bit depth pixel format - BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); + BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, nullptr, 256, pixel_formats, &num_formats); while(!result && mFSAASamples > 0) { @@ -1295,7 +1295,7 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 end_attrib = 0 ; attrib_list[cur_attrib++] = 0 ; //end } - result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); + result = wglChoosePixelFormatARB(mhDC, attrib_list, nullptr, 256, pixel_formats, &num_formats); if(result) { @@ -1319,7 +1319,7 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 LL_INFOS("Window") << "No valid pixel format for " << mFSAASamples << "x anti-aliasing." << LL_ENDL; attrib_list[end_attrib] = 0; - BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); + BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, nullptr, 256, pixel_formats, &num_formats); if (!result) { close(); @@ -1333,7 +1333,7 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 LL_INFOS("Window") << "No 32 bit z-buffer, trying 24 bits instead" << LL_ENDL; // Try 24-bit format attrib_list[1] = 24; - BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); + BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, nullptr, 256, pixel_formats, &num_formats); if (!result) { close(); @@ -1345,7 +1345,7 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 { LL_WARNS("Window") << "Couldn't get 24 bit z-buffer,trying 16 bits instead!" << LL_ENDL; attrib_list[1] = 16; - BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); + BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, nullptr, 256, pixel_formats, &num_formats); if (!result || !num_formats) { close(); @@ -1380,17 +1380,17 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 pixel_format = pixel_formats[cur_format]; - if (mhDC != 0) // Does The Window Have A Device Context? + if (mhDC != nullptr) // Does The Window Have A Device Context? { - wglMakeCurrent(mhDC, 0); // Set The Current Active Rendering Context To Zero - if (mhRC != 0) // Does The Window Have A Rendering Context? + wglMakeCurrent(mhDC, nullptr); // Set The Current Active Rendering Context To Zero + if (mhRC != nullptr) // Does The Window Have A Rendering Context? { wglDeleteContext (mhRC); // Release The Rendering Context - mhRC = 0; // Zero The Rendering Context + mhRC = nullptr; // Zero The Rendering Context } ReleaseDC (mWindowHandle, mhDC); // Release The Device Context - mhDC = 0; // Zero The Device Context + mhDC = nullptr; // Zero The Device Context } DestroyWindow (mWindowHandle); // Destroy The Window @@ -1403,10 +1403,10 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 window_rect.top, // y pos window_rect.right - window_rect.left, // width window_rect.bottom - window_rect.top, // height - NULL, - NULL, + nullptr, + nullptr, mhInstance, - NULL); + nullptr); LL_INFOS("Window") << "recreate window done." << LL_ENDL ; @@ -1482,7 +1482,7 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 return FALSE; } - mhRC = 0; + mhRC = nullptr; if (WGLEW_ARB_create_context) { //attempt to create a specific versioned context S32 attribs[] = @@ -1594,7 +1594,7 @@ BOOL LLWindowWin32::switchContext(U32 window_mode, const LLCoordScreen &size, U3 mDragDrop->init( mWindowHandle ); //register joystick timer callback - SetTimer( mWindowHandle, 0, 1000 / 30, NULL ); // 30 fps timer + SetTimer( mWindowHandle, 0, 1000 / 30, nullptr ); // 30 fps timer // ok to post quit messages now mPostQuit = TRUE; @@ -1649,7 +1649,7 @@ BOOL LLWindowWin32::setCursorPosition(LLCoordWindow position) // mouse position via handleMouseMove() above, we need to clear out // any stale mouse move events. RN/JC MSG msg; - while (PeekMessage(&msg, NULL, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE)) + while (PeekMessage(&msg, nullptr, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE)) { } LLCoordScreen screen_pos(position.convert()); @@ -1728,19 +1728,19 @@ HCURSOR LLWindowWin32::loadColorCursor(LPCTSTR name) void LLWindowWin32::initCursors() { - mCursor[ UI_CURSOR_ARROW ] = LoadCursor(NULL, IDC_ARROW); - mCursor[ UI_CURSOR_WAIT ] = LoadCursor(NULL, IDC_WAIT); - mCursor[ UI_CURSOR_HAND ] = LoadCursor(NULL, IDC_HAND); - mCursor[ UI_CURSOR_IBEAM ] = LoadCursor(NULL, IDC_IBEAM); - mCursor[ UI_CURSOR_CROSS ] = LoadCursor(NULL, IDC_CROSS); - mCursor[ UI_CURSOR_SIZENWSE ] = LoadCursor(NULL, IDC_SIZENWSE); - mCursor[ UI_CURSOR_SIZENESW ] = LoadCursor(NULL, IDC_SIZENESW); - mCursor[ UI_CURSOR_SIZEWE ] = LoadCursor(NULL, IDC_SIZEWE); - mCursor[ UI_CURSOR_SIZENS ] = LoadCursor(NULL, IDC_SIZENS); - mCursor[ UI_CURSOR_NO ] = LoadCursor(NULL, IDC_NO); - mCursor[ UI_CURSOR_WORKING ] = LoadCursor(NULL, IDC_APPSTARTING); - - HMODULE module = GetModuleHandle(NULL); + mCursor[ UI_CURSOR_ARROW ] = LoadCursor(nullptr, IDC_ARROW); + mCursor[ UI_CURSOR_WAIT ] = LoadCursor(nullptr, IDC_WAIT); + mCursor[ UI_CURSOR_HAND ] = LoadCursor(nullptr, IDC_HAND); + mCursor[ UI_CURSOR_IBEAM ] = LoadCursor(nullptr, IDC_IBEAM); + mCursor[ UI_CURSOR_CROSS ] = LoadCursor(nullptr, IDC_CROSS); + mCursor[ UI_CURSOR_SIZENWSE ] = LoadCursor(nullptr, IDC_SIZENWSE); + mCursor[ UI_CURSOR_SIZENESW ] = LoadCursor(nullptr, IDC_SIZENESW); + mCursor[ UI_CURSOR_SIZEWE ] = LoadCursor(nullptr, IDC_SIZEWE); + mCursor[ UI_CURSOR_SIZENS ] = LoadCursor(nullptr, IDC_SIZENS); + mCursor[ UI_CURSOR_NO ] = LoadCursor(nullptr, IDC_NO); + mCursor[ UI_CURSOR_WORKING ] = LoadCursor(nullptr, IDC_APPSTARTING); + + HMODULE module = GetModuleHandle(nullptr); mCursor[ UI_CURSOR_TOOLGRAB ] = LoadCursor(module, TEXT("TOOLGRAB")); mCursor[ UI_CURSOR_TOOLLAND ] = LoadCursor(module, TEXT("TOOLLAND")); mCursor[ UI_CURSOR_TOOLFOCUS ] = LoadCursor(module, TEXT("TOOLFOCUS")); @@ -1780,7 +1780,7 @@ void LLWindowWin32::initCursors() { if( !mCursor[i] ) { - mCursor[i] = LoadCursor(NULL, IDC_ARROW); + mCursor[i] = LoadCursor(nullptr, IDC_ARROW); } } } @@ -1834,7 +1834,7 @@ void LLWindowWin32::gatherInput() MSG msg; int msg_count = 0; - while ((msg_count < MAX_MESSAGE_PER_UPDATE) && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while ((msg_count < MAX_MESSAGE_PER_UPDATE) && PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) { mCallbacks->handlePingWatchdog(this, "Main:TranslateGatherInput"); TranslateMessage(&msg); @@ -1896,12 +1896,12 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr(h_wnd, GWLP_USERDATA); // <alchemy/> - if (NULL != window_imp) + if (nullptr != window_imp) { window_imp->mCallbacks->handleResumeWatchdog(window_imp); window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:StartWndProc"); // Has user provided their own window callback? - if (NULL != window_imp->mWndProc) + if (nullptr != window_imp->mWndProc) { if (!window_imp->mWndProc(h_wnd, u_msg, w_param, l_param)) { @@ -2703,7 +2703,7 @@ BOOL LLWindowWin32::convertCoords(LLCoordGL from, LLCoordWindow *to) if (!mWindowHandle || !GetClientRect(mWindowHandle, &client_rect) || - NULL == to) + nullptr == to) { return FALSE; } @@ -2722,7 +2722,7 @@ BOOL LLWindowWin32::convertCoords(LLCoordWindow from, LLCoordGL* to) if (!mWindowHandle || !GetClientRect(mWindowHandle, &client_rect) || - NULL == to) + nullptr == to) { return FALSE; } @@ -2772,7 +2772,7 @@ BOOL LLWindowWin32::convertCoords(LLCoordScreen from, LLCoordGL *to) { LLCoordWindow window_coord; - if (!mWindowHandle || (NULL == to)) + if (!mWindowHandle || (nullptr == to)) { return FALSE; } @@ -2786,7 +2786,7 @@ BOOL LLWindowWin32::convertCoords(LLCoordGL from, LLCoordScreen *to) { LLCoordWindow window_coord; - if (!mWindowHandle || (NULL == to)) + if (!mWindowHandle || (nullptr == to)) { return FALSE; } @@ -2999,7 +2999,7 @@ LLWindow::LLWindowResolution* LLWindowWin32::getSupportedResolutions(S32 &num_re mNumSupportedResolutions = 0; for (S32 mode_num = 0; mNumSupportedResolutions < MAX_NUM_RESOLUTIONS; mode_num++) { - if (!EnumDisplaySettings(NULL, mode_num, &dev_mode)) + if (!EnumDisplaySettings(nullptr, mode_num, &dev_mode)) { break; } @@ -3075,7 +3075,7 @@ BOOL LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 bits, S32 re BOOL success = FALSE; // Don't change anything if we don't have to - if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode)) + if (EnumDisplaySettings(nullptr, ENUM_CURRENT_SETTINGS, &dev_mode)) { if (dev_mode.dmPelsWidth == width && dev_mode.dmPelsHeight == height && @@ -3127,7 +3127,7 @@ BOOL LLWindowWin32::resetDisplayResolution() { LL_DEBUGS("Window") << "resetDisplayResolution START" << LL_ENDL; - LONG cds_result = ChangeDisplaySettings(NULL, 0); + LONG cds_result = ChangeDisplaySettings(nullptr, 0); BOOL success = (DISP_CHANGE_SUCCESSFUL == cds_result); @@ -3151,7 +3151,7 @@ void LLWindowWin32::swapBuffers() // LLSplashScreenImp // LLSplashScreenWin32::LLSplashScreenWin32() -: mWindow(NULL) +: mWindow(nullptr) { } @@ -3162,7 +3162,7 @@ LLSplashScreenWin32::~LLSplashScreenWin32() void LLSplashScreenWin32::showImpl() { // This appears to work. ??? - HINSTANCE hinst = GetModuleHandle(NULL); + HINSTANCE hinst = GetModuleHandle(nullptr); mWindow = CreateDialog(hinst, TEXT("SPLASHSCREEN"), @@ -3176,7 +3176,7 @@ void LLSplashScreenWin32::updateImpl(const std::string& mesg) { if (!mWindow) return; - int output_str_len = MultiByteToWideChar(CP_UTF8, 0, mesg.c_str(), mesg.length(), NULL, 0); + int output_str_len = MultiByteToWideChar(CP_UTF8, 0, mesg.c_str(), mesg.length(), nullptr, 0); if( output_str_len>1024 ) return; @@ -3200,7 +3200,7 @@ void LLSplashScreenWin32::hideImpl() if (mWindow) { DestroyWindow(mWindow); - mWindow = NULL; + mWindow = nullptr; } } @@ -3238,7 +3238,7 @@ S32 OSMessageBoxWin32(const std::string& text, const std::string& caption, U32 t } // HACK! Doesn't properly handle wide strings! - int retval_win = MessageBoxW(NULL, utf8str_to_utf16str(text).c_str(), utf8str_to_utf16str(caption).c_str(), uType); + int retval_win = MessageBoxW(nullptr, utf8str_to_utf16str(text).c_str(), utf8str_to_utf16str(caption).c_str(), uType); S32 retval; switch(retval_win) @@ -3331,14 +3331,14 @@ BOOL LLWindowWin32::dialogColorPicker( F32 *r, F32 *g, F32 *b ) static COLORREF crCustColors[16]; cc.lStructSize = sizeof(CHOOSECOLOR); cc.hwndOwner = mWindowHandle; - cc.hInstance = NULL; + cc.hInstance = nullptr; cc.rgbResult = RGB ((*r * 255.f),(*g *255.f),(*b * 255.f)); //cc.rgbResult = RGB (0x80,0x80,0x80); cc.lpCustColors = crCustColors; cc.Flags = CC_RGBINIT | CC_FULLOPEN; cc.lCustData = 0; - cc.lpfnHook = NULL; - cc.lpTemplateName = NULL; + cc.lpfnHook = nullptr; + cc.lpTemplateName = nullptr; // This call is modal, so pause agent //send_agent_pause(); // this is in newview and we don't want to set up a dependency @@ -3588,7 +3588,7 @@ void LLWindowWin32::updateLanguageTextInputArea() LLCoordGL caret_coord; LLRect preedit_bounds; - if (mPreeditor->getPreeditLocation(-1, &caret_coord, &preedit_bounds, NULL)) + if (mPreeditor->getPreeditLocation(-1, &caret_coord, &preedit_bounds, nullptr)) { mLanguageTextInputPointGL = caret_coord; mLanguageTextInputAreaGL = preedit_bounds; @@ -3646,7 +3646,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes) if (indexes & GCS_RESULTSTR) { - LONG size = LLWinImm::getCompositionString(himc, GCS_RESULTSTR, NULL, 0); + LONG size = LLWinImm::getCompositionString(himc, GCS_RESULTSTR, nullptr, 0); if (size >= 0) { const LPWSTR data = new WCHAR[size / sizeof(WCHAR) + 1]; @@ -3662,7 +3662,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes) if (indexes & GCS_COMPSTR) { - LONG size = LLWinImm::getCompositionString(himc, GCS_COMPSTR, NULL, 0); + LONG size = LLWinImm::getCompositionString(himc, GCS_COMPSTR, nullptr, 0); if (size >= 0) { const LPWSTR data = new WCHAR[size / sizeof(WCHAR) + 1]; @@ -3679,7 +3679,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes) if ((indexes & GCS_COMPCLAUSE) && preedit_string.length() > 0) { - LONG size = LLWinImm::getCompositionString(himc, GCS_COMPCLAUSE, NULL, 0); + LONG size = LLWinImm::getCompositionString(himc, GCS_COMPCLAUSE, nullptr, 0); if (size > 0) { const LPDWORD data = new DWORD[size / sizeof(DWORD)]; @@ -3702,7 +3702,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes) if ((indexes & GCS_COMPATTR) && preedit_segment_lengths.size() > 1) { - LONG size = LLWinImm::getCompositionString(himc, GCS_COMPATTR, NULL, 0); + LONG size = LLWinImm::getCompositionString(himc, GCS_COMPATTR, nullptr, 0); if (size > 0) { const LPBYTE data = new BYTE[size / sizeof(BYTE)]; @@ -3727,7 +3727,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes) S32 caret_position = preedit_string.length(); if (indexes & GCS_CURSORPOS) { - const S32 caret_position_utf16 = LLWinImm::getCompositionString(himc, GCS_CURSORPOS, NULL, 0); + const S32 caret_position_utf16 = LLWinImm::getCompositionString(himc, GCS_CURSORPOS, nullptr, 0); if (caret_position_utf16 >= 0 && caret_position <= preedit_string_utf16_length) { caret_position = wstring_wstring_length_from_utf16_length(preedit_string, 0, caret_position_utf16); @@ -3831,7 +3831,7 @@ BOOL LLWindowWin32::handleImeRequests(WPARAM w_param, LPARAM l_param, LRESULT *r { LLCoordGL caret_coord; LLRect preedit_bounds; - mPreeditor->getPreeditLocation(-1, &caret_coord, &preedit_bounds, NULL); + mPreeditor->getPreeditLocation(-1, &caret_coord, &preedit_bounds, nullptr); CANDIDATEFORM *const form = (CANDIDATEFORM *)l_param; DWORD const dwIndex = form->dwIndex; @@ -3893,7 +3893,7 @@ BOOL LLWindowWin32::handleImeRequests(WPARAM w_param, LPARAM l_param, LRESULT *r // adjust the reconvert_string structure accordingly. HIMC himc = LLWinImm::getContext(mWindowHandle); const BOOL adjusted = LLWinImm::setCompositionString(himc, - SCS_QUERYRECONVERTSTRING, reconvert_string, size, NULL, 0); + SCS_QUERYRECONVERTSTRING, reconvert_string, size, nullptr, 0); LLWinImm::releaseContext(mWindowHandle, himc); if (adjusted) { @@ -3949,7 +3949,7 @@ BOOL LLWindowWin32::handleImeRequests(WPARAM w_param, LPARAM l_param, LRESULT *r void LLWindowWin32::setDPIAwareness() { HMODULE hShcore = LoadLibrary(L"shcore.dll"); - if (hShcore != NULL) + if (hShcore != nullptr) { SetProcessDpiAwarenessType pSPDA; pSPDA = (SetProcessDpiAwarenessType)GetProcAddress(hShcore, "SetProcessDpiAwareness"); @@ -3981,13 +3981,13 @@ F32 LLWindowWin32::getSystemUISize() HMODULE hShcore = LoadLibrary(L"shcore.dll"); - if (hShcore != NULL) + if (hShcore != nullptr) { GetProcessDpiAwarenessType pGPDA; pGPDA = (GetProcessDpiAwarenessType)GetProcAddress(hShcore, "GetProcessDpiAwareness"); GetDpiForMonitorType pGDFM; pGDFM = (GetDpiForMonitorType)GetProcAddress(hShcore, "GetDpiForMonitor"); - if (pGPDA != NULL && pGDFM != NULL) + if (pGPDA != nullptr && pGDFM != nullptr) { pGPDA(hProcess, &dpi_awareness); if (dpi_awareness == PROCESS_PER_MONITOR_DPI_AWARE) diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 8bf236a975b4d032bce31fa1c5d484a811b9c8fb..0780e0ba189ca7fae50c531a3f08ca9e5de67ad8 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -37,77 +37,77 @@ class LLWindowWin32 : public LLWindow { public: - /*virtual*/ void show(); - /*virtual*/ void hide(); - /*virtual*/ void close(); - /*virtual*/ BOOL getVisible(); - /*virtual*/ BOOL getMinimized(); - /*virtual*/ BOOL getMaximized(); - /*virtual*/ BOOL maximize(); - /*virtual*/ void minimize(); - /*virtual*/ void restore(); + /*virtual*/ void show() override; + /*virtual*/ void hide() override; + /*virtual*/ void close() override; + /*virtual*/ BOOL getVisible() override; + /*virtual*/ BOOL getMinimized() override; + /*virtual*/ BOOL getMaximized() override; + /*virtual*/ BOOL maximize() override; + /*virtual*/ void minimize() override; + /*virtual*/ void restore() override; /*virtual*/ BOOL getFullscreen(); - /*virtual*/ BOOL getPosition(LLCoordScreen *position); - /*virtual*/ BOOL getSize(LLCoordScreen *size); - /*virtual*/ BOOL getSize(LLCoordWindow *size); - /*virtual*/ BOOL setPosition(LLCoordScreen position); - /*virtual*/ BOOL setSizeImpl(LLCoordScreen size); - /*virtual*/ BOOL setSizeImpl(LLCoordWindow size); - /*virtual*/ BOOL switchContext(U32 window_mode, const LLCoordScreen &size, U32 vsync_setting, const LLCoordScreen * const posp = NULL); - /*virtual*/ BOOL setCursorPosition(LLCoordWindow position); - /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position); - /*virtual*/ void showCursor(); - /*virtual*/ void hideCursor(); - /*virtual*/ void showCursorFromMouseMove(); - /*virtual*/ void hideCursorUntilMouseMove(); - /*virtual*/ BOOL isCursorHidden(); - /*virtual*/ void updateCursor(); - /*virtual*/ ECursorType getCursor() const; - /*virtual*/ void captureMouse(); - /*virtual*/ void releaseMouse(); - /*virtual*/ void setMouseClipping( BOOL b ); - /*virtual*/ BOOL isClipboardTextAvailable(); - /*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst); - /*virtual*/ BOOL copyTextToClipboard(const LLWString &src); - /*virtual*/ void setWindowTitle(const std::string& title); - /*virtual*/ void flashIcon(F32 seconds); - /*virtual*/ F32 getGamma(); - /*virtual*/ BOOL setGamma(const F32 gamma); // Set the gamma - /*virtual*/ void setFSAASamples(const U32 fsaa_samples); - /*virtual*/ U32 getFSAASamples(); - /*virtual*/ BOOL restoreGamma(); // Restore original gamma table (before updating gamma) - /*virtual*/ ESwapMethod getSwapMethod() { return mSwapMethod; } - /*virtual*/ void gatherInput(); - /*virtual*/ void delayInputProcessing(); - /*virtual*/ void swapBuffers(); + /*virtual*/ BOOL getPosition(LLCoordScreen *position) override; + /*virtual*/ BOOL getSize(LLCoordScreen *size) override; + /*virtual*/ BOOL getSize(LLCoordWindow *size) override; + /*virtual*/ BOOL setPosition(LLCoordScreen position) override; + /*virtual*/ BOOL setSizeImpl(LLCoordScreen size) override; + /*virtual*/ BOOL setSizeImpl(LLCoordWindow size) override; + /*virtual*/ BOOL switchContext(U32 window_mode, const LLCoordScreen &size, U32 vsync_setting, const LLCoordScreen * const posp = nullptr) override; + /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) override; + /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) override; + /*virtual*/ void showCursor() override; + /*virtual*/ void hideCursor() override; + /*virtual*/ void showCursorFromMouseMove() override; + /*virtual*/ void hideCursorUntilMouseMove() override; + /*virtual*/ BOOL isCursorHidden() override; + /*virtual*/ void updateCursor() override; + /*virtual*/ ECursorType getCursor() const override; + /*virtual*/ void captureMouse() override; + /*virtual*/ void releaseMouse() override; + /*virtual*/ void setMouseClipping( BOOL b ) override; + /*virtual*/ BOOL isClipboardTextAvailable() override; + /*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst) override; + /*virtual*/ BOOL copyTextToClipboard(const LLWString &src) override; + /*virtual*/ void setWindowTitle(const std::string& title) override; + /*virtual*/ void flashIcon(F32 seconds) override; + /*virtual*/ F32 getGamma() override; + /*virtual*/ BOOL setGamma(const F32 gamma) override; // Set the gamma + /*virtual*/ void setFSAASamples(const U32 fsaa_samples) override; + /*virtual*/ U32 getFSAASamples() override; + /*virtual*/ BOOL restoreGamma() override; // Restore original gamma table (before updating gamma) + /*virtual*/ ESwapMethod getSwapMethod() override { return mSwapMethod; } + /*virtual*/ void gatherInput() override; + /*virtual*/ void delayInputProcessing() override; + /*virtual*/ void swapBuffers() override; /*virtual*/ void restoreGLContext() {}; // handy coordinate space conversion routines - /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to); - /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to); - /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to); - /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordWindow *to); - /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordGL *to); - /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordScreen *to); + /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) override; + /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) override; + /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to) override; + /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordWindow *to) override; + /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordGL *to) override; + /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordScreen *to) override; - /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions); - /*virtual*/ F32 getNativeAspectRatio(); - /*virtual*/ F32 getPixelAspectRatio(); - /*virtual*/ void setNativeAspectRatio(F32 ratio) { mOverrideAspectRatio = ratio; } + /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) override; + /*virtual*/ F32 getNativeAspectRatio() override; + /*virtual*/ F32 getPixelAspectRatio() override; + /*virtual*/ void setNativeAspectRatio(F32 ratio) override { mOverrideAspectRatio = ratio; } - /*virtual*/ BOOL dialogColorPicker(F32 *r, F32 *g, F32 *b ); + /*virtual*/ BOOL dialogColorPicker(F32 *r, F32 *g, F32 *b ) override; - /*virtual*/ void *getPlatformWindow(); - /*virtual*/ void bringToFront(); - /*virtual*/ void focusClient(); + /*virtual*/ void *getPlatformWindow() override; + /*virtual*/ void bringToFront() override; + /*virtual*/ void focusClient() override; - /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b); - /*virtual*/ void setLanguageTextInput( const LLCoordGL & pos ); - /*virtual*/ void updateLanguageTextInputArea(); - /*virtual*/ void interruptLanguageTextInput(); - /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); + /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) override; + /*virtual*/ void setLanguageTextInput( const LLCoordGL & pos ) override; + /*virtual*/ void updateLanguageTextInputArea() override; + /*virtual*/ void interruptLanguageTextInput() override; + /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async) override; - /*virtual*/ F32 getSystemUISize(); + /*virtual*/ F32 getSystemUISize() override; LLWindowCallbacks::DragNDropResult completeDragNDropRequest( const LLCoordGL gl_coord, const MASK mask, LLWindowCallbacks::DragNDropAction action, const std::string url ); @@ -123,9 +123,9 @@ protected: void initCursors(); void initInputDevices(); HCURSOR loadColorCursor(LPCTSTR name); - BOOL isValid(); + BOOL isValid() override; void moveWindow(const LLCoordScreen& position,const LLCoordScreen& size); - virtual LLSD getNativeKeyData(); + LLSD getNativeKeyData() override; // Changes display resolution. Returns true if successful BOOL setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh); @@ -220,9 +220,9 @@ public: LLSplashScreenWin32(); virtual ~LLSplashScreenWin32(); - /*virtual*/ void showImpl(); - /*virtual*/ void updateImpl(const std::string& mesg); - /*virtual*/ void hideImpl(); + /*virtual*/ void showImpl() override; + /*virtual*/ void updateImpl(const std::string& mesg) override; + /*virtual*/ void hideImpl() override; #if LL_WINDOWS static LRESULT CALLBACK windowProc(HWND h_wnd, UINT u_msg, diff --git a/indra/llxml/llxmlnode.h b/indra/llxml/llxmlnode.h index d9d95e53dc59b2f26bb1ca2c8703f3695705d56f..01c9558389f3a921a6f9b1eedd283e0624df4c80 100644 --- a/indra/llxml/llxmlnode.h +++ b/indra/llxml/llxmlnode.h @@ -55,9 +55,9 @@ struct CompareAttributes { bool operator()(const LLStringTableEntry* const lhs, const LLStringTableEntry* const rhs) const { - if (lhs == NULL) + if (lhs == nullptr) return TRUE; - if (rhs == NULL) + if (rhs == nullptr) return FALSE; return strcmp(lhs->mString, rhs->mString) < 0; diff --git a/indra/llxml/llxmlparser.cpp b/indra/llxml/llxmlparser.cpp index e59d76b2c6c9042ff42b72bb8f78335d84682fbf..d66c541bd567088cd5ada14a1f3470538cd0705e 100644 --- a/indra/llxml/llxmlparser.cpp +++ b/indra/llxml/llxmlparser.cpp @@ -39,13 +39,13 @@ LLXmlParser::LLXmlParser() : - mParser( NULL ), + mParser(nullptr ), mDepth( 0 ) { mAuxErrorString = "no error"; // Override the document's declared encoding. - mParser = XML_ParserCreate(NULL); + mParser = XML_ParserCreate(nullptr); XML_SetUserData(mParser, this); XML_SetElementHandler( mParser, startElementHandler, endElementHandler); diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp index 2e2fa285eb56fa169d4ed6a2b6e5fb862ab061ee..56e98364ad3629cefad497ee1b006ad6c8215381 100644 --- a/indra/llxml/llxmltree.cpp +++ b/indra/llxml/llxmltree.cpp @@ -45,7 +45,7 @@ LLStdStringTable LLXmlTree::sAttributeKeys(1024); LLXmlTree::LLXmlTree() - : mRoot( NULL ), + : mRoot(nullptr ), mNodeNames(512) { } @@ -58,7 +58,7 @@ LLXmlTree::~LLXmlTree() void LLXmlTree::cleanup() { delete mRoot; - mRoot = NULL; + mRoot = nullptr; mNodeNames.cleanup(); } @@ -66,7 +66,7 @@ void LLXmlTree::cleanup() BOOL LLXmlTree::parseFile(const std::string &path, BOOL keep_contents) { delete mRoot; - mRoot = NULL; + mRoot = nullptr; LLXmlTreeParser parser(this); BOOL success = parser.parseFile( path, &mRoot, keep_contents ); @@ -157,7 +157,7 @@ LLXmlTreeNode* LLXmlTreeNode::getFirstChild() LLXmlTreeNode* LLXmlTreeNode::getNextChild() { if (mChildListIter == mChildList.end()) - return 0; + return nullptr; else return *mChildListIter++; } @@ -173,7 +173,7 @@ LLXmlTreeNode* LLXmlTreeNode::getChildByName(const std::string& name) LLXmlTreeNode* LLXmlTreeNode::getNextNamedChild() { if (mChildMapIter == mChildMapEndIter) - return NULL; + return nullptr; else return (mChildMapIter++)->second; } @@ -504,8 +504,8 @@ std::string LLXmlTreeNode::getTextContents() LLXmlTreeParser::LLXmlTreeParser(LLXmlTree* tree) : mTree(tree), - mRoot( NULL ), - mCurrent( NULL ), + mRoot(nullptr ), + mCurrent(nullptr ), mDump( FALSE ), mKeepContents(FALSE) { @@ -525,13 +525,13 @@ BOOL LLXmlTreeParser::parseFile(const std::string &path, LLXmlTreeNode** root, B BOOL success = LLXmlParser::parseFile(path); *root = mRoot; - mRoot = NULL; + mRoot = nullptr; if( success ) { llassert( !mCurrent ); } - mCurrent = NULL; + mCurrent = nullptr; return success; } diff --git a/indra/llxml/llxmltree.h b/indra/llxml/llxmltree.h index 9347d645f4abe3a074e7e5a93afbdf794f7a14cd..16989d843490cbcd49c6431b94376ad61d85b9a4 100644 --- a/indra/llxml/llxmltree.h +++ b/indra/llxml/llxmltree.h @@ -203,20 +203,20 @@ protected: const std::string& tabs(); // Overrides from LLXmlParser - virtual void startElement(const char *name, const char **attributes); - virtual void endElement(const char *name); - virtual void characterData(const char *s, int len); - virtual void processingInstruction(const char *target, const char *data); - virtual void comment(const char *data); - virtual void startCdataSection(); - virtual void endCdataSection(); - virtual void defaultData(const char *s, int len); - virtual void unparsedEntityDecl( + void startElement(const char *name, const char **attributes) override; + void endElement(const char *name) override; + void characterData(const char *s, int len) override; + void processingInstruction(const char *target, const char *data) override; + void comment(const char *data) override; + void startCdataSection() override; + void endCdataSection() override; + void defaultData(const char *s, int len) override; + void unparsedEntityDecl( const char* entity_name, const char* base, const char* system_id, const char* public_id, - const char* notation_name); + const char* notation_name) override; //template method pattern virtual LLXmlTreeNode* CreateXmlTreeNode(const std::string& name, LLXmlTreeNode* parent); diff --git a/indra/media_plugins/base/media_plugin_base.cpp b/indra/media_plugins/base/media_plugin_base.cpp index 460ec0f1f83403b14d2ab470b2e08ecc2c02176b..9e33c6d8522a16daf26f4ddd1a0bd9fa5c3395cf 100644 --- a/indra/media_plugins/base/media_plugin_base.cpp +++ b/indra/media_plugins/base/media_plugin_base.cpp @@ -48,7 +48,7 @@ MediaPluginBase::MediaPluginBase( mHostSendFunction = host_send_func; mHostUserData = host_user_data; mDeleteMe = false; - mPixels = 0; + mPixels = nullptr; mWidth = 0; mHeight = 0; mTextureWidth = 0; @@ -110,7 +110,7 @@ void MediaPluginBase::staticReceiveMessage(const char *message_string, void **us { MediaPluginBase *self = (MediaPluginBase*)*user_data; - if(self != NULL) + if(self != nullptr) { self->receiveMessage(message_string); @@ -118,7 +118,7 @@ void MediaPluginBase::staticReceiveMessage(const char *message_string, void **us if(self->mDeleteMe) { delete self; - *user_data = NULL; + *user_data = nullptr; } } } diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 9482fb2b3020d1406f20496f3e8c7a064d396f3a..be8728d9be9ad312581e68ead06d84166aa047c2 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -53,7 +53,7 @@ public: ~MediaPluginCEF(); /*virtual*/ - void receiveMessage(const char* message_string); + void receiveMessage(const char* message_string) override; private: bool init(); @@ -119,7 +119,7 @@ MediaPluginBase(host_send_func, host_user_data) mWidth = 0; mHeight = 0; mDepth = 4; - mPixels = 0; + mPixels = nullptr; mEnableMediaPluginDebugging = false; mHostLanguage = "en"; mCookiesEnabled = true; @@ -138,7 +138,7 @@ MediaPluginBase(host_send_func, host_user_data) mPickedFile = ""; mLLCEFLib = new LLCEFLib(); - mPopupBuffer = NULL; + mPopupBuffer = nullptr; mPopupW = 0; mPopupH = 0; mPopupX = 0; @@ -175,7 +175,7 @@ void MediaPluginCEF::onPageChangedCallback(unsigned char* pixels, int x, int y, if( is_popup ) { delete mPopupBuffer; - mPopupBuffer = NULL; + mPopupBuffer = nullptr; mPopupH = 0; mPopupW = 0; mPopupX = 0; @@ -478,7 +478,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { if (mPixels == iter->second.mAddress) { - mPixels = NULL; + mPixels = nullptr; mTextureSegmentName.clear(); } mSharedSegments.erase(iter); diff --git a/indra/media_plugins/cef/windows_volume_catcher.cpp b/indra/media_plugins/cef/windows_volume_catcher.cpp index 102c041ac18d81f6cbd2ef80e0d7ec024cbd7e57..a1ee5050e678b1fe0d9b03ae77145dff0de1684e 100644 --- a/indra/media_plugins/cef/windows_volume_catcher.cpp +++ b/indra/media_plugins/cef/windows_volume_catcher.cpp @@ -69,7 +69,7 @@ void VolumeCatcherImpl::setVolume(F32 volume) DWORD left_channel = (DWORD)(mVolume * 65535.0f); DWORD right_channel = (DWORD)(mVolume * 65535.0f); DWORD hw_volume = left_channel << 16 | right_channel; - ::waveOutSetVolume(NULL, hw_volume); + ::waveOutSetVolume(nullptr, hw_volume); } void VolumeCatcherImpl::setPan(F32 pan) diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index b7d1e4089501cb0b22b739839151275ff83e4b0d..679a683df6a04d91645c4f8504adc7eb02812ae2 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -48,7 +48,7 @@ public: MediaPluginLibVLC(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data); ~MediaPluginLibVLC(); - /*virtual*/ void receiveMessage(const char* message_string); + /*virtual*/ void receiveMessage(const char* message_string) override; private: bool init(); @@ -63,7 +63,8 @@ private: static void unlock(void* data, void* id, void* const* raw_pixels); static void display(void* data, void* id); - /*virtual*/ void setDirty(int left, int top, int right, int bottom) /* override, but that is not supported in gcc 4.6 */; + /*virtual*/ void setDirty(int left, int top, int right, int bottom) override + /* override, but that is not supported in gcc 4.6 */; static void eventCallbacks(const libvlc_event_t* event, void* ptr); @@ -100,11 +101,11 @@ MediaPluginBase(host_send_func, host_user_data) mWidth = 0; mHeight = 0; mDepth = 4; - mPixels = 0; + mPixels = nullptr; - mLibVLC = 0; - mLibVLCMedia = 0; - mLibVLCMediaPlayer = 0; + mLibVLC = nullptr; + mLibVLCMedia = nullptr; + mLibVLCMediaPlayer = nullptr; mCurVolume = 0.0; @@ -133,7 +134,7 @@ void* MediaPluginLibVLC::lock(void* data, void** p_pixels) *p_pixels = context->texture_pixels; - return NULL; + return nullptr; } ///////////////////////////////////////////////////////////////////////////////// @@ -206,7 +207,7 @@ void MediaPluginLibVLC::setDirty(int left, int top, int right, int bottom) void MediaPluginLibVLC::eventCallbacks(const libvlc_event_t* event, void* ptr) { MediaPluginLibVLC* parent = (MediaPluginLibVLC*)ptr; - if (parent == 0) + if (parent == nullptr) { return; } @@ -276,35 +277,35 @@ void MediaPluginLibVLC::playMedia() libvlc_event_manager_t* em = libvlc_media_player_event_manager(mLibVLCMediaPlayer); if (em) { - libvlc_event_detach(em, libvlc_MediaPlayerOpening, eventCallbacks, NULL); - libvlc_event_detach(em, libvlc_MediaPlayerPlaying, eventCallbacks, NULL); - libvlc_event_detach(em, libvlc_MediaPlayerPaused, eventCallbacks, NULL); - libvlc_event_detach(em, libvlc_MediaPlayerStopped, eventCallbacks, NULL); - libvlc_event_detach(em, libvlc_MediaPlayerEndReached, eventCallbacks, NULL); - libvlc_event_detach(em, libvlc_MediaPlayerEncounteredError, eventCallbacks, NULL); - libvlc_event_detach(em, libvlc_MediaPlayerTimeChanged, eventCallbacks, NULL); - libvlc_event_detach(em, libvlc_MediaPlayerPositionChanged, eventCallbacks, NULL); - libvlc_event_detach(em, libvlc_MediaPlayerLengthChanged, eventCallbacks, NULL); - libvlc_event_detach(em, libvlc_MediaPlayerTitleChanged, eventCallbacks, NULL); + libvlc_event_detach(em, libvlc_MediaPlayerOpening, eventCallbacks, nullptr); + libvlc_event_detach(em, libvlc_MediaPlayerPlaying, eventCallbacks, nullptr); + libvlc_event_detach(em, libvlc_MediaPlayerPaused, eventCallbacks, nullptr); + libvlc_event_detach(em, libvlc_MediaPlayerStopped, eventCallbacks, nullptr); + libvlc_event_detach(em, libvlc_MediaPlayerEndReached, eventCallbacks, nullptr); + libvlc_event_detach(em, libvlc_MediaPlayerEncounteredError, eventCallbacks, nullptr); + libvlc_event_detach(em, libvlc_MediaPlayerTimeChanged, eventCallbacks, nullptr); + libvlc_event_detach(em, libvlc_MediaPlayerPositionChanged, eventCallbacks, nullptr); + libvlc_event_detach(em, libvlc_MediaPlayerLengthChanged, eventCallbacks, nullptr); + libvlc_event_detach(em, libvlc_MediaPlayerTitleChanged, eventCallbacks, nullptr); }; libvlc_media_player_stop(mLibVLCMediaPlayer); libvlc_media_player_release(mLibVLCMediaPlayer); - mLibVLCMediaPlayer = 0; + mLibVLCMediaPlayer = nullptr; } if (mLibVLCMedia) { libvlc_media_release(mLibVLCMedia); - mLibVLCMedia = 0; + mLibVLCMedia = nullptr; } mLibVLCMedia = libvlc_media_new_location(mLibVLC, mURL.c_str()); if (!mLibVLCMedia) { - mLibVLCMediaPlayer = 0; + mLibVLCMediaPlayer = nullptr; setStatus(STATUS_ERROR); return; } @@ -478,9 +479,9 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string) { libvlc_media_player_stop(mLibVLCMediaPlayer); libvlc_media_player_release(mLibVLCMediaPlayer); - mLibVLCMediaPlayer = 0; + mLibVLCMediaPlayer = nullptr; - mPixels = NULL; + mPixels = nullptr; mTextureSegmentName.clear(); } mSharedSegments.erase(iter); diff --git a/indra/newview/alchatcommand.cpp b/indra/newview/alchatcommand.cpp index 477ea717a47151e9fce5bb723cd84f02c9290853..74aaa4b90e89366dea9bbb0cb51533868a21e7cd 100644 --- a/indra/newview/alchatcommand.cpp +++ b/indra/newview/alchatcommand.cpp @@ -216,7 +216,7 @@ bool ALChatCommand::parseCommand(std::string data) params.append(fmodf(static_cast<F32>(pos.mdV[VX]), REGION_WIDTH_METERS)); params.append(fmodf(static_cast<F32>(pos.mdV[VY]), REGION_WIDTH_METERS)); params.append(fmodf(static_cast<F32>(pos.mdV[VZ]), REGION_HEIGHT_METERS)); - LLCommandDispatcher::dispatch("teleport", params, LLSD(), NULL, "clicked", true); + LLCommandDispatcher::dispatch("teleport", params, LLSD(), nullptr, "clicked", true); return true; } } diff --git a/indra/newview/alviewermenu.cpp b/indra/newview/alviewermenu.cpp index 9a81ec36be20af139ce5862df650f95000acf838..e056c5471ffee8e16e44b5d26e18fb78c88fd1b5 100644 --- a/indra/newview/alviewermenu.cpp +++ b/indra/newview/alviewermenu.cpp @@ -121,7 +121,7 @@ void al_handle_object_derender() class LLEnableEditParticleSource : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); for (LLObjectSelection::valid_root_iterator iter = selection->valid_root_begin(); @@ -139,7 +139,7 @@ class LLEnableEditParticleSource : public view_listener_t class LLEditParticleSource : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (objectp) @@ -154,7 +154,7 @@ class LLEditParticleSource : public view_listener_t class LLSpawnDebugSimFeatures : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if (LLViewerRegion* regionp = gAgent.getRegion()) { @@ -172,7 +172,7 @@ class LLSpawnDebugSimFeatures : public view_listener_t class LLSyncAnimations : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { for (S32 i = 0; i < gObjectList.getNumObjects(); ++i) { @@ -197,7 +197,7 @@ class LLSyncAnimations : public view_listener_t class ALMarkViewerEffectsDead : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLHUDObject::markViewerEffectsDead(); return true; @@ -206,7 +206,7 @@ class ALMarkViewerEffectsDead : public view_listener_t class ALToggleLocationBar : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { const U32 val = userdata.asInteger(); gSavedSettings.setU32("NavigationBarStyle", val); @@ -216,7 +216,7 @@ class ALToggleLocationBar : public view_listener_t class ALCheckLocationBar : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return userdata.asInteger() == gSavedSettings.getU32("NavigationBarStyle"); } @@ -233,7 +233,7 @@ void destroy_texture(const LLUUID& id) class LLRefreshTexturesObject : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { for (LLObjectSelection::valid_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_begin(); iter != LLSelectMgr::getInstance()->getSelection()->valid_end(); @@ -288,7 +288,7 @@ class LLRefreshTexturesObject : public view_listener_t class LLRefreshTexturesAvatar : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); if (!avatar) return true; @@ -308,7 +308,7 @@ class LLRefreshTexturesAvatar : public view_listener_t class LLObjectExplode : public view_listener_t { - bool handleEvent(LLSD const& userdata) + bool handleEvent(LLSD const& userdata) override { auto* sel_man = LLSelectMgr::getInstance(); LLViewerObject *objectp = sel_man->getSelection()->getFirstRootObject(); @@ -335,7 +335,7 @@ bool enable_object_explode() class LLUndeformSelf : public view_listener_t { - bool handleEvent(LLSD const& userdata) + bool handleEvent(LLSD const& userdata) override { if (!isAgentAvatarValid()) return true; @@ -358,7 +358,7 @@ class LLUndeformSelf : public view_listener_t msg->addUUIDFast(_PREHASH_AnimID, LLUUID("f05d765d-0e01-5f9a-bfc2-fdc054757e55")); msg->addBOOLFast(_PREHASH_StartAnim, TRUE); msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList); - msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0); + msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0); msg->sendReliable(gAgent.getRegion()->getHost()); return true; } @@ -366,7 +366,7 @@ class LLUndeformSelf : public view_listener_t class LLEnableGrid : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { const std::string& grid_type = userdata.asString(); if (grid_type == "secondlife") @@ -392,7 +392,7 @@ class LLEnableGrid : public view_listener_t bool enable_estate_management(const LLSD& avatar_id) { // Use avatar_id if available, otherwise default to right-click avatar - LLVOAvatar* avatar = NULL; + LLVOAvatar* avatar = nullptr; if (avatar_id.asUUID().notNull()) { avatar = find_avatar_from_object(avatar_id.asUUID()); @@ -420,7 +420,7 @@ bool enable_estate_management(const LLSD& avatar_id) class LLAvatarCopyData : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatarp = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); if (avatarp) @@ -448,7 +448,7 @@ class LLAvatarCopyData : public view_listener_t class ALAvatarColorize : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatarp = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); if (avatarp) diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp index b837f77f73328f3281eead497775d2b1232bec63..a47142f78747cbe6749b250aecb8dcc00d44fcd9 100644 --- a/indra/newview/llaccountingcostmanager.cpp +++ b/indra/newview/llaccountingcostmanager.cpp @@ -100,7 +100,7 @@ void LLAccountingCostManager::accountingCostCoro(std::string url, LLAccountingCostObserver* observer = observerHandle.get(); LLUUID transactionId = observer->getTransactionID(); - observer = NULL; + observer = nullptr; diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 19c1c0218af90e7133da79aa425fe3cf2e8d8b44..9a10283da9700d3b0f2295c0cb3cf58ba5fb7a2e 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -166,10 +166,10 @@ public: LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId); virtual ~LLTeleportRequestViaLandmark(); - virtual bool canRestartTeleport(); + bool canRestartTeleport() override; - virtual void startTeleport(); - virtual void restartTeleport(); + void startTeleport() override; + void restartTeleport() override; protected: inline const LLUUID &getLandmarkId() const {return mLandmarkId;}; @@ -184,9 +184,9 @@ public: LLTeleportRequestViaLure(const LLUUID &pLureId, BOOL pIsLureGodLike); virtual ~LLTeleportRequestViaLure(); - virtual bool canRestartTeleport(); + bool canRestartTeleport() override; - virtual void startTeleport(); + void startTeleport() override; protected: inline BOOL isLureGodLike() const {return mIsLureGodLike;}; @@ -201,10 +201,10 @@ public: LLTeleportRequestViaLocation(const LLVector3d &pPosGlobal); virtual ~LLTeleportRequestViaLocation(); - virtual bool canRestartTeleport(); + bool canRestartTeleport() override; - virtual void startTeleport(); - virtual void restartTeleport(); + void startTeleport() override; + void restartTeleport() override; protected: inline const LLVector3d &getPosGlobal() const {return mPosGlobal;}; @@ -220,10 +220,10 @@ public: LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal); virtual ~LLTeleportRequestViaLocationLookAt(); - virtual bool canRestartTeleport(); + bool canRestartTeleport() override; - virtual void startTeleport(); - virtual void restartTeleport(); + void startTeleport() override; + void restartTeleport() override; protected: @@ -248,7 +248,7 @@ class LLAgentFriendObserver : public LLFriendObserver public: LLAgentFriendObserver() {} virtual ~LLAgentFriendObserver() {} - virtual void changed(U32 mask); + void changed(U32 mask) override; }; void LLAgentFriendObserver::changed(U32 mask) @@ -290,7 +290,7 @@ bool LLAgent::isActionAllowed(const LLSD& sdname) { bool allow_agent_voice = false; LLVoiceChannel* channel = LLVoiceChannel::getCurrentVoiceChannel(); - if (channel != NULL) + if (channel != nullptr) { if (channel->getSessionName().empty() && channel->getSessionID().isNull()) { @@ -360,93 +360,93 @@ bool LLAgent::isMicrophoneOn(const LLSD& sdname) // LLAgent() //----------------------------------------------------------------------------- LLAgent::LLAgent() : - mGroupPowers(0), - mHideGroupTitle(FALSE), - mGroupID(), - mInitialized(FALSE), + mFirstLogin(FALSE), mListener(), - mDoubleTapRunTimer(), - mDoubleTapRunMode(DOUBLETAP_NONE), - - mbAlwaysRun(false), - mbRunning(false), - mbTeleportKeepsLookAt(false), - - mAgentAccess(new LLAgentAccess(gSavedSettings)), - mGodLevelChangeSignal(), - mCanEditParcel(false), - mTeleportSourceSLURL(new LLSLURL), - mTeleportRequest(), - mTeleportFinishedSlot(), - mTeleportFailedSlot(), - mIsMaturityRatingChangingDuringTeleport(false), - mMaturityRatingChange(0U), - mIsDoSendMaturityPreferenceToServer(false), - mMaturityPreferenceRequestId(0U), - mMaturityPreferenceResponseId(0U), - mMaturityPreferenceNumRetries(0U), - mLastKnownRequestMaturity(SIM_ACCESS_MIN), - mLastKnownResponseMaturity(SIM_ACCESS_MIN), - mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), - mTeleportState(TELEPORT_NONE), - mRegionp(NULL), + mOutfitChosen(FALSE), + mPositionGlobal(), mAgentOriginGlobal(), - mPositionGlobal(), + mFrameAgent(), + + mHaveHomePosition(FALSE), + mHomeRegionHandle( 0 ), + mRegionp(nullptr), mDistanceTraveled(0.F), mLastPositionGlobal(LLVector3d::zero), - - mRenderState(0), + mNextFidgetTime(0.f), + mCurrentFidget(0), + mCrouch(false), + mVoiceConnected(false), + mNearChatRadius(CHAT_NORMAL_RADIUS / 2.f), mTypingTimer(), - - mViewsPushed(FALSE), - - mCustomAnim(FALSE), - mShowAvatar(TRUE), - mFrameAgent(), - + mDoubleTapRunTimer(), + mDoubleTapRunMode(DOUBLETAP_NONE), + mbAlwaysRun(false), + mbRunning(false), + mbTeleportKeepsLookAt(false), mIsAwaySitting(false), mIsDoNotDisturb(false), - mControlFlags(0x00000000), mbFlagsDirty(FALSE), mbFlagsNeedReset(FALSE), + mMouselookModeInSignal(nullptr), + mMouselookModeOutSignal(nullptr), + + mCustomAnim(FALSE), + mViewsPushed(FALSE), + mAutoPilot(FALSE), mAutoPilotFlyOnStop(FALSE), + mAutoPilotAllowFlying(TRUE), + mAutoPilotTargetGlobal(), mAutoPilotStopDistance(1.f), mAutoPilotUseRotation(FALSE), + mAutoPilotTargetFacing(LLVector3::zero), mAutoPilotTargetDist(0.f), + mAutoPilotNoProgressFrameCount(0), mAutoPilotRotationThreshold(0.f), - mAutoPilotFinishedCallback(NULL), - mAutoPilotCallbackData(NULL), - + mAutoPilotFinishedCallback(nullptr), + + mAutoPilotCallbackData(nullptr), mMovementKeysLocked(FALSE), + mTeleportSourceSLURL(new LLSLURL), + mTeleportRequest(), + mTeleportFinishedSlot(), + mTeleportFailedSlot(), + mIsMaturityRatingChangingDuringTeleport(false), + mMaturityRatingChange(0U), + mTeleportState(TELEPORT_NONE), + mCanEditParcel(false), + mAgentAccess(new LLAgentAccess(gSavedSettings)), + mGodLevelChangeSignal(), + + mIsDoSendMaturityPreferenceToServer(false), - mEffectColor(new LLUIColor(LLColor4(0.f, 1.f, 1.f, 1.f))), + mMaturityPreferenceRequestId(0U), - mHaveHomePosition(FALSE), - mHomeRegionHandle( 0 ), - mNearChatRadius(CHAT_NORMAL_RADIUS / 2.f), + mMaturityPreferenceResponseId(0U), + mMaturityPreferenceNumRetries(0U), + mLastKnownRequestMaturity(SIM_ACCESS_MIN), - mNextFidgetTime(0.f), - mCurrentFidget(0), - mCrouch(false), - mFirstLogin(FALSE), - mOutfitChosen(FALSE), + mLastKnownResponseMaturity(SIM_ACCESS_MIN), + mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), + mShowAvatar(TRUE), + mAppearanceSerialNum(0), + mRenderState(0), - mVoiceConnected(false), + mEffectColor(new LLUIColor(LLColor4(0.f, 1.f, 1.f, 1.f))), - mAppearanceSerialNum(0), - mMouselookModeInSignal(NULL), - mMouselookModeOutSignal(NULL), + mGroupID(), + mHideGroupTitle(FALSE), + mGroupPowers(0), mFriendObserver(nullptr) { @@ -507,7 +507,7 @@ void LLAgent::init() //----------------------------------------------------------------------------- void LLAgent::cleanup() { - mRegionp = NULL; + mRegionp = nullptr; if (mTeleportFinishedSlot.connected()) { mTeleportFinishedSlot.disconnect(); @@ -526,16 +526,16 @@ LLAgent::~LLAgent() cleanup(); delete mMouselookModeInSignal; - mMouselookModeInSignal = NULL; + mMouselookModeInSignal = nullptr; delete mMouselookModeOutSignal; - mMouselookModeOutSignal = NULL; + mMouselookModeOutSignal = nullptr; delete mAgentAccess; - mAgentAccess = NULL; + mAgentAccess = nullptr; delete mEffectColor; - mEffectColor = NULL; + mEffectColor = nullptr; delete mTeleportSourceSLURL; - mTeleportSourceSLURL = NULL; + mTeleportSourceSLURL = nullptr; } // Handle any actions that need to be performed when the main app gains focus @@ -1584,7 +1584,7 @@ void LLAgent::startAutoPilotGlobal( LLVector3d intersection; LLVector3 normal; LLViewerObject *hit_obj; - F32 heightDelta = LLWorld::getInstance()->resolveStepHeightGlobal(NULL, target_global, trace_target, intersection, normal, &hit_obj); + F32 heightDelta = LLWorld::getInstance()->resolveStepHeightGlobal(nullptr, target_global, trace_target, intersection, normal, &hit_obj); if (stop_distance > 0.f) { @@ -1661,7 +1661,7 @@ void LLAgent::setAutoPilotTargetGlobal(const LLVector3d &target_global) LLVector3 groundNorm; LLViewerObject *obj; - LLWorld::getInstance()->resolveStepHeightGlobal(NULL, target_global, traceEndPt, targetOnGround, groundNorm, &obj); + LLWorld::getInstance()->resolveStepHeightGlobal(nullptr, target_global, traceEndPt, targetOnGround, groundNorm, &obj); F64 target_height = llmax((F64)gAgentAvatarp->getPelvisToFoot(), target_global.mdV[VZ] - targetOnGround.mdV[VZ]); // clamp z value of target to minimum height above ground @@ -1687,9 +1687,9 @@ void LLAgent::startFollowPilot(const LLUUID &leader_id, BOOL allow_flying, F32 s startAutoPilotGlobal(object->getPositionGlobal(), std::string(), // behavior_name - NULL, // target_rotation - NULL, // finish_callback - NULL, // callback_data + nullptr, // target_rotation + nullptr, // finish_callback + nullptr, // callback_data stop_distance, 0.03f, // rotation_threshold allow_flying); @@ -1719,7 +1719,7 @@ void LLAgent::stopAutoPilot(BOOL user_cancel) if (mAutoPilotFinishedCallback) { mAutoPilotFinishedCallback(!user_cancel && dist_vec(gAgent.getPositionGlobal(), mAutoPilotTargetGlobal) < mAutoPilotStopDistance, mAutoPilotCallbackData); - mAutoPilotFinishedCallback = NULL; + mAutoPilotFinishedCallback = nullptr; } mLeaderID = LLUUID::null; @@ -2241,7 +2241,7 @@ void LLAgent::endAnimationUpdateUI() gAgentCamera.clearCameraLag(); // JC - Added for always chat in third person option - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); LLToolMgr::getInstance()->setCurrentToolset(gMouselookToolset); @@ -2769,7 +2769,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity) mLastKnownRequestMaturity = pPreferredMaturity; // If we don't have a region, report it as an error - if (getRegion() == NULL) + if (getRegion() == nullptr) { LL_WARNS("Agent") << "Region is not defined, can not change Maturity setting." << LL_ENDL; return; @@ -3121,7 +3121,7 @@ void LLAgent::sendAnimationRequests(const std::vector<LLUUID> &anim_ids, EAnimRe } msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList); - msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0); + msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0); sendReliableMessage(); } @@ -3144,7 +3144,7 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request) msg->addBOOLFast(_PREHASH_StartAnim, (request == ANIM_REQUEST_START) ? TRUE : FALSE); msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList); - msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0); + msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0); sendReliableMessage(); } @@ -3168,7 +3168,7 @@ void LLAgent::sendAnimationStateReset() msg->addBOOLFast(_PREHASH_StartAnim, FALSE); msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList); - msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0); + msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0); sendReliableMessage(); } @@ -3390,10 +3390,10 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **) class LLAgentDropGroupViewerNode : public LLHTTPNode { - virtual void post( + void post( LLHTTPNode::ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { if ( @@ -3525,10 +3525,10 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **) class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode { - virtual void post( + void post( LLHTTPNode::ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { LLSD body = input["body"]; if(body.has("body")) @@ -3980,7 +3980,7 @@ bool LLAgent::teleportCore(bool is_local) bool LLAgent::hasRestartableFailedTeleportRequest() { - return ((mTeleportRequest != NULL) && (mTeleportRequest->getStatus() == LLTeleportRequest::kFailed) && + return ((mTeleportRequest != nullptr) && (mTeleportRequest->getStatus() == LLTeleportRequest::kFailed) && mTeleportRequest->canRestartTeleport()); } @@ -4007,7 +4007,7 @@ void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange) bool LLAgent::hasPendingTeleportRequest() { - return ((mTeleportRequest != NULL) && + return ((mTeleportRequest != nullptr) && ((mTeleportRequest->getStatus() == LLTeleportRequest::kPending) || (mTeleportRequest->getStatus() == LLTeleportRequest::kRestartPending))); } @@ -4144,7 +4144,7 @@ void LLAgent::teleportRequest( // Landmark ID = LLUUID::null means teleport home void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) { - mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id)); + mTeleportRequest = std::static_pointer_cast<LLTeleportRequest>(std::make_shared<LLTeleportRequestViaLandmark>(landmark_asset_id)); startTeleportRequest(); } @@ -4168,7 +4168,7 @@ void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) void LLAgent::teleportViaLure(const LLUUID& lure_id, BOOL godlike) { - mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLure(lure_id, godlike)); + mTeleportRequest = std::static_pointer_cast<LLTeleportRequest>(std::make_shared<LLTeleportRequestViaLure>(lure_id, godlike)); startTeleportRequest(); } @@ -4230,7 +4230,7 @@ void LLAgent::teleportCancel() void LLAgent::restoreCanceledTeleportRequest() { - if (mTeleportCanceled != NULL) + if (mTeleportCanceled != nullptr) { gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED ); mTeleportRequest = mTeleportCanceled; @@ -4242,7 +4242,7 @@ void LLAgent::restoreCanceledTeleportRequest() void LLAgent::teleportViaLocation(const LLVector3d& pos_global) { - mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocation(pos_global)); + mTeleportRequest = std::static_pointer_cast<LLTeleportRequest>(std::make_shared<LLTeleportRequestViaLocation>(pos_global)); startTeleportRequest(); } @@ -4299,7 +4299,7 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) // Teleport to global position, but keep facing in the same direction void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global) { - mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global)); + mTeleportRequest = std::static_pointer_cast<LLTeleportRequest>(std::make_shared<LLTeleportRequestViaLocationLookAt>(pos_global)); startTeleportRequest(); } @@ -4675,7 +4675,7 @@ void LLAgent::sendAgentSetAppearance() // This means the baked texture IDs on the server will be untouched. // Once all textures are baked, another AvatarAppearance message will be sent to update the TEs msg->nextBlockFast(_PREHASH_ObjectData); - gMessageSystem->addBinaryDataFast(_PREHASH_TextureEntry, NULL, 0); + gMessageSystem->addBinaryDataFast(_PREHASH_TextureEntry, nullptr, 0); } @@ -4744,12 +4744,12 @@ void LLAgent::parseTeleportMessages(const std::string& xml_filename) } for (LLXMLNode* message_set = root->getFirstChild(); - message_set != NULL; + message_set != nullptr; message_set = message_set->getNextSibling()) { if ( !message_set->hasName("message_set") ) continue; - std::map<std::string, std::string> *teleport_msg_map = NULL; + std::map<std::string, std::string> *teleport_msg_map = nullptr; std::string message_set_name; if ( message_set->getAttributeString("name", message_set_name) ) @@ -4770,7 +4770,7 @@ void LLAgent::parseTeleportMessages(const std::string& xml_filename) std::string message_name; for (LLXMLNode* message_node = message_set->getFirstChild(); - message_node != NULL; + message_node != nullptr; message_node = message_node->getNextSibling()) { if ( message_node->hasName("message") && @@ -4846,8 +4846,8 @@ void LLAgent::renderAutoPilotTarget() LLAgentQueryManager gAgentQueryManager; LLAgentQueryManager::LLAgentQueryManager() : - mWearablesCacheQueryID(0), mNumPendingQueries(0), + mWearablesCacheQueryID(0), mUpdateSerialNum(0) { for (U32 i = 0; i < BAKED_NUM_INDICES; i++) diff --git a/indra/newview/llagentaccess.cpp b/indra/newview/llagentaccess.cpp index 0c33199973c2f8c3e17655edc7fddcac65a4a62e..cf016c6a96cdee25582097d85b34effda34dc344 100644 --- a/indra/newview/llagentaccess.cpp +++ b/indra/newview/llagentaccess.cpp @@ -32,10 +32,10 @@ #include "llcontrol.h" LLAgentAccess::LLAgentAccess(LLControlGroup& savedSettings) : - mSavedSettings(savedSettings), mAccess(SIM_ACCESS_PG), + mGodLevel(GOD_NOT), mAdminOverride(false), - mGodLevel(GOD_NOT) + mSavedSettings(savedSettings) { } diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index f8284b7684160ea92ef3a3701d933a9fc4ac3c9a..3108e3b3e510f9b7f1ee1acd5cefbd70fb3833ad 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -135,7 +135,7 @@ private: public: LLVector3d getCameraPositionGlobal() const; const LLVector3 &getCameraPositionAgent() const; - LLVector3d calcCameraPositionTargetGlobal(BOOL *hit_limit = NULL); // Calculate the camera position target + LLVector3d calcCameraPositionTargetGlobal(BOOL *hit_limit = nullptr); // Calculate the camera position target F32 getCameraMinOffGround() const; // Minimum height off ground for this mode, meters void setCameraCollidePlane(const LLVector4 &plane) { mCameraCollidePlane = plane; } BOOL calcCameraMinDistance(F32 &obj_min_distance); diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index 5847c3f65d8bc0d1ec611c15f1e72c75975b13d3..1af1913f4af5c3ac12f7ddd815295d1a0c8907c9 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -150,7 +150,7 @@ void LLAgentListener::requestTeleport(LLSD const & event_data) const params.append(event_data["x"]); params.append(event_data["y"]); params.append(event_data["z"]); - LLCommandDispatcher::dispatch("teleport", params, LLSD(), NULL, "clicked", true); + LLCommandDispatcher::dispatch("teleport", params, LLSD(), nullptr, "clicked", true); // *TODO - lookup other LLCommandHandlers for "agent", "classified", "event", "group", "floater", "parcel", "login", login_refresh", "balance", "chat" // should we just compose LLCommandHandler and LLDispatchListener? } @@ -160,7 +160,7 @@ void LLAgentListener::requestTeleport(LLSD const & event_data) const LLVector3(event_data["x"].asReal(), event_data["y"].asReal(), event_data["z"].asReal())).getSLURLString(); - LLURLDispatcher::dispatch(url, "clicked", NULL, false); + LLURLDispatcher::dispatch(url, "clicked", nullptr, false); } } @@ -170,7 +170,7 @@ void LLAgentListener::requestSit(LLSD const & event_data) const // shamelessly ripped from llviewermenu.cpp:handle_sit_or_stand() // *TODO - find a permanent place to share this code properly. - LLViewerObject *object = NULL; + LLViewerObject *object = nullptr; if (event_data.has("obj_uuid")) { object = gObjectList.findObject(event_data["obj_uuid"]); @@ -208,7 +208,7 @@ void LLAgentListener::requestStand(LLSD const & event_data) const LLViewerObject * LLAgentListener::findObjectClosestTo( const LLVector3 & position ) const { - LLViewerObject *object = NULL; + LLViewerObject *object = nullptr; // Find the object closest to that position F32 min_distance = 10000.0f; // Start big @@ -235,7 +235,7 @@ LLViewerObject * LLAgentListener::findObjectClosestTo( const LLVector3 & positio void LLAgentListener::requestTouch(LLSD const & event_data) const { - LLViewerObject *object = NULL; + LLViewerObject *object = nullptr; if (event_data.has("obj_uuid")) { @@ -335,7 +335,7 @@ void LLAgentListener::getPosition(const LLSD& event_data) const void LLAgentListener::startAutoPilot(LLSD const & event_data) { LLQuaternion target_rotation_value; - LLQuaternion* target_rotation = NULL; + LLQuaternion* target_rotation = nullptr; if (event_data.has("target_rotation")) { target_rotation_value = ll_quaternion_from_sd(event_data["target_rotation"]); @@ -367,7 +367,7 @@ void LLAgentListener::startAutoPilot(LLSD const & event_data) mAgent.startAutoPilotGlobal(ll_vector3d_from_sd(event_data["target_global"]), event_data["behavior_name"], target_rotation, - NULL, NULL, + nullptr, nullptr, stop_distance, rotation_threshold, allow_flying); @@ -480,7 +480,7 @@ void LLAgentListener::stopAutoPilot(LLSD const & event_data) const void LLAgentListener::lookAt(LLSD const & event_data) const { - LLViewerObject *object = NULL; + LLViewerObject *object = nullptr; if (event_data.has("obj_uuid")) { object = gObjectList.findObject(event_data["obj_uuid"]); diff --git a/indra/newview/llagentpicksinfo.cpp b/indra/newview/llagentpicksinfo.cpp index 7a779ebf0f15f3ce80970d26427bc11424fafa4c..8864254eef47d76264e9b2b55f44fb6ff3a463f0 100644 --- a/indra/newview/llagentpicksinfo.cpp +++ b/indra/newview/llagentpicksinfo.cpp @@ -61,7 +61,7 @@ public: mServerRespondCallback = cb; } - virtual void processProperties(void* data, EAvatarProcessorType type) + void processProperties(void* data, EAvatarProcessorType type) override { if(APT_PICKS == type) { @@ -86,7 +86,7 @@ private: ////////////////////////////////////////////////////////////////////////// LLAgentPicksInfo::LLAgentPicksInfo() - : mAgentPicksObserver(NULL) + : mAgentPicksObserver(nullptr) , mMaxNumberOfPicks(MAX_AVATAR_PICKS) // Disable Pick creation until we get number of Picks from server - in case // avatar has maximum number of Picks. diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index 842313a9a4257d21da3b9e791472f0c162f94d8a..6ab01ce0354a462923aec59e9e7f3692b642aff9 100644 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -43,6 +43,8 @@ LLAgentPilot gAgentPilot; LLAgentPilot::LLAgentPilot() : + mLoop(TRUE), + mReplaySession(FALSE), mNumRuns(-1), mQuitAfterRuns(FALSE), mRecording(FALSE), @@ -50,9 +52,7 @@ LLAgentPilot::LLAgentPilot() : mStarted(FALSE), mPlaying(FALSE), mCurrentAction(0), - mOverrideCamera(FALSE), - mLoop(TRUE), - mReplaySession(FALSE) + mOverrideCamera(FALSE) { } diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 0bb72bbb3061a820fc0fd4a7a1ce16d2da55a0cf..5cedd7f1dad62bed56e11a418e56b80d7ec2c494 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -106,7 +106,7 @@ public: // Setters //-------------------------------------------------------------------- private: - /*virtual*/void wearableUpdated(LLWearable *wearable, BOOL removed); + /*virtual*/void wearableUpdated(LLWearable *wearable, BOOL removed) override; public: void setWearableItem(LLInventoryItem* new_item, LLViewerWearable* wearable, bool do_append = false); void setWearableOutfit(const LLInventoryItem::item_array_t& items, const std::vector< LLViewerWearable* >& wearables); @@ -163,7 +163,7 @@ public: protected: - /*virtual*/ void invalidateBakedTextureHash(LLMD5& hash) const; + /*virtual*/ void invalidateBakedTextureHash(LLMD5& hash) const override; void sendAgentWearablesUpdate(); void sendAgentWearablesRequest(); void queryWearableCache(); @@ -283,7 +283,7 @@ private: LLViewerWearable* wearable, U32 todo = CALL_NONE, const std::string description = ""); - virtual void fire(const LLUUID& inv_item); + void fire(const LLUUID& inv_item) override; private: LLWearableType::EType mType; U32 mIndex; diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index f6ba772a2cefd9b6f7a8575677e055785aef31cc..b5634a784e8028557057553d6ff2b232fce0d45a 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -113,7 +113,8 @@ public: ~LLFetchAndLinkObserver() { } - virtual void done() + + void done() override { gInventory.removeObserver(this); diff --git a/indra/newview/llagentwearablesfetch.h b/indra/newview/llagentwearablesfetch.h index 81b03110ae34ec487c321300a94a95021f2b2ca8..f82d63731462220d87cd5e74d2334f3267c2b10d 100644 --- a/indra/newview/llagentwearablesfetch.h +++ b/indra/newview/llagentwearablesfetch.h @@ -45,7 +45,7 @@ class LLInitialWearablesFetch : public LLInventoryFetchDescendentsObserver public: LLInitialWearablesFetch(const LLUUID& cof_id); ~LLInitialWearablesFetch(); - virtual void done(); + void done() override; struct InitialWearableData { diff --git a/indra/newview/llaoengine.h b/indra/newview/llaoengine.h index f4e42ee281b68c1dd335b62587c989f20d570ec0..0941e5a8788e46567e23fd161dea7ba460c2e97a 100644 --- a/indra/newview/llaoengine.h +++ b/indra/newview/llaoengine.h @@ -41,7 +41,7 @@ public: LLAOTimerCollection(); ~LLAOTimerCollection() {} - virtual BOOL tick(); + BOOL tick() override; void setInventoryTimer(const bool enable); void setSettingsTimer(const bool enable); @@ -68,7 +68,7 @@ public: void oneShot(); void stop(); - virtual BOOL tick(); + BOOL tick() override; protected: S32 mTickCount; diff --git a/indra/newview/llaoset.cpp b/indra/newview/llaoset.cpp index 77511bb416bfaf589c07fdaadce87d787698a45e..c443420de8c1523c6d3e355fa17ae5acfb243ff0 100644 --- a/indra/newview/llaoset.cpp +++ b/indra/newview/llaoset.cpp @@ -41,8 +41,8 @@ LLAOSet::LLAOSet(const LLUUID& inventoryID) , mSmart(false) , mMouselookDisable(false) , mComplete(false) -, mDirty(false) , mCurrentMotion(LLUUID()) +, mDirty(false) { LL_DEBUGS("AOEngine") << "Creating new AO set: " << this << LL_ENDL; @@ -148,7 +148,7 @@ LLAOSet::AOState* LLAOSet::getStateByName(const std::string& name) } } } - return NULL; + return nullptr; } LLAOSet::AOState* LLAOSet::getStateByRemapID(const LLUUID& id) @@ -166,7 +166,7 @@ LLAOSet::AOState* LLAOSet::getStateByRemapID(const LLUUID& id) return &mStates[index]; } } - return NULL; + return nullptr; } const LLUUID& LLAOSet::getAnimationForState(AOState* state) const diff --git a/indra/newview/llappcorehttp.cpp b/indra/newview/llappcorehttp.cpp index 88bfd28661d5d39e84b9e5452eee609a3d2e648e..0f1b9ee0667546688092611b02c2fde03645005d 100644 --- a/indra/newview/llappcorehttp.cpp +++ b/indra/newview/llappcorehttp.cpp @@ -127,7 +127,7 @@ LLAppCoreHttp::HttpClass::HttpClass() LLAppCoreHttp::LLAppCoreHttp() - : mRequest(NULL), + : mRequest(nullptr), mStopHandle(LLCORE_HTTP_HANDLE_INVALID), mStopRequested(0.0), mStopped(false), @@ -138,7 +138,7 @@ LLAppCoreHttp::LLAppCoreHttp() LLAppCoreHttp::~LLAppCoreHttp() { delete mRequest; - mRequest = NULL; + mRequest = nullptr; } @@ -160,7 +160,7 @@ void LLAppCoreHttp::init() // Point to our certs or SSH/https: will fail on connect status = LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_CA_FILE, LLCore::HttpRequest::GLOBAL_POLICY_ID, - gDirUtilp->getCAFile(), NULL); + gDirUtilp->getCAFile(), nullptr); if (! status) { LL_ERRS("Init") << "Failed to set CA File for HTTP services. Reason: " << status.toString() @@ -170,7 +170,7 @@ void LLAppCoreHttp::init() // Establish HTTP Proxy, if desired. status = LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_LLPROXY, LLCore::HttpRequest::GLOBAL_POLICY_ID, - 1, NULL); + 1, nullptr); if (! status) { LL_WARNS("Init") << "Failed to set HTTP proxy for HTTP services. Reason: " << status.toString() @@ -180,7 +180,7 @@ void LLAppCoreHttp::init() // Set up SSL Verification call back. status = LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_SSL_VERIFY_CALLBACK, LLCore::HttpRequest::GLOBAL_POLICY_ID, - sslVerify, NULL); + sslVerify, nullptr); if (!status) { LL_WARNS("Init") << "Failed to set SSL Verification. Reason: " << status.toString() << LL_ENDL; @@ -198,7 +198,7 @@ void LLAppCoreHttp::init() trace_level = long(gSavedSettings.getU32(http_trace)); status = LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_TRACE, LLCore::HttpRequest::GLOBAL_POLICY_ID, - trace_level, NULL); + trace_level, nullptr); } // Setup default policy and constrain if directed to @@ -347,7 +347,7 @@ void LLAppCoreHttp::cleanup() mPipelinedSignal.disconnect(); delete mRequest; - mRequest = NULL; + mRequest = nullptr; LLCore::HttpStatus status = LLCore::HttpRequest::destroyService(); if (! status) @@ -394,7 +394,7 @@ void LLAppCoreHttp::refreshSettings(bool initial) status = LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_THROTTLE_RATE, mHttpClasses[app_policy].mPolicy, init_data[i].mRate, - NULL); + nullptr); if (! status) { LL_WARNS("Init") << "Unable to set " << init_data[i].mUsage diff --git a/indra/newview/llappcorehttp.h b/indra/newview/llappcorehttp.h index 95c138d5982a213eb3be3b3522f00e4d1ec8f7be..75f75a0e25d4508d8c94daf3965c5b9881e75f60 100644 --- a/indra/newview/llappcorehttp.h +++ b/indra/newview/llappcorehttp.h @@ -213,7 +213,7 @@ public: void cleanup(); // Notification when the stop request is complete. - virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) override; // Retrieve a policy class identifier for desired // application function. diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 90636f9ccc66c9ac0bd8160aa6ada3b98dc04d18..fe756c10f19e81730f2717f6bfbe38b27d3d457a 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -300,7 +300,7 @@ public: bool enforce_ordering = true, nullary_func_t post_update_func = no_op); virtual ~LLUpdateAppearanceOnDestroy(); - /* virtual */ void fire(const LLUUID& inv_item); + /* virtual */ void fire(const LLUUID& inv_item) override; private: U32 mFireCount; @@ -314,7 +314,7 @@ class LLUpdateAppearanceAndEditWearableOnDestroy: public LLInventoryCallback public: LLUpdateAppearanceAndEditWearableOnDestroy(const LLUUID& item_id); - /* virtual */ void fire(const LLUUID& item_id) {} + /* virtual */ void fire(const LLUUID& item_id) override {} ~LLUpdateAppearanceAndEditWearableOnDestroy(); @@ -328,7 +328,7 @@ public: LLRequestServerAppearanceUpdateOnDestroy() {} ~LLRequestServerAppearanceUpdateOnDestroy(); - /* virtual */ void fire(const LLUUID& item_id) {} + /* virtual */ void fire(const LLUUID& item_id) override {} }; // Invoke a given callable after category contents are fully fetched. diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2bf3ee238147c0c1c30b3d180343e43eea63a843..0a4e396132a452873d049c8f51badfffea02ea97 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -318,7 +318,7 @@ LLSD gDebugInfo; U32 gFrameCount = 0; U32 gForegroundFrameCount = 0; // number of frames that app window was in foreground -LLPumpIO* gServicePump = NULL; +LLPumpIO* gServicePump = nullptr; U64MicrosecondsImplicit gFrameTime = 0; F32SecondsImplicit gFrameTimeSeconds = 0.f; @@ -348,7 +348,7 @@ BOOL gRestoreGL = FALSE; BOOL gUseWireframe = FALSE; // VFS globals - see llappviewer.h -LLVFS* gStaticVFS = NULL; +LLVFS* gStaticVFS = nullptr; LLMemoryInfo gSysMemory; U64Bytes gMemoryAllocated(0); // updated in display_stats() in llviewerdisplay.cpp @@ -486,7 +486,7 @@ struct SettingsFiles : public LLInitParam::Block<SettingsFiles> static std::string gWindowTitle; -LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; +LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = nullptr ; //---------------------------------------------------------------------------- // Metrics logging control constants @@ -653,7 +653,7 @@ public: mFile = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, file_name); } - void run() + void run() override { llofstream os(mFile.c_str()); @@ -687,10 +687,10 @@ bool LLAppViewer::sendURLToOtherInstance(const std::string& url) // Static members. // The single viewer app. -LLAppViewer* LLAppViewer::sInstance = NULL; -LLTextureCache* LLAppViewer::sTextureCache = NULL; -LLImageDecodeThread* LLAppViewer::sImageDecodeThread = NULL; -LLTextureFetch* LLAppViewer::sTextureFetch = NULL; +LLAppViewer* LLAppViewer::sInstance = nullptr; +LLTextureCache* LLAppViewer::sTextureCache = nullptr; +LLImageDecodeThread* LLAppViewer::sImageDecodeThread = nullptr; +LLTextureFetch* LLAppViewer::sTextureFetch = nullptr; std::string getRuntime() { @@ -698,30 +698,30 @@ std::string getRuntime() } LLAppViewer::LLAppViewer() -: mMarkerFile(), +: mRandomizeFramerate(LLCachedControl<bool>(gSavedSettings,"Randomize Framerate", false)), + mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", false)), + mSecondInstance(false), + mMarkerFile(), mLogoutMarkerFile(), mReportedCrash(false), mNumSessions(0), mPurgeCache(false), - mPurgeOnExit(false), - mSecondInstance(false), + mPurgeOnExit(false), // don't save settings on logout unless login succeeded. mSavedFinalSnapshot(false), - mSavePerAccountSettings(false), // don't save settings on logout unless login succeeded. + mSavePerAccountSettings(false), mQuitRequested(false), mLogoutRequestSent(false), mYieldTime(-1), mLastAgentControlFlags(0), mLastAgentForceUpdate(0), - mMainloopTimeout(NULL), + mSettingsLocationList(nullptr), + mMainloopTimeout(nullptr), + mFastTimerLogThread(nullptr), mAgentRegionLastAlive(false), - mRandomizeFramerate(LLCachedControl<bool>(gSavedSettings,"Randomize Framerate", false)), - mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", false)), - mFastTimerLogThread(NULL), mUpdater(new LLUpdaterService()), - mSettingsLocationList(NULL), mIsFirstRun(false) { - if(NULL != sInstance) + if(nullptr != sInstance) { LL_ERRS() << "Oh no! An instance of LLAppViewer already exists! LLAppViewer is sort of like a singleton." << LL_ENDL; } @@ -756,7 +756,7 @@ LLAppViewer::~LLAppViewer() delete mSettingsLocationList; LLViewerEventRecorder::deleteSingleton(); - LLLoginInstance::instance().setUpdaterService(0); + LLLoginInstance::instance().setUpdaterService(nullptr); destroyMainloopTimeout(); @@ -767,7 +767,7 @@ LLAppViewer::~LLAppViewer() class LLUITranslationBridge : public LLTranslationBridge { public: - virtual std::string getString(const std::string &xml_desc) + std::string getString(const std::string &xml_desc) override { return LLTrans::getString(xml_desc); } @@ -1676,7 +1676,7 @@ void LLAppViewer::flushVFSIO() bool LLAppViewer::cleanup() { //ditch LLVOAvatarSelf instance - gAgentAvatarp = NULL; + gAgentAvatarp = nullptr; LLNotifications::instance().clear(); @@ -1736,7 +1736,7 @@ bool LLAppViewer::cleanup() release_start_screen(); // just in case - LLError::logToFixedBuffer(NULL); + LLError::logToFixedBuffer(nullptr); LL_INFOS() << "Cleaning Up" << LL_ENDL; @@ -1774,7 +1774,7 @@ bool LLAppViewer::cleanup() } delete gAssetStorage; - gAssetStorage = NULL; + gAssetStorage = nullptr; LLPolyMesh::freeAllMeshes(); @@ -1794,7 +1794,7 @@ bool LLAppViewer::cleanup() gAudiop->shutdown(); delete gAudiop; - gAudiop = NULL; + gAudiop = nullptr; } // Note: this is where LLFeatureManager::getInstance()-> used to be deleted. @@ -1848,7 +1848,7 @@ bool LLAppViewer::cleanup() // This may generate window reshape and activation events. // Therefore must do this before destroying the message system. delete gViewerWindow; - gViewerWindow = NULL; + gViewerWindow = nullptr; LL_INFOS() << "ViewerWindow deleted" << LL_ENDL; } @@ -1856,7 +1856,7 @@ bool LLAppViewer::cleanup() // viewer UI relies on keyboard so keep it aound until viewer UI isa gone delete gKeyboard; - gKeyboard = NULL; + gKeyboard = nullptr; // Turn off Space Navigator and similar devices LLViewerJoystick::getInstance()->terminate(); @@ -2015,13 +2015,13 @@ bool LLAppViewer::cleanup() //MUST happen AFTER LLCurl::cleanupClass delete sTextureCache; - sTextureCache = NULL; + sTextureCache = nullptr; delete sTextureFetch; - sTextureFetch = NULL; + sTextureFetch = nullptr; delete sImageDecodeThread; - sImageDecodeThread = NULL; + sImageDecodeThread = nullptr; delete mFastTimerLogThread; - mFastTimerLogThread = NULL; + mFastTimerLogThread = nullptr; cleanupSecHandler(); @@ -2069,9 +2069,9 @@ bool LLAppViewer::cleanup() // For safety, the LLVFS has to be deleted *after* LLVFSThread. This should be cleaned up. // (LLVFS doesn't know about LLVFSThread so can't kill pending requests) -Steve delete gStaticVFS; - gStaticVFS = NULL; + gStaticVFS = nullptr; delete gVFS; - gVFS = NULL; + gVFS = nullptr; gSavedSettings.cleanup(); LLUIColorTable::instance().clear(); @@ -2087,7 +2087,7 @@ bool LLAppViewer::cleanup() LL_INFOS() << "Launch file on quit." << LL_ENDL; #if LL_WINDOWS // Indicate an application is starting. - SetCursor(LoadCursor(NULL, IDC_WAIT)); + SetCursor(LoadCursor(nullptr, IDC_WAIT)); #endif // HACK: Attempt to wait until the screen res. switch is complete. @@ -2150,7 +2150,7 @@ void watchdog_llerrs_callback(const std::string &error_string) gLLErrorActivated = true; #ifdef LL_WINDOWS - RaiseException(0,0,0,0); + RaiseException(0,0,0,nullptr); #else raise(SIGQUIT); #endif @@ -2414,7 +2414,7 @@ bool LLAppViewer::initConfiguration() //Load settings files list std::string settings_file_list = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings_files.xml"); LLXMLNodePtr root; - BOOL success = LLXMLNode::parseFile(settings_file_list, root, NULL); + BOOL success = LLXMLNode::parseFile(settings_file_list, root, nullptr); if (!success) { LL_ERRS() << "Cannot load default configuration file " << settings_file_list << LL_ENDL; @@ -2607,7 +2607,7 @@ bool LLAppViewer::initConfiguration() const std::string& value = *(++itr); std::string name_part; std::string group_part; - LLControlVariable* control = NULL; + LLControlVariable* control = nullptr; // Name can be further split into ControlGroup.Name, with the default control group being Global size_t pos = name.find('.'); @@ -2968,7 +2968,7 @@ namespace { void on_update_downloaded(LLSD const & data) { std::string notification_name; - void (*apply_callback)(LLSD const &, LLSD const &) = NULL; + void (*apply_callback)(LLSD const &, LLSD const &) = nullptr; /* Build up the notification name... * it can be any of these, which are included here for the sake of grep: @@ -3536,7 +3536,7 @@ std::string LLAppViewer::getViewerInfoString() const // SLT timestamp LLSD substitution; - substitution["datetime"] = (S32)time(NULL);//(S32)time_corrected(); + substitution["datetime"] = (S32)time(nullptr);//(S32)time_corrected(); support << "\n" << LLTrans::getString("AboutTime", substitution); return support.str(); @@ -3559,7 +3559,7 @@ void LLAppViewer::cleanupSavedSettings() // save window position if not maximized // as we don't track it in callbacks - if(NULL != gViewerWindow) + if(nullptr != gViewerWindow) { BOOL maximized = gViewerWindow->getWindow()->getMaximized(); if (!maximized) @@ -3923,7 +3923,7 @@ void LLAppViewer::processMarkerFiles() bool marker_is_same_version = true; // first, look for the marker created at startup and deleted on a clean exit mMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,MARKER_FILE_NAME); - if (LLAPRFile::isExist(mMarkerFileName, NULL, LL_APR_RB)) + if (LLAPRFile::isExist(mMarkerFileName, nullptr, LL_APR_RB)) { // File exists... // first, read it to see if it was created by the same version (we need this later) @@ -4000,7 +4000,7 @@ void LLAppViewer::processMarkerFiles() // check for any last exec event report based on whether or not it happened during logout // (the logout marker is created when logout begins) std::string logout_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LOGOUT_MARKER_FILE_NAME); - if(LLAPRFile::isExist(logout_marker_file, NULL, LL_APR_RB)) + if(LLAPRFile::isExist(logout_marker_file, nullptr, LL_APR_RB)) { if (markerIsSameVersion(logout_marker_file)) { @@ -4015,7 +4015,7 @@ void LLAppViewer::processMarkerFiles() } // further refine based on whether or not a marker created during an llerr crash is found std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME); - if(LLAPRFile::isExist(llerror_marker_file, NULL, LL_APR_RB)) + if(LLAPRFile::isExist(llerror_marker_file, nullptr, LL_APR_RB)) { if (markerIsSameVersion(llerror_marker_file)) { @@ -4038,7 +4038,7 @@ void LLAppViewer::processMarkerFiles() } // and last refine based on whether or not a marker created during a non-llerr crash is found std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); - if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB)) + if(LLAPRFile::isExist(error_marker_file, nullptr, LL_APR_RB)) { if (markerIsSameVersion(error_marker_file)) { @@ -4458,7 +4458,7 @@ bool LLAppViewer::initCache() // This has to happen BEFORE starting the vfs // time_t ltime; - srand(time(NULL)); // Flawfinder: ignore + srand(time(nullptr)); // Flawfinder: ignore U32 old_salt = gSavedSettings.getU32("VFSSalt"); U32 new_salt; std::string old_vfs_data_file; @@ -5627,7 +5627,7 @@ void LLAppViewer::forceErrorBreakpoint() void LLAppViewer::forceErrorBadMemoryAccess() { LL_WARNS() << "Forcing a deliberate bad memory access" << LL_ENDL; - S32* crash = NULL; + S32* crash = nullptr; *crash = 0xDEADBEEF; return; } @@ -5651,7 +5651,7 @@ void LLAppViewer::forceErrorSoftwareException() void LLAppViewer::forceErrorDriverCrash() { LL_WARNS() << "Forcing a deliberate driver crash" << LL_ENDL; - glDeleteTextures(1, NULL); + glDeleteTextures(1, nullptr); } void LLAppViewer::initMainloopTimeout(const std::string& state, F32 secs) @@ -5668,7 +5668,7 @@ void LLAppViewer::destroyMainloopTimeout() if(mMainloopTimeout) { delete mMainloopTimeout; - mMainloopTimeout = NULL; + mMainloopTimeout = nullptr; } } @@ -5797,7 +5797,7 @@ void LLAppViewer::launchUpdater() if (LLAppViewer::sUpdaterInfo->mUpdateExePath.empty()) { delete LLAppViewer::sUpdaterInfo ; - LLAppViewer::sUpdaterInfo = NULL ; + LLAppViewer::sUpdaterInfo = nullptr ; // We're hosed, bail LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL; @@ -5818,7 +5818,7 @@ void LLAppViewer::launchUpdater() if (!CopyFileW(utf8str_to_utf16str(updater_source).c_str(), utf8str_to_utf16str(LLAppViewer::sUpdaterInfo->mUpdateExePath).c_str(), FALSE)) { delete LLAppViewer::sUpdaterInfo ; - LLAppViewer::sUpdaterInfo = NULL ; + LLAppViewer::sUpdaterInfo = nullptr ; LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL; @@ -5966,7 +5966,7 @@ void LLAppViewer::metricsSend(bool enable_reporting) gAgentSessionID, gAgentID, main_stats); - main_stats = 0; // Ownership transferred + main_stats = nullptr; // Ownership transferred } else { diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index d7911433e0573a67a513bb0c59a1a80861f2419d..a25db4706f72f2e43f78920dc52061489d3581ea 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -80,9 +80,9 @@ public: // // Main application logic // - virtual bool init(); // Override to do application initialization - virtual bool cleanup(); // Override to do application cleanup - virtual bool frame(); // Override for application body logic + bool init() override; // Override to do application initialization + bool cleanup() override; // Override to do application cleanup + bool frame() override; // Override for application body logic // Application control void flushVFSIO(); // waits for vfs transfers to complete diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 3a2f8b436e47d5a5fed469257354725549318643..6598f537702de01d65f7470408042e6447f56f1c 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -70,7 +70,7 @@ #include <exception> namespace { - void (*gOldTerminateHandler)() = NULL; + void (*gOldTerminateHandler)() = nullptr; } static void exceptionTerminateHandler() @@ -79,7 +79,7 @@ static void exceptionTerminateHandler() if (gOldTerminateHandler) std::set_terminate(gOldTerminateHandler); // treat this like a regular viewer crash, with nice stacktrace etc. long *null_ptr; - null_ptr = 0; + null_ptr = nullptr; *null_ptr = 0xDEADBEEF; //Force an exception that will trigger breakpad. //LLAppViewer::handleViewerCrash(); // we've probably been killed-off before now, but... @@ -108,7 +108,7 @@ bool create_app_mutex() bool result = true; LPCWSTR unique_mutex_name = L"SecondLifeAppMutex"; HANDLE hMutex; - hMutex = CreateMutex(NULL, TRUE, unique_mutex_name); + hMutex = CreateMutex(nullptr, TRUE, unique_mutex_name); if(GetLastError() == ERROR_ALREADY_EXISTS) { result = false; @@ -345,7 +345,7 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, } delete viewer_app_ptr; - viewer_app_ptr = NULL; + viewer_app_ptr = nullptr; //start updater if(LLAppViewer::sUpdaterInfo) @@ -353,7 +353,7 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, _spawnl(_P_NOWAIT, LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), LLAppViewer::sUpdaterInfo->mParams.str().c_str(), NULL); delete LLAppViewer::sUpdaterInfo ; - LLAppViewer::sUpdaterInfo = NULL ; + LLAppViewer::sUpdaterInfo = nullptr ; } #ifdef USE_NVAPI @@ -423,9 +423,9 @@ static bool create_console() freopen("CONOUT$", "w", stdout); freopen("CONOUT$", "w", stderr); - setvbuf( stdin, NULL, _IONBF, 0 ); - setvbuf( stdout, NULL, _IONBF, 0 ); - setvbuf( stderr, NULL, _IONBF, 0 ); + setvbuf( stdin, nullptr, _IONBF, 0 ); + setvbuf( stdout, nullptr, _IONBF, 0 ); + setvbuf( stderr, nullptr, _IONBF, 0 ); return isConsoleAllocated; } @@ -581,7 +581,7 @@ bool LLAppViewerWin32::initParseCommandLine(LLCommandLineParser& clp) } // Find the system language. - FL_Locale *locale = NULL; + FL_Locale *locale = nullptr; FL_Success success = FL_FindLocale(&locale, FL_MESSAGES); if (success != 0) { @@ -640,12 +640,12 @@ void LLAppViewerWin32::initCrashReporting(bool reportFreeze) LL_INFOS("CrashReport") << "Creating crash reporter process " << exe_path << " with params: " << arg_str << LL_ENDL; if(CreateProcess(exe_wstr.c_str(), &arg_wstr[0], // Application arguments - 0, - 0, + nullptr, + nullptr, FALSE, CREATE_DEFAULT_ERROR_MODE, - 0, - 0, // Working directory + nullptr, + nullptr, // Working directory &startInfo, &processInfo) == FALSE) // Could not start application -> call 'GetLastError()' @@ -662,9 +662,9 @@ bool LLAppViewerWin32::sendURLToOtherInstance(const std::string& url) mbstowcs(window_class, sWindowClass.c_str(), 255); window_class[255] = 0; // Use the class instead of the window name. - HWND other_window = FindWindow(window_class, NULL); + HWND other_window = FindWindow(window_class, nullptr); - if (other_window != NULL) + if (other_window != nullptr) { LL_DEBUGS() << "Found other window with the name '" << getWindowTitle() << "'" << LL_ENDL; COPYDATASTRUCT cds; @@ -691,12 +691,12 @@ std::string LLAppViewerWin32::generateSerialNumber() DWORD flags = 0; BOOL success = GetVolumeInformation( TEXT("C:\\"), - NULL, // volume name buffer + nullptr, // volume name buffer 0, // volume name buffer size &serial, // volume serial - NULL, // max component length + nullptr, // max component length &flags, // file system flags - NULL, // file system name buffer + nullptr, // file system name buffer 0); // file system name buffer size if (success) { diff --git a/indra/newview/llappviewerwin32.h b/indra/newview/llappviewerwin32.h index 59d1ddaa3df21d661e03789da7e58428a3f7e355..6ec46775e80bab40d2e518ccd17f4cc9d109791d 100644 --- a/indra/newview/llappviewerwin32.h +++ b/indra/newview/llappviewerwin32.h @@ -40,21 +40,21 @@ public: // // Main application logic // - virtual bool init(); // Override to do application initialization - virtual bool cleanup(); + bool init() override; // Override to do application initialization + bool cleanup() override; protected: - virtual void initLoggingAndGetLastDuration(); // Override to clean stack_trace info. - virtual void initConsole(); // Initialize OS level debugging console. - virtual bool initHardwareTest(); // Win32 uses DX9 to test hardware. - virtual bool initParseCommandLine(LLCommandLineParser& clp); + void initLoggingAndGetLastDuration() override; // Override to clean stack_trace info. + void initConsole() override; // Initialize OS level debugging console. + bool initHardwareTest() override; // Win32 uses DX9 to test hardware. + bool initParseCommandLine(LLCommandLineParser& clp) override; - virtual bool restoreErrorTrap(); - virtual void initCrashReporting(bool reportFreeze); + bool restoreErrorTrap() override; + void initCrashReporting(bool reportFreeze) override; - virtual bool sendURLToOtherInstance(const std::string& url); + bool sendURLToOtherInstance(const std::string& url) override; - std::string generateSerialNumber(); + std::string generateSerialNumber() override; static const std::string sWindowClass; diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp index ef90440769b49644e8fc56c18f50914bbb47ddef..e7f1e94205f063030dbb7941375c44354224d6a8 100644 --- a/indra/newview/llattachmentsmgr.cpp +++ b/indra/newview/llattachmentsmgr.cpp @@ -273,8 +273,8 @@ void LLAttachmentsMgr::linkRecentlyArrivedAttachments() } LLAttachmentsMgr::LLItemRequestTimes::LLItemRequestTimes(const std::string& op_name, F32 timeout): - mOpName(op_name), - mTimeout(timeout) + mTimeout(timeout), + mOpName(op_name) { } diff --git a/indra/newview/llaudiosourcevo.cpp b/indra/newview/llaudiosourcevo.cpp index f5faf835d05ec0fd685e952fb1cb0ec659ee4d91..a1b41ba259ecefaf27d426fe5aa9e9cf0b6d9e29 100644 --- a/indra/newview/llaudiosourcevo.cpp +++ b/indra/newview/llaudiosourcevo.cpp @@ -48,7 +48,7 @@ LLAudioSourceVO::~LLAudioSourceVO() { mObjectp->clearAttachedSound(); } - mObjectp = NULL; + mObjectp = nullptr; } void LLAudioSourceVO::setGain(const F32 gain) @@ -148,7 +148,7 @@ void LLAudioSourceVO::update() if (mObjectp->isDead()) { - mObjectp = NULL; + mObjectp = nullptr; return; } diff --git a/indra/newview/llaudiosourcevo.h b/indra/newview/llaudiosourcevo.h index f1d8ef4528507b6be516b70cc54ac5edbc551b96..29430eb7900b0e7971117fb98377eca852748a9a 100644 --- a/indra/newview/llaudiosourcevo.h +++ b/indra/newview/llaudiosourcevo.h @@ -38,8 +38,8 @@ class LLAudioSourceVO : public LLAudioSource public: LLAudioSourceVO(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, LLViewerObject *objectp); virtual ~LLAudioSourceVO(); - /*virtual*/ void update(); - /*virtual*/ void setGain(const F32 gain); + /*virtual*/ void update() override; + /*virtual*/ void setGain(const F32 gain) override; private: void updateMute(); diff --git a/indra/newview/llautoreplace.cpp b/indra/newview/llautoreplace.cpp index b441808d1dd30a439303de99fcbcfa7a855cf9ef..1e8316a7941edaa5053db102ba96d2ea1b997848 100644 --- a/indra/newview/llautoreplace.cpp +++ b/indra/newview/llautoreplace.cpp @@ -312,9 +312,9 @@ bool LLAutoReplaceSettings::listNameMatches( const LLSD& list, const std::string const LLSD* LLAutoReplaceSettings::getListEntries(std::string listName) { - const LLSD* returnedEntries = NULL; + const LLSD* returnedEntries = nullptr; for( LLSD::array_const_iterator list = mLists.beginArray(), endList = mLists.endArray(); - returnedEntries == NULL && list != endList; + returnedEntries == nullptr && list != endList; list++ ) { @@ -444,9 +444,9 @@ bool LLAutoReplaceSettings::listIsValid(const LLSD& list) const LLSD* LLAutoReplaceSettings::exportList(std::string listName) { - const LLSD* exportedList = NULL; + const LLSD* exportedList = nullptr; for ( LLSD::array_const_iterator list = mLists.beginArray(), listEnd = mLists.endArray(); - exportedList == NULL && list != listEnd; + exportedList == nullptr && list != listEnd; list++ ) { diff --git a/indra/newview/llautoreplace.h b/indra/newview/llautoreplace.h index 40b4cf044ef6bea334e3b7007e38383363f502ce..a8f8c61e9c4508d8c038cf87286ea017ed348f2f 100644 --- a/indra/newview/llautoreplace.h +++ b/indra/newview/llautoreplace.h @@ -201,7 +201,7 @@ public: void setSettings(const LLAutoReplaceSettings& settings); private: - /*virtual*/ void initSingleton(); + /*virtual*/ void initSingleton() override; LLAutoReplaceSettings mSettings; ///< configuration information diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index b980422b5fed9cf19133ccda6a8429ca6c7552ea..6e3465dea613155accd7dffc12d7eab335e2d8bc 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -589,7 +589,7 @@ namespace action_give_inventory static LLInventoryPanel* get_outfit_editor_inventory_panel() { LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); - if (NULL == panel_outfit_edit) return NULL; + if (nullptr == panel_outfit_edit) return nullptr; LLInventoryPanel* inventory_panel = panel_outfit_edit->findChild<LLInventoryPanel>("folder_view"); return inventory_panel; @@ -656,13 +656,13 @@ namespace action_give_inventory for (std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin(); ; ) { LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); - if (NULL != inv_cat) + if (nullptr != inv_cat) { items_string = inv_cat->getName(); break; } LLViewerInventoryItem* inv_item = gInventory.getItem(*it); - if (NULL != inv_item) + if (nullptr != inv_item) { items_string.append(inv_item->getName()); } @@ -797,7 +797,7 @@ namespace action_give_inventory for ( ; it != inventory_selected_uuids.end() && folders_count <=1 ; ++it) { LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); - if (NULL != inv_cat) + if (nullptr != inv_cat) { folders_count++; } @@ -1213,7 +1213,7 @@ void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::stri //static bool LLAvatarActions::isFriend(const LLUUID& id) { - return ( NULL != LLAvatarTracker::instance().getBuddyInfo(id) ); + return (nullptr != LLAvatarTracker::instance().getBuddyInfo(id) ); } // static @@ -1245,7 +1245,7 @@ bool LLAvatarActions::canBlock(const LLUUID& id) //static bool LLAvatarActions::isAgentMappable(const LLUUID& agent_id) { - const LLRelationship* buddy_info = NULL; + const LLRelationship* buddy_info = nullptr; bool is_friend = LLAvatarActions::isFriend(agent_id); if (is_friend) diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 653b484ebb5f827ac8cbdc66d359f9260cd1b718..48adb027d1d56c95d53c0298488d45676937238e 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -216,7 +216,7 @@ public: * * @return false if the selected items cannot be shared or the active inventory panel cannot be obtained */ - static bool canShareSelectedItems(LLInventoryPanel* inv_panel = NULL); + static bool canShareSelectedItems(LLInventoryPanel* inv_panel = nullptr); /** * Checks whether agent is mappable diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 43d4871556ce386fefdc032e936ed09d34b74f76..2938a1fe2dca6091c4275b76c3eedb7e62e2e610 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -135,9 +135,9 @@ LLUUID* LLAvatarIconIDCache::get (const LLUUID& avatar_id) { std::map<LLUUID,LLAvatarIconIDCacheItem>::iterator it = mCache.find(avatar_id); if(it==mCache.end()) - return 0; + return nullptr; if(it->second.expired()) - return 0; + return nullptr; return &it->second.icon_id; } @@ -174,11 +174,11 @@ LLAvatarIconCtrl::LLAvatarIconCtrl(const LLAvatarIconCtrl::Params& p) mFullName(), mDrawTooltip(p.draw_tooltip), mDefaultIconName(p.default_icon_name), - mAvatarNameCacheConnection(), mSymbolHpad(p.symbol_hpad), mSymbolVpad(p.symbol_vpad), mSymbolSize(p.symbol_size), mSymbolPos(p.symbol_pos), + mAvatarNameCacheConnection(), mUseDefaultImage(gSavedSettings, "AlchemyUseDefaultAvatarIcon", false) { mPriority = LLViewerFetchedTexture::BOOST_ICON; diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h index 5850286bcfce09e791b7437d0d313a3030bc0425..cb639d15935610a12bcd7ff112444a388e807475 100644 --- a/indra/newview/llavatariconctrl.h +++ b/indra/newview/llavatariconctrl.h @@ -109,10 +109,10 @@ protected: public: virtual ~LLAvatarIconCtrl(); - virtual void setValue(const LLSD& value); + void setValue(const LLSD& value) override; // LLAvatarPropertiesProcessor observer trigger - virtual void processProperties(void* data, EAvatarProcessorType type); + void processProperties(void* data, EAvatarProcessorType type) override; const LLUUID& getAvatarId() const { return mAvatarId; } const std::string& getFullName() const { return mFullName; } diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 7f50d6c3191b521763b6ea5353ccb62ccdc44dea..7bbbc129730318bd6c49d4291e030fca526c8910 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -137,16 +137,16 @@ LLAvatarList::LLAvatarList(const Params& p) , mIgnoreOnlineStatus(p.ignore_online_status) , mShowLastInteractionTime(p.show_last_interaction_time) , mShowDistance(p.show_distance) -, mContextMenu(NULL) -, mDirty(true) // to force initial update -, mNeedUpdateNames(false) -, mLITUpdateTimer(NULL) +, mDirty(true) +, mNeedUpdateNames(false) // to force initial update , mShowIcons(true) , mShowInfoBtn(p.show_info_btn) , mShowProfileBtn(p.show_profile_btn) , mShowSpeakingIndicator(p.show_speaking_indicator) , mShowPermissions(p.show_permissions_granted) , mShowCompleteName(false) +, mLITUpdateTimer(nullptr) +, mContextMenu(nullptr) { setCommitOnSelectionChange(true); @@ -504,7 +504,7 @@ BOOL LLAvatarList::handleMouseUp( S32 x, S32 y, MASK mask ) { if(hasMouseCapture()) { - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); } return LLFlatListViewEx::handleMouseUp(x, y, mask); diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 7b57b2fad77c4996c41ad2f3361d8194832e817e..72995788c6f275da806a79de5cfa987e9a96ee35 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -62,11 +62,11 @@ public: LLAvatarList(const Params&); virtual ~LLAvatarList(); - virtual void draw(); // from LLView + void draw() override; // from LLView - virtual void clear(); + void clear() override; - virtual void setVisible(BOOL visible); + void setVisible(BOOL visible) override; void setNameFilter(const std::string& filter); void setDirty(bool val = true, bool force_refresh = false); @@ -85,10 +85,10 @@ public: bool getIconsVisible() const { return mShowIcons; } const std::string getIconParamName() const{return mIconParamName;} std::string getAvatarName(LLAvatarName av_name); - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; // Return true if filter has at least one match. bool filterHasMatches(); @@ -97,7 +97,7 @@ public: boost::signals2::connection setItemDoubleClickCallback(const mouse_signal_t::slot_type& cb); - virtual S32 notifyParent(const LLSD& info); + S32 notifyParent(const LLSD& info) override; void addAvalineItem(const LLUUID& item_id, const LLUUID& session_id, const std::string& item_name); void handleDisplayNamesOptionChanged(); @@ -155,7 +155,7 @@ public: LLAvatarItemComparator() {}; virtual ~LLAvatarItemComparator() {}; - virtual bool compare(const LLPanel* item1, const LLPanel* item2) const; + bool compare(const LLPanel* item1, const LLPanel* item2) const override; protected: @@ -177,7 +177,7 @@ public: virtual ~LLAvatarItemNameComparator() {}; protected: - virtual bool doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const; + bool doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const override; }; class LLAvatarItemAgentOnTopComparator : public LLAvatarItemNameComparator @@ -189,7 +189,7 @@ public: virtual ~LLAvatarItemAgentOnTopComparator() {}; protected: - virtual bool doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const; + bool doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const override; }; /** @@ -207,7 +207,7 @@ public: */ LLAvalineListItem(bool hide_number = true); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /*virtual*/ void setName(const std::string& name); diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 20eaac372fabcf70e6b66563e0d411e0e801b7f3..f71b6cb3b5ecab5ddfea8e6859deb2aa1a9c062c 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -64,28 +64,28 @@ LLAvatarListItem::Params::Params() LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) : LLPanel(), LLFriendObserver(), - mAvatarIcon(NULL), - mAvatarName(NULL), - mDistance(nullptr), - mLastInteractionTime(NULL), - mIconPermissionOnline(NULL), - mIconPermissionMap(NULL), - mIconPermissionEditMine(NULL), - mIconPermissionEditTheirs(NULL), - mIconPermissionMapTheirs(NULL), - mIconPermissionOnlineTheirs(NULL), + mSpeakingIndicator(nullptr), + mAvatarIcon(nullptr), + mIconPermissionOnline(nullptr), + mIconPermissionMap(nullptr), + mIconPermissionEditMine(nullptr), + mIconPermissionEditTheirs(nullptr), + mIconPermissionMapTheirs(nullptr), + mIconPermissionOnlineTheirs(nullptr), mIconHovered(nullptr), - mSpeakingIndicator(NULL), - mInfoBtn(NULL), - mProfileBtn(NULL), + mAvatarName(nullptr), + mDistance(nullptr), + mLastInteractionTime(nullptr), + mInfoBtn(nullptr), + mProfileBtn(nullptr), mOnlineStatus(E_UNKNOWN), mShowInfoBtn(true), mShowProfileBtn(true), mShowPermissions(false), - mShowCompleteName(false), mHovered(false), - mAvatarNameCacheConnection(), - mGreyOutUsername("") + mShowCompleteName(false), + mGreyOutUsername(""), + mAvatarNameCacheConnection() { if (not_from_ui_factory) { @@ -708,7 +708,7 @@ bool LLAvatarListItem::showPermissions(bool visible) mIconPermissionMapTheirs->setVisible(false); } - return NULL != relation; + return nullptr != relation; } LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_index) diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 35c17f7e47ac38db2342af58edacbccd0c7dfb6d..c9f40701ce54c5f218504362aea7f9b74ea1c08b 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -77,17 +77,17 @@ public: LLAvatarListItem(bool not_from_ui_factory = true); virtual ~LLAvatarListItem(); - virtual BOOL postBuild(); + BOOL postBuild() override; /** * Processes notification from speaker indicator to update children when indicator's visibility is changed. */ - virtual void onVisibilityChange ( BOOL new_visibility ); // <alchemy/> - virtual S32 notifyParent(const LLSD& info); - virtual void onMouseLeave(S32 x, S32 y, MASK mask); - virtual void onMouseEnter(S32 x, S32 y, MASK mask); - virtual void setValue(const LLSD& value); - virtual void changed(U32 mask); // from LLFriendObserver + void onVisibilityChange ( BOOL new_visibility ) override; // <alchemy/> + S32 notifyParent(const LLSD& info) override; + void onMouseLeave(S32 x, S32 y, MASK mask) override; + void onMouseEnter(S32 x, S32 y, MASK mask) override; + void setValue(const LLSD& value) override; + void changed(U32 mask) override; // from LLFriendObserver void setOnline(bool online); void updateAvatarName(); // re-query the name cache @@ -116,7 +116,7 @@ public: void onInfoBtnClick(); void onProfileBtnClick(); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; protected: /** diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index d317a37f48c2fff280635f0c24914c0810632f0a..20766888d1d2a3378504c9efc968951664b6c6f6 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -665,7 +665,7 @@ bool LLAvatarPropertiesProcessor::isPendingRequest(const LLUUID& avatar_id, EAva if (it == mRequestTimestamps.end()) return false; // We found a request, check if it has timed out - U32 now = time(NULL); + U32 now = time(nullptr); const U32 REQUEST_EXPIRE_SECS = 5; U32 expires = it->second + REQUEST_EXPIRE_SECS; @@ -679,7 +679,7 @@ bool LLAvatarPropertiesProcessor::isPendingRequest(const LLUUID& avatar_id, EAva void LLAvatarPropertiesProcessor::addPendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type) { timestamp_map_t::key_type key = std::make_pair(avatar_id, type); - U32 now = time(NULL); + U32 now = time(nullptr); // Add or update existing (expired) request mRequestTimestamps[ key ] = now; } diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 4fff18da649fd9505c39722bce690117a1c561f9..d068c430f7645980b94ff3b154b40cc8ff02a15d 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -234,7 +234,7 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro(std::string url, U LLSD report = LLSD::emptyMap(); report[KEY_AGENTS] = agents; - regionp = NULL; + regionp = nullptr; LLSD result = httpAdapter->postAndSuspend(httpRequest, url, report); regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle); diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index e729324e3d971d8e96a95700ae3fb1b3fcd387cf..91359e9b31fb15f59281ab775716ed05468e1a49 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -72,8 +72,8 @@ mLatestOverLimitPct(0.0f), mShowOverLimitAgents(false), mNotifyOutfitLoading(false), mLastCofVersion(LLViewerInventoryCategory::VERSION_UNKNOWN), -mLastOutfitRezStatus(-1), -mLastSkeletonSerialNum(-1) +mLastSkeletonSerialNum(-1), +mLastOutfitRezStatus(-1) { mPopUpDelayTimer.resetWithExpiry(OVER_LIMIT_UPDATE_DELAY); } @@ -137,7 +137,7 @@ void LLAvatarRenderNotifier::displayNotification(bool show_over_limit) notification_name = "AgentComplexity"; } - if (mNotificationPtr != NULL && mNotificationPtr->getName() != notification_name) + if (mNotificationPtr != nullptr && mNotificationPtr->getName() != notification_name) { // since unique tag works only for same notification, // old notification needs to be canceled manually @@ -160,7 +160,7 @@ void LLAvatarRenderNotifier::displayNotification(bool show_over_limit) bool LLAvatarRenderNotifier::isNotificationVisible() { - return mNotificationPtr != NULL && mNotificationPtr->isActive(); + return mNotificationPtr != nullptr && mNotificationPtr->isActive(); } void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLimit) @@ -384,7 +384,7 @@ void LLHUDRenderNotifier::updateNotificationHUD(hud_complexity_list_t complexity bool LLHUDRenderNotifier::isNotificationVisible() { - return mHUDNotificationPtr != NULL && mHUDNotificationPtr->isActive(); + return mHUDNotificationPtr != nullptr && mHUDNotificationPtr->isActive(); } // private static diff --git a/indra/newview/llblockedlistitem.h b/indra/newview/llblockedlistitem.h index e28733134bef4a5583579871ec32f6a4b1b8e387..d2fee46423abfaa0322b2e8d17c4710c9fe4270f 100644 --- a/indra/newview/llblockedlistitem.h +++ b/indra/newview/llblockedlistitem.h @@ -49,15 +49,15 @@ class LLBlockedListItem : public LLPanel public: LLBlockedListItem(const LLMute* item); - virtual BOOL postBuild(); + BOOL postBuild() override; - void onMouseEnter(S32 x, S32 y, MASK mask); - void onMouseLeave(S32 x, S32 y, MASK mask); + void onMouseEnter(S32 x, S32 y, MASK mask) override; + void onMouseLeave(S32 x, S32 y, MASK mask) override; - virtual void setValue(const LLSD& value); + void setValue(const LLSD& value) override; void highlightName(const std::string& highlited_text); - const std::string& getName() const { return mItemName; } + const std::string& getName() const override { return mItemName; } const LLMute::EType& getType() const { return mMuteType; } const LLUUID& getUUID() const { return mItemID; } diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp index 0b2c734c5e6e23a6184ba959bb722ed707dcc30a..42a9e3935b50d3959ed98f82055e1de2baec3199 100644 --- a/indra/newview/llblocklist.cpp +++ b/indra/newview/llblocklist.cpp @@ -307,7 +307,7 @@ bool LLBlockList::isActionEnabled(const LLSD& userdata) if ("unblock_item" == command_name) { - action_enabled = getSelectedItem() != NULL; + action_enabled = getSelectedItem() != nullptr; } return action_enabled; diff --git a/indra/newview/llblocklist.h b/indra/newview/llblocklist.h index ac0729c61051e91536639ea11f70530be45d19ea..cda720b391d74f17f2114ac08fc4cd18dda90c2b 100644 --- a/indra/newview/llblocklist.h +++ b/indra/newview/llblocklist.h @@ -54,13 +54,13 @@ public: LLBlockList(const Params& p); virtual ~LLBlockList(); - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; LLToggleableMenu* getContextMenu() const { return mContextMenu.get(); } LLBlockedListItem* getBlockedItem() const; - virtual void onChange() { } - virtual void onChangeDetailed(const LLMute& ); - virtual void draw(); + void onChange() override { } + void onChangeDetailed(const LLMute& ) override; + void draw() override; void setNameFilter(const std::string& filter); void sortByName(); @@ -115,7 +115,7 @@ public: LLBlockListItemComparator() {}; virtual ~LLBlockListItemComparator() {}; - virtual bool compare(const LLPanel* item1, const LLPanel* item2) const; + bool compare(const LLPanel* item1, const LLPanel* item2) const override; protected: @@ -136,7 +136,7 @@ public: protected: - virtual bool doCompare(const LLBlockedListItem* blocked_item1, const LLBlockedListItem* blocked_item2) const; + bool doCompare(const LLBlockedListItem* blocked_item1, const LLBlockedListItem* blocked_item2) const override; }; /* @@ -153,7 +153,7 @@ public: protected: - virtual bool doCompare(const LLBlockedListItem* blocked_item1, const LLBlockedListItem* blocked_item2) const; + bool doCompare(const LLBlockedListItem* blocked_item1, const LLBlockedListItem* blocked_item2) const override; }; #endif /* LLBLOCKLIST_H_ */ diff --git a/indra/newview/llbuycurrencyhtml.cpp b/indra/newview/llbuycurrencyhtml.cpp index 3eca33bff7f7712dd3866a9fad54e1734f8f0816..64a98d99e64eb44aef84ef01d5f99be5a003ce7d 100644 --- a/indra/newview/llbuycurrencyhtml.cpp +++ b/indra/newview/llbuycurrencyhtml.cpp @@ -45,7 +45,7 @@ public: // requests will be throttled from a non-trusted browser LLBuyCurrencyHTMLHandler() : LLCommandHandler( "buycurrencyhtml", UNTRUSTED_ALLOW ) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { std::string action( "" ); if ( params.size() >= 1 ) diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 0cc402d34070e11039a73bc3560897f882921323..c4b49f347a48506b17404d1e162e56aa36acaa00 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -664,7 +664,7 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) if(count > 0) { LLUUID agent_id; - const LLRelationship* info = NULL; + const LLRelationship* info = nullptr; LLUUID tracking_id; if(mTrackingData) { diff --git a/indra/newview/llcallingcard.h b/indra/newview/llcallingcard.h index cf50828d98d8c525dd24f51116db4a6fe22d6530..e025994c1d81979f8ad81b84c7d231663e5f0dca 100644 --- a/indra/newview/llcallingcard.h +++ b/indra/newview/llcallingcard.h @@ -209,7 +209,7 @@ class LLCollectProxyBuddies : public LLRelationshipFunctor public: LLCollectProxyBuddies() {} virtual ~LLCollectProxyBuddies() {} - virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); + bool operator()(const LLUUID& buddy_id, LLRelationship* buddy) override; typedef std::set<LLUUID> buddy_list_t; buddy_list_t mProxy; }; @@ -220,7 +220,7 @@ class LLCollectMappableBuddies : public LLRelationshipFunctor public: LLCollectMappableBuddies() {} virtual ~LLCollectMappableBuddies() {} - virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); + bool operator()(const LLUUID& buddy_id, LLRelationship* buddy) override; typedef std::map<LLUUID, std::string> buddy_map_t; buddy_map_t mMappable; std::string mFullName; @@ -232,7 +232,7 @@ class LLCollectOnlineBuddies : public LLRelationshipFunctor public: LLCollectOnlineBuddies() {} virtual ~LLCollectOnlineBuddies() {} - virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); + bool operator()(const LLUUID& buddy_id, LLRelationship* buddy) override; typedef std::map<LLUUID, std::string> buddy_map_t; buddy_map_t mOnline; std::string mFullName; @@ -245,7 +245,7 @@ class LLCollectAllBuddies : public LLRelationshipFunctor public: LLCollectAllBuddies() {} virtual ~LLCollectAllBuddies() {} - virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); + bool operator()(const LLUUID& buddy_id, LLRelationship* buddy) override; typedef std::map<LLUUID, std::string> buddy_map_t; buddy_map_t mOnline; buddy_map_t mOffline; diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index e5b735bfbc9c968eb5fc33a8b2c9a06cbd8689d4..6004ebe6638175535b7f67521e062a98f3af7b34 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -49,7 +49,7 @@ LLChannelManager::LLChannelManager() { LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLChannelManager::onLoginCompleted, this)); mChannelList.clear(); - mStartUpChannel = NULL; + mStartUpChannel = nullptr; if(!gViewerWindow) { @@ -153,7 +153,7 @@ void LLChannelManager::onStartUpToastClose() mStartUpChannel->setVisible(FALSE); mStartUpChannel->closeStartUpToast(); removeChannelByID(LLUUID(gSavedSettings.getString("StartUpChannelUUID"))); - mStartUpChannel = NULL; + mStartUpChannel = nullptr; } // set StartUp Toast Flag to allow all other channels to show incoming toasts @@ -165,7 +165,7 @@ void LLChannelManager::onStartUpToastClose() LLScreenChannelBase* LLChannelManager::addChannel(LLScreenChannelBase* channel) { if(!channel) - return 0; + return nullptr; ChannelElem new_elem; new_elem.id = channel->getChannelID(); @@ -204,7 +204,7 @@ LLScreenChannelBase* LLChannelManager::findChannelByID(const LLUUID& id) return (*it).channel.get(); } - return NULL; + return nullptr; } //-------------------------------------------------------------------------- @@ -235,7 +235,7 @@ void LLChannelManager::killToastsFromChannel(const LLUUID& channel_id, const LLS LLScreenChannel * screen_channel = dynamic_cast<LLScreenChannel*> (findChannelByID(channel_id)); - if (screen_channel != NULL) + if (screen_channel != nullptr) { screen_channel->killMatchedToasts(matcher); } @@ -248,7 +248,7 @@ LLNotificationsUI::LLScreenChannel* LLChannelManager::getNotificationScreenChann (LLNotificationsUI::LLChannelManager::getInstance()-> findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); - if (channel == NULL) + if (channel == nullptr) { LL_WARNS() << "Can't find screen channel by NotificationChannelUUID" << LL_ENDL; llassert(!"Can't find screen channel by NotificationChannelUUID"); diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index c215d8936ecb290556b7f0ed9c1411cd8ea78625..76fbf9f846811d07519821251cb562c23644b4ac 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -51,7 +51,7 @@ class LLChatBarGestureObserver : public LLGestureManagerObserver public: LLChatBarGestureObserver(LLChatBar* chat_barp) : mChatBar(chat_barp){} virtual ~LLChatBarGestureObserver() {} - virtual void changed() { mChatBar->refreshGestures(); } + void changed() override { mChatBar->refreshGestures(); } private: LLChatBar* mChatBar; }; @@ -66,7 +66,7 @@ LLChatBar::LLChatBar(const LLSD& key) mGestureLabelTimer(), mIsBuilt(FALSE), mGestureCombo(nullptr), - mObserver(NULL) + mObserver(nullptr) { mCommitCallbackRegistrar.add("Chatbar.Shout", boost::bind(&LLChatBar::sendChat, this, CHAT_TYPE_SHOUT)); mCommitCallbackRegistrar.add("Chatbar.Whisper", boost::bind(&LLChatBar::sendChat, this, CHAT_TYPE_WHISPER)); @@ -78,7 +78,7 @@ LLChatBar::~LLChatBar() { LLGestureMgr::instance().removeObserver(mObserver); delete mObserver; - mObserver = NULL; + mObserver = nullptr; // LLView destructor cleans up children } @@ -479,7 +479,7 @@ void LLChatBar::onCommitGesture(LLUICtrl* ctrl) } } mGestureLabelTimer.start(); - if (mGestureCombo != NULL) + if (mGestureCombo != nullptr) { // free focus back to chat bar mGestureCombo->setFocus(FALSE); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 425136becc7602cfd91b36b308f378b6930a1fa6..4191e93ef243659f79995d6bcb874684b338c651 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -76,7 +76,7 @@ public: // requests will be throttled from a non-trusted browser LLObjectIMHandler() : LLCommandHandler("objectim", UNTRUSTED_THROTTLE) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { if (params.size() < 1) { @@ -106,17 +106,17 @@ class LLChatHistoryHeader: public LLPanel public: LLChatHistoryHeader() : LLPanel(), - mInfoCtrl(NULL), mPopupMenuHandleAvatar(), mPopupMenuHandleObject(), + mInfoCtrl(nullptr), mAvatarID(), mSourceType(CHAT_SOURCE_UNKNOWN), mFrom(), mSessionID(), mMinUserNameWidth(0), - mUserNameFont(NULL), - mUserNameTextBox(NULL), - mTimeBoxTextBox(NULL), + mUserNameFont(nullptr), + mUserNameTextBox(nullptr), + mTimeBoxTextBox(nullptr), mAvatarNameCacheConnection() {} @@ -147,7 +147,7 @@ public: } } - BOOL handleMouseUp(S32 x, S32 y, MASK mask) + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override { return LLPanel::handleMouseUp(x,y,mask); } @@ -296,7 +296,7 @@ public: } } - BOOL postBuild() + BOOL postBuild() override { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable; @@ -346,7 +346,7 @@ public: return child->pointInView(local_x, local_y); } - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override { if(pointInChild("avatar_icon",x,y) || pointInChild("user_name",x,y)) { @@ -517,7 +517,7 @@ public: } } - /*virtual*/ void draw() + /*virtual*/ void draw() override { LLTextBox* user_name = mUserNameTextBox; //getChild<LLTextBox>("user_name"); LLTextBox* time_box = mTimeBoxTextBox; //getChild<LLTextBox>("time_box"); @@ -733,6 +733,8 @@ private: LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) : LLUICtrl(p), + mIsLastMessageFromLog(false), + mNotifyAboutUnreadMsg(p.notify_unread_msg), mMessageHeaderFilename(p.message_header), mMessageSeparatorFilename(p.message_separator), mLeftTextPad(p.left_text_pad), @@ -742,9 +744,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) mTopSeparatorPad(p.top_separator_pad), mBottomSeparatorPad(p.bottom_separator_pad), mTopHeaderPad(p.top_header_pad), - mBottomHeaderPad(p.bottom_header_pad), - mIsLastMessageFromLog(false), - mNotifyAboutUnreadMsg(p.notify_unread_msg) + mBottomHeaderPad(p.bottom_header_pad) { LLTextEditor::Params editor_params(p); editor_params.rect = getLocalRect(); @@ -835,7 +835,7 @@ void LLChatHistory::initFromParams(const LLChatHistory::Params& p) LLView* LLChatHistory::getSeparator() { - LLPanel* separator = LLUICtrlFactory::getInstance()->createFromFile<LLPanel>(mMessageSeparatorFilename, NULL, LLPanel::child_registry_t::instance()); + LLPanel* separator = LLUICtrlFactory::getInstance()->createFromFile<LLPanel>(mMessageSeparatorFilename, nullptr, LLPanel::child_registry_t::instance()); return separator; } @@ -1055,7 +1055,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL else // showing timestamp and name in the expanded mode { prependNewLineState = false; - LLView* view = NULL; + LLView* view = nullptr; LLInlineViewSegment::Params p; p.force_newline = true; p.left_pad = mLeftWidgetPad; @@ -1126,7 +1126,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (create_toast) { LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId); - if (notification != NULL) + if (notification != nullptr) { LLIMToastNotifyPanel* notify_box = new LLIMToastNotifyPanel( notification, chat.mSessionID, LLRect::null, !use_plain_text_chat_history, mEditor); diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index 44736a04895d7cd81257265c166a51e0c02b6ebe..37bfbb4c77285d87e7e225b6b0c5534aa89b4a84 100644 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -82,7 +82,7 @@ class LLChatHistory : public LLUICtrl LLChatHistory(const Params&); friend class LLUICtrlFactory; - /*virtual*/ void draw(); + /*virtual*/ void draw() override; /** * Redefinition of LLTextEditor::updateTextRect() to considerate text * left/right padding params. @@ -104,7 +104,7 @@ class LLChatHistory : public LLUICtrl LLView* getHeader(const LLChat& chat,const LLStyle::Params& style_params, const LLSD& args); public: ~LLChatHistory(); - LLSD getValue() const; + LLSD getValue() const override; void initFromParams(const Params&); /** @@ -119,7 +119,7 @@ class LLChatHistory : public LLUICtrl * @param input_append_params - font style. */ void appendMessage(const LLChat& chat, const LLSD &args = LLSD(), const LLStyle::Params& input_append_params = LLStyle::Params()); - /*virtual*/ void clear(); + /*virtual*/ void clear() override; private: std::string mLastFromName; diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 6f9fc66c24549c1df463a60d47c3ab7a578ba5ab..110dfdfb4511c540ef70a2398c5d1933370e6500 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -69,7 +69,7 @@ class LLObjectHandler : public LLCommandHandler public: LLObjectHandler() : LLCommandHandler("object", UNTRUSTED_BLOCK) { } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { if (params.size() < 2) return false; diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h index 7d35a0538bc5f2104cc39e6c90f2e026a1444d4b..66d6fca4962c0af748e2203543610bbb745f5e9f 100644 --- a/indra/newview/llchatitemscontainerctrl.h +++ b/indra/newview/llchatitemscontainerctrl.h @@ -62,22 +62,22 @@ public: bool canAddText (); - void onMouseLeave (S32 x, S32 y, MASK mask); - void onMouseEnter (S32 x, S32 y, MASK mask); - BOOL handleMouseDown (S32 x, S32 y, MASK mask); - BOOL handleMouseUp (S32 x, S32 y, MASK mask); + void onMouseLeave (S32 x, S32 y, MASK mask) override; + void onMouseEnter (S32 x, S32 y, MASK mask) override; + BOOL handleMouseDown (S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp (S32 x, S32 y, MASK mask) override; - virtual BOOL postBuild(); + BOOL postBuild() override; - void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); + void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE) override; void setHeaderVisibility(EShowItemHeader e); - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; virtual void init(LLSD& data); virtual void addMessage(LLSD& data); - virtual void draw(); + void draw() override; //*TODO REMOVE, why a dup of getFromID? const LLUUID& messageID() const { return mFromID;} diff --git a/indra/newview/llchatmsgbox.cpp b/indra/newview/llchatmsgbox.cpp index 19f12d2c7956d06546f6ff5d0679cc7c4f272e65..ae1b9cbd66001996cb98fdad7dfa8cf1365e1c5f 100644 --- a/indra/newview/llchatmsgbox.cpp +++ b/indra/newview/llchatmsgbox.cpp @@ -40,17 +40,17 @@ class ChatSeparator : public LLTextSegment public: ChatSeparator(S32 start, S32 end) : LLTextSegment(start, end), - mEditor(NULL) + mEditor(nullptr) {} - /*virtual*/ void linkToDocument(class LLTextBase* editor) + /*virtual*/ void linkToDocument(class LLTextBase* editor) override { mEditor = editor; } - /*virtual*/ void unlinkFromDocument(class LLTextBase* editor) + /*virtual*/ void unlinkFromDocument(class LLTextBase* editor) override { - mEditor = NULL; + mEditor = nullptr; } /*virtual*/ S32 getWidth(S32 first_char, S32 num_chars) const @@ -58,7 +58,7 @@ public: return mEditor->getDocumentView()->getRect().getWidth(); } - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) override { gl_line_2d((S32)(draw_rect.mLeft + 5), (S32)draw_rect.getCenterY(), (S32)(draw_rect.mRight - 5), (S32)draw_rect.getCenterY(), LLColor4::grey); return draw_rect.getWidth(); diff --git a/indra/newview/llchatutilities.cpp b/indra/newview/llchatutilities.cpp index 98cbb04629bc530b8b88bcf01406f5fff49f513f..f642f746d46d811669bdc56f9adcd8d7a8708e10 100644 --- a/indra/newview/llchatutilities.cpp +++ b/indra/newview/llchatutilities.cpp @@ -173,7 +173,7 @@ LLWString LLChatUtilities::stripChannelNumber(const LLWString &mesg, S32* channe pos++; } - sLastSpecialChatChannel = strtol(wstring_to_utf8str(channel_string).c_str(), NULL, 10); + sLastSpecialChatChannel = strtol(wstring_to_utf8str(channel_string).c_str(), nullptr, 10); *channel = sLastSpecialChatChannel; return mesg.substr(pos, mesg.length() - pos); } @@ -252,7 +252,7 @@ public: // Your code here bool handle(const LLSD& tokens, const LLSD& query_map, - LLMediaCtrl* web) + LLMediaCtrl* web) override { bool retval = false; // Need at least 2 tokens to have a valid message. diff --git a/indra/newview/llcheatcodes.cpp b/indra/newview/llcheatcodes.cpp index 99f419bf18fcaac8294c1c593bcb22288f8685f3..12a914fb30de1b5ffffb4dedfc2b71b26e5cc9a9 100644 --- a/indra/newview/llcheatcodes.cpp +++ b/indra/newview/llcheatcodes.cpp @@ -45,7 +45,7 @@ class LLXyzzyHandler : public LLCommandHandler public: LLXyzzyHandler() : LLCommandHandler("xyzzy", UNTRUSTED_THROTTLE) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { LLFloaterIMNearbyChat* nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"); if (nearby_chat) @@ -63,7 +63,7 @@ class LLDyeMenuHandler : public LLCommandHandler public: LLDyeMenuHandler() : LLCommandHandler("dyemenu", UNTRUSTED_THROTTLE) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { if (params.size() != 1) return false; diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 140c63718968575b6081855589246066ab6ec3dd..c02ddd5f8b6ee21daa89e312bd4f87041c9d80ca 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -64,11 +64,11 @@ LLSysWellChiclet::Params::Params() LLSysWellChiclet::LLSysWellChiclet(const Params& p) : LLChiclet(p) - , mButton(NULL) + , mButton(nullptr) , mCounter(0) , mMaxDisplayedCount(p.max_displayed_count) , mIsNewMessagesState(false) - , mFlashToLitTimer(NULL) + , mFlashToLitTimer(nullptr) , mContextMenuHandle() { LLButton::Params button_params = p.button; @@ -315,11 +315,11 @@ void LLChiclet::setValue(const LLSD& value) LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) : LLChiclet(p) +, mPopupMenu(nullptr) , mShowSpeaker(false) , mDefaultWidth(p.rect().getWidth()) -, mNewMessagesIcon(NULL) -, mChicletButton(NULL) -, mPopupMenu(NULL) +, mNewMessagesIcon(nullptr) +, mChicletButton(nullptr) { } @@ -426,9 +426,9 @@ LLChicletPanel::Params::Params() LLChicletPanel::LLChicletPanel(const Params&p) : LLPanel(p) -, mScrollArea(NULL) -, mLeftScrollButton(NULL) -, mRightScrollButton(NULL) +, mLeftScrollButton(nullptr) +, mRightScrollButton(nullptr) +, mScrollArea(nullptr) , mChicletPadding(p.chiclet_padding) , mScrollingOffset(p.scrolling_offset) , mScrollButtonHPad(p.scroll_button_hpad) @@ -478,7 +478,7 @@ void LLChicletPanel::objectChicletCallback(const LLSD& data) for (iter = chiclets.begin(); iter != chiclets.end(); iter++) { LLIMChiclet* chiclet = dynamic_cast<LLIMChiclet*>(*iter); - if (chiclet != NULL) + if (chiclet != nullptr) { chiclet->setShowNewMessagesIcon(new_message); } @@ -1002,7 +1002,7 @@ bool LLChicletPanel::isAnyIMFloaterDoked() { LLFloaterIMSession* im_floater = LLFloaterReg::findTypedInstance<LLFloaterIMSession>( "impanel", (*it)->getSessionId()); - if (im_floater != NULL && im_floater->getVisible() + if (im_floater != nullptr && im_floater->getVisible() && !im_floater->isMinimized() && im_floater->isDocked()) { res = true; @@ -1056,15 +1056,15 @@ void LLChicletInvOfferIconCtrl::setValue(const LLSD& value ) ////////////////////////////////////////////////////////////////////////// LLScriptChiclet::Params::Params() - : icon("icon") - , chiclet_button("chiclet_button") + : chiclet_button("chiclet_button") + , icon("icon") , new_message_icon("new_message_icon") { } LLScriptChiclet::LLScriptChiclet(const Params&p) : LLIMChiclet(p) - , mChicletIconCtrl(NULL) + , mChicletIconCtrl(nullptr) { LLButton::Params button_params = p.chiclet_button; mChicletButton = LLUICtrlFactory::create<LLButton>(button_params); @@ -1124,15 +1124,15 @@ void LLScriptChiclet::createPopupMenu() static const std::string INVENTORY_USER_OFFER ("UserGiveItem"); LLInvOfferChiclet::Params::Params() - : icon("icon") - , chiclet_button("chiclet_button") + : chiclet_button("chiclet_button") + , icon("icon") , new_message_icon("new_message_icon") { } LLInvOfferChiclet::LLInvOfferChiclet(const Params&p) : LLIMChiclet(p) - , mChicletIconCtrl(NULL) + , mChicletIconCtrl(nullptr) { LLButton::Params button_params = p.chiclet_button; mChicletButton = LLUICtrlFactory::create<LLButton>(button_params); diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index cfb735971e7bd580445b0c563e0cfd51b46a3874..df8bbebe85a712acd0cf01469c136797dfa57575 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -69,17 +69,17 @@ public: * Returns width, required to display amount of notifications in text form. * Width is the only valid value. */ - /*virtual*/ LLRect getRequiredRect(); + /*virtual*/ LLRect getRequiredRect() override; /** * Sets number of notifications using LLSD */ - /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void setValue(const LLSD& value) override; /** * Returns number of notifications wrapped in LLSD */ - /*virtual*/ LLSD getValue() const; + /*virtual*/ LLSD getValue() const override; protected: @@ -138,7 +138,7 @@ public: /** * Sets icon, if value is LLUUID::null - default icon will be set. */ - virtual void setValue(const LLSD& value ); + void setValue(const LLSD& value ) override; protected: @@ -199,12 +199,12 @@ public: /** * Sets IM Session id using LLSD */ - /*virtual*/ LLSD getValue() const; + /*virtual*/ LLSD getValue() const override; /** * Returns IM Session id using LLSD */ - /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void setValue(const LLSD& value) override; protected: @@ -214,7 +214,7 @@ protected: /** * Notifies subscribers about click on chiclet. */ - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; /** * Notifies subscribers about chiclet size changed event. @@ -257,7 +257,7 @@ public: /** * It is used for default setting up of chicklet:click handler, etc. */ - BOOL postBuild(); + BOOL postBuild() override; /** * Sets IM session name. This name will be displayed in chiclet tooltip. @@ -303,7 +303,7 @@ public: /** * Displays popup menu. */ - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; void hidePopupMenu(); @@ -379,12 +379,12 @@ public: Params(); }; - /*virtual*/ void setSessionId(const LLUUID& session_id); + /*virtual*/ void setSessionId(const LLUUID& session_id) override; /** * Toggle script floater */ - /*virtual*/ void onMouseDown(); + /*virtual*/ void onMouseDown() override; protected: @@ -394,7 +394,7 @@ protected: /** * Creates chiclet popup menu. */ - virtual void createPopupMenu(); + void createPopupMenu() override; /** * Processes clicks on chiclet popup menu. @@ -424,12 +424,12 @@ public: Params(); }; - /*virtual*/ void setSessionId(const LLUUID& session_id); + /*virtual*/ void setSessionId(const LLUUID& session_id) override; /** * Toggle script floater */ - /*virtual*/ void onMouseDown(); + /*virtual*/ void onMouseDown() override; protected: LLInvOfferChiclet(const Params&); @@ -438,7 +438,7 @@ protected: /** * Creates chiclet popup menu. */ - virtual void createPopupMenu(); + void createPopupMenu() override; /** * Processes clicks on chiclet popup menu. @@ -507,7 +507,7 @@ protected: /** * Displays menu. */ - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; virtual void createMenu() = 0; @@ -545,8 +545,8 @@ protected: static bool filterNotification(LLNotificationPtr notify); // connect counter updaters to the corresponding signals - /*virtual*/ void onAdd(LLNotificationPtr p) { mChiclet->setCounter(++mChiclet->mUreadSystemNotifications); } - /*virtual*/ void onDelete(LLNotificationPtr p) { mChiclet->setCounter(--mChiclet->mUreadSystemNotifications); } + /*virtual*/ void onAdd(LLNotificationPtr p) override { mChiclet->setCounter(++mChiclet->mUreadSystemNotifications); } + /*virtual*/ void onDelete(LLNotificationPtr p) override { mChiclet->setCounter(--mChiclet->mUreadSystemNotifications); } LLNotificationChiclet* const mChiclet; }; @@ -568,7 +568,7 @@ protected: /** * Creates menu. */ - /*virtual*/ void createMenu(); + /*virtual*/ void createMenu() override; /*virtual*/ void setCounter(S32 counter); S32 mUreadSystemNotifications; @@ -659,7 +659,7 @@ public: boost::signals2::connection setChicletClickedCallback( const commit_callback_t& cb); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /** * Handler for the Voice Client's signal. Finds a corresponding chiclet and toggles its SpeakerControl @@ -669,13 +669,13 @@ public: /** * Reshapes controls and rearranges chiclets if needed. */ - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE ); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE ) override; - /*virtual*/ void draw(); + /*virtual*/ void draw() override; S32 getMinWidth() const { return mMinWidth; } - /*virtual*/ S32 notifyParent(const LLSD& info); + /*virtual*/ S32 notifyParent(const LLSD& info) override; /** * Toggle chiclet by session id ON and toggle OFF all other chiclets. @@ -774,7 +774,7 @@ protected: /** * Callback for mouse wheel scrolled, calls scrollRight() or scrollLeft() */ - BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; /** * Notifies subscribers about click on chiclet. @@ -828,13 +828,13 @@ T* LLChicletPanel::createChiclet(const LLUUID& session_id, S32 index) if(!chiclet) { LL_WARNS() << "Could not create chiclet" << LL_ENDL; - return NULL; + return nullptr; } if(!addChiclet(chiclet, index)) { delete chiclet; LL_WARNS() << "Could not add chiclet to chiclet panel" << LL_ENDL; - return NULL; + return nullptr; } if (!isAnyIMFloaterDoked()) @@ -858,7 +858,7 @@ T* LLChicletPanel::findChiclet(const LLUUID& im_session_id) { if(im_session_id.isNull()) { - return NULL; + return nullptr; } chiclet_list_t::const_iterator it = mChicletList.begin(); @@ -879,14 +879,14 @@ T* LLChicletPanel::findChiclet(const LLUUID& im_session_id) return result; } } - return NULL; + return nullptr; } template<class T> T* LLChicletPanel::getChiclet(S32 index) { if(index < 0 || index >= getChicletCount()) { - return NULL; + return nullptr; } LLChiclet* chiclet = mChicletList[index]; diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp index 33048f6b05e2ed4dabfb7097a3a38bb52b3501e2..fa25499ffeac501265ae2e9b39f3c11c1f7b4a5e 100644 --- a/indra/newview/llchicletbar.cpp +++ b/indra/newview/llchicletbar.cpp @@ -41,8 +41,8 @@ namespace } LLChicletBar::LLChicletBar() -: mChicletPanel(NULL), - mToolbarStack(NULL) +: mChicletPanel(nullptr), + mToolbarStack(nullptr) { buildFromFile("panel_chiclet_bar.xml"); } @@ -70,7 +70,7 @@ void LLChicletBar::showWellButton(const std::string& well_name, bool visible) void LLChicletBar::log(LLView* panel, const std::string& descr) { - if (NULL == panel) return; + if (nullptr == panel) return; LLView* layout = panel->getParent(); LL_DEBUGS("Chiclet Bar Rects") << descr << ": " << "panel: " << panel->getName() diff --git a/indra/newview/llchicletbar.h b/indra/newview/llchicletbar.h index 6c521dc1d504f176b0f3cfc367ed10ece092af14..c295b999624f71e32fd2bbba5515000627a39fdc 100644 --- a/indra/newview/llchicletbar.h +++ b/indra/newview/llchicletbar.h @@ -43,11 +43,11 @@ class LLChicletBar public: - BOOL postBuild(); + BOOL postBuild() override; LLChicletPanel* getChicletPanel() { return mChicletPanel; } - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent) override; /** diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 5872c66abd18f7abc8ab75b9461ac58eef84bd37..0cc49891eb4df153c14362e06b76034c49628038 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -137,7 +137,7 @@ public: protected: - /*virtual*/ LLContextMenu* createMenu() + /*virtual*/ LLContextMenu* createMenu() override { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; @@ -163,13 +163,13 @@ protected: LLPanelOutfitEdit * panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*> (LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); - if (panel_outfit_edit != NULL) + if (panel_outfit_edit != nullptr) { panel_outfit_edit->onReplaceMenuItemClicked(item_id); } } - /*virtual*/ LLContextMenu* createMenu() + /*virtual*/ LLContextMenu* createMenu() override { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; @@ -224,7 +224,7 @@ public: } protected: - /*virtual*/ LLContextMenu* createMenu() + /*virtual*/ LLContextMenu* createMenu() override { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; @@ -263,15 +263,15 @@ protected: ////////////////////////////////////////////////////////////////////////// LLCOFWearables::LLCOFWearables() : LLPanel(), - mAttachments(NULL), - mClothing(NULL), - mBodyParts(NULL), - mLastSelectedList(NULL), - mClothingTab(NULL), - mAttachmentsTab(NULL), - mBodyPartsTab(NULL), - mLastSelectedTab(NULL), - mAccordionCtrl(NULL), + mAttachments(nullptr), + mClothing(nullptr), + mBodyParts(nullptr), + mLastSelectedList(nullptr), + mClothingTab(nullptr), + mAttachmentsTab(nullptr), + mBodyPartsTab(nullptr), + mLastSelectedTab(nullptr), + mAccordionCtrl(nullptr), mCOFVersion(-1) { mClothingMenu = new CofClothingContextMenu(this); @@ -484,7 +484,7 @@ void LLCOFWearables::populateAttachmentsAndBodypartsLists(const LLInventoryModel const LLAssetType::EType item_type = item->getType(); if (item_type == LLAssetType::AT_CLOTHING) continue; - LLPanelInventoryListItemBase* item_panel = NULL; + LLPanelInventoryListItemBase* item_panel = nullptr; if (item_type == LLAssetType::AT_OBJECT || item_type == LLAssetType::AT_GESTURE) { item_panel = buildAttachemntListItem(item); @@ -521,15 +521,15 @@ void LLCOFWearables::populateAttachmentsAndBodypartsLists(const LLInventoryModel LLPanelClothingListItem* LLCOFWearables::buildClothingListItem(LLViewerInventoryItem* item, bool first, bool last) { llassert(item); - if (!item) return NULL; + if (!item) return nullptr; LLPanelClothingListItem* item_panel = LLPanelClothingListItem::create(item); - if (!item_panel) return NULL; + if (!item_panel) return nullptr; //updating verbs //we don't need to use permissions of a link but of an actual/linked item if (item->getLinkedItem()) item = item->getLinkedItem(); llassert(item); - if (!item) return NULL; + if (!item) return nullptr; bool allow_modify = item->getPermissions().allowModifyBy(gAgentID); @@ -555,15 +555,15 @@ LLPanelClothingListItem* LLCOFWearables::buildClothingListItem(LLViewerInventory LLPanelBodyPartsListItem* LLCOFWearables::buildBodypartListItem(LLViewerInventoryItem* item) { llassert(item); - if (!item) return NULL; + if (!item) return nullptr; LLPanelBodyPartsListItem* item_panel = LLPanelBodyPartsListItem::create(item); - if (!item_panel) return NULL; + if (!item_panel) return nullptr; //updating verbs //we don't need to use permissions of a link but of an actual/linked item if (item->getLinkedItem()) item = item->getLinkedItem(); llassert(item); - if (!item) return NULL; + if (!item) return nullptr; bool allow_modify = item->getPermissions().allowModifyBy(gAgentID); item_panel->setShowLockButton(!allow_modify); item_panel->setShowEditButton(allow_modify); @@ -579,10 +579,10 @@ LLPanelBodyPartsListItem* LLCOFWearables::buildBodypartListItem(LLViewerInventor LLPanelDeletableWearableListItem* LLCOFWearables::buildAttachemntListItem(LLViewerInventoryItem* item) { llassert(item); - if (!item) return NULL; + if (!item) return nullptr; LLPanelAttachmentListItem* item_panel = LLPanelAttachmentListItem::create(item); - if (!item_panel) return NULL; + if (!item_panel) return nullptr; //setting callbacks //*TODO move that item panel's inner structure disclosing stuff into the panels @@ -654,7 +654,7 @@ bool LLCOFWearables::getSelectedUUIDs(uuid_vec_t& selected_ids) LLPanel* LLCOFWearables::getSelectedItem() { - if (!mLastSelectedList) return NULL; + if (!mLastSelectedList) return nullptr; return mLastSelectedList->getSelectedItem(); } @@ -680,7 +680,7 @@ LLAssetType::EType LLCOFWearables::getExpandedAccordionAssetType() static type_map_t type_map; - if (mAccordionCtrl != NULL) + if (mAccordionCtrl != nullptr) { const LLAccordionCtrlTab* expanded_tab = mAccordionCtrl->getExpandedTab(); @@ -692,7 +692,7 @@ LLAssetType::EType LLCOFWearables::getExpandedAccordionAssetType() LLAssetType::EType LLCOFWearables::getSelectedAccordionAssetType() { - if (mAccordionCtrl != NULL) + if (mAccordionCtrl != nullptr) { const LLAccordionCtrlTab* selected_tab = mAccordionCtrl->getSelectedTab(); @@ -704,7 +704,7 @@ LLAssetType::EType LLCOFWearables::getSelectedAccordionAssetType() void LLCOFWearables::expandDefaultAccordionTab() { - if (mAccordionCtrl != NULL) + if (mAccordionCtrl != nullptr) { mAccordionCtrl->expandDefaultTab(); } diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index 5034085dc11be13ba02db7b616d899d0664a2b44..96cd34dbbf2639a06ed1daa6477bec118fb4389d 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -68,7 +68,7 @@ public: LLCOFWearables(); virtual ~LLCOFWearables(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; LLUUID getSelectedUUID(); bool getSelectedUUIDs(uuid_vec_t& selected_ids); @@ -77,8 +77,8 @@ public: void getSelectedItems(std::vector<LLPanel*>& selected_items) const; /* Repopulate the COF wearables list if the COF category has been changed since the last refresh */ - void refresh(); - void clear(); + void refresh() override; + void clear() override; LLAssetType::EType getExpandedAccordionAssetType(); LLAssetType::EType getSelectedAccordionAssetType(); diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index 4da569c0ba1ab070e9a7d0510478b9092a3b7c9a..85cfd3aa5b31cfad24196d5d6ec5db1682ef4501 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -63,13 +63,13 @@ LLColorSwatchCtrl::LLColorSwatchCtrl(const Params& p) : LLUICtrl(p), mValid( TRUE ), mColor(p.color()), + mBorderColor(p.border_color()), mCanApplyImmediately(p.can_apply_immediately), - mAlphaGradientImage(p.alpha_background_image), mOnCancelCallback(p.cancel_callback()), mOnSelectCallback(p.select_callback()), - mBorderColor(p.border_color()), mLabelWidth(p.label_width), - mLabelHeight(p.label_height) + mLabelHeight(p.label_height), + mAlphaGradientImage(p.alpha_background_image) { LLTextBox::Params tp = p.caption_text; // use custom label height if it is provided @@ -176,7 +176,7 @@ BOOL LLColorSwatchCtrl::handleMouseUp(S32 x, S32 y, MASK mask) if( hasMouseCapture() ) { // Release the mouse - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); // If mouseup in the widget, it's been clicked if ( pointInView(x, y) ) @@ -320,7 +320,7 @@ void LLColorSwatchCtrl::closeFloaterColorPicker() LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get(); if (pickerp) { - pickerp->setSwatch(NULL); + pickerp->setSwatch(nullptr); pickerp->closeFloater(); } diff --git a/indra/newview/llcolorswatch.h b/indra/newview/llcolorswatch.h index 380fdccfa37ace92d649699b0472921d31d4dd24..d4533b0cee266c69cfadaaa6ebd3ebbd6aae68a8 100644 --- a/indra/newview/llcolorswatch.h +++ b/indra/newview/llcolorswatch.h @@ -72,9 +72,9 @@ protected: public: ~LLColorSwatchCtrl (); - /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void setValue(const LLSD& value) override; - /*virtual*/ LLSD getValue() const { return mColor.getValue(); } + /*virtual*/ LLSD getValue() const override { return mColor.getValue(); } const LLColor4& get() { return mColor; } void set(const LLColor4& color, BOOL update_picker = FALSE, BOOL from_event = FALSE); @@ -90,13 +90,13 @@ public: void showPicker(BOOL take_focus); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleDoubleClick(S32 x,S32 y,MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); - /*virtual*/ void draw(); - /*virtual*/ void setEnabled( BOOL enabled ); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleDoubleClick(S32 x,S32 y,MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char) override; + /*virtual*/ void draw() override; + /*virtual*/ void setEnabled( BOOL enabled ) override; static void onColorChanged ( void* data, EColorPickOp pick_op = COLOR_CHANGE ); void closeFloaterColorPicker(); diff --git a/indra/newview/llcommanddispatcherlistener.cpp b/indra/newview/llcommanddispatcherlistener.cpp index 1a8c79e5e42e7599092cfb76a70f5a1449aa7c6d..c28e48371cd57c13d07a1aefe0c2d15065298be8 100644 --- a/indra/newview/llcommanddispatcherlistener.cpp +++ b/indra/newview/llcommanddispatcherlistener.cpp @@ -66,7 +66,7 @@ void LLCommandDispatcherListener::dispatch(const LLSD& params) const // But for testing, allow a caller to specify untrusted. trusted_browser = params["trusted"].asBoolean(); } - LLCommandDispatcher::dispatch(params["cmd"], params["params"], params["query"], NULL, + LLCommandDispatcher::dispatch(params["cmd"], params["params"], params["query"], nullptr, "clicked", trusted_browser); } diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index 6a6db9a68c1bfdab19309757b8cd4387698dbe4a..37cf343aa6a5f065b35bdd122f265e5597608fcc 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -138,40 +138,40 @@ public: } // Overrides to support the value_semantic interface. - virtual std::string name() const + std::string name() const override { const std::string arg("arg"); const std::string args("args"); return (max_tokens() > 1) ? args : arg; } - virtual unsigned min_tokens() const + unsigned min_tokens() const override { return mMinTokens; } - virtual unsigned max_tokens() const + unsigned max_tokens() const override { return mMaxTokens; } - virtual bool is_composing() const + bool is_composing() const override { return mIsComposing; } // Needed for boost 1.42 - virtual bool is_required() const + bool is_required() const override { return false; // All our command line options are optional. } - virtual bool apply_default(boost::any& value_store) const + bool apply_default(boost::any& value_store) const override { return false; // No defaults. } - virtual void notify(const boost::any& value_store) const + void notify(const boost::any& value_store) const override { const LLCommandLineParser::token_vector_t* value = boost::any_cast<const LLCommandLineParser::token_vector_t>(&value_store); @@ -180,15 +180,15 @@ public: mNotifyCallback(*value); } } - - virtual bool adjacent_tokens_only() const + + bool adjacent_tokens_only() const override { return false; } protected: void xparse(boost::any& value_store, - const std::vector<std::string>& new_tokens) const + const std::vector<std::string>& new_tokens) const override { if(gPastLastOption) { @@ -506,7 +506,7 @@ void setControlValueCB(const LLCommandLineParser::token_vector_t& value, // compound types // ?... - if(NULL != ctrl) + if(nullptr != ctrl) { switch(ctrl->type()) { diff --git a/indra/newview/llcommandlineparser.h b/indra/newview/llcommandlineparser.h index 2c2bbd9e3a62088a8d9e726388098e0881b453fd..da8a78a0c8c5b6434c6d472ab86c8b1b8e6683b8 100644 --- a/indra/newview/llcommandlineparser.h +++ b/indra/newview/llcommandlineparser.h @@ -56,7 +56,7 @@ public: */ void addOptionDesc( const std::string& option_name, - boost::function1<void, const token_vector_t&> notify_callback = 0, + boost::function1<void, const token_vector_t&> notify_callback = nullptr, unsigned int num_tokens = 0, const std::string& description = LLStringUtil::null, const std::string& short_name = LLStringUtil::null, diff --git a/indra/newview/llcommunicationchannel.h b/indra/newview/llcommunicationchannel.h index 573ab80eef131028157fd0104468352beff94d28..6b39145893a5bedb20856ea87b105c4e6fa86112 100644 --- a/indra/newview/llcommunicationchannel.h +++ b/indra/newview/llcommunicationchannel.h @@ -51,8 +51,8 @@ public: void removeItemFromHistory(LLNotificationPtr p); protected: - virtual void onDelete(LLNotificationPtr p); - virtual void onFilterFail(LLNotificationPtr pNotificationPtr); + void onDelete(LLNotificationPtr p) override; + void onFilterFail(LLNotificationPtr pNotificationPtr) override; private: diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 99e1e2df42d976a6149d433d549002dd73036c38..d2a9c237a988286673e2bb28f5407555cf83a4b5 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -78,16 +78,16 @@ namespace typedef boost::shared_ptr<ObjectInventoryFetcher> ptr_t; ObjectInventoryFetcher(LLEventPump &pump, LLViewerObject* object, void* user_data) : - mPump(pump), - LLVOInventoryListener() + LLVOInventoryListener(), + mPump(pump) { registerVOInventoryListener(object, this); } - virtual void inventoryChanged(LLViewerObject* object, + void inventoryChanged(LLViewerObject* object, LLInventoryObject::object_list_t* inventory, S32 serial_num, - void* user_data); + void* user_data) override; void fetchInventory() { @@ -126,14 +126,14 @@ public: LLQueuedScriptAssetUpload(LLUUID taskId, LLUUID itemId, LLUUID assetId, TargetType_t targetType, bool isRunning, std::string scriptName, LLUUID queueId, LLUUID exerienceId, taskUploadFinish_f finish) : LLScriptAssetUpload(taskId, itemId, targetType, isRunning, - exerienceId, std::string(), finish), - mScriptName(scriptName), - mQueueId(queueId) + exerienceId, std::string(), finish), + mQueueId(queueId), + mScriptName(scriptName) { setAssetId(assetId); } - virtual LLSD prepareUpload() + LLSD prepareUpload() override { /* *NOTE$: The parent class (LLScriptAssetUpload will attempt to save * the script buffer into to the VFS. Since the resource is already in @@ -784,7 +784,7 @@ void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, L LLInventoryObject::object_list_t inventory; if (obj) { - ObjectInventoryFetcher::ptr_t fetcher(new ObjectInventoryFetcher(maildrop, obj, NULL)); + ObjectInventoryFetcher::ptr_t fetcher(new ObjectInventoryFetcher(maildrop, obj, nullptr)); fetcher->fetchInventory(); diff --git a/indra/newview/llcompilequeue.h b/indra/newview/llcompilequeue.h index 0f5e82baba26e6c5ba1372fd333dd4f846309944..15587f6748af0d3a7101609af69465f897d7c55c 100644 --- a/indra/newview/llcompilequeue.h +++ b/indra/newview/llcompilequeue.h @@ -57,7 +57,7 @@ public: LLFloaterScriptQueue(const LLSD& key); virtual ~LLFloaterScriptQueue(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void setMono(bool mono) { mMono = mono; } @@ -132,8 +132,8 @@ public: protected: LLFloaterCompileQueue(const LLSD& key); virtual ~LLFloaterCompileQueue(); - - virtual bool startQueue(); + + bool startQueue() override; static bool processScript(LLHandle<LLFloaterCompileQueue> hfloater, const LLPointer<LLViewerObject> &object, LLInventoryObject* inventory, LLEventPump &pump); @@ -162,7 +162,7 @@ protected: static bool resetObjectScripts(LLHandle<LLFloaterScriptQueue> hfloater, const LLPointer<LLViewerObject> &object, LLInventoryObject* inventory, LLEventPump &pump); - virtual bool startQueue(); + bool startQueue() override; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -180,7 +180,7 @@ protected: static bool runObjectScripts(LLHandle<LLFloaterScriptQueue> hfloater, const LLPointer<LLViewerObject> &object, LLInventoryObject* inventory, LLEventPump &pump); - virtual bool startQueue(); + bool startQueue() override; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -198,7 +198,7 @@ protected: static bool stopObjectScripts(LLHandle<LLFloaterScriptQueue> hfloater, const LLPointer<LLViewerObject> &object, LLInventoryObject* inventory, LLEventPump &pump); - virtual bool startQueue(); + bool startQueue() override; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -216,6 +216,6 @@ protected: static bool deleteObjectScripts(LLHandle<LLFloaterScriptQueue> hfloater, const LLPointer<LLViewerObject> &object, LLInventoryObject* inventory, LLEventPump &pump); - virtual bool startQueue(); + bool startQueue() override; }; #endif // LL_LLCOMPILEQUEUE_H diff --git a/indra/newview/llconfirmationmanager.h b/indra/newview/llconfirmationmanager.h index d791a8b41a7908b13c7ac199a58fad81a81dcbdf..4950e415a3b3618b2124a3eadcb5748055cc4ad9 100644 --- a/indra/newview/llconfirmationmanager.h +++ b/indra/newview/llconfirmationmanager.h @@ -55,7 +55,7 @@ public: : mObject(object), mFunction(function) { } - void confirmed(const std::string& password) + void confirmed(const std::string& password) override { (mObject.*mFunction)(password); } diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index cd6cd503f1de1149d96e526d8b4766f90f454886..c2b2eea62f4e05fbd481145f3e484971aaf8e1a6 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -54,26 +54,26 @@ struct ConversationParams : public LLInitParam::Block<ConversationParams> LLConversation::LLConversation(const ConversationParams& params) : mTime(params.time), - mTimestamp(params.timestamp.isProvided() ? params.timestamp : createTimestamp(params.time)), mConversationType(params.conversation_type), mConversationName(params.conversation_name), mHistoryFileName(params.history_filename), mSessionID(params.session_id), mParticipantID(params.participant_id), - mHasOfflineIMs(params.has_offline_ims) + mHasOfflineIMs(params.has_offline_ims), + mTimestamp(params.timestamp.isProvided() ? params.timestamp : createTimestamp(params.time)) { setListenIMFloaterOpened(); } LLConversation::LLConversation(const LLIMModel::LLIMSession& session) : mTime(time_corrected()), - mTimestamp(createTimestamp(mTime)), mConversationType(session.mSessionType), mConversationName(session.mName), mHistoryFileName(session.mHistoryFileName), mSessionID(session.isOutgoingAdHoc() ? session.generateOutgoingAdHocHash() : session.mSessionID), mParticipantID(session.mOtherParticipantID), - mHasOfflineIMs(session.mHasOfflineMessage) + mHasOfflineIMs(session.mHasOfflineMessage), + mTimestamp(createTimestamp(mTime)) { setListenIMFloaterOpened(); } @@ -169,7 +169,7 @@ class LLConversationLogFriendObserver : public LLFriendObserver public: LLConversationLogFriendObserver() {} virtual ~LLConversationLogFriendObserver() {} - virtual void changed(U32 mask); + void changed(U32 mask) override; }; void LLConversationLogFriendObserver::changed(U32 mask) @@ -325,7 +325,7 @@ LLConversation* LLConversationLog::findConversation(const LLIMModel::LLIMSession } } - return NULL; + return nullptr; } void LLConversationLog::removeConversation(const LLConversation& conversation) @@ -354,7 +354,7 @@ const LLConversation* LLConversationLog::getConversation(const LLUUID& session_i } } - return NULL; + return nullptr; } void LLConversationLog::addObserver(LLConversationLogObserver* observer) diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index 035cbcb9451e7eb41be8747176b15ece750f84eb..670ec52666b9b508769fbba207948edf769a1667 100644 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -124,11 +124,11 @@ public: void removeObserver(LLConversationLogObserver* observer); // LLIMSessionObserver triggers - virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, BOOL has_offline_msg); - virtual void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; // Stub - virtual void sessionRemoved(const LLUUID& session_id){} // Stub - virtual void sessionVoiceOrIMStarted(const LLUUID& session_id){}; // Stub - virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id){}; // Stub + void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, BOOL has_offline_msg) override; + void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) override {}; // Stub + void sessionRemoved(const LLUUID& session_id) override {} // Stub + void sessionVoiceOrIMStarted(const LLUUID& session_id) override {}; // Stub + void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) override {}; // Stub void notifyObservers(); diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index c2e61458393d5cd17e87ce935544bac8c8f5fc16..6e44f3123663f58aa07d5fa7acb51f8af1ed583c 100644 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -221,7 +221,7 @@ void LLConversationLogList::rebuildList() } // try to restore selection of item - if (NULL != selected_conversationp) + if (nullptr != selected_conversationp) { selectItemByUUID(selected_conversationp->getSessionID()); } @@ -250,7 +250,7 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata) { const LLConversation * selected_conversationp = getSelectedConversation(); - if (NULL == selected_conversationp) + if (nullptr == selected_conversationp) { return; } @@ -360,7 +360,7 @@ bool LLConversationLogList::isActionEnabled(const LLSD& userdata) { const LLConversation * selected_conversationp = getSelectedConversation(); - if (NULL == selected_conversationp || numSelected() > 1) + if (nullptr == selected_conversationp || numSelected() > 1) { return false; } @@ -414,7 +414,7 @@ bool LLConversationLogList::isActionChecked(const LLSD& userdata) { const LLConversation * selected_conversationp = getSelectedConversation(); - if (NULL == selected_conversationp) + if (nullptr == selected_conversationp) { return false; } @@ -469,7 +469,7 @@ const LLConversation* LLConversationLogList::getSelectedConversation() return panel->getConversation(); } - return NULL; + return nullptr; } LLConversationLogListItem* LLConversationLogList::getConversationLogListItem(const LLUUID& session_id) @@ -487,7 +487,7 @@ LLConversationLogListItem* LLConversationLogList::getConversationLogListItem(con } } - return NULL; + return nullptr; } LLConversationLogList::ESortOrder LLConversationLogList::getSortOrder() diff --git a/indra/newview/llconversationloglist.h b/indra/newview/llconversationloglist.h index 62ec57e09e660f5a6f9931fa9b08466730a86010..37a3801d929a604366277fcd6d3d8223c7386eb4 100644 --- a/indra/newview/llconversationloglist.h +++ b/indra/newview/llconversationloglist.h @@ -57,9 +57,9 @@ public: LLConversationLogList(const Params& p); virtual ~LLConversationLogList(); - virtual void draw(); + void draw() override; - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; LLToggleableMenu* getContextMenu() const { return mContextMenu.get(); } @@ -73,8 +73,8 @@ public: /** * Changes from LLConversationLogObserver */ - virtual void changed(); - virtual void changed(const LLUUID& session_id, U32 mask); + void changed() override; + void changed(const LLUUID& session_id, U32 mask) override; private: @@ -117,7 +117,7 @@ public: LLConversationLogListItemComparator() {}; virtual ~LLConversationLogListItemComparator() {}; - virtual bool compare(const LLPanel* item1, const LLPanel* item2) const; + bool compare(const LLPanel* item1, const LLPanel* item2) const override; protected: @@ -134,7 +134,7 @@ public: protected: - virtual bool doCompare(const LLConversationLogListItem* conversation1, const LLConversationLogListItem* conversation2) const; + bool doCompare(const LLConversationLogListItem* conversation1, const LLConversationLogListItem* conversation2) const override; }; class LLConversationLogListDateComparator : public LLConversationLogListItemComparator @@ -147,7 +147,7 @@ public: protected: - virtual bool doCompare(const LLConversationLogListItem* conversation1, const LLConversationLogListItem* conversation2) const; + bool doCompare(const LLConversationLogListItem* conversation1, const LLConversationLogListItem* conversation2) const override; }; #endif /* LLCONVERSATIONLOGLIST_H_ */ diff --git a/indra/newview/llconversationloglistitem.cpp b/indra/newview/llconversationloglistitem.cpp index ca5664600db5b0745e583da2510cfa08143e22f2..2f1114ef6ddb547483160e07b8ca29e645e71219 100644 --- a/indra/newview/llconversationloglistitem.cpp +++ b/indra/newview/llconversationloglistitem.cpp @@ -44,8 +44,8 @@ LLConversationLogListItem::LLConversationLogListItem(const LLConversation* conversation) : LLPanel(), mConversation(conversation), - mConversationName(NULL), - mConversationDate(NULL) + mConversationName(nullptr), + mConversationDate(nullptr) { buildFromFile("panel_conversation_log_list_item.xml"); diff --git a/indra/newview/llconversationloglistitem.h b/indra/newview/llconversationloglistitem.h index ee28456bbba27df2920c58ade83c407e924eacfd..e8bfa33948f797a0a5c63c22193f4c63f543708e 100644 --- a/indra/newview/llconversationloglistitem.h +++ b/indra/newview/llconversationloglistitem.h @@ -48,12 +48,12 @@ public: LLConversationLogListItem(const LLConversation* conversation); virtual ~LLConversationLogListItem(); - void onMouseEnter(S32 x, S32 y, MASK mask); - void onMouseLeave(S32 x, S32 y, MASK mask); + void onMouseEnter(S32 x, S32 y, MASK mask) override; + void onMouseLeave(S32 x, S32 y, MASK mask) override; - virtual void setValue(const LLSD& value); + void setValue(const LLSD& value) override; - virtual BOOL postBuild(); + BOOL postBuild() override; void onIMFloaterShown(const LLUUID& session_id); void onRemoveBtnClicked(); diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index b54154b1aa7ab8d8f8e5daae5dfe4ef0c50b8470..74660526f1cbc21b5e1a495fd352ff043e82b500 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -47,8 +47,8 @@ LLConversationItem::LLConversationItem(std::string display_name, const LLUUID& u LLFolderViewModelItemCommon(root_view_model), mName(display_name), mUUID(uuid), - mNeedsRefresh(true), mConvType(CONV_UNKNOWN), + mNeedsRefresh(true), mLastActiveTime(0.0), mDisplayModeratorOptions(false), mDisplayGroupBanOptions(false), @@ -60,8 +60,8 @@ LLConversationItem::LLConversationItem(const LLUUID& uuid, LLFolderViewModelInte LLFolderViewModelItemCommon(root_view_model), mName(""), mUUID(uuid), - mNeedsRefresh(true), mConvType(CONV_UNKNOWN), + mNeedsRefresh(true), mLastActiveTime(0.0), mDisplayModeratorOptions(false), mDisplayGroupBanOptions(false), @@ -73,8 +73,8 @@ LLConversationItem::LLConversationItem(LLFolderViewModelInterface& root_view_mod LLFolderViewModelItemCommon(root_view_model), mName(""), mUUID(), - mNeedsRefresh(true), mConvType(CONV_UNKNOWN), + mNeedsRefresh(true), mLastActiveTime(0.0), mDisplayModeratorOptions(false), mDisplayGroupBanOptions(false), @@ -305,7 +305,7 @@ void LLConversationItemSession::updateName(LLConversationItemParticipant* partic std::string new_session_name; LLAvatarActions::buildResidentsString(temp_uuids, new_session_name); renameItem(new_session_name); - postEvent("update_session", this, NULL); + postEvent("update_session", this, nullptr); } } @@ -337,7 +337,7 @@ LLConversationItemParticipant* LLConversationItemSession::findParticipant(const { // This is *not* a general tree parsing algorithm. It assumes that a session contains only // items (LLConversationItemParticipant) that have themselve no children. - LLConversationItemParticipant* participant = NULL; + LLConversationItemParticipant* participant = nullptr; child_list_t::iterator iter; for (iter = mChildren.begin(); iter != mChildren.end(); iter++) { @@ -449,7 +449,7 @@ const bool LLConversationItemSession::getTime(F64& time) const { F64 most_recent_time = mLastActiveTime; bool has_time = (most_recent_time > 0.1); - LLConversationItemParticipant* participant = NULL; + LLConversationItemParticipant* participant = nullptr; child_list_t::const_iterator iter; for (iter = mChildren.begin(); iter != mChildren.end(); iter++) { @@ -495,7 +495,7 @@ void LLConversationItemSession::onAvatarNameCache(const LLAvatarName& av_name) } renameItem(av_name.getDisplayName()); - postEvent("update_session", this, NULL); + postEvent("update_session", this, nullptr); } // @@ -555,10 +555,10 @@ void LLConversationItemParticipant::updateName(const LLAvatarName& av_name) } renameItem(mDisplayName); - if (mParent != NULL) + if (mParent != nullptr) { LLConversationItemSession* parent_session = dynamic_cast<LLConversationItemSession*>(mParent); - if (parent_session != NULL) + if (parent_session != nullptr) { parent_session->requestSort(); parent_session->updateName(this); @@ -579,7 +579,7 @@ void LLConversationItemParticipant::buildContextMenu(LLMenuGL& menu, U32 flags) LLConversationItemSession* LLConversationItemParticipant::getParentSession() { - LLConversationItemSession* parent_session = NULL; + LLConversationItemSession* parent_session = nullptr; if (hasParent()) { parent_session = dynamic_cast<LLConversationItemSession*>(mParent); diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 84e91c18098013ffd9f0432d9fcad19ae47375dc..36d66fba9f2b32467433331868b6f0ea17785f8e 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -56,7 +56,7 @@ public: : conversation(conv) {} - virtual void onChange(EStatusType status, const std::string &channelURI, bool proximal) + void onChange(EStatusType status, const std::string &channelURI, bool proximal) override { conversation->showVoiceIndicator(conversation && status != STATUS_JOINING @@ -76,17 +76,17 @@ LLConversationViewSession::Params::Params() : LLConversationViewSession::LLConversationViewSession(const LLConversationViewSession::Params& p): LLFolderViewFolder(p), mContainer(p.container), - mItemPanel(NULL), - mCallIconLayoutPanel(NULL), + mItemPanel(nullptr), + mCallIconLayoutPanel(nullptr), mTypingIconLayoutPanel(nullptr), - mSessionTitle(NULL), - mSpeakingIndicator(NULL), - mVoiceClientObserver(NULL), - mCollapsedMode(false), - mHasArrow(true), - mIsInActiveVoiceChannel(false), + mSessionTitle(nullptr), + mSpeakingIndicator(nullptr), mFlashStateOn(false), - mFlashStarted(false) + mFlashStarted(false), + mCollapsedMode(false), + mHasArrow(true), + mIsInActiveVoiceChannel(false), + mVoiceClientObserver(nullptr) { mFlashTimer = new LLFlashTimer(); } @@ -154,7 +154,7 @@ BOOL LLConversationViewSession::postBuild() { LLFolderViewItem::postBuild(); - mItemPanel = LLUICtrlFactory::getInstance()->createFromFile<LLPanel>("panel_conversation_list_item.xml", NULL, LLPanel::child_registry_t::instance()); + mItemPanel = LLUICtrlFactory::getInstance()->createFromFile<LLPanel>("panel_conversation_list_item.xml", nullptr, LLPanel::child_registry_t::instance()); addChild(mItemPanel); mCallIconLayoutPanel = mItemPanel->getChild<LLPanel>("call_icon_panel"); @@ -410,7 +410,7 @@ LLConversationViewParticipant* LLConversationViewSession::findParticipant(const // This is *not* a general tree parsing algorithm. We search only in the mItems list // assuming there is no mFolders which makes sense for sessions (sessions don't contain // sessions). - LLConversationViewParticipant* participant = NULL; + LLConversationViewParticipant* participant = nullptr; items_t::const_iterator iter; for (iter = getItemsBegin(); iter != getItemsEnd(); iter++) { @@ -455,7 +455,7 @@ void LLConversationViewSession::refresh() { mSpeakingIndicator->setVisible(false); } - LLConversationViewParticipant* participant = NULL; + LLConversationViewParticipant* participant = nullptr; items_t::const_iterator iter; for (iter = getItemsBegin(); iter != getItemsEnd(); iter++) { @@ -505,9 +505,9 @@ output_monitor("output_monitor") LLConversationViewParticipant::LLConversationViewParticipant( const LLConversationViewParticipant::Params& p ): LLFolderViewItem(p), - mAvatarIcon(NULL), - mInfoBtn(NULL), - mSpeakingIndicator(NULL), + mAvatarIcon(nullptr), + mInfoBtn(nullptr), + mSpeakingIndicator(nullptr), mUUID(p.participant_id) { } @@ -732,7 +732,7 @@ void LLConversationViewParticipant::updateChildren() LLView* LLConversationViewParticipant::getItemChildView(EAvatarListItemChildIndex child_view_index) { - LLView* child_view = NULL; + LLView* child_view = nullptr; switch (child_view_index) { diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index 11ebcb19c256880bce2a49c4d50cad67feca4046..4cb65618a58844de66e2080726c748d25498da09 100644 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -57,26 +57,26 @@ protected: friend class LLUICtrlFactory; LLConversationViewSession( const Params& p ); - /*virtual*/ bool isHighlightAllowed(); - /*virtual*/ bool isHighlightActive(); - /*virtual*/ bool isFlashing() { return mFlashStateOn; } + /*virtual*/ bool isHighlightAllowed() override; + /*virtual*/ bool isHighlightActive() override; + /*virtual*/ bool isFlashing() override { return mFlashStateOn; } LLFloaterIMContainer* mContainer; public: virtual ~LLConversationViewSession(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); - /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleMouseUp( S32 x, S32 y, MASK mask ); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void draw() override; + /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ) override; + /*virtual*/ BOOL handleMouseUp( S32 x, S32 y, MASK mask ) override; - /*virtual*/ S32 arrange(S32* width, S32* height); + /*virtual*/ S32 arrange(S32* width, S32* height) override; - /*virtual*/ void toggleOpen(); + /*virtual*/ void toggleOpen() override; - /*virtual*/ bool isCollapsed() { return mCollapsedMode; } + /*virtual*/ bool isCollapsed() override { return mCollapsedMode; } void toggleCollapsedMode(bool is_collapsed); @@ -86,9 +86,9 @@ public: void showVoiceIndicator(bool visible); void showTypingIndicator(bool visible); - virtual void refresh(); + void refresh() override; - /*virtual*/ void setFlashState(bool flash_state); + /*virtual*/ void setFlashState(bool flash_state) override; void setHighlightState(bool hihglight_state); LLFloater* getSessionFloater(); @@ -139,23 +139,23 @@ public: virtual ~LLConversationViewParticipant( void ); bool hasSameValue(const LLUUID& uuid) { return (uuid == mUUID); } - void addToFolder(LLFolderViewFolder* folder); + void addToFolder(LLFolderViewFolder* folder) override; void addToSession(const LLUUID& session_id); - void onMouseEnter(S32 x, S32 y, MASK mask); - void onMouseLeave(S32 x, S32 y, MASK mask); + void onMouseEnter(S32 x, S32 y, MASK mask) override; + void onMouseLeave(S32 x, S32 y, MASK mask) override; - /*virtual*/ S32 getLabelXPos(); - /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); + /*virtual*/ S32 getLabelXPos() override; + /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; void hideSpeakingIndicator(); protected: friend class LLUICtrlFactory; LLConversationViewParticipant( const Params& p ); void initFromParams(const Params& params); - BOOL postBuild(); - /*virtual*/ void draw(); - /*virtual*/ S32 arrange(S32* width, S32* height); + BOOL postBuild() override; + /*virtual*/ void draw() override; + /*virtual*/ S32 arrange(S32* width, S32* height) override; void onInfoBtnClick(); diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index 0a6fa2292df4940ac8ff99be8e571001e4dd9a47..3a9d9b2dfa7c3d114c0423515d1191b1190269da 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -138,7 +138,7 @@ LLCurrencyUIManager::Impl::Impl(LLPanel& dialog) mUserEnteredCurrencyBuy(false), mSupportsInternationalBilling(false), mBought(false), - mTransactionType(TransactionNone), mTransaction(0), + mTransactionType(TransactionNone), mTransaction(nullptr), mCurrencyChanged(false) { clearEstimate(); @@ -347,7 +347,7 @@ bool LLCurrencyUIManager::Impl::checkTransaction() return false; } - if (mTransaction->status(NULL) != LLXMLRPCTransaction::StatusComplete) + if (mTransaction->status(nullptr) != LLXMLRPCTransaction::StatusComplete) { setError(mTransaction->statusMessage(), mTransaction->statusURI()); } @@ -361,7 +361,7 @@ bool LLCurrencyUIManager::Impl::checkTransaction() } delete mTransaction; - mTransaction = NULL; + mTransaction = nullptr; mTransactionType = TransactionNone; return true; diff --git a/indra/newview/lldaycyclemanager.h b/indra/newview/lldaycyclemanager.h index 3eb1e51fd47e9b91d8b51216c9c8c4bf406e1fd7..39575456880da1f779dd96d9791f8d43d19d1c10 100644 --- a/indra/newview/lldaycyclemanager.h +++ b/indra/newview/lldaycyclemanager.h @@ -64,7 +64,7 @@ public: boost::signals2::connection setModifyCallback(const modify_signal_t::slot_type& cb); private: - /*virtual*/ void initSingleton(); + /*virtual*/ void initSingleton() override; void loadAllPresets(); void loadPresets(const std::string& dir); diff --git a/indra/newview/lldebugmessagebox.cpp b/indra/newview/lldebugmessagebox.cpp index 7ca9eca016e14b132d287b6d2854c5c7895accff..dc98ff9b585b91189edebb230b6d605cbc3e418a 100644 --- a/indra/newview/lldebugmessagebox.cpp +++ b/indra/newview/lldebugmessagebox.cpp @@ -58,9 +58,9 @@ LLDebugVarMessageBox::LLDebugVarMessageBox(const std::string& title, EDebugVarTy slider_p.can_edit_text(true); slider_p.show_text(true); - mSlider1 = NULL; - mSlider2 = NULL; - mSlider3 = NULL; + mSlider1 = nullptr; + mSlider2 = nullptr; + mSlider3 = nullptr; switch(var_type) { diff --git a/indra/newview/lldebugmessagebox.h b/indra/newview/lldebugmessagebox.h index 75144fc7cb474e70a7095e09e837ae897fa2bcb2..22f2d230936c6e297491bbdb60118b7fc55e6945 100644 --- a/indra/newview/lldebugmessagebox.h +++ b/indra/newview/lldebugmessagebox.h @@ -65,8 +65,8 @@ public: static void show(const std::string& title, LLVector2 *var, LLVector2 max_value = LLVector2(100.f, 100.f), LLVector2 increment = LLVector2(0.1f, 0.1f)); static void show(const std::string& title, LLVector3 *var, LLVector3 max_value = LLVector3(100.f, 100.f, 100.f), LLVector3 increment = LLVector3(0.1f, 0.1f, 0.1f)); //static void show(const std::string& title, LLVector4 *var, LLVector4 max_value = LLVector4(100.f, 100.f, 100.f, 100.f), LLVector4 increment = LLVector4(0.1f, 0.1f, 0.1f, 0.1f)); - - virtual void draw(); + + void draw() override; protected: EDebugVarType mVarType; diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index 69f1f2d2cfb91559ece9c03d8b76f81b9b5dd0b9..335e1d71d22b9f6152e5b97e903b2a64b8726514 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -46,7 +46,7 @@ // Globals // -LLDebugView* gDebugView = NULL; +LLDebugView* gDebugView = nullptr; // // Methods @@ -55,18 +55,18 @@ static LLDefaultChildRegistry::Register<LLDebugView> r("debug_view"); LLDebugView::LLDebugView(const LLDebugView::Params& p) : LLView(p), - mFastTimerView(NULL), - mDebugConsolep(NULL), - mFloaterSnapRegion(NULL) + mFastTimerView(nullptr), + mDebugConsolep(nullptr), + mFloaterSnapRegion(nullptr) {} LLDebugView::~LLDebugView() { // These have already been deleted. Fix the globals appropriately. - gDebugView = NULL; - gTextureView = NULL; - gSceneView = NULL; - gSceneMonitorView = NULL; + gDebugView = nullptr; + gTextureView = nullptr; + gSceneView = nullptr; + gSceneMonitorView = nullptr; } void LLDebugView::init() @@ -121,7 +121,7 @@ void LLDebugView::init() void LLDebugView::draw() { - if (mFloaterSnapRegion == NULL) + if (mFloaterSnapRegion == nullptr) { mFloaterSnapRegion = getRootView()->getChildView("floater_snap_region"); } diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h index 4710385f0858325cffbd4b15399cd78d5c362721..000a6e4862e5a18a548ba09bf290e6d952a99bcc 100644 --- a/indra/newview/lldebugview.h +++ b/indra/newview/lldebugview.h @@ -51,7 +51,7 @@ public: ~LLDebugView(); void init(); - void draw(); + void draw() override; void setStatsVisible(BOOL visible); diff --git a/indra/newview/lldelayedgestureerror.cpp b/indra/newview/lldelayedgestureerror.cpp index e13997d91c0b9bf5db734e8b386d133fd10bddac..4a7856a2e999f0c2d98855b6b134eceb5d8454bf 100644 --- a/indra/newview/lldelayedgestureerror.cpp +++ b/indra/newview/lldelayedgestureerror.cpp @@ -67,7 +67,7 @@ void LLDelayedGestureError::enqueue(const LLErrorEntry &ent) { if ( sQueue.empty() ) { - gIdleCallbacks.addFunction(onIdle, NULL); + gIdleCallbacks.addFunction(onIdle, nullptr); } sQueue.push_back(ent); @@ -89,7 +89,7 @@ void LLDelayedGestureError::onIdle(void *userdata) else { // Nothing to do anymore - gIdleCallbacks.deleteFunction(onIdle, NULL); + gIdleCallbacks.deleteFunction(onIdle, nullptr); } } diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp index 6983fd724ec688f48fcbc5d46bce20a5509b6926..4edd84fd3cfe8fab12e6f8a37bacd400629e6ea4 100644 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -66,7 +66,7 @@ bool LLDirPicker::check_local_file_access_enabled() if ( ! local_file_system_browsing_enabled ) { mDir.clear(); // Windows - mFileName = NULL; // Mac/Linux + mFileName = nullptr; // Mac/Linux return false; } @@ -76,7 +76,7 @@ bool LLDirPicker::check_local_file_access_enabled() #if LL_WINDOWS LLDirPicker::LLDirPicker() : - mFileName(NULL), + mFileName(nullptr), mLocked(false) { } @@ -109,13 +109,13 @@ BOOL LLDirPicker::getDir(std::string* filename) bi.ulFlags = BIF_USENEWUI; bi.hwndOwner = (HWND)gViewerWindow->getPlatformWindow(); - bi.lpszTitle = NULL; + bi.lpszTitle = nullptr; - ::OleInitialize(NULL); + ::OleInitialize(nullptr); LPITEMIDLIST pIDL = ::SHBrowseForFolder(&bi); - if(pIDL != NULL) + if(pIDL != nullptr) { WCHAR buffer[_MAX_PATH] = {'\0'}; diff --git a/indra/newview/lldndbutton.h b/indra/newview/lldndbutton.h index 0819c1c77689ee74449f44b96c39d39aad0c869f..14f85671a21a9a8ccfdf01105dcf948078a3234c 100644 --- a/indra/newview/lldndbutton.h +++ b/indra/newview/lldndbutton.h @@ -70,7 +70,7 @@ public: EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; private: drag_drop_handler_t mDragDropHandler; diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index ae88354b00846f048dda0944e98ee6cf65e5363f..a93af9ebbfe940e1c86858578fc3b93fe2c64957 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -197,7 +197,7 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() { notification = (LLNotificationPtr) new LLNotification(notification_params.with("is_dnd", true)); LLNotificationResponderInterface* responder = createResponder(notification_params["responder_sd"]["responder_type"], notification_params["responder_sd"]); - if (responder == NULL) + if (responder == nullptr) { LL_WARNS("LLDoNotDisturbNotificationStorage") << "cannot create responder for notification of type '" << notification->getType() << "'" << LL_ENDL; diff --git a/indra/newview/lldonotdisturbnotificationstorage.h b/indra/newview/lldonotdisturbnotificationstorage.h index e6cb7835e311b4277df3daf26c2363c3e8d29b62..252d9663c17395630f97397ec8bd8ecaeeefae60 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.h +++ b/indra/newview/lldonotdisturbnotificationstorage.h @@ -42,7 +42,7 @@ public: ~LLDoNotDisturbNotificationStorageTimer(); public: - BOOL tick(); + BOOL tick() override; }; class LLDoNotDisturbNotificationStorage : public LLSingleton<LLDoNotDisturbNotificationStorage>, public LLNotificationStorage diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index f39bf532ee67bdc3a5172abcb79f6c4f25004830..aaf08c887d9694bda57f23c3d996c60742f2d953 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -101,7 +101,7 @@ LLDrawable::LLDrawable(LLViewerObject *vobj, bool new_entry) void LLDrawable::init(bool new_entry) { // mXform - mParent = NULL; + mParent = nullptr; mRenderType = 0; mCurrentScale = LLVector3(1,1,1); mDistanceWRTCamera = 0.0f; @@ -110,11 +110,11 @@ void LLDrawable::init(bool new_entry) // mFaces mRadius = 0.f; mGeneration = -1; - mSpatialBridge = NULL; + mSpatialBridge = nullptr; - LLViewerOctreeEntry* entry = NULL; - LLVOCacheEntry* vo_entry = NULL; - if(!new_entry && mVObjp && getRegion() != NULL) + LLViewerOctreeEntry* entry = nullptr; + LLVOCacheEntry* vo_entry = nullptr; + if(!new_entry && mVObjp && getRegion() != nullptr) { vo_entry = getRegion()->getCacheEntryForOctree(mVObjp->getLocalID()); if(vo_entry) @@ -134,7 +134,7 @@ void LLDrawable::init(bool new_entry) if(vo_entry->getNumOfChildren() > 0) { - getRegion()->addVisibleChildCacheEntry(vo_entry, NULL); //to load all children. + getRegion()->addVisibleChildCacheEntry(vo_entry, nullptr); //to load all children. } llassert(!vo_entry->getGroup()); //not in the object cache octree. @@ -197,7 +197,7 @@ void LLDrawable::markDead() if (mSpatialBridge) { mSpatialBridge->markDead(); - mSpatialBridge = NULL; + mSpatialBridge = nullptr; } sNumZombieDrawables++; @@ -216,7 +216,7 @@ LLVOVolume* LLDrawable::getVOVolume() const } else { - return NULL; + return nullptr; } } @@ -261,8 +261,8 @@ void LLDrawable::cleanupReferences() { LL_RECORD_BLOCK_TIME(FTM_DEREF_DRAWABLE); // Cleanup references to other objects - mVObjp = NULL; - mParent = NULL; + mVObjp = nullptr; + mParent = nullptr; } } @@ -278,7 +278,7 @@ void LLDrawable::removeFromOctree() { getRegion()->removeActiveCacheEntry((LLVOCacheEntry*)mEntry->getVOCacheEntry(), this); } - mEntry = NULL; + mEntry = nullptr; } void LLDrawable::cleanupDeadDrawables() @@ -583,7 +583,7 @@ void LLDrawable::makeStatic(BOOL warning_enabled) if (mSpatialBridge) { mSpatialBridge->markDead(); - setSpatialBridge(NULL); + setSpatialBridge(nullptr); } updatePartition(); } @@ -1109,7 +1109,7 @@ void LLDrawable::setGroup(LLViewerOctreeGroup *groupp) LLSpatialPartition* LLDrawable::getSpatialPartition() { - LLSpatialPartition* retval = NULL; + LLSpatialPartition* retval = nullptr; if (!mVObjp || !getVOVolume() || @@ -1123,7 +1123,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() { // remove obsolete bridge mSpatialBridge->markDead(); - setSpatialBridge(NULL); + setSpatialBridge(nullptr); } //must be an active volume if (!mSpatialBridge) @@ -1147,7 +1147,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() if (retval && mSpatialBridge.notNull()) { mSpatialBridge->markDead(); - setSpatialBridge(NULL); + setSpatialBridge(nullptr); } return retval; @@ -1201,7 +1201,7 @@ LLSpatialBridge::~LLSpatialBridge() void LLSpatialBridge::destroyTree() { delete mOctree; - mOctree = NULL; + mOctree = nullptr; } void LLSpatialBridge::updateSpatialExtents() @@ -1353,15 +1353,15 @@ public: LLCamera* mCamera; LLOctreeMarkNotCulled(LLCamera* camera_in) : mCamera(camera_in) { } - - virtual void traverse(const OctreeNode* node) + + void traverse(const OctreeNode* node) override { LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); group->setVisible(); OctreeTraveler::traverse(node); } - void visit(const OctreeNode* branch) + void visit(const OctreeNode* branch) override { gPipeline.markNotCulled((LLSpatialGroup*) branch->getListener(0), *mCamera); } @@ -1466,7 +1466,7 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) { - if (mDrawable == NULL) + if (mDrawable == nullptr) { markDead(); return; @@ -1552,7 +1552,7 @@ void LLSpatialBridge::cleanupReferences() LLDrawable::cleanupReferences(); if (mDrawable) { - mDrawable->setGroup(NULL); + mDrawable->setGroup(nullptr); if (mDrawable->getVObj()) { @@ -1564,14 +1564,14 @@ void LLSpatialBridge::cleanupReferences() LLDrawable* drawable = child->mDrawable; if (drawable) { - drawable->setGroup(NULL); + drawable->setGroup(nullptr); } } } LLDrawable* drawablep = mDrawable; - mDrawable = NULL; - drawablep->setSpatialBridge(NULL); + mDrawable = nullptr; + drawablep->setSpatialBridge(nullptr); } } diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index 57f107372e09ed944036fb6463d73819605b0b7b..b6f2bac2ff7c86e17a888831ca25165b319dfb10 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -62,8 +62,8 @@ class LLDrawable { public: LLDrawable(const LLDrawable& rhs) - : LLTrace::MemTrackable<LLDrawable, 16>("LLDrawable"), - LLViewerOctreeEntryData(rhs) + : LLViewerOctreeEntryData(rhs), + LLTrace::MemTrackable<LLDrawable, 16>("LLDrawable") { *this = rhs; } @@ -84,7 +84,7 @@ public: BOOL isLight() const; - virtual void setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results = NULL, BOOL for_select = FALSE); + virtual void setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results = nullptr, BOOL for_select = FALSE); LLSpatialGroup* getSpatialGroup()const {return (LLSpatialGroup*)getGroup();} LLViewerRegion* getRegion() const { return mVObjp->getRegion(); } @@ -118,7 +118,7 @@ public: BOOL isRoot() const { return !mParent || mParent->isAvatar(); } BOOL isSpatialRoot() const { return !mParent || mParent->isAvatar(); } virtual BOOL isSpatialBridge() const { return FALSE; } - virtual LLSpatialPartition* asPartition() { return NULL; } + virtual LLSpatialPartition* asPartition() { return nullptr; } LLDrawable* getParent() const { return mParent; } // must set parent through LLViewerObject:: () @@ -168,12 +168,12 @@ public: BOOL getLit() const { return isState(UNLIT) ? FALSE : TRUE; } void setLit(BOOL lit) { lit ? clearState(UNLIT) : setState(UNLIT); } - bool isVisible() const; - bool isRecentlyVisible() const; + bool isVisible() const override; + bool isRecentlyVisible() const override; virtual void cleanupReferences(); - void setGroup(LLViewerOctreeGroup* group); + void setGroup(LLViewerOctreeGroup* group) override; void setRadius(const F32 radius); F32 getRadius() const { return mRadius; } F32 getVisibilityRadius() const; @@ -319,13 +319,13 @@ inline LLFace* LLDrawable::getFace(const S32 i) const if ((U32) i >= mFaces.size()) { LL_WARNS() << "Invalid face index." << LL_ENDL; - return NULL; + return nullptr; } if (!mFaces[i]) { LL_WARNS() << "Null face found." << LL_ENDL; - return NULL; + return nullptr; } return mFaces[i]; diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 58b903578fba13f568dddc4e5ddb56f31c5e3b24..a604587896801387a216e94deb32f29ab664591d 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -59,7 +59,7 @@ S32 LLDrawPool::sNumDrawPools = 0; //============================= LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerTexture *tex0) { - LLDrawPool *poolp = NULL; + LLDrawPool *poolp = nullptr; switch (type) { case POOL_SIMPLE: @@ -113,7 +113,7 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerTexture *tex0) break; default: LL_ERRS() << "Unknown draw pool type!" << LL_ENDL; - return NULL; + return nullptr; } llassert(poolp->mType == type); @@ -136,7 +136,7 @@ LLDrawPool::~LLDrawPool() LLViewerTexture *LLDrawPool::getDebugTexture() { - return NULL; + return nullptr; } //virtual @@ -294,7 +294,7 @@ void LLFacePool::resetDrawOrders() LLViewerTexture *LLFacePool::getTexture() { - return NULL; + return nullptr; } void LLFacePool::removeFaceReference(LLFace *facep) @@ -388,7 +388,7 @@ LLDrawPool* LLRenderPass::instancePool() #else LL_ERRS() << "Attempting to instance a render pass. Invalid operation." << LL_ENDL; #endif - return NULL; + return nullptr; } void LLRenderPass::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture) diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 7d76e1cf26a51283d23173bd341d2f2acf1ebb53..a1bf903f9f43a8bcf5603ada6d78d62ff3c17e7d 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -103,7 +103,7 @@ public: virtual BOOL verify() const { return TRUE; } // Verify that all data in the draw pool is correct! virtual S32 getVertexShaderLevel() const { return mVertexShaderLevel; } - static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = NULL); + static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = nullptr); virtual LLDrawPool *instancePool() = 0; // Create an empty new instance of the pool. virtual LLViewerTexture* getTexture() = 0; virtual BOOL isFacePool() { return FALSE; } @@ -154,11 +154,11 @@ public: LLRenderPass(const U32 type); virtual ~LLRenderPass(); - /*virtual*/ LLDrawPool* instancePool(); - /*virtual*/ LLViewerTexture* getDebugTexture() { return NULL; } - LLViewerTexture* getTexture() { return NULL; } - BOOL isDead() { return FALSE; } - void resetDrawOrders() { } + /*virtual*/ LLDrawPool* instancePool() override; + /*virtual*/ LLViewerTexture* getDebugTexture() override { return nullptr; } + LLViewerTexture* getTexture() override { return nullptr; } + BOOL isDead() override { return FALSE; } + void resetDrawOrders() override { } static void applyModelMatrix(const LLDrawInfo& params); virtual void pushBatches(U32 type, U32 mask, BOOL texture = TRUE, BOOL batch_textures = FALSE); @@ -184,18 +184,18 @@ public: LLFacePool(const U32 type); virtual ~LLFacePool(); - BOOL isDead() { return mReferences.empty(); } - - virtual LLViewerTexture *getTexture(); + BOOL isDead() override { return mReferences.empty(); } + + LLViewerTexture *getTexture() override; virtual void dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures); virtual void enqueue(LLFace *face); virtual BOOL addFace(LLFace *face); virtual BOOL removeFace(LLFace *face); - virtual BOOL verify() const; // Verify that all data in the draw pool is correct! - - virtual void resetDrawOrders(); + BOOL verify() const override; // Verify that all data in the draw pool is correct! + + void resetDrawOrders() override; void resetAll(); void destroy(); @@ -207,7 +207,7 @@ public: void printDebugInfo() const; - BOOL isFacePool() { return TRUE; } + BOOL isFacePool() override { return TRUE; } friend class LLFace; friend class LLPipeline; diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index d2f6d4e7dabf32925e67e10a977d1fbd80f152c2..c861a425e2a0c0736d3cc1c9688b193d45a16e6d 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -55,8 +55,8 @@ BOOL LLDrawPoolAlpha::sShowDebugAlpha = FALSE; static BOOL deferred_render = FALSE; LLDrawPoolAlpha::LLDrawPoolAlpha(U32 type) : - LLRenderPass(type), current_shader(NULL), target_shader(NULL), - simple_shader(NULL), fullbright_shader(NULL), emissive_shader(NULL), + LLRenderPass(type), current_shader(nullptr), target_shader(nullptr), + simple_shader(nullptr), fullbright_shader(nullptr), emissive_shader(nullptr), mColorSFactor(LLRender::BF_UNDEF), mColorDFactor(LLRender::BF_UNDEF), mAlphaSFactor(LLRender::BF_UNDEF), mAlphaDFactor(LLRender::BF_UNDEF) { @@ -151,7 +151,7 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) deferred_render = TRUE; // Start out with no shaders. - current_shader = target_shader = NULL; + current_shader = target_shader = nullptr; LLGLSLShader::bindNoShader(); @@ -204,7 +204,7 @@ void LLDrawPoolAlpha::beginRenderPass(S32 pass) } // Start out with no shaders. - current_shader = target_shader = NULL; + current_shader = target_shader = nullptr; if (mVertexShaderLevel > 0) { diff --git a/indra/newview/lldrawpoolalpha.h b/indra/newview/lldrawpoolalpha.h index d064a3a324b7522c97b395d86c4e48b125292ec4..a65c270a05cfd9a91d78e521e7f7d7e469020aeb 100644 --- a/indra/newview/lldrawpoolalpha.h +++ b/indra/newview/lldrawpoolalpha.h @@ -45,22 +45,23 @@ public: LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_TEXCOORD0 }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + + U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } LLDrawPoolAlpha(U32 type = LLDrawPool::POOL_ALPHA); /*virtual*/ ~LLDrawPoolAlpha(); - /*virtual*/ S32 getNumPostDeferredPasses(); - /*virtual*/ void beginPostDeferredPass(S32 pass); - /*virtual*/ void endPostDeferredPass(S32 pass); - /*virtual*/ void renderPostDeferred(S32 pass); + /*virtual*/ S32 getNumPostDeferredPasses() override; + /*virtual*/ void beginPostDeferredPass(S32 pass) override; + /*virtual*/ void endPostDeferredPass(S32 pass) override; + /*virtual*/ void renderPostDeferred(S32 pass) override; - /*virtual*/ void beginRenderPass(S32 pass = 0); - /*virtual*/ void endRenderPass( S32 pass ); - /*virtual*/ S32 getNumPasses() { return 1; } + /*virtual*/ void beginRenderPass(S32 pass = 0) override; + /*virtual*/ void endRenderPass( S32 pass ) override; + /*virtual*/ S32 getNumPasses() override { return 1; } - virtual void render(S32 pass = 0); - /*virtual*/ void prerender(); + void render(S32 pass = 0) override; + /*virtual*/ void prerender() override; void renderGroupAlpha(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture = TRUE); void renderAlpha(U32 mask, S32 pass); @@ -86,7 +87,7 @@ class LLDrawPoolAlphaPostWater : public LLDrawPoolAlpha { public: LLDrawPoolAlphaPostWater(); - virtual void render(S32 pass = 0); + void render(S32 pass = 0) override; }; #endif // LL_LLDRAWPOOLALPHA_H diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 66b9853e73aba0193eaf596006f8262cc66e375c..fa6689ebc15a594222c2788d35b8314a6505f7dd 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -64,7 +64,7 @@ static U32 sDataMask = LLDrawPoolAvatar::VERTEX_DATA_MASK; static U32 sBufferUsage = GL_STREAM_DRAW_ARB; static U32 sShaderLevel = 0; -LLGLSLShader* LLDrawPoolAvatar::sVertexProgram = NULL; +LLGLSLShader* LLDrawPoolAvatar::sVertexProgram = nullptr; BOOL LLDrawPoolAvatar::sSkipOpaque = FALSE; BOOL LLDrawPoolAvatar::sSkipTransparent = FALSE; S32 LLDrawPoolAvatar::sDiffuseChannel = 0; @@ -337,7 +337,7 @@ void LLDrawPoolAvatar::endDeferredRiggedAlpha() sDiffuseChannel = 0; normal_channel = -1; specular_channel = -1; - sVertexProgram = NULL; + sVertexProgram = nullptr; } void LLDrawPoolAvatar::endPostDeferredPass(S32 pass) @@ -454,7 +454,7 @@ void LLDrawPoolAvatar::endShadowPass(S32 pass) { LLVertexBuffer::unbind(); sVertexProgram->unbind(); - sVertexProgram = NULL; + sVertexProgram = nullptr; } } @@ -529,11 +529,11 @@ void LLDrawPoolAvatar::render(S32 pass) LL_RECORD_BLOCK_TIME(FTM_RENDER_CHARACTERS); if (LLPipeline::sImpostorRender) { - renderAvatars(NULL, pass+2); + renderAvatars(nullptr, pass+2); return; } - renderAvatars(NULL, pass); // render all avatars + renderAvatars(nullptr, pass); // render all avatars } void LLDrawPoolAvatar::beginRenderPass(S32 pass) @@ -671,7 +671,7 @@ void LLDrawPoolAvatar::beginRigid() sVertexProgram = &gObjectAlphaMaskNoColorProgram; } - if (sVertexProgram != NULL) + if (sVertexProgram != nullptr) { //eyeballs render with the specular shader sVertexProgram->bind(); sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha); @@ -679,14 +679,14 @@ void LLDrawPoolAvatar::beginRigid() } else { - sVertexProgram = NULL; + sVertexProgram = nullptr; } } void LLDrawPoolAvatar::endRigid() { sShaderLevel = mVertexShaderLevel; - if (sVertexProgram != NULL) + if (sVertexProgram != nullptr) { sVertexProgram->unbind(); } @@ -715,7 +715,7 @@ void LLDrawPoolAvatar::endDeferredImpostor() sVertexProgram->disableTexture(LLViewerShaderMgr::SPECULAR_MAP); sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); gPipeline.unbindDeferredShader(*sVertexProgram); - sVertexProgram = NULL; + sVertexProgram = nullptr; sDiffuseChannel = 0; } @@ -848,7 +848,7 @@ void LLDrawPoolAvatar::endRiggedSimple() if (sShaderLevel > 0 || gPipeline.canUseVertexShaders()) { sVertexProgram->unbind(); - sVertexProgram = NULL; + sVertexProgram = nullptr; } } @@ -966,7 +966,7 @@ void LLDrawPoolAvatar::endRiggedFullbright() if (sShaderLevel > 0 || gPipeline.canUseVertexShaders()) { sVertexProgram->unbind(); - sVertexProgram = NULL; + sVertexProgram = nullptr; } } @@ -1009,7 +1009,7 @@ void LLDrawPoolAvatar::endRiggedShinySimple() { LLDrawPoolBump::unbindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel); sVertexProgram->unbind(); - sVertexProgram = NULL; + sVertexProgram = nullptr; } } @@ -1068,7 +1068,7 @@ void LLDrawPoolAvatar::endRiggedFullbrightShiny() { LLDrawPoolBump::unbindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel); sVertexProgram->unbind(); - sVertexProgram = NULL; + sVertexProgram = nullptr; } } @@ -1084,7 +1084,7 @@ void LLDrawPoolAvatar::endDeferredRiggedSimple() { LLVertexBuffer::unbind(); sVertexProgram->unbind(); - sVertexProgram = NULL; + sVertexProgram = nullptr; } void LLDrawPoolAvatar::beginDeferredRiggedBump() @@ -1103,7 +1103,7 @@ void LLDrawPoolAvatar::endDeferredRiggedBump() sVertexProgram->unbind(); normal_channel = -1; sDiffuseChannel = 0; - sVertexProgram = NULL; + sVertexProgram = nullptr; } void LLDrawPoolAvatar::beginDeferredRiggedMaterial(S32 pass) @@ -1145,7 +1145,7 @@ void LLDrawPoolAvatar::endDeferredRiggedMaterial(S32 pass) sVertexProgram->unbind(); normal_channel = -1; sDiffuseChannel = 0; - sVertexProgram = NULL; + sVertexProgram = nullptr; } void LLDrawPoolAvatar::beginDeferredSkinned() @@ -1754,7 +1754,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) { //order is important here LLRender::DIFFUSE_MAP should be last, because it changes //(gGL).mCurrTextureUnitIndex - LLViewerTexture* specular = NULL; + LLViewerTexture* specular = nullptr; if (LLPipeline::sImpostorRender && avatar->isVisuallyMuted()) { specular = LLViewerTextureManager::findFetchedTexture(gBlackSquareID, TEX_LIST_STANDARD); @@ -1998,12 +1998,12 @@ LLViewerTexture *LLDrawPoolAvatar::getDebugTexture() { if (mReferences.empty()) { - return NULL; + return nullptr; } LLFace *face = mReferences[0]; if (!face->getDrawable()) { - return NULL; + return nullptr; } const LLViewerObject *objectp = face->getDrawable()->getVObj(); @@ -2038,7 +2038,7 @@ void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type) void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep) { - facep->setPool(NULL); + facep->setPool(nullptr); for (U32 i = 0; i < NUM_RIGGED_PASSES; ++i) { diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index 5e9adf221a9fa7cd8ac4f7f3bb4eeba819d4b46b..0f0391f257f0cbebc6909afe6b16365d9b292d5b 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -56,36 +56,36 @@ public: LLVertexBuffer::MAP_CLOTHWEIGHT }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } - virtual S32 getVertexShaderLevel() const; + S32 getVertexShaderLevel() const override; LLDrawPoolAvatar(); static LLMatrix4& getModelView(); - /*virtual*/ LLDrawPool *instancePool(); + /*virtual*/ LLDrawPool *instancePool() override; - /*virtual*/ S32 getNumPasses(); - /*virtual*/ void beginRenderPass(S32 pass); - /*virtual*/ void endRenderPass(S32 pass); - /*virtual*/ void prerender(); - /*virtual*/ void render(S32 pass = 0); + /*virtual*/ S32 getNumPasses() override; + /*virtual*/ void beginRenderPass(S32 pass) override; + /*virtual*/ void endRenderPass(S32 pass) override; + /*virtual*/ void prerender() override; + /*virtual*/ void render(S32 pass = 0) override; - /*virtual*/ S32 getNumDeferredPasses(); - /*virtual*/ void beginDeferredPass(S32 pass); - /*virtual*/ void endDeferredPass(S32 pass); - /*virtual*/ void renderDeferred(S32 pass); + /*virtual*/ S32 getNumDeferredPasses() override; + /*virtual*/ void beginDeferredPass(S32 pass) override; + /*virtual*/ void endDeferredPass(S32 pass) override; + /*virtual*/ void renderDeferred(S32 pass) override; - /*virtual*/ S32 getNumPostDeferredPasses(); - /*virtual*/ void beginPostDeferredPass(S32 pass); - /*virtual*/ void endPostDeferredPass(S32 pass); - /*virtual*/ void renderPostDeferred(S32 pass); + /*virtual*/ S32 getNumPostDeferredPasses() override; + /*virtual*/ void beginPostDeferredPass(S32 pass) override; + /*virtual*/ void endPostDeferredPass(S32 pass) override; + /*virtual*/ void renderPostDeferred(S32 pass) override; - /*virtual*/ S32 getNumShadowPasses(); - /*virtual*/ void beginShadowPass(S32 pass); - /*virtual*/ void endShadowPass(S32 pass); - /*virtual*/ void renderShadow(S32 pass); + /*virtual*/ S32 getNumShadowPasses() override; + /*virtual*/ void beginShadowPass(S32 pass) override; + /*virtual*/ void endShadowPass(S32 pass) override; + /*virtual*/ void renderShadow(S32 pass) override; void beginRigid(); void beginImpostor(); @@ -264,7 +264,7 @@ public: std::vector<LLFace*> mRiggedFace[NUM_RIGGED_PASSES]; - /*virtual*/ LLViewerTexture *getDebugTexture(); + /*virtual*/ LLViewerTexture *getDebugTexture() override; /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display void renderAvatars(LLVOAvatar *single_avatar, S32 pass = -1); // renders only one avatar if single_avatar is not null. diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 80bf5364c6db6d34efd2ce3c799d6df1ca44cdb1..963725c220e619bfb77a888375504a1d2183d3bc 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -67,7 +67,7 @@ const U32 VERTEX_MASK_BUMP = LLVertexBuffer::MAP_VERTEX |LLVertexBuffer::MAP_TEX U32 LLDrawPoolBump::sVertexMask = VERTEX_MASK_SHINY; -static LLGLSLShader* shader = NULL; +static LLGLSLShader* shader = nullptr; static S32 cube_channel = -1; static S32 diffuse_channel = -1; static S32 bump_channel = -1; @@ -156,7 +156,7 @@ void LLStandardBumpmap::addstandard() gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage = LLViewerTextureManager::getFetchedTexture(LLUUID(bump_image_id)); gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setBoostLevel(LLGLTexture::LOCAL) ; - gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setLoadedCallback(LLBumpImageList::onSourceStandardLoaded, 0, TRUE, FALSE, NULL, NULL ); + gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setLoadedCallback(LLBumpImageList::onSourceStandardLoaded, 0, TRUE, FALSE, nullptr, nullptr ); gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->forceToSaveRawImage(0, 30.f) ; LLStandardBumpmap::sStandardBumpmapCount++; } @@ -171,7 +171,7 @@ void LLStandardBumpmap::clear() for( U32 i = 0; i < LLStandardBumpmap::sStandardBumpmapCount; i++ ) { gStandardBumpmapList[i].mLabel.assign(""); - gStandardBumpmapList[i].mImage = NULL; + gStandardBumpmapList[i].mImage = nullptr; } sStandardBumpmapCount = 0; } @@ -355,7 +355,7 @@ void LLDrawPoolBump::beginShiny() } else { - shader = NULL; + shader = nullptr; } bindCubeMap(shader, mVertexShaderLevel, diffuse_channel, cube_channel); @@ -662,7 +662,7 @@ BOOL LLDrawPoolBump::bindBumpMap(U8 bump_code, LLViewerTexture* texture, F32 vsi return FALSE; } - LLViewerTexture* bump = NULL; + LLViewerTexture* bump = nullptr; switch( bump_code ) { @@ -1040,10 +1040,10 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText { llassert( (bump_code == BE_BRIGHTNESS) || (bump_code == BE_DARKNESS) ); - LLViewerTexture* bump = NULL; + LLViewerTexture* bump = nullptr; - bump_image_map_t* entries_list = NULL; - void (*callback_func)( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) = NULL; + bump_image_map_t* entries_list = nullptr; + void (*callback_func)( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) = nullptr; switch( bump_code ) { @@ -1057,7 +1057,7 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText break; default: llassert(0); - return NULL; + return nullptr; } bump_image_map_t::iterator iter = entries_list->find(src_image->getID()); @@ -1081,7 +1081,7 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText //(LLPipeline::sRenderDeferred && bump->getComponents() != 4)) { src_image->setBoostLevel(LLGLTexture::BOOST_BUMP) ; - src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()), NULL ); + src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()), nullptr ); src_image->forceToSaveRawImage(0) ; } } diff --git a/indra/newview/lldrawpoolbump.h b/indra/newview/lldrawpoolbump.h index 18514e0585ba851a8c2bcc300fb15680ade1d5d8..5c05ab707517fd0a1933cd7885ed80620b9f2cf6 100644 --- a/indra/newview/lldrawpoolbump.h +++ b/indra/newview/lldrawpoolbump.h @@ -45,20 +45,20 @@ protected : public: static U32 sVertexMask; BOOL mShiny; - - virtual U32 getVertexDataMask() { return sVertexMask; } + + U32 getVertexDataMask() override { return sVertexMask; } LLDrawPoolBump(); - virtual void render(S32 pass = 0); - virtual void beginRenderPass( S32 pass ); - virtual void endRenderPass( S32 pass ); - virtual S32 getNumPasses(); - /*virtual*/ void prerender(); - /*virtual*/ void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL batch_textures = FALSE); + void render(S32 pass = 0) override; + void beginRenderPass( S32 pass ) override; + void endRenderPass( S32 pass ) override; + S32 getNumPasses() override; + /*virtual*/ void prerender() override; + /*virtual*/ void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL batch_textures = FALSE) override; void renderBump(U32 type, U32 mask); - void renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture); + void renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture) override; S32 numBumpPasses(); @@ -77,15 +77,15 @@ public: static void bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel); static void unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel); - virtual S32 getNumDeferredPasses(); - /*virtual*/ void beginDeferredPass(S32 pass); - /*virtual*/ void endDeferredPass(S32 pass); - /*virtual*/ void renderDeferred(S32 pass); + S32 getNumDeferredPasses() override; + /*virtual*/ void beginDeferredPass(S32 pass) override; + /*virtual*/ void endDeferredPass(S32 pass) override; + /*virtual*/ void renderDeferred(S32 pass) override; - virtual S32 getNumPostDeferredPasses() { return 2; } - /*virtual*/ void beginPostDeferredPass(S32 pass); - /*virtual*/ void endPostDeferredPass(S32 pass); - /*virtual*/ void renderPostDeferred(S32 pass); + S32 getNumPostDeferredPasses() override { return 2; } + /*virtual*/ void beginPostDeferredPass(S32 pass) override; + /*virtual*/ void endPostDeferredPass(S32 pass) override; + /*virtual*/ void renderPostDeferred(S32 pass) override; static BOOL bindBumpMap(LLDrawInfo& params, S32 channel = -2); static BOOL bindBumpMap(LLFace* face, S32 channel = -2); diff --git a/indra/newview/lldrawpoolground.h b/indra/newview/lldrawpoolground.h index a4f8a3fcf50e343bba2dff7b85a0fc3c806cc243..1f296448de7205bae88398904dab7cca57c14155 100644 --- a/indra/newview/lldrawpoolground.h +++ b/indra/newview/lldrawpoolground.h @@ -39,14 +39,14 @@ public: LLVertexBuffer::MAP_TEXCOORD0 }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } LLDrawPoolGround(); - /*virtual*/ LLDrawPool *instancePool(); + /*virtual*/ LLDrawPool *instancePool() override; - /*virtual*/ void prerender(); - /*virtual*/ void render(S32 pass = 0); + /*virtual*/ void prerender() override; + /*virtual*/ void render(S32 pass = 0) override; }; #endif // LL_LLDRAWPOOLGROUND_H diff --git a/indra/newview/lldrawpoolmaterials.h b/indra/newview/lldrawpoolmaterials.h index eae1aba87cd8ed375b7f278711ddbb5a56b53d78..579af155fbd4b9aaa26ca688d345ea8e1e4dac5d 100644 --- a/indra/newview/lldrawpoolmaterials.h +++ b/indra/newview/lldrawpoolmaterials.h @@ -55,21 +55,21 @@ public: LLVertexBuffer::MAP_TANGENT }; - /*virtual*/ U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + /*virtual*/ U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } - /*virtual*/ void render(S32 pass = 0) { } - /*virtual*/ S32 getNumPasses() {return 0;} - /*virtual*/ void prerender(); + /*virtual*/ void render(S32 pass = 0) override { } + /*virtual*/ S32 getNumPasses() override {return 0;} + /*virtual*/ void prerender() override; - /*virtual*/ S32 getNumDeferredPasses(); - /*virtual*/ void beginDeferredPass(S32 pass); - /*virtual*/ void endDeferredPass(S32 pass); - /*virtual*/ void renderDeferred(S32 pass); + /*virtual*/ S32 getNumDeferredPasses() override; + /*virtual*/ void beginDeferredPass(S32 pass) override; + /*virtual*/ void endDeferredPass(S32 pass) override; + /*virtual*/ void renderDeferred(S32 pass) override; void bindSpecularMap(LLViewerTexture* tex); void bindNormalMap(LLViewerTexture* tex); - /*virtual*/ void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL batch_textures = FALSE); + /*virtual*/ void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL batch_textures = FALSE) override; }; #endif //LL_LLDRAWPOOLMATERIALS_H diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index 129dd5cf3c1d16f3e8635f6beecd4139fb035f3c..b1928a5e8fa03cb0c00130664faa9818cbc43cb7 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -39,8 +39,8 @@ #include "llviewershadermgr.h" #include "llrender.h" -static LLGLSLShader* simple_shader = NULL; -static LLGLSLShader* fullbright_shader = NULL; +static LLGLSLShader* simple_shader = nullptr; +static LLGLSLShader* fullbright_shader = nullptr; static LLTrace::BlockTimerStatHandle FTM_RENDER_SIMPLE_DEFERRED("Deferred Simple"); static LLTrace::BlockTimerStatHandle FTM_RENDER_GRASS_DEFERRED("Deferred Grass"); diff --git a/indra/newview/lldrawpoolsimple.h b/indra/newview/lldrawpoolsimple.h index 608ad9e1eb0856a2095769b117f99fe070ee5cf9..d184b6a611dba0e60b0a28ac7da5ba4c040d4174 100644 --- a/indra/newview/lldrawpoolsimple.h +++ b/indra/newview/lldrawpoolsimple.h @@ -39,21 +39,22 @@ public: LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + + U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } LLDrawPoolSimple(); - /*virtual*/ S32 getNumDeferredPasses() { return 1; } - /*virtual*/ void beginDeferredPass(S32 pass); - /*virtual*/ void endDeferredPass(S32 pass); - /*virtual*/ void renderDeferred(S32 pass); + /*virtual*/ S32 getNumDeferredPasses() override { return 1; } + /*virtual*/ void beginDeferredPass(S32 pass) override; + /*virtual*/ void endDeferredPass(S32 pass) override; + /*virtual*/ void renderDeferred(S32 pass) override; - /*virtual*/ void beginRenderPass(S32 pass); - /*virtual*/ void endRenderPass(S32 pass); + /*virtual*/ void beginRenderPass(S32 pass) override; + /*virtual*/ void endRenderPass(S32 pass) override; /// We need two passes so we can handle emissive materials separately. - /*virtual*/ S32 getNumPasses() { return 1; } - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); + /*virtual*/ S32 getNumPasses() override { return 1; } + /*virtual*/ void render(S32 pass = 0) override; + /*virtual*/ void prerender() override; }; @@ -67,21 +68,22 @@ public: LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + + U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } LLDrawPoolGrass(); - /*virtual*/ S32 getNumDeferredPasses() { return 1; } - /*virtual*/ void beginDeferredPass(S32 pass); - /*virtual*/ void endDeferredPass(S32 pass); - /*virtual*/ void renderDeferred(S32 pass); + /*virtual*/ S32 getNumDeferredPasses() override { return 1; } + /*virtual*/ void beginDeferredPass(S32 pass) override; + /*virtual*/ void endDeferredPass(S32 pass) override; + /*virtual*/ void renderDeferred(S32 pass) override; - /*virtual*/ void beginRenderPass(S32 pass); - /*virtual*/ void endRenderPass(S32 pass); + /*virtual*/ void beginRenderPass(S32 pass) override; + /*virtual*/ void endRenderPass(S32 pass) override; /// We need two passes so we can handle emissive materials separately. - /*virtual*/ S32 getNumPasses() { return 1; } - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); + /*virtual*/ S32 getNumPasses() override { return 1; } + /*virtual*/ void render(S32 pass = 0) override; + /*virtual*/ void prerender() override; }; class LLDrawPoolAlphaMask : public LLRenderPass @@ -94,20 +96,21 @@ public: LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + + U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } LLDrawPoolAlphaMask(); - /*virtual*/ S32 getNumDeferredPasses() { return 1; } - /*virtual*/ void beginDeferredPass(S32 pass); - /*virtual*/ void endDeferredPass(S32 pass); - /*virtual*/ void renderDeferred(S32 pass); + /*virtual*/ S32 getNumDeferredPasses() override { return 1; } + /*virtual*/ void beginDeferredPass(S32 pass) override; + /*virtual*/ void endDeferredPass(S32 pass) override; + /*virtual*/ void renderDeferred(S32 pass) override; - /*virtual*/ S32 getNumPasses() { return 1; } - /*virtual*/ void beginRenderPass(S32 pass); - /*virtual*/ void endRenderPass(S32 pass); - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); + /*virtual*/ S32 getNumPasses() override { return 1; } + /*virtual*/ void beginRenderPass(S32 pass) override; + /*virtual*/ void endRenderPass(S32 pass) override; + /*virtual*/ void render(S32 pass = 0) override; + /*virtual*/ void prerender() override; }; @@ -120,20 +123,21 @@ public: LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + + U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } LLDrawPoolFullbrightAlphaMask(); - /*virtual*/ S32 getNumPostDeferredPasses() { return 1; } - /*virtual*/ void beginPostDeferredPass(S32 pass); - /*virtual*/ void endPostDeferredPass(S32 pass); - /*virtual*/ void renderPostDeferred(S32 pass); - - /*virtual*/ S32 getNumPasses() { return 1; } - /*virtual*/ void beginRenderPass(S32 pass); - /*virtual*/ void endRenderPass(S32 pass); - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); + /*virtual*/ S32 getNumPostDeferredPasses() override { return 1; } + /*virtual*/ void beginPostDeferredPass(S32 pass) override; + /*virtual*/ void endPostDeferredPass(S32 pass) override; + /*virtual*/ void renderPostDeferred(S32 pass) override; + + /*virtual*/ S32 getNumPasses() override { return 1; } + /*virtual*/ void beginRenderPass(S32 pass) override; + /*virtual*/ void endRenderPass(S32 pass) override; + /*virtual*/ void render(S32 pass = 0) override; + /*virtual*/ void prerender() override; }; @@ -146,20 +150,21 @@ public: LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + + U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } LLDrawPoolFullbright(); - /*virtual*/ S32 getNumPostDeferredPasses() { return 1; } - /*virtual*/ void beginPostDeferredPass(S32 pass); - /*virtual*/ void endPostDeferredPass(S32 pass); - /*virtual*/ void renderPostDeferred(S32 pass); + /*virtual*/ S32 getNumPostDeferredPasses() override { return 1; } + /*virtual*/ void beginPostDeferredPass(S32 pass) override; + /*virtual*/ void endPostDeferredPass(S32 pass) override; + /*virtual*/ void renderPostDeferred(S32 pass) override; - /*virtual*/ void beginRenderPass(S32 pass); - /*virtual*/ void endRenderPass(S32 pass); - /*virtual*/ S32 getNumPasses(); - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); + /*virtual*/ void beginRenderPass(S32 pass) override; + /*virtual*/ void endRenderPass(S32 pass) override; + /*virtual*/ S32 getNumPasses() override; + /*virtual*/ void render(S32 pass = 0) override; + /*virtual*/ void prerender() override; }; @@ -175,19 +180,19 @@ public: LLVertexBuffer::MAP_EMISSIVE }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } - virtual void prerender() { } + void prerender() override { } - /*virtual*/ S32 getNumPostDeferredPasses() { return 1; } - /*virtual*/ void beginPostDeferredPass(S32 pass); - /*virtual*/ void endPostDeferredPass(S32 pass); - /*virtual*/ void renderPostDeferred(S32 pass); + /*virtual*/ S32 getNumPostDeferredPasses() override { return 1; } + /*virtual*/ void beginPostDeferredPass(S32 pass) override; + /*virtual*/ void endPostDeferredPass(S32 pass) override; + /*virtual*/ void renderPostDeferred(S32 pass) override; - /*virtual*/ S32 getNumPasses(); + /*virtual*/ S32 getNumPasses() override; - void render(S32 pass = 0); - void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture = TRUE, BOOL batch_textures = FALSE); + void render(S32 pass = 0) override; + void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture = TRUE, BOOL batch_textures = FALSE) override; }; diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 13a1535267e5160fd7c7c884055a9578434bba9d..e26e43063c1dbdf931be4d7b88489ca79684f326 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -47,8 +47,8 @@ LLDrawPoolSky::LLDrawPoolSky() : LLFacePool(POOL_SKY), - mSkyTex(NULL), - mShader(NULL) + mSkyTex(nullptr), + mShader(nullptr) { } @@ -98,7 +98,7 @@ void LLDrawPoolSky::render(S32 pass) // able to use this call. LLGLSLShader::bindNoShader(); } - mShader = NULL; + mShader = nullptr; } diff --git a/indra/newview/lldrawpoolsky.h b/indra/newview/lldrawpoolsky.h index 098bd2134ae28b60f3085bf34439f4a649d0e54b..391cb23f8d699823e4a62e9d3849e561c96ab853 100644 --- a/indra/newview/lldrawpoolsky.h +++ b/indra/newview/lldrawpoolsky.h @@ -45,20 +45,20 @@ public: LLVertexBuffer::MAP_TEXCOORD0 }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } LLDrawPoolSky(); - /*virtual*/ LLDrawPool *instancePool(); + /*virtual*/ LLDrawPool *instancePool() override; - /*virtual*/ S32 getNumPostDeferredPasses() { return getNumPasses(); } - /*virtual*/ void beginPostDeferredPass(S32 pass) { beginRenderPass(pass); } - /*virtual*/ void endPostDeferredPass(S32 pass) { endRenderPass(pass); } - /*virtual*/ void renderPostDeferred(S32 pass) { render(pass); } + /*virtual*/ S32 getNumPostDeferredPasses() override { return getNumPasses(); } + /*virtual*/ void beginPostDeferredPass(S32 pass) override { beginRenderPass(pass); } + /*virtual*/ void endPostDeferredPass(S32 pass) override { endRenderPass(pass); } + /*virtual*/ void renderPostDeferred(S32 pass) override { render(pass); } - /*virtual*/ void prerender(); - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void endRenderPass(S32 pass); + /*virtual*/ void prerender() override; + /*virtual*/ void render(S32 pass = 0) override; + /*virtual*/ void endRenderPass(S32 pass) override; void setSkyTex(LLSkyTex* const st) { mSkyTex = st; } void renderSkyCubeFace(U8 side); diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index 870a4c2f74ec2d5ef04cdf1a1294efb5a721b900..4d426d395d13c012a59d5f70e2e540fcf0da87b4 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -56,7 +56,7 @@ int DebugDetailMap = 0; S32 LLDrawPoolTerrain::sDetailMode = 1; F32 LLDrawPoolTerrain::sDetailScale = DETAIL_SCALE; -static LLGLSLShader* sShader = NULL; +static LLGLSLShader* sShader = nullptr; static LLTrace::BlockTimerStatHandle FTM_SHADOW_TERRAIN("Terrain Shadow"); diff --git a/indra/newview/lldrawpoolterrain.h b/indra/newview/lldrawpoolterrain.h index 8c336bf1c6289c3a50d711087a4b7c64ae30e427..51118a4b39f80a61d2209a8c4b3ee12871f093a3 100644 --- a/indra/newview/lldrawpoolterrain.h +++ b/indra/newview/lldrawpoolterrain.h @@ -43,31 +43,31 @@ public: LLVertexBuffer::MAP_TEXCOORD3 }; - virtual U32 getVertexDataMask(); + U32 getVertexDataMask() override; static S32 getDetailMode(); LLDrawPoolTerrain(LLViewerTexture *texturep); virtual ~LLDrawPoolTerrain(); - /*virtual*/ LLDrawPool *instancePool(); + /*virtual*/ LLDrawPool *instancePool() override; - /*virtual*/ S32 getNumDeferredPasses() { return 1; } - /*virtual*/ void beginDeferredPass(S32 pass); - /*virtual*/ void endDeferredPass(S32 pass); - /*virtual*/ void renderDeferred(S32 pass); + /*virtual*/ S32 getNumDeferredPasses() override { return 1; } + /*virtual*/ void beginDeferredPass(S32 pass) override; + /*virtual*/ void endDeferredPass(S32 pass) override; + /*virtual*/ void renderDeferred(S32 pass) override; - /*virtual*/ S32 getNumShadowPasses() { return 1; } - /*virtual*/ void beginShadowPass(S32 pass); - /*virtual*/ void endShadowPass(S32 pass); - /*virtual*/ void renderShadow(S32 pass); + /*virtual*/ S32 getNumShadowPasses() override { return 1; } + /*virtual*/ void beginShadowPass(S32 pass) override; + /*virtual*/ void endShadowPass(S32 pass) override; + /*virtual*/ void renderShadow(S32 pass) override; - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); - /*virtual*/ void beginRenderPass( S32 pass ); - /*virtual*/ void endRenderPass( S32 pass ); - /*virtual*/ void dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures); - /*virtual*/ LLViewerTexture *getTexture(); - /*virtual*/ LLViewerTexture *getDebugTexture(); + /*virtual*/ void render(S32 pass = 0) override; + /*virtual*/ void prerender() override; + /*virtual*/ void beginRenderPass( S32 pass ) override; + /*virtual*/ void endRenderPass( S32 pass ) override; + /*virtual*/ void dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures) override; + /*virtual*/ LLViewerTexture *getTexture() override; + /*virtual*/ LLViewerTexture *getDebugTexture() override; /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display LLPointer<LLViewerTexture> m2DAlphaRampImagep; diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 8dac529bfab7850e5b77c0396598b6ae5052e4e0..d31c608f7baef0aecfe4fc73d455605cd997e4c2 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -42,7 +42,7 @@ #include "llviewerregion.h" S32 LLDrawPoolTree::sDiffTex = 0; -static LLGLSLShader* shader = NULL; +static LLGLSLShader* shader = nullptr; static LLTrace::BlockTimerStatHandle FTM_SHADOW_TREE("Tree Shadow"); LLDrawPoolTree::LLDrawPoolTree(LLViewerTexture *texturep) : diff --git a/indra/newview/lldrawpooltree.h b/indra/newview/lldrawpooltree.h index e7e25453cffffaa7d7adcd0c3d408b40eff6c9d7..8cfef7727364534093ff71105a0fb01e307d672d 100644 --- a/indra/newview/lldrawpooltree.h +++ b/indra/newview/lldrawpooltree.h @@ -40,31 +40,31 @@ public: LLVertexBuffer::MAP_TEXCOORD0 }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } LLDrawPoolTree(LLViewerTexture *texturep); - /*virtual*/ LLDrawPool *instancePool(); + /*virtual*/ LLDrawPool *instancePool() override; - /*virtual*/ void prerender(); + /*virtual*/ void prerender() override; - /*virtual*/ S32 getNumDeferredPasses() { return 1; } - /*virtual*/ void beginDeferredPass(S32 pass); - /*virtual*/ void endDeferredPass(S32 pass); - /*virtual*/ void renderDeferred(S32 pass); + /*virtual*/ S32 getNumDeferredPasses() override { return 1; } + /*virtual*/ void beginDeferredPass(S32 pass) override; + /*virtual*/ void endDeferredPass(S32 pass) override; + /*virtual*/ void renderDeferred(S32 pass) override; - /*virtual*/ S32 getNumShadowPasses() { return 1; } - /*virtual*/ void beginShadowPass(S32 pass); - /*virtual*/ void endShadowPass(S32 pass); - /*virtual*/ void renderShadow(S32 pass); + /*virtual*/ S32 getNumShadowPasses() override { return 1; } + /*virtual*/ void beginShadowPass(S32 pass) override; + /*virtual*/ void endShadowPass(S32 pass) override; + /*virtual*/ void renderShadow(S32 pass) override; - /*virtual*/ void beginRenderPass( S32 pass ); - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void endRenderPass( S32 pass ); - /*virtual*/ S32 getNumPasses() { return 1; } - /*virtual*/ BOOL verify() const; - /*virtual*/ LLViewerTexture *getTexture(); - /*virtual*/ LLViewerTexture *getDebugTexture(); + /*virtual*/ void beginRenderPass( S32 pass ) override; + /*virtual*/ void render(S32 pass = 0) override; + /*virtual*/ void endRenderPass( S32 pass ) override; + /*virtual*/ S32 getNumPasses() override { return 1; } + /*virtual*/ BOOL verify() const override; + /*virtual*/ LLViewerTexture *getTexture() override; + /*virtual*/ LLViewerTexture *getDebugTexture() override; /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display static S32 sDiffTex; diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 62500783580a8282b10e4adcb07f1fbf73057df5..3026b8cd7f285cb3ef1f73f0c7313df17509f9b6 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -103,7 +103,7 @@ void LLDrawPoolWater::restoreGL() LLDrawPool *LLDrawPoolWater::instancePool() { LL_ERRS() << "Should never be calling instancePool on a water pool!" << LL_ENDL; - return NULL; + return nullptr; } @@ -340,7 +340,7 @@ void LLDrawPoolWater::renderOpaqueLegacyWater() { LLVOSky *voskyp = gSky.mVOSkyp; - LLGLSLShader* shader = NULL; + LLGLSLShader* shader = nullptr; if (LLGLSLShader::sNoFixedFunction) { if (LLPipeline::sUnderWaterRender) @@ -482,7 +482,7 @@ void LLDrawPoolWater::shade() LLVOSky *voskyp = gSky.mVOSkyp; - if(voskyp == NULL) + if(voskyp == nullptr) { return; } diff --git a/indra/newview/lldrawpoolwater.h b/indra/newview/lldrawpoolwater.h index aeeba179d6ca134c240ea7cf70ec4768a95cea20..410c7b1b7b10b9d27a26ae33b68cef31e3e01c28 100644 --- a/indra/newview/lldrawpoolwater.h +++ b/indra/newview/lldrawpoolwater.h @@ -58,26 +58,26 @@ public: LLVertexBuffer::MAP_TEXCOORD0 }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + U32 getVertexDataMask() override { return VERTEX_DATA_MASK; } LLDrawPoolWater(); /*virtual*/ ~LLDrawPoolWater(); - /*virtual*/ LLDrawPool *instancePool(); + /*virtual*/ LLDrawPool *instancePool() override; static void restoreGL(); - /*virtual*/ S32 getNumPostDeferredPasses() { return 0; } //getNumPasses(); } - /*virtual*/ void beginPostDeferredPass(S32 pass); - /*virtual*/ void endPostDeferredPass(S32 pass); - /*virtual*/ void renderPostDeferred(S32 pass) { render(pass); } - /*virtual*/ S32 getNumDeferredPasses() { return 1; } - /*virtual*/ void renderDeferred(S32 pass = 0); - - /*virtual*/ S32 getNumPasses(); - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); - - /*virtual*/ LLViewerTexture *getDebugTexture(); + /*virtual*/ S32 getNumPostDeferredPasses() override { return 0; } //getNumPasses(); } + /*virtual*/ void beginPostDeferredPass(S32 pass) override; + /*virtual*/ void endPostDeferredPass(S32 pass) override; + /*virtual*/ void renderPostDeferred(S32 pass) override { render(pass); } + /*virtual*/ S32 getNumDeferredPasses() override { return 1; } + /*virtual*/ void renderDeferred(S32 pass = 0) override; + + /*virtual*/ S32 getNumPasses() override; + /*virtual*/ void render(S32 pass = 0) override; + /*virtual*/ void prerender() override; + + /*virtual*/ LLViewerTexture *getDebugTexture() override; /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display void renderReflection(LLFace* face); diff --git a/indra/newview/lldrawpoolwlsky.h b/indra/newview/lldrawpoolwlsky.h index 1751ca7e5e11eede47f88ebe98621cbf1794d488..4aa887a08c5539f458f82e00604e52cc89570599 100644 --- a/indra/newview/lldrawpoolwlsky.h +++ b/indra/newview/lldrawpoolwlsky.h @@ -42,30 +42,30 @@ public: LLDrawPoolWLSky(void); /*virtual*/ ~LLDrawPoolWLSky(); - /*virtual*/ BOOL isDead() { return FALSE; } + /*virtual*/ BOOL isDead() override { return FALSE; } - /*virtual*/ S32 getNumDeferredPasses() { return 1; } - /*virtual*/ void beginDeferredPass(S32 pass); - /*virtual*/ void endDeferredPass(S32 pass); - /*virtual*/ void renderDeferred(S32 pass); + /*virtual*/ S32 getNumDeferredPasses() override { return 1; } + /*virtual*/ void beginDeferredPass(S32 pass) override; + /*virtual*/ void endDeferredPass(S32 pass) override; + /*virtual*/ void renderDeferred(S32 pass) override; - /*virtual*/ LLViewerTexture *getDebugTexture(); - /*virtual*/ void beginRenderPass( S32 pass ); - /*virtual*/ void endRenderPass( S32 pass ); - /*virtual*/ S32 getNumPasses() { return 1; } - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); - /*virtual*/ U32 getVertexDataMask() { return SKY_VERTEX_DATA_MASK; } - /*virtual*/ BOOL verify() const { return TRUE; } // Verify that all data in the draw pool is correct! - /*virtual*/ S32 getVertexShaderLevel() const { return mVertexShaderLevel; } + /*virtual*/ LLViewerTexture *getDebugTexture() override; + /*virtual*/ void beginRenderPass( S32 pass ) override; + /*virtual*/ void endRenderPass( S32 pass ) override; + /*virtual*/ S32 getNumPasses() override { return 1; } + /*virtual*/ void render(S32 pass = 0) override; + /*virtual*/ void prerender() override; + /*virtual*/ U32 getVertexDataMask() override { return SKY_VERTEX_DATA_MASK; } + /*virtual*/ BOOL verify() const override { return TRUE; } // Verify that all data in the draw pool is correct! + /*virtual*/ S32 getVertexShaderLevel() const override { return mVertexShaderLevel; } //static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = NULL); // Create an empty new instance of the pool. - /*virtual*/ LLDrawPoolWLSky *instancePool(); ///< covariant override - /*virtual*/ LLViewerTexture* getTexture(); - /*virtual*/ BOOL isFacePool() { return FALSE; } - /*virtual*/ void resetDrawOrders(); + /*virtual*/ LLDrawPoolWLSky *instancePool() override; ///< covariant override + /*virtual*/ LLViewerTexture* getTexture() override; + /*virtual*/ BOOL isFacePool() override { return FALSE; } + /*virtual*/ void resetDrawOrders() override; static void cleanupGL(); static void restoreGL(); diff --git a/indra/newview/lldroptarget.h b/indra/newview/lldroptarget.h index 52529b1393aa6e1fa51d9ecfd0abadf8c318b855..d97763bb964dbf99e2db7c458cf65495a4e19b88 100644 --- a/indra/newview/lldroptarget.h +++ b/indra/newview/lldroptarget.h @@ -51,11 +51,11 @@ public: // // LLView functionality - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; void setAgentID(const LLUUID &agent_id) { mAgentID = agent_id; } protected: LLUUID mAgentID; diff --git a/indra/newview/lldynamictexture.h b/indra/newview/lldynamictexture.h index f3f57c9a6b2752e110021c3733afbb33bfdd4aca..9fe1f7a869fffba149907de5ba0037bc389a1023 100644 --- a/indra/newview/lldynamictexture.h +++ b/indra/newview/lldynamictexture.h @@ -70,7 +70,7 @@ public: EOrder order, // = ORDER_MIDDLE, BOOL clamp); - /*virtual*/ S8 getType() const ; + /*virtual*/ S8 getType() const override; S32 getOriginX() const { return mOrigin.mX; } S32 getOriginY() const { return mOrigin.mY; } diff --git a/indra/newview/lleasymessagereader.cpp b/indra/newview/lleasymessagereader.cpp index f44a69efceb5a08fdf5f6eb0575404b4d96a041b..b4869a9d1b34c6835b245dc86dfffe29951e385a 100644 --- a/indra/newview/lleasymessagereader.cpp +++ b/indra/newview/lleasymessagereader.cpp @@ -35,8 +35,8 @@ //I doubt any of this is thread safe! LLEasyMessageLogEntry::LLEasyMessageLogEntry(LogPayload entry, LLEasyMessageReader* message_reader) : mEntry(entry) +, mResponseMsg(nullptr) , mEasyMessageReader(message_reader) -, mResponseMsg(NULL) { mID.generate(); mSequenceID = 0; @@ -45,7 +45,7 @@ LLEasyMessageLogEntry::LLEasyMessageLogEntry(LogPayload entry, LLEasyMessageRead { mFlags = mEntry->mData[0]; - LLMessageTemplate* temp = NULL; + LLMessageTemplate* temp = nullptr; if (mEasyMessageReader) temp = mEasyMessageReader->decodeTemplateMessage( @@ -125,7 +125,7 @@ std::string LLEasyMessageLogEntry::getFull(BOOL beautify, BOOL show_header) { case LLMessageLogEntry::TEMPLATE: { - LLMessageTemplate* temp = NULL; + LLMessageTemplate* temp = nullptr; if(mEasyMessageReader) temp = mEasyMessageReader->decodeTemplateMessage(&(mEntry->mData[0]), mEntry->mDataSize, mEntry->mFromHost); @@ -223,7 +223,7 @@ std::string LLEasyMessageLogEntry::getFull(BOOL beautify, BOOL show_header) { // Use libxml2 instead of expat for safety. const int parse_opts = XML_PARSE_NONET | XML_PARSE_NOCDATA | XML_PARSE_NOXINCNODE | XML_PARSE_NOBLANKS; - xmlDocPtr doc = xmlReadMemory((char *)(mEntry->mData), mEntry->mDataSize, "noname.xml", NULL, parse_opts); + xmlDocPtr doc = xmlReadMemory((char *)(mEntry->mData), mEntry->mDataSize, "noname.xml", nullptr, parse_opts); if(doc) { xmlChar *xmlbuffer = nullptr; @@ -243,7 +243,7 @@ std::string LLEasyMessageLogEntry::getFull(BOOL beautify, BOOL show_header) else if (parsed_content_type == "text/html") { const int parse_opts = HTML_PARSE_NONET | HTML_PARSE_NOERROR | HTML_PARSE_NOIMPLIED | HTML_PARSE_NOBLANKS; - htmlDocPtr doc = htmlReadMemory((char *)(mEntry->mData), mEntry->mDataSize, "noname.html", NULL, parse_opts); + htmlDocPtr doc = htmlReadMemory((char *)(mEntry->mData), mEntry->mDataSize, "noname.html", nullptr, parse_opts); if (doc) { xmlChar * htmlbuffer = nullptr; @@ -309,7 +309,7 @@ LLMessageTemplate* LLEasyMessageReader::decodeTemplateMessage(U8 *data, S32 data if(data_len > MAX_BUFFER_SIZE) { LL_ERRS("") << "Tried to decode a template message of size " << data_len << ", greater than MAX_BUFFER_SIZE!" << LL_ENDL; - return NULL; + return nullptr; } U8* decodep = (&mRecvBuffer[0]); @@ -330,11 +330,11 @@ LLMessageTemplate* LLEasyMessageReader::decodeTemplateMessage(U8 *data, S32 data LL_WARNS("Messaging") << "Malformed packet received. Packet size " << data_len << " with invalid no. of acks " << acks << LL_ENDL; - return NULL; + return nullptr; } } - LLMessageTemplate* message_template = NULL; + LLMessageTemplate* message_template = nullptr; gMessageSystem->zeroCodeExpand(&decodep, &data_len); diff --git a/indra/newview/lleasymessagereader.h b/indra/newview/lleasymessagereader.h index 04aef9d4671df8b54fcc18b1fe28c4ec90c94a62..2ab3796bff8f517edb7a94689b7cc4abc113e2ee 100644 --- a/indra/newview/lleasymessagereader.h +++ b/indra/newview/lleasymessagereader.h @@ -47,8 +47,8 @@ private: class LLEasyMessageLogEntry { public: - LLEasyMessageLogEntry(LogPayload entry, LLEasyMessageReader* message_reader = NULL); - LLEasyMessageLogEntry(LLEasyMessageReader* message_reader = NULL); + LLEasyMessageLogEntry(LogPayload entry, LLEasyMessageReader* message_reader = nullptr); + LLEasyMessageLogEntry(LLEasyMessageReader* message_reader = nullptr); ~LLEasyMessageLogEntry(); LogPayload operator()() { return mEntry; }; diff --git a/indra/newview/lleasymessagesender.cpp b/indra/newview/lleasymessagesender.cpp index f08afd10022c2c75b1f847077a91bf9e80b738dd..ffd2c01f41c7799fff18a01443e8ee172d05ea4f 100644 --- a/indra/newview/lleasymessagesender.cpp +++ b/indra/newview/lleasymessagesender.cpp @@ -327,7 +327,7 @@ bool LLEasyMessageSender::sendHTTPMessage(const LLHost& region_host, const std:: target = boost::algorithm::join(split_url, "/"); } - auto headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); + auto headers = boost::make_shared<LLCore::HttpHeaders>(); auto body = LLCore::BufferArray::ptr_t(new LLCore::BufferArray()); LLCore::BufferArrayStream bas(body.get()); @@ -844,7 +844,7 @@ inline std::vector<std::string> LLEasyMessageSender::split(const std::string& in while(result) { lines.push_back(result); - result = strtok(NULL, separator.c_str()); + result = strtok(nullptr, separator.c_str()); } delete[] buffer; return lines; diff --git a/indra/newview/llemote.cpp b/indra/newview/llemote.cpp index fefa3d1139c098f715a20a4ab91c1e07e436be15..064c4d739ef16b5ef13890edd271098e25b472f7 100644 --- a/indra/newview/llemote.cpp +++ b/indra/newview/llemote.cpp @@ -46,8 +46,8 @@ //----------------------------------------------------------------------------- LLEmote::LLEmote(const LLUUID &id) : LLMotion(id) { - mCharacter = NULL; - mParam = NULL; + mCharacter = nullptr; + mParam = nullptr; //RN: flag face joint as highest priority for now, until we implement a proper animation track mJointSignature[0][LL_FACE_JOINT_NUM] = 0xff; diff --git a/indra/newview/llemote.h b/indra/newview/llemote.h index 4c516998dc69ae2384a01abe77d4438aebdf4302..1639c48103b4ff3a3f87d4e4b0fb9c86cf4b1d0a 100644 --- a/indra/newview/llemote.h +++ b/indra/newview/llemote.h @@ -69,44 +69,44 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return FALSE; } + BOOL getLoop() override { return FALSE; } // motions must report their total duration - virtual F32 getDuration() { return EMOTE_MORPH_FADEIN_TIME + EMOTE_MORPH_IN_TIME + EMOTE_MORPH_FADEOUT_TIME; } + F32 getDuration() override { return EMOTE_MORPH_FADEIN_TIME + EMOTE_MORPH_IN_TIME + EMOTE_MORPH_FADEOUT_TIME; } // motions must report their "ease in" duration - virtual F32 getEaseInDuration() { return EMOTE_MORPH_FADEIN_TIME; } + F32 getEaseInDuration() override { return EMOTE_MORPH_FADEIN_TIME; } // motions must report their "ease out" duration. - virtual F32 getEaseOutDuration() { return EMOTE_MORPH_FADEOUT_TIME; } + F32 getEaseOutDuration() override { return EMOTE_MORPH_FADEOUT_TIME; } // called to determine when a motion should be activated/deactivated based on avatar pixel coverage - virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_EMOTE; } + F32 getMinPixelArea() override { return MIN_REQUIRED_PIXEL_AREA_EMOTE; } // motions must report their priority - virtual LLJoint::JointPriority getPriority() { return LLJoint::MEDIUM_PRIORITY; } + LLJoint::JointPriority getPriority() override { return LLJoint::MEDIUM_PRIORITY; } - virtual LLMotionBlendType getBlendType() { return NORMAL_BLEND; } + LLMotionBlendType getBlendType() override { return NORMAL_BLEND; } // run-time (post constructor) initialization, // called after parameters have been set // must return true to indicate success and be available for activation - virtual LLMotionInitStatus onInitialize(LLCharacter *character); + LLMotionInitStatus onInitialize(LLCharacter *character) override; // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + BOOL onActivate() override; // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + BOOL onUpdate(F32 time, U8* joint_mask) override; // called when a motion is deactivated - virtual void onDeactivate(); + void onDeactivate() override; - virtual BOOL canDeprecate() { return FALSE; } + BOOL canDeprecate() override { return FALSE; } protected: diff --git a/indra/newview/llenvmanager.h b/indra/newview/llenvmanager.h index 6a0a267f4e355b0d78945f2469c8dc423eca9ae3..5dd49419697a1d764bb403fc4828efc5bffba404 100644 --- a/indra/newview/llenvmanager.h +++ b/indra/newview/llenvmanager.h @@ -53,14 +53,14 @@ class LLEnvironmentSettings public: LLEnvironmentSettings() : mWLDayCycle(LLSD::emptyMap()), - mSkyMap(LLSD::emptyMap()), mWaterParams(LLSD::emptyMap()), + mSkyMap(LLSD::emptyMap()), mDayTime(0.f) {} LLEnvironmentSettings(const LLSD& dayCycle, const LLSD& skyMap, const LLSD& waterParams, F64 dayTime) : mWLDayCycle(dayCycle), - mSkyMap(skyMap), mWaterParams(waterParams), + mSkyMap(skyMap), mDayTime(dayTime) {} ~LLEnvironmentSettings() {} @@ -230,7 +230,7 @@ public: void onRegionSettingsApplyResponse(bool ok); private: - /*virtual*/ void initSingleton(); + /*virtual*/ void initSingleton() override; void loadUserPrefs(); void saveUserPrefs(); diff --git a/indra/newview/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp index 7c84d1fb24245234f4e5bb3ceff0a8ccd94cf13a..ab57696e070f20250c6ded7e9c6dadc737aca7e5 100644 --- a/indra/newview/llestateinfomodel.cpp +++ b/indra/newview/llestateinfomodel.cpp @@ -89,9 +89,9 @@ void LLEstateInfoModel::update(const strings_t& strings) // it draws with a weird character at the end of the string. mName = strings[0]; mOwnerID = LLUUID(strings[1].c_str()); - mID = strtoul(strings[2].c_str(), NULL, 10); - mFlags = strtoul(strings[3].c_str(), NULL, 10); - mSunHour = ((F32)(strtod(strings[4].c_str(), NULL)))/1024.0f; + mID = strtoul(strings[2].c_str(), nullptr, 10); + mFlags = strtoul(strings[3].c_str(), nullptr, 10); + mSunHour = ((F32)(strtod(strings[4].c_str(), nullptr)))/1024.0f; LL_DEBUGS("Windlight Sync") << "Received estate info: " << "is_sun_fixed = " << getUseFixedSun() diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp index 82718d8f0dbe11f6d3b3e2b941b103e4fe8d374b..35bfb48b4f35df8be9d64429cb5a9b352517af90 100644 --- a/indra/newview/lleventnotifier.cpp +++ b/indra/newview/lleventnotifier.cpp @@ -45,7 +45,7 @@ public: // requires trusted browser to trigger LLEventHandler() : LLCommandHandler("event", UNTRUSTED_THROTTLE) { } bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + LLMediaCtrl* web) override { if (params.size() < 2) { diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 75b5e0c0da88eda30f6c76a20e768cf45338f318..5424eda7157ce8297a4d2cb0bb64702e82445226 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -98,8 +98,8 @@ namespace Details { LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp()); - mHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest); - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpRequest = boost::make_shared<LLCore::HttpRequest>(); + mHttpOptions = boost::make_shared<LLCore::HttpOptions>(); mHttpOptions->setRetries(0); mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_LONG_POLL); mSenderIp = sender.getIPandPort(); diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 6df16ec7214c5bc22576a0c7de8b8d5cc8e5feb7..5118dc861ac92255b97c1e5eb99b80d12ad6bbf1 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -46,7 +46,7 @@ public: mExpanderLabel(more_text) {} - /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const + /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const override { // more label always spans width of text box if (num_chars == 0) @@ -61,11 +61,11 @@ public: } return true; } - /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const + /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const override { return start_offset; } - /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const + /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const override { // require full line to ourselves if (line_offset == 0) @@ -79,7 +79,7 @@ public: return 0; } } - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) override { F32 right_x; mStyle->getFont()->renderUTF8(mExpanderLabel, start, @@ -93,11 +93,12 @@ public: mEditor.getUseEllipses()); return right_x; } - /*virtual*/ bool canEdit() const { return false; } + /*virtual*/ bool canEdit() const override { return false; } // eat handleMouseDown event so we get the mouseup event - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) { return TRUE; } - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) { mEditor.onCommit(); return TRUE; } - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override { return TRUE; } + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override + { mEditor.onCommit(); return TRUE; } + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override { LLUI::getWindow()->setCursor(UI_CURSOR_HAND); return TRUE; @@ -221,11 +222,11 @@ LLExpandableTextBox::Params::Params() LLExpandableTextBox::LLExpandableTextBox(const Params& p) : LLUICtrl(p), mMaxHeight(p.max_height), + mExpanded(false), mBGVisible(p.bg_visible), mExpandedBGVisible(p.expanded_bg_visible), mBGColor(p.bg_color), - mExpandedBGColor(p.expanded_bg_color), - mExpanded(false) + mExpandedBGColor(p.expanded_bg_color) { LLRect rc = getLocalRect(); diff --git a/indra/newview/llexpandabletextbox.h b/indra/newview/llexpandabletextbox.h index aaf393277f053b92154e44593e781f25e597ba26..75c3c3267af44fbc6dc0cd0a4eb417c2a07e6705 100644 --- a/indra/newview/llexpandabletextbox.h +++ b/indra/newview/llexpandabletextbox.h @@ -52,8 +52,8 @@ protected: }; // adds or removes "More" link as needed - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ void setText(const LLStringExplicit& text, const LLStyle::Params& input_params = LLStyle::Params()); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + /*virtual*/ void setText(const LLStringExplicit& text, const LLStyle::Params& input_params = LLStyle::Params()) override; void setTextBase(const std::string& text) { LLTextBase::setText(text); } /** @@ -126,33 +126,33 @@ public: /** * Sets text */ - /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void setValue(const LLSD& value) override; /** * Returns text */ - /*virtual*/ LLSD getValue() const { return mText; } + /*virtual*/ LLSD getValue() const override { return mText; } /** * Collapses text box on focus_lost event */ - /*virtual*/ void onFocusLost(); + /*virtual*/ void onFocusLost() override; /** * Collapses text box on top_lost event */ - /*virtual*/ void onTopLost(); + /*virtual*/ void onTopLost() override; /** * *HACK: Update the inner textbox shape. */ void updateTextShape(); - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; /** * Draws text box, collapses text box if its expanded and its parent's position changed */ - /*virtual*/ void draw(); + /*virtual*/ void draw() override; protected: diff --git a/indra/newview/llexperiencelog.cpp b/indra/newview/llexperiencelog.cpp index ccbe65900aafa0c7c86413c4938a6a14e4e72751..c27f25e7dc1d4e92e26c27270c13a5dfbaf2f2ea 100644 --- a/indra/newview/llexperiencelog.cpp +++ b/indra/newview/llexperiencelog.cpp @@ -41,11 +41,11 @@ class LLExperienceLogDispatchHandler : public LLDispatchHandler { public: - virtual bool operator()( + bool operator()( const LLDispatcher* dispatcher, const std::string& key, const LLUUID& invoice, - const sparam_t& strings) + const sparam_t& strings) override { LLSD message; diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 69b9a39086a091952af01a4426ab84bb66a312c8..d7aeabb1c23308111d3e9f4fcb9592d186829704 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -132,7 +132,7 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp) mVSize = 0.f; mPixelArea = 16.f; mState = GLOBAL; - mDrawPoolp = NULL; + mDrawPoolp = nullptr; mPoolType = 0; mCenterLocal = objp->getPosition(); mCenterAgent = drawablep->getPositionAgent(); @@ -148,7 +148,7 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp) for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i) { mIndexInTex[i] = 0; - mTexture[i] = NULL; + mTexture[i] = nullptr; } mTEOffset = -1; @@ -159,8 +159,8 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp) mReferenceIndex = -1; - mTextureMatrix = NULL; - mDrawInfo = NULL; + mTextureMatrix = nullptr; + mDrawInfo = nullptr; mFaceColor = LLColor4(1,0,0,1); @@ -202,13 +202,13 @@ void LLFace::destroy() mDrawPoolp->removeFace(this); } - mDrawPoolp = NULL; + mDrawPoolp = nullptr; } if (mTextureMatrix) { delete mTextureMatrix; - mTextureMatrix = NULL; + mTextureMatrix = nullptr; if (mDrawablep.notNull()) { @@ -221,10 +221,10 @@ void LLFace::destroy() } } - setDrawInfo(NULL); + setDrawInfo(nullptr); - mDrawablep = NULL; - mVObjp = NULL; + mDrawablep = nullptr; + mVObjp = nullptr; } @@ -438,7 +438,7 @@ void LLFace::setSize(S32 num_vertices, S32 num_indices, bool align) { mGeomCount = num_vertices; mIndicesCount = num_indices; - mVertexBuffer = NULL; + mVertexBuffer = nullptr; } llassert(verify()); @@ -449,7 +449,7 @@ void LLFace::setGeomIndex(U16 idx) if (mGeomIndex != idx) { mGeomIndex = idx; - mVertexBuffer = NULL; + mVertexBuffer = nullptr; } } @@ -478,7 +478,7 @@ void LLFace::setIndicesIndex(S32 idx) if (mIndicesIndex != idx) { mIndicesIndex = idx; - mVertexBuffer = NULL; + mVertexBuffer = nullptr; } } @@ -538,7 +538,7 @@ void LLFace::updateCenterAgent() void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) { - if (mDrawablep->getSpatialGroup() == NULL) + if (mDrawablep->getSpatialGroup() == nullptr) { return; } @@ -635,14 +635,14 @@ void LLFace::setDrawInfo(LLDrawInfo* draw_info) { if (draw_info->mFace) { - draw_info->mFace->setDrawInfo(NULL); + draw_info->mFace->setDrawInfo(nullptr); } draw_info->mFace = this; } if (mDrawInfo) { - mDrawInfo->mFace = NULL; + mDrawInfo->mFace = nullptr; } mDrawInfo = draw_info; @@ -917,7 +917,7 @@ LLVector2 LLFace::surfaceToTexture(LLVector2 surface_coord, const LLVector4a& po const LLTextureEntry *tep = getTextureEntry(); - if (tep == NULL) + if (tep == nullptr) { // can't do much without the texture entry return surface_coord; @@ -2416,7 +2416,7 @@ S32 LLFace::renderElements(const U16 *index_array) const S32 LLFace::renderIndexed() { - if(mDrawablep.isNull() || mDrawPoolp == NULL) + if(mDrawablep.isNull() || mDrawPoolp == nullptr) { return 0; } @@ -2485,7 +2485,7 @@ void LLFace::setVertexBuffer(LLVertexBuffer* buffer) void LLFace::clearVertexBuffer() { - mVertexBuffer = NULL; + mVertexBuffer = nullptr; } //static diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 83ebf8302af1b8b92b29a7f5d9856a5dc08bdc04..c207bb8f5e48fc0fa6312e0bf594863ed947617e 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -203,7 +203,7 @@ public: S32 getReferenceIndex() const { return mReferenceIndex; } void setReferenceIndex(const S32 index) { mReferenceIndex = index; } - BOOL verify(const U32* indices_array = NULL) const; + BOOL verify(const U32* indices_array = nullptr) const; void printDebugInfo() const; void setGeomIndex(U16 idx); diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 940e0606a47b277c737513f6f4b6a142ec980031..87268781807f4c9b34079c3b82afc7dd4a1f3129 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -94,7 +94,7 @@ class LLFacebookConnectHandler : public LLCommandHandler public: LLFacebookConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE) { } - bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) override { if (tokens.size() >= 1) { diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 776d3ad004b54363189f54ceba1a02eb2969c579..fd1f04a727a78d37f0855e74a707c79495b4325d 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -85,14 +85,14 @@ S32 get_depth(const BlockTimerStatHandle* blockp) LLFastTimerView::LLFastTimerView(const LLSD& key) : LLFloater(key), - mHoverTimer(NULL), - mDisplayMode(0), mDisplayType(DISPLAY_TIME), + mPauseHistory(false), mScrollIndex(0), - mHoverID(NULL), mHoverBarIndex(-1), mStatsIndex(-1), - mPauseHistory(false), + mDisplayMode(0), + mHoverID(nullptr), + mHoverTimer(nullptr), mRecording(NUM_FRAMES_HISTORY), mScrollPos(0), mMetricCombo(nullptr), @@ -184,7 +184,7 @@ BlockTimerStatHandle* LLFastTimerView::getLegendID(S32 y) return ft_display_idx[idx]; } - return NULL; + return nullptr; } BOOL LLFastTimerView::handleDoubleClick(S32 x, S32 y, MASK mask) @@ -226,7 +226,7 @@ BOOL LLFastTimerView::handleMouseUp(S32 x, S32 y, MASK mask) { if (hasMouseCapture()) { - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); } return LLFloater::handleMouseUp(x, y, mask);; } @@ -240,8 +240,8 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) mScrollIndex = llclamp( mScrollIndex, 0, (S32)mRecording.getNumRecordedPeriods()); return TRUE; } - mHoverTimer = NULL; - mHoverID = NULL; + mHoverTimer = nullptr; + mHoverID = nullptr; if(mPauseHistory && mBarRect.pointInRect(x, y)) { @@ -262,7 +262,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) TimerBarRow& row = mHoverBarIndex == 0 ? mAverageTimerRow : mTimerBarRows[mScrollIndex + mHoverBarIndex - 1]; - TimerBar* hover_bar = NULL; + TimerBar* hover_bar = nullptr; F32Seconds mouse_time_offset = ((F32)(x - mBarRect.mLeft) / (F32)mBarRect.getWidth()) * mTotalTimeDisplay; for (S32 bar_index = 0, end_index = LLTrace::BlockTimerStatHandle::instance_tracker_t::instanceCount(); bar_index < end_index; @@ -439,7 +439,7 @@ void LLFastTimerView::draw() LLView::draw(); mAllTimeMax = llmax(mAllTimeMax, mRecording.getLastRecording().getSum(FTM_FRAME)); - mHoverID = NULL; + mHoverID = nullptr; mHoverBarIndex = -1; } @@ -1092,7 +1092,7 @@ void LLFastTimerView::drawLineGraph() F32 alpha = 1.f; bool is_hover_timer = true; - if (mHoverID != NULL && + if (mHoverID != nullptr && mHoverID != idp) { //fade out non-highlighted timers if (idp->getParent() != mHoverID) @@ -1172,7 +1172,7 @@ void LLFastTimerView::drawLineGraph() : llmin(cur_max/ max_time - 1.f,1.f); alpha_interp = lerp(alpha_interp, alpha_target, LLSmoothInterpolation::getInterpolant(0.1f)); - if (mHoverID != NULL) + if (mHoverID != nullptr) { S32 x = (mGraphRect.mRight + mGraphRect.mLeft)/2; S32 y = mGraphRect.mBottom + 8; @@ -1571,7 +1571,7 @@ S32 LLFastTimerView::updateTimerBarOffsets(LLTrace::BlockTimerStatHandle* time_b //now loop through children and figure out portion of bar image covered by each bar, now that we know the //sum of all children F32 bar_fraction_start = 0.f; - TimerBar* last_child_timer_bar = NULL; + TimerBar* last_child_timer_bar = nullptr; bool first_child = true; for (BlockTimerStatHandle::child_iter it = time_block->beginChildren(), end_it = time_block->endChildren(); diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 6bd054592c4f047be7b5eb09b9c765b59dc56e44..7084ce3f76f5ffd2d3188bf5a5934d078914e7ac 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -42,7 +42,7 @@ class LLFastTimerView : public LLFloater public: LLFastTimerView(const LLSD&); ~LLFastTimerView(); - BOOL postBuild(); + BOOL postBuild() override; static BOOL sAnalyzePerformance; @@ -57,16 +57,16 @@ private: public: - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); - virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - virtual void draw(); - virtual void onOpen(const LLSD& key); - virtual void onClose(bool app_quitting); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleToolTip(S32 x, S32 y, MASK mask) override; + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + void draw() override; + void onOpen(const LLSD& key) override; + void onClose(bool app_quitting) override; LLTrace::BlockTimerStatHandle* getLegendID(S32 y); private: @@ -110,7 +110,7 @@ private: TimerBarRow() : mBottom(0), mTop(0), - mBars(NULL) + mBars(nullptr) {} ~TimerBarRow(); S32 mBottom, diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index f5e8258cb2259d6d3a9b808bad2fbbcdc68e1a9f..da131225ce1a1639a4a9a1689c0ce36241d7bc15 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -56,20 +56,20 @@ protected: public: virtual ~LLFavoritesBarCtrl(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; // LLInventoryObserver observer trigger - virtual void changed(U32 mask); - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - virtual void draw(); + void changed(U32 mask) override; + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + void draw() override; void showDragMarker(BOOL show) { mShowDragMarker = show; } void setLandingTab(LLUICtrl* tab) { mLandingTab = tab; } diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 1673f2d3acbb7b654a7fa1902ef530d547d66d55..9916a2dd236596519417c36af26f90b32010a2d2 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -239,7 +239,7 @@ LLFeatureList *LLFeatureManager::findMask(const std::string& name) return mMaskList[name]; } - return NULL; + return nullptr; } BOOL LLFeatureManager::maskFeatures(const std::string& name) @@ -326,7 +326,7 @@ bool LLFeatureManager::parseFeatureTable(std::string filename) mTableVersion = version; - LLFeatureList *flp = NULL; + LLFeatureList *flp = nullptr; bool parse_ok = true; while (file >> name && parse_ok) { @@ -600,7 +600,7 @@ void LLFeatureManager::applyFeatures(bool skipFeatures) // get the control setting LLControlVariable* ctrl = gSavedSettings.getControl(mIt->first); - if(ctrl == NULL) + if(ctrl == nullptr) { LL_WARNS() << "AHHH! Control setting " << mIt->first << " does not exist!" << LL_ENDL; continue; @@ -670,7 +670,7 @@ void LLFeatureManager::applyBaseMasks() mFeatures.clear(); LLFeatureList* maskp = findMask("all"); - if(maskp == NULL) + if(maskp == nullptr) { LL_WARNS("RenderInit") << "AHH! No \"all\" in feature table!" << LL_ENDL; return; @@ -813,7 +813,7 @@ LLSD LLFeatureManager::getRecommendedSettingsMap() for (feature_map_t::iterator mIt = mFeatures.begin(); mIt != mFeatures.end(); ++mIt) { LLControlVariable* ctrl = gSavedSettings.getControl(mIt->first); - if (ctrl == NULL) + if (ctrl == nullptr) { LL_WARNS() << "AHHH! Control setting " << mIt->first << " does not exist!" << LL_ENDL; continue; diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 2d90e8c5e3d94206108ec4f6c3898e5185d539f8..8e095312025c513acb9595dd0d847a16b3b04452 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -98,23 +98,23 @@ LLFilePicker::LLFilePicker() #if LL_WINDOWS mOFN.lStructSize = sizeof(OPENFILENAMEW); - mOFN.hwndOwner = NULL; // Set later - mOFN.hInstance = NULL; - mOFN.lpstrCustomFilter = NULL; + mOFN.hwndOwner = nullptr; // Set later + mOFN.hInstance = nullptr; + mOFN.lpstrCustomFilter = nullptr; mOFN.nMaxCustFilter = 0; - mOFN.lpstrFile = NULL; // set in open and close + mOFN.lpstrFile = nullptr; // set in open and close mOFN.nMaxFile = LL_MAX_PATH; - mOFN.lpstrFileTitle = NULL; + mOFN.lpstrFileTitle = nullptr; mOFN.nMaxFileTitle = 0; - mOFN.lpstrInitialDir = NULL; - mOFN.lpstrTitle = NULL; + mOFN.lpstrInitialDir = nullptr; + mOFN.lpstrTitle = nullptr; mOFN.Flags = 0; // set in open and close mOFN.nFileOffset = 0; mOFN.nFileExtension = 0; - mOFN.lpstrDefExt = NULL; + mOFN.lpstrDefExt = nullptr; mOFN.lCustData = 0L; - mOFN.lpfnHook = NULL; - mOFN.lpTemplateName = NULL; + mOFN.lpfnHook = nullptr; + mOFN.lpTemplateName = nullptr; mFilesW[0] = '\0'; #endif @@ -405,7 +405,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename) switch( filter ) { case FFSAVE_ALL: - mOFN.lpstrDefExt = NULL; + mOFN.lpstrDefExt = nullptr; mOFN.lpstrFilter = L"All Files (*.*)\0*.*\0" \ L"WAV Sounds (*.wav)\0*.wav\0" \ diff --git a/indra/newview/llfilteredwearablelist.h b/indra/newview/llfilteredwearablelist.h index 197302f41dc4e925bb0bf6e21615b8afc4b36ed3..8fa2dbbca79d052ace87d9b9d383270190cfead6 100644 --- a/indra/newview/llfilteredwearablelist.h +++ b/indra/newview/llfilteredwearablelist.h @@ -44,7 +44,7 @@ public: /** LLInventoryObserver implementation * */ - /*virtual*/ void changed(U32 mask); + /*virtual*/ void changed(U32 mask) override; /** * Sets new collector and applies it immediately diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index 715fe5ce8761ac5fe3aedfb02efe8e856d9e12b6..db42fb161777484f7d421a05ed8fbd0d8b88449a 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -256,7 +256,7 @@ void LLVolumeImplFlexible::setAttributesOfAllSections(LLVector3* inScale) S32 num_sections = 1 << mSimulateRes; LLVector3 scale; - if (inScale == (LLVector3*)NULL) + if (inScale == (LLVector3*)nullptr) { scale = mVO->mDrawable->getScale(); } diff --git a/indra/newview/llflexibleobject.h b/indra/newview/llflexibleobject.h index a00551df8e10b5357f79a89f19ac7de52a026af0..beb2f0903ff5176926c4a8c4df03fc6c4b108d58 100644 --- a/indra/newview/llflexibleobject.h +++ b/indra/newview/llflexibleobject.h @@ -82,26 +82,26 @@ private: ~LLVolumeImplFlexible(); // Implements LLVolumeInterface - U32 getID() const { return mID; } + U32 getID() const override { return mID; } LLVector3 getFramePosition() const; LLQuaternion getFrameRotation() const; - LLVolumeInterfaceType getInterfaceType() const { return INTERFACE_FLEXIBLE; } + LLVolumeInterfaceType getInterfaceType() const override { return INTERFACE_FLEXIBLE; } void updateRenderRes(); - void doIdleUpdate(); - BOOL doUpdateGeometry(LLDrawable *drawable); - LLVector3 getPivotPosition() const; - void onSetVolume(const LLVolumeParams &volume_params, const S32 detail); - void onSetScale(const LLVector3 &scale, BOOL damped); - void onParameterChanged(U16 param_type, LLNetworkData *data, BOOL in_use, bool local_origin); - void onShift(const LLVector4a &shift_vector); - bool isVolumeUnique() const { return true; } - bool isVolumeGlobal() const { return true; } - bool isActive() const { return true; } - const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const; - void updateRelativeXform(bool force_identity); + void doIdleUpdate() override; + BOOL doUpdateGeometry(LLDrawable *drawable) override; + LLVector3 getPivotPosition() const override; + void onSetVolume(const LLVolumeParams &volume_params, const S32 detail) override; + void onSetScale(const LLVector3 &scale, BOOL damped) override; + void onParameterChanged(U16 param_type, LLNetworkData *data, BOOL in_use, bool local_origin) override; + void onShift(const LLVector4a &shift_vector) override; + bool isVolumeUnique() const override { return true; } + bool isVolumeGlobal() const override { return true; } + bool isActive() const override { return true; } + const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const override; + void updateRelativeXform(bool force_identity) override; void doFlexibleUpdate(); // Called to update the simulation void doFlexibleRebuild(bool rebuild_volume); // Called to rebuild the geometry - void preRebuild(); + void preRebuild() override; //void setAttributes( LLFlexibleObjectData ); void setParentPositionAndRotationDirectly( LLVector3 p, LLQuaternion r ); @@ -141,7 +141,7 @@ private: //-------------------------------------- // private methods //-------------------------------------- - void setAttributesOfAllSections (LLVector3* inScale = NULL); + void setAttributesOfAllSections (LLVector3* inScale = nullptr); void remapSections(LLFlexibleObjectSection *source, S32 source_sections, LLFlexibleObjectSection *dest, S32 dest_sections); diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index ef9a7388c9fe9c181c34ac6bc9bbbcea9b2d4025..9267616b6c7d7a728d9a977d87aa1b4be57a1d5d 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -84,7 +84,7 @@ private: virtual ~LLFloaterAbout(); public: - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /// Obtain the data used to fill out the contents string. This is /// separated so that we can programmatically access the same info. diff --git a/indra/newview/llfloaterao.cpp b/indra/newview/llfloaterao.cpp index 35b008e2cbdec49f3e376cf80ebc9b482135f7de..f0e7746f52863d0ff33ddcedd8527f3c69cbd316 100644 --- a/indra/newview/llfloaterao.cpp +++ b/indra/newview/llfloaterao.cpp @@ -188,7 +188,7 @@ void LLFloaterAO::updateList() mSetSelector->clear(); mAnimationList->deleteAllItems(); - mCurrentBoldItem = NULL; + mCurrentBoldItem = nullptr; reloading(false); if (mSetList.empty()) @@ -372,7 +372,7 @@ LLScrollListItem* LLFloaterAO::addAnimation(const std::string& name) void LLFloaterAO::onSelectState() { mAnimationList->deleteAllItems(); - mCurrentBoldItem = NULL; + mCurrentBoldItem = nullptr; mAnimationList->setCommentText(getString("ao_no_animations_loaded")); mAnimationList->setEnabled(FALSE); diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index 46d13cb1d09090532102b701df768686d6e0b789..d3e6783ec961971c3a1b391d1e06bca5a9b0e2a3 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -141,7 +141,7 @@ void LLFloaterAuction::initialize() } mImageID.setNull(); - mImage = NULL; + mImage = nullptr; } void LLFloaterAuction::draw() @@ -268,7 +268,7 @@ void LLFloaterAuction::onClickStartAuction(void* data) void LLFloaterAuction::cleanupAndClose() { mImageID.setNull(); - mImage = NULL; + mImage = nullptr; mParcelID = -1; mParcelHost.invalidate(); closeFloater(); diff --git a/indra/newview/llfloaterauction.h b/indra/newview/llfloaterauction.h index c83a11ba8b9af0b2d782cb33b690a30f6bdb85fd..8f2bf40b5b0d7cc7e4809a4b7ccd289dbda24e55 100644 --- a/indra/newview/llfloaterauction.h +++ b/indra/newview/llfloaterauction.h @@ -47,8 +47,8 @@ class LLFloaterAuction : public LLFloater friend class LLFloaterReg; public: // LLFloater interface - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void draw(); + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void draw() override; private: @@ -63,7 +63,7 @@ private: bool onSellToAnyoneConfirmed(const LLSD& notification, const LLSD& response); // Sell confirmation clicked static void onClickStartAuction(void* data); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void doResetParcel(); void doSellToAnyone(); diff --git a/indra/newview/llfloaterautoreplacesettings.cpp b/indra/newview/llfloaterautoreplacesettings.cpp index 675d64a14c22df53d6702028a67520a453547723..0db18c28eaef8e0049e935b546726fe455650d8b 100644 --- a/indra/newview/llfloaterautoreplacesettings.cpp +++ b/indra/newview/llfloaterautoreplacesettings.cpp @@ -68,11 +68,11 @@ LLFloaterAutoReplaceSettings::LLFloaterAutoReplaceSettings(const LLSD& key) : LLFloater(key) , mSelectedListName("") - , mListNames(NULL) - , mReplacementsList(NULL) - , mKeyword(NULL) + , mListNames(nullptr) + , mReplacementsList(nullptr) + , mKeyword(nullptr) , mPreviousKeyword("") - , mReplacement(NULL) + , mReplacement(nullptr) { } diff --git a/indra/newview/llfloaterautoreplacesettings.h b/indra/newview/llfloaterautoreplacesettings.h index 7585e9deff6fc3a3ddcbd769a71dd357c22d530f..e7780f51b7635a639ee4bc47be50bb551c2968bb 100644 --- a/indra/newview/llfloaterautoreplacesettings.h +++ b/indra/newview/llfloaterautoreplacesettings.h @@ -40,8 +40,8 @@ class LLFloaterAutoReplaceSettings : public LLFloater public: LLFloaterAutoReplaceSettings(const LLSD& key); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onClose(bool app_quitting) override; void setData(void * data); diff --git a/indra/newview/llfloateravatar.h b/indra/newview/llfloateravatar.h index cadc5e4028be24ed39f4bec922eaf4f3469bc81d..fa0722616b7ba6730d5978d350494d8bc4afcbda 100644 --- a/indra/newview/llfloateravatar.h +++ b/indra/newview/llfloateravatar.h @@ -37,7 +37,7 @@ class LLFloaterAvatar: private: LLFloaterAvatar(const LLSD& key); /*virtual*/ ~LLFloaterAvatar(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; }; #endif diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index a7060a84405cca4d67456687ee56d89bcac3552b..2439ec9aa904679d7f99c35a3f62a5de96ce4ddb 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -74,7 +74,7 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback, if (!floater) { LL_WARNS() << "Cannot instantiate avatar picker" << LL_ENDL; - return NULL; + return nullptr; } floater->mSelectionCallback = callback; @@ -120,7 +120,7 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key) BOOL LLFloaterAvatarPicker::postBuild() { - getChild<LLLineEditor>("Edit")->setKeystrokeCallback( boost::bind(&LLFloaterAvatarPicker::editKeystroke, this, _1, _2),NULL); + getChild<LLLineEditor>("Edit")->setKeystrokeCallback( boost::bind(&LLFloaterAvatarPicker::editKeystroke, this, _1, _2), nullptr); childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this)); getChildView("Find")->setEnabled(FALSE); @@ -225,7 +225,7 @@ void LLFloaterAvatarPicker::onBtnSelect() if(mSelectionCallback) { std::string acvtive_panel_name; - LLScrollListCtrl* list = NULL; + LLScrollListCtrl* list = nullptr; LLPanel* active_panel = getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel(); if(active_panel) { @@ -546,7 +546,7 @@ void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple) LLScrollListCtrl* LLFloaterAvatarPicker::getActiveList() { std::string acvtive_panel_name; - LLScrollListCtrl* list = NULL; + LLScrollListCtrl* list = nullptr; LLPanel* active_panel = getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel(); if(active_panel) { @@ -609,7 +609,7 @@ BOOL LLFloaterAvatarPicker::handleDragAndDrop(S32 x, S32 y, MASK mask, void LLFloaterAvatarPicker::openFriendsTab() { LLTabContainer* tab_container = getChild<LLTabContainer>("ResidentChooserTabs"); - if (tab_container == NULL) + if (tab_container == nullptr) { llassert(tab_container != NULL); return; @@ -803,7 +803,7 @@ bool LLFloaterAvatarPicker::isSelectBtnEnabled() if ( ret_val ) { std::string acvtive_panel_name; - LLScrollListCtrl* list = NULL; + LLScrollListCtrl* list = nullptr; LLPanel* active_panel = getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel(); if(active_panel) diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 9517ecbb05972e763ca2f9e35a332d2eb66b3e6e..97ceb74b7fdf9306f7d8135f78742d9e9e0cf619 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -48,12 +48,12 @@ public: BOOL closeOnSelect = FALSE, BOOL skip_agent = FALSE, const std::string& name = "", - LLView * frustumOrigin = NULL); + LLView * frustumOrigin = nullptr); LLFloaterAvatarPicker(const LLSD& key); virtual ~LLFloaterAvatarPicker(); - - virtual BOOL postBuild(); + + BOOL postBuild() override; void setOkBtnEnableCb(validate_callback_t cb); @@ -63,7 +63,7 @@ public: BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; void openFriendsTab(); BOOL isExcludeAgentFromSearchResults() {return mExcludeAgentFromSearchResults;} @@ -90,8 +90,8 @@ private: LLScrollListCtrl* getActiveList(); void drawFrustum(); - virtual void draw(); - virtual BOOL handleKeyHere(KEY key, MASK mask); + void draw() override; + BOOL handleKeyHere(KEY key, MASK mask) override; LLUUID mQueryID; int mNumResultsReturned; diff --git a/indra/newview/llfloateravatarrendersettings.cpp b/indra/newview/llfloateravatarrendersettings.cpp index fde55928ba160419c2753d513e9b2f19c11386cb..4b33f91eb7b40b1ca1cd17880d67bf49d55210be 100644 --- a/indra/newview/llfloateravatarrendersettings.cpp +++ b/indra/newview/llfloateravatarrendersettings.cpp @@ -46,7 +46,7 @@ public: : mFloaterSettings(floater_settings) {} protected: - LLContextMenu* createMenu() + LLContextMenu* createMenu() override { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; @@ -62,15 +62,15 @@ protected: class LLAvatarRenderMuteListObserver : public LLMuteListObserver { - /* virtual */ void onChange() { LLFloaterAvatarRenderSettings::setNeedsUpdate();} + /* virtual */ void onChange() override { LLFloaterAvatarRenderSettings::setNeedsUpdate();} }; static LLAvatarRenderMuteListObserver sAvatarRenderMuteListObserver; LLFloaterAvatarRenderSettings::LLFloaterAvatarRenderSettings(const LLSD& key) : LLFloater(key), - mAvatarSettingsList(NULL), - mNeedsUpdate(false) + mNeedsUpdate(false), + mAvatarSettingsList(nullptr) { mContextMenu = new LLSettingsContextMenu(this); LLRenderMuteList::getInstance()->addObserver(&sAvatarRenderMuteListObserver); @@ -184,7 +184,7 @@ static LLVOAvatar* find_avatar(const LLUUID& id) } else { - return NULL; + return nullptr; } } diff --git a/indra/newview/llfloateravatarrendersettings.h b/indra/newview/llfloateravatarrendersettings.h index fe727bcf3279b0bbbcf8b8768a0578b03f0efa60..0228c91f03ecc5c5424ac2e7fc5455855e2c9106 100644 --- a/indra/newview/llfloateravatarrendersettings.h +++ b/indra/newview/llfloateravatarrendersettings.h @@ -40,9 +40,9 @@ public: LLFloaterAvatarRenderSettings(const LLSD& key); virtual ~LLFloaterAvatarRenderSettings(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void draw() override; void onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y); diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp index 826fae02d8fff8824be03a34bbb732f1a39135a3..16f6463c62db86caa6c8b0974e56a43ca83fb17f 100644 --- a/indra/newview/llfloateravatartextures.cpp +++ b/indra/newview/llfloateravatartextures.cpp @@ -130,7 +130,7 @@ static LLVOAvatar* find_avatar(const LLUUID& id) } else { - return NULL; + return nullptr; } } diff --git a/indra/newview/llfloateravatartextures.h b/indra/newview/llfloateravatartextures.h index 58c747228619d79ace0f1eaa91203b020cf9ad33..4882d9eb551b71b25b40f91c9ebf3b7d87610697 100644 --- a/indra/newview/llfloateravatartextures.h +++ b/indra/newview/llfloateravatartextures.h @@ -39,10 +39,10 @@ public: LLFloaterAvatarTextures(const LLSD& id); virtual ~LLFloaterAvatarTextures(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void draw() override; - void refresh(); + void refresh() override; private: static void onClickDump(void*); diff --git a/indra/newview/llfloaterbeacons.cpp b/indra/newview/llfloaterbeacons.cpp index cdb9bb824e62717f1b5e5a423e14ba2ebf476a3b..c5c5b0aca7647e466dea85a23078f4298798e2e0 100644 --- a/indra/newview/llfloaterbeacons.cpp +++ b/indra/newview/llfloaterbeacons.cpp @@ -67,11 +67,11 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl) std::string name = check->getName(); if(name == "touch_only") { - LLPipeline::toggleRenderScriptedTouchBeacons(NULL); + LLPipeline::toggleRenderScriptedTouchBeacons(nullptr); // Don't allow both to be ON at the same time. Toggle the other one off if both now on. if ( - LLPipeline::getRenderScriptedTouchBeacons(NULL) && - LLPipeline::getRenderScriptedBeacons(NULL) ) + LLPipeline::getRenderScriptedTouchBeacons(nullptr) && + LLPipeline::getRenderScriptedBeacons(nullptr) ) { LLPipeline::setRenderScriptedBeacons(FALSE); getChild<LLCheckBoxCtrl>("scripted")->setControlValue(LLSD(FALSE)); @@ -82,11 +82,11 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl) } else if(name == "scripted") { - LLPipeline::toggleRenderScriptedBeacons(NULL); + LLPipeline::toggleRenderScriptedBeacons(nullptr); // Don't allow both to be ON at the same time. Toggle the other one off if both now on. if ( - LLPipeline::getRenderScriptedTouchBeacons(NULL) && - LLPipeline::getRenderScriptedBeacons(NULL) ) + LLPipeline::getRenderScriptedTouchBeacons(nullptr) && + LLPipeline::getRenderScriptedBeacons(nullptr) ) { LLPipeline::setRenderScriptedTouchBeacons(FALSE); getChild<LLCheckBoxCtrl>("touch_only")->setControlValue(LLSD(FALSE)); @@ -101,11 +101,11 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl) else if(name == "moapbeacon") LLPipeline::setRenderMOAPBeacons(check->get()); else if(name == "highlights") { - LLPipeline::toggleRenderHighlights(NULL); + LLPipeline::toggleRenderHighlights(nullptr); // Don't allow both to be OFF at the same time. Toggle the other one on if both now off. if ( - !LLPipeline::getRenderBeacons(NULL) && - !LLPipeline::getRenderHighlights(NULL) ) + !LLPipeline::getRenderBeacons(nullptr) && + !LLPipeline::getRenderHighlights(nullptr) ) { LLPipeline::setRenderBeacons(TRUE); getChild<LLCheckBoxCtrl>("beacons")->setControlValue(LLSD(TRUE)); @@ -116,11 +116,11 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl) } else if(name == "beacons") { - LLPipeline::toggleRenderBeacons(NULL); + LLPipeline::toggleRenderBeacons(nullptr); // Don't allow both to be OFF at the same time. Toggle the other one on if both now off. if ( - !LLPipeline::getRenderBeacons(NULL) && - !LLPipeline::getRenderHighlights(NULL) ) + !LLPipeline::getRenderBeacons(nullptr) && + !LLPipeline::getRenderHighlights(nullptr) ) { LLPipeline::setRenderHighlights(TRUE); getChild<LLCheckBoxCtrl>("highlights")->setControlValue(LLSD(TRUE)); diff --git a/indra/newview/llfloaterbeacons.h b/indra/newview/llfloaterbeacons.h index 47d06962962b550bc48b1372daf6f8701c0ed47d..5e583aef09946029be62f853929b1c35e7e67ada 100644 --- a/indra/newview/llfloaterbeacons.h +++ b/indra/newview/llfloaterbeacons.h @@ -36,7 +36,7 @@ class LLFloaterBeacons : public LLFloater public: - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; // Needed to make the floater visibility toggle the beacons. // Too bad we can't just add control_name="BeaconAlwaysOn" to the XML. diff --git a/indra/newview/llfloaterbigpreview.cpp b/indra/newview/llfloaterbigpreview.cpp index 42086479a07d96823b859aa914369161d55c4c37..b2bf748573a2d5a2390dde5a78ba87f787dc1f72 100644 --- a/indra/newview/llfloaterbigpreview.cpp +++ b/indra/newview/llfloaterbigpreview.cpp @@ -37,8 +37,8 @@ /////////////////////// LLFloaterBigPreview::LLFloaterBigPreview(const LLSD& key) : LLFloater(key), - mPreviewPlaceholder(NULL), - mFloaterOwner(NULL) + mPreviewPlaceholder(nullptr), + mFloaterOwner(nullptr) { } diff --git a/indra/newview/llfloaterbigpreview.h b/indra/newview/llfloaterbigpreview.h index 63c6784d36ead97349c3de495c53fbed90650363..cec740359156eb16206cf523901eb19263c7973e 100644 --- a/indra/newview/llfloaterbigpreview.h +++ b/indra/newview/llfloaterbigpreview.h @@ -35,8 +35,8 @@ public: LLFloaterBigPreview(const LLSD& key); ~LLFloaterBigPreview(); - BOOL postBuild(); - void draw(); + BOOL postBuild() override; + void draw() override; void onCancel(); void setPreview(LLView* previewp) { mPreviewHandle = previewp->getHandle(); } diff --git a/indra/newview/llfloaterbuildoptions.cpp b/indra/newview/llfloaterbuildoptions.cpp index 496ae9ce4a6452e4ccfac2864113c95815a9bc62..488b339b36cfd12d1f109625abcc6d648afa7a80 100644 --- a/indra/newview/llfloaterbuildoptions.cpp +++ b/indra/newview/llfloaterbuildoptions.cpp @@ -64,5 +64,5 @@ void LLFloaterBuildOptions::onOpen(const LLSD& key) // virtual void LLFloaterBuildOptions::onClose(bool app_quitting) { - mObjectSelection = NULL; + mObjectSelection = nullptr; } diff --git a/indra/newview/llfloaterbuildoptions.h b/indra/newview/llfloaterbuildoptions.h index 02c56cb6a9253a9006350b74bdeec89b80620049..0a600bc666a6caf607f0e58635432d5ede2c8413 100644 --- a/indra/newview/llfloaterbuildoptions.h +++ b/indra/newview/llfloaterbuildoptions.h @@ -43,10 +43,10 @@ class LLFloaterBuildOptions : public LLFloater { public: - virtual BOOL postBuild(); + BOOL postBuild() override; - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void onClose(bool app_quitting) override; private: friend class LLFloaterReg; diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp index 630d41d27ee719cf7e458dca67f24a7eee488062..4119e11b1f56077803d0d3682808df9b21e026e4 100644 --- a/indra/newview/llfloaterbulkpermission.cpp +++ b/indra/newview/llfloaterbulkpermission.cpp @@ -112,7 +112,8 @@ void LLFloaterBulkPermission::doApply() { public: ModifiableGatherer(std::vector<LLUUID>& q) : mQueue(q) { mQueue.reserve(32); } - virtual bool apply(LLSelectNode* node) + + bool apply(LLSelectNode* node) override { if( node->allowOperationOnNode(PERM_MODIFY, GP_OBJECT_MANIPULATE) ) { diff --git a/indra/newview/llfloaterbulkpermission.h b/indra/newview/llfloaterbulkpermission.h index 1640cfcb17fd3003e9fb99e816e5e28e6db0f5f4..cb9d6a52e9752d891bad4dd3c6d8a195bb625fea 100644 --- a/indra/newview/llfloaterbulkpermission.h +++ b/indra/newview/llfloaterbulkpermission.h @@ -42,7 +42,7 @@ class LLFloaterBulkPermission : public LLFloater, public LLVOInventoryListener friend class LLFloaterReg; public: - BOOL postBuild(); + BOOL postBuild() override; private: @@ -58,7 +58,7 @@ private: /*virtual*/ void inventoryChanged(LLViewerObject* obj, LLInventoryObject::object_list_t* inv, S32 serial_num, - void* queue); + void* queue) override; // This is called by inventoryChanged void handleInventory(LLViewerObject* viewer_obj, diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index 7c699abefe7328944fef60e8a67c3797a7cabc34..72566c74c76cba14a8b0f35acda917790b0d93bb 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -51,7 +51,7 @@ // Default constructor LLFloaterBump::LLFloaterBump(const LLSD& key) : LLFloater(key), - mList(NULL), + mList(nullptr), mPopupMenuHandle() { mCommitCallbackRegistrar.add("Avatar.SendIM", boost::bind(&LLFloaterBump::startIM, this)); @@ -197,7 +197,7 @@ void LLFloaterBump::onScrollListRightClicked(LLUICtrl* ctrl, S32 x, S32 y) std::string mute_msg = (LLMuteList::getInstance()->isMuted(mItemUUID, mNames[mItemUUID])) ? "UnmuteAvatar" : "MuteAvatar"; menu->getChild<LLUICtrl>("Avatar Mute")->setValue(LLTrans::getString(mute_msg)); - menu->setItemEnabled(LLStringExplicit("Zoom In"), (gObjectList.findObject(mItemUUID) != NULL)); + menu->setItemEnabled(LLStringExplicit("Zoom In"), (gObjectList.findObject(mItemUUID) != nullptr)); menu->show(x, y); LLMenuGL::showPopup(ctrl, menu, x, y); diff --git a/indra/newview/llfloaterbump.h b/indra/newview/llfloaterbump.h index e1601551d969bf34f4a2b0fa766a003c6dd77106..ffa019a75187a21af561e2a21ed9438d0e46c6ed 100644 --- a/indra/newview/llfloaterbump.h +++ b/indra/newview/llfloaterbump.h @@ -43,8 +43,8 @@ protected: void onScrollListRightClicked(LLUICtrl* ctrl, S32 x, S32 y); public: - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; static LLFloaterBump* getInstance(); diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index 1d6f95e6c6328c810ee14024cf660da76b80a8c0..d7cbd593392908a2f5159c67a8ea8d35e9ab6190 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -75,7 +75,7 @@ BOOL LLFloaterBuy::postBuild() LLFloaterBuy::~LLFloaterBuy() { - mObjectSelection = NULL; + mObjectSelection = nullptr; } void LLFloaterBuy::reset() @@ -184,7 +184,7 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) // sometimes the inventory is already there and // the callback is called immediately. LLViewerObject* obj = selection->getFirstRootObject(); - floater->registerVOInventoryListener(obj,NULL); + floater->registerVOInventoryListener(obj, nullptr); floater->requestVOInventory(); } diff --git a/indra/newview/llfloaterbuy.h b/indra/newview/llfloaterbuy.h index 3ec642dee1652db7334df71716e6c2eb38be0932..e86886c5662ccdf0c4558f09bd9f1a748db4f3ff 100644 --- a/indra/newview/llfloaterbuy.h +++ b/indra/newview/llfloaterbuy.h @@ -49,8 +49,8 @@ public: LLFloaterBuy(const LLSD& key); ~LLFloaterBuy(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onClose(bool app_quitting) override; static void show(const LLSaleInfo& sale_info); @@ -61,7 +61,7 @@ protected: /*virtual*/ void inventoryChanged(LLViewerObject* obj, LLInventoryObject::object_list_t* inv, S32 serial_num, - void* data); + void* data) override; void onClickBuy(); void onClickCancel(); diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index d5d33f3b09bbc4628e33882ebe907237af901328..d4140659514fcec66aae0ec1a3c80137f092b84e 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -132,7 +132,7 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) // sometimes the inventory is already there and // the callback is called immediately. LLViewerObject* obj = selection->getFirstRootObject(); - floater->registerVOInventoryListener(obj,NULL); + floater->registerVOInventoryListener(obj, nullptr); floater->requestVOInventory(); } diff --git a/indra/newview/llfloaterbuycontents.h b/indra/newview/llfloaterbuycontents.h index 19393fb6af4b4e60b65020bd172fd01b198c70e1..c5315cc08a79f9a24063533638cad27f892ad3af 100644 --- a/indra/newview/llfloaterbuycontents.h +++ b/indra/newview/llfloaterbuycontents.h @@ -48,14 +48,14 @@ public: LLFloaterBuyContents(const LLSD& key); ~LLFloaterBuyContents(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; protected: void requestObjectInventories(); /*virtual*/ void inventoryChanged(LLViewerObject* obj, LLInventoryObject::object_list_t* inv, S32 serial_num, - void* data); + void* data) override; void onClickBuy(); void onClickCancel(); diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 2664d946d063ef9cd63505313124210c9e360f4e..4cece91b78e087a7b666d59f9c3263e064321b6a 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -64,13 +64,13 @@ public: public: void noTarget(); void target(const std::string& name, S32 price); - - virtual BOOL postBuild(); + + BOOL postBuild() override; void updateUI(); - virtual void draw(); - virtual BOOL canClose(); + void draw() override; + BOOL canClose() override; void onClickBuy(); void onClickCancel(); diff --git a/indra/newview/llfloaterbuycurrencyhtml.h b/indra/newview/llfloaterbuycurrencyhtml.h index 6b1fc53f1fc4162253f3bbd1da5f8a9971627ec5..7dbe71c5f5de4b5359a988eba145885e1c15402e 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.h +++ b/indra/newview/llfloaterbuycurrencyhtml.h @@ -37,11 +37,11 @@ class LLFloaterBuyCurrencyHTML : public: LLFloaterBuyCurrencyHTML( const LLSD& key ); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose( bool app_quitting ); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onClose( bool app_quitting ) override; // inherited from LLViewerMediaObserver - /*virtual*/ void handleMediaEvent( LLPluginClassMedia* self, EMediaEvent event ); + /*virtual*/ void handleMediaEvent( LLPluginClassMedia* self, EMediaEvent event ) override; // allow our controlling parent to tell us paramters void setParams( bool specific_sum_requested, const std::string& message, S32 sum ); diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 6eda7070b974e74176fcbc12c3ab946d27842019..08f1ded1d353f3659c19b39fdc06ecd26de05f0f 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -74,7 +74,7 @@ public: LLFloaterBuyLandUI(const LLSD& key); virtual ~LLFloaterBuyLandUI(); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onClose(bool app_quitting) override; // Left padding for maturity rating icon. static const S32 ICON_PAD = 2; @@ -84,7 +84,7 @@ private: { public: SelectionObserver(LLFloaterBuyLandUI* floater) : mFloater(floater) {} - virtual void changed(); + void changed() override; private: LLFloaterBuyLandUI* mFloater; }; @@ -188,7 +188,7 @@ public: void tellUserError(const std::string& message, const std::string& uri); - virtual BOOL postBuild(); + BOOL postBuild() override; void startBuyPreConfirm(); void startBuyPostConfirm(const std::string& password); @@ -196,9 +196,9 @@ public: void onClickBuy(); void onClickCancel(); void onClickErrorWeb(); - - virtual void draw(); - virtual BOOL canClose(); + + void draw() override; + BOOL canClose() override; void onVisibilityChanged ( const LLSD& new_visibility ); @@ -284,7 +284,7 @@ LLFloaterBuyLandUI::LLFloaterBuyLandUI(const LLSD& key) : LLFloater(LLSD()), mParcelSelectionObserver(this), mRegion(nullptr), - mParcel(0), + mParcel(nullptr), mIsClaim(false), mIsForGroup(false), mCanBuy(false), @@ -311,8 +311,8 @@ LLFloaterBuyLandUI::LLFloaterBuyLandUI(const LLSD& key) mChildren(*this), mCurrency(*this), mTransaction(nullptr), - mParcelBuyInfo(nullptr), - mTransactionType(TransactionNone) + mTransactionType(TransactionNone), + mParcelBuyInfo(nullptr) { LLViewerParcelMgr::getInstance()->addObserver(&mParcelSelectionObserver); @@ -869,7 +869,7 @@ void LLFloaterBuyLandUI::updateGroupName(const LLUUID& id, void LLFloaterBuyLandUI::startTransaction(TransactionType type, const LLXMLRPCValue& params) { delete mTransaction; - mTransaction = NULL; + mTransaction = nullptr; mTransactionType = type; @@ -914,7 +914,7 @@ bool LLFloaterBuyLandUI::checkTransaction() return false; } - if (mTransaction->status(NULL) != LLXMLRPCTransaction::StatusComplete) + if (mTransaction->status(nullptr) != LLXMLRPCTransaction::StatusComplete) { tellUserError(mTransaction->statusMessage(), mTransaction->statusURI()); } @@ -928,7 +928,7 @@ bool LLFloaterBuyLandUI::checkTransaction() } delete mTransaction; - mTransaction = NULL; + mTransaction = nullptr; return true; } diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index 8f6a3c1a4b5797c63aabfa49972b9ce710fc5570..9398de6b1963d2ec5c12de6c94184837e0fd62ef 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -156,8 +156,8 @@ std::map <std::string, std::string> LLFloaterBvhPreview::getJointAliases() //----------------------------------------------------------------------------- BOOL LLFloaterBvhPreview::postBuild() { - LLKeyframeMotion* motionp = NULL; - LLBVHLoader* loaderp = NULL; + LLKeyframeMotion* motionp = nullptr; + LLBVHLoader* loaderp = nullptr; if (!LLFloaterNameDesc::postBuild()) { @@ -199,7 +199,7 @@ BOOL LLFloaterBvhPreview::postBuild() S32 file_size; LLAPRFile infile ; - infile.open(mFilenameAndPath, LL_APR_RB, NULL, &file_size); + infile.open(mFilenameAndPath, LL_APR_RB, nullptr, &file_size); if (!infile.getFileHandle()) { @@ -305,7 +305,7 @@ BOOL LLFloaterBvhPreview::postBuild() } else { - mAnimPreview = NULL; + mAnimPreview = nullptr; mMotionID.setNull(); getChild<LLUICtrl>("bad_animation_text")->setValue(getString("failed_to_initialize")); } @@ -331,7 +331,7 @@ BOOL LLFloaterBvhPreview::postBuild() //setEnabled(FALSE); mMotionID.setNull(); - mAnimPreview = NULL; + mAnimPreview = nullptr; } refresh(); @@ -346,7 +346,7 @@ BOOL LLFloaterBvhPreview::postBuild() //----------------------------------------------------------------------------- LLFloaterBvhPreview::~LLFloaterBvhPreview() { - mAnimPreview = NULL; + mAnimPreview = nullptr; setEnabled(FALSE); } @@ -430,7 +430,7 @@ void LLFloaterBvhPreview::resetMotion() } else { - mPauseRequest = NULL; + mPauseRequest = nullptr; } } @@ -554,11 +554,11 @@ void LLFloaterBvhPreview::onBtnPlay() if (!avatarp->isMotionActive(mMotionID)) { resetMotion(); - mPauseRequest = NULL; + mPauseRequest = nullptr; } else if (avatarp->areAnimationsPaused()) { - mPauseRequest = NULL; + mPauseRequest = nullptr; } } } @@ -650,7 +650,7 @@ void LLFloaterBvhPreview::onCommitBaseAnim() if (!paused) { - mPauseRequest = NULL; + mPauseRequest = nullptr; } } } diff --git a/indra/newview/llfloaterbvhpreview.h b/indra/newview/llfloaterbvhpreview.h index 20d15d96033b35bf4d5c0e383c4a5d74dcd08253..d882941bf9f4f420f3e1f69d3c70cb03aaf49f1d 100644 --- a/indra/newview/llfloaterbvhpreview.h +++ b/indra/newview/llfloaterbvhpreview.h @@ -45,9 +45,9 @@ protected: public: LLPreviewAnimation(S32 width, S32 height); - /*virtual*/ S8 getType() const ; + /*virtual*/ S8 getType() const override; - BOOL render(); + BOOL render() override; void requestUpdate(); void rotate(F32 yaw_radians, F32 pitch_radians); void zoom(F32 zoom_delta); @@ -74,15 +74,15 @@ public: LLFloaterBvhPreview(const std::string& filename); virtual ~LLFloaterBvhPreview(); - BOOL postBuild(); + BOOL postBuild() override; - BOOL handleMouseDown(S32 x, S32 y, MASK mask); - BOOL handleMouseUp(S32 x, S32 y, MASK mask); - BOOL handleHover(S32 x, S32 y, MASK mask); - BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - void onMouseCaptureLost(); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + void onMouseCaptureLost() override; - void refresh(); + void refresh() override; void onBtnPlay(); void onBtnPause(); @@ -113,7 +113,7 @@ private: protected: - void draw(); + void draw() override; void resetMotion(); LLPointer< LLPreviewAnimation > mAnimPreview; diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index ab8406702a37d6ca5c8b326cff0b8618f474ee84..cb46e74acd9cfdfe3a7cfd46d5f82255b3c474c4 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -69,8 +69,8 @@ class LLPanelCameraZoom public: LLPanelCameraZoom(); - /* virtual */ BOOL postBuild(); - /* virtual */ void draw(); + /* virtual */ BOOL postBuild() override; + /* virtual */ void draw() override; protected: void onZoomPlusHeldDown(); @@ -90,8 +90,8 @@ LLPanelCameraItem::Params::Params() : icon_over("icon_over"), icon_selected("icon_selected"), picture("picture"), - text("text"), selected_picture("selected_picture"), + text("text"), mousedown_callback("mousedown_callback") { } @@ -160,9 +160,9 @@ static LLPanelInjector<LLPanelCameraZoom> t_camera_zoom_panel("camera_zoom_panel //------------------------------------------------------------------------------- LLPanelCameraZoom::LLPanelCameraZoom() -: mPlusBtn( NULL ), - mMinusBtn( NULL ), - mSlider( NULL ) +: mPlusBtn(nullptr ), + mMinusBtn(nullptr ), + mSlider(nullptr ) { mCommitCallbackRegistrar.add("Zoom.minus", boost::bind(&LLPanelCameraZoom::onZoomMinusHeldDown, this)); mCommitCallbackRegistrar.add("Zoom.plus", boost::bind(&LLPanelCameraZoom::onZoomPlusHeldDown, this)); diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index 1ff6b5eb71eb252097b8e0ac3c2eac19828fbb26..1ee85afd3e51594b278ebbaf6a65defd6ff381a5 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -75,8 +75,8 @@ public: are not in free camera mode*/ void fromFreeToPresets(); - virtual void onOpen(const LLSD& key); - virtual void onClose(bool app_quitting); + void onOpen(const LLSD& key) override; + void onClose(bool app_quitting) override; LLJoystickCameraRotate* mRotate; LLPanelCameraZoom* mZoom; @@ -90,7 +90,7 @@ private: /* return instance if it exists - created by LLFloaterReg */ static LLFloaterCamera* findInstance(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; ECameraControlMode determineMode(); @@ -154,9 +154,9 @@ public: Optional<CommitCallbackParam> mousedown_callback; Params(); }; - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /** setting on/off background icon to indicate selected state */ - /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void setValue(const LLSD& value) override; // sends commit signal void onAnyMouseClick(); protected: diff --git a/indra/newview/llfloaterchatvoicevolume.h b/indra/newview/llfloaterchatvoicevolume.h index 61ad92b6da4dd72a0566984bcb15f16b59123593..d0c9e5faa8ed07ede8f9aeba7509506670d58cd3 100644 --- a/indra/newview/llfloaterchatvoicevolume.h +++ b/indra/newview/llfloaterchatvoicevolume.h @@ -36,9 +36,9 @@ public: LLFloaterChatVoiceVolume(const LLSD& key); virtual ~LLFloaterChatVoiceVolume(); - virtual void onOpen(const LLSD& key); + void onOpen(const LLSD& key) override; - /*virtual*/ LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::GLOBAL; } + /*virtual*/ LLTransientFloaterMgr::ETransientGroup getGroup() override { return LLTransientFloaterMgr::GLOBAL; } }; #endif /* LLFLOATERCHATVOICEVOLUME_H_ */ diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 4188d9094515209895b4f92d5aa5068e3deb8424..45f5e136b9298f1f1916cb9b4c45d410d3462782 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -99,7 +99,7 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show mSwatchRegionTop ( 190 ), mSwatchRegionWidth ( 116 ), mSwatchRegionHeight ( 60 ), - mSwatchView ( NULL ), + mSwatchView (nullptr ), // *TODO: Specify this in XML numPaletteColumns ( 16 ), numPaletteRows ( 2 ), @@ -279,7 +279,7 @@ void LLFloaterColorPicker::destroyUI () { this->removeChild ( mSwatchView ); mSwatchView->die();; - mSwatchView = NULL; + mSwatchView = nullptr; } } @@ -1039,7 +1039,7 @@ BOOL LLFloaterColorPicker::handleMouseUp ( S32 x, S32 y, MASK mask ) if (hasMouseCapture()) { - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); } // dispatch to base class for the rest of things diff --git a/indra/newview/llfloatercolorpicker.h b/indra/newview/llfloatercolorpicker.h index 8b67060cf8c02bcd81b984396f0068ecaff6e061..009d10ede16aefea9ea2a0205b6c57c5fe081b08 100644 --- a/indra/newview/llfloatercolorpicker.h +++ b/indra/newview/llfloatercolorpicker.h @@ -45,12 +45,12 @@ class LLFloaterColorPicker virtual ~LLFloaterColorPicker (); // overrides - virtual BOOL postBuild (); - virtual void draw (); - virtual BOOL handleMouseDown ( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseUp ( S32 x, S32 y, MASK mask ); - virtual BOOL handleHover ( S32 x, S32 y, MASK mask ); - virtual void onMouseCaptureLost(); + BOOL postBuild () override; + void draw () override; + BOOL handleMouseDown ( S32 x, S32 y, MASK mask ) override; + BOOL handleMouseUp ( S32 x, S32 y, MASK mask ) override; + BOOL handleHover ( S32 x, S32 y, MASK mask ) override; + void onMouseCaptureLost() override; virtual F32 getSwatchTransparency(); // implicit methods diff --git a/indra/newview/llfloaterconversationlog.cpp b/indra/newview/llfloaterconversationlog.cpp index 146c93bad5b0b9d73b7c5dee78bc6d55a87cd55a..20cf1b821384c6b793c071febd829f1025edd856 100644 --- a/indra/newview/llfloaterconversationlog.cpp +++ b/indra/newview/llfloaterconversationlog.cpp @@ -35,7 +35,7 @@ LLFloaterConversationLog::LLFloaterConversationLog(const LLSD& key) : LLFloater(key), - mConversationLogList(NULL) + mConversationLogList(nullptr) { mCommitCallbackRegistrar.add("CallLog.Action", boost::bind(&LLFloaterConversationLog::onCustomAction, this, _2)); mEnableCallbackRegistrar.add("CallLog.Check", boost::bind(&LLFloaterConversationLog::isActionChecked, this, _2)); @@ -70,7 +70,7 @@ BOOL LLFloaterConversationLog::postBuild() void LLFloaterConversationLog::draw() { - getChild<LLMenuButton>("conversations_gear_btn")->setEnabled(mConversationLogList->getSelectedItem() != NULL); + getChild<LLMenuButton>("conversations_gear_btn")->setEnabled(mConversationLogList->getSelectedItem() != nullptr); LLFloater::draw(); } diff --git a/indra/newview/llfloaterconversationlog.h b/indra/newview/llfloaterconversationlog.h index e971330f3d0b6efe54aa49a5cafcbb39c1b618d2..687537a7bf8f4d80eb99761d881d668054c973a3 100644 --- a/indra/newview/llfloaterconversationlog.h +++ b/indra/newview/llfloaterconversationlog.h @@ -37,9 +37,9 @@ public: LLFloaterConversationLog(const LLSD& key); virtual ~LLFloaterConversationLog(){}; - virtual BOOL postBuild(); + BOOL postBuild() override; - virtual void draw(); + void draw() override; void onFilterEdit(const std::string& search_string); diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 03e185bf13dd512b0dcd7a15e3fc417f8495e68b..8cd32d9917d78c37c07b7000c191b4f917ce0cdf 100644 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -42,16 +42,16 @@ const std::string LL_FCP_ACCOUNT_NAME("user_name"); LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_id) : LLFloater(session_id), + mMutex(), mPageSpinner(nullptr), mChatHistory(nullptr), mSessionID(session_id.asUUID()), mCurrentPage(0), mPageSize(gSavedSettings.getS32("ConversationHistoryPageSize")), + mMessages(nullptr), mAccountName(session_id[LL_FCP_ACCOUNT_NAME]), mCompleteName(session_id[LL_FCP_COMPLETE_NAME]), - mMutex(), mShowHistory(false), - mMessages(nullptr), mHistoryThreadsBusy(false), mOpened(false) { @@ -198,7 +198,7 @@ void LLFloaterConversationPreview::showHistory() { // additional protection to avoid changes of mMessages in setPages LLMutexLock lock(&mMutex); - if(mMessages == NULL || !mMessages->size() || mCurrentPage * mPageSize >= mMessages->size()) + if(mMessages == nullptr || !mMessages->size() || mCurrentPage * mPageSize >= mMessages->size()) { return; } diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h index a8dbbc9ffe0c112721f984dfcd1dd821afbe82e4..c1c7a9d61bc03cf077aa4c5d30fa3c58fbbeeb62 100644 --- a/indra/newview/llfloaterconversationpreview.h +++ b/indra/newview/llfloaterconversationpreview.h @@ -41,12 +41,12 @@ public: LLFloaterConversationPreview(const LLSD& session_id); virtual ~LLFloaterConversationPreview(); - virtual BOOL postBuild(); + BOOL postBuild() override; void setPages(std::list<LLSD>* messages,const std::string& file_name); - virtual void draw(); - virtual void onOpen(const LLSD& key); - virtual void onClose(bool app_quitting); + void draw() override; + void onOpen(const LLSD& key) override; + void onClose(bool app_quitting) override; private: void onMoreHistoryBtnClick(); diff --git a/indra/newview/llfloaterdeleteenvpreset.cpp b/indra/newview/llfloaterdeleteenvpreset.cpp index 01ab3602711e77d443cac7c21f793a88d99c1386..af011959b7571dcc3a5b1509712d21daa5b4b7d2 100644 --- a/indra/newview/llfloaterdeleteenvpreset.cpp +++ b/indra/newview/llfloaterdeleteenvpreset.cpp @@ -52,7 +52,7 @@ static bool confirmation_callback(const LLSD& notification, const LLSD& response LLFloaterDeleteEnvPreset::LLFloaterDeleteEnvPreset(const LLSD &key) : LLFloater(key) -, mPresetCombo(NULL) +, mPresetCombo(nullptr) { } diff --git a/indra/newview/llfloaterdeleteenvpreset.h b/indra/newview/llfloaterdeleteenvpreset.h index 1211505273aff21acee891a96ac91f51cb563450..67fe05d343ec4108d9f03be50be702edf6a901d8 100644 --- a/indra/newview/llfloaterdeleteenvpreset.h +++ b/indra/newview/llfloaterdeleteenvpreset.h @@ -38,8 +38,8 @@ class LLFloaterDeleteEnvPreset : public LLFloater public: LLFloaterDeleteEnvPreset(const LLSD &key); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; void onBtnDelete(); void onBtnCancel(); diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp index a6be960f525fa0557307c185746b1b0de35abbcf..0ca790a28ba51835bb52aa65f88a0c4045e66e31 100644 --- a/indra/newview/llfloaterdirectory.cpp +++ b/indra/newview/llfloaterdirectory.cpp @@ -529,7 +529,7 @@ void LLFloaterDirectory::processSearchPeopleReply(LLMessageSystem* msg, void**) // *TODO: Get rid of this so we can have multiple search windows LLFloaterDirectory* self = LLFloaterReg::findTypedInstance<LLFloaterDirectory>("search"); - if (self == NULL || query_id != self->mQueryID) return; // not the result we're waiting for + if (self == nullptr || query_id != self->mQueryID) return; // not the result we're waiting for self->setProgress(false); LLScrollListCtrl* pResults = self->mResultList; @@ -600,7 +600,7 @@ void LLFloaterDirectory::processSearchGroupsReply(LLMessageSystem* msg, void**) LL_DEBUGS("Search") << "Received results for query id: " << query_id << LL_ENDL; LLFloaterDirectory* self = LLFloaterReg::findTypedInstance<LLFloaterDirectory>("search"); - if (self == NULL || query_id != self->mQueryID) return; // not the result we're waiting for + if (self == nullptr || query_id != self->mQueryID) return; // not the result we're waiting for self->setProgress(false); LLScrollListCtrl* pResults = self->mResultList; @@ -702,7 +702,7 @@ void LLFloaterDirectory::processSearchPlacesReply(LLMessageSystem* msg, void**) LL_DEBUGS("Search") << "Received results for query id: " << query_id << LL_ENDL; LLFloaterDirectory* self = LLFloaterReg::findTypedInstance<LLFloaterDirectory>("search"); - if (self == NULL || query_id != self->mQueryID) return; // not the result we're waiting for + if (self == nullptr || query_id != self->mQueryID) return; // not the result we're waiting for self->setProgress(false); LLScrollListCtrl* pResults = self->mResultList; @@ -818,7 +818,7 @@ void LLFloaterDirectory::processSearchClassifiedsReply(LLMessageSystem* msg, voi LL_DEBUGS("Search") << "Received results for query id: " << query_id << LL_ENDL; LLFloaterDirectory* self = LLFloaterReg::findTypedInstance<LLFloaterDirectory>("search"); - if (self == NULL || query_id != self->mQueryID) return; // not the result we're waiting for + if (self == nullptr || query_id != self->mQueryID) return; // not the result we're waiting for self->setProgress(false); LLScrollListCtrl* pResults = self->mResultList; @@ -921,7 +921,7 @@ void LLFloaterDirectory::processSearchLandReply(LLMessageSystem* msg, void**) LL_DEBUGS("Search") << "Received results for query id: " << query_id << LL_ENDL; LLFloaterDirectory* self = LLFloaterReg::findTypedInstance<LLFloaterDirectory>("search"); - if (self == NULL || query_id != self->mQueryID) return; // not the result we're waiting for + if (self == nullptr || query_id != self->mQueryID) return; // not the result we're waiting for self->setProgress(false); LLScrollListCtrl* pResults = self->mResultList; @@ -1073,7 +1073,7 @@ void LLFloaterDirectory::processSearchEventsReply(LLMessageSystem* msg, void**) LL_DEBUGS("Search") << "Received results for query id: " << query_id << LL_ENDL; LLFloaterDirectory* self = LLFloaterReg::findTypedInstance<LLFloaterDirectory>("search"); - if (self == NULL || query_id != self->mQueryID) return; // not the result we're waiting for + if (self == nullptr || query_id != self->mQueryID) return; // not the result we're waiting for self->setProgress(false); LLScrollListCtrl* pResults = self->mResultList; diff --git a/indra/newview/llfloaterdirectory.h b/indra/newview/llfloaterdirectory.h index 9f5d98f4738a6eeca37bd88db1120ddb1ed4080f..5b5385381ec7cef28ce43fd6e65224ba5ae1441d 100644 --- a/indra/newview/llfloaterdirectory.h +++ b/indra/newview/llfloaterdirectory.h @@ -94,8 +94,8 @@ public: typedef LLSDParamAdapter<_Params> Params; LLFloaterDirectory(const Params& key); - BOOL postBuild(); - void onOpen(const LLSD& key); + BOOL postBuild() override; + void onOpen(const LLSD& key) override; static void processSearchPeopleReply(LLMessageSystem* msg, void**); static void processSearchGroupsReply(LLMessageSystem* msg, void**); diff --git a/indra/newview/llfloaterdisplayname.cpp b/indra/newview/llfloaterdisplayname.cpp index f602177ae36e38518d2e52ec14a82575d95f749a..c007d5e6e2373f3c1fef23d4aac21cffe27b2566 100644 --- a/indra/newview/llfloaterdisplayname.cpp +++ b/indra/newview/llfloaterdisplayname.cpp @@ -47,11 +47,11 @@ class LLFloaterDisplayName : public LLFloater public: LLFloaterDisplayName(const LLSD& key); virtual ~LLFloaterDisplayName() { } - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void onSave(); void onReset(); void onCancel(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; private: diff --git a/indra/newview/llfloatereditdaycycle.cpp b/indra/newview/llfloatereditdaycycle.cpp index e988567b6913acfea2c8a064f0ee942e4f3c155d..032bd50f6f1a17c7d5cc63435202c30e2e663507 100644 --- a/indra/newview/llfloatereditdaycycle.cpp +++ b/indra/newview/llfloatereditdaycycle.cpp @@ -53,14 +53,14 @@ const F32 LLFloaterEditDayCycle::sHoursPerDay = 24.0f; LLFloaterEditDayCycle::LLFloaterEditDayCycle(const LLSD &key) : LLFloater(key) -, mDayCycleNameEditor(NULL) -, mDayCyclesCombo(NULL) -, mTimeSlider(NULL) -, mKeysSlider(NULL) -, mSkyPresetsCombo(NULL) -, mTimeCtrl(NULL) -, mMakeDefaultCheckBox(NULL) -, mSaveButton(NULL) +, mDayCycleNameEditor(nullptr) +, mDayCyclesCombo(nullptr) +, mTimeSlider(nullptr) +, mKeysSlider(nullptr) +, mSkyPresetsCombo(nullptr) +, mTimeCtrl(nullptr) +, mMakeDefaultCheckBox(nullptr) +, mSaveButton(nullptr) { } @@ -129,7 +129,7 @@ void LLFloaterEditDayCycle::draw() void LLFloaterEditDayCycle::initCallbacks(void) { - mDayCycleNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditDayCycle::onDayCycleNameEdited, this), NULL); + mDayCycleNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditDayCycle::onDayCycleNameEdited, this), nullptr); mDayCyclesCombo->setCommitCallback(boost::bind(&LLFloaterEditDayCycle::onDayCycleSelected, this)); mDayCyclesCombo->setTextEntryCallback(boost::bind(&LLFloaterEditDayCycle::onDayCycleNameEdited, this)); mTimeSlider->setCommitCallback(boost::bind(&LLFloaterEditDayCycle::onTimeSliderMoved, this)); diff --git a/indra/newview/llfloatereditdaycycle.h b/indra/newview/llfloatereditdaycycle.h index e6e4fe39c1e80ca6de114c840d977492521609b5..33a8931a17e9202590578ce173546b4dedc88f6e 100644 --- a/indra/newview/llfloatereditdaycycle.h +++ b/indra/newview/llfloatereditdaycycle.h @@ -47,10 +47,10 @@ class LLFloaterEditDayCycle : public LLFloater public: LLFloaterEditDayCycle(const LLSD &key); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void onClose(bool app_quitting) override; + /*virtual*/ void draw() override; private: diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp index aad210a190877c520fd0c1a146b1b4898f5f6de7..a0af3c3373dbf09e23c2edcec0d6c6f0c044db7a 100644 --- a/indra/newview/llfloatereditsky.cpp +++ b/indra/newview/llfloatereditsky.cpp @@ -65,10 +65,10 @@ static F32 time24_to_sun_pos(F32 time24) LLFloaterEditSky::LLFloaterEditSky(const LLSD &key) : LLFloater(key) -, mSkyPresetNameEditor(NULL) -, mSkyPresetCombo(NULL) -, mMakeDefaultCheckBox(NULL) -, mSaveButton(NULL) +, mSkyPresetNameEditor(nullptr) +, mSkyPresetCombo(nullptr) +, mMakeDefaultCheckBox(nullptr) +, mSaveButton(nullptr) { } @@ -132,7 +132,7 @@ void LLFloaterEditSky::initCallbacks(void) { // *TODO: warn user if a region environment update comes while we're editing a region sky preset. - mSkyPresetNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditSky::onSkyPresetNameEdited, this), NULL); + mSkyPresetNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditSky::onSkyPresetNameEdited, this), nullptr); mSkyPresetCombo->setCommitCallback(boost::bind(&LLFloaterEditSky::onSkyPresetSelected, this)); mSkyPresetCombo->setTextEntryCallback(boost::bind(&LLFloaterEditSky::onSkyPresetNameEdited, this)); diff --git a/indra/newview/llfloatereditsky.h b/indra/newview/llfloatereditsky.h index a06c4fc5fab8e21a52b88897be6fb8576fabe5a7..c63957cd535bcc15c5fb8bbd7018f8aa613b84ca 100644 --- a/indra/newview/llfloatereditsky.h +++ b/indra/newview/llfloatereditsky.h @@ -45,10 +45,10 @@ class LLFloaterEditSky : public LLFloater public: LLFloaterEditSky(const LLSD &key); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void onClose(bool app_quitting) override; + /*virtual*/ void draw() override; private: void initCallbacks(void); diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp index 4c3d31d8d7e7634b34588d93d623bc60f2a4710a..11d04330ab9a1f55782ebae789ad33ec17b3f676 100644 --- a/indra/newview/llfloatereditwater.cpp +++ b/indra/newview/llfloatereditwater.cpp @@ -50,10 +50,10 @@ LLFloaterEditWater::LLFloaterEditWater(const LLSD &key) : LLFloater(key) -, mWaterPresetNameEditor(NULL) -, mWaterPresetCombo(NULL) -, mMakeDefaultCheckBox(NULL) -, mSaveButton(NULL) +, mWaterPresetNameEditor(nullptr) +, mWaterPresetCombo(nullptr) +, mMakeDefaultCheckBox(nullptr) +, mSaveButton(nullptr) { } @@ -114,7 +114,7 @@ void LLFloaterEditWater::draw() void LLFloaterEditWater::initCallbacks(void) { - mWaterPresetNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditWater::onWaterPresetNameEdited, this), NULL); + mWaterPresetNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditWater::onWaterPresetNameEdited, this), nullptr); mWaterPresetCombo->setCommitCallback(boost::bind(&LLFloaterEditWater::onWaterPresetSelected, this)); mWaterPresetCombo->setTextEntryCallback(boost::bind(&LLFloaterEditWater::onWaterPresetNameEdited, this)); diff --git a/indra/newview/llfloatereditwater.h b/indra/newview/llfloatereditwater.h index 2211bca59f182dba1343b991ef00a83f303ade21..c15ffe3c98825d61a2756e8de2d659393e325975 100644 --- a/indra/newview/llfloatereditwater.h +++ b/indra/newview/llfloatereditwater.h @@ -48,10 +48,10 @@ class LLFloaterEditWater : public LLFloater public: LLFloaterEditWater(const LLSD &key); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void onClose(bool app_quitting) override; + /*virtual*/ void draw() override; private: void initCallbacks(void); diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp index 8d5b988d1005ebcd3a39dc3f27ae8208d81ea6c7..9ac86b6bede0943cbdbcea2badd53f09daddff52 100644 --- a/indra/newview/llfloaterenvironmentsettings.cpp +++ b/indra/newview/llfloaterenvironmentsettings.cpp @@ -41,11 +41,11 @@ LLFloaterEnvironmentSettings::LLFloaterEnvironmentSettings(const LLSD &key) : LLFloater(key) - ,mRegionSettingsCheckBox(NULL) // <alchemy/> - ,mDayCycleSettingsRadioGroup(NULL) - ,mWaterPresetCombo(NULL) - ,mSkyPresetCombo(NULL) - ,mDayCyclePresetCombo(NULL) + ,mRegionSettingsCheckBox(nullptr) // <alchemy/> + ,mDayCycleSettingsRadioGroup(nullptr) + ,mWaterPresetCombo(nullptr) + ,mSkyPresetCombo(nullptr) + ,mDayCyclePresetCombo(nullptr) { } @@ -69,9 +69,9 @@ BOOL LLFloaterEnvironmentSettings::postBuild() mDayCyclePresetCombo = getChild<LLComboBox>("dayc_settings_preset_combo"); mDayCyclePresetCombo->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSelectDayCyclePreset, this)); - childSetCommitCallback("ok_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnOK, this), NULL); + childSetCommitCallback("ok_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnOK, this), nullptr); getChild<LLUICtrl>("ok_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance())); - childSetCommitCallback("cancel_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnCancel, this), NULL); + childSetCommitCallback("cancel_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnCancel, this), nullptr); getChild<LLUICtrl>("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance())); setCloseCallback(boost::bind(&LLFloaterEnvironmentSettings::cancel, this)); diff --git a/indra/newview/llfloaterenvironmentsettings.h b/indra/newview/llfloaterenvironmentsettings.h index 9da446c3f6e5c6e534c0dda5faaa18d3b1425a7a..44ebedbec9f60b100f0cdfa45c78fc0da9c801af 100644 --- a/indra/newview/llfloaterenvironmentsettings.h +++ b/indra/newview/llfloaterenvironmentsettings.h @@ -39,8 +39,8 @@ class LLFloaterEnvironmentSettings : public LLFloater public: LLFloaterEnvironmentSettings(const LLSD &key); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; private: void onSwitchRegionSettings(); @@ -53,7 +53,7 @@ private: void onBtnOK(); void onBtnCancel(); - void refresh(); /// update controls with user prefs + void refresh() override; /// update controls with user prefs void apply(); void cancel(); diff --git a/indra/newview/llfloaterexperiencepicker.cpp b/indra/newview/llfloaterexperiencepicker.cpp index 06a55e376946b09b6d7ee57b36d77b6c32a0b4ca..a6db1b6ce355a3ff558e95865e2fb5d501e0c987 100644 --- a/indra/newview/llfloaterexperiencepicker.cpp +++ b/indra/newview/llfloaterexperiencepicker.cpp @@ -53,7 +53,7 @@ LLFloaterExperiencePicker* LLFloaterExperiencePicker::show( select_callback_t ca if (!floater) { LL_WARNS() << "Cannot instantiate experience picker" << LL_ENDL; - return NULL; + return nullptr; } if (floater->mSearchPanel) @@ -132,7 +132,7 @@ void LLFloaterExperiencePicker::draw() LLFloaterExperiencePicker::LLFloaterExperiencePicker( const LLSD& key ) :LLFloater(key) - ,mSearchPanel(NULL) + ,mSearchPanel(nullptr) ,mContextConeOpacity(0.f) ,mContextConeInAlpha(0.f) ,mContextConeOutAlpha(0.f) diff --git a/indra/newview/llfloaterexperiencepicker.h b/indra/newview/llfloaterexperiencepicker.h index 29054a57db2b47468afa48eb34d10dbdc5a8ca9d..f6217ff79775e1ccb1d4ff26665f49df09eae0ee 100644 --- a/indra/newview/llfloaterexperiencepicker.h +++ b/indra/newview/llfloaterexperiencepicker.h @@ -48,9 +48,9 @@ public: LLFloaterExperiencePicker(const LLSD& key); virtual ~LLFloaterExperiencePicker(); - BOOL postBuild(); - - virtual void draw(); + BOOL postBuild() override; + + void draw() override; private: LLPanelExperiencePicker* mSearchPanel; diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp index 4d9b87abbf532d66931c363139124a5e01c2e5a1..7682f0c3e7019edf5a20025360b10240306e47bd 100644 --- a/indra/newview/llfloaterexperienceprofile.cpp +++ b/indra/newview/llfloaterexperienceprofile.cpp @@ -95,7 +95,7 @@ public: LLExperienceHandler() : LLCommandHandler("experience", UNTRUSTED_THROTTLE) { } bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + LLMediaCtrl* web) override { if(params.size() != 2 || params[1].asString() != "profile") return false; @@ -170,13 +170,13 @@ BOOL LLFloaterExperienceProfile::postBuild() getChild<LLTextEditor>(EDIT TF_DESC)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this)); getChild<LLUICtrl>(EDIT TF_MATURITY)->setCommitCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this)); - getChild<LLLineEditor>(EDIT TF_MRKT)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), NULL); - getChild<LLLineEditor>(EDIT TF_NAME)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), NULL); + getChild<LLLineEditor>(EDIT TF_MRKT)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), nullptr); + getChild<LLLineEditor>(EDIT TF_NAME)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), nullptr); - childSetCommitCallback(EDIT BTN_ENABLE, boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), NULL); - childSetCommitCallback(EDIT BTN_PRIVATE, boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), NULL); + childSetCommitCallback(EDIT BTN_ENABLE, boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), nullptr); + childSetCommitCallback(EDIT BTN_PRIVATE, boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), nullptr); - childSetCommitCallback(EDIT IMG_LOGO, boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), NULL); + childSetCommitCallback(EDIT IMG_LOGO, boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), nullptr); getChild<LLTextEditor>(EDIT TF_DESC)->setCommitOnFocusLost(TRUE); diff --git a/indra/newview/llfloaterexperienceprofile.h b/indra/newview/llfloaterexperienceprofile.h index 1394418d9118d3e6d8e96f198039c045e3b2ed2b..037659317617619a413c4b1bad7de24f4cda01a7 100644 --- a/indra/newview/llfloaterexperienceprofile.h +++ b/indra/newview/llfloaterexperienceprofile.h @@ -58,9 +58,9 @@ public: void refreshExperience(const LLSD& experience); void onSaveComplete( const LLSD& content ); - virtual BOOL canClose(); + BOOL canClose() override; - virtual void onClose(bool app_quitting); + void onClose(bool app_quitting) override; protected: void onClickEdit(); void onClickPermission(const char* permission); @@ -85,7 +85,7 @@ protected: static void experienceCallback(LLHandle<LLFloaterExperienceProfile> handle, const LLSD& experience); static bool experiencePermission(LLHandle<LLFloaterExperienceProfile> handle, const LLSD& permission); - BOOL postBuild(); + BOOL postBuild() override; bool setMaturityString(U8 maturity, LLTextBox* child, LLComboBox* combo); bool handleSaveChangesDialog(const LLSD& notification, const LLSD& response, PostSaveAction action); void doSave( int success_action ); diff --git a/indra/newview/llfloaterexperiences.h b/indra/newview/llfloaterexperiences.h index 6d0559af7cfc18f5544a76c312641d50bf6127ca..de37974b8e91cf57ecf5794454acbaf7451662b5 100644 --- a/indra/newview/llfloaterexperiences.h +++ b/indra/newview/llfloaterexperiences.h @@ -37,9 +37,9 @@ class LLFloaterExperiences : { public: LLFloaterExperiences(const LLSD& data); - virtual void onClose(bool app_quitting); + void onClose(bool app_quitting) override; - virtual void onOpen(const LLSD& key); + void onOpen(const LLSD& key) override; static LLFloaterExperiences* findInstance(); protected: typedef std::map<std::string, std::string> NameMap_t; @@ -47,7 +47,7 @@ protected: void clearFromRecent(const LLSD& ids); void resizeToTabs(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void refreshContents(); void setupRecentTabs(); LLPanelExperiences* addTab(const std::string& name, bool select); diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp index 0cd1c91b30f04d0a6ca6326ed26d310fbd0ff08a..27af67653dd87b599504541f23e6b17263e0bace 100644 --- a/indra/newview/llfloaterfacebook.cpp +++ b/indra/newview/llfloaterfacebook.cpp @@ -95,14 +95,14 @@ S32 compute_jpeg_quality(S32 width, S32 height) /////////////////////////// LLFacebookStatusPanel::LLFacebookStatusPanel() : - mMessageTextEditor(NULL), - mPostButton(NULL), - mCancelButton(NULL), - mAccountCaptionLabel(NULL), - mAccountNameLabel(NULL), - mPanelButtons(NULL), - mConnectButton(NULL), - mDisconnectButton(NULL) + mAccountCaptionLabel(nullptr), + mAccountNameLabel(nullptr), + mPanelButtons(nullptr), + mConnectButton(nullptr), + mDisconnectButton(nullptr), + mMessageTextEditor(nullptr), + mPostButton(nullptr), + mCancelButton(nullptr) { mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this)); mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this)); @@ -327,12 +327,12 @@ LLFacebookPhotoPanel::LLFacebookPhotoPanel() : mResolutionComboBox(nullptr), mFilterComboBox(nullptr), mRefreshBtn(nullptr), -mCancelButton(nullptr), -mBtnPreview(nullptr), mWorkingLabel(nullptr), mThumbnailPlaceholder(nullptr), mCaptionTextBox(nullptr), mPostButton(nullptr), +mCancelButton(nullptr), +mBtnPreview(nullptr), mBigPreviewFloater(nullptr), mQuality(MAX_QUALITY) { @@ -865,9 +865,9 @@ void LLFacebookCheckinPanel::clearAndClose() /////////////////////////// LLFacebookFriendsPanel::LLFacebookFriendsPanel() : - mFriendsStatusCaption(NULL), - mSecondLifeFriends(NULL), - mSuggestedFriends(NULL) + mFriendsStatusCaption(nullptr), + mSecondLifeFriends(nullptr), + mSuggestedFriends(nullptr) { } @@ -1028,10 +1028,10 @@ bool LLFacebookFriendsPanel::onConnectedToFacebook(const LLSD& data) //////////////////////// LLFloaterFacebook::LLFloaterFacebook(const LLSD& key) : LLFloater(key), - mFacebookPhotoPanel(NULL), - mStatusErrorText(NULL), - mStatusLoadingText(NULL), - mStatusLoadingIndicator(NULL) + mFacebookPhotoPanel(nullptr), + mStatusErrorText(nullptr), + mStatusLoadingText(nullptr), + mStatusLoadingIndicator(nullptr) { mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterFacebook::onCancel, this)); } diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h index 729a1d59674697bcef09ec73f1bda6bc5e322695..f7dc7e0f769023633843b5345023ee97e6cc7aac 100644 --- a/indra/newview/llfloaterfacebook.h +++ b/indra/newview/llfloaterfacebook.h @@ -42,8 +42,8 @@ class LLFacebookStatusPanel : public LLPanel { public: LLFacebookStatusPanel(); - BOOL postBuild(); - void draw(); + BOOL postBuild() override; + void draw() override; void onSend(); bool onFacebookConnectStateChange(const LLSD& data); bool onFacebookConnectAccountStateChange(const LLSD& data); @@ -52,7 +52,7 @@ public: void clearAndClose(); private: - void onVisibilityChange(BOOL new_visibility); + void onVisibilityChange(BOOL new_visibility) override; bool onFacebookConnectInfoChange(); void onConnect(); void onUseAnotherAccount(); @@ -79,15 +79,15 @@ public: LLFacebookPhotoPanel(); ~LLFacebookPhotoPanel(); - BOOL postBuild(); - void draw(); + BOOL postBuild() override; + void draw() override; LLSnapshotLivePreview* getPreviewView(); - void onVisibilityChange(BOOL new_visibility); + void onVisibilityChange(BOOL new_visibility) override; void onClickBigPreview(); void onClickNewSnapshot(); void onSend(); - S32 notify(const LLSD& info); + S32 notify(const LLSD& info) override; bool onFacebookConnectStateChange(const LLSD& data); void sendPhoto(); @@ -123,8 +123,8 @@ class LLFacebookCheckinPanel : public LLPanel { public: LLFacebookCheckinPanel(); - BOOL postBuild(); - void draw(); + BOOL postBuild() override; + void draw() override; void onSend(); bool onFacebookConnectStateChange(const LLSD& data); @@ -149,8 +149,8 @@ class LLFacebookFriendsPanel : public LLPanel, public LLFriendObserver public: LLFacebookFriendsPanel(); ~LLFacebookFriendsPanel(); - BOOL postBuild(); - virtual void changed(U32 mask); + BOOL postBuild() override; + void changed(U32 mask) override; private: bool updateSuggestedFriendList(); @@ -167,9 +167,9 @@ class LLFloaterFacebook : public LLFloater { public: LLFloaterFacebook(const LLSD& key); - BOOL postBuild(); - void draw(); - void onClose(bool app_quitting); + BOOL postBuild() override; + void draw() override; + void onClose(bool app_quitting) override; void onCancel(); void showPhotoPanel(); diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp index e76d78529444249d0656c7bb7618d9816a7b05d8..72b1fa5c7ce2e0d6563d03d69b184ff96e1df911 100644 --- a/indra/newview/llfloaterflickr.cpp +++ b/indra/newview/llfloaterflickr.cpp @@ -69,8 +69,6 @@ LLFlickrPhotoPanel::LLFlickrPhotoPanel() : mResolutionComboBox(nullptr), mFilterComboBox(nullptr), mRefreshBtn(nullptr), -mCancelButton(nullptr), -mBtnPreview(nullptr), mWorkingLabel(nullptr), mThumbnailPlaceholder(nullptr), mTitleTextBox(nullptr), @@ -78,8 +76,10 @@ mDescriptionTextBox(nullptr), mLocationCheckbox(nullptr), mTagsTextBox(nullptr), mRatingComboBox(nullptr), -mBigPreviewFloater(nullptr), -mPostButton(nullptr) +mPostButton(nullptr), +mCancelButton(nullptr), +mBtnPreview(nullptr), +mBigPreviewFloater(nullptr) { mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLFlickrPhotoPanel::onSend, this)); mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLFlickrPhotoPanel::onClickNewSnapshot, this)); @@ -520,11 +520,11 @@ LLUICtrl* LLFlickrPhotoPanel::getRefreshBtn() /////////////////////////// LLFlickrAccountPanel::LLFlickrAccountPanel() : -mAccountCaptionLabel(NULL), -mAccountNameLabel(NULL), -mPanelButtons(NULL), -mConnectButton(NULL), -mDisconnectButton(NULL) +mAccountCaptionLabel(nullptr), +mAccountNameLabel(nullptr), +mPanelButtons(nullptr), +mConnectButton(nullptr), +mDisconnectButton(nullptr) { mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFlickrAccountPanel::onConnect, this)); mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFlickrAccountPanel::onDisconnect, this)); @@ -678,10 +678,10 @@ void LLFlickrAccountPanel::onDisconnect() //////////////////////// LLFloaterFlickr::LLFloaterFlickr(const LLSD& key) : LLFloater(key), - mFlickrPhotoPanel(NULL), - mStatusErrorText(NULL), - mStatusLoadingText(NULL), - mStatusLoadingIndicator(NULL) + mFlickrPhotoPanel(nullptr), + mStatusErrorText(nullptr), + mStatusLoadingText(nullptr), + mStatusLoadingIndicator(nullptr) { mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterFlickr::onCancel, this)); } diff --git a/indra/newview/llfloaterflickr.h b/indra/newview/llfloaterflickr.h index 40676bc84a5debf5f25ea9db78e2cc6c82958130..9c4f870a35c1e7a0ffd65850e9646e990782b2a5 100644 --- a/indra/newview/llfloaterflickr.h +++ b/indra/newview/llfloaterflickr.h @@ -42,12 +42,12 @@ public: LLFlickrPhotoPanel(); ~LLFlickrPhotoPanel(); - BOOL postBuild(); - S32 notify(const LLSD& info); - void draw(); + BOOL postBuild() override; + S32 notify(const LLSD& info) override; + void draw() override; LLSnapshotLivePreview* getPreviewView(); - void onVisibilityChange(BOOL new_visibility); + void onVisibilityChange(BOOL new_visibility) override; void onClickNewSnapshot(); void onClickBigPreview(); void onSend(); @@ -88,11 +88,11 @@ class LLFlickrAccountPanel : public LLPanel { public: LLFlickrAccountPanel(); - BOOL postBuild(); - void draw(); + BOOL postBuild() override; + void draw() override; private: - void onVisibilityChange(BOOL new_visibility); + void onVisibilityChange(BOOL new_visibility) override; bool onFlickrConnectStateChange(const LLSD& data); bool onFlickrConnectInfoChange(); void onConnect(); @@ -116,9 +116,9 @@ class LLFloaterFlickr : public LLFloater { public: LLFloaterFlickr(const LLSD& key); - BOOL postBuild(); - void draw(); - void onClose(bool app_quitting); + BOOL postBuild() override; + void draw() override; + void onClose(bool app_quitting) override; void onCancel(); void showPhotoPanel(); diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 8aa2886f8efd700af6a517de04012085e4192fee..aecf3bbfe53549fce34bad78e21abb0445de95e8 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -62,7 +62,7 @@ class LLFloaterGestureObserver : public LLGestureManagerObserver public: LLFloaterGestureObserver(LLFloaterGesture* floater) : mFloater(floater) {} virtual ~LLFloaterGestureObserver() {} - virtual void changed() { mFloater->refreshAll(); } + void changed() override { mFloater->refreshAll(); } private: LLFloaterGesture* mFloater; @@ -74,7 +74,7 @@ private: class GestureShowCallback : public LLInventoryCallback { public: - void fire(const LLUUID &inv_item) + void fire(const LLUUID &inv_item) override { LLPreviewGesture::show(inv_item, LLUUID::null); @@ -99,11 +99,11 @@ private: public: GestureCopiedCallback(LLFloaterGesture* floater): mFloater(floater) {} - void fire(const LLUUID &inv_item) + void fire(const LLUUID &inv_item) override { if(mFloater) { - mFloater->addGesture(inv_item,NULL,mFloater->getChild<LLScrollListCtrl>("gesture_list")); + mFloater->addGesture(inv_item, nullptr,mFloater->getChild<LLScrollListCtrl>("gesture_list")); // EXP-1909 (Pasted gesture displayed twice) // The problem is that addGesture is called here for the second time for the same item (which is copied) @@ -184,7 +184,7 @@ LLFloaterGesture::~LLFloaterGesture() { LLGestureMgr::instance().removeObserver(mObserver); delete mObserver; - mObserver = NULL; + mObserver = nullptr; gInventory.removeObserver(this); } @@ -289,7 +289,7 @@ void LLFloaterGesture::buildGestureList() if (active_gestures.find(item->getUUID()) == active_gestures.end()) { // if gesture wasn't loaded yet, we can display only name - addGesture(item->getUUID(), NULL, mGestureList); + addGesture(item->getUUID(), nullptr, mGestureList); } } } diff --git a/indra/newview/llfloatergesture.h b/indra/newview/llfloatergesture.h index d2ee229d280716f6e95c453a1fe5e8012c3df182..929acb66aab31757081b9abeae374872f6182e28 100644 --- a/indra/newview/llfloatergesture.h +++ b/indra/newview/llfloatergesture.h @@ -55,8 +55,8 @@ public: LLFloaterGesture(const LLSD& key); virtual ~LLFloaterGesture(); - virtual BOOL postBuild(); - virtual void done (); + BOOL postBuild() override; + void done () override; void refreshAll(); /** * @brief Add new scrolllistitem into gesture_list. diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index c41df53031640a915d3ce28e0697480c37f28bab..e86ebb2162b12f511c1d831e4406e8b90fcf4513 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -532,7 +532,7 @@ void LLPanelRegionTools::onSaveState(void* userdata) gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); gMessageSystem->nextBlockFast(_PREHASH_DataBlock); - gMessageSystem->addStringFast(_PREHASH_Filename, NULL); + gMessageSystem->addStringFast(_PREHASH_Filename, nullptr); gAgent.sendReliableMessage(); } } @@ -1148,7 +1148,7 @@ void LLPanelObjectTools::onClickSetBySelection(void* data) if (!panelp) return; const BOOL non_root_ok = TRUE; - LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(NULL, non_root_ok); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(nullptr, non_root_ok); if (!node) return; std::string owner_name; @@ -1326,7 +1326,7 @@ void LLPanelRequestTools::sendRequest(const LLHost& host) host, FALSE, terrain_download_done, - NULL); + nullptr); } else { diff --git a/indra/newview/llfloatergodtools.h b/indra/newview/llfloatergodtools.h index 1f4e164223b5ef49d8d2901a14ec52fb92d58671..e6b85da5b2e7e1f3c8513bffe9409f2d529a284b 100644 --- a/indra/newview/llfloatergodtools.h +++ b/indra/newview/llfloatergodtools.h @@ -74,9 +74,9 @@ public: void showPanel(const std::string& panel_name); - virtual void onOpen(const LLSD& key); + void onOpen(const LLSD& key) override; - virtual void draw(); + void draw() override; // call this once per frame to handle visibility, rect location, // button highlights, etc. @@ -101,7 +101,7 @@ protected: protected: - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; // When the floater is going away, reset any options that need to be // cleared. void resetToolState(); @@ -126,9 +126,9 @@ public: LLPanelRegionTools(); /*virtual*/ ~LLPanelRegionTools(); - BOOL postBuild(); + BOOL postBuild() override; - /*virtual*/ void refresh(); + /*virtual*/ void refresh() override; static void onSaveState(void* userdata); static void onChangeSimName(LLLineEditor* caller, void* userdata); @@ -188,9 +188,9 @@ public: LLPanelGridTools(); virtual ~LLPanelGridTools(); - BOOL postBuild(); + BOOL postBuild() override; - void refresh(); + void refresh() override; static void onDragSunPhase(LLUICtrl *ctrl, void *userdata); void onClickFlushMapVisibilityCaches(); @@ -212,9 +212,9 @@ public: LLPanelObjectTools(); /*virtual*/ ~LLPanelObjectTools(); - BOOL postBuild(); + BOOL postBuild() override; - /*virtual*/ void refresh(); + /*virtual*/ void refresh() override; void setTargetAvatar(const LLUUID& target_id); U64 computeRegionFlags(U64 initial_flags) const; @@ -253,9 +253,9 @@ public: LLPanelRequestTools(); /*virtual*/ ~LLPanelRequestTools(); - BOOL postBuild(); + BOOL postBuild() override; - void refresh(); + void refresh() override; static void sendRequest(const std::string& request, const std::string& parameter, diff --git a/indra/newview/llfloatergotoline.cpp b/indra/newview/llfloatergotoline.cpp index 96fe10d9f64e56be2f9b356843de80788e661866..1050c43884f41900224186092dc62d22412d5da6 100644 --- a/indra/newview/llfloatergotoline.cpp +++ b/indra/newview/llfloatergotoline.cpp @@ -35,12 +35,12 @@ #include "llscripteditor.h" #include "llviewerwindow.h" -LLFloaterGotoLine* LLFloaterGotoLine::sInstance = NULL; +LLFloaterGotoLine* LLFloaterGotoLine::sInstance = nullptr; LLFloaterGotoLine::LLFloaterGotoLine(LLScriptEdCore* editor_core) : LLFloater(LLSD()), - mGotoBox(NULL), - mEditorCore(editor_core) + mEditorCore(editor_core), + mGotoBox(nullptr) { buildFromFile("floater_goto_line.xml"); @@ -92,7 +92,7 @@ void LLFloaterGotoLine::show(LLScriptEdCore* editor_core) LLFloaterGotoLine::~LLFloaterGotoLine() { - sInstance = NULL; + sInstance = nullptr; } // static diff --git a/indra/newview/llfloatergotoline.h b/indra/newview/llfloatergotoline.h index 96bc97c051b5fdc0d397029663cf9c85eda8d70a..808d62f76d771adfff7510d48476a83de166769c 100644 --- a/indra/newview/llfloatergotoline.h +++ b/indra/newview/llfloatergotoline.h @@ -39,7 +39,7 @@ public: LLFloaterGotoLine(LLScriptEdCore* editor_core); ~LLFloaterGotoLine(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; static void show(LLScriptEdCore* editor_core); static void onBtnGoto(void* userdata); @@ -48,8 +48,8 @@ public: LLScriptEdCore* getEditorCore() { return mEditorCore; } static LLFloaterGotoLine* getInstance() { return sInstance; } - virtual bool hasAccelerators() const; - virtual BOOL handleKeyHere(KEY key, MASK mask); + bool hasAccelerators() const override; + BOOL handleKeyHere(KEY key, MASK mask) override; private: diff --git a/indra/newview/llfloatergridstatus.h b/indra/newview/llfloatergridstatus.h index 0c3deb7d4c8d7adba06c0e5790d90c2f44b9cba9..43ba48f38d116bec376fec02fdc2b8201e1aaf07 100644 --- a/indra/newview/llfloatergridstatus.h +++ b/indra/newview/llfloatergridstatus.h @@ -43,8 +43,8 @@ public: LLFloaterGridStatus(const Params& key); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false) override; static bool checkGridStatusRSS(); static void getGridStatusRSSCoro(); @@ -57,7 +57,7 @@ public: private: - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void applyPreferredRect(); diff --git a/indra/newview/llfloatergroupbulkban.cpp b/indra/newview/llfloatergroupbulkban.cpp index 0b6eb1861dcfc2cd8ddb18ff2a49839e71b38780..bf27f9500630d3e3d8fe483eb781430f627f6d1e 100644 --- a/indra/newview/llfloatergroupbulkban.cpp +++ b/indra/newview/llfloatergroupbulkban.cpp @@ -37,7 +37,7 @@ class LLFloaterGroupBulkBan::impl { public: - impl(const LLUUID& group_id) : mGroupID(group_id), mBulkBanPanelp(NULL) {} + impl(const LLUUID& group_id) : mGroupID(group_id), mBulkBanPanelp(nullptr) {} ~impl() {} static void closeFloater(void* data); @@ -110,7 +110,7 @@ void LLFloaterGroupBulkBan::showForGroup(const LLUUID& group_id, uuid_vec_t* age // If we don't have a floater for this group, create one. LLFloaterGroupBulkBan* fgb = get_if_there(impl::sInstances, group_id, - (LLFloaterGroupBulkBan*)NULL); + (LLFloaterGroupBulkBan*)nullptr); if (!fgb) { fgb = new LLFloaterGroupBulkBan(group_id); @@ -125,7 +125,7 @@ void LLFloaterGroupBulkBan::showForGroup(const LLUUID& group_id, uuid_vec_t* age fgb->mImpl->mBulkBanPanelp->clear(); } - if (agent_ids != NULL) + if (agent_ids != nullptr) { fgb->mImpl->mBulkBanPanelp->addUsers(*agent_ids); } diff --git a/indra/newview/llfloatergroupbulkban.h b/indra/newview/llfloatergroupbulkban.h index 5b680a1ba4969541920a8ae728a62153a6895d6a..c430e6fee041ed1c86fdc667419845e4e646e9e5 100644 --- a/indra/newview/llfloatergroupbulkban.h +++ b/indra/newview/llfloatergroupbulkban.h @@ -36,7 +36,7 @@ class LLFloaterGroupBulkBan : public LLFloater public: virtual ~LLFloaterGroupBulkBan(); - static void showForGroup(const LLUUID& group_id, uuid_vec_t* agent_ids = NULL); + static void showForGroup(const LLUUID& group_id, uuid_vec_t* agent_ids = nullptr); protected: LLFloaterGroupBulkBan(const LLUUID& group_id = LLUUID::null); diff --git a/indra/newview/llfloatergroupinvite.cpp b/indra/newview/llfloatergroupinvite.cpp index 99ba2d8db128702b3101cc9259e73f12f39cfe44..24e016a141fb74519237455390a9a14f25642f14 100644 --- a/indra/newview/llfloatergroupinvite.cpp +++ b/indra/newview/llfloatergroupinvite.cpp @@ -57,7 +57,7 @@ std::map<LLUUID, LLFloaterGroupInvite*> LLFloaterGroupInvite::impl::sInstances; LLFloaterGroupInvite::impl::impl(const LLUUID& group_id) : mGroupID(group_id), - mInvitePanelp(NULL) + mInvitePanelp(nullptr) { } @@ -126,7 +126,7 @@ void LLFloaterGroupInvite::showForGroup(const LLUUID& group_id, uuid_vec_t *agen // If we don't have a floater for this group, create one. LLFloaterGroupInvite *fgi = get_if_there(impl::sInstances, group_id, - (LLFloaterGroupInvite*)NULL); + (LLFloaterGroupInvite*)nullptr); // refresh group information gAgent.sendAgentDataUpdateRequest(); @@ -147,7 +147,7 @@ void LLFloaterGroupInvite::showForGroup(const LLUUID& group_id, uuid_vec_t *agen fgi->mImpl->mInvitePanelp->clear(); } - if (agent_ids != NULL) + if (agent_ids != nullptr) { fgi->mImpl->mInvitePanelp->addUsers(*agent_ids); } diff --git a/indra/newview/llfloatergroupinvite.h b/indra/newview/llfloatergroupinvite.h index f6a3ca55509b6c2a7e6c2b3b50a9e7fb50c4f58d..c9f71c7ae3f7e35588f8d202fa4635b5e89f4498 100644 --- a/indra/newview/llfloatergroupinvite.h +++ b/indra/newview/llfloatergroupinvite.h @@ -37,7 +37,7 @@ class LLFloaterGroupInvite public: virtual ~LLFloaterGroupInvite(); - static void showForGroup(const LLUUID &group_id, uuid_vec_t *agent_ids = NULL); + static void showForGroup(const LLUUID &group_id, uuid_vec_t *agent_ids = nullptr); protected: LLFloaterGroupInvite(const LLUUID& group_id = LLUUID::null); diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 1edc4f5bd58af1b5df2b54a838b2d622a2924e43..f1c53c38f4c24d3a75a8900788106246f921a73e 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -58,8 +58,8 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow LLFloaterGroupPicker::LLFloaterGroupPicker(const LLSD& seed) : LLFloater(seed), - mPowersMask(GP_ALL_POWERS), - mID(seed.asUUID()) + mID(seed.asUUID()), + mPowersMask(GP_ALL_POWERS) { // LLUICtrlFactory::getInstance()->buildFloater(this, "floater_choose_group.xml"); } diff --git a/indra/newview/llfloatergroups.h b/indra/newview/llfloatergroups.h index 324149e2ae22052913bdb60f0dcd8a181a019ebf..a0237f47fe1be2776c4f6f115bb55edc4c721c82 100644 --- a/indra/newview/llfloatergroups.h +++ b/indra/newview/llfloatergroups.h @@ -57,7 +57,7 @@ public: typedef boost::signals2::signal<void (LLUUID id)> signal_t; void setSelectGroupCallback(const signal_t::slot_type& cb) { mGroupSelectSignal.connect(cb); } void setPowersMask(U64 powers_mask); - BOOL postBuild(); + BOOL postBuild() override; // implementation of factory policy static LLFloaterGroupPicker* findInstance(const LLSD& seed); @@ -87,14 +87,14 @@ public: virtual ~LLPanelGroups(); //LLEventListener - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); + /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override; // clear the group list, and get a fresh set of info. void reset(); protected: // initialize based on the type - BOOL postBuild(); + BOOL postBuild() override; // highlight_id is a group id to highlight void enableButtons(); diff --git a/indra/newview/llfloaterhandler.cpp b/indra/newview/llfloaterhandler.cpp index 8d726ca5e9bf5b19274da6a853a6dd1cb84c0fa4..35ddcabd8e7d0a52091537954d4ee5ec0cd2a768 100644 --- a/indra/newview/llfloaterhandler.cpp +++ b/indra/newview/llfloaterhandler.cpp @@ -35,7 +35,7 @@ LLFloaterHandler gFloaterHandler; LLFloater* get_parent_floater(LLView* view) { - LLFloater* floater = NULL; + LLFloater* floater = nullptr; LLView* parent = view->getParent(); while (parent) { @@ -53,7 +53,7 @@ LLFloater* get_parent_floater(LLView* view) bool LLFloaterHandler::handle(const LLSD ¶ms, const LLSD &query_map, LLMediaCtrl *web) { if (params.size() < 2) return false; - LLFloater* floater = NULL; + LLFloater* floater = nullptr; // *TODO: implement floater lookup by name if (params[0].asString() == "self") { diff --git a/indra/newview/llfloaterhandler.h b/indra/newview/llfloaterhandler.h index 5915642d6671eb9f905867fe4d3c79e049733661..3e95a9428dc13016006777b42180d906040436ad 100644 --- a/indra/newview/llfloaterhandler.h +++ b/indra/newview/llfloaterhandler.h @@ -33,7 +33,7 @@ class LLFloaterHandler { public: LLFloaterHandler() : LLCommandHandler("floater", UNTRUSTED_BLOCK) { } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web); + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override; }; #endif diff --git a/indra/newview/llfloaterhelpbrowser.h b/indra/newview/llfloaterhelpbrowser.h index bf4f544a14b1cc75cde3d38158a3cb21f2719203..2b07ced708bb23028c3f32edaf2e51efe3f9fcd9 100644 --- a/indra/newview/llfloaterhelpbrowser.h +++ b/indra/newview/llfloaterhelpbrowser.h @@ -40,12 +40,12 @@ class LLFloaterHelpBrowser : public: LLFloaterHelpBrowser(const LLSD& key); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onClose(bool app_quitting) override; + /*virtual*/ void onOpen(const LLSD& key) override; // inherited from LLViewerMediaObserver - /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; void openMedia(const std::string& media_url); diff --git a/indra/newview/llfloaterhud.cpp b/indra/newview/llfloaterhud.cpp index b958927ee4cbdcf89a4a85620bdc53bf4f7c9c1e..41e3096ae010bc0a13138f10d487f84b99f85ad7 100644 --- a/indra/newview/llfloaterhud.cpp +++ b/indra/newview/llfloaterhud.cpp @@ -46,7 +46,7 @@ // Default constructor LLFloaterHUD::LLFloaterHUD(const LLSD& key) : LLFloater(key), - mWebBrowser(0) + mWebBrowser(nullptr) { // do not build the floater if there the url is empty if (gSavedSettings.getString("TutorialURL").empty()) diff --git a/indra/newview/llfloaterhud.h b/indra/newview/llfloaterhud.h index e560d6320b1a47431d009a7f5f6f6a71f71a9b48..e715af08b47104ecdced942287b080793264554e 100644 --- a/indra/newview/llfloaterhud.h +++ b/indra/newview/llfloaterhud.h @@ -36,7 +36,7 @@ class LLFloaterHUD : public LLFloater friend class LLFloaterReg; public: - BOOL postBuild(); + BOOL postBuild() override; private: // Handles its own construction and destruction, so private. diff --git a/indra/newview/llfloaterimagepreview.h b/indra/newview/llfloaterimagepreview.h index 472f35b4f0ce18f7ed805960ea90a1d6e5ccc4bb..7b006fbab52d4c7b5ee51d5116e7f0ff4a068734 100644 --- a/indra/newview/llfloaterimagepreview.h +++ b/indra/newview/llfloaterimagepreview.h @@ -47,17 +47,17 @@ protected: public: LLImagePreviewSculpted(S32 width, S32 height); - /*virtual*/ S8 getType() const ; + /*virtual*/ S8 getType() const override; void setPreviewTarget(LLImageRaw *imagep, F32 distance); void setTexture(U32 name) { mTextureName = name; } - BOOL render(); + BOOL render() override; void refresh(); void rotate(F32 yaw_radians, F32 pitch_radians); void zoom(F32 zoom_amt); void pan(F32 right, F32 up); - virtual BOOL needsRender() { return mNeedsUpdate; } + BOOL needsRender() override { return mNeedsUpdate; } protected: BOOL mNeedsUpdate; @@ -80,18 +80,18 @@ protected: public: LLImagePreviewAvatar(S32 width, S32 height); - /*virtual*/ S8 getType() const ; + /*virtual*/ S8 getType() const override; void setPreviewTarget(const std::string& joint_name, const std::string& mesh_name, LLImageRaw* imagep, F32 distance, BOOL male); void setTexture(U32 name) { mTextureName = name; } void clearPreviewTexture(const std::string& mesh_name); - BOOL render(); + BOOL render() override; void refresh(); void rotate(F32 yaw_radians, F32 pitch_radians); void zoom(F32 zoom_amt); void pan(F32 right, F32 up); - virtual BOOL needsRender() { return mNeedsUpdate; } + BOOL needsRender() override { return mNeedsUpdate; } protected: BOOL mNeedsUpdate; @@ -112,12 +112,12 @@ public: LLFloaterImagePreview(const std::string& filename); virtual ~LLFloaterImagePreview(); - virtual BOOL postBuild(); + BOOL postBuild() override; - BOOL handleMouseDown(S32 x, S32 y, MASK mask); - BOOL handleMouseUp(S32 x, S32 y, MASK mask); - BOOL handleHover(S32 x, S32 y, MASK mask); - BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; static void onMouseCaptureLostImagePreview(LLMouseHandler*); @@ -125,7 +125,7 @@ public: protected: static void onPreviewTypeCommit(LLUICtrl*,void*); - void draw(); + void draw() override; bool loadImage(const std::string& filename); LLPointer<LLImageRaw> mRawImagep; diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 8929e65e7520dbeea616f570515d388381709e4a..bd5b70ce76faaa51fd47467c603d0160331c1252 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -55,20 +55,20 @@ public: LLFloaterIMContainer(const LLSD& seed, const Params& params = getDefaultParams()); virtual ~LLFloaterIMContainer(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void draw(); - /*virtual*/ void setMinimized(BOOL b); - /*virtual*/ void setVisible(BOOL visible); - /*virtual*/ void setVisibleAndFrontmost(BOOL take_focus=TRUE, const LLSD& key = LLSD()); - /*virtual*/ void updateResizeLimits(); - /*virtual*/ void handleReshape(const LLRect& rect, bool by_user); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void draw() override; + /*virtual*/ void setMinimized(BOOL b) override; + /*virtual*/ void setVisible(BOOL visible) override; + /*virtual*/ void setVisibleAndFrontmost(BOOL take_focus=TRUE, const LLSD& key = LLSD()) override; + /*virtual*/ void updateResizeLimits() override; + /*virtual*/ void handleReshape(const LLRect& rect, bool by_user) override; void onCloseFloater(LLUUID& id); /*virtual*/ void addFloater(LLFloater* floaterp, BOOL select_added_floater, - LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); + LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END) override; void returnFloaterToHost(); void showConversation(const LLUUID& session_id); void selectConversation(const LLUUID& session_id); @@ -79,7 +79,7 @@ public: bool selectNextorPreviousConversation(bool select_next, bool focus_selected = true); void expandConversation(); - /*virtual*/ void tabClose(); + /*virtual*/ void tabClose() override; void showStub(bool visible); static LLFloater* getCurrentVoiceFloater(); @@ -96,11 +96,11 @@ public: static void idle(void* user_data); // LLIMSessionObserver observe triggers - /*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, BOOL has_offline_msg); - /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); - /*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id); - /*virtual*/ void sessionRemoved(const LLUUID& session_id); - /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); + /*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, BOOL has_offline_msg) override; + /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) override; + /*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) override; + /*virtual*/ void sessionRemoved(const LLUUID& session_id) override; + /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) override; LLConversationViewModel& getRootViewModel() { return mConversationViewModel; } LLUUID getSelectedSession() { return mSelectedSession; } @@ -115,11 +115,11 @@ public: void doToParticipants(const std::string& item, uuid_vec_t& selectedIDS); void assignResizeLimits(); - virtual BOOL handleKeyHere(KEY key, MASK mask ); - /*virtual*/ void closeFloater(bool app_quitting = false); + BOOL handleKeyHere(KEY key, MASK mask ) override; + /*virtual*/ void closeFloater(bool app_quitting = false) override; void closeAllConversations(); void closeSelectedConversations(const uuid_vec_t& ids); - /*virtual*/ BOOL isFrontmost(); + /*virtual*/ BOOL isFrontmost() override; private: @@ -127,7 +127,7 @@ private: avatarID_panel_map_t mSessions; boost::signals2::connection mNewMessageConnection; - /*virtual*/ void computeResizeLimits(S32& new_min_width, S32& new_min_height) {} + /*virtual*/ void computeResizeLimits(S32& new_min_width, S32& new_min_height) override {} void onNewMessageReceived(const LLSD& data); @@ -136,8 +136,8 @@ private: void processParticipantsStyleUpdate(); void onSpeakButtonPressed(); void onSpeakButtonReleased(); - /*virtual*/ void onClickCloseBtn(bool app_quitting = false); - /*virtual*/ void closeHostedFloater(); + /*virtual*/ void onClickCloseBtn(bool app_quitting = false) override; + /*virtual*/ void closeHostedFloater() override; void collapseConversationsPane(bool collapse, bool save_is_allowed=true); diff --git a/indra/newview/llfloaterimnearbychat.h b/indra/newview/llfloaterimnearbychat.h index 31c69e79d39e53b7831097dbac5e924847b84152..b8d7c2206b7ccd6c69db2f8eaf3b143a11d0f0b5 100644 --- a/indra/newview/llfloaterimnearbychat.h +++ b/indra/newview/llfloaterimnearbychat.h @@ -48,12 +48,12 @@ public: static LLFloaterIMNearbyChat* buildFloater(const LLSD& key); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void setVisible(BOOL visible); - /*virtual*/ void setVisibleAndFrontmost(BOOL take_focus=TRUE, const LLSD& key = LLSD()); - /*virtual*/ void closeHostedFloater(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void onClose(bool app_quitting) override; + /*virtual*/ void setVisible(BOOL visible) override; + /*virtual*/ void setVisibleAndFrontmost(BOOL take_focus=TRUE, const LLSD& key = LLSD()) override; + /*virtual*/ void closeHostedFloater() override; void loadHistory(); void reloadMessages(bool clean_messages = false); @@ -71,7 +71,7 @@ public: std::string getCurrentChat(); S32 getMessageArchiveLength() {return mMessageArchive.size();} - virtual BOOL handleKeyHere( KEY key, MASK mask ); + BOOL handleKeyHere( KEY key, MASK mask ) override; static void startChat(const char* line); static void stopChat(); @@ -90,8 +90,8 @@ protected: void onChatBoxCommit(); void onChatFontChange(LLFontGL* fontp); - /*virtual*/ void onTearOffClicked(); - /*virtual*/ void onClickCloseBtn(bool app_qutting = false); + /*virtual*/ void onTearOffClicked() override; + /*virtual*/ void onClickCloseBtn(bool app_qutting = false) override; void displaySpeakingIndicator(); @@ -103,7 +103,7 @@ protected: S32 mExpandedHeight; private: - /*virtual*/ void refresh(); + /*virtual*/ void refresh() override; std::vector<LLChat> mMessageArchive; }; diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index b3418d7bd4d1aaecc232f6f79872b0a24d72ed53..d2b2bc4e68fb3dc2317caf9c32d281dfc2f4665d 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -95,14 +95,14 @@ public: void onToastDestroyed (LLToast* toast, bool app_quitting); void onToastFade (LLToast* toast); - void redrawToasts() + void redrawToasts() override { arrangeToasts(); } // hide all toasts from screen, but not remove them from a channel // removes all toasts from a channel - virtual void removeToastsFromChannel() + void removeToastsFromChannel() override { for(toast_vec_t::iterator it = m_active_toasts.begin(); it != m_active_toasts.end(); ++it) { @@ -111,7 +111,7 @@ public: m_active_toasts.clear(); }; - virtual void deleteAllChildren() + void deleteAllChildren() override { LL_DEBUGS("NearbyChat") << "Clearing toast pool" << LL_ENDL; m_toast_pool.clear(); @@ -175,7 +175,7 @@ public: { } - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onClose(bool app_quitting) override; private: LLFloaterIMNearbyChatScreenChannel* mNearbyChatScreenChannelp; @@ -287,7 +287,7 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat) if(mStopProcessing) return; - if (mFloaterSnapRegion == NULL) + if (mFloaterSnapRegion == nullptr) { mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); } @@ -378,7 +378,7 @@ void LLFloaterIMNearbyChatScreenChannel::arrangeToasts() if(mStopProcessing || isHovering()) return; - if (mFloaterSnapRegion == NULL) + if (mFloaterSnapRegion == nullptr) { mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); } diff --git a/indra/newview/llfloaterimnearbychathandler.h b/indra/newview/llfloaterimnearbychathandler.h index 94cffe113bcffc6cca0c3b10a0e84d4337ebe8fb..92c97fd1632091e2884e563a3a88a3923a65f2e1 100644 --- a/indra/newview/llfloaterimnearbychathandler.h +++ b/indra/newview/llfloaterimnearbychathandler.h @@ -50,10 +50,10 @@ public: virtual ~LLFloaterIMNearbyChatHandler(); - virtual void processChat(const LLChat& chat_msg, const LLSD &args); + void processChat(const LLChat& chat_msg, const LLSD &args) override; protected: - virtual void initChannel(); + void initChannel() override; static boost::scoped_ptr<LLEventPump> sChatWatcher; }; diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index de80b3eb578d2d5fb9ce0d1ef62b72a3b0248956..dfac1b5f3ee720037715d2fd956a1453b0ac2c7d 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -74,17 +74,17 @@ LLFloaterIMSession::LLFloaterIMSession(const LLUUID& session_id) : LLFloaterIMSessionTab(session_id), mLastMessageIndex(-1), mDialog(IM_NOTHING_SPECIAL), + mPositioned(false), mTypingStart(), - mShouldSendTypingState(false), mMeTyping(false), mOtherTyping(false), - mSessionNameUpdatedForTyping(false), + mShouldSendTypingState(false), mTypingTimer(), mTypingTimeoutTimer(), - mPositioned(false), - mSessionInitialized(false), + mSessionNameUpdatedForTyping(false), mMeTypingTimer(), mOtherTypingTimer(), + mSessionInitialized(false), mImInfo() { mIsNearbyChat = false; @@ -144,14 +144,14 @@ void LLFloaterIMSession::onClickCloseBtn(bool) { LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSessionID); - if (session != NULL) + if (session != nullptr) { bool is_call_with_chat = session->isGroupSessionType() || session->isAdHocSessionType() || session->isP2PSessionType(); LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID); - if (is_call_with_chat && voice_channel != NULL + if (is_call_with_chat && voice_channel != nullptr && voice_channel->isActive()) { LLSD payload; @@ -481,7 +481,7 @@ void LLFloaterIMSession::addP2PSessionParticipants(const LLSD& notification, con LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID); // first check whether this is a voice session - bool is_voice_call = voice_channel != NULL && voice_channel->isActive(); + bool is_voice_call = voice_channel != nullptr && voice_channel->isActive(); uuid_vec_t temp_ids; @@ -588,7 +588,7 @@ LLFloaterIMSession* LLFloaterIMSession::show(const LLUUID& session_id) closeHiddenIMToasts(); if (!gIMMgr->hasSession(session_id)) - return NULL; + return nullptr; // Test the existence of the floater before we try to create it bool exist = findInstance(session_id); @@ -596,7 +596,7 @@ LLFloaterIMSession* LLFloaterIMSession::show(const LLUUID& session_id) // Get the floater: this will create the instance if it didn't exist LLFloaterIMSession* floater = getInstance(session_id); if (!floater) - return NULL; + return nullptr; LLFloaterIMContainer* floater_container = LLFloaterIMContainer::getInstance(); @@ -707,10 +707,10 @@ void LLFloaterIMSession::setVisible(BOOL visible) if(!visible) { LLChicletPanel * chiclet_panelp = LLChicletBar::getInstance()->getChicletPanel(); - if (NULL != chiclet_panelp) + if (nullptr != chiclet_panelp) { LLIMChiclet * chicletp = chiclet_panelp->findChiclet<LLIMChiclet>(mSessionID); - if(NULL != chicletp) + if(nullptr != chicletp) { chicletp->setToggleState(false); } @@ -866,7 +866,7 @@ void LLFloaterIMSession::updateMessages() { chat.mNotifId = msg["notification_id"].asUUID(); // if notification exists - embed it - if (LLNotificationsUtil::find(chat.mNotifId) != NULL) + if (LLNotificationsUtil::find(chat.mNotifId) != nullptr) { // remove embedded notification from channel LLNotificationsUI::LLScreenChannel* channel = static_cast<LLNotificationsUI::LLScreenChannel*> @@ -895,7 +895,7 @@ void LLFloaterIMSession::updateMessages() mLastMessageIndex = msg["index"].asInteger(); // if it is a notification - next message is a notification history log, so skip it - if (chat.mNotifId.notNull() && LLNotificationsUtil::find(chat.mNotifId) != NULL) + if (chat.mNotifId.notNull() && LLNotificationsUtil::find(chat.mNotifId) != nullptr) { if (++iter == iter_end) { @@ -916,7 +916,7 @@ void LLFloaterIMSession::reloadMessages(bool clean_messages/* = false*/) { LLIMModel::LLIMSession * sessionp = LLIMModel::instance().findIMSession(mSessionID); - if (NULL != sessionp) + if (nullptr != sessionp) { sessionp->loadHistory(); } @@ -1190,7 +1190,7 @@ BOOL LLFloaterIMSession::isInviteAllowed() const BOOL LLFloaterIMSession::inviteToSession(const uuid_vec_t& ids) { LLViewerRegion* region = gAgent.getRegion(); - bool is_region_exist = region != NULL; + bool is_region_exist = region != nullptr; if (is_region_exist) { @@ -1305,7 +1305,7 @@ void LLFloaterIMSession::closeHiddenIMToasts() class IMToastMatcher: public LLNotificationsUI::LLScreenChannel::Matcher { public: - bool matches(const LLNotificationPtr notification) const + bool matches(const LLNotificationPtr notification) const override { // "notifytoast" type of notifications is reserved for IM notifications return "notifytoast" == notification->getType(); @@ -1314,7 +1314,7 @@ void LLFloaterIMSession::closeHiddenIMToasts() LLNotificationsUI::LLScreenChannel* channel = LLNotificationsUI::LLChannelManager::getNotificationScreenChannel(); - if (channel != NULL) + if (channel != nullptr) { channel->closeHiddenToasts(IMToastMatcher()); } @@ -1327,7 +1327,7 @@ void LLFloaterIMSession::confirmLeaveCallCallback(const LLSD& notification, cons LLUUID session_id = payload["session_id"]; LLFloater* im_floater = findInstance(session_id); - if (option == 0 && im_floater != NULL) + if (option == 0 && im_floater != nullptr) { im_floater->closeFloater(); } diff --git a/indra/newview/llfloaterimsession.h b/indra/newview/llfloaterimsession.h index 0f7164a58596e083fe6ccf4cfdd8c104273964e2..78715fe0bbc342598f95ee16d044d9746f19b734 100644 --- a/indra/newview/llfloaterimsession.h +++ b/indra/newview/llfloaterimsession.h @@ -64,26 +64,26 @@ public: void initIMFloater(); // LLView overrides - /*virtual*/ BOOL postBuild(); - /*virtual*/ void setMinimized(BOOL b); - /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void setMinimized(BOOL b) override; + /*virtual*/ void setVisible(BOOL visible) override; /*virtual*/ BOOL getVisible(); - /*virtual*/ void setFocus(BOOL focus); + /*virtual*/ void setFocus(BOOL focus) override; // Check typing timeout timer. - /*virtual*/ void draw(); + /*virtual*/ void draw() override; /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; static LLFloaterIMSession* findInstance(const LLUUID& session_id); static LLFloaterIMSession* getInstance(const LLUUID& session_id); // LLFloater overrides - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); + /*virtual*/ void onClose(bool app_quitting) override; + /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true) override; // Make IM conversion visible and update the message history static LLFloaterIMSession* show(const LLUUID& session_id); @@ -94,7 +94,7 @@ public: void sessionInitReplyReceived(const LLUUID& im_session_id); // get new messages from LLIMModel - /*virtual*/ void updateMessages(); + /*virtual*/ void updateMessages() override; void reloadMessages(bool clean_messages = false); static void onSendMsg(LLUICtrl*, void*); void sendMsgFromInputEditor(); @@ -115,9 +115,9 @@ public: // Implements LLVoiceClientStatusObserver::onChange() to enable the call // button when voice is available void onChange(EStatusType status, const std::string &channelURI, - bool proximal); + bool proximal) override; - virtual LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::IM; } + LLTransientFloaterMgr::ETransientGroup getGroup() override { return LLTransientFloaterMgr::IM; } virtual void onVoiceChannelStateChanged( const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state); @@ -138,13 +138,13 @@ public: S32 getLastChatMessageIndex() {return mLastMessageIndex;} private: - /*virtual*/ void refresh(); + /*virtual*/ void refresh() override; - /*virtual*/ void onTearOffClicked(); - /*virtual*/ void onClickCloseBtn(bool app_qutting); + /*virtual*/ void onTearOffClicked() override; + /*virtual*/ void onClickCloseBtn(bool app_qutting) override; // Update the window title and input field help text - /*virtual*/ void updateSessionName(const std::string& name); + /*virtual*/ void updateSessionName(const std::string& name) override; bool dropPerson(LLUUID* person_id, bool drop); @@ -168,7 +168,7 @@ private: void addTypingIndicator(const LLIMInfo* im_info); // Remove the "User is typing..." indicator. - void removeTypingIndicator(const LLIMInfo* im_info = NULL); + void removeTypingIndicator(const LLIMInfo* im_info = nullptr); static void closeHiddenIMToasts(); diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 828d37828ad00837e50965ea463bf1d624aa341a..5d0e5ebffba5954abe863bad4e10ec39ed6c1fd0 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -49,7 +49,7 @@ const F32 REFRESH_INTERVAL = 1.0f; LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) -: LLTransientDockableFloater(NULL, false, session_id), +: LLTransientDockableFloater(nullptr, false, session_id), mFloaterExtraWidth(0), mIsNearbyChat(false), mIsP2PChat(false), @@ -213,7 +213,7 @@ void LLFloaterIMSessionTab::addToHost(const LLUUID& session_id) // LLFloater::mHostHandle = NULL (a current host), but // LLFloater::mLastHostHandle = floater_container (a "future" host) conversp->setHost(floater_container); - conversp->setHost(NULL); + conversp->setHost(nullptr); conversp->forceReshape(); } @@ -321,7 +321,7 @@ BOOL LLFloaterIMSessionTab::postBuild() p.parent_panel = mParticipantListPanel; p.listener = base_item; p.view_model = &mConversationViewModel; - p.root = NULL; + p.root = nullptr; p.use_ellipses = true; p.options_menu = "menu_conversation.xml"; p.name = "root"; @@ -619,7 +619,7 @@ void LLFloaterIMSessionTab::refreshConversation() } mConversationViewModel.requestSortAll(); - if(mConversationsRoot != NULL) + if(mConversationsRoot != nullptr) { mConversationsRoot->arrangeAll(); mConversationsRoot->update(); @@ -1097,7 +1097,7 @@ void LLFloaterIMSessionTab::getSelectedUUIDs(uuid_vec_t& selected_uuids) LLConversationItem* LLFloaterIMSessionTab::getCurSelectedViewModelItem() { - LLConversationItem *conversationItem = NULL; + LLConversationItem *conversationItem = nullptr; if(mConversationsRoot && mConversationsRoot->getCurSelectedItem() && diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h index b798c693a257e73627b1ae2e5f09c786d8bdeb0d..707f72198e8e83ee6083bc2a1ab061c3b4eed428 100644 --- a/indra/newview/llfloaterimsessiontab.h +++ b/indra/newview/llfloaterimsessiontab.h @@ -76,11 +76,11 @@ public: bool isNearbyChat() {return mIsNearbyChat;} // LLFloater overrides - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); - /*virtual*/ void setVisible(BOOL visible); - /*virtual*/ void setFocus(BOOL focus); + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void draw() override; + /*virtual*/ void setVisible(BOOL visible) override; + /*virtual*/ void setFocus(BOOL focus) override; // Handle the left hand participant list widgets void addConversationViewParticipant(LLConversationItem* item); @@ -96,7 +96,7 @@ public: virtual void updateMessages() {} LLConversationItem* getCurSelectedViewModelItem(); void forceReshape(); - virtual BOOL handleKeyHere( KEY key, MASK mask ); + BOOL handleKeyHere( KEY key, MASK mask ) override; bool isMessagePaneExpanded(){return mMessagePaneExpanded;} void setMessagePaneExpanded(bool expanded){mMessagePaneExpanded = expanded;} void restoreFloater(); @@ -135,8 +135,8 @@ protected: virtual void enableDisableCallBtn(); // process focus events to set a currently active session - /* virtual */ void onFocusLost(); - /* virtual */ void onFocusReceived(); + /* virtual */ void onFocusLost() override; + /* virtual */ void onFocusReceived() override; // prepare chat's params and out one message to chatHistory void appendMessage(const LLChat& chat, const LLSD &args = 0); @@ -198,7 +198,7 @@ private: void getSelectedUUIDs(uuid_vec_t& selected_uuids); /// Refreshes the floater at a constant rate. - virtual void refresh() = 0; + void refresh() override = 0; /** * Adjusts chat history height to fit vertically with input chat field diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 24b9e25d5403e890004fc37c1356386d081273aa..307947c725f04afc67ad0c742b193d35d663818e 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -120,7 +120,8 @@ void LLFloaterInspect::onClickCreatorProfile() { LLUUID obj_id; f(const LLUUID& id) : obj_id(id) {} - virtual bool apply(LLSelectNode* node) + + bool apply(LLSelectNode* node) override { return (obj_id == node->getObject()->getID()); } @@ -145,7 +146,8 @@ void LLFloaterInspect::onClickOwnerProfile() { LLUUID obj_id; f(const LLUUID& id) : obj_id(id) {} - virtual bool apply(LLSelectNode* node) + + bool apply(LLSelectNode* node) override { return (obj_id == node->getObject()->getID()); } diff --git a/indra/newview/llfloaterinspect.h b/indra/newview/llfloaterinspect.h index 605d8565e4c9f6267fbe445978c3cf2c488aafd3..54780147ba5f4fdf711a5b8633f70a6f30d5cf24 100644 --- a/indra/newview/llfloaterinspect.h +++ b/indra/newview/llfloaterinspect.h @@ -43,14 +43,14 @@ class LLFloaterInspect : public LLFloater public: // static void show(void* ignored = NULL); - void onOpen(const LLSD& key); - virtual BOOL postBuild(); + void onOpen(const LLSD& key) override; + BOOL postBuild() override; void dirty(); LLUUID getSelectedUUID(); - virtual void draw(); - virtual void refresh(); + void draw() override; + void refresh() override; // static BOOL isVisible(); - virtual void onFocusReceived(); + void onFocusReceived() override; void onClickCreatorProfile(); void onClickOwnerProfile(); void onSelectObject(); diff --git a/indra/newview/llfloaterjoystick.h b/indra/newview/llfloaterjoystick.h index 5a89733342ed24758cc0ca963e0e9444877d2d81..bcf0635881e366c07bf34b1bbf482f4824919083 100644 --- a/indra/newview/llfloaterjoystick.h +++ b/indra/newview/llfloaterjoystick.h @@ -38,18 +38,18 @@ class LLFloaterJoystick : public LLFloater public: - virtual BOOL postBuild(); - virtual void refresh(); + BOOL postBuild() override; + void refresh() override; virtual void apply(); // Apply the changed values. virtual void cancel(); // Cancel the changed values. - virtual void draw(); + void draw() override; static void setSNDefaults(); static void setXbox360Defaults(); protected: - void onClose(bool app_quitting); - void onClickCloseBtn(bool app_quitting); + void onClose(bool app_quitting) override; + void onClickCloseBtn(bool app_quitting) override; private: diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index fe5b9ee6fa1e114a26beb13f87f9aa9756af2a9f..4e150befb7aa9085ba8ca0995ab6747d1a8832d9 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -75,9 +75,9 @@ public: static LLPanelLandCovenant* getCurrentPanelLandCovenant(); LLParcel* getCurrentSelectedParcel(); - - virtual void onOpen(const LLSD& key); - virtual BOOL postBuild(); + + void onOpen(const LLSD& key) override; + BOOL postBuild() override; private: // Does its own instance management, so clients not allowed @@ -91,7 +91,7 @@ private: protected: - /*virtual*/ void refresh(); + /*virtual*/ void refresh() override; void selectiveRefresh(); static void* createPanelLandGeneral(void* data); @@ -134,9 +134,9 @@ class LLPanelLandGeneral public: LLPanelLandGeneral(LLSafeHandle<LLParcelSelection>& parcelp); virtual ~LLPanelLandGeneral(); - /*virtual*/ void refresh(); + /*virtual*/ void refresh() override; void refreshNames(); - virtual void draw(); + void draw() override; void setGroup(const LLUUID& group_id); void onClickProfile(); @@ -169,7 +169,7 @@ public: static void confirmSaleChange(S32 landSize, S32 salePrice, std::string authorizedName, void(*callback)(void*), void* userdata); static void callbackConfirmSaleChange(S32 option, void* userdata); - virtual BOOL postBuild(); + BOOL postBuild() override; protected: LLLineEditor* mEditName; @@ -235,15 +235,15 @@ class LLPanelLandObjects public: LLPanelLandObjects(LLSafeHandle<LLParcelSelection>& parcelp); virtual ~LLPanelLandObjects(); - /*virtual*/ void refresh(); - virtual void draw(); + /*virtual*/ void refresh() override; + void draw() override; bool callbackReturnOwnerObjects(const LLSD& notification, const LLSD& response); bool callbackReturnGroupObjects(const LLSD& notification, const LLSD& response); bool callbackReturnOtherObjects(const LLSD& notification, const LLSD& response); bool callbackReturnOwnerList(const LLSD& notification, const LLSD& response); - static void clickShowCore(LLPanelLandObjects* panelp, S32 return_type, uuid_list_t* list = 0); + static void clickShowCore(LLPanelLandObjects* panelp, S32 return_type, uuid_list_t* list = nullptr); void onClickShowOwnerObjects(); void onClickShowGroupObjects(); void onClickShowOtherObjects(); @@ -260,8 +260,8 @@ public: static void onLostFocus(LLFocusableElement* caller, void* user_data); void onCommitClean(); static void processParcelObjectOwnersReply(LLMessageSystem *msg, void **); - - virtual BOOL postBuild(); + + BOOL postBuild() override; protected: @@ -306,9 +306,9 @@ class LLPanelLandOptions public: LLPanelLandOptions(LLSafeHandle<LLParcelSelection>& parcelp); virtual ~LLPanelLandOptions(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); - /*virtual*/ void refresh(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void draw() override; + /*virtual*/ void refresh() override; private: // Refresh the "show in search" checkbox and category selector. @@ -353,10 +353,10 @@ class LLPanelLandAccess public: LLPanelLandAccess(LLSafeHandle<LLParcelSelection>& parcelp); virtual ~LLPanelLandAccess(); - void refresh(); + void refresh() override; void refresh_ui(); void refreshNames(); - virtual void draw(); + void draw() override; void onCommitPublicAccess(LLUICtrl* ctrl); void onCommitAny(); @@ -364,7 +364,7 @@ public: void onClickRemoveAccess(); void onClickRemoveBanned(); - virtual BOOL postBuild(); + BOOL postBuild() override; void onClickAddAccess(); void onClickAddBanned(); @@ -385,8 +385,8 @@ class LLPanelLandCovenant public: LLPanelLandCovenant(LLSafeHandle<LLParcelSelection>& parcelp); virtual ~LLPanelLandCovenant(); - virtual BOOL postBuild(); - void refresh(); + BOOL postBuild() override; + void refresh() override; static void updateCovenantText(const std::string& string); static void updateEstateName(const std::string& name); static void updateLastModified(const std::string& text); diff --git a/indra/newview/llfloaterlandholdings.h b/indra/newview/llfloaterlandholdings.h index d1d510bb40a189007bbbe397b2a366d4d9f8e028..889326b8f763e9210e95b287b7dd8af1dd7354a4 100644 --- a/indra/newview/llfloaterlandholdings.h +++ b/indra/newview/llfloaterlandholdings.h @@ -40,12 +40,12 @@ class LLFloaterLandHoldings public: LLFloaterLandHoldings(const LLSD& key); virtual ~LLFloaterLandHoldings(); - - virtual BOOL postBuild(); - virtual void onOpen(const LLSD& key); - virtual void draw(); - void refresh(); + BOOL postBuild() override; + void onOpen(const LLSD& key) override; + void draw() override; + + void refresh() override; void buttonCore(S32 which); diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index c893b0e4fb544cd5b59b5133eb2efd172acfedb7..f759e90d1b52fb9651148f20037fdd4e350c069d 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -65,15 +65,15 @@ const S32 MAP_PADDING_BOTTOM = 0; LLFloaterMap::LLFloaterMap(const LLSD& key) : LLFloater(key), - mTextBoxEast(NULL), - mTextBoxNorth(NULL), - mTextBoxWest(NULL), - mTextBoxSouth(NULL), - mTextBoxSouthEast(NULL), - mTextBoxNorthEast(NULL), - mTextBoxNorthWest(NULL), - mTextBoxSouthWest(NULL), - mMap(NULL) + mTextBoxEast(nullptr), + mTextBoxNorth(nullptr), + mTextBoxWest(nullptr), + mTextBoxSouth(nullptr), + mTextBoxSouthEast(nullptr), + mTextBoxNorthEast(nullptr), + mTextBoxNorthWest(nullptr), + mTextBoxSouthWest(nullptr), + mMap(nullptr) { } @@ -168,7 +168,7 @@ void LLFloaterMap::setDirectionPos( LLTextBox* text_box, F32 rotation ) void LLFloaterMap::updateMinorDirections() { - if (mTextBoxNorthEast == NULL) + if (mTextBoxNorthEast == nullptr) { return; } diff --git a/indra/newview/llfloatermap.h b/indra/newview/llfloatermap.h index 380165bca134b994ba60321b06165425bd5ce77f..01627da3f3e7940d43d289db2d3fc97c8fd5f940 100644 --- a/indra/newview/llfloatermap.h +++ b/indra/newview/llfloatermap.h @@ -42,11 +42,11 @@ public: static LLFloaterMap* getInstance(); virtual ~LLFloaterMap(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ void draw(); - /*virtual*/ void setMinimized(BOOL b); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask ) override; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + /*virtual*/ void draw() override; + /*virtual*/ void setMinimized(BOOL b) override; private: void handleZoom(const LLSD& userdata); diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index c20262de68d517e3e5f1193fa96a7824d5b4b7b8..84aaa298caa5fe24a0ef687aace04df9c8e23de8 100644 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -85,7 +85,7 @@ BOOL LLPanelMarketplaceListings::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL std::string& tooltip_msg) { LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); - BOOL handled = (handled_view != NULL); + BOOL handled = (handled_view != nullptr); // Special case the drop zone if (handled && (handled_view->getName() == "marketplace_drop_zone")) { @@ -326,7 +326,7 @@ public: { } - void done() + void done() override { for (cat_vec_t::iterator it = mAddedCategories.begin(); it != mAddedCategories.end(); ++it) { @@ -351,15 +351,15 @@ private: LLFloaterMarketplaceListings::LLFloaterMarketplaceListings(const LLSD& key) : LLFloater(key) -, mCategoriesObserver(NULL) -, mCategoryAddedObserver(NULL) +, mCategoriesObserver(nullptr) +, mCategoryAddedObserver(nullptr) +, mInventoryStatus(nullptr) +, mInventoryInitializationInProgress(nullptr) +, mInventoryPlaceholder(nullptr) +, mInventoryText(nullptr) +, mInventoryTitle(nullptr) , mRootFolderId(LLUUID::null) -, mInventoryStatus(NULL) -, mInventoryInitializationInProgress(NULL) -, mInventoryPlaceholder(NULL) -, mInventoryText(NULL) -, mInventoryTitle(NULL) -, mPanelListings(NULL) +, mPanelListings(nullptr) , mPanelListingsSet(false) { } @@ -461,7 +461,7 @@ void LLFloaterMarketplaceListings::setRootFolder() { gInventory.removeObserver(mCategoryAddedObserver); delete mCategoryAddedObserver; - mCategoryAddedObserver = NULL; + mCategoryAddedObserver = nullptr; } llassert(!mCategoryAddedObserver); @@ -632,7 +632,7 @@ BOOL LLFloaterMarketplaceListings::handleDragAndDrop(S32 x, S32 y, MASK mask, BO // Pass to the children LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); - BOOL handled = (handled_view != NULL); + BOOL handled = (handled_view != nullptr); // If no one handled it or it was not accepted and we drop on an empty panel, we try to accept it at the floater level // as if it was dropped on the marketplace listings root folder @@ -784,7 +784,7 @@ void LLFloaterAssociateListing::cancel() LLFloaterMarketplaceValidation::LLFloaterMarketplaceValidation(const LLSD& key) : LLFloater(key), -mEditor(NULL) +mEditor(nullptr) { } diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h index 63df36d1a465883572b19b537d5f5fbcdcf5b08a..761466d2f0f7ee13f5b2974bc7bbe4a0f0e58dd0 100644 --- a/indra/newview/llfloatermarketplacelistings.h +++ b/indra/newview/llfloatermarketplacelistings.h @@ -51,13 +51,13 @@ class LLPanelMarketplaceListings : public LLPanel { public: LLPanelMarketplaceListings(); - BOOL postBuild(); + BOOL postBuild() override; BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); - void draw(); + std::string& tooltip_msg) override; + void draw() override; LLFolderView* getRootFolder() { return mRootFolder; } bool allowDropOnRoot(); @@ -98,17 +98,17 @@ public: void initializeMarketPlace(); // virtuals - BOOL postBuild(); + BOOL postBuild() override; BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; void showNotification(const LLNotificationPtr& notification); - BOOL handleHover(S32 x, S32 y, MASK mask); - void onMouseLeave(S32 x, S32 y, MASK mask); + BOOL handleHover(S32 x, S32 y, MASK mask) override; + void onMouseLeave(S32 x, S32 y, MASK mask) override; protected: void setRootFolder(); @@ -117,9 +117,9 @@ protected: void setStatusString(const std::string& statusString); - void onClose(bool app_quitting); - void onOpen(const LLSD& key); - void onFocusReceived(); + void onClose(bool app_quitting) override; + void onOpen(const LLSD& key) override; + void onFocusReceived() override; void onChanged(); bool isAccepted(EAcceptance accept); @@ -150,8 +150,8 @@ class LLFloaterAssociateListing : public LLFloater { friend class LLFloaterReg; public: - virtual BOOL postBuild(); - virtual BOOL handleKeyHere(KEY key, MASK mask); + BOOL postBuild() override; + BOOL handleKeyHere(KEY key, MASK mask) override; static LLFloaterAssociateListing* show(const LLUUID& folder_id); @@ -181,10 +181,10 @@ class LLFloaterMarketplaceValidation : public LLFloater public: LLFloaterMarketplaceValidation(const LLSD& key); virtual ~LLFloaterMarketplaceValidation(); - - virtual BOOL postBuild(); - virtual void draw(); - virtual void onOpen(const LLSD& key); + + BOOL postBuild() override; + void draw() override; + void onOpen(const LLSD& key) override; void clearMessages(); void appendMessage(std::string& message, S32 depth, LLError::ELevel log_level); @@ -217,8 +217,8 @@ public: LLFloaterItemProperties(const LLSD& key); virtual ~LLFloaterItemProperties(); - BOOL postBuild(); - virtual void onOpen(const LLSD& key); + BOOL postBuild() override; + void onOpen(const LLSD& key) override; private: }; diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp index f3bb216651b0e71a876d0abad1f98f74dcd10c2c..23c6d99aa683cb41e1959e07cec8c672efadf562 100644 --- a/indra/newview/llfloatermediasettings.cpp +++ b/indra/newview/llfloatermediasettings.cpp @@ -39,7 +39,7 @@ #include "llselectmgr.h" #include "llsdutil.h" -LLFloaterMediaSettings* LLFloaterMediaSettings::sInstance = NULL; +LLFloaterMediaSettings* LLFloaterMediaSettings::sInstance = nullptr; //////////////////////////////////////////////////////////////////////////////// // @@ -65,22 +65,22 @@ LLFloaterMediaSettings::~LLFloaterMediaSettings() if ( mPanelMediaSettingsGeneral ) { delete mPanelMediaSettingsGeneral; - mPanelMediaSettingsGeneral = NULL; + mPanelMediaSettingsGeneral = nullptr; } if ( mPanelMediaSettingsSecurity ) { delete mPanelMediaSettingsSecurity; - mPanelMediaSettingsSecurity = NULL; + mPanelMediaSettingsSecurity = nullptr; } if ( mPanelMediaSettingsPermissions ) { delete mPanelMediaSettingsPermissions; - mPanelMediaSettingsPermissions = NULL; + mPanelMediaSettingsPermissions = nullptr; } - sInstance = NULL; + sInstance = nullptr; } //////////////////////////////////////////////////////////////////////////////// @@ -273,7 +273,7 @@ const std::string LLFloaterMediaSettings::getHomeUrl() // virtual void LLFloaterMediaSettings::draw() { - if (NULL != mApplyBtn) + if (nullptr != mApplyBtn) { // Set the enabled state of the "Apply" button if values changed mApplyBtn->setEnabled( haveValuesChanged() ); diff --git a/indra/newview/llfloatermediasettings.h b/indra/newview/llfloatermediasettings.h index e1a9d2c9cb23e0ad349231f2ea2c229b0e497af3..61df05f699b3cc466046bc3d98fbe63f615f2ccb 100644 --- a/indra/newview/llfloatermediasettings.h +++ b/indra/newview/llfloatermediasettings.h @@ -41,8 +41,8 @@ public: LLFloaterMediaSettings(const LLSD& key); ~LLFloaterMediaSettings(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onClose(bool app_quitting) override; static LLFloaterMediaSettings* getInstance(); static bool instanceExists(); @@ -54,7 +54,7 @@ public: const std::string getHomeUrl(); //bool passesWhiteList( const std::string& test_url ); - virtual void draw(); + void draw() override; bool getIdenticalHasMediaInfo() const { return mIdenticalHasMediaInfo; } bool getMultipleMedia() const { return mMultipleMedia; } diff --git a/indra/newview/llfloatermemleak.cpp b/indra/newview/llfloatermemleak.cpp index b8df460cab7538bce2fe45f4de1c960753e77706..ee7e2e2fda5175b513d2cc561625dfafd1617497 100644 --- a/indra/newview/llfloatermemleak.cpp +++ b/indra/newview/llfloatermemleak.cpp @@ -128,7 +128,7 @@ void LLFloaterMemLeak::idle() return ; } - char* p = NULL ; + char* p = nullptr ; if(sMemLeakingSpeed > 0 && sTotalLeaked < sMaxLeakedMem) { p = new char[sMemLeakingSpeed] ; diff --git a/indra/newview/llfloatermemleak.h b/indra/newview/llfloatermemleak.h index 86416eaa076a6bb5d2b72940573abaa3d2c0bdea..e1b15c76cf0331cc6279aae66aa23cbcba74573d 100644 --- a/indra/newview/llfloatermemleak.h +++ b/indra/newview/llfloatermemleak.h @@ -35,8 +35,8 @@ class LLFloaterMemLeak : public LLFloater public: /// initialize all the callbacks for the menu - virtual BOOL postBuild() ; - virtual void draw() ; + BOOL postBuild() override; + void draw() override; void onChangeLeakingSpeed(); void onChangeMaxMemLeaking(); diff --git a/indra/newview/llfloatermessagebuilder.cpp b/indra/newview/llfloatermessagebuilder.cpp index 9e5c5af60977206e0da3c629c5ec7ea86baa2c56..a09b6a5d8dcf736b61d7899125debbf10501724d 100644 --- a/indra/newview/llfloatermessagebuilder.cpp +++ b/indra/newview/llfloatermessagebuilder.cpp @@ -42,8 +42,8 @@ LLNetListItem::LLNetListItem(LLUUID id) mAutoName(TRUE), mName("No name"), mPreviousRegionName(""), - mCircuitData(NULL), - mHandle(0) + mHandle(0), + mCircuitData(nullptr) { } @@ -117,7 +117,7 @@ void LLFloaterMessageBuilder::refreshNetList() // Remove net list items that are totally useless now for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != sNetListItems.end();) { - if((*iter)->mCircuitData == NULL) + if((*iter)->mCircuitData == nullptr) iter = sNetListItems.erase(iter); else ++iter; diff --git a/indra/newview/llfloatermessagelog.cpp b/indra/newview/llfloatermessagelog.cpp index f3b2f28eb3af43eb725ba853a5f43c6fe159a818..c3205b3d64128070fc263b7a3de2932879102a49 100644 --- a/indra/newview/llfloatermessagelog.cpp +++ b/indra/newview/llfloatermessagelog.cpp @@ -93,17 +93,17 @@ BOOL LLFloaterMessageLog::LLMessageLogNetMan::tick() std::list<LLNetListItem*> LLFloaterMessageLog::sNetListItems; LogPayloadList LLFloaterMessageLog::sMessageLogEntries = LogPayloadList(4096); -LLMutex* LLFloaterMessageLog::sNetListMutex = NULL; -LLMutex* LLFloaterMessageLog::sMessageListMutex = NULL; -LLMutex* LLFloaterMessageLog::sIncompleteHTTPConvoMutex = NULL; +LLMutex* LLFloaterMessageLog::sNetListMutex = nullptr; +LLMutex* LLFloaterMessageLog::sMessageListMutex = nullptr; +LLMutex* LLFloaterMessageLog::sIncompleteHTTPConvoMutex = nullptr; LLFloaterMessageLog::LLFloaterMessageLog(const LLSD& key) : LLFloater(key) +, mMessagelogScrollListCtrl(nullptr) +, mMessageLogFilter(DEFAULT_FILTER) , mInfoPaneMode(IPANE_NET) -, mMessagelogScrollListCtrl(NULL) -, mMessagesLogged(0) , mBeautifyMessages(false) -, mMessageLogFilter(DEFAULT_FILTER) +, mMessagesLogged(0) , mEasyMessageReader(new LLEasyMessageReader()) { mCommitCallbackRegistrar.add("MessageLog.Filter.Action", boost::bind(&LLFloaterMessageLog::onClickFilterMenu, this, _2)); @@ -122,7 +122,7 @@ LLFloaterMessageLog::~LLFloaterMessageLog() stopApplyingFilter(); clearFloaterMessageItems(true); - LLMessageLog::setCallback(NULL); + LLMessageLog::setCallback(nullptr); sNetListMutex->lock(); sNetListItems.clear(); @@ -133,9 +133,9 @@ LLFloaterMessageLog::~LLFloaterMessageLog() delete sNetListMutex; delete sMessageListMutex; delete sIncompleteHTTPConvoMutex; - sNetListMutex = NULL; - sMessageListMutex = NULL; - sIncompleteHTTPConvoMutex = NULL; + sNetListMutex = nullptr; + sMessageListMutex = nullptr; + sIncompleteHTTPConvoMutex = nullptr; } BOOL LLFloaterMessageLog::postBuild() @@ -171,7 +171,7 @@ void LLFloaterMessageLog::onOpen(const LLSD& key) void LLFloaterMessageLog::onClose(bool app_quiting) { - LLMessageLog::setCallback(NULL); + LLMessageLog::setCallback(nullptr); if (!app_quiting) onClickClearLog(); } @@ -223,12 +223,12 @@ void LLFloaterMessageLog::updateGlobalNetList(bool starting) for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != sNetListItems.end(); ++iter) { if(std::find(circuits.begin(), circuits.end(), (*iter)->mCircuitData) == circuits.end()) - (*iter)->mCircuitData = NULL; + (*iter)->mCircuitData = nullptr; } // Remove net list items that are totally useless now for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != sNetListItems.end();) { - if((*iter)->mCircuitData == NULL) + if((*iter)->mCircuitData == nullptr) { delete *iter; iter = sNetListItems.erase(iter); @@ -249,7 +249,7 @@ LLNetListItem* LLFloaterMessageLog::findNetListItem(LLHost host) for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != end; ++iter) if((*iter)->mCircuitData && (*iter)->mCircuitData->getHost() == host) return (*iter); - return NULL; + return nullptr; } LLNetListItem* LLFloaterMessageLog::findNetListItem(LLUUID id) @@ -258,7 +258,7 @@ LLNetListItem* LLFloaterMessageLog::findNetListItem(LLUUID id) for(std::list<LLNetListItem*>::iterator iter = sNetListItems.begin(); iter != end; ++iter) if((*iter)->mID == id) return (*iter); - return NULL; + return nullptr; } void LLFloaterMessageLog::refreshNetList() @@ -335,13 +335,13 @@ void LLFloaterMessageLog::refreshNetList() LLScrollListIcon* icon = (LLScrollListIcon*)scroll_itemp->getColumn(1); icon->setValue("Stop_Off"); icon->setColor(LLColor4(1.0f,1.0f,1.0f,0.5f)); - icon->setClickCallback(NULL, NULL); + icon->setClickCallback(nullptr, nullptr); } // Event queue isn't even supported yet... FIXME LLScrollListIcon* icon = (LLScrollListIcon*)scroll_itemp->getColumn(2); icon->setValue("Stop_Off"); icon->setColor(LLColor4(0.1f,0.1f,0.1f,0.7f)); - icon->setClickCallback(NULL, NULL); + icon->setClickCallback(nullptr, nullptr); } if(selected_id.notNull()) scrollp->selectByID(selected_id); diff --git a/indra/newview/llfloatermessagelog.h b/indra/newview/llfloatermessagelog.h index e9c369bb826b61f5bb164555051457f8a5d4fbc3..23cd4aff9bad75184edf57ddcd907661216e1b23 100644 --- a/indra/newview/llfloatermessagelog.h +++ b/indra/newview/llfloatermessagelog.h @@ -150,7 +150,7 @@ protected: ~LLMessageLogNetMan() {} private: - BOOL tick(); + BOOL tick() override; LLFloaterMessageLog* mParent; }; diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index a0ecfeea7d80de3f62afff2a78d6eb5a1657ae61..e98b937a5c805df64a195a9922691d08d55ee3d0 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -93,7 +93,7 @@ //static S32 LLFloaterModelPreview::sUploadAmount = 10; -LLFloaterModelPreview* LLFloaterModelPreview::sInstance = NULL; +LLFloaterModelPreview* LLFloaterModelPreview::sInstance = nullptr; bool LLModelPreview::sIgnoreLoadedCallback = false; @@ -201,7 +201,7 @@ LLViewerFetchedTexture* bindMaterialDiffuseTexture(const LLImportMaterial& mater } } - return NULL; + return nullptr; } std::string stripSuffix(std::string name) @@ -254,14 +254,14 @@ void FindModel(LLModelLoader::scene& scene, const std::string& name_to_match, LL //----------------------------------------------------------------------------- LLFloaterModelPreview::LLFloaterModelPreview(const LLSD& key) : LLFloaterModelUploadBase(key), -mUploadBtn(NULL), -mCalculateBtn(NULL) +mUploadBtn(nullptr), +mCalculateBtn(nullptr) { sInstance = this; mLastMouseX = 0; mLastMouseY = 0; mStatusLock = new LLMutex(); - mModelPreview = NULL; + mModelPreview = nullptr; mLODMode[LLModel::LOD_HIGH] = 0; for (U32 i = 0; i < LLModel::LOD_HIGH; i++) @@ -298,10 +298,10 @@ BOOL LLFloaterModelPreview::postBuild() getChild<LLSpinCtrl>("lod_triangle_limit_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLODParamCommit, this, lod, true)); } - childSetCommitCallback("upload_skin", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL); - childSetCommitCallback("upload_joints", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL); - childSetCommitCallback("lock_scale_if_joint_position", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL); - childSetCommitCallback("upload_textures", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL); + childSetCommitCallback("upload_skin", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), nullptr); + childSetCommitCallback("upload_joints", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), nullptr); + childSetCommitCallback("lock_scale_if_joint_position", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), nullptr); + childSetCommitCallback("upload_textures", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), nullptr); childSetTextArg("status", "[STATUS]", getString("status_idle")); @@ -385,7 +385,7 @@ BOOL LLFloaterModelPreview::postBuild() mUploadBtn = getChild<LLButton>("ok_btn"); mCalculateBtn = getChild<LLButton>("calculate_btn"); - if (LLConvexDecomposition::getInstance() != NULL) + if (LLConvexDecomposition::getInstance() != nullptr) { mCalculateBtn->setClickedCallback(boost::bind(&LLFloaterModelPreview::onClickCalculateBtn, this)); @@ -404,7 +404,7 @@ BOOL LLFloaterModelPreview::postBuild() //----------------------------------------------------------------------------- LLFloaterModelPreview::~LLFloaterModelPreview() { - sInstance = NULL; + sInstance = nullptr; if ( mModelPreview ) { @@ -412,7 +412,7 @@ LLFloaterModelPreview::~LLFloaterModelPreview() } delete mStatusLock; - mStatusLock = NULL; + mStatusLock = nullptr; } void LLFloaterModelPreview::initModelPreview() @@ -836,7 +836,7 @@ void LLFloaterModelPreview::onClose(bool app_quitting) //static void LLFloaterModelPreview::onPhysicsParamCommit(LLUICtrl* ctrl, void* data) { - if (LLConvexDecomposition::getInstance() == NULL) + if (LLConvexDecomposition::getInstance() == nullptr) { LL_INFOS() << "convex decomposition tool is a stub on this platform. cannot get decomp." << LL_ENDL; return; @@ -995,23 +995,23 @@ void LLFloaterModelPreview::initDecompControls() { LLSD key; - childSetCommitCallback("simplify_cancel", onPhysicsStageCancel, NULL); - childSetCommitCallback("decompose_cancel", onPhysicsStageCancel, NULL); + childSetCommitCallback("simplify_cancel", onPhysicsStageCancel, nullptr); + childSetCommitCallback("decompose_cancel", onPhysicsStageCancel, nullptr); - childSetCommitCallback("physics_lod_combo", onPhysicsUseLOD, NULL); - childSetCommitCallback("physics_browse", onPhysicsBrowse, NULL); + childSetCommitCallback("physics_lod_combo", onPhysicsUseLOD, nullptr); + childSetCommitCallback("physics_browse", onPhysicsBrowse, nullptr); - static const LLCDStageData* stage = NULL; + static const LLCDStageData* stage = nullptr; static S32 stage_count = 0; - if (!stage && LLConvexDecomposition::getInstance() != NULL) + if (!stage && LLConvexDecomposition::getInstance() != nullptr) { stage_count = LLConvexDecomposition::getInstance()->getStages(&stage); } - static const LLCDParam* param = NULL; + static const LLCDParam* param = nullptr; static S32 param_count = 0; - if (!param && LLConvexDecomposition::getInstance() != NULL) + if (!param && LLConvexDecomposition::getInstance() != nullptr) { param_count = LLConvexDecomposition::getInstance()->getParameters(¶m); } @@ -1198,12 +1198,12 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE), LLMutex() , mLodsQuery() , mLodsWithParsingError() -, mPelvisZOffset( 0.0f ) -, mLegacyRigValid( false ) -, mRigValidJointUpload( false ) , mPhysicsSearchLOD( LLModel::LOD_PHYSICS ) , mResetJoints( false ) , mModelNoErrors( true ) +, mPelvisZOffset( 0.0f ) +, mRigValidJointUpload( false ) +, mLegacyRigValid( false ) , mLastJointUpdate( false ) { mNeedsUpdate = TRUE; @@ -1213,7 +1213,7 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) mCameraZoom = 1.f; mTextureName = 0; mPreviewLOD = 0; - mModelLoader = NULL; + mModelLoader = nullptr; mMaxTriangleLimit = 0; mDirty = false; mGenLOD = false; @@ -1444,7 +1444,7 @@ void LLModelPreview::rebuildUploadData() for (int i = LLModel::NUM_LODS - 1; i >= LLModel::LOD_IMPOSTOR; i--) { - LLModel* lod_model = NULL; + LLModel* lod_model = nullptr; if (!legacyMatching) { // Fill LOD slots by finding matching meshes by label with name extensions @@ -1935,7 +1935,7 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) if(getLoadState() >= LLModelLoader::ERROR_PARSING) { mLoading = false ; - mModelLoader = NULL; + mModelLoader = nullptr; mLodsWithParsingError.push_back(loaded_lod); return ; } @@ -2099,7 +2099,7 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) { std::string loaded_name = stripSuffix(mModel[loaded_lod][idx]->mLabel); - LLModel* found_model = NULL; + LLModel* found_model = nullptr; LLMatrix4 transform; FindModel(mBaseScene, loaded_name, found_model, transform); if (found_model) @@ -2178,7 +2178,7 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) mModelLoadedSignal(); - mModelLoader = NULL; + mModelLoader = nullptr; } void LLModelPreview::resetPreviewTarget() @@ -3256,7 +3256,7 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) U32 mesh_count = 0; - LLModelLoader::model_list* model = NULL; + LLModelLoader::model_list* model = nullptr; if (lod < 0 || lod > 4) { @@ -3300,7 +3300,7 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) continue; } - LLVertexBuffer* vb = NULL; + LLVertexBuffer* vb = nullptr; bool skinned = include_skin_weights && !mdl->mSkinWeights.empty(); @@ -3485,7 +3485,7 @@ LLJoint* LLModelPreview::lookupJointByName(const std::string& str, void* opaque) { return pPreview->getPreviewAvatar()->getJoint(str); } - return NULL; + return nullptr; } U32 LLModelPreview::loadTextures(LLImportMaterial& material,void* opaque) @@ -3498,13 +3498,13 @@ U32 LLModelPreview::loadTextures(LLImportMaterial& material,void* opaque) LLPointer< LLViewerFetchedTexture >& tex = (*reinterpret_cast< LLPointer< LLViewerFetchedTexture > * >(material.mOpaqueData)); tex = LLViewerTextureManager::getFetchedTextureFromUrl("file://" + material.mDiffuseMapFilename, FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_PREVIEW); - tex->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, TRUE, FALSE, opaque, NULL, FALSE); + tex->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, TRUE, FALSE, opaque, nullptr, FALSE); tex->forceToSaveRawImage(0, F32_MAX); material.setDiffuseMap(tex->getID()); // record tex ID return 1; } - material.mOpaqueData = NULL; + material.mOpaqueData = nullptr; return 0; } diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 0b2b7db2b6757b0288d2157c01bf35500976b2b4..6da76a41aed5d0f5b42e1a9bddc3b21637b8d185 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -70,26 +70,26 @@ public: LLPointer<LLModel> mModel; DecompRequest(const std::string& stage, LLModel* mdl); - virtual S32 statusCallback(const char* status, S32 p1, S32 p2); - virtual void completed(); + S32 statusCallback(const char* status, S32 p1, S32 p2) override; + void completed() override; }; static LLFloaterModelPreview* sInstance; LLFloaterModelPreview(const LLSD& key); virtual ~LLFloaterModelPreview(); - - virtual BOOL postBuild(); + + BOOL postBuild() override; void initModelPreview(); - BOOL handleMouseDown(S32 x, S32 y, MASK mask); - BOOL handleMouseUp(S32 x, S32 y, MASK mask); - BOOL handleHover(S32 x, S32 y, MASK mask); - BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void onClose(bool app_quitting) override; static void onMouseCaptureLostModelPreview(LLMouseHandler*); static void setUploadAmount(S32 amount) { sUploadAmount = amount; } @@ -103,7 +103,7 @@ public: static void onUpload(void* data); - void refresh(); + void refresh() override; void loadModel(S32 lod); void loadModel(S32 lod, const std::string& file_name, bool force_disable_slm = false); @@ -118,18 +118,18 @@ public: bool isModelLoading(); // shows warning message if agent has no permissions to upload model - /*virtual*/ void onPermissionsReceived(const LLSD& result); + /*virtual*/ void onPermissionsReceived(const LLSD& result) override; // called when error occurs during permissions request - /*virtual*/ void setPermissonsErrorStatus(S32 status, const std::string& reason); + /*virtual*/ void setPermissonsErrorStatus(S32 status, const std::string& reason) override; - /*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url); + /*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) override; void handleModelPhysicsFeeReceived(); - /*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason); + /*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) override; - /*virtual*/ void onModelUploadSuccess(); + /*virtual*/ void onModelUploadSuccess() override; - /*virtual*/ void onModelUploadFailure(); + /*virtual*/ void onModelUploadFailure() override; bool isModelUploadAllowed(); @@ -166,7 +166,7 @@ protected: static void onPhysicsDecomposeBack(LLUICtrl* ctrl, void* userdata); static void onPhysicsSimplifyBack(LLUICtrl* ctrl, void* userdata); - void draw(); + void draw() override; void initDecompControls(); @@ -219,7 +219,7 @@ class LLMeshFilePicker : public LLFilePickerThread { public: LLMeshFilePicker(LLModelPreview* mp, S32 lod); - virtual void notify(const std::string& filename); + void notify(const std::string& filename) override; private: LLModelPreview* mMP; @@ -251,7 +251,7 @@ public: void setTexture(U32 name) { mTextureName = name; } void setPhysicsFromLOD(S32 lod); - BOOL render(); + BOOL render() override; void update(); void genBuffers(S32 lod, bool skinned); void clearBuffers(); @@ -259,7 +259,7 @@ public: void rotate(F32 yaw_radians, F32 pitch_radians); void zoom(F32 zoom_amt); void pan(F32 right, F32 up); - virtual BOOL needsRender() { return mNeedsUpdate; } + BOOL needsRender() override { return mNeedsUpdate; } void setPreviewLOD(S32 lod); void clearModel(S32 lod); void getJointAliases(JointMap& joint_map); diff --git a/indra/newview/llfloatermodeluploadbase.h b/indra/newview/llfloatermodeluploadbase.h index 0d4c834122325d56ab1bc62457ca1fbfc0465ac5..1526e195148b572dfb5d207a3eaaa5d0f8ea2495 100644 --- a/indra/newview/llfloatermodeluploadbase.h +++ b/indra/newview/llfloatermodeluploadbase.h @@ -39,17 +39,17 @@ public: virtual ~LLFloaterModelUploadBase(){}; - virtual void setPermissonsErrorStatus(S32 status, const std::string& reason) = 0; + void setPermissonsErrorStatus(S32 status, const std::string& reason) override = 0; - virtual void onPermissionsReceived(const LLSD& result) = 0; + void onPermissionsReceived(const LLSD& result) override = 0; - virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0; + void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) override = 0; - virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0; + void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) override = 0; - virtual void onModelUploadSuccess() {}; + void onModelUploadSuccess() override {}; - virtual void onModelUploadFailure() {}; + void onModelUploadFailure() override {}; protected: diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index 132e9ecec9c1f5eba01fee3849004c7fef97f626..bd56a7b2f89a2ddecf87a5adf5a9b2f31b59e1a0 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -162,12 +162,12 @@ void LLFloaterNameDesc::onBtnOK( ) { getChildView("ok_btn")->setEnabled(FALSE); // don't allow inadvertent extra uploads - LLAssetStorage::LLStoreAssetCallback callback = NULL; + LLAssetStorage::LLStoreAssetCallback callback = nullptr; S32 expected_upload_cost = LLGlobalEconomy::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass). if (can_afford_transaction(expected_upload_cost)) { - void *nruserdata = NULL; + void *nruserdata = nullptr; LLResourceUploadInfo::ptr_t uploadInfo(new LLNewFileResourceUploadInfo( mFilenameAndPath, diff --git a/indra/newview/llfloaternamedesc.h b/indra/newview/llfloaternamedesc.h index 51434b99c0b240318ab0268acaa7e6e7f9966884..e612d3750489e955388080359fbb911d8507ac4d 100644 --- a/indra/newview/llfloaternamedesc.h +++ b/indra/newview/llfloaternamedesc.h @@ -39,14 +39,14 @@ class LLFloaterNameDesc : public LLFloater public: LLFloaterNameDesc(const LLSD& filename); virtual ~LLFloaterNameDesc(); - virtual BOOL postBuild(); + BOOL postBuild() override; void onBtnOK(); void onBtnCancel(); void doCommit(); protected: - virtual void onCommit(); + void onCommit() override; protected: @@ -58,21 +58,21 @@ class LLFloaterSoundPreview : public LLFloaterNameDesc { public: LLFloaterSoundPreview(const LLSD& filename ); - virtual BOOL postBuild(); + BOOL postBuild() override; }; class LLFloaterAnimPreview : public LLFloaterNameDesc { public: LLFloaterAnimPreview(const LLSD& filename ); - virtual BOOL postBuild(); + BOOL postBuild() override; }; class LLFloaterScriptPreview : public LLFloaterNameDesc { public: LLFloaterScriptPreview(const LLSD& filename ); - virtual BOOL postBuild(); + BOOL postBuild() override; }; #endif // LL_LLFLOATERNAMEDESC_H diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index 1cce0b63e0810a8c46fab48b2cdb29d35ffa8a20..8a1fc65de80fe96867455c3638168e58440a471d 100644 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -43,7 +43,7 @@ class LLNotificationChannelPanel : public LLLayoutPanel public: LLNotificationChannelPanel(const Params& p); ~LLNotificationChannelPanel(); - BOOL postBuild(); + BOOL postBuild() override; private: bool update(const LLSD& payload); @@ -69,7 +69,7 @@ LLNotificationChannelPanel::~LLNotificationChannelPanel() LLScrollListItem* item = *data_itor; LLNotification* notification = (LLNotification*)item->getUserdata(); delete notification; - notification = NULL; + notification = nullptr; } } diff --git a/indra/newview/llfloaternotificationsconsole.h b/indra/newview/llfloaternotificationsconsole.h index eba33de2ddbeeb4e86dfc1d69c2b4caf6029a9a7..9304e38c0d6a915982ea7a72ee90244199b78afd 100644 --- a/indra/newview/llfloaternotificationsconsole.h +++ b/indra/newview/llfloaternotificationsconsole.h @@ -41,7 +41,7 @@ class LLFloaterNotificationConsole : public: // LLPanel - BOOL postBuild(); + BOOL postBuild() override; void addChannel(const std::string& type, bool open = false); void updateResizeLimits(LLLayoutStack &stack); @@ -64,7 +64,7 @@ public: LLFloaterNotification(LLNotification* note); // LLPanel - BOOL postBuild(); + BOOL postBuild() override; void respond(); private: diff --git a/indra/newview/llfloaternotificationstabbed.cpp b/indra/newview/llfloaternotificationstabbed.cpp index d9d61e3038754780aa652e7781735bd21b0eda57..7ab0b2c224821a8bd70794690c9ff66b857b1f87 100644 --- a/indra/newview/llfloaternotificationstabbed.cpp +++ b/indra/newview/llfloaternotificationstabbed.cpp @@ -41,18 +41,18 @@ #include "llviewercontrol.h" //--------------------------------------------------------------------------------- -LLFloaterNotificationsTabbed::LLFloaterNotificationsTabbed(const LLSD& key) : LLTransientDockableFloater(NULL, true, key), - mChannel(NULL), - mSysWellChiclet(NULL), - mGroupInviteMessageList(NULL), - mGroupNoticeMessageList(NULL), - mTransactionMessageList(NULL), - mSystemMessageList(NULL), - mNotificationsSeparator(NULL), - mNotificationsTabContainer(NULL), +LLFloaterNotificationsTabbed::LLFloaterNotificationsTabbed(const LLSD& key) : LLTransientDockableFloater(nullptr, true, key), NOTIFICATION_TABBED_ANCHOR_NAME("notification_well_panel"), IM_WELL_ANCHOR_NAME("im_well_panel"), - mIsReshapedByUser(false) + mChannel(nullptr), + mSysWellChiclet(nullptr), + mIsReshapedByUser(false), + mGroupInviteMessageList(nullptr), + mGroupNoticeMessageList(nullptr), + mTransactionMessageList(nullptr), + mSystemMessageList(nullptr), + mNotificationsSeparator(nullptr), + mNotificationsTabContainer(nullptr) { setOverlapsScreenChannel(true); @@ -111,7 +111,7 @@ void LLFloaterNotificationsTabbed::onStartUpToastClick(S32 x, S32 y, MASK mask) void LLFloaterNotificationsTabbed::setSysWellChiclet(LLSysWellChiclet* chiclet) { mSysWellChiclet = chiclet; - if(NULL != mSysWellChiclet) + if(nullptr != mSysWellChiclet) { mSysWellChiclet->updateWidget(isWindowEmpty()); } @@ -127,7 +127,7 @@ void LLFloaterNotificationsTabbed::removeItemByID(const LLUUID& id, std::string { if(mNotificationsSeparator->removeItemByID(type, id)) { - if (NULL != mSysWellChiclet) + if (nullptr != mSysWellChiclet) { mSysWellChiclet->updateWidget(isWindowEmpty()); } @@ -159,7 +159,7 @@ void LLFloaterNotificationsTabbed::initChannel() LLNotificationsUI::LLScreenChannelBase* channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID( LLUUID(gSavedSettings.getString("NotificationChannelUUID"))); mChannel = dynamic_cast<LLNotificationsUI::LLScreenChannel*>(channel); - if(NULL == mChannel) + if(nullptr == mChannel) { LL_WARNS() << "LLSysWellWindow::initChannel() - could not get a requested screen channel" << LL_ENDL; } @@ -180,7 +180,7 @@ void LLFloaterNotificationsTabbed::setVisible(BOOL visible) } if (visible) { - if (NULL == getDockControl() && getDockTongue().notNull()) + if (nullptr == getDockControl() && getDockTongue().notNull()) { setDockControl(new LLDockControl( LLChicletBar::getInstance()->getChild<LLView>(getAnchorViewName()), this, @@ -189,7 +189,7 @@ void LLFloaterNotificationsTabbed::setVisible(BOOL visible) } // do not show empty window - if (NULL == mNotificationsSeparator || isWindowEmpty()) visible = FALSE; + if (nullptr == mNotificationsSeparator || isWindowEmpty()) visible = FALSE; LLTransientDockableFloater::setVisible(visible); @@ -274,7 +274,7 @@ void LLFloaterNotificationsTabbed::addItem(LLNotificationListItem::Params p) if (mNotificationsSeparator->findItemByID(p.notification_name, p.notification_id)) return; LLNotificationListItem* new_item = LLNotificationListItem::create(p); - if (new_item == NULL) + if (new_item == nullptr) { return; } @@ -484,7 +484,7 @@ bool LLNotificationSeparator::addItem(std::string& tag, LLNotificationListItem* { return it->second->addNotification(item); } - else if (mUnTaggedList != NULL) + else if (mUnTaggedList != nullptr) { return mUnTaggedList->addNotification(item); } @@ -499,7 +499,7 @@ bool LLNotificationSeparator::removeItemByID(std::string& tag, const LLUUID& id) { return it->second->removeItemByValue(id); } - else if (mUnTaggedList != NULL) + else if (mUnTaggedList != nullptr) { return mUnTaggedList->removeItemByValue(id); } @@ -515,7 +515,7 @@ U32 LLNotificationSeparator::size() const { size = size + (*it)->size(); } - if (mUnTaggedList != NULL) + if (mUnTaggedList != nullptr) { size = size + mUnTaggedList->size(); } @@ -530,12 +530,12 @@ LLPanel* LLNotificationSeparator::findItemByID(std::string& tag, const LLUUID& i { return it->second->getItemByValue(id); } - else if (mUnTaggedList != NULL) + else if (mUnTaggedList != nullptr) { return mUnTaggedList->getItemByValue(id); } - return NULL; + return nullptr; } //static @@ -562,7 +562,7 @@ void LLNotificationSeparator::getItems(std::vector<LLNotificationListItem*>& ite { getItemsFromList(items, *lists_it); } - if (mUnTaggedList != NULL) + if (mUnTaggedList != nullptr) { getItemsFromList(items, mUnTaggedList); } @@ -570,7 +570,7 @@ void LLNotificationSeparator::getItems(std::vector<LLNotificationListItem*>& ite //--------------------------------------------------------------------------------- LLNotificationSeparator::LLNotificationSeparator() - : mUnTaggedList(NULL) + : mUnTaggedList(nullptr) {} //--------------------------------------------------------------------------------- diff --git a/indra/newview/llfloaternotificationstabbed.h b/indra/newview/llfloaternotificationstabbed.h index 8dd20b18c42b8d8151eecd351e9c398e785dc83e..396120b5307ab6e1a6d3742eedaec946ed73a93f 100644 --- a/indra/newview/llfloaternotificationstabbed.h +++ b/indra/newview/llfloaternotificationstabbed.h @@ -72,7 +72,7 @@ public: LLFloaterNotificationsTabbed(const LLSD& key); virtual ~LLFloaterNotificationsTabbed(); - BOOL postBuild(); + BOOL postBuild() override; // other interface functions // check is window empty @@ -85,12 +85,12 @@ public: void updateNotificationCounter(S32 panelIndex, S32 counterValue, std::string stringName); // Operating with outfit - virtual void setVisible(BOOL visible); + void setVisible(BOOL visible) override; - /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); + /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true) override; // override LLFloater's minimization according to EXT-1216 - /*virtual*/ void setMinimized(BOOL minimize); - /*virtual*/ void handleReshape(const LLRect& rect, bool by_user); + /*virtual*/ void setMinimized(BOOL minimize) override; + /*virtual*/ void handleReshape(const LLRect& rect, bool by_user) override; void onStartUpToastClick(S32 x, S32 y, MASK mask); /*virtual*/ void onAdd(LLNotificationPtr notify); @@ -127,7 +127,7 @@ private: struct NotificationTabbedChannel : public LLNotificationChannel { NotificationTabbedChannel(LLFloaterNotificationsTabbed*); - void onDelete(LLNotificationPtr notify) + void onDelete(LLNotificationPtr notify) override { mNotificationsTabbedWindow->removeItemByID(notify->getID(), notify->getName()); } diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp index 5e68d407a6a62a97c6acde1fa614753372eff699..692dc60425caf737f4e14e352dc1bbce00be5fee 100644 --- a/indra/newview/llfloaterobjectweights.cpp +++ b/indra/newview/llfloaterobjectweights.cpp @@ -68,16 +68,16 @@ bool LLCrossParcelFunctor::apply(LLViewerObject* obj) LLFloaterObjectWeights::LLFloaterObjectWeights(const LLSD& key) : LLFloater(key), - mSelectedObjects(NULL), - mSelectedPrims(NULL), - mSelectedDownloadWeight(NULL), - mSelectedPhysicsWeight(NULL), - mSelectedServerWeight(NULL), - mSelectedDisplayWeight(NULL), - mSelectedOnLand(NULL), - mRezzedOnLand(NULL), - mRemainingCapacity(NULL), - mTotalCapacity(NULL) + mSelectedObjects(nullptr), + mSelectedPrims(nullptr), + mSelectedDownloadWeight(nullptr), + mSelectedPhysicsWeight(nullptr), + mSelectedServerWeight(nullptr), + mSelectedDisplayWeight(nullptr), + mSelectedOnLand(nullptr), + mRezzedOnLand(nullptr), + mRemainingCapacity(nullptr), + mTotalCapacity(nullptr) { } diff --git a/indra/newview/llfloaterobjectweights.h b/indra/newview/llfloaterobjectweights.h index 1a2c317bad862171a9303d73b77a501534a60149..33a8b2494f54e09e82bcbd87ce0a1008b4c51649 100644 --- a/indra/newview/llfloaterobjectweights.h +++ b/indra/newview/llfloaterobjectweights.h @@ -43,7 +43,7 @@ class LLTextBox; */ struct LLCrossParcelFunctor : public LLSelectedObjectFunctor { - /*virtual*/ bool apply(LLViewerObject* obj); + /*virtual*/ bool apply(LLViewerObject* obj) override; private: LLBBox mBoundingBox; @@ -58,18 +58,18 @@ public: LLFloaterObjectWeights(const LLSD& key); ~LLFloaterObjectWeights(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; - /*virtual*/ void onWeightsUpdate(const SelectionCost& selection_cost); - /*virtual*/ void setErrorStatus(S32 status, const std::string& reason); + /*virtual*/ void onWeightsUpdate(const SelectionCost& selection_cost) override; + /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) override; void updateLandImpacts(const LLParcel* parcel); - void refresh(); + void refresh() override; private: - /*virtual*/ void generateTransactionID(); + /*virtual*/ void generateTransactionID() override; void toggleWeightsLoadingIndicators(bool visible); void toggleLandImpactsLoadingIndicators(bool visible); diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index 4a420b48b129db2b24180f531faaecb7ba0b29ff..e8dd65bcb815b6f42ff1025473f58f2fb8a9d003 100644 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -52,7 +52,7 @@ LLFloaterOpenObject::LLFloaterOpenObject(const LLSD& key) : LLFloater(key), - mPanelInventoryObject(NULL), + mPanelInventoryObject(nullptr), mDirty(TRUE) { mCommitCallbackRegistrar.add("OpenObject.Cancel", boost::bind(&LLFloaterOpenObject::onClickCancel, this)); @@ -187,7 +187,7 @@ void LLFloaterOpenObject::moveToInventory(bool wear, bool replace) if (!success) { delete data; - data = NULL; + data = nullptr; LLNotificationsUtil::add("OpenObjectCannotCopy"); } @@ -212,7 +212,7 @@ void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLUUID& category if (!success) { delete wear_data; - wear_data = NULL; + wear_data = nullptr; LLNotificationsUtil::add("OpenObjectCannotCopy"); } diff --git a/indra/newview/llfloateropenobject.h b/indra/newview/llfloateropenobject.h index 73d0dfbf5848dd1f9534ffb9e07b9f57142a146e..db516e0f1467b5450b4ea10289b767b106e204c1 100644 --- a/indra/newview/llfloateropenobject.h +++ b/indra/newview/llfloateropenobject.h @@ -55,10 +55,10 @@ public: protected: - /*virtual*/ BOOL postBuild(); - void refresh(); - void draw(); - virtual void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + void refresh() override; + void draw() override; + void onOpen(const LLSD& key) override; void moveToInventory(bool wear, bool replace = false); diff --git a/indra/newview/llfloateroutfitphotopreview.h b/indra/newview/llfloateroutfitphotopreview.h index a1e7b58abe613ab0445753ec249fa5f1670da1a1..59dc985398a33d1215417e2206743d3626a609f0 100644 --- a/indra/newview/llfloateroutfitphotopreview.h +++ b/indra/newview/llfloateroutfitphotopreview.h @@ -41,14 +41,14 @@ public: LLFloaterOutfitPhotoPreview(const LLSD& key); ~LLFloaterOutfitPhotoPreview(); - virtual void draw(); + void draw() override; - virtual void loadAsset(); - virtual EAssetStatus getAssetStatus(); - - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void loadAsset() override; + EAssetStatus getAssetStatus() override; + + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; - /*virtual*/ void setObjectID(const LLUUID& object_id); + /*virtual*/ void setObjectID(const LLUUID& object_id) override; void setOutfitID(const LLUUID& outfit_id); void onOkBtn(); @@ -56,7 +56,7 @@ public: protected: void init(); - /* virtual */ BOOL postBuild(); + /* virtual */ BOOL postBuild() override; private: void updateImageID(); // set what image is being uploaded. diff --git a/indra/newview/llfloateroutfitsnapshot.cpp b/indra/newview/llfloateroutfitsnapshot.cpp index 3caaaed95ce1f0f214f094352b667da2eaa81bea..553e591042f07827e7857114a04013d4edf426ce 100644 --- a/indra/newview/llfloateroutfitsnapshot.cpp +++ b/indra/newview/llfloateroutfitsnapshot.cpp @@ -53,7 +53,7 @@ ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -LLOutfitSnapshotFloaterView* gOutfitSnapshotFloaterView = NULL; +LLOutfitSnapshotFloaterView* gOutfitSnapshotFloaterView = nullptr; const S32 OUTFIT_SNAPSHOT_WIDTH = 256; const S32 OUTFIT_SNAPSHOT_HEIGHT = 256; @@ -218,7 +218,7 @@ void LLFloaterOutfitSnapshot::Impl::updateResolution(void* data) // Default constructor LLFloaterOutfitSnapshot::LLFloaterOutfitSnapshot(const LLSD& key) : LLFloaterSnapshotBase(key), -mOutfitGallery(NULL) +mOutfitGallery(nullptr) { impl = new Impl(this); } @@ -323,7 +323,7 @@ void LLFloaterOutfitSnapshot::onExtendFloater() void LLFloaterOutfitSnapshot::update() { LLFloaterOutfitSnapshot* inst = findInstance(); - if (inst != NULL) + if (inst != nullptr) { inst->impl->updateLivePreview(); } diff --git a/indra/newview/llfloateroutfitsnapshot.h b/indra/newview/llfloateroutfitsnapshot.h index bee386ec63bb70ca29708b62375367e048880213..26770d9701727f7ef50a0a239115c076a8e2c098 100644 --- a/indra/newview/llfloateroutfitsnapshot.h +++ b/indra/newview/llfloateroutfitsnapshot.h @@ -45,8 +45,8 @@ public: LLFloaterOutfitSnapshot(const LLSD& key); /*virtual*/ ~LLFloaterOutfitSnapshot(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; static void update(); @@ -54,7 +54,7 @@ public: static LLFloaterOutfitSnapshot* getInstance(); static LLFloaterOutfitSnapshot* findInstance(); - /*virtual*/ void saveTexture(); + /*virtual*/ void saveTexture() override; const LLRect& getThumbnailPlaceholderRect() { return mThumbnailPlaceholder->getRect(); } @@ -87,15 +87,15 @@ public: static void onSnapshotUploadFinished(LLFloaterSnapshotBase* floater, bool status); - /*virtual*/ LLPanelSnapshot* getActivePanel(LLFloaterSnapshotBase* floater, bool ok_if_not_found = true); - /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat(LLFloaterSnapshotBase* floater); - /*virtual*/ std::string getSnapshotPanelPrefix(); + /*virtual*/ LLPanelSnapshot* getActivePanel(LLFloaterSnapshotBase* floater, bool ok_if_not_found = true) override; + /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat(LLFloaterSnapshotBase* floater) override; + /*virtual*/ std::string getSnapshotPanelPrefix() override; - /*virtual*/ void updateControls(LLFloaterSnapshotBase* floater); + /*virtual*/ void updateControls(LLFloaterSnapshotBase* floater) override; private: - /*virtual*/ LLSnapshotModel::ESnapshotLayerType getLayerType(LLFloaterSnapshotBase* floater); - /*virtual*/ void setFinished(bool finished, bool ok = true, const std::string& msg = LLStringUtil::null); + /*virtual*/ LLSnapshotModel::ESnapshotLayerType getLayerType(LLFloaterSnapshotBase* floater) override; + /*virtual*/ void setFinished(bool finished, bool ok = true, const std::string& msg = LLStringUtil::null) override; }; ///---------------------------------------------------------------------------- diff --git a/indra/newview/llfloaterparticleeditor.cpp b/indra/newview/llfloaterparticleeditor.cpp index f74f90d00e8127bd25da1a0f897ff76ff730ddfd..0113681f9f2ef8f5905aae4f3c3bf0e1cd0442e6 100644 --- a/indra/newview/llfloaterparticleeditor.cpp +++ b/indra/newview/llfloaterparticleeditor.cpp @@ -87,15 +87,15 @@ LLFloaterParticleEditor::LLFloaterParticleEditor(const LLSD& key) , mBurstSpeedMaxCtrl(nullptr), mStartAlphaCtrl(nullptr), mEndAlphaCtrl(nullptr) , mScaleStartXCtrl(nullptr), mScaleStartYCtrl(nullptr), mScaleEndXCtrl(nullptr) , mScaleEndYCtrl(nullptr), mSourceMaxAgeCtrl(nullptr), mParticlesMaxAgeCtrl(nullptr) - , mStartGlowCtrl(nullptr), mEndGlowCtrl(nullptr), mBlendFuncSrcCombo(nullptr) + , mStartGlowCtrl(nullptr), mEndGlowCtrl(nullptr), mAcellerationXCtrl(nullptr) + , mAcellerationYCtrl(nullptr), mAcellerationZCtrl(nullptr), mOmegaXCtrl(nullptr) + , mOmegaYCtrl(nullptr), mOmegaZCtrl(nullptr), mBlendFuncSrcCombo(nullptr) , mBlendFuncDestCombo(nullptr), mBounceCheckBox(nullptr), mEmissiveCheckBox(nullptr) , mFollowSourceCheckBox(nullptr), mFollowVelocityCheckBox(nullptr), mInterpolateColorCheckBox(nullptr) , mInterpolateScaleCheckBox(nullptr), mTargetPositionCheckBox(nullptr), mTargetLinearCheckBox(nullptr) - , mWindCheckBox(nullptr), mRibbonCheckBox(nullptr), mAcellerationXCtrl(nullptr) - , mAcellerationYCtrl(nullptr), mAcellerationZCtrl(nullptr), mOmegaXCtrl(nullptr) - , mOmegaYCtrl(nullptr), mOmegaZCtrl(nullptr), mStartColorSelector(nullptr) - , mEndColorSelector(nullptr), mTargetKeyInput(nullptr), mClearTargetButton(nullptr) - , mPickTargetButton(nullptr), mInjectScriptButton(nullptr), mCopyToLSLButton(nullptr) + , mWindCheckBox(nullptr), mRibbonCheckBox(nullptr), mTargetKeyInput(nullptr) + , mClearTargetButton(nullptr), mPickTargetButton(nullptr), mCopyToLSLButton(nullptr) + , mInjectScriptButton(nullptr), mStartColorSelector(nullptr), mEndColorSelector(nullptr) { mCommitCallbackRegistrar.add("Particle.Edit", boost::bind(&LLFloaterParticleEditor::onParameterChange, this)); mDefaultParticleTexture = LLViewerTextureManager::getFetchedTextureFromFile("pixiesmall.j2c"); diff --git a/indra/newview/llfloaterparticleeditor.h b/indra/newview/llfloaterparticleeditor.h index d787e6af5166bf3ec42ff293d0a741bd398f19c5..cf886222cdcc40ff53174921fe1ca8d6dac440d8 100644 --- a/indra/newview/llfloaterparticleeditor.h +++ b/indra/newview/llfloaterparticleeditor.h @@ -44,7 +44,7 @@ public: LLFloaterParticleEditor(const LLSD& key); /* virtual */ ~LLFloaterParticleEditor(); - /* virtual */ BOOL postBuild(); + /* virtual */ BOOL postBuild() override; void setObject(LLViewerObject* objectp); @@ -134,7 +134,7 @@ private: { public: LLParticleScriptCreationCallback(LLFloaterParticleEditor* editor); - void fire(const LLUUID& inventoryItem); + void fire(const LLUUID& inventoryItem) override; protected: ~LLParticleScriptCreationCallback() {} diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index d116354aabd655ea9a9862902b97407b7e2c3f44..045c9aac5e82b61ec3a06367c7611302201bf7b0 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -74,7 +74,7 @@ LLHandle<LLFloaterPathfindingCharacters> LLFloaterPathfindingCharacters::getInst if ( sInstanceHandle.isDead() ) { LLFloaterPathfindingCharacters *floaterInstance = LLFloaterReg::findTypedInstance<LLFloaterPathfindingCharacters>("pathfinding_characters"); - if (floaterInstance != NULL) + if (floaterInstance != nullptr) { sInstanceHandle = floaterInstance->mSelfHandle; } diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h index 842f0f0a47f5033cd4c858a3622f367a80788f1a..4751c2771c845676f74687c7a80d50fc5abf7d37 100644 --- a/indra/newview/llfloaterpathfindingcharacters.h +++ b/indra/newview/llfloaterpathfindingcharacters.h @@ -42,7 +42,7 @@ class LLVector3; class LLFloaterPathfindingCharacters : public LLFloaterPathfindingObjects { public: - virtual void onClose(bool pIsAppQuitting); + void onClose(bool pIsAppQuitting) override; static void openCharactersWithSelectedObjects(); static LLHandle<LLFloaterPathfindingCharacters> getInstanceHandle(); @@ -53,20 +53,20 @@ protected: LLFloaterPathfindingCharacters(const LLSD& pSeed); virtual ~LLFloaterPathfindingCharacters(); - virtual BOOL postBuild(); + BOOL postBuild() override; - virtual void requestGetObjects(); + void requestGetObjects() override; - virtual void buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr); + void buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr) override; - virtual void updateControlsOnScrollListChange(); + void updateControlsOnScrollListChange() override; - virtual S32 getNameColumnIndex() const; - virtual S32 getOwnerNameColumnIndex() const; - virtual std::string getOwnerName(const LLPathfindingObject *pObject) const; - virtual const LLColor4 &getBeaconColor() const; + S32 getNameColumnIndex() const override; + S32 getOwnerNameColumnIndex() const override; + std::string getOwnerName(const LLPathfindingObject *pObject) const override; + const LLColor4 &getBeaconColor() const override; - virtual LLPathfindingObjectListPtr getEmptyObjectList() const; + LLPathfindingObjectListPtr getEmptyObjectList() const override; private: LLSD buildCharacterScrollListItemData(const LLPathfindingCharacter *pCharacterPtr) const; diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 63b928218f0775cc5746eee79120b3db0d426535..064706f2138cd9188217037b0ea28115d57e4276 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -72,31 +72,31 @@ void LLFloaterPathfindingLinksets::openLinksetsWithSelectedObjects() LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed) : LLFloaterPathfindingObjects(pSeed), - mFilterByName(NULL), - mFilterByDescription(NULL), - mFilterByLinksetUse(NULL), - mEditLinksetUse(NULL), + mFilterByName(nullptr), + mFilterByDescription(nullptr), + mFilterByLinksetUse(nullptr), + mEditLinksetUse(nullptr), mEditLinksetUseUnset(nullptr), - mEditLinksetUseWalkable(NULL), - mEditLinksetUseStaticObstacle(NULL), - mEditLinksetUseDynamicObstacle(NULL), - mEditLinksetUseMaterialVolume(NULL), - mEditLinksetUseExclusionVolume(NULL), - mEditLinksetUseDynamicPhantom(NULL), - mLabelWalkabilityCoefficients(NULL), - mLabelEditA(NULL), - mLabelSuggestedUseA(NULL), - mEditA(NULL), - mLabelEditB(NULL), - mLabelSuggestedUseB(NULL), - mEditB(NULL), - mLabelEditC(NULL), - mLabelSuggestedUseC(NULL), - mEditC(NULL), - mLabelEditD(NULL), - mLabelSuggestedUseD(NULL), - mEditD(NULL), - mApplyEditsButton(NULL), + mEditLinksetUseWalkable(nullptr), + mEditLinksetUseStaticObstacle(nullptr), + mEditLinksetUseDynamicObstacle(nullptr), + mEditLinksetUseMaterialVolume(nullptr), + mEditLinksetUseExclusionVolume(nullptr), + mEditLinksetUseDynamicPhantom(nullptr), + mLabelWalkabilityCoefficients(nullptr), + mLabelEditA(nullptr), + mLabelSuggestedUseA(nullptr), + mEditA(nullptr), + mLabelEditB(nullptr), + mLabelSuggestedUseB(nullptr), + mEditB(nullptr), + mLabelEditC(nullptr), + mLabelSuggestedUseC(nullptr), + mEditC(nullptr), + mLabelEditD(nullptr), + mLabelSuggestedUseD(nullptr), + mEditD(nullptr), + mApplyEditsButton(nullptr), mBeaconColor(), mPreviousValueA(LLPathfindingLinkset::MAX_WALKABILITY_VALUE), mPreviousValueB(LLPathfindingLinkset::MAX_WALKABILITY_VALUE), @@ -509,7 +509,7 @@ bool LLFloaterPathfindingLinksets::isShowUnmodifiablePhantomWarning(LLPathfindin if (pLinksetUse != LLPathfindingLinkset::kUnknown) { LLPathfindingObjectListPtr selectedObjects = getSelectedObjects(); - if ((selectedObjects != NULL) && !selectedObjects->isEmpty()) + if ((selectedObjects != nullptr) && !selectedObjects->isEmpty()) { const LLPathfindingLinksetList *linksetList = dynamic_cast<const LLPathfindingLinksetList *>(selectedObjects.get()); isShowWarning = linksetList->isShowUnmodifiablePhantomWarning(pLinksetUse); @@ -526,7 +526,7 @@ bool LLFloaterPathfindingLinksets::isShowPhantomToggleWarning(LLPathfindingLinks if (pLinksetUse != LLPathfindingLinkset::kUnknown) { LLPathfindingObjectListPtr selectedObjects = getSelectedObjects(); - if ((selectedObjects != NULL) && !selectedObjects->isEmpty()) + if ((selectedObjects != nullptr) && !selectedObjects->isEmpty()) { const LLPathfindingLinksetList *linksetList = dynamic_cast<const LLPathfindingLinksetList *>(selectedObjects.get()); isShowWarning = linksetList->isShowPhantomToggleWarning(pLinksetUse); @@ -543,7 +543,7 @@ bool LLFloaterPathfindingLinksets::isShowCannotBeVolumeWarning(LLPathfindingLink if (pLinksetUse != LLPathfindingLinkset::kUnknown) { LLPathfindingObjectListPtr selectedObjects = getSelectedObjects(); - if ((selectedObjects != NULL) && !selectedObjects->isEmpty()) + if ((selectedObjects != nullptr) && !selectedObjects->isEmpty()) { const LLPathfindingLinksetList *linksetList = dynamic_cast<const LLPathfindingLinksetList *>(selectedObjects.get()); isShowWarning = linksetList->isShowCannotBeVolumeWarning(pLinksetUse); @@ -587,7 +587,7 @@ void LLFloaterPathfindingLinksets::updateStateOnEditLinksetUse() BOOL useDynamicPhantom = FALSE; LLPathfindingObjectListPtr selectedObjects = getSelectedObjects(); - if ((selectedObjects != NULL) && !selectedObjects->isEmpty()) + if ((selectedObjects != nullptr) && !selectedObjects->isEmpty()) { const LLPathfindingLinksetList *linksetList = dynamic_cast<const LLPathfindingLinksetList *>(selectedObjects.get()); linksetList->determinePossibleStates(useWalkable, useStaticObstacle, useDynamicObstacle, useMaterialVolume, useExclusionVolume, useDynamicPhantom); @@ -659,7 +659,7 @@ void LLFloaterPathfindingLinksets::handleApplyEdit(const LLSD &pNotification, co void LLFloaterPathfindingLinksets::doApplyEdit() { LLPathfindingObjectListPtr selectedObjects = getSelectedObjects(); - if ((selectedObjects != NULL) && !selectedObjects->isEmpty()) + if ((selectedObjects != nullptr) && !selectedObjects->isEmpty()) { LLPathfindingLinkset::ELinksetUse linksetUse = getEditLinksetUse(); S32 aValue = std::stoi(mEditA->getText()); diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index 8346dc81ef2999296a5d0822b19db8474c8efe12..4d285ee82305dd55ca10fba9a7b0fcab1d337eb0 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -52,20 +52,20 @@ protected: LLFloaterPathfindingLinksets(const LLSD& pSeed); virtual ~LLFloaterPathfindingLinksets(); - virtual BOOL postBuild(); + BOOL postBuild() override; - virtual void requestGetObjects(); + void requestGetObjects() override; - virtual void buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr); + void buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr) override; - virtual void updateControlsOnScrollListChange(); + void updateControlsOnScrollListChange() override; - virtual S32 getNameColumnIndex() const; - virtual S32 getOwnerNameColumnIndex() const; - virtual std::string getOwnerName(const LLPathfindingObject *pObject) const; - virtual const LLColor4 &getBeaconColor() const; + S32 getNameColumnIndex() const override; + S32 getOwnerNameColumnIndex() const override; + std::string getOwnerName(const LLPathfindingObject *pObject) const override; + const LLColor4 &getBeaconColor() const override; - virtual LLPathfindingObjectListPtr getEmptyObjectList() const; + LLPathfindingObjectListPtr getEmptyObjectList() const override; private: void requestSetLinksets(LLPathfindingObjectListPtr pLinksetList, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD); diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index 973bfb7ce09574ddb71aa40521e7b1d8d9540a69..5789882837af659926264f53585427bfd512a78e 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -145,7 +145,7 @@ void LLFloaterPathfindingObjects::draw() const LLScrollListItem *selectedItem = *selectedItemIter; LLViewerObject *viewerObject = gObjectList.findObject(selectedItem->getUUID()); - if (viewerObject != NULL) + if (viewerObject != nullptr) { const std::string &objectName = selectedItem->getColumn(nameColumnIndex)->getValue().asString(); gObjectList.addDebugBeacon(viewerObject->getPositionAgent(), objectName, beaconColor, beaconTextColor, beaconWidth); @@ -157,17 +157,17 @@ void LLFloaterPathfindingObjects::draw() LLFloaterPathfindingObjects::LLFloaterPathfindingObjects(const LLSD &pSeed) : LLFloater(pSeed), - mObjectsScrollList(NULL), - mMessagingStatus(NULL), - mRefreshListButton(NULL), - mSelectAllButton(NULL), - mSelectNoneButton(NULL), - mShowBeaconCheckBox(NULL), - mTakeButton(NULL), - mTakeCopyButton(NULL), - mReturnButton(NULL), - mDeleteButton(NULL), - mTeleportButton(NULL), + mObjectsScrollList(nullptr), + mMessagingStatus(nullptr), + mRefreshListButton(nullptr), + mSelectAllButton(nullptr), + mSelectNoneButton(nullptr), + mShowBeaconCheckBox(nullptr), + mTakeButton(nullptr), + mTakeCopyButton(nullptr), + mReturnButton(nullptr), + mDeleteButton(nullptr), + mTeleportButton(nullptr), mDefaultBeaconColor(), mDefaultBeaconTextColor(), mErrorTextColor(), @@ -296,7 +296,7 @@ void LLFloaterPathfindingObjects::handleUpdateObjectList(LLPathfindingManager::r setMessagingState(kMessagingSetRequestSent); break; case LLPathfindingManager::kRequestCompleted : - if (mObjectList == NULL) + if (mObjectList == nullptr) { mObjectList = pObjectList; } @@ -346,7 +346,7 @@ void LLFloaterPathfindingObjects::rebuildObjectsScrollList(bool update_if_needed mObjectsScrollList->deleteAllItems(); mMissingNameObjectsScrollListItems.clear(); - if ((mObjectList != NULL) && !mObjectList->isEmpty()) + if ((mObjectList != nullptr) && !mObjectList->isEmpty()) { buildObjectsScrollList(mObjectList); @@ -530,7 +530,7 @@ void LLFloaterPathfindingObjects::teleportToSelectedObject() llassert(mObjectList != NULL); LLVector3d teleportLocation; LLViewerObject *viewerObject = gObjectList.findObject(selectedItem->getUUID()); - if (viewerObject == NULL) + if (viewerObject == nullptr) { // If we cannot find the object in the viewer list, teleport to the last reported position const LLPathfindingObjectPtr objectPtr = mObjectList->find(selectedItem->getUUID().asString()); @@ -568,7 +568,7 @@ LLPathfindingObjectListPtr LLFloaterPathfindingObjects::getSelectedObjects() con itemIter != selectedItems.end(); ++itemIter) { LLPathfindingObjectPtr objectPtr = findObject(*itemIter); - if (objectPtr != NULL) + if (objectPtr != nullptr) { selectedObjects->update(objectPtr); } @@ -841,7 +841,7 @@ void LLFloaterPathfindingObjects::selectScrollListItemsInWorld() const LLScrollListItem *selectedItem = *selectedItemIter; LLViewerObject *viewerObject = gObjectList.findObject(selectedItem->getUUID()); - if (viewerObject != NULL) + if (viewerObject != nullptr) { viewerObjects.push_back(viewerObject); } diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h index c41454e6284a2ab82f79d1d38d13905ad53ea013..df6f6608d9b15c01a721a3ab0f47d2929679cac8 100644 --- a/indra/newview/llfloaterpathfindingobjects.h +++ b/indra/newview/llfloaterpathfindingobjects.h @@ -47,9 +47,9 @@ class LLTextBase; class LLFloaterPathfindingObjects : public LLFloater { public: - virtual void onOpen(const LLSD &pKey); - virtual void onClose(bool pIsAppQuitting); - virtual void draw(); + void onOpen(const LLSD &pKey) override; + void onClose(bool pIsAppQuitting) override; + void draw() override; protected: friend class LLFloaterReg; @@ -68,7 +68,7 @@ protected: LLFloaterPathfindingObjects(const LLSD &pSeed); virtual ~LLFloaterPathfindingObjects(); - virtual BOOL postBuild(); + BOOL postBuild() override; virtual void requestGetObjects(); LLPathfindingManager::request_id_t getNewRequestId(); diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index 2666fb9319f2dd307109ff4c8c5b9debd451519c..4fb9b5433803e56dc24b9eac6a42296cfe9cbde0 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -83,8 +83,8 @@ class LLFloaterPay : public LLFloater public: LLFloaterPay(const LLSD& key); virtual ~LLFloaterPay(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onClose(bool app_quitting) override; void setCallback(money_callback callback) { mCallback = callback; } @@ -124,7 +124,7 @@ const S32 FASTPAY_BUTTON_WIDTH = 80; LLFloaterPay::LLFloaterPay(const LLSD& key) : LLFloater(key), mCallbackData(), - mCallback(NULL), + mCallback(nullptr), mTargetUUID(key.asUUID()), mTargetIsGroup(FALSE), mQuickPayButton({ {nullptr,nullptr,nullptr,nullptr} }), @@ -138,20 +138,20 @@ LLFloaterPay::~LLFloaterPay() std::vector<give_money_ptr>::iterator iter; for (iter = mCallbackData.begin(); iter != mCallbackData.end(); ++iter) { - (*iter)->mFloater = NULL; + (*iter)->mFloater = nullptr; } mCallbackData.clear(); // Name callbacks will be automatically disconnected since LLFloater is trackable // In case this floater is currently waiting for a reply. - gMessageSystem->setHandlerFuncFast(_PREHASH_PayPriceReply, 0, 0); + gMessageSystem->setHandlerFuncFast(_PREHASH_PayPriceReply, nullptr, nullptr); } BOOL LLFloaterPay::postBuild() { S32 i = 0; - give_money_ptr info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_0)); + give_money_ptr info = boost::make_shared<LLGiveMoneyInfo>(this, PAY_BUTTON_DEFAULT_0); mCallbackData.push_back(info); childSetAction("fastpay 1", boost::bind(LLFloaterPay::onGive, info)); @@ -161,7 +161,7 @@ BOOL LLFloaterPay::postBuild() mQuickPayInfo[i] = info; ++i; - info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_1)); + info = boost::make_shared<LLGiveMoneyInfo>(this, PAY_BUTTON_DEFAULT_1); mCallbackData.push_back(info); childSetAction("fastpay 5", boost::bind(LLFloaterPay::onGive, info)); @@ -171,7 +171,7 @@ BOOL LLFloaterPay::postBuild() mQuickPayInfo[i] = info; ++i; - info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_2)); + info = boost::make_shared<LLGiveMoneyInfo>(this, PAY_BUTTON_DEFAULT_2); mCallbackData.push_back(info); childSetAction("fastpay 10", boost::bind(LLFloaterPay::onGive, info)); @@ -181,7 +181,7 @@ BOOL LLFloaterPay::postBuild() mQuickPayInfo[i] = info; ++i; - info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_3)); + info = boost::make_shared<LLGiveMoneyInfo>(this, PAY_BUTTON_DEFAULT_3); mCallbackData.push_back(info); childSetAction("fastpay 20", boost::bind(LLFloaterPay::onGive, info)); @@ -206,7 +206,7 @@ BOOL LLFloaterPay::postBuild() getChild<LLUICtrl>("amount")->setValue(last_amount); getChild<LLLineEditor>("amount")->setPrevalidate(LLTextValidate::validateNonNegativeS32); - info = give_money_ptr(new LLGiveMoneyInfo(this, 0)); + info = boost::make_shared<LLGiveMoneyInfo>(this, 0); mCallbackData.push_back(info); childSetAction("pay btn", boost::bind(LLFloaterPay::onGive, info)); @@ -223,7 +223,7 @@ BOOL LLFloaterPay::postBuild() void LLFloaterPay::onClose(bool app_quitting) { // Deselect the objects - mObjectSelection = NULL; + mObjectSelection = nullptr; } // static @@ -361,7 +361,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) self->reshape( self->getRect().getWidth() + padding_required, self->getRect().getHeight(), FALSE ); } - msg->setHandlerFunc("PayPriceReply",NULL,NULL); + msg->setHandlerFunc("PayPriceReply", nullptr, nullptr); } // static @@ -416,7 +416,7 @@ void LLFloaterPay::payDirectly(money_callback callback, return; floater->setCallback(callback); - floater->mObjectSelection = NULL; + floater->mObjectSelection = nullptr; floater->getChildView("amount")->setVisible(TRUE); floater->getChildView("pay btn")->setVisible(TRUE); @@ -522,7 +522,7 @@ void LLFloaterPay::give(S32 amount) S32 tx_type = TRANS_PAY_OBJECT; if(dest_object->isAvatar()) tx_type = TRANS_GIFT; mCallback(mTargetUUID, region, amount, FALSE, tx_type, object_name); - mObjectSelection = NULL; + mObjectSelection = nullptr; // request the object owner in order to check if the owner needs to be unmuted LLMessageSystem* msg = gMessageSystem; diff --git a/indra/newview/llfloaterperms.h b/indra/newview/llfloaterperms.h index 6ec486263a8305b3719b73e9360987c54032a6c6..92e6162ab9a0d885dfdb7bc3443b596e30b8b6b4 100644 --- a/indra/newview/llfloaterperms.h +++ b/indra/newview/llfloaterperms.h @@ -39,7 +39,7 @@ class LLFloaterPerms : public LLFloater friend class LLFloaterReg; public: - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; // Convenience methods to get current permission preference bitfields from saved settings: static U32 getEveryonePerms(const std::string& prefix=""); // prefix + "EveryoneCopy" diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d2ed88c9beb227eb491ea18551bc53f2a53a66a1..3fcb18d3e0f9e26ae088bc37705f598f4c4b2393 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -152,11 +152,11 @@ public: LLVoiceSetKeyDialog(const LLSD& key); ~LLVoiceSetKeyDialog(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void setParent(LLFloaterPreference* parent) { mParent = parent; } - BOOL handleKeyHere(KEY key, MASK mask); + BOOL handleKeyHere(KEY key, MASK mask) override; static void onCancel(void* user_data); private: @@ -183,7 +183,7 @@ typedef struct skin_t LLVoiceSetKeyDialog::LLVoiceSetKeyDialog(const LLSD& key) : LLModalDialog(key), - mParent(NULL) + mParent(nullptr) { } @@ -356,12 +356,12 @@ std::string LLFloaterPreference::sSkin = ""; LLFloaterPreference::LLFloaterPreference(const LLSD& key) : LLFloater(key), + mClickActionDirty(false), mGotPersonalInfo(false), mOriginalIMViaEmail(false), mLanguageChanged(false), mSoundQualityChanged(false), - mAvatarDataInitialized(false), - mClickActionDirty(false) + mAvatarDataInitialized(false) { LLConversationLog::instance().addObserver(this); @@ -962,10 +962,10 @@ LLFloaterPreference::~LLFloaterPreference() void LLFloaterPreference::draw() { - BOOL has_first_selected = (getChildRef<LLScrollListCtrl>("disabled_popups").getFirstSelected()!=NULL); + BOOL has_first_selected = (getChildRef<LLScrollListCtrl>("disabled_popups").getFirstSelected()!= nullptr); gSavedSettings.setBOOL("FirstSelectedDisabledPopups", has_first_selected); - has_first_selected = (getChildRef<LLScrollListCtrl>("enabled_popups").getFirstSelected()!=NULL); + has_first_selected = (getChildRef<LLScrollListCtrl>("enabled_popups").getFirstSelected()!= nullptr); gSavedSettings.setBOOL("FirstSelectedEnabledPopups", has_first_selected); LLFloater::draw(); @@ -1500,7 +1500,7 @@ void LLFloaterPreference::buildPopupLists() row["columns"][0]["font"] = "SANSSERIF_SMALL"; row["columns"][0]["width"] = 400; - LLScrollListItem* item = NULL; + LLScrollListItem* item = nullptr; bool show_popup = !formp->getIgnored(); if (!show_popup) @@ -2201,7 +2201,7 @@ void LLFloaterPreference::refreshUI() void LLFloaterPreferenceGraphicsAdvanced::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) { - if (text_box == NULL || ctrl== NULL) + if (text_box == nullptr || ctrl== nullptr) return; // get range and points when text should change @@ -2531,7 +2531,7 @@ void LLFloaterPreference::selectPanel(const LLSD& name) { LLTabContainer * tab_containerp = getChild<LLTabContainer>("pref core"); LLPanel * panel = tab_containerp->getPanelByName(name); - if (NULL != panel) + if (nullptr != panel) { tab_containerp->selectTabPanel(panel); } @@ -2588,7 +2588,7 @@ public: protected: - BOOL tick() + BOOL tick() override { mCallback(mNewValue); mEventTimer.stop(); @@ -2605,7 +2605,7 @@ private: static LLPanelInjector<LLPanelPreference> t_places("panel_preference"); LLPanelPreference::LLPanelPreference() : LLPanel(), - mBandWidthUpdater(NULL) + mBandWidthUpdater(nullptr) { mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2)); mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1)); @@ -2824,7 +2824,7 @@ public: mAccountIndependentSettings.push_back("AutoDisengageMic"); } - /*virtual*/ void saveSettings() + /*virtual*/ void saveSettings() override { LLPanelPreference::saveSettings(); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 9ba530dbba5ec91f659db90035fda441edb00e7c..3f7be6cf8682ba84e1dcd6924c053711e3b26675 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -68,12 +68,12 @@ public: void apply(); void cancel(); - /*virtual*/ void draw(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void changed(); - /*virtual*/ void changed(const LLUUID& session_id, U32 mask) {}; + /*virtual*/ void draw() override; + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void onClose(bool app_quitting) override; + /*virtual*/ void changed() override; + /*virtual*/ void changed(const LLUUID& session_id, U32 mask) override {}; // static data update, called from message handler static void updateUserInfo(const std::string& visibility, bool im_via_email); @@ -84,7 +84,7 @@ public: // translate user's do not disturb response message according to current locale if message is default, otherwise do nothing static void initDoNotDisturbResponse(); - void processProperties( void* pData, EAvatarProcessorType type ); + void processProperties( void* pData, EAvatarProcessorType type ) override; void processProfileProperties(const LLAvatarData* pAvatarData ); void storeAvatarProperties( const LLAvatarData* pAvatarData ); void saveAvatarProperties( void ); @@ -144,7 +144,7 @@ public: void setPersonalInfo(const std::string& visibility, bool im_via_email); void refreshEnabledState(); void onCommitWindowedMode(); - void refresh(); // Refresh enable/disable + void refresh() override; // Refresh enable/disable // if the quality radio buttons are changed void onChangeQuality(const LLSD& data); @@ -223,7 +223,7 @@ class LLPanelPreference : public LLPanel { public: LLPanelPreference(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; virtual ~LLPanelPreference(); @@ -262,12 +262,12 @@ private: class LLPanelPreferenceGraphics : public LLPanelPreference { public: - BOOL postBuild(); - void draw(); - void cancel(); - void saveSettings(); + BOOL postBuild() override; + void draw() override; + void cancel() override; + void saveSettings() override; void resetDirtyChilds(); - void setHardwareDefaults(); + void setHardwareDefaults() override; protected: bool hasDirtyChilds(); @@ -280,8 +280,8 @@ class LLFloaterPreferenceGraphicsAdvanced : public LLFloater public: LLFloaterPreferenceGraphicsAdvanced(const LLSD& key); ~LLFloaterPreferenceGraphicsAdvanced(); - void onOpen(const LLSD& key); - void onClickCloseBtn(bool app_quitting); + void onOpen(const LLSD& key) override; + void onClickCloseBtn(bool app_quitting) override; void disableUnavailableSettings(); void refreshEnabledGraphics(); void refreshEnabledState(); @@ -293,7 +293,7 @@ class LLFloaterPreferenceGraphicsAdvanced : public LLFloater static void setIndirectControls(); static void setIndirectMaxNonImpostors(); static void setIndirectMaxArc(); - void refresh(); + void refresh() override; // callback for when client turns on shaders void onVertexShaderEnable(); LOG_CLASS(LLFloaterPreferenceGraphicsAdvanced); @@ -321,13 +321,13 @@ public: void cancel(); protected: - BOOL postBuild(); - void onOpen(const LLSD& key); - void onClose(bool app_quitting); + BOOL postBuild() override; + void onOpen(const LLSD& key) override; + void onClose(bool app_quitting) override; void saveSettings(); void onBtnOk(); void onBtnCancel(); - void onClickCloseBtn(bool app_quitting = false); + void onClickCloseBtn(bool app_quitting = false) override; void onChangeSocksSettings(); diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index afd08448425c94591491fbac3b16ddc126a1ea81..53ae6998f7d8bc3e70e128ce22d2a2a4730ec116 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -84,7 +84,8 @@ public: { gInventory.removeObserver(this); } - virtual void changed(U32 mask); + + void changed(U32 mask) override; private: LLFloaterProperties* mFloater; }; @@ -117,7 +118,7 @@ LLFloaterProperties::LLFloaterProperties(const LLUUID& item_id) LLFloaterProperties::~LLFloaterProperties() { delete mPropertiesObserver; - mPropertiesObserver = NULL; + mPropertiesObserver = nullptr; } // virtual @@ -248,7 +249,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) // You need permission to modify the object to modify an inventory // item in it. - LLViewerObject* object = NULL; + LLViewerObject* object = nullptr; if(!mObjectID.isNull()) object = gObjectList.findObject(mObjectID); BOOL is_obj_modify = TRUE; if(object) @@ -848,7 +849,7 @@ void LLFloaterProperties::updateSaleInfo() LLInventoryItem* LLFloaterProperties::findItem() const { - LLInventoryItem* item = NULL; + LLInventoryItem* item = nullptr; if(mObjectID.isNull()) { // it is in agent inventory diff --git a/indra/newview/llfloaterproperties.h b/indra/newview/llfloaterproperties.h index 4bd30eab9a502573f359c1329abeeca8a1268ebe..016b14d3737f92364c0c21a93b50434386ff1733 100644 --- a/indra/newview/llfloaterproperties.h +++ b/indra/newview/llfloaterproperties.h @@ -49,12 +49,12 @@ public: LLFloaterProperties(const LLUUID& item_id); /*virtual*/ ~LLFloaterProperties(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; void setObjectID(const LLUUID& object_id) { mObjectID = object_id; } void dirty() { mDirty = TRUE; } - void refresh(); + void refresh() override; static void dirtyAll(); @@ -72,7 +72,7 @@ protected: LLInventoryItem* findItem() const; void refreshFromItem(LLInventoryItem* item); - virtual void draw(); + void draw() override; protected: // The item id of the inventory item in question. diff --git a/indra/newview/llfloaterregiondebugconsole.h b/indra/newview/llfloaterregiondebugconsole.h index e354d2b243e9f7fc62727d75520012eac56ab102..d3e94ceaa88d5387f51fd6c6280f0e445e12e021 100644 --- a/indra/newview/llfloaterregiondebugconsole.h +++ b/indra/newview/llfloaterregiondebugconsole.h @@ -42,7 +42,7 @@ public: virtual ~LLFloaterRegionDebugConsole(); // virtual - BOOL postBuild(); + BOOL postBuild() override; void onInput(LLUICtrl* ctrl, const LLSD& param); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 019e71fd07d4f5c08d2c683159b29fab2e73db92..adfc1a33097c170ec582ac75b93bc20631029188 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -113,11 +113,11 @@ class LLDispatchEstateUpdateInfo : public LLDispatchHandler public: LLDispatchEstateUpdateInfo() {} virtual ~LLDispatchEstateUpdateInfo() {} - virtual bool operator()( + bool operator()( const LLDispatcher* dispatcher, const std::string& key, const LLUUID& invoice, - const sparam_t& strings); + const sparam_t& strings) override; }; class LLDispatchSetEstateAccess : public LLDispatchHandler @@ -125,21 +125,21 @@ class LLDispatchSetEstateAccess : public LLDispatchHandler public: LLDispatchSetEstateAccess() {} virtual ~LLDispatchSetEstateAccess() {} - virtual bool operator()( + bool operator()( const LLDispatcher* dispatcher, const std::string& key, const LLUUID& invoice, - const sparam_t& strings); + const sparam_t& strings) override; }; class LLDispatchSetEstateExperience : public LLDispatchHandler { public: - virtual bool operator()( + bool operator()( const LLDispatcher* dispatcher, const std::string& key, const LLUUID& invoice, - const sparam_t& strings); + const sparam_t& strings) override; LLSD getIDs( sparam_t::const_iterator it, sparam_t::const_iterator end, S32 count ); }; @@ -459,7 +459,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) LLPanelEstateInfo* LLFloaterRegionInfo::getPanelEstate() { LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info"); - if (!floater) return NULL; + if (!floater) return nullptr; LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate"); return panel; @@ -469,7 +469,7 @@ LLPanelEstateInfo* LLFloaterRegionInfo::getPanelEstate() LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant() { LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info"); - if (!floater) return NULL; + if (!floater) return nullptr; LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); LLPanelEstateCovenant* panel = (LLPanelEstateCovenant*)tab->getChild<LLPanel>("Covenant"); return panel; @@ -479,7 +479,7 @@ LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant() LLPanelRegionGeneralInfo* LLFloaterRegionInfo::getPanelGeneral() { LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info"); - if (!floater) return NULL; + if (!floater) return nullptr; LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); LLPanelRegionGeneralInfo* panel = (LLPanelRegionGeneralInfo*)tab->getChild<LLPanel>("General"); return panel; @@ -492,7 +492,7 @@ LLPanelRegionTerrainInfo* LLFloaterRegionInfo::getPanelRegionTerrain() if (!floater) { llassert(floater); - return NULL; + return nullptr; } LLTabContainer* tab_container = floater->getChild<LLTabContainer>("region_panels"); @@ -505,7 +505,7 @@ LLPanelRegionTerrainInfo* LLFloaterRegionInfo::getPanelRegionTerrain() LLPanelRegionExperiences* LLFloaterRegionInfo::getPanelExperiences() { LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info"); - if (!floater) return NULL; + if (!floater) return nullptr; LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); return (LLPanelRegionExperiences*)tab->getChild<LLPanel>("Experiences"); } @@ -653,7 +653,7 @@ void LLPanelRegionInfo::sendEstateOwnerMessage( if(strings.empty()) { msg->nextBlock("ParamList"); - msg->addString("Parameter", NULL); + msg->addString("Parameter", nullptr); } else { @@ -1850,7 +1850,7 @@ bool LLPanelEstateInfo::accessAddCore2(const LLSD& notification, const LLSD& res //Determine the button that triggered opening of the avatar picker //(so that a shadow frustum from the button to the avatar picker can be created) - LLView * button = NULL; + LLView * button = nullptr; switch(change_info->mOperationFlag) { case ESTATE_ACCESS_ALLOWED_AGENT_ADD: @@ -1888,7 +1888,7 @@ void LLPanelEstateInfo::accessAddCore3(const uuid_vec_t& ids, void* data) { // User didn't select a name. delete change_info; - change_info = NULL; + change_info = nullptr; return; } // User did select a name. @@ -2540,7 +2540,7 @@ BOOL LLPanelEstateCovenant::postBuild() mEditor = getChild<LLViewerTextEditor>("covenant_editor"); LLButton* reset_button = getChild<LLButton>("reset_covenant"); reset_button->setEnabled(gAgent.canManageEstate()); - reset_button->setClickedCallback(LLPanelEstateCovenant::resetCovenantID, NULL); + reset_button->setClickedCallback(LLPanelEstateCovenant::resetCovenantID, nullptr); return LLPanelRegionInfo::postBuild(); } @@ -2621,7 +2621,7 @@ bool LLPanelEstateCovenant::confirmResetCovenantCallback(const LLSD& notificatio switch(option) { case 0: - self->loadInvItem(NULL); + self->loadInvItem(nullptr); break; default: break; @@ -2864,11 +2864,11 @@ bool LLDispatchSetEstateAccess::operator()( if (!panel) return true; S32 index = 1; // skip estate_id - U32 access_flags = strtoul(strings[index++].c_str(), NULL,10); - S32 num_allowed_agents = strtol(strings[index++].c_str(), NULL, 10); - S32 num_allowed_groups = strtol(strings[index++].c_str(), NULL, 10); - S32 num_banned_agents = strtol(strings[index++].c_str(), NULL, 10); - S32 num_estate_managers = strtol(strings[index++].c_str(), NULL, 10); + U32 access_flags = strtoul(strings[index++].c_str(), nullptr,10); + S32 num_allowed_agents = strtol(strings[index++].c_str(), nullptr, 10); + S32 num_allowed_groups = strtol(strings[index++].c_str(), nullptr, 10); + S32 num_banned_agents = strtol(strings[index++].c_str(), nullptr, 10); + S32 num_estate_managers = strtol(strings[index++].c_str(), nullptr, 10); // sanity ckecks if (num_allowed_agents > 0 @@ -3055,9 +3055,9 @@ bool LLDispatchSetEstateExperience::operator()( ++it; // U32 send_to_agent_only = strtoul((*(++it)).c_str(), NULL, 10); LLUUID id; - S32 num_blocked = strtol((*(it++)).c_str(), NULL, 10); - S32 num_trusted = strtol((*(it++)).c_str(), NULL, 10); - S32 num_allowed = strtol((*(it++)).c_str(), NULL, 10); + S32 num_blocked = strtol((*(it++)).c_str(), nullptr, 10); + S32 num_trusted = strtol((*(it++)).c_str(), nullptr, 10); + S32 num_allowed = strtol((*(it++)).c_str(), nullptr, 10); LLSD ids = LLSD::emptyMap() .with("blocked", getIDs(it, strings.end(), num_blocked)) @@ -3073,11 +3073,11 @@ bool LLDispatchSetEstateExperience::operator()( LLPanelEnvironmentInfo::LLPanelEnvironmentInfo() : mEnableEditing(false), - mRegionSettingsRadioGroup(NULL), - mDayCycleSettingsRadioGroup(NULL), - mWaterPresetCombo(NULL), - mSkyPresetCombo(NULL), - mDayCyclePresetCombo(NULL) + mRegionSettingsRadioGroup(nullptr), + mDayCycleSettingsRadioGroup(nullptr), + mWaterPresetCombo(nullptr), + mSkyPresetCombo(nullptr), + mDayCyclePresetCombo(nullptr) { } @@ -3099,9 +3099,9 @@ BOOL LLPanelEnvironmentInfo::postBuild() mDayCyclePresetCombo = getChild<LLComboBox>("dayc_settings_preset_combo"); mDayCyclePresetCombo->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSelectDayCycle, this)); - childSetCommitCallback("apply_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnApply, this), NULL); + childSetCommitCallback("apply_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnApply, this), nullptr); getChild<LLButton>("apply_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance())); - childSetCommitCallback("cancel_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnCancel, this), NULL); + childSetCommitCallback("cancel_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnCancel, this), nullptr); getChild<LLButton>("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance())); LLEnvManagerNew::instance().setRegionSettingsChangeCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingschange, this)); diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index e7e226528de8295ff76491215cd84e1dc5e54278..911f4f4aabdb1b5857850640a30575d4618a7d7a 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -77,8 +77,8 @@ class LLFloaterRegionInfo : public LLFloater public: - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ BOOL postBuild() override; static void processEstateOwnerRequest(LLMessageSystem* msg, void**); @@ -97,7 +97,7 @@ public: static LLPanelRegionGeneralInfo* getPanelGeneral(); // from LLPanel - virtual void refresh(); + void refresh() override; void requestRegionInfo(); void requestMeshRezInfo(); @@ -138,8 +138,8 @@ public: virtual bool refreshFromRegion(LLViewerRegion* region); virtual bool estateUpdate(LLMessageSystem* msg) { return true; } - - virtual BOOL postBuild(); + + BOOL postBuild() override; virtual void updateChild(LLUICtrl* child_ctrl); void enableButton(const std::string& btn_name, BOOL enable = TRUE); @@ -178,17 +178,17 @@ public: : LLPanelRegionInfo(), mObjBonusFactor(0.f) {} ~LLPanelRegionGeneralInfo() {} - - virtual bool refreshFromRegion(LLViewerRegion* region); + + bool refreshFromRegion(LLViewerRegion* region) override; // LLPanel - virtual BOOL postBuild(); + BOOL postBuild() override; void onBtnSet(); void setObjBonusFactor(F32 object_bonus_factor) {mObjBonusFactor = object_bonus_factor;} protected: - virtual BOOL sendUpdate(); + BOOL sendUpdate() override; void onClickKick(); void onKickCommit(const uuid_vec_t& ids); static void onClickKickAll(void* userdata); @@ -210,12 +210,12 @@ public: : LLPanelRegionInfo(), mTargetAvatar() {} ~LLPanelRegionDebugInfo() {} // LLPanel - virtual BOOL postBuild(); - - virtual bool refreshFromRegion(LLViewerRegion* region); + BOOL postBuild() override; + + bool refreshFromRegion(LLViewerRegion* region) override; protected: - virtual BOOL sendUpdate(); + BOOL sendUpdate() override; void onClickChooseAvatar(); void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); @@ -241,21 +241,21 @@ class LLPanelRegionTerrainInfo : public LLPanelRegionInfo public: LLPanelRegionTerrainInfo() : LLPanelRegionInfo(), - mAskedTextureHeights(false), - mConfirmedTextureHeights(false) {} + mConfirmedTextureHeights(false), + mAskedTextureHeights(false) {} ~LLPanelRegionTerrainInfo() {} - - virtual BOOL postBuild(); // LLPanel - - virtual bool refreshFromRegion(LLViewerRegion* region); // refresh local settings from region update from simulator + + BOOL postBuild() override; // LLPanel + + bool refreshFromRegion(LLViewerRegion* region) override; // refresh local settings from region update from simulator void setEnvControls(bool available); // Whether environment settings are available for this region BOOL validateTextureSizes(); BOOL validateTextureHeights(); //static void onChangeAnything(LLUICtrl* ctrl, void* userData); // callback for any change, to enable commit button - - virtual BOOL sendUpdate(); + + BOOL sendUpdate() override; static void onClickDownloadRaw(void*); static void onClickUploadRaw(void*); @@ -324,13 +324,13 @@ public: static void updateEstateName(const std::string& name); static void updateEstateOwnerName(const std::string& name); - virtual bool refreshFromRegion(LLViewerRegion* region); - virtual bool estateUpdate(LLMessageSystem* msg); + bool refreshFromRegion(LLViewerRegion* region) override; + bool estateUpdate(LLMessageSystem* msg) override; // LLPanel - virtual BOOL postBuild(); - virtual void updateChild(LLUICtrl* child_ctrl); - virtual void refresh(); + BOOL postBuild() override; + void updateChild(LLUICtrl* child_ctrl) override; + void refresh() override; void refreshFromEstate(); @@ -340,7 +340,7 @@ public: void setOwnerName(const std::string& name); protected: - virtual BOOL sendUpdate(); + BOOL sendUpdate() override; // confirmation dialog callback bool callbackChangeLindenEstate(const LLSD& notification, const LLSD& response); @@ -362,16 +362,16 @@ public: ~LLPanelEstateCovenant() {} // LLPanel - virtual BOOL postBuild(); - virtual void updateChild(LLUICtrl* child_ctrl); - virtual bool refreshFromRegion(LLViewerRegion* region); - virtual bool estateUpdate(LLMessageSystem* msg); + BOOL postBuild() override; + void updateChild(LLUICtrl* child_ctrl) override; + bool refreshFromRegion(LLViewerRegion* region) override; + bool estateUpdate(LLMessageSystem* msg) override; // LLView overrides BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; static bool confirmChangeCovenantCallback(const LLSD& notification, const LLSD& response); static void resetCovenantID(void* userdata); static bool confirmResetCovenantCallback(const LLSD& notification, const LLSD& response); @@ -405,7 +405,7 @@ public: } EAssetStatus; protected: - virtual BOOL sendUpdate(); + BOOL sendUpdate() override; LLTextBox* mEstateNameText; LLTextBox* mEstateOwnerText; LLTextBox* mLastModifiedText; @@ -425,17 +425,17 @@ public: LLPanelEnvironmentInfo(); // LLPanel - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; // LLView - /*virtual*/ void onVisibilityChange(BOOL new_visibility); + /*virtual*/ void onVisibilityChange(BOOL new_visibility) override; // LLPanelRegionInfo - /*virtual*/ bool refreshFromRegion(LLViewerRegion* region); + /*virtual*/ bool refreshFromRegion(LLViewerRegion* region) override; private: - void refresh(); + void refresh() override; void setControlsEnabled(bool enabled); void setApplyProgress(bool started); void setDirty(bool dirty); @@ -483,18 +483,18 @@ class LLPanelRegionExperiences : public LLPanelRegionInfo public: LLPanelRegionExperiences() - : mTrusted(NULL) - , mAllowed(NULL) - , mBlocked(NULL) + : mTrusted(nullptr) + , mAllowed(nullptr) + , mBlocked(nullptr) {} - /*virtual*/ BOOL postBuild(); - virtual BOOL sendUpdate(); + /*virtual*/ BOOL postBuild() override; + BOOL sendUpdate() override; static bool experienceCoreConfirm(const LLSD& notification, const LLSD& response); static void sendEstateExperienceDelta(U32 flags, const LLUUID& agent_id); static void infoCallback(LLHandle<LLPanelRegionExperiences> handle, const LLSD& content); - bool refreshFromRegion(LLViewerRegion* region); + bool refreshFromRegion(LLViewerRegion* region) override; void sendPurchaseRequest()const; void processResponse( const LLSD& content ); private: diff --git a/indra/newview/llfloaterregionrestarting.h b/indra/newview/llfloaterregionrestarting.h index 4cd90473295f39aab4aa789c2886a88aa54128d5..55e0de07446f7791a1e32696631e93e7304466ae 100644 --- a/indra/newview/llfloaterregionrestarting.h +++ b/indra/newview/llfloaterregionrestarting.h @@ -41,10 +41,10 @@ public: private: LLFloaterRegionRestarting(const LLSD& key); virtual ~LLFloaterRegionRestarting(); - virtual BOOL postBuild(); - virtual BOOL tick(); - virtual void refresh(); - virtual void draw(); + BOOL postBuild() override; + BOOL tick() override; + void refresh() override; + void draw() override; virtual void regionChange(); std::string mName; diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index c399f16374b1a7a3069128be6528bc32d7a0a603..ac1237057971d4e0aaa7c98a191d1892d2092181 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -101,13 +101,13 @@ class LLARScreenShotUploader : public LLResourceUploadInfo public: LLARScreenShotUploader(LLSD report, LLUUID assetId, LLAssetType::EType assetType); - virtual LLSD prepareUpload(); - virtual LLSD generatePostBody(); - virtual S32 getEconomyUploadCost(); - virtual LLUUID finishUpload(LLSD &result); + LLSD prepareUpload() override; + LLSD generatePostBody() override; + S32 getEconomyUploadCost() override; + LLUUID finishUpload(LLSD &result) override; - virtual bool showInventoryPanel() const { return false; } - virtual std::string getDisplayName() const { return "Abuse Report"; } + bool showInventoryPanel() const override { return false; } + std::string getDisplayName() const override { return "Abuse Report"; } private: @@ -299,7 +299,7 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) if (LLUUID::null != mObjectID) { // get object info for the user's benefit - LLViewerObject* objectp = NULL; + LLViewerObject* objectp = nullptr; objectp = gObjectList.findObject( mObjectID ); if (objectp) { diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index 646b70a67f9f9e22b6c8d4cc7b693c215e4079eb..93c6f3658127c54dea4396c71c634fcb8ea16c2e 100644 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -80,10 +80,10 @@ class LLFloaterReporter public: LLFloaterReporter(const LLSD& key); /*virtual*/ ~LLFloaterReporter(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); - virtual void draw(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void onClose(bool app_quitting) override; + void draw() override; void setReportType(EReportType type) { mReportType = type; } @@ -100,8 +100,8 @@ public: void onClickSelectAbuser (); static void closePickTool (void *userdata); static void uploadDoneCallback(const LLUUID &uuid, void* user_data, S32 result, LLExtStat ext_status); - static void addDescription(const std::string& description, LLMeanCollisionData *mcd = NULL); - static void setDescription(const std::string& description, LLMeanCollisionData *mcd = NULL); + static void addDescription(const std::string& description, LLMeanCollisionData *mcd = nullptr); + static void setDescription(const std::string& description, LLMeanCollisionData *mcd = nullptr); void setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id); diff --git a/indra/newview/llfloatersceneloadstats.h b/indra/newview/llfloatersceneloadstats.h index aa414bf5448165447226d7318f5cfa22184fd829..2399e2581855131ecf18986beaa4e321e2a69f22 100644 --- a/indra/newview/llfloatersceneloadstats.h +++ b/indra/newview/llfloatersceneloadstats.h @@ -36,7 +36,7 @@ private: LLFloaterSceneLoadStats(const LLSD& key); public: - BOOL postBuild(); + BOOL postBuild() override; }; diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp index 73560c1b394094d35b6183f3ac6e67bc50224e5c..b23f0f2f14a60c89d0b6039b90fb0a1ddccb9bb0 100644 --- a/indra/newview/llfloaterscriptdebug.cpp +++ b/indra/newview/llfloaterscriptdebug.cpp @@ -89,7 +89,7 @@ void LLFloaterScriptDebug::setVisible(BOOL visible) if(visible) { LLFloaterScriptDebugOutput* floater_output = LLFloaterReg::findTypedInstance<LLFloaterScriptDebugOutput>("script_debug_output", LLUUID::null); - if (floater_output == NULL) + if (floater_output == nullptr) { floater_output = dynamic_cast<LLFloaterScriptDebugOutput*>(LLFloaterReg::showInstance("script_debug_output", LLUUID::null, FALSE)); if (floater_output) @@ -118,12 +118,12 @@ LLFloater* LLFloaterScriptDebug::addOutputWindow(const LLUUID &object_id) { LLMultiFloater* host = LLFloaterReg::showTypedInstance<LLMultiFloater>("script_debug", LLSD()); if (!host) - return NULL; + return nullptr; LLFloater::setFloaterHost(host); // prevent stealing focus, see EXT-8040 LLFloater* floaterp = LLFloaterReg::showInstance("script_debug_output", object_id, FALSE); - LLFloater::setFloaterHost(NULL); + LLFloater::setFloaterHost(nullptr); return floaterp; } diff --git a/indra/newview/llfloaterscriptdebug.h b/indra/newview/llfloaterscriptdebug.h index 8c08b234f39b4fcfb3277e4c74689b1bf59958b8..a57d2f69580df3d592a769b9b1f2c2d068309cc5 100644 --- a/indra/newview/llfloaterscriptdebug.h +++ b/indra/newview/llfloaterscriptdebug.h @@ -37,11 +37,11 @@ class LLFloaterScriptDebug : public LLMultiFloater public: LLFloaterScriptDebug(const LLSD& key); virtual ~LLFloaterScriptDebug(); - virtual BOOL postBuild(); - virtual void setVisible(BOOL visible); + BOOL postBuild() override; + void setVisible(BOOL visible) override; static void show(const LLUUID& object_id); - /*virtual*/ void closeFloater(bool app_quitting = false); + /*virtual*/ void closeFloater(bool app_quitting = false) override; static void addScriptLine(const std::string &utf8mesg, const std::string &user_name, const LLColor4& color, const LLUUID& source_id); protected: @@ -59,7 +59,7 @@ public: void addLine(const std::string &utf8mesg, const std::string &user_name, const LLColor4& color); - virtual BOOL postBuild(); + BOOL postBuild() override; protected: LLTextEditor* mHistoryEditor; diff --git a/indra/newview/llfloaterscriptedprefs.cpp b/indra/newview/llfloaterscriptedprefs.cpp index 8e24cb25b3060fa3487c5e089c2c0859272cf4f8..5ef6e8793de70bcf42c95c3a0d0d01e9bddb7521 100644 --- a/indra/newview/llfloaterscriptedprefs.cpp +++ b/indra/newview/llfloaterscriptedprefs.cpp @@ -36,7 +36,7 @@ LLFloaterScriptEdPrefs::LLFloaterScriptEdPrefs(const LLSD& key) : LLFloater(key) -, mEditor(NULL) +, mEditor(nullptr) { mCommitCallbackRegistrar.add("ScriptPref.applyUIColor", boost::bind(&LLFloaterScriptEdPrefs::applyUIColor, this ,_1, _2)); mCommitCallbackRegistrar.add("ScriptPref.getUIColor", boost::bind(&LLFloaterScriptEdPrefs::getUIColor, this ,_1, _2)); diff --git a/indra/newview/llfloaterscriptedprefs.h b/indra/newview/llfloaterscriptedprefs.h index 31df897aac71bbc466a0fc0592e320f36b3dc42c..5cd8008fe442803d70169ccffef5eca8b56f6bf7 100644 --- a/indra/newview/llfloaterscriptedprefs.h +++ b/indra/newview/llfloaterscriptedprefs.h @@ -37,7 +37,7 @@ class LLFloaterScriptEdPrefs : public LLFloater { public: LLFloaterScriptEdPrefs(const LLSD& key); - BOOL postBuild(); + BOOL postBuild() override; private: ~LLFloaterScriptEdPrefs() {}; diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index b61d7daabf2141a4b2f8e5f4f6957f7b5b35b378..67c8d9de86afa367d96259fd760ae27229767711 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -959,7 +959,7 @@ void LLPanelScriptLimitsRegionMemory::returnObjects() } } - onClickRefresh(NULL); + onClickRefresh(nullptr); } diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h index 01d71f9e03a66349ec0a9664cb71768f8321a7c4..06a363a83292972afba4e24941ff558f2713d20b 100644 --- a/indra/newview/llfloaterscriptlimits.h +++ b/indra/newview/llfloaterscriptlimits.h @@ -46,10 +46,10 @@ class LLFloaterScriptLimits : public LLFloater friend class LLFloaterReg; public: - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; // from LLPanel - virtual void refresh(); + void refresh() override; private: @@ -69,8 +69,8 @@ class LLPanelScriptLimitsInfo : public LLPanel { public: LLPanelScriptLimitsInfo(); - - virtual BOOL postBuild(); + + BOOL postBuild() override; virtual void updateChild(LLUICtrl* child_ctrl); protected: @@ -101,7 +101,7 @@ public: ~LLPanelScriptLimitsRegionMemory(); // LLPanel - virtual BOOL postBuild(); + BOOL postBuild() override; void setRegionDetails(LLSD content); void setRegionSummary(LLSD content); @@ -142,9 +142,9 @@ private: protected: // LLRemoteParcelInfoObserver interface: -/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); -/*virtual*/ void setParcelID(const LLUUID& parcel_id); -/*virtual*/ void setErrorStatus(S32 status, const std::string& reason); +/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data) override; +/*virtual*/ void setParcelID(const LLUUID& parcel_id) override; +/*virtual*/ void setErrorStatus(S32 status, const std::string& reason) override; static void onClickRefresh(void* userdata); static void onClickHighlight(void* userdata); @@ -174,7 +174,7 @@ public: }; // LLPanel - virtual BOOL postBuild(); + BOOL postBuild() override; void setAttachmentDetails(LLSD content); diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 96c6ba28c99c742aac0dd68878c60a426f6aaeb3..8bfac3d7cc698928f331b996c09ea3a260065d0c 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -50,7 +50,7 @@ class LLSearchHandler : public LLCommandHandler public: // requires trusted browser to trigger LLSearchHandler() : LLCommandHandler("search", UNTRUSTED_THROTTLE) { } - bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) override { if (!LLUI::sSettingGroups["config"]->getBOOL("EnableSearch")) { diff --git a/indra/newview/llfloatersearch.h b/indra/newview/llfloatersearch.h index 1fb557a2d54638e536cb44a43cfe478eef38aca1..475e964a9800880444f128b08f2840212c0a071a 100644 --- a/indra/newview/llfloatersearch.h +++ b/indra/newview/llfloatersearch.h @@ -63,9 +63,9 @@ public: /// show the search floater with a new search /// see search() for details on the key parameter. - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onClose(bool app_quitting) override; /// perform a search with the specific search term. /// The key should be a map that can contain the following keys: @@ -80,7 +80,7 @@ public: void godLevelChanged(U8 godlevel); private: - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; LLSD mCategoryPaths; U8 mSearchGodLevel; diff --git a/indra/newview/llfloatersearchreplace.cpp b/indra/newview/llfloatersearchreplace.cpp index 4d46e743842bb1882b2b5d3991a0506738cb7635..fe7285db25bc1feaf1eb807c05a7e368ddba943c 100644 --- a/indra/newview/llfloatersearchreplace.cpp +++ b/indra/newview/llfloatersearchreplace.cpp @@ -25,7 +25,7 @@ #include "lltexteditor.h" LLFloaterSearchReplace::LLFloaterSearchReplace(const LLSD& sdKey) - : LLFloater(sdKey), mEditor(NULL) + : LLFloater(sdKey), mEditor(nullptr) { } @@ -43,7 +43,7 @@ void LLFloaterSearchReplace::show(LLTextEditor* pEditor) pSelf->mEditor = pEditor; if (pEditor) { - LLFloater *pDependeeNew = NULL, *pDependeeOld = pSelf->getDependee(); + LLFloater *pDependeeNew = nullptr, *pDependeeOld = pSelf->getDependee(); LLView* pView = pEditor->getParent(); while (pView) { diff --git a/indra/newview/llfloatersearchreplace.h b/indra/newview/llfloatersearchreplace.h index 268166acaea4ae0164d17c5d36b6ebb17da28ae7..21feade0efe5a81d3a5fad94038312bd2506b518 100644 --- a/indra/newview/llfloatersearchreplace.h +++ b/indra/newview/llfloatersearchreplace.h @@ -28,9 +28,9 @@ public: LLFloaterSearchReplace(const LLSD& sdKey); ~LLFloaterSearchReplace(); - /*virtual*/ bool hasAccelerators() const; - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); - /*virtual*/ BOOL postBuild(); + /*virtual*/ bool hasAccelerators() const override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask) override; + /*virtual*/ BOOL postBuild() override; public: LLTextEditor* getEditor() { return mEditor; } diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index 276cfa85c072392bee868aa61a40bfb3bc1d8c3b..b49f4f23c362d17f40b9b3aff158c6157e0fbae3 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -47,7 +47,7 @@ class LLAvatarName; // defined in llfloaterland.cpp void send_parcel_select_objects(S32 parcel_local_id, U32 return_type, - uuid_list_t* return_ids = NULL); + uuid_list_t* return_ids = nullptr); enum Badge { BADGE_OK, BADGE_NOTE, BADGE_WARN, BADGE_ERROR }; @@ -57,14 +57,14 @@ class LLFloaterSellLandUI public: LLFloaterSellLandUI(const LLSD& key); virtual ~LLFloaterSellLandUI(); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onClose(bool app_quitting) override; private: class SelectionObserver : public LLParcelObserver { public: SelectionObserver(LLFloaterSellLandUI* floater) : mFloater(floater) {} - virtual void changed(); + void changed() override; private: LLFloaterSellLandUI* mFloater; }; @@ -99,7 +99,7 @@ private: void onBuyerNameCache(const LLAvatarName& av_name); public: - virtual BOOL postBuild(); + BOOL postBuild() override; bool setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel); static bool callbackHighlightTransferable(const LLSD& notification, const LLSD& response); @@ -129,8 +129,8 @@ LLFloater* LLFloaterSellLand::buildFloater(const LLSD& key) #endif LLFloaterSellLandUI::LLFloaterSellLandUI(const LLSD& key) : LLFloater(key), + mRegion(nullptr), mParcelSelectionObserver(this), - mRegion(0), mAvatarNameCacheConnection() { LLViewerParcelMgr::getInstance()->addObserver(&mParcelSelectionObserver); @@ -149,7 +149,7 @@ LLFloaterSellLandUI::~LLFloaterSellLandUI() void LLFloaterSellLandUI::onClose(bool app_quitting) { // Must release parcel selection to allow land to deselect, see EXT-803 - mParcelSelection = NULL; + mParcelSelection = nullptr; } void LLFloaterSellLandUI::SelectionObserver::changed() diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index c2e9cddd4cc8004f44b09ca562b17e67d43bd241..0c1d39115957def24f7cc24f5dabb90edff25045 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -64,7 +64,8 @@ BOOL LLFloaterSettingsDebug::postBuild() { LLComboBox* combo; f(LLComboBox* c) : combo(c) {} - virtual void apply(const std::string& name, LLControlVariable* control) + + void apply(const std::string& name, LLControlVariable* control) override { if (!control->isHiddenFromSettingsEditor()) { diff --git a/indra/newview/llfloatersettingsdebug.h b/indra/newview/llfloatersettingsdebug.h index 6a7ff8c8191e996e9b237782e75e58261f544302..57f58bad324c91b40ab87b0507167ef71942342c 100644 --- a/indra/newview/llfloatersettingsdebug.h +++ b/indra/newview/llfloatersettingsdebug.h @@ -43,8 +43,8 @@ class LLFloaterSettingsDebug public: - virtual BOOL postBuild(); - virtual void draw(); + BOOL postBuild() override; + void draw() override; void updateControl(LLControlVariable* control); diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 8ec0e87ffc34217067e31cd65b49d88d1877d754..45f92c330e2c09ef0a401481488aae0d616d359c 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -92,14 +92,14 @@ void LLFloaterSidePanelContainer::closeFloater(bool app_quitting) LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) { LLView* view = findChildView(panel_name, true); - if (!view) return NULL; + if (!view) return nullptr; if (!getVisible()) { openFloater(); } - LLPanel* panel = NULL; + LLPanel* panel = nullptr; LLSideTrayPanelContainer* container = dynamic_cast<LLSideTrayPanelContainer*>(view->getParent()); if (container) @@ -107,7 +107,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na container->openPanel(panel_name, params); panel = container->getCurrentPanel(); } - else if ((panel = dynamic_cast<LLPanel*>(view)) != NULL) + else if ((panel = dynamic_cast<LLPanel*>(view)) != nullptr) { panel->onOpen(params); } @@ -142,5 +142,5 @@ LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name, return floaterp->findChild<LLPanel>(panel_name, true); } - return NULL; + return nullptr; } diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 635514e26ca48292617703879a3da5275a786c62..5eb6a757ca7594f09050992f845735fcfa62e11d 100644 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -49,9 +49,9 @@ public: LLFloaterSidePanelContainer(const LLSD& key, const Params& params = getDefaultParams()); ~LLFloaterSidePanelContainer(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; - /*virtual*/ void closeFloater(bool app_quitting = false); + /*virtual*/ void closeFloater(bool app_quitting = false) override; void cleanup() { destroy(); } diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index 1f303ea4d6532d34193e8afaf7fce11ca7563628..51fa4f8df8e9f862d9239999b19a17ecf55fd140 100644 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -44,9 +44,9 @@ public: LLFloaterSnapshotBase(const LLSD& key); virtual ~LLFloaterSnapshotBase(); - /*virtual*/ void draw(); - /*virtual*/ void onClose(bool app_quitting); - virtual S32 notify(const LLSD& info); + /*virtual*/ void draw() override; + /*virtual*/ void onClose(bool app_quitting) override; + S32 notify(const LLSD& info) override; // TODO: create a snapshot model instead virtual void saveTexture() = 0; @@ -83,12 +83,12 @@ public: STATUS_FINISHED } EStatus; - ImplBase(LLFloaterSnapshotBase* floater) : mAvatarPauseHandles(), - mLastToolset(NULL), + ImplBase(LLFloaterSnapshotBase* floater) : mFloater(floater), + mAvatarPauseHandles(), + mLastToolset(nullptr), mAspectRatioCheckOff(false), mNeedRefresh(false), - mStatus(STATUS_READY), - mFloater(floater) + mStatus(STATUS_READY) {} virtual ~ImplBase() { @@ -145,9 +145,9 @@ public: LLFloaterSnapshot(const LLSD& key); /*virtual*/ ~LLFloaterSnapshot(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ S32 notify(const LLSD& info); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ S32 notify(const LLSD& info) override; static void update(); @@ -155,7 +155,7 @@ public: static LLFloaterSnapshot* getInstance(); static LLFloaterSnapshot* findInstance(); - /*virtual*/ void saveTexture(); + /*virtual*/ void saveTexture() override; BOOL saveLocal(); static void setAgentEmail(const std::string& email); @@ -189,22 +189,22 @@ public: void updateSpinners(LLFloaterSnapshotBase* view, LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL is_width_changed); static void onSnapshotUploadFinished(LLFloaterSnapshotBase* floater, bool status); - /*virtual*/ LLPanelSnapshot* getActivePanel(LLFloaterSnapshotBase* floater, bool ok_if_not_found = true); - /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat(LLFloaterSnapshotBase* floater); + /*virtual*/ LLPanelSnapshot* getActivePanel(LLFloaterSnapshotBase* floater, bool ok_if_not_found = true) override; + /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat(LLFloaterSnapshotBase* floater) override; LLSpinCtrl* getWidthSpinner(LLFloaterSnapshotBase* floater); LLSpinCtrl* getHeightSpinner(LLFloaterSnapshotBase* floater); void enableAspectRatioCheckbox(LLFloaterSnapshotBase* floater, BOOL enable); void setAspectRatioCheckboxValue(LLFloaterSnapshotBase* floater, BOOL checked); - /*virtual*/ std::string getSnapshotPanelPrefix(); + /*virtual*/ std::string getSnapshotPanelPrefix() override; void setResolution(LLFloaterSnapshotBase* floater, const std::string& comboname); - /*virtual*/ void updateControls(LLFloaterSnapshotBase* floater); + /*virtual*/ void updateControls(LLFloaterSnapshotBase* floater) override; private: - /*virtual*/ LLSnapshotModel::ESnapshotLayerType getLayerType(LLFloaterSnapshotBase* floater); + /*virtual*/ LLSnapshotModel::ESnapshotLayerType getLayerType(LLFloaterSnapshotBase* floater) override; void comboSetCustom(LLFloaterSnapshotBase *floater, const std::string& comboname); void checkAspectRatio(LLFloaterSnapshotBase *view, S32 index); - void setFinished(bool finished, bool ok = true, const std::string& msg = LLStringUtil::null); + void setFinished(bool finished, bool ok = true, const std::string& msg = LLStringUtil::null) override; }; class LLSnapshotFloaterView : public LLFloaterView @@ -222,10 +222,10 @@ protected: public: virtual ~LLSnapshotFloaterView(); - /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent) override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; }; extern LLSnapshotFloaterView* gSnapshotFloaterView; diff --git a/indra/newview/llfloatersounddevices.cpp b/indra/newview/llfloatersounddevices.cpp index 8621f49cd26a0f739436ff46bfdd7e94c69ef571..de650cd29eaaa806fe7947548969815bf40754c0 100644 --- a/indra/newview/llfloatersounddevices.cpp +++ b/indra/newview/llfloatersounddevices.cpp @@ -39,7 +39,7 @@ // protected LLFloaterSoundDevices::LLFloaterSoundDevices(const LLSD& key) -: LLTransientDockableFloater(NULL, false, key) +: LLTransientDockableFloater(nullptr, false, key) { LLTransientFloaterMgr::getInstance()->addControlView(this); diff --git a/indra/newview/llfloatersounddevices.h b/indra/newview/llfloatersounddevices.h index f09ee3b06931004e36bf25ed4f6236c301190a07..fddad90b3081977b9dbc8a9e9d61ce8720225ee0 100644 --- a/indra/newview/llfloatersounddevices.h +++ b/indra/newview/llfloatersounddevices.h @@ -39,9 +39,9 @@ public: LLFloaterSoundDevices(const LLSD& key); ~LLFloaterSoundDevices(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); - /*virtual*/ void setFocus( BOOL b ); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true) override; + /*virtual*/ void setFocus( BOOL b ) override; }; diff --git a/indra/newview/llfloaterspellchecksettings.cpp b/indra/newview/llfloaterspellchecksettings.cpp index f5cee509baf644a4837509f2950fc8b550f70443..ce59d00d09d5dcbe7b8606db5c65977028d90855 100644 --- a/indra/newview/llfloaterspellchecksettings.cpp +++ b/indra/newview/llfloaterspellchecksettings.cpp @@ -397,7 +397,7 @@ std::string LLFloaterSpellCheckerImport::parseXcuFile(const std::string& file_pa } // Bury down to the "Dictionaries" parent node - LLXMLNode* dict_node = NULL; + LLXMLNode* dict_node = nullptr; for (LLXMLNode* outer_node = xml_root->getFirstChild(); outer_node && !dict_node; outer_node = outer_node->getNextSibling()) { std::string temp; diff --git a/indra/newview/llfloaterspellchecksettings.h b/indra/newview/llfloaterspellchecksettings.h index de59d83f24243b1d1bd86b695248353a0c299b8c..625d7989a248420f2b1de9fae19494381d341936 100644 --- a/indra/newview/llfloaterspellchecksettings.h +++ b/indra/newview/llfloaterspellchecksettings.h @@ -34,10 +34,10 @@ class LLFloaterSpellCheckerSettings : public LLFloater public: LLFloaterSpellCheckerSettings(const LLSD& key); - /*virtual*/ void draw(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void draw() override; + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void onClose(bool app_quitting) override; protected: void onBtnImport(); @@ -52,7 +52,7 @@ class LLFloaterSpellCheckerImport : public LLFloater public: LLFloaterSpellCheckerImport(const LLSD& key); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; protected: void onBtnBrowse(); diff --git a/indra/newview/llfloatertelehub.cpp b/indra/newview/llfloatertelehub.cpp index 0e626d266bd45594ecd6f68e55a6330464e723c0..326e2bf581e2b2f3ffceed6c6355592a3da46372 100644 --- a/indra/newview/llfloatertelehub.cpp +++ b/indra/newview/llfloatertelehub.cpp @@ -86,7 +86,7 @@ void LLFloaterTelehub::onOpen(const LLSD& key) LLFloaterTelehub::~LLFloaterTelehub() { // no longer interested in this message - gMessageSystem->setHandlerFunc("TelehubInfo", NULL); + gMessageSystem->setHandlerFunc("TelehubInfo", nullptr); } void LLFloaterTelehub::draw() @@ -104,7 +104,7 @@ void LLFloaterTelehub::refresh() const BOOL children_ok = TRUE; LLViewerObject* object = mObjectSelection->getFirstRootObject(children_ok); - BOOL have_selection = (object != NULL); + BOOL have_selection = (object != nullptr); BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); getChildView("connect_btn")->setEnabled(have_selection && all_volume); @@ -117,7 +117,7 @@ void LLFloaterTelehub::refresh() LLScrollListCtrl* list = getChild<LLScrollListCtrl>("spawn_points_list"); if (list) { - BOOL enable_remove = (list->getFirstSelected() != NULL); + BOOL enable_remove = (list->getFirstSelected() != nullptr); getChildView("remove_spawn_point_btn")->setEnabled(enable_remove); } } diff --git a/indra/newview/llfloatertelehub.h b/indra/newview/llfloatertelehub.h index 9b9b11fb296ef96ecf135a9383f7a75dafebcf58..864b6dce098554f9b8370741f3e435aa2ee3b8e5 100644 --- a/indra/newview/llfloatertelehub.h +++ b/indra/newview/llfloatertelehub.h @@ -41,15 +41,15 @@ public: LLFloaterTelehub(const LLSD& key); ~LLFloaterTelehub(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; - /*virtual*/ void draw(); + /*virtual*/ void draw() override; static BOOL renderBeacons(); static void addBeacons(); - void refresh(); + void refresh() override; void sendTelehubInfoRequest(); void onClickConnect(); diff --git a/indra/newview/llfloatertestinspectors.h b/indra/newview/llfloatertestinspectors.h index 1724a2e076eeec99b2d9592b18375f78cb7bdafd..7793b954f443f267e30fdacda5620500e65a5b6b 100644 --- a/indra/newview/llfloatertestinspectors.h +++ b/indra/newview/llfloatertestinspectors.h @@ -40,7 +40,7 @@ private: LLFloaterTestInspectors(const LLSD& seed); ~LLFloaterTestInspectors(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; // Button callback to show void showAvatarInspector(LLUICtrl*, const LLSD& avatar_id); diff --git a/indra/newview/llfloatertexturefetchdebugger.cpp b/indra/newview/llfloatertexturefetchdebugger.cpp index de5dce82f2ec867cbd5232b4f5ae87d83e44cb91..1364e7f8ab1810f7441f363bb348ba3882e98abf 100644 --- a/indra/newview/llfloatertexturefetchdebugger.cpp +++ b/indra/newview/llfloatertexturefetchdebugger.cpp @@ -41,7 +41,7 @@ LLFloaterTextureFetchDebugger::LLFloaterTextureFetchDebugger(const LLSD& key) : LLFloater(key), - mDebugger(NULL) + mDebugger(nullptr) { setTitle("Texture Fetching Debugger Floater"); diff --git a/indra/newview/llfloatertexturefetchdebugger.h b/indra/newview/llfloatertexturefetchdebugger.h index 096ad88e07e5c1520f5fd28e5b1e5526937806ee..8ab85f11f0a4e34b5a0399e2c0d096594bb033f7 100644 --- a/indra/newview/llfloatertexturefetchdebugger.h +++ b/indra/newview/llfloatertexturefetchdebugger.h @@ -36,8 +36,8 @@ class LLFloaterTextureFetchDebugger : public LLFloater public: /// initialize all the callbacks for the menu - virtual BOOL postBuild() ; - virtual void draw() ; + BOOL postBuild() override; + void draw() override; void onChangeTexelPixelRatio(); diff --git a/indra/newview/llfloatertexturezoom.h b/indra/newview/llfloatertexturezoom.h index b00fa668eb89a57f36d9d0fc35476ed23300db0f..6e0120022e438db97e06106dd374026c0054f663 100644 --- a/indra/newview/llfloatertexturezoom.h +++ b/indra/newview/llfloatertexturezoom.h @@ -31,15 +31,15 @@ class LLFloaterTextureZoom : public LLPreview public: LLFloaterTextureZoom(const LLSD& key); - /* virtual */ BOOL postBuild(); - /* virtual */ void draw(); - /* virtual */ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /* virtual */ BOOL postBuild() override; + /* virtual */ void draw() override; + /* virtual */ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; - /* virtual */ void loadAsset(); - /* virtual */ EAssetStatus getAssetStatus(); - /* virtual */ void setObjectID(const LLUUID& object_id); - /* virtual */ BOOL handleKeyHere(KEY key, MASK mask); - /* virtual */ void onFocusLost(); + /* virtual */ void loadAsset() override; + /* virtual */ EAssetStatus getAssetStatus() override; + /* virtual */ void setObjectID(const LLUUID& object_id) override; + /* virtual */ BOOL handleKeyHere(KEY key, MASK mask) override; + /* virtual */ void onFocusLost() override; private: ~LLFloaterTextureZoom(); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 8c8bd9e23aded0e2014642e23bce343c11f75f3f..47f12fc3fec0a92dc343f0543bb3a92c1df82dc2 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -95,7 +95,7 @@ #include "qtoolalign.h" // <alchemy/> // Globals -LLFloaterTools *gFloaterTools = NULL; +LLFloaterTools *gFloaterTools = nullptr; bool LLFloaterTools::sShowObjectCost = true; bool LLFloaterTools::sPreviousFocusOnAvatar = false; @@ -133,7 +133,7 @@ void commit_slider_zoom(LLUICtrl *ctrl); class LLLandImpactsObserver : public LLParcelObserver { public: - virtual void changed() + void changed() override { LLFloaterTools* tools_floater = LLFloaterReg::getTypedInstance<LLFloaterTools>("build"); if(tools_floater) @@ -329,72 +329,72 @@ BOOL LLFloaterTools::postBuild() // during LLViewerWindow's per-frame hover processing. LLFloaterTools::LLFloaterTools(const LLSD& key) : LLFloater(key), - mAlchEditRootAxis(NULL), - mBtnFocus(NULL), - mBtnMove(NULL), - mBtnEdit(NULL), - mBtnCreate(NULL), - mBtnLand(NULL), - mTextStatus(NULL), - - mRadioGroupFocus(NULL), - mRadioGroupMove(NULL), - mRadioGroupEdit(NULL), - + mAlchEditRootAxis(nullptr), + mBtnFocus(nullptr), + mBtnMove(nullptr), + mBtnEdit(nullptr), + mBtnCreate(nullptr), + mBtnLand(nullptr), + mTextStatus(nullptr), + + mRadioGroupFocus(nullptr), mZoomSlider(nullptr), + mRadioGroupMove(nullptr), - mCheckSelectIndividual(NULL), + mRadioGroupEdit(nullptr), - mCheckSnapToGrid(NULL), - mBtnGridOptions(NULL), - mTitleMedia(NULL), - mComboGridMode(NULL), - mCheckStretchUniform(NULL), - mCheckStretchTexture(NULL), + mCheckSelectIndividual(nullptr), - mBtnRotateLeft(NULL), - mBtnRotateReset(NULL), - mBtnRotateRight(NULL), + mBtnLink(nullptr), + mBtnUnlink(nullptr), + mCheckSnapToGrid(nullptr), + mBtnGridOptions(nullptr), + mComboGridMode(nullptr), + mCheckStretchUniform(nullptr), - mBtnLink(NULL), - mBtnUnlink(NULL), + mCheckStretchTexture(nullptr), + mBtnRotateLeft(nullptr), + mBtnRotateReset(nullptr), - mBtnDelete(NULL), - mBtnDuplicate(NULL), - mBtnDuplicateInPlace(NULL), + mBtnRotateRight(nullptr), + mBtnDelete(nullptr), + mBtnDuplicate(nullptr), + mBtnDuplicateInPlace(nullptr), mTreeGrassCombo(nullptr), - mCheckSticky(NULL), - mCheckCopySelection(NULL), - mCheckCopyCenters(NULL), - mCheckCopyRotates(NULL), - mRadioGroupLand(NULL), - mSliderDozerSize(NULL), - mSliderDozerForce(NULL), + mCheckSticky(nullptr), + + mCheckCopySelection(nullptr), + mCheckCopyCenters(nullptr), + mCheckCopyRotates(nullptr), + mRadioGroupLand(nullptr), + mSliderDozerSize(nullptr), + mSliderDozerForce(nullptr), mTextDozer(nullptr), mTextDozerSize(nullptr), mTextDozerStrength(nullptr), - mBtnApplyToSelection(NULL), - - mTab(NULL), - mPanelPermissions(NULL), - mPanelObject(NULL), - mPanelVolume(NULL), - mPanelContents(NULL), - mPanelFace(NULL), - mPanelLandInfo(NULL), - + mBtnApplyToSelection(nullptr), + mTab(nullptr), + + mPanelPermissions(nullptr), + mPanelObject(nullptr), + mPanelVolume(nullptr), + mPanelContents(nullptr), + mPanelFace(nullptr), + mPanelLandInfo(nullptr), mTextRemainingCapacity(nullptr), + mTextSelectionCount(nullptr), mTextSelectionEmpty(nullptr), - mCostTextBorder(NULL), - mTabLand(NULL), + mCostTextBorder(nullptr), + mTabLand(nullptr), + mLandImpactsObserver(nullptr), - mLandImpactsObserver(NULL), + mTitleMedia(nullptr), - mDirty(TRUE), - mNeedMediaTitle(TRUE) + mNeedMediaTitle(TRUE), + mDirty(TRUE) { gFloaterTools = this; @@ -436,7 +436,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) LLFloaterTools::~LLFloaterTools() { // children automatically deleted - gFloaterTools = NULL; + gFloaterTools = nullptr; LLViewerParcelMgr::getInstance()->removeObserver(mLandImpactsObserver); delete mLandImpactsObserver; @@ -905,8 +905,8 @@ void LLFloaterTools::onClose(bool app_quitting) resetToolState(); - mParcelSelection = NULL; - mObjectSelection = NULL; + mParcelSelection = nullptr; + mObjectSelection = nullptr; // Switch back to basic toolset LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); @@ -1069,7 +1069,7 @@ void commit_select_component(void *data) //forfeit focus if (gFocusMgr.childHasKeyboardFocus(floaterp)) { - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } BOOL select_individuals = floaterp->mCheckSelectIndividual->get(); @@ -1092,7 +1092,7 @@ void LLFloaterTools::setObjectType( LLPCode pcode ) LLToolPlacer::setObjectType( pcode ); gSavedSettings.setBOOL("CreateToolCopySelection", FALSE); gFloaterTools->buildTreeGrassCombo(); - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); } void commit_grid_mode(LLUICtrl *ctrl) @@ -1275,7 +1275,7 @@ void LLFloaterTools::getMediaState() { LLSelectNode* node = *iter; LLVOVolume* object = dynamic_cast<LLVOVolume*>(node->getObject()); - if (NULL != object) + if (nullptr != object) { if (!object->permModify()) { @@ -1307,7 +1307,7 @@ void LLFloaterTools::getMediaState() bool bool_has_media = false; struct media_functor : public LLSelectedTEGetFunctor<bool> { - bool get(LLViewerObject* object, S32 face) + bool get(LLViewerObject* object, S32 face) override { LLTextureEntry *te = object->getTE(face); if (te) @@ -1328,7 +1328,7 @@ void LLFloaterTools::getMediaState() { functor_getter_media_data(const LLMediaEntry& entry): mMediaEntry(entry) {} - LLMediaEntry get( LLViewerObject* object, S32 face ) + LLMediaEntry get( LLViewerObject* object, S32 face ) override { if ( object && object->getTE(face) && object->getTE(face)->getMediaData() ) return *(object->getTE(face)->getMediaData()); @@ -1562,7 +1562,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_controls(const LLMediaEntry &entry) : mMediaEntry(entry) {} - U8 get( LLViewerObject* object, S32 face ) + U8 get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1585,7 +1585,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_first_click(const LLMediaEntry& entry): mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) + bool get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1608,7 +1608,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_home_url(const LLMediaEntry& entry): mMediaEntry(entry) {} - std::string get( LLViewerObject* object, S32 face ) + std::string get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1631,8 +1631,8 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_current_url(const LLMediaEntry& entry): mMediaEntry(entry) {} - std::string get( LLViewerObject* object, S32 face ) - { + std::string get( LLViewerObject* object, S32 face ) override + { if ( object ) if ( object->getTE(face) ) if ( object->getTE(face)->getMediaData() ) @@ -1655,7 +1655,7 @@ void LLFloaterTools::updateMediaSettings() functor_getter_auto_zoom(const LLMediaEntry& entry) : mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) + bool get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1680,7 +1680,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_auto_play(const LLMediaEntry& entry) : mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) + bool get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1707,7 +1707,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_auto_scale(const LLMediaEntry& entry): mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) + bool get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1731,7 +1731,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_auto_loop(const LLMediaEntry& entry) : mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) + bool get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1754,7 +1754,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_width_pixels(const LLMediaEntry& entry): mMediaEntry(entry) {} - int get( LLViewerObject* object, S32 face ) + int get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1777,8 +1777,8 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_height_pixels(const LLMediaEntry& entry) : mMediaEntry(entry) {} - int get( LLViewerObject* object, S32 face ) - { + int get( LLViewerObject* object, S32 face ) override + { if ( object ) if ( object->getTE(face) ) if ( object->getTE(face)->getMediaData() ) @@ -1800,8 +1800,8 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_enable_alt_image(const LLMediaEntry& entry): mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) - { + bool get( LLViewerObject* object, S32 face ) override + { if ( object ) if ( object->getTE(face) ) if ( object->getTE(face)->getMediaData() ) @@ -1823,8 +1823,8 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_perms_owner_interact(const LLMediaEntry& entry): mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) - { + bool get( LLViewerObject* object, S32 face ) override + { if ( object ) if ( object->getTE(face) ) if ( object->getTE(face)->getMediaData() ) @@ -1846,7 +1846,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_perms_owner_control(const LLMediaEntry& entry) : mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) + bool get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1869,7 +1869,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_perms_group_interact(const LLMediaEntry& entry): mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) + bool get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1892,7 +1892,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_perms_group_control(const LLMediaEntry& entry): mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) + bool get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1915,7 +1915,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_perms_anyone_interact(const LLMediaEntry& entry): mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) + bool get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1938,7 +1938,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_perms_anyone_control(const LLMediaEntry& entry) : mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) + bool get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1961,7 +1961,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_whitelist_enable(const LLMediaEntry& entry) : mMediaEntry(entry) {} - bool get( LLViewerObject* object, S32 face ) + bool get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) @@ -1984,7 +1984,7 @@ void LLFloaterTools::updateMediaSettings() { functor_getter_whitelist_urls(const LLMediaEntry& entry): mMediaEntry(entry) {} - std::vector<std::string> get( LLViewerObject* object, S32 face ) + std::vector<std::string> get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h index d4c79b9fe977d7a27012dff4816313a66f5be990..f16be61ba5962559f90b0804312ae77941f8dbcc 100644 --- a/indra/newview/llfloatertools.h +++ b/indra/newview/llfloatertools.h @@ -56,7 +56,7 @@ class LLFloaterTools : public LLFloater { public: - virtual BOOL postBuild(); + BOOL postBuild() override; static void* createPanelPermissions(void* vdata); static void* createPanelObject(void* vdata); static void* createPanelVolume(void* vdata); @@ -67,11 +67,11 @@ public: LLFloaterTools(const LLSD& key); virtual ~LLFloaterTools(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ BOOL canClose(); - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void draw(); - /*virtual*/ void onFocusReceived(); + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ BOOL canClose() override; + /*virtual*/ void onClose(bool app_quitting) override; + /*virtual*/ void draw() override; + /*virtual*/ void onFocusReceived() override; // call this once per frame to handle visibility, rect location, // button highlights, etc. @@ -112,7 +112,7 @@ public: LLPanelFace* getPanelFace() { return mPanelFace; } private: - void refresh(); + void refresh() override; void refreshMedia(); void getMediaState(); void updateMediaSettings(); diff --git a/indra/newview/llfloatertopobjects.h b/indra/newview/llfloatertopobjects.h index dbbe9ac52125ac743bb0338c8e1a14f7b867ff23..c7ccbbf6f0e0ba7e127ff3cc61a128a2514e91f2 100644 --- a/indra/newview/llfloatertopobjects.h +++ b/indra/newview/llfloatertopobjects.h @@ -61,7 +61,7 @@ public: void clearList(); void updateSelectionInfo(); - virtual BOOL postBuild(); + BOOL postBuild() override; void onRefresh(); diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index cd2fa3f5377f3d8e72ae884482e2de80f1793e4f..1e2268f4568ddc160196cda3c3e1d6caabc236ad 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -241,7 +241,7 @@ void LLFloaterTOS::testSiteIsAliveCoro(LLHandle<LLFloater> handle, std::string u LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = boost::make_shared<LLCore::HttpOptions>(); httpOpts->setWantHeaders(true); diff --git a/indra/newview/llfloatertos.h b/indra/newview/llfloatertos.h index 071747d0b516dd30972e834e5a3dd5a07373d914..616e25631382e003980587ab64b1b4f126734eb2 100644 --- a/indra/newview/llfloatertos.h +++ b/indra/newview/llfloatertos.h @@ -47,9 +47,9 @@ public: LLFloaterTOS(const LLSD& data); virtual ~LLFloaterTOS(); - BOOL postBuild(); - - virtual void draw(); + BOOL postBuild() override; + + void draw() override; static void updateAgree( LLUICtrl *, void* userdata ); static void onContinue( void* userdata ); @@ -58,7 +58,7 @@ public: void setSiteIsAlive( bool alive ); // inherited from LLViewerMediaObserver - /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; private: static void testSiteIsAliveCoro(LLHandle<LLFloater> handle, std::string url); diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp index c39fc5ecfc75a215f163389dc443c79a99f9617e..36c5d4de360d5bb27fb13aaf68f9bab41086dc8b 100644 --- a/indra/newview/llfloatertoybox.cpp +++ b/indra/newview/llfloatertoybox.cpp @@ -41,7 +41,7 @@ LLFloaterToybox::LLFloaterToybox(const LLSD& key) : LLFloater(key) - , mToolBar(NULL) + , mToolBar(nullptr) { mCommitCallbackRegistrar.add("Toybox.RestoreDefaults", boost::bind(&LLFloaterToybox::onBtnRestoreDefaults, this)); mCommitCallbackRegistrar.add("Toybox.ClearAll", boost::bind(&LLFloaterToybox::onBtnClearAll, this)); diff --git a/indra/newview/llfloatertoybox.h b/indra/newview/llfloatertoybox.h index 10aee0e6f54d0985d4fcc871952a348124a8fb01..7fa30066c794cb66324a66b821243e218bae3c32 100644 --- a/indra/newview/llfloatertoybox.h +++ b/indra/newview/llfloatertoybox.h @@ -41,13 +41,13 @@ public: virtual ~LLFloaterToybox(); // virtuals - BOOL postBuild(); - void draw(); + BOOL postBuild() override; + void draw() override; /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; protected: void onBtnClearAll(); diff --git a/indra/newview/llfloatertransactionlog.h b/indra/newview/llfloatertransactionlog.h index ff47afe01d79e2da5b1097392ca8ffffc1a50a63..77a321916ac6c05ddb7c3a1f205253b38061983e 100644 --- a/indra/newview/llfloatertransactionlog.h +++ b/indra/newview/llfloatertransactionlog.h @@ -40,7 +40,7 @@ class LLFloaterTransactionLog : public LLFloater { public: LLFloaterTransactionLog(const LLSD& key); - BOOL postBuild(); + BOOL postBuild() override; void addTransaction(const LLDate& date, const LLUUID& sender, S32 amount); private: diff --git a/indra/newview/llfloatertranslationsettings.cpp b/indra/newview/llfloatertranslationsettings.cpp index 93303ccdb0df1011ecff7547e99c18eeb1d90481..547cd46ec8431137e11119a2d04e7a56da50f493 100644 --- a/indra/newview/llfloatertranslationsettings.cpp +++ b/indra/newview/llfloatertranslationsettings.cpp @@ -46,14 +46,14 @@ LLFloaterTranslationSettings::LLFloaterTranslationSettings(const LLSD& key) : LLFloater(key) -, mMachineTranslationCB(NULL) -, mLanguageCombo(NULL) -, mTranslationServiceRadioGroup(NULL) -, mBingAPIKeyEditor(NULL) -, mGoogleAPIKeyEditor(NULL) -, mBingVerifyBtn(NULL) -, mGoogleVerifyBtn(NULL) -, mOKBtn(NULL) +, mMachineTranslationCB(nullptr) +, mLanguageCombo(nullptr) +, mBingAPIKeyEditor(nullptr) +, mGoogleAPIKeyEditor(nullptr) +, mTranslationServiceRadioGroup(nullptr) +, mBingVerifyBtn(nullptr) +, mGoogleVerifyBtn(nullptr) +, mOKBtn(nullptr) , mBingKeyVerified(false) , mGoogleKeyVerified(false) { @@ -79,9 +79,9 @@ BOOL LLFloaterTranslationSettings::postBuild() mGoogleVerifyBtn->setClickedCallback(boost::bind(&LLFloaterTranslationSettings::onBtnGoogleVerify, this)); mBingAPIKeyEditor->setFocusReceivedCallback(boost::bind(&LLFloaterTranslationSettings::onEditorFocused, this, _1)); - mBingAPIKeyEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onBingKeyEdited, this), NULL); + mBingAPIKeyEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onBingKeyEdited, this), nullptr); mGoogleAPIKeyEditor->setFocusReceivedCallback(boost::bind(&LLFloaterTranslationSettings::onEditorFocused, this, _1)); - mGoogleAPIKeyEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onGoogleKeyEdited, this), NULL); + mGoogleAPIKeyEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onGoogleKeyEdited, this), nullptr); center(); return TRUE; diff --git a/indra/newview/llfloatertranslationsettings.h b/indra/newview/llfloatertranslationsettings.h index 2a15eacdedafa50c8559f7442211ad929b2e4e48..72e1464bac478fab934d990ce35a73ed5acfb11b 100644 --- a/indra/newview/llfloatertranslationsettings.h +++ b/indra/newview/llfloatertranslationsettings.h @@ -39,12 +39,12 @@ class LLFloaterTranslationSettings : public LLFloater { public: LLFloaterTranslationSettings(const LLSD& key); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; void setBingVerified(bool ok, bool alert); void setGoogleVerified(bool ok, bool alert); - void onClose(bool app_quitting); + void onClose(bool app_quitting) override; private: std::string getSelectedService() const; diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp index f9a61f86395a3b483d33baef791be96f1df26744..362f49a7a3ede792ce6820c8309a7c2e6c8020d1 100644 --- a/indra/newview/llfloatertwitter.cpp +++ b/indra/newview/llfloatertwitter.cpp @@ -66,17 +66,17 @@ const std::string DEFAULT_PHOTO_LOCATION_URL = "http://maps.secondlife.com/"; LLTwitterPhotoPanel::LLTwitterPhotoPanel() : mResolutionComboBox(nullptr), mFilterComboBox(nullptr), -mRefreshBtn(NULL), -mWorkingLabel(NULL), -mThumbnailPlaceholder(NULL), -mStatusCounterLabel(NULL), -mStatusTextBox(NULL), -mLocationCheckbox(NULL), -mPhotoCheckbox(NULL), -mPostButton(NULL), +mRefreshBtn(nullptr), +mWorkingLabel(nullptr), +mThumbnailPlaceholder(nullptr), +mStatusCounterLabel(nullptr), +mStatusTextBox(nullptr), +mLocationCheckbox(nullptr), +mPhotoCheckbox(nullptr), +mPostButton(nullptr), mCancelButton(nullptr), -mBtnPreview(NULL), -mBigPreviewFloater(NULL) +mBtnPreview(nullptr), +mBigPreviewFloater(nullptr) { mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLTwitterPhotoPanel::onSend, this)); mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLTwitterPhotoPanel::onClickNewSnapshot, this)); @@ -543,11 +543,11 @@ LLUICtrl* LLTwitterPhotoPanel::getRefreshBtn() /////////////////////////// LLTwitterAccountPanel::LLTwitterAccountPanel() : -mAccountCaptionLabel(NULL), -mAccountNameLabel(NULL), -mPanelButtons(NULL), -mConnectButton(NULL), -mDisconnectButton(NULL) +mAccountCaptionLabel(nullptr), +mAccountNameLabel(nullptr), +mPanelButtons(nullptr), +mConnectButton(nullptr), +mDisconnectButton(nullptr) { mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLTwitterAccountPanel::onConnect, this)); mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLTwitterAccountPanel::onDisconnect, this)); @@ -701,10 +701,10 @@ void LLTwitterAccountPanel::onDisconnect() //////////////////////// LLFloaterTwitter::LLFloaterTwitter(const LLSD& key) : LLFloater(key), - mTwitterPhotoPanel(NULL), - mStatusErrorText(NULL), - mStatusLoadingText(NULL), - mStatusLoadingIndicator(NULL) + mTwitterPhotoPanel(nullptr), + mStatusErrorText(nullptr), + mStatusLoadingText(nullptr), + mStatusLoadingIndicator(nullptr) { mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterTwitter::onCancel, this)); } diff --git a/indra/newview/llfloatertwitter.h b/indra/newview/llfloatertwitter.h index cec50174fee2dd93d20dc675a5705dec3ab7c862..8a22a649113285e523555378d28716237f59cb14 100644 --- a/indra/newview/llfloatertwitter.h +++ b/indra/newview/llfloatertwitter.h @@ -42,17 +42,17 @@ public: LLTwitterPhotoPanel(); ~LLTwitterPhotoPanel(); - BOOL postBuild(); - void draw(); + BOOL postBuild() override; + void draw() override; LLSnapshotLivePreview* getPreviewView(); - void onVisibilityChange(BOOL new_visibility); + void onVisibilityChange(BOOL new_visibility) override; void onAddLocationToggled(); void onAddPhotoToggled(); void onClickBigPreview(); void onClickNewSnapshot(); void onSend(); - S32 notify(const LLSD& info); + S32 notify(const LLSD& info) override; bool onTwitterConnectStateChange(const LLSD& data); void sendPhoto(); @@ -92,11 +92,11 @@ class LLTwitterAccountPanel : public LLPanel { public: LLTwitterAccountPanel(); - BOOL postBuild(); - void draw(); + BOOL postBuild() override; + void draw() override; private: - void onVisibilityChange(BOOL new_visibility); + void onVisibilityChange(BOOL new_visibility) override; bool onTwitterConnectStateChange(const LLSD& data); bool onTwitterConnectInfoChange(); void onConnect(); @@ -120,9 +120,9 @@ class LLFloaterTwitter : public LLFloater { public: LLFloaterTwitter(const LLSD& key); - BOOL postBuild(); - void draw(); - void onClose(bool app_quitting); + BOOL postBuild() override; + void draw() override; + void onClose(bool app_quitting) override; void onCancel(); void showPhotoPanel(); diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 82b2e68b685fb20b4d20247cf5c25c90fcd6fce7..520129d21362c76c41c7ca3fca2ee471eb6cb931 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -108,14 +108,15 @@ public: Params() {} }; LLOverlapPanel(Params p = Params()) : LLPanel(p), - mSpacing(10), + mLastClickedElement(nullptr), // mClickedElement(NULL), - mLastClickedElement(NULL) + mSpacing(10) { mOriginalWidth = getRect().getWidth(); mOriginalHeight = getRect().getHeight(); } - virtual void draw(); + + void draw() override; typedef std::map<LLView*, std::list<LLView*> > OverlapMap; OverlapMap mOverlapMap; // map, of XUI element to a list of XUI elements it overlaps @@ -136,8 +137,8 @@ public: std::string getLocStr(S32 ID); // fetches the localization string based on what is selected in the drop-down menu void displayFloater(BOOL click, S32 ID); // needs to be public so live file can call it when it finds an update - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onClose(bool app_quitting) override; void refreshList(); // refresh list (empty it out and fill it up from scratch) void addFloaterEntry(const std::string& path); // add a single file's entry to the list of floaters @@ -240,7 +241,7 @@ public: BOOL mFirstFade; // setting this avoids showing the fade reload warning on first load std::string mFileName; protected: - bool loadFile(); + bool loadFile() override; }; // Implementation of graphical fade in/out (on timer) for when XUI files are updated @@ -248,7 +249,7 @@ class LLFadeEventTimer : public LLEventTimer { public: LLFadeEventTimer(F32 refresh, LLGUIPreviewLiveFile* parent); - BOOL tick(); + BOOL tick() override; LLGUIPreviewLiveFile* mParent; private: BOOL mFadingOut; // fades in then out; this is toggled in between @@ -266,9 +267,9 @@ public: { } - virtual void draw(); - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - BOOL handleToolTip(S32 x, S32 y, MASK mask); + void draw() override; + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleToolTip(S32 x, S32 y, MASK mask) override; BOOL selectElement(LLView* parent, int x, int y, int depth); // select element to display its overlappers LLFloaterUIPreview* mFloaterUIPreview; @@ -303,19 +304,19 @@ LLLocalizationResetForcer::~LLLocalizationResetForcer() // Live file constructor // Needs full path for LLLiveFile but needs just file name for this code, hence the reduntant arguments; easier than separating later LLGUIPreviewLiveFile::LLGUIPreviewLiveFile(std::string path, std::string name, LLFloaterUIPreview* parent) - : mFileName(name), + : LLLiveFile(path, 1.0), mParent(parent), + mFadeTimer(nullptr), mFirstFade(TRUE), - mFadeTimer(NULL), - LLLiveFile(path, 1.0) + mFileName(name) {} LLGUIPreviewLiveFile::~LLGUIPreviewLiveFile() { - mParent->mLiveFile = NULL; + mParent->mLiveFile = nullptr; if(mFadeTimer) { - mFadeTimer->mParent = NULL; + mFadeTimer->mParent = nullptr; // deletes itself; see lltimer.cpp } } @@ -332,7 +333,7 @@ bool LLGUIPreviewLiveFile::loadFile() { if(mFadeTimer) { - mFadeTimer->mParent = NULL; + mFadeTimer->mParent = nullptr; } mFadeTimer = new LLFadeEventTimer(0.05f,this); } @@ -341,9 +342,9 @@ bool LLGUIPreviewLiveFile::loadFile() // Initialize fade event timer LLFadeEventTimer::LLFadeEventTimer(F32 refresh, LLGUIPreviewLiveFile* parent) - : mParent(parent), - mFadingOut(TRUE), - LLEventTimer(refresh) + : LLEventTimer(refresh), + mParent(parent), + mFadingOut(TRUE) { mOriginalColor = mParent->mParent->mDisplayedFloater->getBackgroundColor(); } @@ -357,7 +358,7 @@ BOOL LLFadeEventTimer::tick() diff = -diff; } - if(NULL == mParent) // no more need to tick, so suicide + if(nullptr == mParent) // no more need to tick, so suicide { return TRUE; } @@ -388,9 +389,9 @@ BOOL LLFadeEventTimer::tick() // Constructor LLFloaterUIPreview::LLFloaterUIPreview(const LLSD& key) : LLFloater(key), - mDisplayedFloater(NULL), - mDisplayedFloater_2(NULL), - mLiveFile(NULL), + mDisplayedFloater(nullptr), + mDisplayedFloater_2(nullptr), + mLiveFile(nullptr), mOverlapPanel(nullptr), // mHighlightingDiffs(FALSE), mHighlightingOverlaps(FALSE), @@ -429,7 +430,7 @@ LLFloaterUIPreview::~LLFloaterUIPreview() if(mLiveFile) { delete mLiveFile; - mLiveFile = NULL; + mLiveFile = nullptr; } } @@ -611,9 +612,9 @@ void LLFloaterUIPreview::onClose(bool app_quitting) onClickCloseDisplayedFloater(PRIMARY_FLOATER); onClickCloseDisplayedFloater(SECONDARY_FLOATER); delete mDisplayedFloater; - mDisplayedFloater = NULL; + mDisplayedFloater = nullptr; delete mDisplayedFloater_2; - mDisplayedFloater_2 = NULL; + mDisplayedFloater_2 = nullptr; } } @@ -750,7 +751,7 @@ void LLFloaterUIPreview::addFloaterEntry(const std::string& path) if(mLiveFile) { delete mLiveFile; - mLiveFile = NULL; + mLiveFile = nullptr; } return; } @@ -810,21 +811,21 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID) LLPreviewedFloater** floaterp = (ID == 1 ? &(mDisplayedFloater) : &(mDisplayedFloater_2)); if(ID == 1) { - BOOL floater_already_open = mDisplayedFloater != NULL; + BOOL floater_already_open = mDisplayedFloater != nullptr; if(floater_already_open) // if we are already displaying a floater { mLastDisplayedX = mDisplayedFloater->calcScreenRect().mLeft; // save floater's last known position to put the new one there mLastDisplayedY = mDisplayedFloater->calcScreenRect().mBottom; delete mDisplayedFloater; // delete it (this closes it too) - mDisplayedFloater = NULL; // and reset the pointer + mDisplayedFloater = nullptr; // and reset the pointer } } else { - if(mDisplayedFloater_2 != NULL) + if(mDisplayedFloater_2 != nullptr) { delete mDisplayedFloater_2; - mDisplayedFloater_2 = NULL; + mDisplayedFloater_2 = nullptr; } } @@ -916,7 +917,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID) if(mLiveFile) { delete mLiveFile; - mLiveFile = NULL; + mLiveFile = nullptr; } mLiveFile = new LLGUIPreviewLiveFile(std::string(full_path.c_str()),std::string(path.c_str()),this); mLiveFile->checkAndReload(); @@ -936,8 +937,8 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID) if(ID == 1) { mOverlapPanel->mOverlapMap.clear(); - LLView::sPreviewClickedElement = NULL; // stop overlapping elements from drawing - mOverlapPanel->mLastClickedElement = NULL; + LLView::sPreviewClickedElement = nullptr; // stop overlapping elements from drawing + mOverlapPanel->mLastClickedElement = nullptr; findOverlapsInChildren((LLView*)mDisplayedFloater); // highlight and enable them @@ -1146,7 +1147,7 @@ void LLFloaterUIPreview::onClickToggleDiffHighlighting() if(!strncmp("XuiDelta",root_floater->getName().c_str(),9)) { for (LLXmlTreeNode* child = root_floater->getFirstChild(); // get the first child first, then below get the next one; otherwise the iterator is invalid (bug or feature in XML code?) - child != NULL; + child != nullptr; child = root_floater->getNextChild()) // get child for next iteration { if(!strncmp("file",child->getName().c_str(),5)) @@ -1160,7 +1161,7 @@ void LLFloaterUIPreview::onClickToggleDiffHighlighting() child->getAttributeString("message",error_message); if(mDiffsMap.find(error_file) != mDiffsMap.end()) { - mDiffsMap.insert(std::make_pair(error_file,std::make_pair(StringListPtr(new StringList), StringListPtr(new StringList)))); + mDiffsMap.insert(std::make_pair(error_file,std::make_pair(std::make_shared<StringList>(), std::make_shared<StringList>()))); } mDiffsMap[error_file].second->push_back(error_message); } @@ -1214,7 +1215,7 @@ void LLFloaterUIPreview::scanDiffFile(LLXmlTreeNode* file_node) // Get a list of changed elements // Get the first child first, then below get the next one; otherwise the iterator is invalid (bug or feature in XML code?) - for (LLXmlTreeNode* child = file_node->getFirstChild(); child != NULL; child = file_node->getNextChild()) + for (LLXmlTreeNode* child = file_node->getFirstChild(); child != nullptr; child = file_node->getNextChild()) { if(!strncmp("delta",child->getName().c_str(),6)) { @@ -1222,7 +1223,7 @@ void LLFloaterUIPreview::scanDiffFile(LLXmlTreeNode* file_node) child->getAttributeString("id",id); if(mDiffsMap.find(file_name) == mDiffsMap.end()) { - mDiffsMap.insert(std::make_pair(file_name,std::make_pair(StringListPtr(new StringList), StringListPtr(new StringList)))); + mDiffsMap.insert(std::make_pair(file_name,std::make_pair(std::make_shared<StringList>(), std::make_shared<StringList>()))); } mDiffsMap[file_name].first->push_back(std::string(id.c_str())); } @@ -1237,7 +1238,7 @@ void LLFloaterUIPreview::scanDiffFile(LLXmlTreeNode* file_node) void LLFloaterUIPreview::highlightChangedElements() { - if(NULL == mLiveFile) + if(nullptr == mLiveFile) { return; } @@ -1270,7 +1271,7 @@ void LLFloaterUIPreview::highlightChangedElements() element = element->findChild<LLView>(*token_iter, FALSE); // try to find element: don't recur, and don't create if missing // if we still didn't find it... - if (NULL == element) + if (nullptr == element) { LL_INFOS() << "Unable to find element in XuiDelta file named \"" << *iter << "\" in file \"" << mLiveFile->mFileName << "\". The element may no longer exist, the path may be incorrect, or it may not be a non-displayable element (not an LLView) such as a \"string\" type." << LL_ENDL; @@ -1332,13 +1333,13 @@ void LLFloaterUIPreview::onClickCloseDisplayedFloater(S32 caller_id) mLastDisplayedX = mDisplayedFloater->calcScreenRect().mLeft; mLastDisplayedY = mDisplayedFloater->calcScreenRect().mBottom; delete mDisplayedFloater; - mDisplayedFloater = NULL; + mDisplayedFloater = nullptr; } if(mLiveFile) { delete mLiveFile; - mLiveFile = NULL; + mLiveFile = nullptr; } if(mToggleOverlapButton->getToggleState()) @@ -1347,14 +1348,14 @@ void LLFloaterUIPreview::onClickCloseDisplayedFloater(S32 caller_id) onClickToggleOverlapping(); } - LLView::sPreviewClickedElement = NULL; // stop overlapping elements panel from drawing - mOverlapPanel->mLastClickedElement = NULL; + LLView::sPreviewClickedElement = nullptr; // stop overlapping elements panel from drawing + mOverlapPanel->mLastClickedElement = nullptr; } else { mCloseOtherButton_2->setEnabled(FALSE); delete mDisplayedFloater_2; - mDisplayedFloater_2 = NULL; + mDisplayedFloater_2 = nullptr; } } @@ -1477,7 +1478,7 @@ BOOL LLPreviewedFloater::selectElement(LLView* parent, int x, int y, int depth) void LLPreviewedFloater::draw() { - if(NULL != mFloaterUIPreview) + if(nullptr != mFloaterUIPreview) { // Set and unset sDrawPreviewHighlights flag so as to avoid using two flags if(mFloaterUIPreview->mHighlightingOverlaps) @@ -1575,16 +1576,16 @@ void LLFloaterUIPreview::findOverlapsInChildren(LLView* parent) // *NOTE: If a list of elements which have localizable content were created, this function should return false if viewp's class is in that list. BOOL LLFloaterUIPreview::overlapIgnorable(LLView* viewp) { - return NULL != dynamic_cast<LLDragHandle*>(viewp) || - NULL != dynamic_cast<LLViewBorder*>(viewp) || - NULL != dynamic_cast<LLResizeBar*>(viewp); + return nullptr != dynamic_cast<LLDragHandle*>(viewp) || + nullptr != dynamic_cast<LLViewBorder*>(viewp) || + nullptr != dynamic_cast<LLResizeBar*>(viewp); } // *HACK: these are the only two container types as of 8/08, per Richard // This is using dynamic casts because there is no object-oriented way to tell which elements are containers. BOOL LLFloaterUIPreview::containerType(LLView* viewp) { - return NULL != dynamic_cast<LLPanel*>(viewp) || NULL != dynamic_cast<LLLayoutStack*>(viewp); + return nullptr != dynamic_cast<LLPanel*>(viewp) || nullptr != dynamic_cast<LLLayoutStack*>(viewp); } // Check if two llview's rectangles overlap, with some tolerance @@ -1611,7 +1612,7 @@ void LLOverlapPanel::draw() LLUI::translate(5,getRect().getHeight()-20); // translate to top-5,left-5 LLView::sDrawPreviewHighlights = FALSE; LLFontGL::getFontSansSerifSmall()->renderUTF8(current_selection_text, 0, 0, 0, text_color, - LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); + LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, nullptr, FALSE); } else { @@ -1629,7 +1630,7 @@ void LLOverlapPanel::draw() std::string current_selection = std::string(current_selection_text + LLView::sPreviewClickedElement->getName() + " (no elements overlap)"); S32 text_width = LLFontGL::getFontSansSerifSmall()->getWidth(current_selection) + 10; LLFontGL::getFontSansSerifSmall()->renderUTF8(current_selection, 0, 0, 0, text_color, - LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); + LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, nullptr, FALSE); // widen panel enough to fit this text LLRect rect = getRect(); setRect(LLRect(rect.mLeft,rect.mTop,rect.getWidth() < text_width ? rect.mLeft + text_width : rect.mRight,rect.mTop)); @@ -1638,12 +1639,12 @@ void LLOverlapPanel::draw() // recalculate required with and height; otherwise use cached BOOL need_to_recalculate_bounds = FALSE; - if(mLastClickedElement == NULL) + if(mLastClickedElement == nullptr) { need_to_recalculate_bounds = TRUE; } - if(NULL == mLastClickedElement) + if(nullptr == mLastClickedElement) { mLastClickedElement = LLView::sPreviewClickedElement; } @@ -1695,7 +1696,7 @@ void LLOverlapPanel::draw() // draw currently-selected element at top of overlappers LLUI::translate(0,-mSpacing); LLFontGL::getFontSansSerifSmall()->renderUTF8(current_selection_text + LLView::sPreviewClickedElement->getName(), 0, 0, 0, text_color, - LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); + LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, nullptr, FALSE); LLUI::translate(0,-mSpacing-LLView::sPreviewClickedElement->getRect().getHeight()); // skip spacing distance + height LLView::sPreviewClickedElement->draw(); @@ -1710,7 +1711,7 @@ void LLOverlapPanel::draw() // draw name LLUI::translate(0,-mSpacing); LLFontGL::getFontSansSerifSmall()->renderUTF8(overlapper_text + viewp->getName(), 0, 0, 0, text_color, - LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); + LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, nullptr, FALSE); // draw element LLUI::translate(0,-mSpacing-viewp->getRect().getHeight()); // skip spacing distance + height diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index aaf905754ac528043e76628f87c6090674c3ff45..0be001c147b7fdef6a5e48a43af077a691fcdc6e 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -41,7 +41,7 @@ #include "llviewerwindow.h" #include "llcorehttputil.h" -static LLFloaterURLEntry* sInstance = NULL; +static LLFloaterURLEntry* sInstance = nullptr; //----------------------------------------------------------------------------- // LLFloaterURLEntry() @@ -59,7 +59,7 @@ LLFloaterURLEntry::LLFloaterURLEntry(LLHandle<LLPanel> parent) //----------------------------------------------------------------------------- LLFloaterURLEntry::~LLFloaterURLEntry() { - sInstance = NULL; + sInstance = nullptr; } BOOL LLFloaterURLEntry::postBuild() @@ -205,7 +205,7 @@ void LLFloaterURLEntry::getMediaTypeCoro(std::string url, LLHandle<LLFloater> pa LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMediaTypeCoro", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = boost::make_shared<LLCore::HttpOptions>(); httpOpts->setHeadersOnly(true); diff --git a/indra/newview/llfloaterurlentry.h b/indra/newview/llfloaterurlentry.h index 20f4604907acceb12b84e2eb0b36906782841751..79deb37931749f9303c7fcabc9fbc9438464bd85 100644 --- a/indra/newview/llfloaterurlentry.h +++ b/indra/newview/llfloaterurlentry.h @@ -41,7 +41,7 @@ public: // Can only be shown by LLPanelLandMedia, and pushes data back into // that panel via the handle. static LLHandle<LLFloater> show(LLHandle<LLPanel> panel_land_media_handle, const std::string media_url); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void headerFetchComplete(S32 status, const std::string& mime_type); bool addURLToCombobox(const std::string& media_url); diff --git a/indra/newview/llfloatervoiceeffect.h b/indra/newview/llfloatervoiceeffect.h index 4d432c46ccc5bdc0447d780e57bcd6f9f84b4256..7cec0767c451ffc371dfc084415733ee2eb01c61 100644 --- a/indra/newview/llfloatervoiceeffect.h +++ b/indra/newview/llfloatervoiceeffect.h @@ -44,8 +44,8 @@ public: LLFloaterVoiceEffect(const LLSD& key); virtual ~LLFloaterVoiceEffect(); - virtual BOOL postBuild(); - virtual void onClose(bool app_quitting); + BOOL postBuild() override; + void onClose(bool app_quitting) override; private: enum ColumnIndex @@ -58,7 +58,7 @@ private: void updateControls(); /// Called by voice effect provider when voice effect list is changed. - virtual void onVoiceEffectChanged(bool effect_list_updated); + void onVoiceEffectChanged(bool effect_list_updated) override; void onClickRecord(); void onClickPlay(); diff --git a/indra/newview/llfloatervoicevolume.cpp b/indra/newview/llfloatervoicevolume.cpp index 00ab464fe843ab2f78f2f9906f98bfed97028498..10f4d34f917b6a1a36caf609432fe2e4e2d8c9f6 100644 --- a/indra/newview/llfloatervoicevolume.cpp +++ b/indra/newview/llfloatervoicevolume.cpp @@ -62,13 +62,13 @@ public: LLFloaterVoiceVolume(const LLSD& avatar_id); virtual ~LLFloaterVoiceVolume(); - /*virtual*/ BOOL postBuild(void); + /*virtual*/ BOOL postBuild(void) override; // Because floater is single instance, need to re-parse data on each spawn // (for example, inspector about same avatar but in different position) - /*virtual*/ void onOpen(const LLSD& avatar_id); + /*virtual*/ void onOpen(const LLSD& avatar_id) override; - /*virtual*/ LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::GLOBAL; } + /*virtual*/ LLTransientFloaterMgr::ETransientGroup getGroup() override { return LLTransientFloaterMgr::GLOBAL; } private: // Set the volume slider to this user's current client-side volume setting, diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 22fc510bfb86da792086c7b810b386547fca38b8..ad851d028918737f858ef3d5f70646d7f71fea67 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -49,30 +49,30 @@ LLFloaterWebContent::_Params::_Params() : url("url"), target("target"), - id("id"), window_class("window_class", "web_content"), + id("id"), show_chrome("show_chrome", true), allow_address_entry("allow_address_entry", true), allow_back_forward_navigation("allow_back_forward_navigation", true), - preferred_media_size("preferred_media_size"), trusted_content("trusted_content", false), show_page_title("show_page_title", true), clean_browser("clean_browser", false), - dev_mode("dev_mode", false) + dev_mode("dev_mode", false), + preferred_media_size("preferred_media_size") {} LLFloaterWebContent::LLFloaterWebContent( const Params& params ) : LLFloater( params ), LLInstanceTracker<LLFloaterWebContent, std::string, LLInstanceTrackerReplaceOnCollision>(params.id()), - mWebBrowser(NULL), - mAddressCombo(NULL), - mSecureLockIcon(NULL), - mStatusBarText(NULL), - mStatusBarProgress(NULL), - mBtnBack(NULL), - mBtnForward(NULL), - mBtnReload(NULL), - mBtnStop(NULL), + mWebBrowser(nullptr), + mAddressCombo(nullptr), + mSecureLockIcon(nullptr), + mStatusBarText(nullptr), + mStatusBarProgress(nullptr), + mBtnBack(nullptr), + mBtnForward(nullptr), + mBtnReload(nullptr), + mBtnStop(nullptr), mUUID(params.id()), mShowPageTitle(params.show_page_title), mAllowNavigation(true), diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 0bf93504c28623293b7e7360d61948041f09dc85..d33e3d975ad0342c93731f5df9bb845849aa79af 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -77,15 +77,15 @@ public: static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height); void geometryChanged(S32 x, S32 y, S32 width, S32 height); - /* virtual */ BOOL postBuild(); - /* virtual */ void onOpen(const LLSD& key); - /* virtual */ bool matchesKey(const LLSD& key); - /* virtual */ void onClose(bool app_quitting); - /* virtual */ void draw(); + /* virtual */ BOOL postBuild() override; + /* virtual */ void onOpen(const LLSD& key) override; + /* virtual */ bool matchesKey(const LLSD& key) override; + /* virtual */ void onClose(bool app_quitting) override; + /* virtual */ void draw() override; protected: // inherited from LLViewerMediaObserver - /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; void onClickBack(); void onClickForward(); diff --git a/indra/newview/llfloaterwebprofile.h b/indra/newview/llfloaterwebprofile.h index aa780d24957dd77533c80e3939df80fe15b1cf5c..2bea192aa04060b57070698ff229fc41ac811985 100644 --- a/indra/newview/llfloaterwebprofile.h +++ b/indra/newview/llfloaterwebprofile.h @@ -44,8 +44,8 @@ public: LLFloaterWebProfile(const Params& key); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false) override; static LLFloater* create(const LLSD& key); diff --git a/indra/newview/llfloaterwhitelistentry.h b/indra/newview/llfloaterwhitelistentry.h index deab49c52382aafc16b687e19ac785f820ad6cda..89b222ea3a92e998ba048a5b328194ef3b7c85cf 100644 --- a/indra/newview/llfloaterwhitelistentry.h +++ b/indra/newview/llfloaterwhitelistentry.h @@ -38,7 +38,7 @@ class LLFloaterWhiteListEntry : LLFloaterWhiteListEntry(const LLSD& key); ~LLFloaterWhiteListEntry(); - BOOL postBuild(); + BOOL postBuild() override; private: LLLineEditor* mWhiteListEdit; diff --git a/indra/newview/llfloaterwindowsize.h b/indra/newview/llfloaterwindowsize.h index a71e5e273c9252f77d03cc1b912f7196c2b4d3f0..5d6857fabaff29c77dc9c99a2b3240c96997a7de 100644 --- a/indra/newview/llfloaterwindowsize.h +++ b/indra/newview/llfloaterwindowsize.h @@ -40,7 +40,7 @@ private: virtual ~LLFloaterWindowSize(); public: - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void initWindowSizeControls(); void onClickSet(); void onClickCancel(); diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index bfe2da353442f1eb69f61effaa93ff5fa75bab69..8833d9d73f20d5ad84104f386a89e49eb33c2c35 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -126,7 +126,7 @@ public: LLWorldMapHandler() : LLCommandHandler("worldmap", UNTRUSTED_THROTTLE ) { } bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + LLMediaCtrl* web) override { if (!LLUI::sSettingGroups["config"]->getBOOL("EnableWorldMap")) { @@ -164,7 +164,7 @@ public: { } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { if (!LLUI::sSettingGroups["config"]->getBOOL("EnableWorldMap")) { @@ -198,7 +198,7 @@ class LLMapInventoryObserver : public LLInventoryObserver public: LLMapInventoryObserver() {} virtual ~LLMapInventoryObserver() {} - virtual void changed(U32 mask); + void changed(U32 mask) override; }; void LLMapInventoryObserver::changed(U32 mask) @@ -216,7 +216,7 @@ class LLMapFriendObserver : public LLFriendObserver public: LLMapFriendObserver() {} virtual ~LLMapFriendObserver() {} - virtual void changed(U32 mask); + void changed(U32 mask) override; }; void LLMapFriendObserver::changed(U32 mask) @@ -242,9 +242,10 @@ const LLUUID LLFloaterWorldMap::sHomeID( "10000000-0000-0000-0000-000000000001" LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) : LLFloater(key), - mInventory(NULL), - mInventoryObserver(NULL), - mFriendObserver(NULL), + mPanel(nullptr), + mInventory(nullptr), + mInventoryObserver(nullptr), + mFriendObserver(nullptr), mCompletingRegionName(), mCompletingRegionPos(), mWaitingForTracker(FALSE), @@ -252,7 +253,6 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) mSetToUserPosition(TRUE), mTrackedLocation(0,0,0), mTrackedStatus(LLTracker::TRACKING_NOTHING), - mPanel(nullptr), mListFriendCombo(nullptr), mListLandmarkCombo(nullptr), mListSearchResults(nullptr), @@ -271,7 +271,7 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) mTeleportHomeButton(nullptr), mZoomSlider(nullptr) { - mFactoryMap["objects_mapview"] = LLCallbackMap(createWorldMapView, NULL); + mFactoryMap["objects_mapview"] = LLCallbackMap(createWorldMapView, nullptr); mCommitCallbackRegistrar.add("WMap.Coordinates", boost::bind(&LLFloaterWorldMap::onCoordinatesCommit, this)); mCommitCallbackRegistrar.add("WMap.Location", boost::bind(&LLFloaterWorldMap::onLocationCommit, this)); @@ -336,7 +336,7 @@ BOOL LLFloaterWorldMap::postBuild() mCurZoomVal = log(LLWorldMapView::sMapScale)/log(2.f); mZoomSlider->setValue(LLWorldMapView::sMapScale); - setDefaultBtn(NULL); + setDefaultBtn(nullptr); mZoomTimer.stop(); @@ -349,14 +349,14 @@ BOOL LLFloaterWorldMap::postBuild() LLFloaterWorldMap::~LLFloaterWorldMap() { // All cleaned up by LLView destructor - mPanel = NULL; + mPanel = nullptr; // Inventory deletes all observers on shutdown - mInventory = NULL; - mInventoryObserver = NULL; + mInventory = nullptr; + mInventoryObserver = nullptr; // avatar tracker will delete this for us. - mFriendObserver = NULL; + mFriendObserver = nullptr; } //static @@ -864,8 +864,8 @@ void LLFloaterWorldMap::observeInventory(LLInventoryModel* model) { mInventory->removeObserver(mInventoryObserver); delete mInventoryObserver; - mInventory = NULL; - mInventoryObserver = NULL; + mInventory = nullptr; + mInventoryObserver = nullptr; } if(model) { @@ -1256,7 +1256,7 @@ void LLFloaterWorldMap::updateSearchEnabled() } else { - setDefaultBtn(NULL); + setDefaultBtn(nullptr); } } diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 5aedadacc952bc64e20b27d93451f83fe7804a36..ac472052b755e1cb964c6512d8bd7548730bfea3 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -57,19 +57,19 @@ public: static LLFloaterWorldMap* getInstance(); static void *createWorldMapView(void* data); - BOOL postBuild(); + BOOL postBuild() override; - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void onClose(bool app_quitting) override; static void reloadIcons(void*); - /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE ); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - /*virtual*/ void draw(); + /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE ) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + /*virtual*/ void draw() override; - /*virtual*/ void onFocusLost(); + /*virtual*/ void onFocusLost() override; // methods for dealing with inventory. The observe() method is // called during program startup. inventoryUpdated() will be diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h index dea54cbe57811716e207dc3a60c0cf2dae6ed4c0..1bc190d1df751fd51dd6ccb40f34f2527bbd8fb1 100644 --- a/indra/newview/llfolderviewmodelinventory.h +++ b/indra/newview/llfolderviewmodelinventory.h @@ -46,15 +46,15 @@ public: virtual void showProperties(void) = 0; virtual BOOL isItemInTrash( void) const { return FALSE; } // TODO: make into pure virtual. virtual BOOL isUpToDate() const = 0; - virtual bool hasChildren() const = 0; + bool hasChildren() const override = 0; virtual LLInventoryType::EType getInventoryType() const = 0; virtual void performAction(LLInventoryModel* model, std::string action) = 0; virtual LLWearableType::EType getWearableType() const = 0; virtual EInventorySortGroup getSortGroup() const = 0; virtual LLInventoryObject* getInventoryObject() const = 0; - virtual void requestSort(); - virtual void setPassedFilter(bool filtered, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0); - virtual bool filter( LLFolderViewFilter& filter); + void requestSort() override; + void setPassedFilter(bool filtered, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) override; + bool filter( LLFolderViewFilter& filter) override; virtual bool filterChildItem( LLFolderViewModelItem* item, LLFolderViewFilter& filter); virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const = 0; @@ -113,10 +113,10 @@ public: void setTaskID(const LLUUID& id) {mTaskID = id;} - void sort(LLFolderViewFolder* folder); - bool contentsReady(); - bool isFolderComplete(LLFolderViewFolder* folder); - bool startDrag(std::vector<LLFolderViewModelItem*>& items); + void sort(LLFolderViewFolder* folder) override; + bool contentsReady() override; + bool isFolderComplete(LLFolderViewFolder* folder) override; + bool startDrag(std::vector<LLFolderViewModelItem*>& items) override; private: LLUUID mTaskID; diff --git a/indra/newview/llfollowcam.cpp b/indra/newview/llfollowcam.cpp index 633243d6427c0585b9638ec3829bd14ebc0dbe12..b15984961c4fa264a379ad9cfe279c4d73fb4d48 100644 --- a/indra/newview/llfollowcam.cpp +++ b/indra/newview/llfollowcam.cpp @@ -815,7 +815,7 @@ void LLFollowCamMgr::setFocusLocked( const LLUUID& source, bool locked ) //static LLFollowCamParams* LLFollowCamMgr::getParamsForID(const LLUUID& source) { - LLFollowCamParams* params = NULL; + LLFollowCamParams* params = nullptr; param_map_t::iterator found_it = sParamMap.find(source); if (found_it == sParamMap.end()) // didn't find it? @@ -836,7 +836,7 @@ LLFollowCamParams* LLFollowCamMgr::getActiveFollowCamParams() { if (sParamStack.empty()) { - return NULL; + return nullptr; } return sParamStack.back(); diff --git a/indra/newview/llfollowcam.h b/indra/newview/llfollowcam.h index de5bde67545f86a64c0eafb169e0e9656f55180a..35ab92aacb56168e427034b890bab9b96cfcc9c8 100644 --- a/indra/newview/llfollowcam.h +++ b/indra/newview/llfollowcam.h @@ -148,12 +148,12 @@ public: void zoom( S32 ); // overrides for setters and getters - virtual void setPitch( F32 ); - virtual void setDistance( F32 ); - virtual void setPosition(const LLVector3& pos); - virtual void setFocus(const LLVector3& focus); - virtual void setPositionLocked ( bool ); - virtual void setFocusLocked ( bool ); + void setPitch( F32 ) override; + void setDistance( F32 ) override; + void setPosition(const LLVector3& pos) override; + void setFocus(const LLVector3& focus) override; + void setPositionLocked ( bool ) override; + void setFocusLocked ( bool ) override; LLVector3 getSimulatedPosition() const; LLVector3 getSimulatedFocus() const; diff --git a/indra/newview/llfriendcard.h b/indra/newview/llfriendcard.h index 11eeb49b8a08085dd1326a4963df8a352a01aeb1..c8a50608e9349b532efb806e41f48e3e08b7d2fa 100644 --- a/indra/newview/llfriendcard.h +++ b/indra/newview/llfriendcard.h @@ -55,7 +55,7 @@ public: }; // LLFriendObserver implementation - void changed(U32 mask) + void changed(U32 mask) override { onFriendListUpdate(mask); } diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 0a015ab2c98c7c3e6cb30b1c628c545ad2a54bc6..66db1778aa736dee3126d32429da71c8d14e72c1 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -68,10 +68,10 @@ const F32 MAX_WAIT_ANIM_SECS = 30.f; // Lightweight constructor. // init() does the heavy lifting. LLGestureMgr::LLGestureMgr() -: mValid(FALSE), +: mActive(), + mLoadingCount(0), mPlaying(), - mActive(), - mLoadingCount(0) + mValid(FALSE) { gInventory.addObserver(this); mListener.reset(new LLGestureListener()); @@ -87,7 +87,7 @@ LLGestureMgr::~LLGestureMgr() LLMultiGesture* gesture = (*it).second; delete gesture; - gesture = NULL; + gesture = nullptr; } gInventory.removeObserver(this); } @@ -277,7 +277,7 @@ void LLGestureMgr::activateGestureWithAsset(const LLUUID& item_id, // For now, put NULL into the item map. We'll build a gesture // class object when the asset data arrives. - mActive[base_item_id] = NULL; + mActive[base_item_id] = nullptr; // Copy the UUID if (asset_id.notNull()) @@ -326,7 +326,7 @@ void LLGestureMgr::deactivateGesture(const LLUUID& item_id) stopGesture(gesture); delete gesture; - gesture = NULL; + gesture = nullptr; } mActive.erase(it); @@ -380,7 +380,7 @@ void LLGestureMgr::deactivateSimilarGestures(LLMultiGesture* in, const LLUUID& i stopGesture(gest); delete gest; - gest = NULL; + gest = nullptr; mActive.erase(it++); gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); @@ -490,7 +490,7 @@ void LLGestureMgr::replaceGesture(const LLUUID& item_id, LLMultiGesture* new_ges mActive[base_item_id] = new_gesture; delete old_gesture; - old_gesture = NULL; + old_gesture = nullptr; if (asset_id.notNull()) { @@ -582,7 +582,7 @@ void LLGestureMgr::playGesture(LLMultiGesture* gesture) gAssetStorage->getAssetData(sound_id, LLAssetType::AT_SOUND, onAssetLoadComplete, - NULL, + nullptr, TRUE); } break; @@ -640,7 +640,7 @@ BOOL LLGestureMgr::triggerAndReviseString(const std::string &utf8str, std::strin for( token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) { const char* cur_token = token_iter->c_str(); - LLMultiGesture* gesture = NULL; + LLMultiGesture* gesture = nullptr; // Only pay attention to the first gesture in the string. if( !found_gestures ) @@ -660,7 +660,7 @@ BOOL LLGestureMgr::triggerAndReviseString(const std::string &utf8str, std::strin matching.push_back(gesture); } - gesture = NULL; + gesture = nullptr; } @@ -712,7 +712,7 @@ BOOL LLGestureMgr::triggerAndReviseString(const std::string &utf8str, std::strin } first_token = FALSE; - gesture = NULL; + gesture = nullptr; } return found_gestures; } @@ -787,7 +787,7 @@ void LLGestureMgr::update() // callback might have deleted gesture, can't // rely on this pointer any more - gesture = NULL; + gesture = nullptr; } } @@ -857,7 +857,7 @@ void LLGestureMgr::stepGesture(LLMultiGesture* gesture) { // Get the current step, if there is one. // Otherwise enter the waiting at end state. - LLGestureStep* step = NULL; + LLGestureStep* step = nullptr; if (gesture->mCurrentStep < (S32)gesture->mSteps.size()) { step = gesture->mSteps[gesture->mCurrentStep]; @@ -1049,7 +1049,7 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs, BOOL deactivate_similar = info->mDeactivateSimilar; delete info; - info = NULL; + info = nullptr; LLGestureMgr& self = LLGestureMgr::instance(); self.mLoadingCount--; @@ -1136,7 +1136,7 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs, self.mActive.erase(item_id); delete gesture; - gesture = NULL; + gesture = nullptr; } } else @@ -1283,7 +1283,7 @@ void LLGestureMgr::stopGesture(LLMultiGesture* gesture) // callback might have deleted gesture, can't // rely on this pointer any more - gesture = NULL; + gesture = nullptr; } notifyObservers(); diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index ad35a60be3739c115f9b06fd3ddf4bdeeb0d10f7..67cb97dff5d1048d7efdefe3d615cf4be55bf141 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -120,7 +120,7 @@ public: BOOL triggerGesture(KEY key, MASK mask); // Trigger all gestures referenced as substrings in this string - BOOL triggerAndReviseString(const std::string &str, std::string *revised_string = NULL); + BOOL triggerAndReviseString(const std::string &str, std::string *revised_string = nullptr); // Does some gesture have this key bound? BOOL isKeyBound(KEY key, MASK mask); @@ -132,7 +132,7 @@ public: void notifyObservers(); // Overriding so we can update active gesture names and notify observers - void changed(U32 mask); + void changed(U32 mask) override; BOOL matchPrefix(const std::string& in_str, std::string* out_str); @@ -147,7 +147,7 @@ protected: void runStep(LLMultiGesture* gesture, LLGestureStep* step); // LLInventoryCompletionObserver trigger - void done(); + void done() override; // Used by loadGesture static void onLoadComplete(LLVFS *vfs, diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index b8ec857836a8a4ddaea4a7dfba6cdd72d7de99c9..e1e81f3370e99435a7ab6588b29395d904cce0f7 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -61,7 +61,7 @@ class LLGiveable : public LLInventoryCollectFunctor public: LLGiveable() : mCountLosing(0) {} virtual ~LLGiveable() {} - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override; S32 countNoCopy() const { return mCountLosing; } protected: @@ -98,7 +98,7 @@ class LLUncopyableItems : public LLInventoryCollectFunctor public: LLUncopyableItems() {} virtual ~LLUncopyableItems() {} - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override; }; bool LLUncopyableItems::operator()(LLInventoryCategory* cat, @@ -357,7 +357,7 @@ bool LLGiveInventory::handleCopyProtectedItem(const LLSD& notification, const LL { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLSD itmes = notification["payload"]["items"]; - LLInventoryItem* item = NULL; + LLInventoryItem* item = nullptr; bool give_successful = true; switch(option) { @@ -448,7 +448,7 @@ void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent, bool LLGiveInventory::handleCopyProtectedCategory(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - LLInventoryCategory* cat = NULL; + LLInventoryCategory* cat = nullptr; bool give_successful = true; switch(option) { diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 204e3843e7da691d577515feb0cb01f566a343d8..32ff37cc2899b1d5fa415d28a2490a90e09be60a 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -144,7 +144,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) { struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* vobjp) + bool apply(LLViewerObject* vobjp) override { LLDrawable* drawable = vobjp->mDrawable; if (!drawable || vobjp->getPCode() != LL_PCODE_VOLUME || vobjp->isAttachment()) @@ -899,7 +899,7 @@ F32 gpu_benchmark() gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkV.glsl", GL_VERTEX_SHADER)); gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkF.glsl", GL_FRAGMENT_SHADER)); gBenchmarkProgram.mShaderLevel = 1; - if (!gBenchmarkProgram.createShader(NULL, NULL)) + if (!gBenchmarkProgram.createShader(nullptr, nullptr)) { return -1.f; } diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 78d9d099131091d97d1a5af227a2f62e61f322c2..9a2def3a9b6b0f44a93df03d72ade0ba99d3e6c2 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -57,7 +57,7 @@ public: // requires trusted browser to trigger LLGroupHandler() : LLCommandHandler("group", UNTRUSTED_THROTTLE) { } bool handle(const LLSD& tokens, const LLSD& query_map, - LLMediaCtrl* web) + LLMediaCtrl* web) override { if (!LLUI::sSettingGroups["config"]->getBOOL("EnableGroupInfo")) { @@ -126,9 +126,9 @@ class LLFetchGroupMemberData : public LLGroupMgrObserver { public: LLFetchGroupMemberData(const LLUUID& group_id) : + LLGroupMgrObserver(group_id), mGroupId(group_id), - mRequestProcessed(false), - LLGroupMgrObserver(group_id) + mRequestProcessed(false) { LL_INFOS() << "Sending new group member request for group_id: "<< group_id << LL_ENDL; LLGroupMgr* mgr = LLGroupMgr::getInstance(); @@ -151,7 +151,7 @@ public: LLGroupMgr::getInstance()->removeObserver(this); } - void changed(LLGroupChange gc) + void changed(LLGroupChange gc) override { if (gc == GC_PROPERTIES && !mRequestProcessed) { @@ -183,13 +183,13 @@ public: LLFetchLeaveGroupData(const LLUUID& group_id) : LLFetchGroupMemberData(group_id) {} - void processGroupData() + void processGroupData() override { LLGroupActions::processLeaveGroupDataResponse(mGroupId); } }; -LLFetchLeaveGroupData* gFetchLeaveGroupData = NULL; +LLFetchLeaveGroupData* gFetchLeaveGroupData = nullptr; // static void LLGroupActions::search() @@ -293,10 +293,10 @@ void LLGroupActions::leave(const LLUUID& group_id) LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id); if (!gdatap || !gdatap->isMemberDataComplete()) { - if (gFetchLeaveGroupData != NULL) + if (gFetchLeaveGroupData != nullptr) { delete gFetchLeaveGroupData; - gFetchLeaveGroupData = NULL; + gFetchLeaveGroupData = nullptr; } gFetchLeaveGroupData = new LLFetchLeaveGroupData(group_id); } @@ -345,7 +345,7 @@ void LLGroupActions::activate(const LLUUID& group_id) static bool isGroupUIVisible() { - static LLPanel* panel = 0; + static LLPanel* panel = nullptr; if(!panel) panel = LLFloaterSidePanelContainer::getPanel("people", "panel_group_info_sidetray"); if(!panel) diff --git a/indra/newview/llgroupiconctrl.h b/indra/newview/llgroupiconctrl.h index 43e384d3e277746ef77889f5a23ea01d8d1484da..3589979454f4789ad8f0eef0100bafedfd220cdb 100644 --- a/indra/newview/llgroupiconctrl.h +++ b/indra/newview/llgroupiconctrl.h @@ -64,7 +64,7 @@ public: * * @params value - if LLUUID - it is processed as group id otherwise base method is called. */ - virtual void setValue(const LLSD& value); + void setValue(const LLSD& value) override; /** * Sets icon_id as icon value directly. Avoids LLGroupMgr cache checks for group id @@ -75,7 +75,7 @@ public: void setIconId(const LLUUID& icon_id); // LLGroupMgrObserver observer trigger - virtual void changed(LLGroupChange gc); + void changed(LLGroupChange gc) override; const std::string& getGroupName() const { return mGroupName; } void setDrawTooltip(bool value) { mDrawTooltip = value;} diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 4e66b11442ebb4f7bc36e2b9612a09dfa0959ad7..80f207f3cb2c3749f1077c2520749ba7e9c3ed67 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -55,7 +55,7 @@ public: LLGroupComparator() {}; /** Returns true if item1 < item2, false otherwise */ - /*virtual*/ bool compare(const LLPanel* item1, const LLPanel* item2) const + /*virtual*/ bool compare(const LLPanel* item1, const LLPanel* item2) const override { std::string name1 = static_cast<const LLGroupListItem*>(item1)->getGroupName(); std::string name2 = static_cast<const LLGroupListItem*>(item2)->getGroupName(); @@ -312,10 +312,10 @@ bool LLGroupList::onContextMenuItemEnable(const LLSD& userdata) LLGroupListItem::LLGroupListItem() : LLPanel(), -mGroupIcon(NULL), -mGroupNameBox(NULL), -mInfoBtn(NULL), +mGroupNameBox(nullptr), mGroupID(LLUUID::null), +mGroupIcon(nullptr), +mInfoBtn(nullptr), mGroupName(LLStringUtil::null) { buildFromFile( "panel_group_list_item.xml"); diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h index 8a6e87683ec824da73b246f6a1e3452d63d16638..138aa36741b9447c409669686c4aecfa1de12923 100644 --- a/indra/newview/llgrouplist.h +++ b/indra/newview/llgrouplist.h @@ -56,9 +56,9 @@ public: LLGroupList(const Params& p); virtual ~LLGroupList(); - virtual void draw(); // from LLView - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); // from LLView - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); // from LLView + void draw() override; // from LLView + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; // from LLView + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; // from LLView void setNameFilter(const std::string& filter); void toggleIcons(); @@ -71,7 +71,7 @@ private: void refresh(); void addNewItem(const LLUUID& id, const std::string& name, const LLUUID& icon_id, const bool visible_in_profile, EAddPosition pos = ADD_BOTTOM); - bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); // called on agent group list changes + bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override; // called on agent group list changes bool onContextMenuItemClick(const LLSD& userdata); bool onContextMenuItemEnable(const LLSD& userdata); @@ -93,10 +93,10 @@ class LLGroupListItem : public LLPanel public: LLGroupListItem(); ~LLGroupListItem(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void setValue(const LLSD& value); - void onMouseEnter(S32 x, S32 y, MASK mask); - void onMouseLeave(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void setValue(const LLSD& value) override; + void onMouseEnter(S32 x, S32 y, MASK mask) override; + void onMouseLeave(S32 x, S32 y, MASK mask) override; const LLUUID& getGroupID() const { return mGroupID; } const std::string& getGroupName() const { return mGroupName; } @@ -106,7 +106,7 @@ public: void setGroupIconID(const LLUUID& group_icon_id); void setGroupIconVisible(bool visible); - virtual void changed(LLGroupChange gc); + void changed(LLGroupChange gc) override; private: void setActive(bool active); void onInfoBtnClick(); diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 2f08475b6c9b2d29f51d83733f4ab60d633e4c46..6c3817d047c4a3c5534e1cfaca1e6d13b0b2ffd6 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -64,7 +64,7 @@ constexpr U32 MAX_CACHED_GROUPS = 20; // LLRoleActionSet // LLRoleActionSet::LLRoleActionSet() -: mActionSetData(NULL) +: mActionSetData(nullptr) { } LLRoleActionSet::~LLRoleActionSet() @@ -238,14 +238,14 @@ LLGroupMgrGroupData::LLGroupMgrGroupData(const LLUUID& id) : mChanged(FALSE), mMemberCount(0), mRoleCount(0), + mPendingBanRequest(false), mReceivedRoleMemberPairs(0), mMemberDataComplete(false), mRoleDataComplete(false), mRoleMemberDataComplete(false), mGroupPropertiesDataComplete(false), mPendingRoleMemberRequest(false), - mAccessTime(0.0f), - mPendingBanRequest(false) + mAccessTime(0.0f) { mMemberVersion.generate(); } @@ -924,7 +924,7 @@ LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id) { return gi->second; } - return NULL; + return nullptr; } // Helper function for LLGroupMgr::processGroupMembersReply @@ -1242,8 +1242,8 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data) U32 i; LLUUID member_id; LLUUID role_id; - LLGroupRoleData* rd = NULL; - LLGroupMemberData* md = NULL; + LLGroupRoleData* rd = nullptr; + LLGroupMemberData* md = nullptr; LLGroupMgrGroupData::role_list_t::iterator ri; LLGroupMgrGroupData::member_list_t::iterator mi; @@ -1258,14 +1258,14 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data) if (role_id.notNull() && member_id.notNull() ) { - rd = NULL; + rd = nullptr; ri = group_datap->mRoles.find(role_id); if (ri != group_datap->mRoles.end()) { rd = ri->second; } - md = NULL; + md = nullptr; mi = group_datap->mMembers.find(member_id); if (mi != group_datap->mMembers.end()) { @@ -1470,7 +1470,7 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data) LLGroupMgrGroupData* LLGroupMgr::createGroupData(const LLUUID& id) { - LLGroupMgrGroupData* group_datap = NULL; + LLGroupMgrGroupData* group_datap = nullptr; group_map_t::iterator existing_group = LLGroupMgr::getInstance()->mGroups.find(id); if (existing_group == LLGroupMgr::getInstance()->mGroups.end()) @@ -1915,7 +1915,7 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, for (LLGroupMemberData::role_list_t::iterator rit = member_data->roleBegin(); rit != member_data->roleEnd(); ++rit) { - if ((*rit).first.notNull() && (*rit).second!=0) + if ((*rit).first.notNull() && (*rit).second!=nullptr) { (*rit).second->removeMember(ejected_member_id); } @@ -2110,7 +2110,7 @@ void LLGroupMgr::groupMembersRequestCoro(std::string url, LLUUID groupId) LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("groupMembersRequest", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = boost::make_shared<LLCore::HttpOptions>(); mMemberRequestInFlight = true; @@ -2219,7 +2219,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) BOOL is_owner; // Compute this once, rather than every time. - U64 default_powers = llstrtou64(defaults["default_powers"].asString().c_str(), NULL, 16); + U64 default_powers = llstrtou64(defaults["default_powers"].asString().c_str(), nullptr, 16); LLSD::map_const_iterator member_iter_start = member_list.beginMap(); LLSD::map_const_iterator member_iter_end = member_list.endMap(); @@ -2248,7 +2248,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) title = titles[member_info["title"].asInteger()].asString(); if(member_info.has("powers")) - member_powers = llstrtou64(member_info["powers"].asString().c_str(), NULL, 16); + member_powers = llstrtou64(member_info["powers"].asString().c_str(), nullptr, 16); if(member_info.has("donated_square_meters")) contribution = member_info["donated_square_meters"]; diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 7ffcbfa5a1a48e2502068ecf75a041a00d795a95..b03cefdb58ff5107b89e9b91e6960461df745d93 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -112,7 +112,7 @@ public: LLHintPopup(const Params&); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void onClickClose() { @@ -122,7 +122,7 @@ public: LLNotifications::instance().cancel(mNotification); } } - void draw(); + void draw() override; void hide() { if(!mHidden) {mHidden = true; mFadeTimer.reset();} } private: @@ -149,7 +149,8 @@ static LLDefaultChildRegistry::Register<LLHintPopup> r("hint_popup"); LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) -: mNotification(p.notification), +: LLPanel(p), + mNotification(p.notification), mDirection(TOP), mDistance(p.distance), mArrowLeft(p.left_arrow), @@ -161,10 +162,9 @@ LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) mArrowUpOffset(p.up_arrow_offset), mArrowRightOffset(p.right_arrow_offset), mArrowDownOffset(p.down_arrow_offset), - mHidden(false), mFadeInTime(p.fade_in_time), mFadeOutTime(p.fade_out_time), - LLPanel(p) + mHidden(false) { if (p.target_params.isProvided()) { diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp index d8b245b99d0f4d9c2160fc68502876e78080d7e6..4d5aadaa3079c9ef2f5989713f274cdf87bfcfab 100644 --- a/indra/newview/llhttpretrypolicy.cpp +++ b/indra/newview/llhttpretrypolicy.cpp @@ -168,10 +168,10 @@ bool LLAdaptiveRetryPolicy::getSecondsUntilRetryAfter(const std::string& retry_a // Retry-After: 120 // Check for number of seconds version, first: - char* end = 0; + char* end = nullptr; // Parse as double double seconds = std::strtod(retry_after.c_str(), &end); - if (end != 0 && *end == 0) + if (end != nullptr && *end == 0) { // Successful parse seconds_to_wait = (F32)seconds; @@ -179,7 +179,7 @@ bool LLAdaptiveRetryPolicy::getSecondsUntilRetryAfter(const std::string& retry_a } // Parse rfc1123 date. - time_t date = curl_getdate(retry_after.c_str(), NULL); + time_t date = curl_getdate(retry_after.c_str(), nullptr); if (-1 == date) return false; seconds_to_wait = (F64)date - LLTimer::getTotalSeconds(); diff --git a/indra/newview/llhttpretrypolicy.h b/indra/newview/llhttpretrypolicy.h index af07b4afecbfc5065b8a3f9fabdd5788f29f5d1a..6a32fca4cb895517627dec30c51c66b8721dfd30 100644 --- a/indra/newview/llhttpretrypolicy.h +++ b/indra/newview/llhttpretrypolicy.h @@ -65,16 +65,16 @@ public: LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries, bool retry_on_4xx = false); // virtual - void onSuccess(); + void onSuccess() override; - void reset(); + void reset() override; // virtual - void onFailure(S32 status, const LLSD& headers); + void onFailure(S32 status, const LLSD& headers) override; // virtual - void onFailure(const LLCore::HttpResponse *response); + void onFailure(const LLCore::HttpResponse *response) override; // virtual - bool shouldRetry(F32& seconds_to_wait) const; + bool shouldRetry(F32& seconds_to_wait) const override; static bool getSecondsUntilRetryAfter(const std::string& retry_after, F32& seconds_to_wait); diff --git a/indra/newview/llhudeffect.h b/indra/newview/llhudeffect.h index 7c825e3f3d76b318f127da5445a952ad17b7cde6..00bfa991963524448e815940f19df9748fd1e671 100644 --- a/indra/newview/llhudeffect.h +++ b/indra/newview/llhudeffect.h @@ -57,7 +57,7 @@ protected: LLHUDEffect(const U8 type); ~LLHUDEffect(); - /*virtual*/ void render(); + /*virtual*/ void render() override; virtual void packData(LLMessageSystem *mesgsys); virtual void unpackData(LLMessageSystem *mesgsys, S32 blocknum); diff --git a/indra/newview/llhudeffectbeam.cpp b/indra/newview/llhudeffectbeam.cpp index f0c3f71154fa170f02e5368603ba43fb8ffa69d5..b68388cac23706b3aca0c616ea3703238e261493 100644 --- a/indra/newview/llhudeffectbeam.cpp +++ b/indra/newview/llhudeffectbeam.cpp @@ -174,7 +174,7 @@ void LLHUDEffectBeam::setSourceObject(LLViewerObject *objp) if (objp->isDead()) { LL_WARNS() << "HUDEffectBeam: Source object is dead!" << LL_ENDL; - mSourceObject = NULL; + mSourceObject = nullptr; return; } @@ -220,7 +220,7 @@ void LLHUDEffectBeam::setTargetObject(LLViewerObject *objp) void LLHUDEffectBeam::setTargetPos(const LLVector3d &pos_global) { mTargetPos = pos_global; - mTargetObject = NULL; + mTargetObject = nullptr; } void LLHUDEffectBeam::render() diff --git a/indra/newview/llhudeffectbeam.h b/indra/newview/llhudeffectbeam.h index fdee5178af266059a04c808d8bddfab8c78bbb81..f30931c37eb9d4bc577db9c9aabeb0c58780d3a8 100644 --- a/indra/newview/llhudeffectbeam.h +++ b/indra/newview/llhudeffectbeam.h @@ -40,10 +40,10 @@ const S32 NUM_POINTS = 5; class LLHUDEffectBeam : public LLHUDEffect { public: - /*virtual*/ void setSourceObject(LLViewerObject *objp); + /*virtual*/ void setSourceObject(LLViewerObject *objp) override; // A beam can have either a target object or a target position - void setTargetObject(LLViewerObject *objp); + void setTargetObject(LLViewerObject *objp) override; void setTargetPos(const LLVector3d &target_pos_global); friend class LLHUDObject; @@ -51,10 +51,10 @@ protected: LLHUDEffectBeam(const U8 type); ~LLHUDEffectBeam(); - /*virtual*/ void render(); - /*virtual*/ void renderForTimer(); - /*virtual*/ void packData(LLMessageSystem *mesgsys); - /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum); + /*virtual*/ void render() override; + /*virtual*/ void renderForTimer() override; + /*virtual*/ void packData(LLMessageSystem *mesgsys) override; + /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum) override; private: void setupParticle(const S32 i); diff --git a/indra/newview/llhudeffectblob.cpp b/indra/newview/llhudeffectblob.cpp index 9499a57e86ed894081a67fda24aa4628935ccb90..1116181f85e62d5b01c6f026fea4d0610a20c547 100644 --- a/indra/newview/llhudeffectblob.cpp +++ b/indra/newview/llhudeffectblob.cpp @@ -48,7 +48,7 @@ LLHUDEffectBlob::~LLHUDEffectBlob() void LLHUDEffectBlob::markDead() { - mImage = NULL; + mImage = nullptr; LLHUDEffect::markDead(); } diff --git a/indra/newview/llhudeffectblob.h b/indra/newview/llhudeffectblob.h index ce3e8500fc180d6b98d12c33769e0fdd95a3be91..57c73609bf0009f23dfbd39a36d2e193ed8ca2fa 100644 --- a/indra/newview/llhudeffectblob.h +++ b/indra/newview/llhudeffectblob.h @@ -35,7 +35,7 @@ class LLHUDEffectBlob : public LLHUDEffect public: friend class LLHUDObject; - void markDead(); + void markDead() override; void setPixelSize(S32 pixels) { mPixelSize = pixels; } @@ -43,8 +43,8 @@ protected: LLHUDEffectBlob(const U8 type); ~LLHUDEffectBlob(); - /*virtual*/ void render(); - /*virtual*/ void renderForTimer(); + /*virtual*/ void render() override; + /*virtual*/ void renderForTimer() override; private: S32 mPixelSize; LLFrameTimer mTimer; diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index b6129259b2df747273e5f52523327309a15d7a21..bd8b787cb2ac77680a438e9909f84c4b1aa4a0a4 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -399,7 +399,7 @@ void LLHUDEffectLookAt::setTargetObjectAndOffset(LLViewerObject *objp, LLVector3 //----------------------------------------------------------------------------- void LLHUDEffectLookAt::setTargetPosGlobal(const LLVector3d &target_pos_global) { - mTargetObject = NULL; + mTargetObject = nullptr; mTargetOffsetGlobal = target_pos_global; } @@ -471,7 +471,7 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec //----------------------------------------------------------------------------- void LLHUDEffectLookAt::clearLookAtTarget() { - mTargetObject = NULL; + mTargetObject = nullptr; mTargetOffsetGlobal.clearVec(); mTargetType = LOOKAT_TARGET_NONE; if (mSourceObject.notNull()) @@ -490,7 +490,7 @@ void LLHUDEffectLookAt::markDead() ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->removeAnimationData("LookAtPoint"); } - mSourceObject = NULL; + mSourceObject = nullptr; clearLookAtTarget(); LLHUDEffect::markDead(); } diff --git a/indra/newview/llhudeffectpointat.cpp b/indra/newview/llhudeffectpointat.cpp index b03b0aac086630a066d1235ebd4b77b600541396..1b438348237252f6a232ff4a3f8f8ea93689e3f7 100644 --- a/indra/newview/llhudeffectpointat.cpp +++ b/indra/newview/llhudeffectpointat.cpp @@ -212,7 +212,7 @@ void LLHUDEffectPointAt::setTargetObjectAndOffset(LLViewerObject *objp, LLVector //----------------------------------------------------------------------------- void LLHUDEffectPointAt::setTargetPosGlobal(const LLVector3d &target_pos_global) { - mTargetObject = NULL; + mTargetObject = nullptr; mTargetOffsetGlobal = target_pos_global; } @@ -287,7 +287,7 @@ BOOL LLHUDEffectPointAt::setPointAt(EPointAtType target_type, LLViewerObject *ob //----------------------------------------------------------------------------- void LLHUDEffectPointAt::clearPointAtTarget() { - mTargetObject = NULL; + mTargetObject = nullptr; mTargetOffsetGlobal.clearVec(); mTargetType = POINTAT_TARGET_NONE; } diff --git a/indra/newview/llhudeffectpointat.h b/indra/newview/llhudeffectpointat.h index 6200b68cbc410361849908f16de03457fa4c08bc..36b61e4e6e652261d918ccea76c61e9224688880 100644 --- a/indra/newview/llhudeffectpointat.h +++ b/indra/newview/llhudeffectpointat.h @@ -47,8 +47,8 @@ class LLHUDEffectPointAt : public LLHUDEffect public: friend class LLHUDObject; - /*virtual*/ void markDead(); - /*virtual*/ void setSourceObject(LLViewerObject* objectp); + /*virtual*/ void markDead() override; + /*virtual*/ void setSourceObject(LLViewerObject* objectp) override; BOOL setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position); void clearPointAtTarget(); @@ -60,15 +60,15 @@ protected: LLHUDEffectPointAt(const U8 type); ~LLHUDEffectPointAt(); - /*virtual*/ void render(); - /*virtual*/ void packData(LLMessageSystem *mesgsys); - /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum); + /*virtual*/ void render() override; + /*virtual*/ void packData(LLMessageSystem *mesgsys) override; + /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum) override; // lookat behavior has either target position or target object with offset void setTargetObjectAndOffset(LLViewerObject *objp, LLVector3d offset); void setTargetPosGlobal(const LLVector3d &target_pos_global); bool calcTargetPosition(); - void update(); + void update() override; public: static BOOL sDebugPointAt; private: diff --git a/indra/newview/llhudeffecttrail.cpp b/indra/newview/llhudeffecttrail.cpp index d2cadce4e4b1930acdffdcbfa4c8b6a3bfb7ad7b..38eb903431ac705e496e46d1f3dadf4377e8e87c 100644 --- a/indra/newview/llhudeffecttrail.cpp +++ b/indra/newview/llhudeffecttrail.cpp @@ -71,7 +71,7 @@ void LLHUDEffectSpiral::markDead() if (mPartSourcep) { mPartSourcep->setDead(); - mPartSourcep = NULL; + mPartSourcep = nullptr; } LLHUDEffect::markDead(); } @@ -121,11 +121,11 @@ void LLHUDEffectSpiral::unpackData(LLMessageSystem *mesgsys, S32 blocknum) htonmemcpy(target_object_id.mData, packed_data + 16, MVT_LLUUID, 16); htonmemcpy(mPositionGlobal.mdV, packed_data + 32, MVT_LLVector3d, 24); - LLViewerObject *objp = NULL; + LLViewerObject *objp = nullptr; if (object_id.isNull()) { - setSourceObject(NULL); + setSourceObject(nullptr); } else { @@ -144,7 +144,7 @@ void LLHUDEffectSpiral::unpackData(LLMessageSystem *mesgsys, S32 blocknum) if (target_object_id.isNull()) { - setTargetObject(NULL); + setTargetObject(nullptr); } else { @@ -196,7 +196,7 @@ void LLHUDEffectSpiral::triggerLocal() { LLPointer<LLViewerPartSourceBeam> psb = new LLViewerPartSourceBeam; psb->setSourceObject(mSourceObject); - psb->setTargetObject(NULL); + psb->setTargetObject(nullptr); psb->setColor(color); psb->mLKGTargetPosGlobal = mPositionGlobal; psb->setOwnerUUID(gAgent.getID()); diff --git a/indra/newview/llhudeffecttrail.h b/indra/newview/llhudeffecttrail.h index ca863774eff82f00faff16c835b1037f6dd942ea..2c78773c95c31941debf72cb7375e56a4cca2820 100644 --- a/indra/newview/llhudeffecttrail.h +++ b/indra/newview/llhudeffecttrail.h @@ -42,8 +42,8 @@ constexpr U32 NUM_TRAIL_POINTS = 40; class LLHUDEffectSpiral : public LLHUDEffect { public: - /*virtual*/ void markDead(); - /*virtual*/ void setTargetObject(LLViewerObject* objectp); + /*virtual*/ void markDead() override; + /*virtual*/ void setTargetObject(LLViewerObject* objectp) override; void setVMag(F32 vmag) { mVMag = vmag; } void setVOffset(F32 offset) { mVOffset = offset; } void setInitialRadius(F32 radius) { mInitialRadius = radius; } @@ -61,10 +61,10 @@ protected: LLHUDEffectSpiral(const U8 type); ~LLHUDEffectSpiral(); - /*virtual*/ void render(); - /*virtual*/ void renderForTimer(); - /*virtual*/ void packData(LLMessageSystem *mesgsys); - /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum); + /*virtual*/ void render() override; + /*virtual*/ void renderForTimer() override; + /*virtual*/ void packData(LLMessageSystem *mesgsys) override; + /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum) override; private: /* void setupParticle(const S32 i, const F32 start_time); diff --git a/indra/newview/llhudicon.h b/indra/newview/llhudicon.h index 6e6976dfa20169b24af05f36ed16b46e185012f2..25da0b1fc91aed621ac5e597aab865ba13ae56ec 100644 --- a/indra/newview/llhudicon.h +++ b/indra/newview/llhudicon.h @@ -46,9 +46,9 @@ class LLHUDIcon : public LLHUDObject friend class LLHUDObject; public: - /*virtual*/ void render(); - /*virtual*/ void markDead(); - /*virtual*/ F32 getDistance() const { return mDistance; } + /*virtual*/ void render() override; + /*virtual*/ void markDead() override; + /*virtual*/ F32 getDistance() const override { return mDistance; } void setImage(LLViewerTexture* imagep); void setScale(F32 fraction_of_fov); diff --git a/indra/newview/llhudmanager.cpp b/indra/newview/llhudmanager.cpp index 4829732e44ea5d78a1cb623a6935d92d0aee908a..e783685a49df62f7fc7b3c2a44578ad1c1223dac 100644 --- a/indra/newview/llhudmanager.cpp +++ b/indra/newview/llhudmanager.cpp @@ -134,7 +134,7 @@ LLHUDEffect *LLHUDManager::createViewerEffect(const U8 type, BOOL send_to_sim, B LLHUDEffect *hep = LLHUDObject::addHUDEffect(type); if (!hep) { - return NULL; + return nullptr; } LLUUID tmp; @@ -151,7 +151,7 @@ LLHUDEffect *LLHUDManager::createViewerEffect(const U8 type, BOOL send_to_sim, B //static void LLHUDManager::processViewerEffect(LLMessageSystem *mesgsys, void **user_data) { - LLHUDEffect *effectp = NULL; + LLHUDEffect *effectp = nullptr; LLUUID effect_id; U8 effect_type = 0; S32 number_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_Effect); @@ -159,7 +159,7 @@ void LLHUDManager::processViewerEffect(LLMessageSystem *mesgsys, void **user_dat for (k = 0; k < number_blocks; k++) { - effectp = NULL; + effectp = nullptr; LLHUDEffect::getIDType(mesgsys, k, effect_id, effect_type); S32 i; for (i = 0; i < LLHUDManager::getInstance()->mHUDEffects.size(); i++) diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index 87c8bab06d6da6ed7ab8bc63f8f29ff0af981efb..7c69b90b7c574808f756484af887b4dd1fe3acb6 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -79,8 +79,8 @@ bool llhudnametag_further_away::operator()(const LLPointer<LLHUDNameTag>& lhs, c LLHUDNameTag::LLHUDNameTag(const U8 type) : LLHUDObject(type), mDoFade(TRUE), - mFadeDistance(8.f), mFadeRange(4.f), + mFadeDistance(8.f), mLastDistance(0.f), mZCompare(TRUE), mVisibleOffScreen(FALSE), diff --git a/indra/newview/llhudnametag.h b/indra/newview/llhudnametag.h index 11fed4c87f934e935635750a9d80c9b370f96982..7fc953e4e7cfc77e5d37b500855ac227c4b1626b 100644 --- a/indra/newview/llhudnametag.h +++ b/indra/newview/llhudnametag.h @@ -56,8 +56,8 @@ protected: LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color, const LLFontGL* font) : mColor(color), mStyle(style), - mText(text), - mFont(font) + mFont(font), + mText(text) {} F32 getWidth(const LLFontGL* font); const LLWString& getText() const { return mText; } @@ -91,7 +91,7 @@ public: void clearString(); // Add text a line at a time, allowing custom formatting - void addLine(const std::string &text_utf8, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = NULL); + void addLine(const std::string &text_utf8, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = nullptr); // For bubble chat, set the part above the chat text void setLabel(const std::string& label_utf8); @@ -114,9 +114,9 @@ public: // void setMass(F32 mass) { mMass = llmax(0.1f, mass); } void setTextAlignment(ETextAlignment alignment) { mTextAlignment = alignment; } void setVertAlignment(EVertAlignment alignment) { mVertAlignment = alignment; } - /*virtual*/ void markDead(); + /*virtual*/ void markDead() override; friend class LLHUDObject; - /*virtual*/ F32 getDistance() const { return mLastDistance; } + /*virtual*/ F32 getDistance() const override { return mLastDistance; } S32 getLOD() { return mLOD; } BOOL getVisible() { return mVisible; } BOOL getHidden() const { return mHidden; } @@ -133,7 +133,7 @@ public: protected: LLHUDNameTag(const U8 type); - /*virtual*/ void render(); + /*virtual*/ void render() override; void renderText(BOOL for_select); static void updateAll(); void setLOD(S32 lod); diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index eb2a7299acce06799d7e26a7c517f7eda656f664..ce7bb795d982bc720b4a316c8baa64f28212b4d5 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -55,8 +55,8 @@ protected: LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color, const LLFontGL* font) : mColor(color), mStyle(style), - mText(text), - mFont(font) + mFont(font), + mText(text) {} F32 getWidth(const LLFontGL* font); const LLWString& getText() const { return mText; } @@ -90,7 +90,7 @@ public: void clearString(); // Add text a line at a time, allowing custom formatting - void addLine(const std::string &text_utf8, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = NULL); + void addLine(const std::string &text_utf8, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = nullptr); // Sets the default font for lines with no font specified void setFont(const LLFontGL* font); @@ -109,9 +109,9 @@ public: void setMass(F32 mass) { mMass = llmax(0.1f, mass); } void setTextAlignment(ETextAlignment alignment) { mTextAlignment = alignment; } void setVertAlignment(EVertAlignment alignment) { mVertAlignment = alignment; } - /*virtual*/ void markDead(); + /*virtual*/ void markDead() override; friend class LLHUDObject; - /*virtual*/ F32 getDistance() const { return mLastDistance; } + /*virtual*/ F32 getDistance() const override { return mLastDistance; } BOOL getVisible() { return mVisible; } BOOL getHidden() const { return mHidden; } void setHidden( BOOL hide ) { mHidden = hide; } @@ -126,7 +126,7 @@ public: protected: LLHUDText(const U8 type); - /*virtual*/ void render(); + /*virtual*/ void render() override; void renderText(); static void updateAll(); S32 getMaxLines(); diff --git a/indra/newview/llhudview.cpp b/indra/newview/llhudview.cpp index 50e5628cc8ac530eee5b9a0e628a1b231774563e..e52b5f572dc2ac24354445f5c1615b0c6566486a 100644 --- a/indra/newview/llhudview.cpp +++ b/indra/newview/llhudview.cpp @@ -43,7 +43,7 @@ #include "llviewercamera.h" #include "llui.h" -LLHUDView *gHUDView = NULL; +LLHUDView *gHUDView = nullptr; LLHUDView::LLHUDView(const LLRect& r) { diff --git a/indra/newview/llhudview.h b/indra/newview/llhudview.h index 6689554706cb9cd5aee22155ac359c940b82f0e9..3914be7331db8c775535c1fc1f818e2ed220e220 100644 --- a/indra/newview/llhudview.h +++ b/indra/newview/llhudview.h @@ -39,10 +39,10 @@ public: LLHUDView(const LLRect& rect); virtual ~LLHUDView(); - virtual void draw(); + void draw() override; protected: - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; }; extern LLHUDView *gHUDView; diff --git a/indra/newview/llimagefiltersmanager.h b/indra/newview/llimagefiltersmanager.h index f14833f26872c8a6637fd0a513370bcf7a21c089..3526a7b311cd2055f4e3838c82bb66e0303852e0 100644 --- a/indra/newview/llimagefiltersmanager.h +++ b/indra/newview/llimagefiltersmanager.h @@ -43,7 +43,7 @@ private: void loadAllFilters(); void loadFiltersFromDir(const std::string& dir); - /*virtual*/ void initSingleton(); + /*virtual*/ void initSingleton() override; // List of filters : first is the user friendly localized name, second is the xml file name std::map<std::string,std::string> mFiltersList; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index eb1d5e2ab9481fc9dee1a32fdce0ece7fbc8ab8e..cb96007e54666248d84c16ab33441eac7c8c73fd 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -84,13 +84,13 @@ void start_deprecated_conference_chat(const LLUUID& temp_session_id, const LLUUI std::string LLCallDialogManager::sPreviousSessionlName = ""; LLIMModel::LLIMSession::SType LLCallDialogManager::sPreviousSessionType = LLIMModel::LLIMSession::P2P_SESSION; std::string LLCallDialogManager::sCurrentSessionlName = ""; -LLIMModel::LLIMSession* LLCallDialogManager::sSession = NULL; +LLIMModel::LLIMSession* LLCallDialogManager::sSession = nullptr; LLVoiceChannel::EState LLCallDialogManager::sOldState = LLVoiceChannel::STATE_READY; const LLUUID LLOutgoingCallDialog::OCD_KEY = LLUUID("7CF78E11-0CFE-498D-ADB9-1417BF03DDB4"); // // Globals // -LLIMMgr* gIMMgr = NULL; +LLIMMgr* gIMMgr = nullptr; BOOL LLSessionTimeoutTimer::tick() @@ -274,7 +274,7 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg) { if (session_floater->getHost()) { - if (NULL != im_box && im_box->isMinimized()) + if (nullptr != im_box && im_box->isMinimized()) { LLFloater::onClickMinimize(im_box); } @@ -530,8 +530,8 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& mInitialTargetIDs(ids), mParticipantUnreadMessageCount(0), mNumUnread(0), - mVoiceChannel(NULL), - mSpeakers(NULL), + mVoiceChannel(nullptr), + mSpeakers(nullptr), mSessionInitialized(false), mCallBackEnabled(true), mTextIMPossible(true), @@ -737,7 +737,7 @@ LLIMModel::LLIMSession::~LLIMSession() } delete mSpeakers; - mSpeakers = NULL; + mSpeakers = nullptr; // End the text IM session if necessary if(LLVoiceClient::getInstance() && mOtherParticipantID.notNull()) @@ -761,7 +761,7 @@ LLIMModel::LLIMSession::~LLIMSession() mVoiceChannel->deactivate(); delete mVoiceChannel; - mVoiceChannel = NULL; + mVoiceChannel = nullptr; } void LLIMModel::LLIMSession::sessionInitReplyReceived(const LLUUID& new_session_id) @@ -856,16 +856,16 @@ void LLIMModel::LLIMSession::loadHistory() LLIMModel::LLIMSession* LLIMModel::findIMSession(const LLUUID& session_id) const { - return get_if_there(mId2SessionMap, session_id, (LLIMModel::LLIMSession*) NULL); + return get_if_there(mId2SessionMap, session_id, (LLIMModel::LLIMSession*)nullptr); } //*TODO consider switching to using std::set instead of std::list for holding LLUUIDs across the whole code LLIMModel::LLIMSession* LLIMModel::findAdHocIMSession(const uuid_vec_t& ids) { S32 num = ids.size(); - if (!num) return NULL; + if (!num) return nullptr; - if (mId2SessionMap.empty()) return NULL; + if (mId2SessionMap.empty()) return nullptr; std::map<LLUUID, LLIMSession*>::const_iterator it = mId2SessionMap.begin(); for (; it != mId2SessionMap.end(); ++it) @@ -895,7 +895,7 @@ LLIMModel::LLIMSession* LLIMModel::findAdHocIMSession(const uuid_vec_t& ids) } } - return NULL; + return nullptr; } bool LLIMModel::LLIMSession::isOutgoingAdHoc() const @@ -1233,7 +1233,7 @@ LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id, if (!session) { LL_WARNS() << "session " << session_id << "does not exist " << LL_ENDL; - return NULL; + return nullptr; } // replace interactive system message marker with correct from string value @@ -1318,7 +1318,7 @@ LLVoiceChannel* LLIMModel::getVoiceChannel( const LLUUID& session_id ) const if (!session) { LL_WARNS() << "session " << session_id << "does not exist " << LL_ENDL; - return NULL; + return nullptr; } return session->mVoiceChannel; @@ -1330,7 +1330,7 @@ LLIMSpeakerMgr* LLIMModel::getSpeakerManager( const LLUUID& session_id ) const if (!session) { LL_WARNS() << "session " << session_id << " does not exist " << LL_ENDL; - return NULL; + return nullptr; } return session->mSpeakers; @@ -1404,7 +1404,7 @@ void LLIMModel::sendMessage(const std::string& utf8_text, bool sent = false; LLAgentUI::buildFullname(name); - const LLRelationship* info = NULL; + const LLRelationship* info = nullptr; info = LLAvatarTracker::instance().getBuddyInfo(other_participant_id); U8 offline = (!info || info->isOnline()) ? IM_ONLINE : IM_OFFLINE; @@ -1507,11 +1507,11 @@ void LLIMModel::sendMessage(const std::string& utf8_text, } // Add the recipient to the recent people list. - bool is_not_group_id = LLGroupMgr::getInstance()->getGroupData(other_participant_id) == NULL; + bool is_not_group_id = LLGroupMgr::getInstance()->getGroupData(other_participant_id) == nullptr; if (is_not_group_id) { - if( session == 0)//??? shouldn't really happen + if( session == nullptr)//??? shouldn't really happen { LLRecentPeople::instance().add(other_participant_id); return; @@ -1543,7 +1543,7 @@ void LLIMModel::addSpeakersToRecent(const LLUUID& im_session_id) { LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(im_session_id); LLSpeakerMgr::speaker_list_t speaker_list; - if(speaker_mgr != NULL) + if(speaker_mgr != nullptr) { speaker_mgr->getSpeakerList(&speaker_list, true); } @@ -1884,7 +1884,7 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id) void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction, bool ended_by_agent) { LLSD mCallDialogPayload; - LLOutgoingCallDialog* ocd = NULL; + LLOutgoingCallDialog* ocd = nullptr; if(sOldState == new_state) { @@ -1941,10 +1941,10 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat // Class LLCallDialog //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LLCallDialog::LLCallDialog(const LLSD& payload) - : LLDockableFloater(NULL, false, payload), + : LLDockableFloater(nullptr, false, payload), - mPayload(payload), - mLifetime(DEFAULT_LIFETIME) + mLifetime(DEFAULT_LIFETIME), + mPayload(payload) { setAutoFocus(FALSE); // force docked state since this floater doesn't save it between recreations @@ -2018,7 +2018,7 @@ void LLCallDialog::draw() onLifetimeExpired(); } - if (getDockControl() != NULL) + if (getDockControl() != nullptr) { LLDockableFloater::draw(); } @@ -2694,7 +2694,7 @@ void LLIMMgr::addMessage( if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && !from_linden) { // Evaluate if we need to skip this message when that setting is true (default is false) - skip_message = (LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL); // Skip non friends... + skip_message = (LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == nullptr); // Skip non friends... skip_message &= !(other_participant_id == gAgentID); // You are your best friend... Don't skip yourself } @@ -2950,7 +2950,7 @@ LLUUID LLIMMgr::addSession( } } - bool new_session = (LLIMModel::getInstance()->findIMSession(session_id) == NULL); + bool new_session = (LLIMModel::getInstance()->findIMSession(session_id) == nullptr); //works only for outgoing ad-hoc sessions if (new_session && IM_SESSION_CONFERENCE_START == dialog && ids.size()) @@ -3103,7 +3103,7 @@ void LLIMMgr::inviteToSession( if (voice_invite) { bool isRejectGroupCall = (gSavedSettings.getBOOL("VoiceCallsRejectGroup") && (notify_box_type == "VoiceInviteGroup")); - bool isRejectNonFriendCall = (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL)); + bool isRejectNonFriendCall = (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(caller_id) == nullptr)); if (isRejectGroupCall || isRejectNonFriendCall || gAgent.isDoNotDisturb()) { if (gAgent.isDoNotDisturb() && !isRejectGroupCall && !isRejectNonFriendCall) @@ -3176,7 +3176,7 @@ void LLIMMgr::disconnectAllSessions() BOOL LLIMMgr::hasSession(const LLUUID& session_id) { - return LLIMModel::getInstance()->findIMSession(session_id) != NULL; + return LLIMModel::getInstance()->findIMSession(session_id) != nullptr; } void LLIMMgr::clearPendingInvitation(const LLUUID& session_id) @@ -3434,7 +3434,7 @@ void LLIMMgr::noteOfflineUsers( } else { - const LLRelationship* info = NULL; + const LLRelationship* info = nullptr; LLAvatarTracker& at = LLAvatarTracker::instance(); LLIMModel& im_model = LLIMModel::instance(); for(S32 i = 0; i < count; ++i) @@ -3506,7 +3506,7 @@ void LLIMMgr::processIMTypingCore(const LLIMInfo* im_info, BOOL typing) class LLViewerChatterBoxSessionStartReply : public LLHTTPNode { public: - virtual void describe(Description& desc) const + void describe(Description& desc) const override { desc.shortInfo("Used for receiving a reply to a request to initialize an ChatterBox session"); desc.postAPI(); @@ -3515,9 +3515,9 @@ public: desc.source(__FILE__, __LINE__); } - virtual void post(ResponsePtr response, + void post(ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { LLSD body; LLUUID temp_session_id; @@ -3565,7 +3565,7 @@ public: class LLViewerChatterBoxSessionEventReply : public LLHTTPNode { public: - virtual void describe(Description& desc) const + void describe(Description& desc) const override { desc.shortInfo("Used for receiving a reply to a ChatterBox session event"); desc.postAPI(); @@ -3574,9 +3574,9 @@ public: desc.source(__FILE__, __LINE__); } - virtual void post(ResponsePtr response, + void post(ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { LLUUID session_id; bool success; @@ -3599,9 +3599,9 @@ public: class LLViewerForceCloseChatterBoxSession: public LLHTTPNode { public: - virtual void post(ResponsePtr response, + void post(ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { LLUUID session_id; std::string reason; @@ -3616,10 +3616,10 @@ public: class LLViewerChatterBoxSessionAgentListUpdates : public LLHTTPNode { public: - virtual void post( + void post( ResponsePtr responder, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { const LLUUID& session_id = input["body"]["session_id"].asUUID(); gIMMgr->processAgentListUpdates(session_id, input["body"]); @@ -3629,10 +3629,10 @@ public: class LLViewerChatterBoxSessionUpdate : public LLHTTPNode { public: - virtual void post( + void post( ResponsePtr responder, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { LLUUID session_id = input["body"]["session_id"].asUUID(); LLFloaterIMSession* im_floater = LLFloaterIMSession::findInstance(session_id); @@ -3653,10 +3653,10 @@ class LLViewerChatterBoxInvitation : public LLHTTPNode { public: - virtual void post( + void post( ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { //for backwards compatiblity reasons...we need to still //check for 'text' or 'voice' invitations...bleh diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 659fa0f509eb832bc691e7494b47f4ce56ea7e91..8e195847375b65786be2ebc0cb32e2da0a433f11 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -50,7 +50,7 @@ class LLSessionTimeoutTimer : public LLEventTimer public: LLSessionTimeoutTimer(const LLUUID& session_id, F32 period) : LLEventTimer(period), mSessionId(session_id) {} virtual ~LLSessionTimeoutTimer() {}; - /* virtual */ BOOL tick(); + /* virtual */ BOOL tick() override; private: LLUUID mSessionId; @@ -524,13 +524,13 @@ public: LLCallDialog(const LLSD& payload); virtual ~LLCallDialog(); - virtual BOOL postBuild(); + BOOL postBuild() override; void dockToToolbarButton(const std::string& toolbarButtonName); // check timer state - /*virtual*/ void draw(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void draw() override; + /*virtual*/ void onOpen(const LLSD& key) override; protected: // lifetime timer for a notification @@ -569,8 +569,8 @@ public: } } - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; static void onAccept(void* user_data); static void onReject(void* user_data); @@ -587,7 +587,7 @@ private: boost::signals2::connection mAvatarNameCacheConnection; - /*virtual*/ void onLifetimeExpired(); + /*virtual*/ void onLifetimeExpired() override; }; class LLOutgoingCallDialog : public LLCallDialog @@ -595,7 +595,7 @@ class LLOutgoingCallDialog : public LLCallDialog public: LLOutgoingCallDialog(const LLSD& payload); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void show(const LLSD& key); static void onCancel(void* user_data); diff --git a/indra/newview/llinspect.h b/indra/newview/llinspect.h index 1f6aafc7bdc2446e18c66dd30800a94e73afcc0f..4401bf35f2e3f2b5fca2389e36a29c7054398ff0 100644 --- a/indra/newview/llinspect.h +++ b/indra/newview/llinspect.h @@ -38,17 +38,17 @@ public: virtual ~LLInspect(); /// Inspectors have a custom fade-in/fade-out animation - /*virtual*/ void draw(); + /*virtual*/ void draw() override; - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override; /// Start open animation - /*virtual*/ void onOpen(const LLSD& avatar_id); + /*virtual*/ void onOpen(const LLSD& avatar_id) override; /// Inspectors close themselves when they lose focus - /*virtual*/ void onFocusLost(); + /*virtual*/ void onFocusLost() override; protected: diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 12d0a8621bb8d07efaf52892774dcf9adce320bd..115efb935d193e15504e236304b1570e04d270ca 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -70,16 +70,16 @@ public: LLInspectAvatar(const LLSD& avatar_id); virtual ~LLInspectAvatar(); - /*virtual*/ BOOL postBuild(void); + /*virtual*/ BOOL postBuild(void) override; // Because floater is single instance, need to re-parse data on each spawn // (for example, inspector about same avatar but in different position) - /*virtual*/ void onOpen(const LLSD& avatar_id); + /*virtual*/ void onOpen(const LLSD& avatar_id) override; // Update view based on information from avatar properties processor void processAvatarData(LLAvatarData* data); - - virtual LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::GLOBAL; } + + LLTransientFloaterMgr::ETransientGroup getGroup() override { return LLTransientFloaterMgr::GLOBAL; } private: // Make network requests for all the data to display in this view. @@ -137,7 +137,7 @@ public: removeObserver(mAvatarID, this); } - void processProperties(void* data, EAvatarProcessorType type) + void processProperties(void* data, EAvatarProcessorType type) override { // route the data to the inspector if (data @@ -157,7 +157,7 @@ LLInspectAvatar::LLInspectAvatar(const LLSD& sd) : LLInspect( LLSD() ), // single_instance, doesn't really need key mAvatarID(), // set in onOpen() *Note: we used to show partner's name but we dont anymore --angela 3rd Dec* mAvatarName(), - mPropertiesRequest(NULL), + mPropertiesRequest(nullptr), mAvatarNameCacheConnection() { // can't make the properties request until the widgets are constructed @@ -176,7 +176,7 @@ LLInspectAvatar::~LLInspectAvatar() // clean up any pending requests so they don't call back into a deleted // view delete mPropertiesRequest; - mPropertiesRequest = NULL; + mPropertiesRequest = nullptr; LLTransientFloaterMgr::getInstance()->removeControlView(this); } @@ -292,7 +292,7 @@ void LLInspectAvatar::processAvatarData(LLAvatarData* data) // Delete the request object as it has been satisfied delete mPropertiesRequest; - mPropertiesRequest = NULL; + mPropertiesRequest = nullptr; } void LLInspectAvatar::updateVolumeSlider() diff --git a/indra/newview/llinspectgroup.cpp b/indra/newview/llinspectgroup.cpp index c7044c8d444dc6ab037c64f5fee080a5da2ff476..f0ce376dd8a17af9b996bfa1dc19c9224daf3771 100644 --- a/indra/newview/llinspectgroup.cpp +++ b/indra/newview/llinspectgroup.cpp @@ -63,17 +63,17 @@ public: // Because floater is single instance, need to re-parse data on each spawn // (for example, inspector about same group but in different position) - /*virtual*/ void onOpen(const LLSD& group_id); + /*virtual*/ void onOpen(const LLSD& group_id) override; void setGroupID(const LLUUID& group_id); // When closing they should close their gear menu - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onClose(bool app_quitting) override; // Update view based on information from group manager void processGroupData(); - virtual void changed(LLGroupChange gc); + void changed(LLGroupChange gc) override; // Make network requests for all the data to display in this view. // Used on construction and if avatar id changes. diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp index 765d60ea12d867d25a60e5bd1a14fb6030feb79e..045ec234e2024cf28855bd86df71420b7e14dd96 100644 --- a/indra/newview/llinspecttoast.cpp +++ b/indra/newview/llinspecttoast.cpp @@ -48,9 +48,9 @@ public: LLInspectToast(const LLSD& notification_idl); virtual ~LLInspectToast(); - /*virtual*/ void onOpen(const LLSD& notification_id); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); - /*virtual*/ void removeChild(LLView* child); + /*virtual*/ void onOpen(const LLSD& notification_id) override; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; + /*virtual*/ void removeChild(LLView* child) override; private: void onToastDestroy(LLToast * toast); @@ -60,12 +60,12 @@ private: }; LLInspectToast::LLInspectToast(const LLSD& notification_id) : - LLInspect(LLSD()), mPanel(NULL) + LLInspect(LLSD()), mPanel(nullptr) { LLScreenChannelBase* channel = LLChannelManager::getInstance()->findChannelByID( LLUUID(gSavedSettings.getString("NotificationChannelUUID"))); mScreenChannel = dynamic_cast<LLScreenChannel*>(channel); - if(NULL == mScreenChannel) + if(nullptr == mScreenChannel) { LL_WARNS() << "Could not get requested screen channel." << LL_ENDL; return; @@ -85,7 +85,7 @@ void LLInspectToast::onOpen(const LLSD& notification_id) { LLInspect::onOpen(notification_id); LLToast* toast = mScreenChannel->getToastByNotificationID(notification_id); - if (toast == NULL) + if (toast == nullptr) { LL_WARNS() << "Could not get requested toast from screen channel." << LL_ENDL; return; @@ -93,14 +93,14 @@ void LLInspectToast::onOpen(const LLSD& notification_id) mConnection = toast->setOnToastDestroyedCallback(boost::bind(&LLInspectToast::onToastDestroy, this, _1)); LLPanel * panel = toast->getPanel(); - if (panel == NULL) + if (panel == nullptr) { LL_WARNS() << "Could not get toast's panel." << LL_ENDL; return; } panel->setVisible(TRUE); panel->setMouseOpaque(FALSE); - if(mPanel != NULL && mPanel->getParent() == this) + if(mPanel != nullptr && mPanel->getParent() == this) { LLInspect::removeChild(mPanel); } @@ -130,7 +130,7 @@ void LLInspectToast::removeChild(LLView* child) { if (mPanel == child) { - mPanel = NULL; + mPanel = nullptr; } LLInspect::removeChild(child); } diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index bac365987c341abc4c5355b2ab3a228062235c2d..bf3914273b8757486345f7d6e79a828512009291 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -82,7 +82,7 @@ public: //-------------------------------------------------------------------- // LLInvFVBridge functionality //-------------------------------------------------------------------- - virtual const LLUUID& getUUID() const { return mUUID; } + const LLUUID& getUUID() const override { return mUUID; } virtual void clearDisplayName() { mDisplayName.clear(); } virtual void restoreItem() {} virtual void restoreToWorld() {} @@ -90,50 +90,52 @@ public: //-------------------------------------------------------------------- // Inherited LLFolderViewModelItemInventory functions //-------------------------------------------------------------------- - virtual const std::string& getName() const; - virtual const std::string& getDisplayName() const; - const std::string& getSearchableName() const { return mSearchableName; } - - virtual PermissionMask getPermissionMask() const; - virtual LLFolderType::EType getPreferredType() const; - virtual time_t getCreationDate() const; - virtual void setCreationDate(time_t creation_date_utc); - virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } - virtual std::string getLabelSuffix() const { return LLStringUtil::null; } - virtual void openItem() {} - virtual void closeItem() {} - virtual void showProperties(); - virtual BOOL isItemRenameable() const { return TRUE; } + const std::string& getName() const override; + const std::string& getDisplayName() const override; + const std::string& getSearchableName() const override { return mSearchableName; } + + PermissionMask getPermissionMask() const override; + LLFolderType::EType getPreferredType() const override; + time_t getCreationDate() const override; + void setCreationDate(time_t creation_date_utc) override; + LLFontGL::StyleFlags getLabelStyle() const override { return LLFontGL::NORMAL; } + std::string getLabelSuffix() const override { return LLStringUtil::null; } + void openItem() override {} + void closeItem() override {} + void showProperties() override; + BOOL isItemRenameable() const override { return TRUE; } //virtual BOOL renameItem(const std::string& new_name) {} - virtual BOOL isItemRemovable() const; - virtual BOOL isItemMovable() const; - virtual BOOL isItemInTrash() const; + BOOL isItemRemovable() const override; + BOOL isItemMovable() const override; + BOOL isItemInTrash() const override; virtual BOOL isLink() const; virtual BOOL isLibraryItem() const; //virtual BOOL removeItem() = 0; - virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch); - virtual void move(LLFolderViewModelItem* new_parent_bridge) {} - virtual BOOL isItemCopyable() const { return FALSE; } - virtual BOOL copyToClipboard() const; - virtual BOOL cutToClipboard(); - virtual bool isCutToClipboard(); - virtual BOOL isClipboardPasteable() const; + void removeBatch(std::vector<LLFolderViewModelItem*>& batch) override; + void move(LLFolderViewModelItem* new_parent_bridge) override {} + BOOL isItemCopyable() const override { return FALSE; } + BOOL copyToClipboard() const override; + BOOL cutToClipboard() override; + bool isCutToClipboard() override; + BOOL isClipboardPasteable() const override; virtual BOOL isClipboardPasteableAsLink() const; - virtual void pasteFromClipboard() {} - virtual void pasteLinkFromClipboard() {} + void pasteFromClipboard() override {} + void pasteLinkFromClipboard() override {} void getClipboardEntries(bool show_asset_id, menuentry_vec_t &items, menuentry_vec_t &disabled_items, U32 flags); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual LLToolDragAndDrop::ESource getDragSource() const; - virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const; - virtual BOOL dragOrDrop(MASK mask, BOOL drop, + void buildContextMenu(LLMenuGL& menu, U32 flags) override; + LLToolDragAndDrop::ESource getDragSource() const override; + BOOL startDrag(EDragAndDropType* type, LLUUID* id) const override; + + BOOL dragOrDrop(MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, - std::string& tooltip_msg) { return FALSE; } - virtual LLInventoryType::EType getInventoryType() const { return mInvType; } - virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; } - EInventorySortGroup getSortGroup() const { return SG_ITEM; } - virtual LLInventoryObject* getInventoryObject() const; + std::string& tooltip_msg) override { return FALSE; } + + LLInventoryType::EType getInventoryType() const override { return mInvType; } + LLWearableType::EType getWearableType() const override { return LLWearableType::WT_NONE; } + EInventorySortGroup getSortGroup() const override { return SG_ITEM; } + LLInventoryObject* getInventoryObject() const override; //-------------------------------------------------------------------- @@ -222,30 +224,30 @@ public: typedef std::function<void(std::string& slurl)> slurl_callback_t; - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void selectItem(); - virtual void restoreItem(); - virtual void restoreToWorld(); + void performAction(LLInventoryModel* model, std::string action) override; + void selectItem() override; + void restoreItem() override; + void restoreToWorld() override; virtual void gotoItem(); - virtual LLUIImagePtr getIcon() const; - virtual std::string getLabelSuffix() const; - virtual LLFontGL::StyleFlags getLabelStyle() const; - virtual PermissionMask getPermissionMask() const; - virtual time_t getCreationDate() const; - virtual BOOL isItemRenameable() const; - virtual BOOL renameItem(const std::string& new_name); - virtual BOOL removeItem(); - virtual BOOL isItemCopyable() const; - virtual bool hasChildren() const { return FALSE; } - virtual BOOL isUpToDate() const { return TRUE; } - virtual LLUIImagePtr getIconOverlay() const; + LLUIImagePtr getIcon() const override; + std::string getLabelSuffix() const override; + LLFontGL::StyleFlags getLabelStyle() const override; + PermissionMask getPermissionMask() const override; + time_t getCreationDate() const override; + BOOL isItemRenameable() const override; + BOOL renameItem(const std::string& new_name) override; + BOOL removeItem() override; + BOOL isItemCopyable() const override; + bool hasChildren() const override { return FALSE; } + BOOL isUpToDate() const override { return TRUE; } + LLUIImagePtr getIconOverlay() const override; LLViewerInventoryItem* getItem() const; protected: BOOL confirmRemoveItem(const LLSD& notification, const LLSD& response); - virtual BOOL isItemPermissive() const; - virtual void buildDisplayName() const; + BOOL isItemPermissive() const override; + void buildDisplayName() const override; void doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb); private: @@ -269,48 +271,48 @@ public: void callback_dropItemIntoFolder(const LLSD& notification, const LLSD& response, LLInventoryItem* inv_item); void callback_dropCategoryIntoFolder(const LLSD& notification, const LLSD& response, LLInventoryCategory* inv_category); - virtual void buildDisplayName() const; + void buildDisplayName() const override; - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void openItem(); - virtual void closeItem(); - virtual BOOL isItemRenameable() const; - virtual void selectItem(); - virtual void restoreItem(); + void performAction(LLInventoryModel* model, std::string action) override; + void openItem() override; + void closeItem() override; + BOOL isItemRenameable() const override; + void selectItem() override; + void restoreItem() override; - virtual LLFolderType::EType getPreferredType() const; - virtual LLUIImagePtr getIcon() const; - virtual LLUIImagePtr getIconOpen() const; - virtual LLUIImagePtr getIconOverlay() const; + LLFolderType::EType getPreferredType() const override; + LLUIImagePtr getIcon() const override; + LLUIImagePtr getIconOpen() const override; + LLUIImagePtr getIconOverlay() const override; static LLUIImagePtr getIcon(LLFolderType::EType preferred_type); - virtual std::string getLabelSuffix() const; - virtual LLFontGL::StyleFlags getLabelStyle() const; + std::string getLabelSuffix() const override; + LLFontGL::StyleFlags getLabelStyle() const override; - virtual BOOL renameItem(const std::string& new_name); + BOOL renameItem(const std::string& new_name) override; - virtual BOOL removeItem(); + BOOL removeItem() override; BOOL removeSystemFolder(); bool removeItemResponse(const LLSD& notification, const LLSD& response); void updateHierarchyCreationDate(time_t date); - virtual void pasteFromClipboard(); - virtual void pasteLinkFromClipboard(); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual bool hasChildren() const; - virtual BOOL dragOrDrop(MASK mask, BOOL drop, + void pasteFromClipboard() override; + void pasteLinkFromClipboard() override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; + bool hasChildren() const override; + BOOL dragOrDrop(MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, - std::string& tooltip_msg); - - virtual BOOL isItemRemovable() const; - virtual BOOL isItemMovable() const ; - virtual BOOL isUpToDate() const; - virtual BOOL isItemCopyable() const; - virtual BOOL isClipboardPasteable() const; - virtual BOOL isClipboardPasteableAsLink() const; + std::string& tooltip_msg) override; + + BOOL isItemRemovable() const override; + BOOL isItemMovable() const override; + BOOL isUpToDate() const override; + BOOL isItemCopyable() const override; + BOOL isClipboardPasteable() const override; + BOOL isClipboardPasteableAsLink() const override; - EInventorySortGroup getSortGroup() const; - virtual void update(); + EInventorySortGroup getSortGroup() const override; + void update() override; static void createWearable(LLFolderBridge* bridge, LLWearableType::EType type); @@ -382,10 +384,11 @@ public: { mInvType = type; } - virtual LLUIImagePtr getIcon() const; - virtual void openItem(); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual void performAction(LLInventoryModel* model, std::string action); + + LLUIImagePtr getIcon() const override; + void openItem() override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; + void performAction(LLInventoryModel* model, std::string action) override; bool canSaveTexture(void); }; @@ -396,9 +399,10 @@ public: LLFolderView* root, const LLUUID& uuid) : LLItemBridge(inventory, root, uuid) {} - virtual void openItem(); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual void performAction(LLInventoryModel* model, std::string action); + + void openItem() override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; + void performAction(LLInventoryModel* model, std::string action) override; static void openSoundPreview(void*); }; @@ -409,10 +413,10 @@ public: LLFolderView* root, const LLUUID& uuid, U32 flags = 0x00); - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual LLUIImagePtr getIcon() const; - virtual void openItem(); + void performAction(LLInventoryModel* model, std::string action) override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; + LLUIImagePtr getIcon() const override; + void openItem() override; protected: BOOL mVisited; }; @@ -424,16 +428,16 @@ public: LLFolderView* folder, const LLUUID& uuid ); ~LLCallingCardBridge(); - virtual std::string getLabelSuffix() const; + std::string getLabelSuffix() const override; //virtual const std::string& getDisplayName() const; - virtual LLUIImagePtr getIcon() const; - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void openItem(); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual BOOL dragOrDrop(MASK mask, BOOL drop, + LLUIImagePtr getIcon() const override; + void performAction(LLInventoryModel* model, std::string action) override; + void openItem() override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; + BOOL dragOrDrop(MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, - std::string& tooltip_msg); + std::string& tooltip_msg) override; void refreshFolderViewItem(); void checkSearchBySuffixChanges(); protected: @@ -447,8 +451,9 @@ public: LLFolderView* root, const LLUUID& uuid) : LLItemBridge(inventory, root, uuid) {} - virtual void openItem(); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); + + void openItem() override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; }; class LLGestureBridge : public LLItemBridge @@ -460,12 +465,12 @@ public: LLItemBridge(inventory, root, uuid) {} // Only suffix for gesture items, not task items, because only // gestures in your inventory can be active. - virtual LLFontGL::StyleFlags getLabelStyle() const; - virtual std::string getLabelSuffix() const; - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void openItem(); - virtual BOOL removeItem(); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); + LLFontGL::StyleFlags getLabelStyle() const override; + std::string getLabelSuffix() const override; + void performAction(LLInventoryModel* model, std::string action) override; + void openItem() override; + BOOL removeItem() override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; static void playGesture(const LLUUID& item_id); }; @@ -476,9 +481,10 @@ public: LLFolderView* root, const LLUUID& uuid) : LLItemBridge(inventory, root, uuid) {} - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual void openItem(); + + void performAction(LLInventoryModel* model, std::string action) override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; + void openItem() override; }; class LLObjectBridge : public LLItemBridge @@ -489,13 +495,13 @@ public: const LLUUID& uuid, LLInventoryType::EType type, U32 flags); - virtual LLUIImagePtr getIcon() const; - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void openItem(); - virtual BOOL isItemWearable() const { return TRUE; } - virtual std::string getLabelSuffix() const; - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual BOOL renameItem(const std::string& new_name); + LLUIImagePtr getIcon() const override; + void performAction(LLInventoryModel* model, std::string action) override; + void openItem() override; + BOOL isItemWearable() const override { return TRUE; } + std::string getLabelSuffix() const override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; + BOOL renameItem(const std::string& new_name) override; LLInventoryObject* getObject() const; protected: static LLUUID sContextMenuItemID; // Only valid while the context menu is open. @@ -510,7 +516,8 @@ public: LLFolderView* root, const LLUUID& uuid ) : LLItemBridge(inventory, root, uuid) {} - virtual void openItem(); + + void openItem() override; }; class LLWearableBridge : public LLItemBridge @@ -522,14 +529,14 @@ public: LLAssetType::EType asset_type, LLInventoryType::EType inv_type, LLWearableType::EType wearable_type); - virtual LLUIImagePtr getIcon() const; - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void openItem(); - virtual BOOL isItemWearable() const { return TRUE; } - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual std::string getLabelSuffix() const; - virtual BOOL renameItem(const std::string& new_name); - virtual LLWearableType::EType getWearableType() const { return mWearableType; } + LLUIImagePtr getIcon() const override; + void performAction(LLInventoryModel* model, std::string action) override; + void openItem() override; + BOOL isItemWearable() const override { return TRUE; } + void buildContextMenu(LLMenuGL& menu, U32 flags) override; + std::string getLabelSuffix() const override; + BOOL renameItem(const std::string& new_name) override; + LLWearableType::EType getWearableType() const override { return mWearableType; } static void onWearOnAvatar( void* userdata ); // Access to wearOnAvatar() from menu static BOOL canWearOnAvatar( void* userdata ); @@ -559,7 +566,7 @@ public: const LLUUID& uuid) : LLItemBridge(inventory, root, uuid) {} virtual const std::string& getPrefix() { return sPrefix; } - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); + void buildContextMenu(LLMenuGL& menu, U32 flags) override; protected: static std::string sPrefix; }; @@ -572,10 +579,10 @@ public: const LLUUID& uuid) : LLItemBridge(inventory, root, uuid) {} virtual const std::string& getPrefix() { return sPrefix; } - virtual LLUIImagePtr getIcon() const; - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void gotoItem(); + LLUIImagePtr getIcon() const override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; + void performAction(LLInventoryModel* model, std::string action) override; + void gotoItem() override; protected: const LLUUID &getFolderID() const; static std::string sPrefix; @@ -586,9 +593,9 @@ class LLMeshBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual LLUIImagePtr getIcon() const; - virtual void openItem(); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); + LLUIImagePtr getIcon() const override; + void openItem() override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; protected: LLMeshBridge(LLInventoryPanel* inventory, @@ -632,7 +639,7 @@ class LLMeshBridgeAction: public LLInvFVBridgeAction { friend class LLInvFVBridgeAction; public: - virtual void doIt() ; + void doIt() override; virtual ~LLMeshBridgeAction(){} protected: LLMeshBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} @@ -659,7 +666,7 @@ public: { mInvType = type; } - /*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags); + /*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags) override; }; // Bridge builder to create Inventory-Folder-View-Bridge for Recent Inventory Panel @@ -669,14 +676,14 @@ public: LLRecentInventoryBridgeBuilder() {} // Overrides FolderBridge for Recent Inventory Panel. // It use base functionality for bridges other than FolderBridge. - virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type, + LLInvFVBridge* createBridge(LLAssetType::EType asset_type, LLAssetType::EType actual_asset_type, LLInventoryType::EType inv_type, LLInventoryPanel* inventory, LLFolderViewModelInventory* view_model, LLFolderView* root, const LLUUID& uuid, - U32 flags = 0x00) const; + U32 flags = 0x00) const override; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -690,11 +697,11 @@ public: LLMarketplaceFolderBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid); - - virtual LLUIImagePtr getIcon() const; - virtual LLUIImagePtr getIconOpen() const; - virtual std::string getLabelSuffix() const; - virtual LLFontGL::StyleFlags getLabelStyle() const; + + LLUIImagePtr getIcon() const override; + LLUIImagePtr getIconOpen() const override; + std::string getLabelSuffix() const override; + LLFontGL::StyleFlags getLabelStyle() const override; private: LLUIImagePtr getMarketplaceFolderIcon(BOOL is_open) const; @@ -715,21 +722,21 @@ public: { mInvType = type; } - /*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags); + /*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags) override; }; class LLWornInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder { public: LLWornInventoryBridgeBuilder() {} - virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type, + LLInvFVBridge* createBridge(LLAssetType::EType asset_type, LLAssetType::EType actual_asset_type, LLInventoryType::EType inv_type, LLInventoryPanel* inventory, LLFolderViewModelInventory* view_model, LLFolderView* root, const LLUUID& uuid, - U32 flags = 0x00) const; + U32 flags = 0x00) const override; }; void rez_attachment(LLViewerInventoryItem* item, @@ -741,9 +748,9 @@ void rez_attachment(LLViewerInventoryItem* item, BOOL move_inv_category_world_to_agent(const LLUUID& object_id, const LLUUID& category_id, BOOL drop, - void (*callback)(S32, void*) = NULL, - void* user_data = NULL, - LLInventoryFilter* filter = NULL); + void (*callback)(S32, void*) = nullptr, + void* user_data = nullptr, + LLInventoryFilter* filter = nullptr); // Utility function to hide all entries except those in the list // Can be called multiple times on the same menu (e.g. if multiple items @@ -763,7 +770,7 @@ class LLFolderViewGroupedItemBridge: public LLFolderViewGroupedItemModel { public: LLFolderViewGroupedItemBridge(); - virtual void groupFilterContextMenu(folder_view_item_deque& selected_items, LLMenuGL& menu); + void groupFilterContextMenu(folder_view_item_deque& selected_items, LLMenuGL& menu) override; }; #endif // LL_LLINVENTORYBRIDGE_H diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index b45d26f3e096061ed54059a83a3da8e946593c0e..b6208d6521f4816a3d7030952d50ce46969e3fb2 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -53,19 +53,19 @@ LLTrace::BlockTimerStatHandle FT_FILTER_CLIPBOARD("Filter Clipboard"); LLInventoryFilter::FilterOps::FilterOps(const Params& p) -: mFilterObjectTypes(p.object_types), - mFilterCategoryTypes(p.category_types), +: mFilterTypes(p.types), + mFilterObjectTypes(p.object_types), mFilterWearableTypes(p.wearable_types), + mFilterCategoryTypes(p.category_types), + mFilterWornItems(p.worn_items), + mFilterLinks(p.links), + mFilterUUID(p.uuid), mMinDate(p.date_range.min_date), mMaxDate(p.date_range.max_date), mHoursAgo(p.hours_ago), mDateSearchDirection(p.date_search_direction), mShowFolderState(p.show_folder_state), - mPermissions(p.permissions), - mFilterTypes(p.types), - mFilterUUID(p.uuid), - mFilterLinks(p.links), - mFilterWornItems(p.worn_items) + mPermissions(p.permissions) { } @@ -73,15 +73,15 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p) /// Class LLInventoryFilter ///---------------------------------------------------------------------------- LLInventoryFilter::LLInventoryFilter(const Params& p) -: mName(p.name), - mFilterModified(FILTER_NONE), - mEmptyLookupMessage("InventoryNoMatchingItems"), - mFilterOps(p.filter_ops), +: mFilterOps(p.filter_ops), mBackupFilterOps(mFilterOps), mFilterSubString(p.substring), + mName(p.name), mCurrentGeneration(0), mFirstRequiredGeneration(0), - mFirstSuccessGeneration(0) + mFirstSuccessGeneration(0), + mFilterModified(FILTER_NONE), + mEmptyLookupMessage("InventoryNoMatchingItems") { // copy mFilterOps into mDefaultFilterOps markDefault(); @@ -321,8 +321,8 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent gInventory.fetchDescendentsOf(object_id); } - LLInventoryModel::cat_array_t* cat_array = NULL; - LLInventoryModel::item_array_t* item_array = NULL; + LLInventoryModel::cat_array_t* cat_array = nullptr; + LLInventoryModel::item_array_t* item_array = nullptr; gInventory.getDirectDescendentsOf(object_id,cat_array,item_array); S32 descendents_actual = 0; if(cat_array && item_array) @@ -451,7 +451,7 @@ bool LLInventoryFilter::checkAgainstPermissions(const LLInventoryItem* item) con LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); PermissionMask perm = new_item->getPermissionMask(); - new_item = NULL; + new_item = nullptr; return (perm & mFilterOps.mPermissions) == mFilterOps.mPermissions; } diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index b8e5b3be53ab3c81e1d71c94d88ad58b0afae95f..82084ba589095c2904a84688809990a2a993c2ee 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -217,56 +217,56 @@ public: // +-------------------------------------------------------------------+ // + Execution And Results // +-------------------------------------------------------------------+ - bool check(const LLFolderViewModelItem* listener); + bool check(const LLFolderViewModelItem* listener) override; bool check(const LLInventoryItem* item); - bool checkFolder(const LLFolderViewModelItem* listener) const; + bool checkFolder(const LLFolderViewModelItem* listener) const override; bool checkFolder(const LLUUID& folder_id) const; - bool showAllResults() const; + bool showAllResults() const override; - std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const; - std::string::size_type getFilterStringSize() const; + std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const override; + std::string::size_type getFilterStringSize() const override; // +-------------------------------------------------------------------+ // + Presentation // +-------------------------------------------------------------------+ void setShowFolderState( EFolderShow state); EFolderShow getShowFolderState() const; - void setEmptyLookupMessage(const std::string& message); - std::string getEmptyLookupMessage() const; + void setEmptyLookupMessage(const std::string& message) override; + std::string getEmptyLookupMessage() const override; // +-------------------------------------------------------------------+ // + Status // +-------------------------------------------------------------------+ - bool isActive() const; - bool isModified() const; + bool isActive() const override; + bool isModified() const override; bool isSinceLogoff() const; - void clearModified(); - const std::string& getName() const { return mName; } - const std::string& getFilterText(); + void clearModified() override; + const std::string& getName() const override { return mName; } + const std::string& getFilterText() override; //RN: this is public to allow system to externally force a global refilter - void setModified(EFilterModified behavior = FILTER_RESTART); + void setModified(EFilterModified behavior = FILTER_RESTART) override; // +-------------------------------------------------------------------+ // + Time // +-------------------------------------------------------------------+ - void resetTime(S32 timeout); - bool isTimedOut(); + void resetTime(S32 timeout) override; + bool isTimedOut() override; // +-------------------------------------------------------------------+ // + Default // +-------------------------------------------------------------------+ - bool isDefault() const; - bool isNotDefault() const; - void markDefault(); - void resetDefault(); + bool isDefault() const override; + bool isNotDefault() const override; + void markDefault() override; + void resetDefault() override; // +-------------------------------------------------------------------+ // + Generation // +-------------------------------------------------------------------+ - S32 getCurrentGeneration() const; - S32 getFirstSuccessGeneration() const; - S32 getFirstRequiredGeneration() const; + S32 getCurrentGeneration() const override; + S32 getFirstSuccessGeneration() const override; + S32 getFirstRequiredGeneration() const override; // +-------------------------------------------------------------------+ diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 603eb25cbb8b06d97a1ee9e8786bf88edd471e31..9f7332f334be047591cce035055bac44af87223b 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -125,7 +125,7 @@ class LLAssetIDMatches : public LLInventoryCollectFunctor public: LLAssetIDMatches(const LLUUID& asset_id) : mAssetID(asset_id) {} virtual ~LLAssetIDMatches() {} - bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override; protected: LLUUID mAssetID; @@ -142,7 +142,7 @@ class LLLinkedItemIDMatches : public LLInventoryCollectFunctor public: LLLinkedItemIDMatches(const LLUUID& item_id) : mBaseItemID(item_id) {} virtual ~LLLinkedItemIDMatches() {} - bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override; protected: LLUUID mBaseItemID; @@ -160,8 +160,8 @@ class LLIsType : public LLInventoryCollectFunctor public: LLIsType(LLAssetType::EType type) : mType(type) {} virtual ~LLIsType() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; protected: LLAssetType::EType mType; }; @@ -177,8 +177,8 @@ class LLIsNotType : public LLInventoryCollectFunctor public: LLIsNotType(LLAssetType::EType type) : mType(type) {} virtual ~LLIsNotType() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; protected: LLAssetType::EType mType; }; @@ -196,8 +196,8 @@ class LLIsOfAssetType : public LLInventoryCollectFunctor public: LLIsOfAssetType(LLAssetType::EType type) : mType(type) {} virtual ~LLIsOfAssetType() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; protected: LLAssetType::EType mType; }; @@ -205,8 +205,8 @@ protected: class LLIsValidItemLink : public LLInventoryCollectFunctor { public: - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; }; class LLIsTypeWithPermissions : public LLInventoryCollectFunctor @@ -215,8 +215,8 @@ public: LLIsTypeWithPermissions(LLAssetType::EType type, const PermissionBit perms, const LLUUID &agent_id, const LLUUID &group_id) : mType(type), mPerm(perms), mAgentID(agent_id), mGroupID(group_id) {} virtual ~LLIsTypeWithPermissions() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; protected: LLAssetType::EType mType; PermissionBit mPerm; @@ -235,8 +235,8 @@ class LLBuddyCollector : public LLInventoryCollectFunctor public: LLBuddyCollector() {} virtual ~LLBuddyCollector() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -250,8 +250,8 @@ class LLUniqueBuddyCollector : public LLInventoryCollectFunctor public: LLUniqueBuddyCollector() {} virtual ~LLUniqueBuddyCollector() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; protected: std::set<LLUUID> mSeen; @@ -268,8 +268,8 @@ class LLParticularBuddyCollector : public LLInventoryCollectFunctor public: LLParticularBuddyCollector(const LLUUID& id) : mBuddyID(id) {} virtual ~LLParticularBuddyCollector() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; protected: LLUUID mBuddyID; }; @@ -284,8 +284,8 @@ class LLNameCategoryCollector : public LLInventoryCollectFunctor public: LLNameCategoryCollector(const std::string& name) : mName(name) {} virtual ~LLNameCategoryCollector() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; protected: std::string mName; }; @@ -300,8 +300,8 @@ class LLFindCOFValidItems : public LLInventoryCollectFunctor public: LLFindCOFValidItems() {} virtual ~LLFindCOFValidItems() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; }; @@ -315,7 +315,7 @@ public: : mFilterMask(mask) {} - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override { //converting an inventory type to a bitmap filter mask if(item && (mFilterMask & (1LL << item->getInventoryType())) ) @@ -342,7 +342,7 @@ public: : mFilterMask(mask) {} - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override { if(item && !item->getIsLinkType() && (mFilterMask & (1LL << item->getInventoryType())) ) { @@ -371,8 +371,8 @@ class LLFindWearables : public LLInventoryCollectFunctor public: LLFindWearables() {} virtual ~LLFindWearables() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -384,7 +384,7 @@ class LLFindWearablesEx : public LLInventoryCollectFunctor { public: LLFindWearablesEx(bool is_worn, bool include_body_parts = true); - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override; private: bool mIncludeBodyParts; bool mIsWorn; @@ -396,7 +396,7 @@ class LLFindWearablesOfType : public LLInventoryCollectFunctor public: LLFindWearablesOfType(LLWearableType::EType type) : mWearableType(type) {} virtual ~LLFindWearablesOfType() {} - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override; void setType(LLWearableType::EType type); private: @@ -409,7 +409,8 @@ class LLFindActualWearablesOfType : public LLFindWearablesOfType public: LLFindActualWearablesOfType(LLWearableType::EType type) : LLFindWearablesOfType(type) {} virtual ~LLFindActualWearablesOfType() {} - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override { if (item && item->getIsLinkType()) return false; return LLFindWearablesOfType::operator()(cat, item); @@ -422,7 +423,8 @@ class LLIsTypeActual : public LLIsType public: LLIsTypeActual(LLAssetType::EType type) : LLIsType(type) {} virtual ~LLIsTypeActual() {} - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override { if (item && item->getIsLinkType()) return false; return LLIsType::operator()(cat, item); @@ -433,7 +435,7 @@ public: class LLFindNonRemovableObjects : public LLInventoryCollectFunctor { public: - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override; }; /** Inventory Collector Functions diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index abaefa4891395805f8ecf1acb89239e43408931a..c2321c30d01e3173457bbe158b9544cc9bc04162 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -220,7 +220,7 @@ void LLInventoryItemsList::refresh() for (; pair_it != panel_list.end(); ++pair_it) { item_pair_t* item_pair = *pair_it; - if (item_pair->first->getParent() != NULL) + if (item_pair->first->getParent() != nullptr) { updateItemVisibility(item_pair->first, action); } @@ -288,7 +288,7 @@ LLPanel* LLInventoryItemsList::createNewItem(LLViewerInventoryItem* item) { LL_WARNS() << "No inventory item. Couldn't create flat list item." << LL_ENDL; llassert(item != NULL); - return NULL; + return nullptr; } return LLPanelInventoryListItemBase::create(item); } diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index ce41105f989f28d3117ceb792e0f0f60848a8ad9..a548eebdf9722d1f6318d2f8bfb091fff36219cb 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -66,7 +66,7 @@ public: */ bool getForceRefresh(){ return mForceRefresh; } - virtual bool selectItemByValue(const LLSD& value, bool select = true); + bool selectItemByValue(const LLSD& value, bool select = true) override; void updateSelection(); diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp index 508f1406e34611c58f66b655a469afa767050ed2..11c0a9c27f9aee3765324a1d15e10e410ed4073f 100644 --- a/indra/newview/llinventorylistitem.cpp +++ b/indra/newview/llinventorylistitem.cpp @@ -59,7 +59,7 @@ LLPanelInventoryListItemBase::Params::Params() LLPanelInventoryListItemBase* LLPanelInventoryListItemBase::create(LLViewerInventoryItem* item) { - LLPanelInventoryListItemBase* list_item = NULL; + LLPanelInventoryListItemBase* list_item = nullptr; if (item) { const LLPanelInventoryListItemBase::Params& params = LLUICtrlFactory::getDefaultParams<LLPanelInventoryListItemBase>(); @@ -199,7 +199,7 @@ void LLPanelInventoryListItemBase::onMouseLeave(S32 x, S32 y, MASK mask) const std::string& LLPanelInventoryListItemBase::getItemName() const { LLViewerInventoryItem* inv_item = getItem(); - if (NULL == inv_item) + if (nullptr == inv_item) { return LLStringUtil::null; } @@ -209,7 +209,7 @@ const std::string& LLPanelInventoryListItemBase::getItemName() const LLAssetType::EType LLPanelInventoryListItemBase::getType() const { LLViewerInventoryItem* inv_item = getItem(); - if (NULL == inv_item) + if (nullptr == inv_item) { return LLAssetType::AT_NONE; } @@ -219,7 +219,7 @@ LLAssetType::EType LLPanelInventoryListItemBase::getType() const LLWearableType::EType LLPanelInventoryListItemBase::getWearableType() const { LLViewerInventoryItem* inv_item = getItem(); - if (NULL == inv_item) + if (nullptr == inv_item) { return LLWearableType::WT_NONE; } @@ -229,7 +229,7 @@ LLWearableType::EType LLPanelInventoryListItemBase::getWearableType() const const std::string& LLPanelInventoryListItemBase::getDescription() const { LLViewerInventoryItem* inv_item = getItem(); - if (NULL == inv_item) + if (nullptr == inv_item) { return LLStringUtil::null; } @@ -239,7 +239,7 @@ const std::string& LLPanelInventoryListItemBase::getDescription() const time_t LLPanelInventoryListItemBase::getCreationDate() const { LLViewerInventoryItem* inv_item = getItem(); - if (NULL == inv_item) + if (nullptr == inv_item) { return 0; } @@ -283,18 +283,18 @@ S32 LLPanelInventoryListItemBase::notify(const LLSD& info) LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem* item, const LLPanelInventoryListItemBase::Params& params) : LLPanel(params), mInventoryItemUUID(item ? item->getUUID() : LLUUID::null), - mIconCtrl(NULL), - mTitleCtrl(NULL), - mWidgetSpacing(WIDGET_SPACING), - mLeftWidgetsWidth(0), - mRightWidgetsWidth(0), - mNeedsRefresh(false), + mIconCtrl(nullptr), + mTitleCtrl(nullptr), + mHoverImage(params.hover_image), + mSelectedImage(params.selected_image), + mSeparatorImage(params.separator_image), mHovered(false), mSelected(false), mSeparatorVisible(false), - mHoverImage(params.hover_image), - mSelectedImage(params.selected_image), - mSeparatorImage(params.separator_image) + mWidgetSpacing(WIDGET_SPACING), + mLeftWidgetsWidth(0), + mRightWidgetsWidth(0), + mNeedsRefresh(false) { LLIconCtrl::Params icon_params(params.item_icon); applyXUILayout(icon_params, this); diff --git a/indra/newview/llinventorylistitem.h b/indra/newview/llinventorylistitem.h index d4dd212cc3e4e5fa60faff8049ca03f262f453aa..558b2b95d3f4915581e41779f079c87caa615ad2 100644 --- a/indra/newview/llinventorylistitem.h +++ b/indra/newview/llinventorylistitem.h @@ -80,7 +80,7 @@ public: static LLPanelInventoryListItemBase* create(LLViewerInventoryItem* item); - virtual void draw(); + void draw() override; /** * Let item know it need to be refreshed in next draw() @@ -117,22 +117,22 @@ public: /** * Inheritors need to call base implementation of postBuild() */ - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /** * Handles item selection */ - /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void setValue(const LLSD& value) override; /** * Handles filter request */ - /*virtual*/ S32 notify(const LLSD& info); + /*virtual*/ S32 notify(const LLSD& info) override; /* Highlights item */ - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; /* Removes item highlight */ - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override; /** Get the name of a corresponding inventory item */ const std::string& getItemName() const; @@ -194,7 +194,7 @@ protected: /** * Show tool tip if item name text size > panel size */ - virtual BOOL handleToolTip( S32 x, S32 y, MASK mask); + BOOL handleToolTip( S32 x, S32 y, MASK mask) override; const LLUUID mInventoryItemUUID; diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 4d0df6fa7e17943a7ea6bf04c2ec5b104ebb4f64..b41c7524ad8e4638897ccfef286294322cd6dcae 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -95,7 +95,7 @@ public: void operator=(const FetchItemHttpHandler &) = delete; // Not defined public: - virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) override; private: void processData(LLSD & body, LLCore::HttpResponse * response); diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 1b484d8a8da7229f9e2791be974ce4a734dcc07f..f96b8b27862386ebceee7c0b32b5c0348335d73f 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -169,7 +169,7 @@ protected: void operator=(const BGFolderHttpHandler &) = delete; // Not defined public: - virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) override; bool getIsRecursive(const LLUUID & cat_id) const; @@ -196,16 +196,16 @@ const char * const LOG_INV("Inventory"); ///---------------------------------------------------------------------------- LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch(): + mRecursiveInventoryFetchStarted(FALSE), + mRecursiveLibraryFetchStarted(FALSE), + mAllFoldersFetched(FALSE), mBackgroundFetchActive(FALSE), mFolderFetchActive(false), mFetchCount(0), - mAllFoldersFetched(FALSE), - mRecursiveInventoryFetchStarted(FALSE), - mRecursiveLibraryFetchStarted(FALSE), + mTimelyFetchPending(FALSE), mNumFetchRetries(0), mMinTimeBetweenFetches(0.3f), - mMaxTimeBetweenFetches(10.f), - mTimelyFetchPending(FALSE) + mMaxTimeBetweenFetches(10.f) {} LLInventoryModelBackgroundFetch::~LLInventoryModelBackgroundFetch() @@ -283,13 +283,13 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive) { mRecursiveInventoryFetchStarted |= recursive; mFetchQueue.push_back(FetchQueueInfo(gInventory.getRootFolderID(), recursive)); - gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); + gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr); } if (! mRecursiveLibraryFetchStarted) { mRecursiveLibraryFetchStarted |= recursive; mFetchQueue.push_back(FetchQueueInfo(gInventory.getLibraryRootFolderID(), recursive)); - gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); + gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr); } } else @@ -298,7 +298,7 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive) if (mFetchQueue.empty() || mFetchQueue.front().mUUID != id) { mFetchQueue.push_front(FetchQueueInfo(id, recursive)); - gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); + gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr); } if (id == gInventory.getLibraryRootFolderID()) { @@ -317,7 +317,7 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive) mBackgroundFetchActive = TRUE; mFetchQueue.push_front(FetchQueueInfo(id, false, false)); - gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); + gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr); } } } @@ -327,7 +327,7 @@ void LLInventoryModelBackgroundFetch::findLostItems() mBackgroundFetchActive = TRUE; mFolderFetchActive = true; mFetchQueue.push_back(FetchQueueInfo(LLUUID::null, TRUE)); - gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); + gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr); } void LLInventoryModelBackgroundFetch::setAllFoldersFetched() @@ -341,7 +341,7 @@ void LLInventoryModelBackgroundFetch::setAllFoldersFetched() } mFolderFetchActive = false; mBackgroundFetchActive = false; - gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); + gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr); LL_INFOS_ONCE(LOG_INV) << "Inventory background fetch completed" << LL_ENDL; } @@ -628,8 +628,8 @@ void LLInventoryModelBackgroundFetch::bulkFetch() // May already have this folder, but append child folders to list. if (fetch_info.mRecursive) { - LLInventoryModel::cat_array_t * categories(NULL); - LLInventoryModel::item_array_t * items(NULL); + LLInventoryModel::cat_array_t * categories(nullptr); + LLInventoryModel::item_array_t * items(nullptr); gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items); for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); it != categories->end(); diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index bb65b86958890cbdc78e3f1fb9277a4081449f99..81babf6d260b1df4613b12defa4dfdae36e6c5e8 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -260,7 +260,7 @@ void fetch_items_from_llsd(const LLSD& items_llsd) msg->nextBlockFast(_PREHASH_InventoryData); msg->addUUIDFast(_PREHASH_OwnerID, item_entry["owner_id"].asUUID()); msg->addUUIDFast(_PREHASH_ItemID, item_entry["item_id"].asUUID()); - if (msg->isSendFull(NULL)) + if (msg->isSendFull(nullptr)) { start_new_message = TRUE; gAgent.sendReliableMessage(); @@ -744,11 +744,11 @@ void LLInventoryCategoriesObserver::removeCategory(const LLUUID& cat_id) LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData( const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents) - : mCatID(cat_id) - , mCallback(cb) + : mCallback(cb) , mVersion(version) , mDescendentsCount(num_descendents) , mIsNameHashInitialized(false) + , mCatID(cat_id) { mItemNameHash.finalize(); } @@ -756,12 +756,12 @@ LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData( LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData( const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents, LLMD5 name_hash) - : mCatID(cat_id) - , mCallback(cb) + : mCallback(cb) , mVersion(version) , mDescendentsCount(num_descendents) - , mIsNameHashInitialized(true) , mItemNameHash(name_hash) + , mIsNameHashInitialized(true) + , mCatID(cat_id) { } diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 534f17c048144fd25879548e36ac44aa346021b2..dfaa26ff5df9ca4592bef749330f8eabf4178a38 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -82,7 +82,7 @@ public: BOOL isFinished() const; virtual void startFetch() = 0; - virtual void changed(U32 mask) = 0; + void changed(U32 mask) override = 0; virtual void done() {}; protected: uuid_vec_t mComplete; @@ -101,8 +101,8 @@ public: LLInventoryFetchItemsObserver(const LLUUID& item_id = LLUUID::null); LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids); - /*virtual*/ void startFetch(); - /*virtual*/ void changed(U32 mask); + /*virtual*/ void startFetch() override; + /*virtual*/ void changed(U32 mask) override; private: LLTimer mFetchingPeriod; @@ -124,8 +124,8 @@ public: LLInventoryFetchDescendentsObserver(const LLUUID& cat_id = LLUUID::null); LLInventoryFetchDescendentsObserver(const uuid_vec_t& cat_ids); - /*virtual*/ void startFetch(); - /*virtual*/ void changed(U32 mask); + /*virtual*/ void startFetch() override; + /*virtual*/ void changed(U32 mask) override; protected: BOOL isCategoryComplete(const LLViewerInventoryCategory* cat) const; }; @@ -143,7 +143,7 @@ public: LLInventoryFetchComboObserver(const uuid_vec_t& folder_ids, const uuid_vec_t& item_ids); ~LLInventoryFetchComboObserver(); - /*virtual*/ void changed(U32 mask); + /*virtual*/ void changed(U32 mask) override; void startFetch(); virtual void done() = 0; @@ -165,7 +165,7 @@ class LLInventoryAddItemByAssetObserver : public LLInventoryObserver { public: LLInventoryAddItemByAssetObserver() : mIsDirty(false) {} - virtual void changed(U32 mask); + void changed(U32 mask) override; void watchAsset(const LLUUID& asset_id); bool isAssetWatched(const LLUUID& asset_id); @@ -192,7 +192,7 @@ class LLInventoryAddedObserver : public LLInventoryObserver { public: LLInventoryAddedObserver() {} - /*virtual*/ void changed(U32 mask); + /*virtual*/ void changed(U32 mask) override; protected: virtual void done() = 0; @@ -212,7 +212,7 @@ public: typedef std::vector<LLViewerInventoryCategory*> cat_vec_t; LLInventoryCategoryAddedObserver() : mAddedCategories() {} - /*virtual*/ void changed(U32 mask); + /*virtual*/ void changed(U32 mask) override; protected: virtual void done() = 0; @@ -232,7 +232,7 @@ class LLInventoryCompletionObserver : public LLInventoryObserver { public: LLInventoryCompletionObserver() {} - /*virtual*/ void changed(U32 mask); + /*virtual*/ void changed(U32 mask) override; void watchItem(const LLUUID& id); @@ -256,7 +256,7 @@ public: typedef std::function<void()> callback_t; LLInventoryCategoriesObserver() {}; - virtual void changed(U32 mask); + void changed(U32 mask) override; /** * Add cat_id to the list of observed categories with a @@ -297,11 +297,11 @@ public: LLUUID mUUID; LLScrollOnRenameObserver(const LLUUID& uuid, LLFolderView *view): - mUUID(uuid), - mView(view) + mView(view), + mUUID(uuid) { } - /* virtual */ void changed(U32 mask); + /* virtual */ void changed(U32 mask) override; }; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 68addf1c63231aa1f0061adc1101b87bdadeea4f..f8c21531a3d6694ebb226490981d9b32de4af305 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -79,7 +79,8 @@ class LLInventoryPanelObserver : public LLInventoryObserver public: LLInventoryPanelObserver(LLInventoryPanel* ip) : mIP(ip) {} virtual ~LLInventoryPanelObserver() {} - virtual void changed(U32 mask) + + void changed(U32 mask) override { mIP->modelChanged(mask); } @@ -113,7 +114,7 @@ public: void reset(); private: - /*virtual*/ void done(); + /*virtual*/ void done() override; /// Called when all the items are complete. callback_t mCallback; @@ -136,19 +137,19 @@ void LLInvPanelComplObserver::done() LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : LLPanel(p), - mInventoryObserver(NULL), - mCompletionObserver(NULL), - mScroller(NULL), - mSortOrderSetting(p.sort_order_setting), mInventory(p.inventory), + mInventoryObserver(nullptr), + mCompletionObserver(nullptr), mAcceptsDragAndDrop(p.accepts_drag_and_drop), mAllowMultiSelect(p.allow_multi_select), mShowItemLinkOverlays(p.show_item_link_overlays), mShowEmptyMessage(p.show_empty_message), - mViewsInitialized(false), - mInvFVBridgeBuilder(NULL), + mScroller(nullptr), mInventoryViewModel(p.name), - mGroupedItemBridge(new LLFolderViewGroupedItemBridge) + mGroupedItemBridge(new LLFolderViewGroupedItemBridge), + mInvFVBridgeBuilder(nullptr), + mSortOrderSetting(p.sort_order_setting), + mViewsInitialized(false) { mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER; @@ -185,7 +186,7 @@ LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) LLInventoryType::IT_CATEGORY, this, &mInventoryViewModel, - NULL, + nullptr, root_id); p.view_model = &mInventoryViewModel; p.grouped_item_model = mGroupedItemBridge; @@ -193,7 +194,7 @@ LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) p.allow_multiselect = mAllowMultiSelect; p.show_empty_message = mShowEmptyMessage; p.show_item_link_overlays = mShowItemLinkOverlays; - p.root = NULL; + p.root = nullptr; p.allow_drop = mParams.allow_drop_on_root; p.options_menu = "menu_inventory.xml"; @@ -209,20 +210,20 @@ void LLInventoryPanel::clearFolderRoot() { mInventory->removeObserver(mInventoryObserver); delete mInventoryObserver; - mInventoryObserver = NULL; + mInventoryObserver = nullptr; } if (mCompletionObserver) { mInventory->removeObserver(mCompletionObserver); delete mCompletionObserver; - mCompletionObserver = NULL; + mCompletionObserver = nullptr; } if (mScroller) { removeChild(mScroller); delete mScroller; - mScroller = NULL; + mScroller = nullptr; } } @@ -457,7 +458,7 @@ void LLInventoryPanel::modelChanged(U32 mask) // LLFolderViewFolder is derived from LLFolderViewItem so dynamic_cast from item // to folder is the fast way to get a folder without searching through folders tree. - LLFolderViewFolder* view_folder = NULL; + LLFolderViewFolder* view_folder = nullptr; // Check requires as this item might have already been deleted // as a child of its deleted parent. @@ -559,7 +560,7 @@ void LLInventoryPanel::modelChanged(U32 mask) // Item has been moved. if (old_parent != new_parent) { - if (new_parent != NULL) + if (new_parent != nullptr) { // Item is to be moved and we found its new parent in the panel's directory, so move the item's UI. view_item->addToFolder(new_parent); @@ -666,11 +667,11 @@ void LLInventoryPanel::onIdle(void *userdata) struct DirtyFilterFunctor : public LLFolderViewFunctor { - /*virtual*/ void doFolder(LLFolderViewFolder* folder) + /*virtual*/ void doFolder(LLFolderViewFolder* folder) override { folder->getViewModelItem()->dirtyFilter(); } - /*virtual*/ void doItem(LLFolderViewItem* item) + /*virtual*/ void doItem(LLFolderViewItem* item) override { item->getViewModelItem()->dirtyFilter(); } @@ -804,7 +805,7 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) if (!objectp) { - return NULL; + return nullptr; } LLFolderViewItem* folder_view_item = getItemByID(id); @@ -822,7 +823,7 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) { // We insert an extra level that's seen by the UI but has no influence on the model parent_folder = dynamic_cast<LLFolderViewFolder*>(folder_view_item); - folder_view_item = NULL; + folder_view_item = nullptr; allow_drop = mParams.allow_drop_on_root; create_root = true; } @@ -836,7 +837,7 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) LL_WARNS() << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() << LL_ENDL; - return NULL; + return nullptr; } if ((objectp->getType() == LLAssetType::AT_CATEGORY) && @@ -954,7 +955,7 @@ void LLInventoryPanel::openSelected() void LLInventoryPanel::unSelectAll() { - mFolderRoot.get()->setSelection(NULL, FALSE, FALSE); + mFolderRoot.get()->setSelection(nullptr, FALSE, FALSE); } @@ -1011,7 +1012,7 @@ void LLInventoryPanel::onFocusLost() // inventory no longer handles cut/copy/paste/delete if (LLEditMenuHandler::gEditMenuHandler == mFolderRoot.get()) { - LLEditMenuHandler::gEditMenuHandler = NULL; + LLEditMenuHandler::gEditMenuHandler = nullptr; } LLPanel::onFocusLost(); @@ -1228,7 +1229,7 @@ bool LLInventoryPanel::attachObject(const LLSD& userdata) // Attach selected items. LLViewerAttachMenu::attachObjects(items, userdata.asString()); - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); return true; } @@ -1257,8 +1258,8 @@ BOOL is_inventorysp_active() LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) { S32 z_min = S32_MAX; - LLInventoryPanel* res = NULL; - LLFloater* active_inv_floaterp = NULL; + LLInventoryPanel* res = nullptr; + LLFloater* active_inv_floaterp = nullptr; LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory"); if (!floater_inventory) @@ -1322,7 +1323,7 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L bool in_inbox = false; - LLViewerInventoryCategory * parent_cat = NULL; + LLViewerInventoryCategory * parent_cat = nullptr; if (item) { @@ -1341,7 +1342,7 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L if (in_inbox) { LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory"); - LLInventoryPanel * inventory_panel = NULL; + LLInventoryPanel * inventory_panel = nullptr; if (in_inbox) { @@ -1416,7 +1417,7 @@ LLFolderViewItem* LLInventoryPanel::getItemByID(const LLUUID& id) return map_it->second; } - return NULL; + return nullptr; } LLFolderViewFolder* LLInventoryPanel::getFolderByID(const LLUUID& id) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index a74e7c2c0b866771c9496f533ef9bc4be22e1c1e..9b2401b62ee88e3a24987703c502518fe90746dc 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -147,20 +147,20 @@ public: LLFolderViewModelInventory& getRootViewModel() { return mInventoryViewModel; } // LLView methods - void draw(); - /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ); - BOOL handleHover(S32 x, S32 y, MASK mask); + void draw() override; + /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; // LLUICtrl methods - /*virtual*/ void onFocusLost(); - /*virtual*/ void onFocusReceived(); + /*virtual*/ void onFocusLost() override; + /*virtual*/ void onFocusReceived() override; // LLBadgeHolder methods - bool addBadge(LLBadge * badge); + bool addBadge(LLBadge * badge) override; // Call this method to set the selection. void openAllFolders(); diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp index 324675bac6bf0def01b017733a1eda6b3cf4fe7b..42e299359eb5de265320a1a690a7286cab9fb4b2 100644 --- a/indra/newview/lljoystickbutton.cpp +++ b/indra/newview/lljoystickbutton.cpp @@ -71,6 +71,7 @@ void QuadrantNames::declareValues() LLJoystick::LLJoystick(const LLJoystick::Params& p) : LLButton(p), + mInitialQuadrant(p.quadrant), mInitialOffset(0, 0), mLastMouse(0, 0), mFirstMouse(0, 0), @@ -79,8 +80,7 @@ LLJoystick::LLJoystick(const LLJoystick::Params& p) mHorizSlopNear(0), mHorizSlopFar(0), mHeldDown(FALSE), - mHeldDownTimer(), - mInitialQuadrant(p.quadrant) + mHeldDownTimer() { setHeldDownCallback(boost::bind(&LLJoystick::onBtnHeldDown, this)); } diff --git a/indra/newview/lljoystickbutton.h b/indra/newview/lljoystickbutton.h index 4e6c774cadfa3c062709a7b318041ea4e6658961..b8b110406a87cbec2a05368b450cc28821af913b 100644 --- a/indra/newview/lljoystickbutton.h +++ b/indra/newview/lljoystickbutton.h @@ -62,9 +62,9 @@ public: }; LLJoystick(const Params&); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; virtual void onMouseUp() {} virtual void onHeldDown() = 0; @@ -110,7 +110,7 @@ class LLJoystickAgentTurn public: struct Params : public LLJoystick::Params {}; LLJoystickAgentTurn(const Params& p) : LLJoystick(p) {} - virtual void onHeldDown(); + void onHeldDown() override; }; @@ -122,8 +122,8 @@ public: struct Params : public LLJoystick::Params {}; LLJoystickAgentSlide(const Params& p) : LLJoystick(p) {} - virtual void onHeldDown(); - virtual void onMouseUp(); + void onHeldDown() override; + void onMouseUp() override; }; @@ -145,14 +145,14 @@ public: virtual void setToggleState( BOOL left, BOOL top, BOOL right, BOOL bottom ); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual void onHeldDown(); - virtual void draw(); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + void onHeldDown() override; + void draw() override; protected: F32 getOrbitRate(); - virtual void updateSlop(); + void updateSlop() override; void drawRotatedImage( LLPointer<LLUIImage> image, S32 rotations ); protected: @@ -175,7 +175,7 @@ public: }; LLJoystickCameraTrack(const LLJoystickCameraTrack::Params&); - virtual void onHeldDown(); + void onHeldDown() override; }; #endif // LL_LLJOYSTICKBUTTON_H diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index 4f6774e8064c94f1ab49e6cec4ea363d28646cfa..95080e7f9bd67461972a32caee3f8bda613c5b4c 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -69,7 +69,7 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t { if ( mBadList.find(asset_uuid) != mBadList.end() ) { - return NULL; + return nullptr; } landmark_requested_list_t::iterator iter = mRequestedList.find(asset_uuid); @@ -78,7 +78,7 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t const F32 rerequest_time = 30.f; // 30 seconds between requests if (gFrameTimeSeconds - iter->second < rerequest_time) { - return NULL; + return nullptr; } } @@ -91,10 +91,10 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t gAssetStorage->getAssetData(asset_uuid, LLAssetType::AT_LANDMARK, LLLandmarkList::processGetAssetReply, - NULL); + nullptr); mRequestedList[asset_uuid] = gFrameTimeSeconds; } - return NULL; + return nullptr; } // static diff --git a/indra/newview/lllightshare.cpp b/indra/newview/lllightshare.cpp index d336b29b4026fe8be7cd76355fdae3a8d74195d4..d379295565ffafcfee01bea09f1e9ba43d94ab7c 100644 --- a/indra/newview/lllightshare.cpp +++ b/indra/newview/lllightshare.cpp @@ -38,10 +38,10 @@ const std::string LIGHTSHARE_WL_KEY = "LightshareCurrentRegion"; class LLDispatchLightshare : public LLDispatchHandler { public: - virtual bool operator()(const LLDispatcher* dispatcher, + bool operator()(const LLDispatcher* dispatcher, const std::string& key, const LLUUID& invoice, - const sparam_t& strings) + const sparam_t& strings) override { if (key == WINDLIGHT_REFRESH_MSG) { diff --git a/indra/newview/lllistview.cpp b/indra/newview/lllistview.cpp index b1bf47016f609382e8f9b01b1348b7a7e58a1172..1b6aae835e8efe03f6eea1a05c176e61cbeeab9f 100644 --- a/indra/newview/lllistview.cpp +++ b/indra/newview/lllistview.cpp @@ -45,7 +45,7 @@ LLListView::Params::Params() LLListView::LLListView(const Params& p) : LLUICtrl(p), - mLabel(NULL), + mLabel(nullptr), mBgColor(p.bg_color()), mFgSelectedColor(p.fg_selected_color()), mBgSelectedColor(p.bg_selected_color()) diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 2bf177d87d7ab37ba4073894f54fbd4663b7ac84..a7619530ebc1751e50c5e61c3d8f283d43b71d0f 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -224,7 +224,7 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate) // remove old_id from gimagelist LLViewerFetchedTexture* image = gTextureList.findImage(old_id, TEX_LIST_STANDARD); - if (image != NULL) + if (image != nullptr) { gTextureList.deleteImage(image); image->unref(); @@ -881,7 +881,7 @@ bool LLLocalBitmapMgr::addUnit() LLNotificationsUtil::add("LocalBitmapsVerifyFail", notif_args); delete unit; - unit = NULL; + unit = nullptr; } filename = picker.getNextFile(); @@ -944,7 +944,7 @@ void LLLocalBitmapMgr::delUnit(LLUUID tracking_id) LLLocalBitmap* unit = *del_iter; sBitmapList.remove(unit); delete unit; - unit = NULL; + unit = nullptr; } } } diff --git a/indra/newview/lllocalbitmaps.h b/indra/newview/lllocalbitmaps.h index 922d114f30f9fc649f8914b968761cb507e171de..772e2ad53c93e3a94a2031d53c7c608375c971b1 100644 --- a/indra/newview/lllocalbitmaps.h +++ b/indra/newview/lllocalbitmaps.h @@ -107,7 +107,7 @@ class LLLocalBitmapTimer : public LLEventTimer void startTimer(); void stopTimer(); bool isRunning(); - BOOL tick(); + BOOL tick() override; }; diff --git a/indra/newview/lllocationhistory.h b/indra/newview/lllocationhistory.h index 5a8433fb49c4258d83eb063c360795e01a0127de..1678461bdf66bb2990d8eb890ffc28ff8b3452ef 100644 --- a/indra/newview/lllocationhistory.h +++ b/indra/newview/lllocationhistory.h @@ -42,9 +42,9 @@ public: LLLocationHistoryItem(){} LLLocationHistoryItem(std::string typed_location, LLVector3d global_position, std::string tooltip,ELocationType type ): - mLocation(typed_location), - mGlobalPos(global_position), + mGlobalPos(global_position), mToolTip(tooltip), + mLocation(typed_location), mType(type) {} LLLocationHistoryItem(const LLLocationHistoryItem& item): @@ -54,9 +54,9 @@ public: mType(item.mType) {} LLLocationHistoryItem(const LLSD& data): - mLocation(data["location"]), mGlobalPos(data["global_pos"]), mToolTip(data["tooltip"]), + mLocation(data["location"]), mType(ELocationType(data["item_type"].asInteger())) {} diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index f92dbf77e22c701daffade1fa1d13a563aaa6105..bd239ccd9448b587e20cb2621b15a84f09f53c45 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -89,22 +89,22 @@ public: }; // LLView interface - /*virtual*/ void setEnabled(BOOL enabled); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); - /*virtual*/ void onFocusReceived(); - /*virtual*/ void onFocusLost(); - /*virtual*/ void draw(); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /*virtual*/ void setEnabled(BOOL enabled) override; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask) override; + /*virtual*/ void onFocusReceived() override; + /*virtual*/ void onFocusLost() override; + /*virtual*/ void draw() override; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; //======================================================================== // LLUICtrl interface - /*virtual*/ void setFocus(BOOL b); + /*virtual*/ void setFocus(BOOL b) override; //======================================================================== // LLComboBox interface - void hideList(); - void onTextEntry(LLLineEditor* line_editor); + void hideList() override; + void onTextEntry(LLLineEditor* line_editor) override; //======================================================================== LLLineEditor* getTextEntry() const { return mTextEntry; } diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 2e95ee225f3e10c3be7bc31dfcefedc92893fdcc..b7e79b073f05d75a08da741ff7860b6d8374a73f 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -129,7 +129,7 @@ public: { typedef boost::date_time::local_adjustor<ptime, -8, no_dst> pst; typedef boost::date_time::local_adjustor<ptime, -7, no_dst> pdt; - time_t t_time = time(NULL); + time_t t_time = time(nullptr); ptime p_time = LLStringOps::getPacificDaylightTime() ? pdt::utc_to_local(from_time_t(t_time)) : pst::utc_to_local(from_time_t(t_time)); @@ -198,11 +198,11 @@ LLLogChatTimeScanner::LLLogChatTimeScanner() mTimeStream.imbue(std::locale(mTimeStream.getloc(), new time_input_facet(DATE_FORMAT))); } -LLLogChat::save_history_signal_t * LLLogChat::sSaveHistorySignal = NULL; +LLLogChat::save_history_signal_t * LLLogChat::sSaveHistorySignal = nullptr; std::map<LLUUID,LLLoadHistoryThread *> LLLogChat::sLoadHistoryThreads; std::map<LLUUID,LLDeleteHistoryThread *> LLLogChat::sDeleteHistoryThreads; -LLMutex* LLLogChat::sHistoryThreadsMutex = NULL; +LLMutex* LLLogChat::sHistoryThreadsMutex = nullptr; //static @@ -327,7 +327,7 @@ void LLLogChat::saveHistory(const std::string& filename, file.close(); - if (NULL != sSaveHistorySignal) + if (nullptr != sSaveHistorySignal) { (*sSaveHistorySignal)(); } @@ -436,7 +436,7 @@ LLLoadHistoryThread* LLLogChat::getLoadHistoryThread(LLUUID session_id) { return it->second; } - return NULL; + return nullptr; } // static @@ -448,7 +448,7 @@ LLDeleteHistoryThread* LLLogChat::getDeleteHistoryThread(LLUUID session_id) { return it->second; } - return NULL; + return nullptr; } // static @@ -564,7 +564,7 @@ void LLLogChat::findTranscriptFiles(const std::string& pattern, std::vector<std: std::string fullname = gDirUtilp->add(dirname, filename); LLFILE * filep = LLFile::fopen(fullname, "rb"); - if (NULL != filep) + if (nullptr != filep) { if(makeLogFileName("chat") == fullname) { @@ -585,7 +585,7 @@ void LLLogChat::findTranscriptFiles(const std::string& pattern, std::vector<std: bytes_to_read = LOG_RECALL_SIZE - 1; } - if (bytes_to_read > 0 && NULL != fgets(buffer, bytes_to_read, filep)) + if (bytes_to_read > 0 && nullptr != fgets(buffer, bytes_to_read, filep)) { //matching a timestamp boost::match_results<std::string::const_iterator> matches; @@ -618,7 +618,7 @@ void LLLogChat::getListOfTranscriptBackupFiles(std::vector<std::string>& list_of //static boost::signals2::connection LLLogChat::setSaveHistorySignal(const save_history_signal_t::slot_type& cb) { - if (NULL == sSaveHistorySignal) + if (nullptr == sSaveHistorySignal) { sSaveHistorySignal = new save_history_signal_t(); } @@ -956,23 +956,23 @@ LLDeleteHistoryThread::~LLDeleteHistoryThread() } void LLDeleteHistoryThread::run() { - if (mLoadThread != NULL) + if (mLoadThread != nullptr) { mLoadThread->waitFinished(); } - if (NULL != mMessages) + if (nullptr != mMessages) { delete mMessages; } - mMessages = NULL; + mMessages = nullptr; setFinished(); } LLActionThread::LLActionThread(const std::string& name) : LLThread(name), + mFinished(false), mMutex(), - mRunCondition(), - mFinished(false) + mRunCondition() { } @@ -1004,11 +1004,11 @@ void LLActionThread::setFinished() LLLoadHistoryThread::LLLoadHistoryThread(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params) : LLActionThread("load chat history"), - mMessages(messages), mFileName(file_name), + mMessages(messages), mLoadParams(load_params), mNewLoad(true), - mLoadEndSignal(NULL) + mLoadEndSignal(nullptr) { } @@ -1111,7 +1111,7 @@ void LLLoadHistoryThread::loadHistory(const std::string& file_name, std::list<LL boost::signals2::connection LLLoadHistoryThread::setLoadEndSignal(const load_end_signal_t::slot_type& cb) { - if (NULL == mLoadEndSignal) + if (nullptr == mLoadEndSignal) { mLoadEndSignal = new load_end_signal_t(); } @@ -1121,10 +1121,10 @@ boost::signals2::connection LLLoadHistoryThread::setLoadEndSignal(const load_end void LLLoadHistoryThread::removeLoadEndSignal(const load_end_signal_t::slot_type& cb) { - if (NULL != mLoadEndSignal) + if (nullptr != mLoadEndSignal) { mLoadEndSignal->disconnect_all_slots(); delete mLoadEndSignal; } - mLoadEndSignal = NULL; + mLoadEndSignal = nullptr; } diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index e451f12c13ef29efcca5b50c3985f7506916b1f7..4050a0d3780d59f56211e7df263ad843ecaef8ba 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -58,7 +58,7 @@ public: ~LLLoadHistoryThread(); //void setHistoryParams(const std::string& file_name, const LLSD& load_params); virtual void loadHistory(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params); - virtual void run(); + void run() override; typedef boost::signals2::signal<void (std::list<LLSD>* messages,const std::string& file_name)> load_end_signal_t; load_end_signal_t * mLoadEndSignal; @@ -75,7 +75,7 @@ public: LLDeleteHistoryThread(std::list<LLSD>* messages, LLLoadHistoryThread* loadThread); ~LLDeleteHistoryThread(); - virtual void run(); + void run() override; static void deleteHistory(); }; diff --git a/indra/newview/llloginhandler.h b/indra/newview/llloginhandler.h index 1f2eacd094e1c7e27d0efaf021b5659581dd1503..a89211e913857e1719d91aa79dc0ac3c8ba3487a 100644 --- a/indra/newview/llloginhandler.h +++ b/indra/newview/llloginhandler.h @@ -35,7 +35,7 @@ class LLLoginHandler : public LLCommandHandler public: // allow from external browsers LLLoginHandler() : LLCommandHandler("login", UNTRUSTED_ALLOW) { } - /*virtual*/ bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web); + /*virtual*/ bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) override; // Fill in our internal fields from a SLURL like // secondlife:///app/login?first=Bob&last=Dobbs diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index e75c457c1ce45129f26d06cfdebca214489bcda4..0beff200a44cd6d3f2b38dc1fbc59a9745e364f2 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -112,9 +112,9 @@ namespace { { public: CheckingForUpdate(MandatoryUpdateMachine & machine); - - virtual void enter(void); - virtual void exit(void); + + void enter(void) override; + void exit(void) override; private: LLTempBoundListener mConnection; @@ -130,9 +130,9 @@ namespace { { public: Error(MandatoryUpdateMachine & machine); - - virtual void enter(void); - virtual void exit(void); + + void enter(void) override; + void exit(void) override; void onButtonClicked(const LLSD &, const LLSD &); private: @@ -145,9 +145,9 @@ namespace { { public: ReadyToInstall(MandatoryUpdateMachine & machine); - - virtual void enter(void); - virtual void exit(void); + + void enter(void) override; + void exit(void) override; private: //MandatoryUpdateMachine & mMachine; @@ -159,9 +159,9 @@ namespace { { public: StartingUpdaterService(MandatoryUpdateMachine & machine); - - virtual void enter(void); - virtual void exit(void); + + void enter(void) override; + void exit(void) override; void onButtonClicked(const LLSD & uiform, const LLSD & result); private: MandatoryUpdateMachine & mMachine; @@ -173,9 +173,9 @@ namespace { { public: WaitingForDownload(MandatoryUpdateMachine & machine); - - virtual void enter(void); - virtual void exit(void); + + void enter(void) override; + void exit(void) override; private: LLTempBoundListener mConnection; @@ -249,13 +249,13 @@ void MandatoryUpdateMachine::setCurrentState(State * newStatePointer) { { std::unique_ptr<State> newState(newStatePointer); - if(mState != 0) mState->exit(); + if(mState != nullptr) mState->exit(); mState.swap(newState); // Old state will be deleted on exit from this block before the new state // is entered. } - if(mState != 0) mState->enter(); + if(mState != nullptr) mState->enter(); } @@ -417,7 +417,7 @@ void MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked(const LLSD MandatoryUpdateMachine::WaitingForDownload::WaitingForDownload(MandatoryUpdateMachine & machine): mMachine(machine), - mProgressView(0) + mProgressView(nullptr) { ; // No op. } @@ -475,13 +475,13 @@ bool MandatoryUpdateMachine::WaitingForDownload::onEvent(LLSD const & event) LLLoginInstance::LLLoginInstance() : mLoginModule(new LLLogin()), - mNotifications(NULL), + mNotifications(nullptr), mLoginState("offline"), mSkipOptionalUpdate(false), mAttemptComplete(false), mTransferRate(0.0f), mDispatcher("LLLoginInstance", "change"), - mUpdaterService(0) + mUpdaterService(nullptr) { mLoginModule->getEventPump().listen("lllogininstance", boost::bind(&LLLoginInstance::handleLoginEvent, this, _1)); diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp index e5998861ef21134c3adc07890a15137c906ebced..cea4081743781edc6062ccacb485ca6273819cb0 100644 --- a/indra/newview/llmachineid.cpp +++ b/indra/newview/llmachineid.cpp @@ -60,7 +60,7 @@ S32 LLMachineID::init() // Step 1: -------------------------------------------------- // Initialize COM. ------------------------------------------ - hres = CoInitializeEx(0, COINIT_MULTITHREADED); + hres = CoInitializeEx(nullptr, COINIT_MULTITHREADED); if (FAILED(hres)) { LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << std::hex << hres << std::dec << LL_ENDL; @@ -75,15 +75,15 @@ S32 LLMachineID::init() // parameter of CoInitializeSecurity ------------------------ hres = CoInitializeSecurity( - NULL, + nullptr, -1, // COM authentication - NULL, // Authentication services - NULL, // Reserved + nullptr, // Authentication services + nullptr, // Reserved RPC_C_AUTHN_LEVEL_DEFAULT, // Default authentication RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation - NULL, // Authentication info + nullptr, // Authentication info EOAC_NONE, // Additional capabilities - NULL // Reserved + nullptr // Reserved ); @@ -97,11 +97,11 @@ S32 LLMachineID::init() // Step 3: --------------------------------------------------- // Obtain the initial locator to WMI ------------------------- - IWbemLocator *pLoc = NULL; + IWbemLocator *pLoc = nullptr; hres = CoCreateInstance( CLSID_WbemLocator, - 0, + nullptr, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID *) &pLoc); @@ -115,19 +115,19 @@ S32 LLMachineID::init() // Step 4: ----------------------------------------------------- // Connect to WMI through the IWbemLocator::ConnectServer method - IWbemServices *pSvc = NULL; + IWbemServices *pSvc = nullptr; // Connect to the root\cimv2 namespace with // the current user and obtain pointer pSvc // to make IWbemServices calls. hres = pLoc->ConnectServer( _bstr_t(L"ROOT\\CIMV2"), // Object path of WMI namespace - NULL, // User name. NULL = current user - NULL, // User password. NULL = current - 0, // Locale. NULL indicates current + nullptr, // User name. NULL = current user + nullptr, // User password. NULL = current + nullptr, // Locale. NULL indicates current NULL, // Security flags. - 0, // Authority (e.g. Kerberos) - 0, // Context object + nullptr, // Authority (e.g. Kerberos) + nullptr, // Context object &pSvc // pointer to IWbemServices proxy ); @@ -149,10 +149,10 @@ S32 LLMachineID::init() pSvc, // Indicates the proxy to set RPC_C_AUTHN_WINNT, // RPC_C_AUTHN_xxx RPC_C_AUTHZ_NONE, // RPC_C_AUTHZ_xxx - NULL, // Server principal name + nullptr, // Server principal name RPC_C_AUTHN_LEVEL_CALL, // RPC_C_AUTHN_LEVEL_xxx RPC_C_IMP_LEVEL_IMPERSONATE, // RPC_C_IMP_LEVEL_xxx - NULL, // client identity + nullptr, // client identity EOAC_NONE // proxy capabilities ); @@ -169,12 +169,12 @@ S32 LLMachineID::init() // Use the IWbemServices pointer to make requests of WMI ---- // For example, get the name of the operating system - IEnumWbemClassObject* pEnumerator = NULL; + IEnumWbemClassObject* pEnumerator = nullptr; hres = pSvc->ExecQuery( bstr_t("WQL"), bstr_t("SELECT * FROM Win32_OperatingSystem"), - WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, - NULL, + WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, + nullptr, &pEnumerator); if (FAILED(hres)) @@ -189,7 +189,7 @@ S32 LLMachineID::init() // Step 7: ------------------------------------------------- // Get the data from the query in step 6 ------------------- - IWbemClassObject *pclsObj = NULL; + IWbemClassObject *pclsObj = nullptr; ULONG uReturn = 0; while (pEnumerator) @@ -205,7 +205,7 @@ S32 LLMachineID::init() VARIANT vtProp; // Get the value of the Name property - hr = pclsObj->Get(L"SerialNumber", 0, &vtProp, 0, 0); + hr = pclsObj->Get(L"SerialNumber", 0, &vtProp, nullptr, nullptr); LL_INFOS("AppInit") << " Serial Number : " << vtProp.bstrVal << LL_ENDL; // use characters in the returned Serial Number to create a byte array of size len BSTR serialNumber ( vtProp.bstrVal); @@ -224,7 +224,7 @@ S32 LLMachineID::init() VariantClear(&vtProp); pclsObj->Release(); - pclsObj = NULL; + pclsObj = nullptr; break; } diff --git a/indra/newview/llmainlooprepeater.cpp b/indra/newview/llmainlooprepeater.cpp index e82b040d123f7864387cd1488e23daf8e4698ab1..3b4194a50974a9151f2d4a2a2927bee22bc51c44 100644 --- a/indra/newview/llmainlooprepeater.cpp +++ b/indra/newview/llmainlooprepeater.cpp @@ -38,7 +38,7 @@ LLMainLoopRepeater::LLMainLoopRepeater(void): - mQueue(0) + mQueue(nullptr) { ; // No op. } @@ -46,7 +46,7 @@ LLMainLoopRepeater::LLMainLoopRepeater(void): void LLMainLoopRepeater::start(void) { - if(mQueue != 0) return; + if(mQueue != nullptr) return; mQueue = new LLThreadSafeQueue<LLSD>(gAPRPoolp, 1024); mMainLoopConnection = LLEventPumps::instance(). @@ -62,7 +62,7 @@ void LLMainLoopRepeater::stop(void) mRepeaterConnection.release(); delete mQueue; - mQueue = 0; + mQueue = nullptr; } diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index e21068e3e4dfaf1a7e2d64f1ec03ca8925395d1b..a124fbef702aed3fe8b6fc0ecf479409349c4f60 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -210,7 +210,7 @@ void LLManip::handleDeselect() { mHighlightedPart = LL_NO_PART; mManipPart = LL_NO_PART; - mObjectSelection = NULL; + mObjectSelection = nullptr; } LLObjectSelectionHandle LLManip::getSelection() diff --git a/indra/newview/llmanip.h b/indra/newview/llmanip.h index 246197c7479ad0fc589cb13fc7b0d4fb811efec9..0c7f3a824b0908bc9c76570580444e44f11e329a 100644 --- a/indra/newview/llmanip.h +++ b/indra/newview/llmanip.h @@ -121,11 +121,11 @@ public: void renderGuidelines(BOOL draw_x = TRUE, BOOL draw_y = TRUE, BOOL draw_z = TRUE); static void renderXYZ(const LLVector3 &vec); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; virtual void highlightManipulators(S32 x, S32 y) = 0; - virtual void handleSelect(); - virtual void handleDeselect(); + void handleSelect() override; + void handleDeselect() override; virtual BOOL canAffectSelection() = 0; EManipPart getHighlightedPart() { return mHighlightedPart; } diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 726f0856556cb75738f5996c7def75af349d3a15..78cb93ee45df7934b38f5f8bd6a67d69aadfe2a4 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -482,11 +482,11 @@ BOOL LLManipRotate::handleMouseUp(S32 x, S32 y, MASK mask) { LLSelectNode* selectNode = *iter; LLViewerObject* object = selectNode->getObject(); - LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit(); + LLViewerObject* root_object = (object == nullptr) ? NULL : object->getRootEdit(); // have permission to move and object is root of selection or individually selected if (object && object->permMove() && !object->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && (object->isRootEdit() || selectNode->mIndividualSelection)) { object->mUnselectedChildrenPositions.clear() ; @@ -573,11 +573,11 @@ void LLManipRotate::drag( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject* object = selectNode->getObject(); - LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit(); + LLViewerObject* root_object = (object == nullptr) ? NULL : object->getRootEdit(); // have permission to move and object is root of selection or individually selected if (object && object->permMove() && !object->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && (object->isRootEdit() || selectNode->mIndividualSelection)) { if (!object->isRootEdit()) @@ -630,11 +630,11 @@ void LLManipRotate::drag( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject* object = selectNode->getObject(); - LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit(); + LLViewerObject* root_object = (object == nullptr) ? NULL : object->getRootEdit(); // to avoid cumulative position changes we calculate the objects new position using its saved position if (object && object->permMove() && !object->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced())) + ((root_object == nullptr) || !root_object->isPermanentEnforced())) { LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter ); @@ -715,9 +715,9 @@ void LLManipRotate::drag( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); - LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit(); + LLViewerObject *root_object = (cur == nullptr) ? NULL : cur->getRootEdit(); if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && !cur->isAvatar()) { selectNode->mLastRotation = cur->getRotation(); @@ -1924,11 +1924,11 @@ BOOL LLManipRotate::canAffectSelection() { struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* objectp) + bool apply(LLViewerObject* objectp) override { - LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit(); + LLViewerObject *root_object = (objectp == nullptr) ? NULL : objectp->getRootEdit(); return objectp->permMove() && !objectp->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); } } func; diff --git a/indra/newview/llmaniprotate.h b/indra/newview/llmaniprotate.h index e8f1c24c584bbcac14622c20936d8966a9117b32..e892f8abdd34d5da7cf25e47675c647543300f19 100644 --- a/indra/newview/llmaniprotate.h +++ b/indra/newview/llmaniprotate.h @@ -53,16 +53,16 @@ public: LLManipRotate( LLToolComposite* composite ); - virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); - virtual BOOL handleHover( S32 x, S32 y, MASK mask ); - virtual void render(); + BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + BOOL handleMouseUp( S32 x, S32 y, MASK mask ) override; + BOOL handleHover( S32 x, S32 y, MASK mask ) override; + void render() override; - virtual void handleSelect(); + void handleSelect() override; - virtual BOOL handleMouseDownOnPart(S32 x, S32 y, MASK mask); - virtual void highlightManipulators(S32 x, S32 y); - virtual BOOL canAffectSelection(); + BOOL handleMouseDownOnPart(S32 x, S32 y, MASK mask) override; + void highlightManipulators(S32 x, S32 y) override; + BOOL canAffectSelection() override; private: void updateHoverView(); diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 24f7e252035f034923ae1c158910032b82daf534..046523d1032dfa27773c50841c296fbcbceed19b 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -190,8 +190,8 @@ LLManipScale::LLManipScale( LLToolComposite* composite ) mTickPixelSpacing1(0.f), mTickPixelSpacing2(0.f), mSnapGuideLength(0.f), - mSnapRegime(SNAP_REGIME_NONE), - mScaleSnappedValue(0.f) + mScaleSnappedValue(0.f), + mSnapRegime(SNAP_REGIME_NONE) { for (S32 i = 0; i < NUM_MANIPULATORS; i++) { @@ -828,9 +828,9 @@ void LLManipScale::drag( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); - LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit(); + LLViewerObject *root_object = (cur == nullptr) ? NULL : cur->getRootEdit(); if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && !cur->isAvatar()) { selectNode->mLastScale = cur->getScale(); @@ -947,9 +947,9 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject* cur = selectNode->getObject(); - LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit(); + LLViewerObject *root_object = (cur == nullptr) ? NULL : cur->getRootEdit(); if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && !cur->isAvatar() ) { const LLVector3& scale = selectNode->mSavedScale; @@ -978,9 +978,9 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject* cur = selectNode->getObject(); - LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit(); + LLViewerObject *root_object = (cur == nullptr) ? NULL : cur->getRootEdit(); if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && !cur->isAvatar() && cur->isRootEdit() ) { const LLVector3& scale = selectNode->mSavedScale; @@ -1029,9 +1029,9 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); - LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit(); + LLViewerObject *root_object = (cur == nullptr) ? NULL : cur->getRootEdit(); if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && !cur->isAvatar() && !cur->isRootEdit() ) { const LLVector3& scale = selectNode->mSavedScale; @@ -1230,9 +1230,9 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); - LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit(); + LLViewerObject *root_object = (cur == nullptr) ? NULL : cur->getRootEdit(); if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && !cur->isAvatar() ) { LLBBox cur_bbox = cur->getBoundingBoxAgent(); @@ -2102,11 +2102,11 @@ BOOL LLManipScale::canAffectSelection() { struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* objectp) + bool apply(LLViewerObject* objectp) override { - LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit(); + LLViewerObject *root_object = (objectp == nullptr) ? NULL : objectp->getRootEdit(); return objectp->permModify() && objectp->permMove() && !objectp->isPermanentEnforced() && - (root_object == NULL || (!root_object->isPermanentEnforced() && !root_object->isSeat())) && + (root_object == nullptr || (!root_object->isPermanentEnforced() && !root_object->isSeat())) && !objectp->isSeat(); } } func; diff --git a/indra/newview/llmanipscale.h b/indra/newview/llmanipscale.h index 11ade9b7d0a04e0073e89c0ab004d10dead62c29..5ca16c1b0881a3f11622e7fb4552ec09b3bab893 100644 --- a/indra/newview/llmanipscale.h +++ b/indra/newview/llmanipscale.h @@ -76,15 +76,15 @@ public: LLManipScale( LLToolComposite* composite ); ~LLManipScale(); - virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); - virtual BOOL handleHover( S32 x, S32 y, MASK mask ); - virtual void render(); - virtual void handleSelect(); + BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + BOOL handleMouseUp( S32 x, S32 y, MASK mask ) override; + BOOL handleHover( S32 x, S32 y, MASK mask ) override; + void render() override; + void handleSelect() override; - virtual BOOL handleMouseDownOnPart(S32 x, S32 y, MASK mask); - virtual void highlightManipulators(S32 x, S32 y); // decided which manipulator, if any, should be highlighted by mouse hover - virtual BOOL canAffectSelection(); + BOOL handleMouseDownOnPart(S32 x, S32 y, MASK mask) override; + void highlightManipulators(S32 x, S32 y) override; // decided which manipulator, if any, should be highlighted by mouse hover + BOOL canAffectSelection() override; static void setUniform( BOOL b ); static BOOL getUniform(); @@ -103,7 +103,7 @@ private: void revert(); - inline void conditionalHighlight( U32 part, const LLColor4* highlight = NULL, const LLColor4* normal = NULL ); + inline void conditionalHighlight( U32 part, const LLColor4* highlight = nullptr, const LLColor4* normal = nullptr ); void drag( S32 x, S32 y ); void dragFace( S32 x, S32 y ); diff --git a/indra/newview/llmaniptranslate.h b/indra/newview/llmaniptranslate.h index 3c37bbd69834de064cba16d60f4d374deadeeee9..c26f50e97cfa5c35e1840df8ca8e809993c2ff66 100644 --- a/indra/newview/llmaniptranslate.h +++ b/indra/newview/llmaniptranslate.h @@ -53,15 +53,15 @@ public: static U32 getGridTexName() ; static void destroyGL(); static void restoreGL(); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual void render(); - virtual void handleSelect(); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + void render() override; + void handleSelect() override; - virtual void highlightManipulators(S32 x, S32 y); - virtual BOOL handleMouseDownOnPart(S32 x, S32 y, MASK mask); - virtual BOOL canAffectSelection(); + void highlightManipulators(S32 x, S32 y) override; + BOOL handleMouseDownOnPart(S32 x, S32 y, MASK mask) override; + BOOL canAffectSelection() override; protected: enum EHandleType { diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 53a7d738f73f7dd51a8221f0c4dceffb9dc753e3..ff5051e978163be38747b5246dc422747e807758 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -283,7 +283,7 @@ namespace LLMarketplaceImport if (buildHeaders) { - httpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + httpHeaders = boost::make_shared<LLCore::HttpHeaders>(); httpHeaders->append(HTTP_OUT_HEADER_ACCEPT, "*/*"); httpHeaders->append(HTTP_OUT_HEADER_COOKIE, sMarketplaceCookie); @@ -456,15 +456,15 @@ LLMarketplaceInventoryImporter::LLMarketplaceInventoryImporter() , mImportInProgress(false) , mInitialized(false) , mMarketPlaceStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED) - , mErrorInitSignal(NULL) - , mStatusChangedSignal(NULL) - , mStatusReportSignal(NULL) + , mErrorInitSignal(nullptr) + , mStatusChangedSignal(nullptr) + , mStatusReportSignal(nullptr) { } boost::signals2::connection LLMarketplaceInventoryImporter::setInitializationErrorCallback(const status_report_signal_t::slot_type& cb) { - if (mErrorInitSignal == NULL) + if (mErrorInitSignal == nullptr) { mErrorInitSignal = new status_report_signal_t(); } @@ -474,7 +474,7 @@ boost::signals2::connection LLMarketplaceInventoryImporter::setInitializationErr boost::signals2::connection LLMarketplaceInventoryImporter::setStatusChangedCallback(const status_changed_signal_t::slot_type& cb) { - if (mStatusChangedSignal == NULL) + if (mStatusChangedSignal == nullptr) { mStatusChangedSignal = new status_changed_signal_t(); } @@ -484,7 +484,7 @@ boost::signals2::connection LLMarketplaceInventoryImporter::setStatusChangedCall boost::signals2::connection LLMarketplaceInventoryImporter::setStatusReportCallback(const status_report_signal_t::slot_type& cb) { - if (mStatusReportSignal == NULL) + if (mStatusReportSignal == nullptr) { mStatusReportSignal = new status_report_signal_t(); } @@ -609,7 +609,7 @@ class LLMarketplaceInventoryObserver : public LLInventoryObserver public: LLMarketplaceInventoryObserver() {} virtual ~LLMarketplaceInventoryObserver() {} - virtual void changed(U32 mask); + void changed(U32 mask) override; }; void LLMarketplaceInventoryObserver::changed(U32 mask) @@ -718,10 +718,10 @@ LLMarketplaceTuple::LLMarketplaceTuple(const LLUUID& folder_id, S32 listing_id, // Data map LLMarketplaceData::LLMarketplaceData() : mMarketPlaceStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED), + mStatusUpdatedSignal(nullptr), + mDirtyCount(false), mMarketPlaceDataFetched(MarketplaceFetchCodes::MARKET_FETCH_NOT_DONE), - mStatusUpdatedSignal(NULL), - mDataFetchedSignal(NULL), - mDirtyCount(false) + mDataFetchedSignal(nullptr) { mInventoryObserver = new LLMarketplaceInventoryObserver; gInventory.addObserver(mInventoryObserver); @@ -754,7 +754,7 @@ LLSD LLMarketplaceData::getMarketplaceStringSubstitutions() void LLMarketplaceData::initializeSLM(const status_updated_signal_t::slot_type& cb) { - if (mStatusUpdatedSignal == NULL) + if (mStatusUpdatedSignal == nullptr) { mStatusUpdatedSignal = new status_updated_signal_t(); } @@ -836,7 +836,7 @@ void LLMarketplaceData::getMerchantStatusCoro() void LLMarketplaceData::setDataFetchedSignal(const status_updated_signal_t::slot_type& cb) { - if (mDataFetchedSignal == NULL) + if (mDataFetchedSignal == nullptr) { mDataFetchedSignal = new status_updated_signal_t(); } diff --git a/indra/newview/llmarketplacenotifications.cpp b/indra/newview/llmarketplacenotifications.cpp index 333b75c37e9e03d403df9ac0534742910afbe336..4d95be6f3864fe36c9cbd9a4d798bf0e8ca31b69 100644 --- a/indra/newview/llmarketplacenotifications.cpp +++ b/indra/newview/llmarketplacenotifications.cpp @@ -39,7 +39,7 @@ namespace LLMarketplaceInventoryNotifications { typedef boost::signals2::signal<void (const LLSD& param)> no_copy_payload_cb_signal_t; - static no_copy_payload_cb_signal_t* no_copy_cb_action = NULL; + static no_copy_payload_cb_signal_t* no_copy_cb_action = nullptr; static bool no_copy_notify_active = false; static std::list<LLSD> no_copy_payloads; @@ -59,7 +59,7 @@ namespace LLMarketplaceInventoryNotifications } delete no_copy_cb_action; - no_copy_cb_action = NULL; + no_copy_cb_action = nullptr; no_copy_notify_active = false; no_copy_payloads.clear(); @@ -77,7 +77,7 @@ namespace LLMarketplaceInventoryNotifications void addNoCopyNotification(const LLSD& payload, const NoCopyCallbackFunction& cb) { - if (no_copy_cb_action == NULL) + if (no_copy_cb_action == nullptr) { no_copy_cb_action = new no_copy_payload_cb_signal_t; no_copy_cb_action->connect(boost::bind(cb, _1)); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index feb1e173e939faf25515e9d00da277ad917ebe5c..158a0079779c58e1a9423bdc03c62db55faf838d 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -72,14 +72,14 @@ LLMediaCtrl::Params::Params() : start_url("start_url"), border_visible("border_visible", true), decouple_texture_size("decouple_texture_size", false), + trusted_content("trusted_content", false), + focus_on_click("focus_on_click", true), texture_width("texture_width", 1024), texture_height("texture_height", 1024), caret_color("caret_color"), initial_mime_type("initial_mime_type"), - error_page_url("error_page_url"), media_id("media_id"), - trusted_content("trusted_content", false), - focus_on_click("focus_on_click", true) + error_page_url("error_page_url") { } @@ -87,28 +87,28 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : LLPanel( p ), LLInstanceTracker<LLMediaCtrl, LLUUID>(LLUUID::generateNewID()), mTextureDepthBytes( 4 ), - mBorder(NULL), + mBorder(nullptr), mFrequentUpdates( true ), mForceUpdate( false ), - mHomePageUrl( "" ), + mTrusted(p.trusted_content), mAlwaysRefresh( false ), - mMediaSource( 0 ), mTakeFocusOnClick( p.focus_on_click ), - mCurrentNavUrl( "" ), mStretchToFill( true ), mMaintainAspectRatio ( true ), - mDecoupleTextureSize ( false ), - mUpdateScrolls( false ), - mTextureWidth ( 1024 ), - mTextureHeight ( 1024 ), - mClearCache(false), mHideLoading(p.hide_loading), mHidingInitialLoad(false), + mClearCache(false), + mHoverTextChanged(false), + mDecoupleTextureSize ( false ), + mUpdateScrolls( false ), + mHomePageUrl( "" ), mHomePageMimeType(p.initial_mime_type), + mCurrentNavUrl( "" ), mErrorPageURL(p.error_page_url), - mTrusted(p.trusted_content), - mWindowShade(NULL), - mHoverTextChanged(false), + mMediaSource( nullptr ), + mTextureWidth ( 1024 ), + mTextureHeight ( 1024 ), + mWindowShade(nullptr), mContextMenuHandle() { { @@ -163,7 +163,7 @@ LLMediaCtrl::~LLMediaCtrl() if (mMediaSource) { mMediaSource->remObserver( this ); - mMediaSource = NULL; + mMediaSource = nullptr; } } @@ -259,7 +259,7 @@ BOOL LLMediaCtrl::handleMouseUp( S32 x, S32 y, MASK mask ) mMediaSource->mouseUp(x, y, mask); } - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); return TRUE; } @@ -304,7 +304,7 @@ BOOL LLMediaCtrl::handleRightMouseUp( S32 x, S32 y, MASK mask ) } } - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); return TRUE; } @@ -389,7 +389,7 @@ void LLMediaCtrl::onFocusLost() if( LLEditMenuHandler::gEditMenuHandler == mMediaSource ) { // Clear focus for edit menu items - LLEditMenuHandler::gEditMenuHandler = NULL; + LLEditMenuHandler::gEditMenuHandler = nullptr; } } @@ -407,7 +407,7 @@ BOOL LLMediaCtrl::postBuild () // stinson 05/05/2014 : use this as the parent of the context menu if the static menu // container has yet to be created - LLView* menuParent = (gMenuHolder != NULL) ? dynamic_cast<LLView*>(gMenuHolder) : dynamic_cast<LLView*>(this); + LLView* menuParent = (gMenuHolder != nullptr) ? dynamic_cast<LLView*>(gMenuHolder) : dynamic_cast<LLView*>(this); llassert(menuParent != NULL); auto menu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>( "menu_media_ctrl.xml", menuParent, LLViewerMenuHolderGL::child_registry_t::instance()); @@ -744,7 +744,7 @@ bool LLMediaCtrl::ensureMediaSourceExists() // void LLMediaCtrl::unloadMediaSource() { - mMediaSource = NULL; + mMediaSource = nullptr; } //////////////////////////////////////////////////////////////////////////////// @@ -782,8 +782,8 @@ void LLMediaCtrl::draw() bool draw_media = false; - LLPluginClassMedia* media_plugin = NULL; - LLViewerMediaTexture* media_texture = NULL; + LLPluginClassMedia* media_plugin = nullptr; + LLViewerMediaTexture* media_texture = nullptr; if(mMediaSource && mMediaSource->hasMedia()) { @@ -1023,7 +1023,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << target << "\", uri is " << url << LL_ENDL; // try as slurl first - if (!LLURLDispatcher::dispatch(url, "clicked", NULL, mTrusted)) + if (!LLURLDispatcher::dispatch(url, "clicked", nullptr, mTrusted)) { LLWeb::loadURL(url, target, std::string()); } diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 9aff723dd8889d1abb4156bca0ea2f88378f3084..985c94e184fe05b23ee39282d4cf929fadbd592d 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -85,14 +85,14 @@ public: void setTakeFocusOnClick( bool take_focus ); // handle mouse related methods - virtual BOOL handleHover( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); - virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); - virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); + BOOL handleHover( S32 x, S32 y, MASK mask ) override; + BOOL handleMouseUp( S32 x, S32 y, MASK mask ) override; + BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick( S32 x, S32 y, MASK mask ) override; + BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ) override; + BOOL handleToolTip(S32 x, S32 y, MASK mask) override; // navigation void navigateTo( std::string url_in, std::string mime_type = "", bool clean_browser = false); @@ -150,20 +150,20 @@ public: void setTrustedContent(bool trusted); // over-rides - virtual BOOL handleKeyHere( KEY key, MASK mask); - virtual BOOL handleKeyUpHere(KEY key, MASK mask); - virtual void onVisibilityChange ( BOOL new_visibility ); - virtual BOOL handleUnicodeCharHere(llwchar uni_char); - virtual void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE); - virtual void draw(); - virtual BOOL postBuild(); + BOOL handleKeyHere( KEY key, MASK mask) override; + BOOL handleKeyUpHere(KEY key, MASK mask) override; + void onVisibilityChange ( BOOL new_visibility ) override; + BOOL handleUnicodeCharHere(llwchar uni_char) override; + void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE) override; + void draw() override; + BOOL postBuild() override; // focus overrides - void onFocusLost(); - void onFocusReceived(); + void onFocusLost() override; + void onFocusReceived() override; // Incoming media event dispatcher - virtual void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; // right click debugging item void onOpenWebInspector(); @@ -171,8 +171,8 @@ public: LLUUID getTextureID() {return mMediaTextureID;} // The Browser windows want keyup and keydown events. Overridden from LLFocusableElement to return true. - virtual bool wantsKeyUpKeyDown() const; - virtual bool wantsReturnKey() const; + bool wantsKeyUpKeyDown() const override; + bool wantsReturnKey() const override; protected: void convertInputCoords(S32& x, S32& y); diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 4e6c439f1942752937dfdd3e75bfb0535470d4b7..9e2e981bb5dbf5e52d3c73c6f50f5690c9fedbec 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -170,11 +170,11 @@ LLMediaDataClient::LLMediaDataClient(F32 queue_timer_delay, F32 retry_timer_dela mMaxNumRetries(max_retries), mMaxSortedQueueSize(max_sorted_queue_size), mMaxRoundRobinQueueSize(max_round_robin_queue_size), - mQueueTimerIsRunning(false), mHttpRequest(new LLCore::HttpRequest()), mHttpHeaders(new LLCore::HttpHeaders()), mHttpOpts(new LLCore::HttpOptions()), - mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID) + mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), + mQueueTimerIsRunning(false) { // *TODO: Look up real Policy ID } @@ -424,7 +424,7 @@ BOOL LLMediaDataClient::QueueTimer::tick() { // This timer won't fire again. mMDC->setIsRunning(false); - mMDC = NULL; + mMDC = nullptr; } } @@ -478,13 +478,13 @@ LLMediaDataClient::Request::Request(Type in_type, LLMediaDataClientObject *obj, LLMediaDataClient *mdc, S32 face) -: mType(in_type), - mObject(obj), +: mObject(obj), + mType(in_type), mNum(++sNum), mRetryCount(0), - mMDC(mdc), mScore((F64)0.0), - mFace(face) + mFace(face), + mMDC(mdc) { mObjectID = mObject->getID(); } @@ -565,12 +565,12 @@ void LLMediaDataClient::Request::updateScore() void LLMediaDataClient::Request::markDead() { - mMDC = NULL; + mMDC = nullptr; } bool LLMediaDataClient::Request::isDead() { - return ((mMDC == NULL) || mObject->isDead()); + return ((mMDC == nullptr) || mObject->isDead()); } void LLMediaDataClient::Request::startTracking() @@ -659,7 +659,7 @@ void LLMediaDataClient::Handler::onFailure(LLCore::HttpResponse * response, LLCo void LLObjectMediaDataClient::fetchMedia(LLMediaDataClientObject *object) { // Create a get request and put it in the queue. - enqueue(Request::ptr_t(new RequestGet(object, this))); + enqueue(boost::static_pointer_cast<Request>(boost::make_shared<RequestGet>(object, this))); } const char *LLObjectMediaDataClient::getCapabilityName() const @@ -872,14 +872,14 @@ LLSD LLObjectMediaDataClient::RequestGet::getPayload() const LLCore::HttpHandler::ptr_t LLObjectMediaDataClient::RequestGet::createHandler() { - return LLCore::HttpHandler::ptr_t(new LLObjectMediaDataClient::Handler(shared_from_this())); + return boost::static_pointer_cast<LLCore::HttpHandler>(boost::make_shared<LLObjectMediaDataClient::Handler>(shared_from_this())); } void LLObjectMediaDataClient::updateMedia(LLMediaDataClientObject *object) { // Create an update request and put it in the queue. - enqueue(Request::ptr_t(new RequestUpdate(object, this))); + enqueue(boost::static_pointer_cast<Request>(boost::make_shared<RequestUpdate>(object, this))); } LLObjectMediaDataClient::RequestUpdate::RequestUpdate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc): @@ -909,7 +909,7 @@ LLSD LLObjectMediaDataClient::RequestUpdate::getPayload() const LLCore::HttpHandler::ptr_t LLObjectMediaDataClient::RequestUpdate::createHandler() { // This just uses the base class's responder. - return LLCore::HttpHandler::ptr_t(new LLMediaDataClient::Handler(shared_from_this())); + return boost::static_pointer_cast<LLCore::HttpHandler>(boost::make_shared<LLMediaDataClient::Handler>(shared_from_this())); } void LLObjectMediaDataClient::Handler::onSuccess(LLCore::HttpResponse * response, const LLSD &content) @@ -1022,7 +1022,7 @@ void LLObjectMediaNavigateClient::navigate(LLMediaDataClientObject *object, U8 t // LL_INFOS("LLMediaDataClient") << "navigate() initiated: " << ll_print_sd(sd_payload) << LL_ENDL; // Create a get request and put it in the queue. - enqueue(Request::ptr_t(new RequestNavigate(object, this, texture_index, url))); + enqueue(boost::static_pointer_cast<Request>(boost::make_shared<RequestNavigate>(object, this, texture_index, url))); } LLObjectMediaNavigateClient::RequestNavigate::RequestNavigate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc, U8 texture_index, const std::string &url): @@ -1043,7 +1043,7 @@ LLSD LLObjectMediaNavigateClient::RequestNavigate::getPayload() const LLCore::HttpHandler::ptr_t LLObjectMediaNavigateClient::RequestNavigate::createHandler() { - return LLCore::HttpHandler::ptr_t(new LLObjectMediaNavigateClient::Handler(shared_from_this())); + return boost::static_pointer_cast<LLCore::HttpHandler>(boost::make_shared<LLObjectMediaNavigateClient::Handler>(shared_from_this())); } void LLObjectMediaNavigateClient::Handler::onSuccess(LLCore::HttpResponse * response, const LLSD &content) diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index 58f8bad3e444cf931fc35ef5b31eadd4a686e170..502298c9196653ede0c66dbb1e8f99d2c0f327ff 100644 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -207,8 +207,8 @@ protected: Request::ptr_t getRequest() const { return mRequest; } protected: - virtual void onSuccess(LLCore::HttpResponse * response, const LLSD &content); - virtual void onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status); + void onSuccess(LLCore::HttpResponse * response, const LLSD &content) override; + void onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status) override; private: Request::ptr_t mRequest; @@ -219,7 +219,7 @@ protected: { public: RetryTimer(F32 time, Request::ptr_t); - virtual BOOL tick(); + BOOL tick() override; private: // back-pointer Request::ptr_t mRequest; @@ -286,7 +286,7 @@ private: { public: QueueTimer(F32 time, LLMediaDataClient *mdc); - virtual BOOL tick(); + BOOL tick() override; private: // back-pointer LLPointer<LLMediaDataClient> mMDC; @@ -323,39 +323,39 @@ public: { public: RequestGet(LLMediaDataClientObject *obj, LLMediaDataClient *mdc); - /*virtual*/ LLSD getPayload() const; - /*virtual*/ LLCore::HttpHandler::ptr_t createHandler(); + /*virtual*/ LLSD getPayload() const override; + /*virtual*/ LLCore::HttpHandler::ptr_t createHandler() override; }; class RequestUpdate: public Request { public: RequestUpdate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc); - /*virtual*/ LLSD getPayload() const; - /*virtual*/ LLCore::HttpHandler::ptr_t createHandler(); + /*virtual*/ LLSD getPayload() const override; + /*virtual*/ LLCore::HttpHandler::ptr_t createHandler() override; }; // Returns true iff the queue is empty - virtual bool isEmpty() const; + bool isEmpty() const override; // Returns true iff the given object is in the queue - virtual bool isInQueue(const LLMediaDataClientObject::ptr_t &object); + bool isInQueue(const LLMediaDataClientObject::ptr_t &object) override; // Remove the given object from the queue. Returns true iff the given object is removed. - virtual void removeFromQueue(const LLMediaDataClientObject::ptr_t &object); + void removeFromQueue(const LLMediaDataClientObject::ptr_t &object) override; - virtual bool processQueueTimer(); + bool processQueueTimer() override; - virtual bool canServiceRequest(Request::ptr_t request); + bool canServiceRequest(Request::ptr_t request) override; protected: // Subclasses must override to return a cap name - virtual const char *getCapabilityName() const; - - virtual request_queue_t *getQueue(); + const char *getCapabilityName() const override; + + request_queue_t *getQueue() override; // Puts the request into the appropriate queue - virtual void enqueue(Request::ptr_t); + void enqueue(Request::ptr_t) override; class Handler: public LLMediaDataClient::Handler { @@ -366,7 +366,7 @@ protected: {} protected: - virtual void onSuccess(LLCore::HttpResponse * response, const LLSD &content); + void onSuccess(LLCore::HttpResponse * response, const LLSD &content) override; }; private: @@ -402,22 +402,22 @@ public: void navigate(LLMediaDataClientObject *object, U8 texture_index, const std::string &url); // Puts the request into the appropriate queue - virtual void enqueue(Request::ptr_t); + void enqueue(Request::ptr_t) override; class RequestNavigate: public Request { public: RequestNavigate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc, U8 texture_index, const std::string &url); - /*virtual*/ LLSD getPayload() const; - /*virtual*/ LLCore::HttpHandler::ptr_t createHandler(); - /*virtual*/ std::string getURL() { return mURL; } + /*virtual*/ LLSD getPayload() const override; + /*virtual*/ LLCore::HttpHandler::ptr_t createHandler() override; + /*virtual*/ std::string getURL() override { return mURL; } private: std::string mURL; }; protected: // Subclasses must override to return a cap name - virtual const char *getCapabilityName() const; + const char *getCapabilityName() const override; class Handler : public LLMediaDataClient::Handler { @@ -428,8 +428,8 @@ protected: {} protected: - virtual void onSuccess(LLCore::HttpResponse * response, const LLSD &content); - virtual void onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status); + void onSuccess(LLCore::HttpResponse * response, const LLSD &content) override; + void onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status) override; private: void mediaNavigateBounceBack(); diff --git a/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp b/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp index 732b1e2d5c684df63d768ebd61c8fcbd7e44213f..5667f35d355188d1826688c7b82048ef9a11fc1a 100644 --- a/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp +++ b/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp @@ -234,7 +234,7 @@ void LLMenuOptionPathfindingRebakeNavmesh::createNavMeshStatusListenerForCurrent } LLViewerRegion *currentRegion = gAgent.getRegion(); - if (currentRegion != NULL) + if (currentRegion != nullptr) { mNavMeshSlot = LLPathfindingManager::getInstance()->registerNavMeshListenerForRegion(currentRegion, boost::bind(&LLMenuOptionPathfindingRebakeNavmesh::handleNavMeshStatus, this, _2)); LLPathfindingManager::getInstance()->requestGetNavMeshForRegion(currentRegion, true); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index c747e7e17415b646c3a2b97a9ed8b9397d89bd0e..a9bb3fca3ade1ea60c0066c41ebab4fb2f4d0b4e 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -571,7 +571,7 @@ protected: void operator=(const LLMeshHandlerBase &) = delete; // Not defined public: - virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) override; virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size) = 0; virtual void processFailure(LLCore::HttpStatus status) = 0; @@ -604,8 +604,8 @@ protected: void operator=(const LLMeshHeaderHandler &) = delete; // Not defined public: - virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); - virtual void processFailure(LLCore::HttpStatus status); + void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size) override; + void processFailure(LLCore::HttpStatus status) override; }; @@ -630,8 +630,8 @@ protected: void operator=(const LLMeshLODHandler &) = delete; // Not defined public: - virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); - virtual void processFailure(LLCore::HttpStatus status); + void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size) override; + void processFailure(LLCore::HttpStatus status) override; public: S32 mLOD; @@ -656,8 +656,8 @@ protected: void operator=(const LLMeshSkinInfoHandler &) = delete; // Not defined public: - virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); - virtual void processFailure(LLCore::HttpStatus status); + void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size) override; + void processFailure(LLCore::HttpStatus status) override; public: LLUUID mMeshID; @@ -682,8 +682,8 @@ protected: void operator=(const LLMeshDecompositionHandler &) = delete; // Not defined public: - virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); - virtual void processFailure(LLCore::HttpStatus status); + void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size) override; + void processFailure(LLCore::HttpStatus status) override; public: LLUUID mMeshID; @@ -708,8 +708,8 @@ protected: void operator=(const LLMeshPhysicsShapeHandler &) = delete; // Not defined public: - virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); - virtual void processFailure(LLCore::HttpStatus status); + void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size) override; + void processFailure(LLCore::HttpStatus status) override; public: LLUUID mMeshID; @@ -799,7 +799,7 @@ void log_upload_error(LLCore::HttpStatus status, const LLSD& content, LLMeshRepoThread::LLMeshRepoThread() : LLThread("mesh repo"), - mHttpRequest(NULL), + mHttpRequest(nullptr), mHttpOptions(), mHttpLargeOptions(), mHttpHeaders(), @@ -815,13 +815,13 @@ LLMeshRepoThread::LLMeshRepoThread() mHeaderMutex = new LLMutex(); mSignal = new LLCondition(); mHttpRequest = new LLCore::HttpRequest; - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpOptions = boost::make_shared<LLCore::HttpOptions>(); mHttpOptions->setTransferTimeout(SMALL_MESH_XFER_TIMEOUT); mHttpOptions->setUseRetryAfter(gSavedSettings.getBOOL("MeshUseHttpRetryAfter")); - mHttpLargeOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpLargeOptions = boost::make_shared<LLCore::HttpOptions>(); mHttpLargeOptions->setTransferTimeout(LARGE_MESH_XFER_TIMEOUT); mHttpLargeOptions->setUseRetryAfter(gSavedSettings.getBOOL("MeshUseHttpRetryAfter")); - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpHeaders = boost::make_shared<LLCore::HttpHeaders>(); mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_VND_LL_MESH); mHttpPolicyClass = app_core_http.getPolicy(LLAppCoreHttp::AP_MESH2); mHttpLegacyPolicyClass = app_core_http.getPolicy(LLAppCoreHttp::AP_MESH1); @@ -840,13 +840,13 @@ LLMeshRepoThread::~LLMeshRepoThread() mHttpHeaders.reset(); delete mHttpRequest; - mHttpRequest = NULL; + mHttpRequest = nullptr; delete mMutex; - mMutex = NULL; + mMutex = nullptr; delete mHeaderMutex; - mHeaderMutex = NULL; + mHeaderMutex = nullptr; delete mSignal; - mSignal = NULL; + mSignal = nullptr; } void LLMeshRepoThread::run() @@ -1485,7 +1485,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) } else { //no physics shape whatsoever, report back NULL - physicsShapeReceived(mesh_id, NULL, 0); + physicsShapeReceived(mesh_id, nullptr, 0); } } else @@ -1749,7 +1749,7 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat bool LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size) { - if (data == NULL || data_size <= 0) + if (data == nullptr || data_size <= 0) { return false; } @@ -1843,7 +1843,7 @@ bool LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32 LLModel::Decomposition* d = new LLModel::Decomposition(); d->mMeshID = mesh_id; - if (data == NULL) + if (data == nullptr) { //no data, no physics shape exists d->mPhysicsShapeMesh.clear(); } @@ -1904,10 +1904,10 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, : LLThread("mesh upload"), LLCore::HttpHandler(), mDiscarded(false), - mDoUpload(do_upload), mWholeModelUploadURL(upload_url), mFeeObserverHandle(fee_observer), - mUploadObserverHandle(upload_observer) + mUploadObserverHandle(upload_observer), + mDoUpload(do_upload) { mInstanceList = data; mUploadTextures = upload_textures; @@ -1927,11 +1927,11 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, mMeshUploadTimeOut = gSavedSettings.getS32("MeshUploadTimeOut"); mHttpRequest = new LLCore::HttpRequest; - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpOptions = boost::make_shared<LLCore::HttpOptions>(); mHttpOptions->setTransferTimeout(mMeshUploadTimeOut); mHttpOptions->setUseRetryAfter(gSavedSettings.getBOOL("MeshUseHttpRetryAfter")); mHttpOptions->setRetries(UPLOAD_RETRY_LIMIT); - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpHeaders = boost::make_shared<LLCore::HttpHeaders>(); mHttpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); mHttpPolicyClass = LLAppViewer::instance()->getAppCoreHttp().getPolicy(LLAppCoreHttp::AP_UPLOADS); mHttpPriority = 0; @@ -1940,7 +1940,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, LLMeshUploadThread::~LLMeshUploadThread() { delete mHttpRequest; - mHttpRequest = NULL; + mHttpRequest = nullptr; } LLMeshUploadThread::DecompRequest::DecompRequest(LLModel* mdl, LLModel* base_model, LLMeshUploadThread* thread) @@ -2151,21 +2151,21 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) LLImportMaterial& material = instance.mMaterial[data.mBaseModel->mMaterialList[face_num]]; LLSD face_entry = LLSD::emptyMap(); - LLViewerFetchedTexture *texture = NULL; + LLViewerFetchedTexture *texture = nullptr; if (material.mDiffuseMapFilename.size()) { texture = FindViewerTexture(material); } - if ((texture != NULL) && + if ((texture != nullptr) && (textures.find(texture) == textures.end())) { textures.insert(texture); } std::stringstream texture_str; - if (texture != NULL && include_textures && mUploadTextures) + if (texture != nullptr && include_textures && mUploadTextures) { if(texture->hasSavedRawImage()) { @@ -2179,7 +2179,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) } } - if (texture != NULL && + if (texture != nullptr && mUploadTextures && texture_index.find(texture) == texture_index.end()) { @@ -2190,7 +2190,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) } // Subset of TextureEntry fields. - if (texture != NULL && mUploadTextures) + if (texture != nullptr && mUploadTextures) { face_entry["image"] = texture_index[texture]; face_entry["scales"] = 1.0; @@ -2310,21 +2310,21 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) LLImportMaterial& material = instance.mMaterial[data.mBaseModel->mMaterialList[face_num]]; LLSD face_entry = LLSD::emptyMap(); - LLViewerFetchedTexture *texture = NULL; + LLViewerFetchedTexture *texture = nullptr; if (material.mDiffuseMapFilename.size()) { texture = FindViewerTexture(material); } - if ((texture != NULL) && + if ((texture != nullptr) && (textures.find(texture) == textures.end())) { textures.insert(texture); } std::stringstream texture_str; - if (texture != NULL && include_textures && mUploadTextures) + if (texture != nullptr && include_textures && mUploadTextures) { if(texture->hasSavedRawImage()) { @@ -2338,7 +2338,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) } } - if (texture != NULL && + if (texture != nullptr && mUploadTextures && texture_index.find(texture) == texture_index.end()) { @@ -2349,7 +2349,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) } // Subset of TextureEntry fields. - if (texture != NULL && mUploadTextures) + if (texture != nullptr && mUploadTextures) { face_entry["image"] = texture_index[texture]; face_entry["scales"] = 1.0; @@ -2395,7 +2395,7 @@ void LLMeshUploadThread::generateHulls() } //queue up models for hull generation - LLModel* physics = NULL; + LLModel* physics = nullptr; if (data.mModel[LLModel::LOD_PHYSICS].notNull()) { @@ -2863,7 +2863,7 @@ void LLMeshHandlerBase::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRespo mProcessed = true; unsigned int retries(0U); - response->getRetries(NULL, &retries); + response->getRetries(nullptr, &retries); LLMeshRepository::sHTTPRetryCount += retries; LLCore::HttpStatus status(response->getStatus()); @@ -2888,7 +2888,7 @@ void LLMeshHandlerBase::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRespo // speculative loads aren't done. LLCore::BufferArray * body(response->getBody()); S32 body_offset(0); - U8 * data(NULL); + U8 * data(nullptr); S32 data_size(body ? body->size() : 0); if (data_size > 0) @@ -3283,9 +3283,9 @@ void LLMeshPhysicsShapeHandler::processData(LLCore::BufferArray * /* body */, S3 } LLMeshRepository::LLMeshRepository() -: mMeshMutex(NULL), +: mMeshMutex(nullptr), mMeshThreadCount(0), - mThread(NULL), + mThread(nullptr), mDecompThread(nullptr), mGetMeshVersion(2) { @@ -3331,7 +3331,7 @@ void LLMeshRepository::shutdown() boost::this_thread::sleep_for(boost::chrono::microseconds(10)); } delete mThread; - mThread = NULL; + mThread = nullptr; for (U32 i = 0; i < mUploads.size(); ++i) { @@ -3346,7 +3346,7 @@ void LLMeshRepository::shutdown() mUploads.clear(); delete mMeshMutex; - mMeshMutex = NULL; + mMeshMutex = nullptr; LL_INFOS(LOG_MESH) << "Shutting down decomposition system." << LL_ENDL; @@ -3354,7 +3354,7 @@ void LLMeshRepository::shutdown() { mDecompThread->shutdown(); delete mDecompThread; - mDecompThread = NULL; + mDecompThread = nullptr; } LLConvexDecomposition::quitSystem(); @@ -3852,7 +3852,7 @@ const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, const } } - return NULL; + return nullptr; } void LLMeshRepository::fetchPhysicsShape(const LLUUID& mesh_id) @@ -3861,7 +3861,7 @@ void LLMeshRepository::fetchPhysicsShape(const LLUUID& mesh_id) if (mesh_id.notNull()) { - LLModel::Decomposition* decomp = NULL; + LLModel::Decomposition* decomp = nullptr; decomposition_map::iterator iter = mDecompositionMap.find(mesh_id); if (iter != mDecompositionMap.end()) { @@ -3888,7 +3888,7 @@ LLModel::Decomposition* LLMeshRepository::getDecomposition(const LLUUID& mesh_id { LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH); - LLModel::Decomposition* ret = NULL; + LLModel::Decomposition* ret = nullptr; if (mesh_id.notNull()) { @@ -4197,9 +4197,9 @@ LLPhysicsDecomp::~LLPhysicsDecomp() shutdown(); delete mSignal; - mSignal = NULL; + mSignal = nullptr; delete mMutex; - mMutex = NULL; + mMutex = nullptr; } void LLPhysicsDecomp::shutdown() @@ -4240,7 +4240,7 @@ bool needTriangles( LLConvexDecomposition *aDC ) if( !aDC ) return false; - LLCDParam const *pParams(0); + LLCDParam const *pParams(nullptr); int nParams = aDC->getParameters( &pParams ); if( nParams <= 0 ) @@ -4288,7 +4288,7 @@ void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh, bool vertex_based) if ((vertex_based || mesh.mNumTriangles > 0) && mesh.mNumVertices > 2) { LLCDResult ret = LLCD_OK; - if (LLConvexDecomposition::getInstance() != NULL) + if (LLConvexDecomposition::getInstance() != nullptr) { ret = LLConvexDecomposition::getInstance()->setMeshData(&mesh, vertex_based); } @@ -4305,7 +4305,7 @@ void LLPhysicsDecomp::doDecomposition() LLCDMeshData mesh; S32 stage = mStageID[mCurRequest->mStage]; - if (LLConvexDecomposition::getInstance() == NULL) + if (LLConvexDecomposition::getInstance() == nullptr) { // stub library. do nothing. return; @@ -4320,7 +4320,7 @@ void LLPhysicsDecomp::doDecomposition() //build parameter map std::map<std::string, const LLCDParam*> param_map; - static const LLCDParam* params = NULL; + static const LLCDParam* params = nullptr; static S32 param_count = 0; if (!params) { @@ -4341,7 +4341,7 @@ void LLPhysicsDecomp::doDecomposition() const LLCDParam* param = param_map[name]; - if (param == NULL) + if (param == nullptr) { //couldn't find valid parameter continue; } @@ -4364,7 +4364,7 @@ void LLPhysicsDecomp::doDecomposition() mCurRequest->setStatusMessage("Executing."); - if (LLConvexDecomposition::getInstance() != NULL) + if (LLConvexDecomposition::getInstance() != nullptr) { ret = LLConvexDecomposition::getInstance()->executeStage(stage); } @@ -4387,7 +4387,7 @@ void LLPhysicsDecomp::doDecomposition() mCurRequest->setStatusMessage("Reading results"); S32 num_hulls =0; - if (LLConvexDecomposition::getInstance() != NULL) + if (LLConvexDecomposition::getInstance() != nullptr) { num_hulls = LLConvexDecomposition::getInstance()->getNumHullsFromStage(stage); } @@ -4441,7 +4441,7 @@ void LLPhysicsDecomp::completeCurrent() { LLMutexLock lock(mMutex); mCompletedQ.push(mCurRequest); - mCurRequest = NULL; + mCurRequest = nullptr; } void LLPhysicsDecomp::notifyCompleted() @@ -4490,7 +4490,7 @@ void LLPhysicsDecomp::doDecompositionSingleHull() { LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance(); - if (decomp == NULL) + if (decomp == nullptr) { //stub. do nothing. return; @@ -4546,7 +4546,7 @@ void LLPhysicsDecomp::doDecompositionSingleHull() void LLPhysicsDecomp::run() { LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance(); - if (decomp == NULL) + if (decomp == nullptr) { // stub library. Set init to true so the main thread // doesn't wait for this to finish. @@ -4557,7 +4557,7 @@ void LLPhysicsDecomp::run() decomp->initThread(); mInited = true; - static const LLCDStageData* stages = NULL; + static const LLCDStageData* stages = nullptr; static S32 num_stages = 0; if (!stages) @@ -4702,7 +4702,7 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp) LLCDMeshData mesh; LLCDResult res = LLCD_NULL_PTR; - if (LLConvexDecomposition::getInstance() != NULL) + if (LLConvexDecomposition::getInstance() != nullptr) { res = LLConvexDecomposition::getInstance()->getMeshFromHull(&hull, &mesh); } @@ -4721,7 +4721,7 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp) LLCDMeshData mesh; LLCDResult res = LLCD_NULL_PTR; - if (LLConvexDecomposition::getInstance() != NULL) + if (LLConvexDecomposition::getInstance() != nullptr) { res = LLConvexDecomposition::getInstance()->getMeshFromHull(&hull, &mesh); } diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 9adf774e5c3b00d2f81da2954bb4a08aaabe3928..159994bab81ac17d3ba4ff8481066bdaf4fbcf9a 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -144,7 +144,7 @@ public: LLPhysicsDecomp(); ~LLPhysicsDecomp(); - void shutdown(); + void shutdown() override; void submitRequest(Request* request); static S32 llcdCallback(const char*, S32, S32); @@ -154,7 +154,7 @@ public: void doDecomposition(); void doDecompositionSingleHull(); - virtual void run(); + void run() override; void completeCurrent(); void notifyCompleted(); @@ -295,7 +295,7 @@ public: LLMeshRepoThread(); ~LLMeshRepoThread(); - virtual void run(); + void run() override; void lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32 lod); void loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod); @@ -379,8 +379,8 @@ public: DecompRequest(LLModel* mdl, LLModel* base_model, LLMeshUploadThread* thread); - S32 statusCallback(const char* status, S32 p1, S32 p2) { return 1; } - void completed(); + S32 statusCallback(const char* status, S32 p1, S32 p2) override { return 1; } + void completed() override; }; LLPointer<DecompRequest> mFinalDecomp; @@ -417,7 +417,7 @@ public: ~LLMeshUploadThread(); bool finished() const { return mFinished; } - virtual void run(); + void run() override; void preStart(); void discard() ; bool isDiscarded() const; @@ -438,7 +438,7 @@ public: void setUploadObserverHandle(LLHandle<LLWholeModelUploadObserver> observer_handle) { mUploadObserverHandle = observer_handle; } // Inherited from LLCore::HttpHandler - virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) override; LLViewerFetchedTexture* FindViewerTexture(const LLImportMaterial& material); @@ -479,8 +479,8 @@ public: static LLDeadmanTimer sQuiescentTimer; // Time-to-complete-mesh-downloads after significant events - F32 getStreamingCost(LLUUID mesh_id, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); - static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); + F32 getStreamingCost(LLUUID mesh_id, F32 radius, S32* bytes = nullptr, S32* visible_bytes = nullptr, S32 detail = -1, F32 *unscaled_value = nullptr); + static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = nullptr, S32* visible_bytes = nullptr, S32 detail = -1, F32 *unscaled_value = nullptr); LLMeshRepository(); diff --git a/indra/newview/llmimetypes.cpp b/indra/newview/llmimetypes.cpp index e77b72a4e8b57e449513fcda59ea2c3c5dec0c39..3d3fc85d32ff86077fa6d81421c7929ebf97b0ea 100644 --- a/indra/newview/llmimetypes.cpp +++ b/indra/newview/llmimetypes.cpp @@ -63,7 +63,7 @@ bool LLMIMETypes::parseMIMETypes(const std::string& xml_filename) } for (LLXMLNode* node = root->getFirstChild(); - node != NULL; + node != nullptr; node = node->getNextSibling()) { if (node->hasName("defaultlabel")) @@ -84,7 +84,7 @@ bool LLMIMETypes::parseMIMETypes(const std::string& xml_filename) node->getAttributeString("name", mime_type); LLMIMEInfo info; for (LLXMLNode* child = node->getFirstChild(); - child != NULL; + child != nullptr; child = child->getNextSibling()) { if (child->hasName("label")) @@ -108,7 +108,7 @@ bool LLMIMETypes::parseMIMETypes(const std::string& xml_filename) node->getAttributeString("name", set_name); LLMIMEWidgetSet info; for (LLXMLNode* child = node->getFirstChild(); - child != NULL; + child != nullptr; child = child->getNextSibling()) { if (child->hasName("label")) diff --git a/indra/newview/llmorphview.cpp b/indra/newview/llmorphview.cpp index 711826fa58134c24d633609e8a77acf4309287e0..3cb4b44ba5a2af0debf6d2969416a21203a58406 100644 --- a/indra/newview/llmorphview.cpp +++ b/indra/newview/llmorphview.cpp @@ -47,7 +47,7 @@ #include "llviewerwindow.h" #include "pipeline.h" -LLMorphView *gMorphView = NULL; +LLMorphView *gMorphView = nullptr; const F32 MORPH_NEAR_CLIP = 0.1f; @@ -56,7 +56,7 @@ const F32 MORPH_NEAR_CLIP = 0.1f; //----------------------------------------------------------------------------- LLMorphView::LLMorphView(const LLMorphView::Params& p) : LLView(p), - mCameraTargetJoint( NULL ), + mCameraTargetJoint(nullptr ), mCameraOffset(-0.5f, 0.05f, 0.07f ), mCameraTargetOffset(0.f, 0.f, 0.05f ), mOldCameraNearClip( 0.f ), diff --git a/indra/newview/llmorphview.h b/indra/newview/llmorphview.h index 318d49bba5d0e32ba1a0a462cf6a5cedf8bbdfac..30155cba0b3e0513edbfcaea8df7da59f855a02f 100644 --- a/indra/newview/llmorphview.h +++ b/indra/newview/llmorphview.h @@ -49,7 +49,7 @@ public: void shutdown(); // inherited methods - /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ void setVisible(BOOL visible) override; void setCameraTargetJoint(LLJoint *joint) {mCameraTargetJoint = joint;} LLJoint* getCameraTargetJoint() {return mCameraTargetJoint;} diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index a7380d4873f77e304f189e1b2733863c164509be..c01c53f2eebf67c657ca6eb9bbf234410c5b0481 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -68,15 +68,15 @@ const F32 NUDGE_TIME = 0.25f; // in seconds // protected LLFloaterMove::LLFloaterMove(const LLSD& key) : LLFloater(key), - mForwardButton(NULL), - mBackwardButton(NULL), + mForwardButton(nullptr), + mBackwardButton(nullptr), mSlideLeftButton(nullptr), mSlideRightButton(nullptr), - mTurnLeftButton(NULL), - mTurnRightButton(NULL), - mMoveUpButton(NULL), - mMoveDownButton(NULL), - mModeActionsPanel(NULL), + mTurnLeftButton(nullptr), + mTurnRightButton(nullptr), + mMoveUpButton(nullptr), + mMoveDownButton(nullptr), + mModeActionsPanel(nullptr), mCurrentMode(MM_WALK) { } @@ -172,7 +172,7 @@ void LLFloaterMove::setVisible(BOOL visible) else { // Detach the Stand/Stop Flying panel. - LLPanelStandStopFlying::getInstance()->reparent(NULL); + LLPanelStandStopFlying::getInstance()->reparent(nullptr); } LLFloater::setVisible(visible); @@ -202,7 +202,7 @@ void LLFloaterMove::setFlyingMode(BOOL fly) instance->setFlyingModeImpl(fly); LLVOAvatarSelf* avatar_object = gAgentAvatarp; bool is_sitting = avatar_object - && (avatar_object->getRegion() != NULL) + && (avatar_object->getRegion() != nullptr) && (!avatar_object->isDead()) && avatar_object->isSitting(); instance->showModeButtons(!fly && !is_sitting); @@ -515,8 +515,8 @@ void LLFloaterMove::setModeButtonToggleState(const EMovementMode mode) /* LLPanelStandStopFlying */ /************************************************************************/ LLPanelStandStopFlying::LLPanelStandStopFlying() : - mStandButton(NULL), - mStopFlyingButton(NULL), + mStandButton(nullptr), + mStopFlyingButton(nullptr), mAttached(false) { // make sure we have the only instance of this class @@ -626,11 +626,11 @@ void LLPanelStandStopFlying::reparent(LLFloaterMove* move_view) LLPanel* parent = dynamic_cast<LLPanel*>(getParent()); if (!parent) { - LL_WARNS() << "Stand/stop flying panel parent is unset, already attached?: " << mAttached << ", new parent: " << (move_view == NULL ? "NULL" : "Move Floater") << LL_ENDL; + LL_WARNS() << "Stand/stop flying panel parent is unset, already attached?: " << mAttached << ", new parent: " << (move_view == nullptr ? "NULL" : "Move Floater") << LL_ENDL; return; } - if (move_view != NULL) + if (move_view != nullptr) { llassert(move_view != parent); // sanity check @@ -734,7 +734,7 @@ void LLPanelStandStopFlying::updatePosition() panel_ssf_container->setOrigin(0, y_pos); } - if (gToolBarView != NULL && gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT)->hasButtons()) + if (gToolBarView != nullptr && gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT)->hasButtons()) { S32 x_pos = bottom_tb_center - getRect().getWidth() / 2 - left_tb_width; setOrigin( x_pos, 0); diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h index 4a31f2a8148d018affc43f6918e7e52933781086..174f9e2626809569d360c76dc0bbb4497da6e7b2 100644 --- a/indra/newview/llmoveview.h +++ b/indra/newview/llmoveview.h @@ -48,8 +48,8 @@ private: ~LLFloaterMove(); public: - /*virtual*/ BOOL postBuild(); - /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void setVisible(BOOL visible) override; static F32 getYawRate(F32 time); static void setFlyingMode(BOOL fly); void setFlyingModeImpl(BOOL fly); @@ -57,7 +57,7 @@ public: void setAlwaysRunModeImpl(bool run); static void setSittingMode(BOOL bSitting); static void enableInstance(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; static void sUpdateFlyingStatus(); @@ -141,13 +141,14 @@ public: static LLPanelStandStopFlying* getInstance(); static void setStandStopFlyingMode(EStandStopFlyingMode mode); static void clearStandStopFlyingMode(EStandStopFlyingMode mode); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void setVisible(BOOL visible) override; // *HACK: due to hard enough to have this control aligned with "Move" button while resizing // let update its position in each frame - /*virtual*/ void draw(){updatePosition(); LLPanel::draw();} - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); + /*virtual*/ void draw() override + {updatePosition(); LLPanel::draw();} + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; protected: diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index fe33004033a0e8f9713a123b4d983d6b8aad97ad..9403b3696adb26d00bd99f5a23ee83c1d3c367f2 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -90,11 +90,11 @@ namespace class LLDispatchEmptyMuteList : public LLDispatchHandler { public: - virtual bool operator()( + bool operator()( const LLDispatcher* dispatcher, const std::string& key, const LLUUID& invoice, - const sparam_t& strings) + const sparam_t& strings) override { LLMuteList::getInstance()->setLoaded(); return true; @@ -173,10 +173,10 @@ LLMuteList::LLMuteList() : // that last NULL. gMessageSystem.callWhenReady(boost::bind(&LLMessageSystem::setHandlerFuncFast, _1, _PREHASH_MuteListUpdate, processMuteListUpdate, - static_cast<void**>(NULL))); + static_cast<void**>(nullptr))); gMessageSystem.callWhenReady(boost::bind(&LLMessageSystem::setHandlerFuncFast, _1, _PREHASH_UseCachedMuteList, processUseCachedMuteList, - static_cast<void**>(NULL))); + static_cast<void**>(nullptr))); } //----------------------------------------------------------------------------- @@ -230,7 +230,7 @@ static LLVOAvatar* find_avatar(const LLUUID& id) } else { - return NULL; + return nullptr; } } diff --git a/indra/newview/llnameeditor.h b/indra/newview/llnameeditor.h index 74a7b831351dd707668a0cb11af13e9185687e9a..2c4ad7b008fb5d453bc90e8457888efadb06a0de 100644 --- a/indra/newview/llnameeditor.h +++ b/indra/newview/llnameeditor.h @@ -64,8 +64,8 @@ public: // Take/return agent UUIDs - virtual void setValue( const LLSD& value ); - virtual LLSD getValue() const; + void setValue( const LLSD& value ) override; + LLSD getValue() const override; private: static std::set<LLNameEditor*> sInstances; diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index c0616811b67e543e031c4f2af24eea283bd426f5..c9f4b48bd064e7de20cae18349d4f29a3cdd024e 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -305,7 +305,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( LLUUID id = name_item.value().asUUID(); LLNameListItem* item = new LLNameListItem(name_item,name_item.target() == GROUP, name_item.target() == EXPERIENCE); - if (!item) return NULL; + if (!item) return nullptr; LLScrollListCtrl::addRow(item, name_item, pos); diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 3919ab69d179516bb39a4f2db2986428dcd9ac2e..b6d1cccc4b951139c43e985ef7a681a4a651fdbe 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -107,8 +107,8 @@ public: Alternative<S32> column_index; Alternative<std::string> column_name; NameColumn() - : column_name("name_column"), - column_index("name_column_index", 0) + : column_index("name_column_index", 0), + column_name("name_column") {} }; @@ -141,7 +141,7 @@ public: BOOL enabled = TRUE, const std::string& suffix = LLStringUtil::null); LLScrollListItem* addNameItem(NameItem& item, EAddPosition pos = ADD_BOTTOM); - /*virtual*/ LLScrollListItem* addElement(const LLSD& element, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); + /*virtual*/ LLScrollListItem* addElement(const LLSD& element, EAddPosition pos = ADD_BOTTOM, void* userdata = nullptr) override; LLScrollListItem* addNameItemRow(const NameItem& value, EAddPosition pos = ADD_BOTTOM, const std::string& suffix = LLStringUtil::null); // Add a user to the list by name. It will be added, the name @@ -157,16 +157,16 @@ public: /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, - std::string& tooltip_msg); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); + std::string& tooltip_msg) override; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; void setAllowCallingCardDrop(BOOL b) { mAllowCallingCardDrop = b; } void sortByName(BOOL ascending); - /*virtual*/ void updateColumns(bool force_update); + /*virtual*/ void updateColumns(bool force_update) override; - /*virtual*/ void mouseOverHighlightNthItem( S32 index ); + /*virtual*/ void mouseOverHighlightNthItem( S32 index ) override; private: void showInspector(const LLUUID& avatar_id, bool is_group, bool is_experience = false); diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 9518933d4da545245d3803370c54f50a20dab8d0..a9172b3b8f9b0bdf9301bce519bd25ebe347bff3 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -106,9 +106,9 @@ public: {} }; - /*virtual*/ void draw(); - /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); + /*virtual*/ void draw() override; + /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask) override; + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override; private: LLTeleportHistoryMenuItem(const Params&); @@ -125,7 +125,7 @@ static LLDefaultChildRegistry::Register<LLTeleportHistoryMenuItem> r("teleport_h LLTeleportHistoryMenuItem::LLTeleportHistoryMenuItem(const Params& p) : LLMenuItemCallGL(p), - mArrowIcon(NULL) + mArrowIcon(nullptr) { // Set appearance depending on the item type. if (p.item_type == TYPE_BACKWARD) @@ -266,15 +266,15 @@ TODO: */ LLNavigationBar::LLNavigationBar() -: mTeleportHistoryMenu(NULL), - mBtnBack(NULL), - mBtnForward(NULL), - mBtnHome(NULL), - mCmbLocation(NULL), - mSaveToLocationHistory(false), - mNavigationPanel(NULL), - mFavoritePanel(NULL), - mNavPanWidth(0) +: mNavPanWidth(0), + mTeleportHistoryMenu(nullptr), + mBtnBack(nullptr), + mBtnForward(nullptr), + mBtnHome(nullptr), + mCmbLocation(nullptr), + mNavigationPanel(nullptr), + mFavoritePanel(nullptr), + mSaveToLocationHistory(false) { buildFromFile( "panel_navigation_bar.xml"); @@ -362,7 +362,7 @@ void LLNavigationBar::draw() BOOL LLNavigationBar::handleRightMouseDown(S32 x, S32 y, MASK mask) { - BOOL handled = childrenHandleRightMouseDown( x, y, mask) != NULL; + BOOL handled = childrenHandleRightMouseDown( x, y, mask) != nullptr; if(!handled && !gMenuHolder->hasVisibleMenu()) { show_navbar_context_menu(this,x,y); @@ -657,7 +657,7 @@ void LLNavigationBar::showTeleportHistoryMenu(LLUICtrl* btn_ctrl) rebuildTeleportHistoryMenu(); - if (mTeleportHistoryMenu == NULL) + if (mTeleportHistoryMenu == nullptr) return; mTeleportHistoryMenu->updateParent(LLMenuGL::sMenuContainer); @@ -693,7 +693,7 @@ void LLNavigationBar::onNavigationButtonHeldUp(LLButton* nav_button) { // we had passed mouseCapture in showTeleportHistoryMenu() // now we MUST release mouseCapture to continue a proper mouseevent workflow. - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); } //gMenuHolder is using to display bunch of menus. Disconnect signal to avoid unnecessary calls. mHistoryMenuConnection.disconnect(); diff --git a/indra/newview/llnavigationbar.h b/indra/newview/llnavigationbar.h index a44c6dd6997e315dd6722579861276ac8b3d8896..ef023f20d3602f82886e89401721b126821db9e8 100755 --- a/indra/newview/llnavigationbar.h +++ b/indra/newview/llnavigationbar.h @@ -60,11 +60,11 @@ public: } }; - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override; boost::signals2::connection setClickDraggingCallback(const commit_signal_t::slot_type& cb); @@ -92,10 +92,10 @@ class LLNavigationBar public: - /*virtual*/ void draw(); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ void draw() override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void setVisible(BOOL visible) override; void handleLoginComplete(); void clearHistoryCache(); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index d1317d7e9f5daf3e8cc668eed9fe68b27b9df091..ce0cf3ede763570d967b297138439913244a27cf 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -80,17 +80,17 @@ const F64 COARSEUPDATE_MAX_Z = 1020.0; LLNetMap::LLNetMap (const Params & p) : LLUICtrl (p), + mUpdateNow(false), mBackgroundColor (p.bg_color()), mScale( MAP_SCALE_MID ), mPixelsPerMeter( MAP_SCALE_MID / REGION_WIDTH_METERS ), mObjectMapTPM(0.f), mObjectMapPixels(0.f), + mPanning(false), mTargetPan(0.f, 0.f), mCurPan(0.f, 0.f), mStartPan(0.f, 0.f), mMouseDown(0, 0), - mPanning(false), - mUpdateNow(false), mObjectImageCenterGlobal( gAgentCamera.getCameraPositionGlobal() ), mObjectRawImagep(), mObjectImagep(), @@ -934,7 +934,7 @@ BOOL LLNetMap::handleMouseUp( S32 x, S32 y, MASK mask ) mTargetPan.setZero(); } gViewerWindow->showCursor(); - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); return TRUE; } return FALSE; diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 99de4030c6d4860ea23505c07ceac0b4b76d877e..5471e40dd67df9035ad420b750b195eac1901967 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -68,18 +68,18 @@ public: static const F32 MAP_SCALE_MID; static const F32 MAP_SCALE_MAX; - /*virtual*/ void draw(); - /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleToolTip( S32 x, S32 y, MASK mask); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - - /*virtual*/ BOOL postBuild(); - /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); + /*virtual*/ void draw() override; + /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ) override; + /*virtual*/ BOOL handleToolTip( S32 x, S32 y, MASK mask) override; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + + /*virtual*/ BOOL postBuild() override; + /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ) override; /*virtual*/ BOOL handleClick(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); + /*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask ) override; void setScale( F32 scale ); void setToolTipMsg(const std::string& msg) { mToolTipMsg = msg; } diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 7a183cb298e9449ba39e0014fafcbe1cb3ecb2b0..ed2b8dff167c39df67bd17aa1e416349e6fdfadf 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -94,10 +94,10 @@ public: virtual ~LLNotificationHandler() {}; // base interface functions - virtual void onAdd(LLNotificationPtr p) { processNotification(p); } - virtual void onChange(LLNotificationPtr p) { processNotification(p); } - virtual void onLoad(LLNotificationPtr p) { processNotification(p); } - virtual void onDelete(LLNotificationPtr p) { if (mChannel.get()) mChannel.get()->removeToastByNotificationID(p->getID());} + void onAdd(LLNotificationPtr p) override { processNotification(p); } + void onChange(LLNotificationPtr p) override { processNotification(p); } + void onLoad(LLNotificationPtr p) override { processNotification(p); } + void onDelete(LLNotificationPtr p) override { if (mChannel.get()) mChannel.get()->removeToastByNotificationID(p->getID());} virtual bool processNotification(const LLNotificationPtr& notify) = 0; }; @@ -136,10 +136,10 @@ class LLIMHandler : public LLCommunicationNotificationHandler public: LLIMHandler(); virtual ~LLIMHandler(); - bool processNotification(const LLNotificationPtr& p); + bool processNotification(const LLNotificationPtr& p) override; protected: - virtual void initChannel(); + void initChannel() override; }; /** @@ -152,10 +152,10 @@ public: LLTipHandler(); virtual ~LLTipHandler(); - virtual bool processNotification(const LLNotificationPtr& p); + bool processNotification(const LLNotificationPtr& p) override; protected: - virtual void initChannel(); + void initChannel() override; }; /** @@ -168,14 +168,14 @@ public: LLScriptHandler(); virtual ~LLScriptHandler(); - virtual void onDelete(LLNotificationPtr p); - virtual void onChange(LLNotificationPtr p); - virtual bool processNotification(const LLNotificationPtr& p); + void onDelete(LLNotificationPtr p) override; + void onChange(LLNotificationPtr p) override; + bool processNotification(const LLNotificationPtr& p) override; virtual void addToastWithNotification(const LLNotificationPtr& p); protected: - virtual void onDeleteToast(LLToast* toast); - virtual void initChannel(); + void onDeleteToast(LLToast* toast) override; + void initChannel() override; }; @@ -187,11 +187,11 @@ class LLGroupHandler : public LLCommunicationNotificationHandler public: LLGroupHandler(); virtual ~LLGroupHandler(); - - virtual bool processNotification(const LLNotificationPtr& p); + + bool processNotification(const LLNotificationPtr& p) override; protected: - virtual void initChannel(); + void initChannel() override; }; /** @@ -203,11 +203,11 @@ public: LLAlertHandler(const std::string& name, const std::string& notification_type, bool is_modal); virtual ~LLAlertHandler(); - virtual void onChange(LLNotificationPtr p); - virtual bool processNotification(const LLNotificationPtr& p); + void onChange(LLNotificationPtr p) override; + bool processNotification(const LLNotificationPtr& p) override; protected: - virtual void initChannel(); + void initChannel() override; bool mIsModal; }; @@ -219,11 +219,11 @@ public: LLViewerAlertHandler(const std::string& name, const std::string& notification_type); virtual ~LLViewerAlertHandler() {}; - virtual void onDelete(LLNotificationPtr p) {}; - virtual bool processNotification(const LLNotificationPtr& p); + void onDelete(LLNotificationPtr p) override {}; + bool processNotification(const LLNotificationPtr& p) override; protected: - virtual void initChannel() {}; + void initChannel() override {}; }; /** @@ -236,12 +236,12 @@ public: LLOfferHandler(); virtual ~LLOfferHandler(); - virtual void onChange(LLNotificationPtr p); - virtual void onDelete(LLNotificationPtr notification); - virtual bool processNotification(const LLNotificationPtr& p); + void onChange(LLNotificationPtr p) override; + void onDelete(LLNotificationPtr notification) override; + bool processNotification(const LLNotificationPtr& p) override; protected: - virtual void initChannel(); + void initChannel() override; }; /** @@ -253,13 +253,13 @@ public: LLHintHandler(); virtual ~LLHintHandler() {} - virtual void onAdd(LLNotificationPtr p); - virtual void onLoad(LLNotificationPtr p); - virtual void onDelete(LLNotificationPtr p); - virtual bool processNotification(const LLNotificationPtr& p); + void onAdd(LLNotificationPtr p) override; + void onLoad(LLNotificationPtr p) override; + void onDelete(LLNotificationPtr p) override; + bool processNotification(const LLNotificationPtr& p) override; protected: - virtual void initChannel() {}; + void initChannel() override {}; }; /** @@ -271,10 +271,10 @@ public: LLBrowserNotification(); virtual ~LLBrowserNotification() {} - virtual bool processNotification(const LLNotificationPtr& p); + bool processNotification(const LLNotificationPtr& p) override; protected: - virtual void initChannel() {}; + void initChannel() override {}; }; class LLHandlerUtil diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index a2174919311adf2c9be452ea33df676e6adf7693..07c3574de460e324654555d606948af4f8c2ddd2 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -64,7 +64,7 @@ bool LLHandlerUtil::isIMFloaterOpened(const LLNotificationPtr& notification) LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, from_id); LLFloaterIMSession* im_floater = LLFloaterReg::findTypedInstance<LLFloaterIMSession>("impanel", session_id); - if (im_floater != NULL) + if (im_floater != nullptr) { res = im_floater->getVisible() == TRUE; } @@ -88,7 +88,7 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, session_owner_id); LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession( session_id); - if (session == NULL) + if (session == nullptr) { // replace interactive system message marker with correct from string value if (INTERACTIVE_SYSTEM_FROM == from_name) @@ -209,7 +209,7 @@ LLUUID LLHandlerUtil::spawnIMSession(const std::string& name, const LLUUID& from LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession( session_id); - if (session == NULL) + if (session == nullptr) { session_id = LLIMMgr::instance().addSession(name, IM_NOTHING_SPECIAL, from_id); } @@ -277,7 +277,7 @@ void LLHandlerUtil::addNotifPanelToIM(const LLNotificationPtr& notification) void LLHandlerUtil::updateIMFLoaterMesages(const LLUUID& session_id) { LLFloaterIMSession* im_floater = LLFloaterIMSession::findInstance(session_id); - if (im_floater != NULL && im_floater->getVisible()) + if (im_floater != nullptr && im_floater->getVisible()) { im_floater->updateMessages(); } diff --git a/indra/newview/llnotificationlistitem.cpp b/indra/newview/llnotificationlistitem.cpp index ac13a0dc03c880cf3b5e84fbaf69d41e35d816cc..65301d45aff4732fe871d4548bd139259a524f98 100644 --- a/indra/newview/llnotificationlistitem.cpp +++ b/indra/newview/llnotificationlistitem.cpp @@ -382,11 +382,11 @@ void LLGroupInviteNotificationListItem::setFee(S32 fee) LLGroupNoticeNotificationListItem::LLGroupNoticeNotificationListItem(const Params& p) : LLGroupNotificationListItem(p), - mAttachmentPanel(NULL), - mAttachmentTextBox(NULL), - mAttachmentIcon(NULL), - mAttachmentIconExp(NULL), - mInventoryOffer(NULL) + mAttachmentPanel(nullptr), + mAttachmentTextBox(nullptr), + mAttachmentIcon(nullptr), + mAttachmentIconExp(nullptr), + mInventoryOffer(nullptr) { if (mParams.inventory_offer.isDefined()) { @@ -403,10 +403,10 @@ LLGroupNotificationListItem::~LLGroupNotificationListItem() LLGroupNoticeNotificationListItem::~LLGroupNoticeNotificationListItem() { - if (mInventoryOffer != NULL) + if (mInventoryOffer != nullptr) { mInventoryOffer->forceResponse(IOR_DECLINE); - mInventoryOffer = NULL; + mInventoryOffer = nullptr; } } @@ -435,7 +435,7 @@ BOOL LLGroupNoticeNotificationListItem::postBuild() } setSender(mParams.sender); - if (mInventoryOffer != NULL) + if (mInventoryOffer != nullptr) { mAttachmentTextBox->setValue(mInventoryOffer->mDesc); mAttachmentTextBox->setVisible(TRUE); @@ -558,16 +558,16 @@ void LLGroupNoticeNotificationListItem::close() // The group notice dialog may be an inventory offer. // If it has an inventory save button and that button is still enabled // Then we need to send the inventory declined message - if (mInventoryOffer != NULL) + if (mInventoryOffer != nullptr) { mInventoryOffer->forceResponse(IOR_DECLINE); - mInventoryOffer = NULL; + mInventoryOffer = nullptr; } } void LLGroupNoticeNotificationListItem::onClickAttachment() { - if (mInventoryOffer != NULL) { + if (mInventoryOffer != nullptr) { static const LLUIColor textColor = LLUIColorTable::instance().getColor( "GroupNotifyDimmedTextColor"); mAttachmentTextBox->setColor(textColor); @@ -579,7 +579,7 @@ void LLGroupNoticeNotificationListItem::onClickAttachment() } mInventoryOffer->forceResponse(IOR_ACCEPT); - mInventoryOffer = NULL; + mInventoryOffer = nullptr; } } @@ -602,7 +602,7 @@ bool LLGroupNoticeNotificationListItem::isAttachmentOpenable(LLAssetType::EType LLTransactionNotificationListItem::LLTransactionNotificationListItem(const Params& p) : LLNotificationListItem(p), - mAvatarIcon(NULL), + mAvatarIcon(nullptr), mAvatarIconExp(nullptr) { buildFromFile("panel_notification_list_item.xml"); diff --git a/indra/newview/llnotificationlistitem.h b/indra/newview/llnotificationlistitem.h index cbe62fda2cd17ba285bda4e87dd859f6b949b278..09492dcd9345483ecf504f33b24fb28431d10b2c 100644 --- a/indra/newview/llnotificationlistitem.h +++ b/indra/newview/llnotificationlistitem.h @@ -78,9 +78,9 @@ public: std::string& getNotificationName() { return mNotificationName; } // handlers - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual void onMouseEnter(S32 x, S32 y, MASK mask); - virtual void onMouseLeave(S32 x, S32 y, MASK mask); + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + void onMouseEnter(S32 x, S32 y, MASK mask) override; + void onMouseLeave(S32 x, S32 y, MASK mask) override; //callbacks typedef boost::function<void (LLNotificationListItem* item)> item_callback_t; @@ -92,7 +92,7 @@ public: virtual bool showPopup() { return true; } void setExpanded(BOOL value); - virtual BOOL postBuild(); + BOOL postBuild() override; void reshapeNotification(); typedef enum e_time_type @@ -137,11 +137,11 @@ class LLGroupNotificationListItem { public: virtual ~LLGroupNotificationListItem(); - virtual BOOL postBuild(); + BOOL postBuild() override; void setGroupId(const LLUUID& value); // LLGroupMgrObserver observer trigger - virtual void changed(LLGroupChange gc); + void changed(LLGroupChange gc) override; friend class LLNotificationListItem; protected: @@ -167,9 +167,9 @@ class LLGroupInviteNotificationListItem { public: static std::set<std::string> getTypes(); - virtual BOOL postBuild(); + BOOL postBuild() override; - /*virtual*/ bool showPopup() { return false; } + /*virtual*/ bool showPopup() override { return false; } private: friend class LLNotificationListItem; @@ -195,9 +195,9 @@ class LLGroupNoticeNotificationListItem public: virtual ~LLGroupNoticeNotificationListItem(); static std::set<std::string> getTypes(); - virtual BOOL postBuild(); + BOOL postBuild() override; - /*virtual*/ bool showPopup() { return false; } + /*virtual*/ bool showPopup() override { return false; } private: friend class LLNotificationListItem; @@ -207,7 +207,7 @@ private: void setSender(std::string sender); void onClickAttachment(); - /*virtual*/ void close(); + /*virtual*/ void close() override; static bool isAttachmentOpenable(LLAssetType::EType); @@ -222,7 +222,7 @@ class LLTransactionNotificationListItem : public LLNotificationListItem { public: static std::set<std::string> getTypes(); - virtual BOOL postBuild(); + BOOL postBuild() override; private: friend class LLNotificationListItem; LLTransactionNotificationListItem(const Params& p); @@ -235,7 +235,7 @@ private: class LLSystemNotificationListItem : public LLNotificationListItem { public: - virtual BOOL postBuild(); + BOOL postBuild() override; private: friend class LLNotificationListItem; LLSystemNotificationListItem(const Params& p); diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp index 1e56ce435c43db2e96df712040fd6e056b6fb3ec..162410851e5a1ba53882cd60204762a05589e670 100644 --- a/indra/newview/llnotificationmanager.cpp +++ b/indra/newview/llnotificationmanager.cpp @@ -62,7 +62,7 @@ void LLNotificationManager::init() mChannels.push_back(new LLBrowserNotification()); mChannels.push_back(new LLIMHandler()); - mChatHandler = std::shared_ptr<LLFloaterIMNearbyChatHandler>(new LLFloaterIMNearbyChatHandler()); + mChatHandler = std::make_shared<LLFloaterIMNearbyChatHandler>(); } //-------------------------------------------------------------------------- diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp index 1a7f254edf0be99c993e81a59a5d1db9a32bf8dc..7fcf2c9db506d742ea4e6d77a6abc0d32aa6af7e 100644 --- a/indra/newview/llnotificationstorage.cpp +++ b/indra/newview/llnotificationstorage.cpp @@ -67,7 +67,7 @@ LLNotificationResponderInterface * LLResponderRegistry::createResponder(const st return (*factoryFunc)(pParams); } - return NULL; + return nullptr; } LLResponderRegistry::StaticRegistrar sRegisterObjectGiveItem("ObjectGiveItem", &LLResponderRegistry::create<LLOfferInfo>); diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index c54dc7120be70641b336661274452adb8250600c..1d72c7c042ebbe8e484425e23d3183d5b05fa98f 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -50,7 +50,7 @@ class LLUpdateGalleryOnPhotoLinked : public LLInventoryCallback public: LLUpdateGalleryOnPhotoLinked(){} virtual ~LLUpdateGalleryOnPhotoLinked(){} - /* virtual */ void fire(const LLUUID& inv_item_id); + /* virtual */ void fire(const LLUUID& inv_item_id) override; private: }; @@ -82,9 +82,9 @@ public: LLOutfitGallery(const LLOutfitGallery::Params& params = getDefaultParams()); virtual ~LLOutfitGallery(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& info); - /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& info) override; + /*virtual*/ void draw() override; void onSelectPhoto(LLUUID selected_outfit_id); void onTakeSnapshot(LLUUID selected_outfit_id); @@ -92,17 +92,17 @@ public: void wearSelectedOutfit(); - /*virtual*/ void setFilterSubString(const std::string& string); + /*virtual*/ void setFilterSubString(const std::string& string) override; - /*virtual*/ void getCurrentCategories(uuid_vec_t& vcur); - /*virtual*/ void updateAddedCategory(LLUUID cat_id); - /*virtual*/ void updateRemovedCategory(LLUUID cat_id); - /*virtual*/ void updateChangedCategoryName(LLViewerInventoryCategory *cat, std::string name); + /*virtual*/ void getCurrentCategories(uuid_vec_t& vcur) override; + /*virtual*/ void updateAddedCategory(LLUUID cat_id) override; + /*virtual*/ void updateRemovedCategory(LLUUID cat_id) override; + /*virtual*/ void updateChangedCategoryName(LLViewerInventoryCategory *cat, std::string name) override; - /*virtual*/ bool hasItemSelected(); - /*virtual*/ bool canWearSelected(); + /*virtual*/ bool hasItemSelected() override; + /*virtual*/ bool canWearSelected() override; - /*virtual*/ bool getHasExpandableFolders() { return FALSE; } + /*virtual*/ bool getHasExpandableFolders() override { return FALSE; } void updateMessageVisibility(); bool hasDefaultImage(const LLUUID& outfit_cat_id); @@ -115,14 +115,14 @@ public: void onBeforeOutfitSnapshotSave(); void onAfterOutfitSnapshotSave(); protected: - /*virtual*/ void onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id); - /*virtual*/ void onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid); - /*virtual*/ void onOutfitRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); - /*virtual*/ void onChangeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id); + /*virtual*/ void onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id) override; + /*virtual*/ void onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid) override; + /*virtual*/ void onOutfitRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id) override; + /*virtual*/ void onChangeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id) override; - /*virtual*/ void onCollapseAllFolders() {} - /*virtual*/ void onExpandAllFolders() {} - /*virtual*/ LLOutfitListGearMenuBase* createGearMenu(); + /*virtual*/ void onCollapseAllFolders() override {} + /*virtual*/ void onExpandAllFolders() override {} + /*virtual*/ LLOutfitListGearMenuBase* createGearMenu() override; void applyFilter(LLOutfitGalleryItem* item, const std::string& filter_substring); @@ -209,7 +209,7 @@ public: : LLOutfitContextMenu(outfit_list), mOutfitList(outfit_list){} protected: - /* virtual */ LLContextMenu* createMenu(); + /* virtual */ LLContextMenu* createMenu() override; bool onEnable(LLSD::String param); bool onVisible(LLSD::String param); void onUploadPhoto(const LLUUID& outfit_cat_id); @@ -231,13 +231,13 @@ public: LLOutfitGalleryGearMenu(LLOutfitListBase* olist); protected: - /*virtual*/ void onUpdateItemsVisibility(); + /*virtual*/ void onUpdateItemsVisibility() override; private: - /*virtual*/ void onUploadFoto(); - /*virtual*/ void onSelectPhoto(); - /*virtual*/ void onTakeSnapshot(); - /*virtual*/ void onRemovePhoto(); - /*virtual*/ void onChangeSortOrder(); + /*virtual*/ void onUploadFoto() override; + /*virtual*/ void onSelectPhoto() override; + /*virtual*/ void onTakeSnapshot() override; + /*virtual*/ void onRemovePhoto() override; + /*virtual*/ void onChangeSortOrder() override; bool hasDefaultImage(); }; @@ -251,10 +251,10 @@ public: LLOutfitGalleryItem(const Params& p); virtual ~LLOutfitGalleryItem(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void draw() override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; void setDefaultImage(); void setImageAssetId(LLUUID asset_id); diff --git a/indra/newview/lloutfitobserver.h b/indra/newview/lloutfitobserver.h index 3f10ac99fdb52243f1afde692d6463d91be383e3..2e6e6d2ff6580794f934af5604fe29a1ea63f3a3 100644 --- a/indra/newview/lloutfitobserver.h +++ b/indra/newview/lloutfitobserver.h @@ -40,7 +40,7 @@ class LLOutfitObserver: public LLInventoryObserver, public LLSingleton<LLOutfitO public: - virtual void changed(U32 mask); + void changed(U32 mask) override; void notifyOutfitLockChanged() { mOutfitLockChanged(); } diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 4c057ee7439f07d5821b0f0d58ae30bc53181086..3a6001260d320674729ddb856728767e5eeb865d 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -103,8 +103,8 @@ static LLPanelInjector<LLOutfitsList> t_outfits_list("outfits_list"); LLOutfitsList::LLOutfitsList() : LLOutfitListBase() - , mAccordion(NULL) - , mListCommands(NULL) + , mAccordion(nullptr) + , mListCommands(nullptr) , mItemSelected(false) { } @@ -242,7 +242,7 @@ void LLOutfitsList::updateRemovedCategory(LLUUID cat_id) mAccordion->removeCollapsibleCtrl(tab); // kill removed tab - if (tab != NULL) + if (tab != nullptr) { tab->die(); } @@ -486,7 +486,7 @@ void LLOutfitsList::onChangeOutfitSelection(LLWearableItemsList* list, const LLU mSelectedListsMap.clear(); } - mItemSelected = list && (list->getSelectedItem() != NULL); + mItemSelected = list && (list->getSelectedItem() != nullptr); mSelectedListsMap.insert(wearables_lists_map_value_t(category_id, list)); } @@ -1093,7 +1093,7 @@ void LLOutfitContextMenu::renameOutfit(const LLUUID& outfit_cat_id) LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist) : mOutfitList(olist), - mMenu(NULL) + mMenu(nullptr) { llassert_always(mOutfitList); @@ -1156,7 +1156,7 @@ LLViewerInventoryCategory* LLOutfitListGearMenuBase::getSelectedOutfit() const LLUUID& selected_outfit_id = getSelectedOutfitID(); if (selected_outfit_id.isNull()) { - return NULL; + return nullptr; } LLViewerInventoryCategory* cat = gInventory.getCategory(selected_outfit_id); diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index a05a9bad4be5bf5c460d464e314e784ad996e262..2da64e211e5c1fcea8b6ca1ea70f734c4e6fcb65 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -57,7 +57,7 @@ public: LLOutfitTabNameComparator() {}; virtual ~LLOutfitTabNameComparator() {}; - /*virtual*/ bool compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const; + /*virtual*/ bool compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const override; }; class LLOutfitListBase : public LLPanelAppearanceTab @@ -69,8 +69,8 @@ public: LLOutfitListBase(); virtual ~LLOutfitListBase(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& info); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& info) override; void refreshList(const LLUUID& category_id); void computeDifference(const LLInventoryModel::cat_array_t& vcats, uuid_vec_t& vadded, uuid_vec_t& vremoved); @@ -92,7 +92,7 @@ public: boost::signals2::connection setSelectionChangeCallback(selection_change_callback_t cb); void outfitRightClickCallBack(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); - virtual bool isActionEnabled(const LLSD& userdata); + bool isActionEnabled(const LLSD& userdata) override; virtual void performAction(std::string action); virtual bool hasItemSelected() = 0; virtual bool canWearSelected() = 0; @@ -138,7 +138,7 @@ public: mOutfitList(outfit_list) {} protected: - /* virtual */ LLContextMenu* createMenu(); + /* virtual */ LLContextMenu* createMenu() override; bool onEnable(LLSD::String param); @@ -194,7 +194,7 @@ public: virtual ~LLOutfitListGearMenu(); protected: - /*virtual*/ void onUpdateItemsVisibility(); + /*virtual*/ void onUpdateItemsVisibility() override; }; /** @@ -213,25 +213,25 @@ public: LLOutfitsList(); virtual ~LLOutfitsList(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; - /*virtual*/ void onOpen(const LLSD& info); + /*virtual*/ void onOpen(const LLSD& info) override; //virtual void refreshList(const LLUUID& category_id); - /*virtual*/ void updateAddedCategory(LLUUID cat_id); - /*virtual*/ void updateRemovedCategory(LLUUID cat_id); + /*virtual*/ void updateAddedCategory(LLUUID cat_id) override; + /*virtual*/ void updateRemovedCategory(LLUUID cat_id) override; // highlits currently worn outfit tab text and unhighlights previously worn - /*virtual*/ void onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id); + /*virtual*/ void onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id) override; //void performAction(std::string action); - /*virtual*/ void setFilterSubString(const std::string& string); + /*virtual*/ void setFilterSubString(const std::string& string) override; - /*virtual*/ void getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const; + /*virtual*/ void getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const override; // Collects selected items from all selected lists and wears them(if possible- adds, else replaces) void wearSelectedItems(); @@ -239,21 +239,21 @@ public: /** * Returns true if there is a selection inside currently selected outfit */ - /*virtual*/ bool hasItemSelected(); + /*virtual*/ bool hasItemSelected() override; /** Collapses all outfit accordions. */ - /*virtual*/ void onCollapseAllFolders(); + /*virtual*/ void onCollapseAllFolders() override; /** Expands all outfit accordions. */ - void onExpandAllFolders(); + void onExpandAllFolders() override; - /*virtual*/ bool getHasExpandableFolders() { return TRUE; } + /*virtual*/ bool getHasExpandableFolders() override { return TRUE; } protected: - LLOutfitListGearMenuBase* createGearMenu(); + LLOutfitListGearMenuBase* createGearMenu() override; private: @@ -262,22 +262,22 @@ private: */ //void computeDifference(const LLInventoryModel::cat_array_t& vcats, uuid_vec_t& vadded, uuid_vec_t& vremoved); - void getCurrentCategories(uuid_vec_t& vcur); + void getCurrentCategories(uuid_vec_t& vcur) override; /** * Updates tab displaying outfit identified by category_id. */ - /*virtual*/ void updateChangedCategoryName(LLViewerInventoryCategory *cat, std::string name); + /*virtual*/ void updateChangedCategoryName(LLViewerInventoryCategory *cat, std::string name) override; - /*virtual*/ void sortOutfits(); - /*virtual*/ void arrange(); + /*virtual*/ void sortOutfits() override; + /*virtual*/ void arrange() override; - /*virtual*/ void onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid); + /*virtual*/ void onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid) override; /** * Resets previous selection and stores newly selected list and outfit id. */ - /*virtual*/ void onChangeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id); + /*virtual*/ void onChangeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id) override; /** *Resets items selection inside outfit @@ -287,7 +287,7 @@ private: /** * Removes the outfit from selection. */ - /*virtual*/ void deselectOutfit(const LLUUID& category_id); + /*virtual*/ void deselectOutfit(const LLUUID& category_id) override; /** * Try restoring selection for a temporary hidden tab. @@ -317,14 +317,14 @@ private: /** * Returns true if all selected items can be worn. */ - bool canWearSelected(); + bool canWearSelected() override; void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y); void onCOFChanged(); void onListSelectionChange(LLUICtrl* ctrl); - /*virtual*/ void onOutfitRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); + /*virtual*/ void onOutfitRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id) override; static void onOutfitRename(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 64f98fa17b4fb326ed3180a185c29cd963ccb95b..30a8ebafca1966a95c8729db31a5caa63dfdc03e 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -66,6 +66,8 @@ LLOutputMonitorCtrl::Params::Params() LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) : LLView(p), mPower(0), + mIsAgentControl(false), + mShowParticipantsSpeaking(false), mImageMute(p.image_mute), mImageOff(p.image_off), mImageOn(p.image_on), @@ -74,9 +76,7 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) mImageLevel3(p.image_level_3), mAutoUpdate(p.auto_update), mSpeakerId(p.speaker_id), - mIsAgentControl(false), - mIndicatorToggled(false), - mShowParticipantsSpeaking(false) + mIndicatorToggled(false) { //static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange); //static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red); diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h index 9bea72f9a10ebfd697be47377c8cc43f3a47dd27..77d17a180c1ef98d2d1940fd1529a1f1358cfab4 100644 --- a/indra/newview/lloutputmonitorctrl.h +++ b/indra/newview/lloutputmonitorctrl.h @@ -66,8 +66,8 @@ public: virtual ~LLOutputMonitorCtrl(); // llview overrides - virtual void draw(); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + void draw() override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; void setPower(F32 val); F32 getPower(F32 val) const { return mPower; } @@ -91,7 +91,7 @@ public: void setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id = LLUUID::null, bool show_other_participants_speaking = false); //called by mute list - virtual void onChange(); + void onChange() override; /** * Implementation of LLSpeakingIndicator interface. @@ -103,7 +103,7 @@ public: * Otherwise it marks an instance as dirty and stores necessary visibility. * It will be applied in next draw and parent will be notified. */ - virtual void switchIndicator(bool switch_on); + void switchIndicator(bool switch_on) override; bool getIndicatorToggled() { return mIndicatorToggled;} void setIndicatorToggled(bool value) { mIndicatorToggled = value;} diff --git a/indra/newview/llpanelappearancetab.cpp b/indra/newview/llpanelappearancetab.cpp index c3d3066cc38e7dc38ee79d95c620ac2315821696..c40a08db64aa374125e6799dca71ed0c71dc1a2e 100644 --- a/indra/newview/llpanelappearancetab.cpp +++ b/indra/newview/llpanelappearancetab.cpp @@ -48,7 +48,7 @@ bool LLPanelAppearanceTab::canTakeOffSelected() LLViewerInventoryItem* item = gInventory.getItem(*it); if (!item) continue; - if (is_worn(NULL, item)) return true; + if (is_worn(nullptr, item)) return true; } return false; } diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index d9208cd5caa950b7f993b63f7b56905a3b8054bc..020e581a4978cc1b7811a626b016018c6429d6c6 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -63,7 +63,7 @@ public: /** * Clears panel data if viewing avatar info for first time and sends update data request. */ - virtual void onOpen(const LLSD& key); + void onOpen(const LLSD& key) override; /** * Profile tabs should close any opened panels here. diff --git a/indra/newview/llpanelavatartag.h b/indra/newview/llpanelavatartag.h index 1068ae0b4f8db65c0fbf1dcb59bf8468006f5d46..398307bdb899d7f077d07923edf69a0d344c8be5 100644 --- a/indra/newview/llpanelavatartag.h +++ b/indra/newview/llpanelavatartag.h @@ -57,12 +57,12 @@ public: const LLUUID& getAvatarId() const { return mAvatarId; } - /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void draw() override; virtual boost::signals2::connection setLeftButtonClickCallback( const commit_callback_t& cb); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; void onClick(); private: diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index 7d7fb38c1aed9d4f58b505c1c6f5a3eb9c9df3ee..e220af46f4056782b7c12cdc730e44941ef666b4 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -64,8 +64,8 @@ const std::string BLOCKED_PARAM_NAME = "blocked_to_select"; LLPanelBlockedList::LLPanelBlockedList() : LLPanel() , mBlockedList(nullptr) -, mUnblockBtn(nullptr) , mBlockedGearMBtn(nullptr) +, mUnblockBtn(nullptr) , mBlockLimitText(nullptr) { mCommitCallbackRegistrar.add("Block.Action", boost::bind(&LLPanelBlockedList::onCustomAction, this, _2)); diff --git a/indra/newview/llpanelblockedlist.h b/indra/newview/llpanelblockedlist.h index 83c7e97cf1199659228621fff4f4a29a9dd70f93..aa1c92458bb8fab6084ae40b41f93a6b179054a5 100644 --- a/indra/newview/llpanelblockedlist.h +++ b/indra/newview/llpanelblockedlist.h @@ -43,9 +43,9 @@ public: LLPanelBlockedList(); ~LLPanelBlockedList(){}; - virtual BOOL postBuild(); - virtual void draw(); - virtual void onOpen(const LLSD& key); + BOOL postBuild() override; + void draw() override; + void onOpen(const LLSD& key) override; void selectBlocked(const LLUUID& id); @@ -99,9 +99,9 @@ class LLFloaterGetBlockedObjectName : public LLFloater public: typedef std::function<void (const std::string&)> get_object_name_callback_t; - virtual BOOL postBuild(); + BOOL postBuild() override; - virtual BOOL handleKeyHere(KEY key, MASK mask); + BOOL handleKeyHere(KEY key, MASK mask) override; static LLFloaterGetBlockedObjectName* show(get_object_name_callback_t callback); diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 2446662b858dfed04478314ba974933a776f94e1..ecfada4d7f26bc7f819dbfc7c240521139544109 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -73,11 +73,11 @@ LLPanelClassifiedInfo::panel_list_t LLPanelClassifiedInfo::sAllPanels; class LLDispatchClassifiedClickThrough : public LLDispatchHandler { public: - virtual bool operator()( + bool operator()( const LLDispatcher* dispatcher, const std::string& key, const LLUUID& invoice, - const sparam_t& strings) + const sparam_t& strings) override { if (strings.size() != 4) return false; LLUUID classified_id(strings[0]); @@ -101,19 +101,19 @@ static LLPanelInjector<LLPanelClassifiedInfo> t_classified_info("panel_classifie LLPanelClassifiedInfo::LLPanelClassifiedInfo() : LLPanel() + , mSnapshotStreched(false) + , mSnapshotCtrl(nullptr) , mInfoLoaded(false) - , mScrollingPanel(NULL) - , mScrollContainer(NULL) + , mScrollContainer(nullptr) + , mScrollingPanel(nullptr) , mScrollingPanelMinHeight(0) , mScrollingPanelWidth(0) - , mSnapshotStreched(false) , mTeleportClicksOld(0) , mMapClicksOld(0) , mProfileClicksOld(0) , mTeleportClicksNew(0) , mMapClicksNew(0) , mProfileClicksNew(0) - , mSnapshotCtrl(NULL) { sAllPanels.push_back(this); } @@ -597,7 +597,7 @@ void LLPanelClassifiedInfo::onTeleportClick() void LLPanelClassifiedInfo::onExit() { LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); - gGenericDispatcher.addHandler("classifiedclickthrough", NULL); // deregister our handler + gGenericDispatcher.addHandler("classifiedclickthrough", nullptr); // deregister our handler } ////////////////////////////////////////////////////////////////////////// @@ -612,7 +612,7 @@ LLPanelClassifiedEdit::LLPanelClassifiedEdit() , mIsNew(false) , mIsNewWithErrors(false) , mCanClose(false) - , mPublishFloater(NULL) + , mPublishFloater(nullptr) { } @@ -641,7 +641,7 @@ BOOL LLPanelClassifiedEdit::postBuild() edit_icon->setVisible(false); LLLineEditor* line_edit = getChild<LLLineEditor>("classified_name"); - line_edit->setKeystrokeCallback(boost::bind(&LLPanelClassifiedEdit::onChange, this), NULL); + line_edit->setKeystrokeCallback(boost::bind(&LLPanelClassifiedEdit::onChange, this), nullptr); LLTextEditor* text_edit = getChild<LLTextEditor>("classified_desc"); text_edit->setKeystrokeCallback(boost::bind(&LLPanelClassifiedEdit::onChange, this)); @@ -657,9 +657,9 @@ BOOL LLPanelClassifiedEdit::postBuild() combobox->setCommitCallback(boost::bind(&LLPanelClassifiedEdit::onChange, this)); - childSetCommitCallback("content_type", boost::bind(&LLPanelClassifiedEdit::onChange, this), NULL); - childSetCommitCallback("price_for_listing", boost::bind(&LLPanelClassifiedEdit::onChange, this), NULL); - childSetCommitCallback("auto_renew", boost::bind(&LLPanelClassifiedEdit::onChange, this), NULL); + childSetCommitCallback("content_type", boost::bind(&LLPanelClassifiedEdit::onChange, this), nullptr); + childSetCommitCallback("price_for_listing", boost::bind(&LLPanelClassifiedEdit::onChange, this), nullptr); + childSetCommitCallback("auto_renew", boost::bind(&LLPanelClassifiedEdit::onChange, this), nullptr); childSetAction("save_changes_btn", boost::bind(&LLPanelClassifiedEdit::onSaveClick, this)); childSetAction("set_to_curr_location_btn", boost::bind(&LLPanelClassifiedEdit::onSetLocationClick, this)); diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index a45aaf9c1263775dc40b01ca23205fd53fa256ba..e3298afd5c6916afb4924bad2648292a7d72364c 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -50,7 +50,7 @@ public: LLPublishClassifiedFloater(const LLSD& key); virtual ~LLPublishClassifiedFloater(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void setPrice(S32 price); S32 getPrice(); @@ -71,11 +71,11 @@ public: LLPanelClassifiedInfo(); virtual ~LLPanelClassifiedInfo(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) override; void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; } @@ -140,9 +140,9 @@ public: void setEditClassifiedCallback(const commit_callback_t& cb); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; - /*virtual*/ void draw(); + /*virtual*/ void draw() override; protected: @@ -210,23 +210,23 @@ public: virtual ~LLPanelClassifiedEdit(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void fillIn(const LLSD& key); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) override; - /*virtual*/ BOOL isDirty() const; + /*virtual*/ BOOL isDirty() const override; - /*virtual*/ void resetDirty(); + /*virtual*/ void resetDirty() override; void setSaveCallback(const commit_signal_t::slot_type& cb); void setCancelCallback(const commit_signal_t::slot_type& cb); - /*virtual*/ void resetControls(); + /*virtual*/ void resetControls() override; bool isNew() { return mIsNew; } @@ -234,7 +234,7 @@ public: bool canClose(); - void draw(); + void draw() override; void stretchSnapshot(); diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index 414069857067523012a4f273a877d939bf62e7ed..b5d2d8217282f10112afc922500dbcfd9fbbc286 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -93,7 +93,7 @@ BOOL LLPanelContents::postBuild() LLPanelContents::LLPanelContents() : LLPanel(), - mPanelInventoryObject(NULL) + mPanelInventoryObject(nullptr) { } diff --git a/indra/newview/llpanelcontents.h b/indra/newview/llpanelcontents.h index 6ecc78afa0d297926f9f33d11ee31c766ad8c029..b79a5eb7dc1db7f575896fbdc16b3f763fcda67b 100644 --- a/indra/newview/llpanelcontents.h +++ b/indra/newview/llpanelcontents.h @@ -43,11 +43,11 @@ class LLSpinCtrl; class LLPanelContents : public LLPanel { public: - virtual BOOL postBuild(); + BOOL postBuild() override; LLPanelContents(); virtual ~LLPanelContents(); - void refresh(); + void refresh() override; void clearContents(); diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index c8ba3e6b1ea5ff29e12ca651616534bc67b8d9b2..f7467a52dbd26171478f7bebbf68c021fc53f029 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -435,7 +435,7 @@ get_pickers_indexes(const LLEditWearableDictionary::WearableEntry *wearable_entr // Specializations of this template function return picker control entry for particular control type. template <typename T> const LLEditWearableDictionary::PickerControlEntry* -get_picker_entry (const ETextureIndex index) { return NULL; } +get_picker_entry (const ETextureIndex index) { return nullptr; } typedef std::function<void(LLPanel* panel, const LLEditWearableDictionary::PickerControlEntry*)> function_t; @@ -501,7 +501,7 @@ find_picker_ctrl_entry_if(LLWearableType::EType type, const Predicate pred) if (!wearable_entry) { LL_WARNS() << "could not get wearable dictionary entry for wearable of type: " << type << LL_ENDL; - return NULL; + return nullptr; } const texture_vec_t& indexes = get_pickers_indexes<CtrlType>(wearable_entry); for (texture_vec_t::const_iterator @@ -522,7 +522,7 @@ find_picker_ctrl_entry_if(LLWearableType::EType type, const Predicate pred) return entry; } } - return NULL; + return nullptr; } template <typename CtrlType> @@ -641,8 +641,8 @@ static void set_enabled_texture_ctrl(bool enabled, LLPanel* panel, const LLEditW LLPanelEditWearable::LLPanelEditWearable() : LLPanel() - , mWearablePtr(NULL) - , mWearableItem(NULL) + , mWearablePtr(nullptr) + , mWearableItem(nullptr) { mCommitCallbackRegistrar.add("ColorSwatch.Commit", boost::bind(&LLPanelEditWearable::onColorSwatchCommit, this, _1)); mCommitCallbackRegistrar.add("TexturePicker.Commit", boost::bind(&LLPanelEditWearable::onTexturePickerCommit, this, _1)); @@ -685,7 +685,7 @@ void LLPanelEditWearable::updateAvatarHeightLabel() void LLPanelEditWearable::onWearablePanelVisibilityChange(const LLSD &in_visible_chain, LLAccordionCtrl* accordion_ctrl) { - if (in_visible_chain.asBoolean() && accordion_ctrl != NULL) + if (in_visible_chain.asBoolean() && accordion_ctrl != nullptr) { accordion_ctrl->expandDefaultTab(); } @@ -693,11 +693,11 @@ void LLPanelEditWearable::onWearablePanelVisibilityChange(const LLSD &in_visible void LLPanelEditWearable::setWearablePanelVisibilityChangeCallback(LLPanel* bodypart_panel) { - if (bodypart_panel != NULL) + if (bodypart_panel != nullptr) { LLAccordionCtrl* accordion_ctrl = bodypart_panel->getChild<LLAccordionCtrl>("wearable_accordion"); - if (accordion_ctrl != NULL) + if (accordion_ctrl != nullptr) { bodypart_panel->setVisibleCallback( boost::bind(&LLPanelEditWearable::onWearablePanelVisibilityChange, this, _2, accordion_ctrl)); @@ -767,7 +767,7 @@ BOOL LLPanelEditWearable::postBuild() mTxtAvatarHeight = mPanelShape->getChild<LLTextBox>("avatar_height"); - mWearablePtr = NULL; + mWearablePtr = nullptr; configureAlphaCheckbox(LLAvatarAppearanceDefines::TEX_LOWER_ALPHA, "lower alpha texture invisible"); configureAlphaCheckbox(LLAvatarAppearanceDefines::TEX_UPPER_ALPHA, "upper alpha texture invisible"); @@ -1080,7 +1080,7 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) std::string new_name = mNameEditor->getText(); // Find an existing link to this wearable's inventory item, if any, and its description field. - LLInventoryItem *link_item = NULL; + LLInventoryItem *link_item = nullptr; std::string description; LLInventoryModel::item_array_t links = LLAppearanceMgr::instance().findCOFItemLinks(mWearablePtr->getItemID()); @@ -1152,7 +1152,7 @@ void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BO llassert(mWearableItem); LLWearableType::EType type = wearable->getType(); - LLPanel *targetPanel = NULL; + LLPanel *targetPanel = nullptr; std::string title; std::string description_title; @@ -1365,7 +1365,7 @@ void LLPanelEditWearable::updateTypeSpecificControls(LLWearableType::EType type) void LLPanelEditWearable::updateScrollingPanelUI() { // do nothing if we don't have a valid wearable we're editing - if (mWearablePtr == NULL) + if (mWearablePtr == nullptr) { return; } @@ -1473,7 +1473,7 @@ LLPanel* LLPanelEditWearable::getPanel(LLWearableType::EType type) default: break; } - return NULL; + return nullptr; } void LLPanelEditWearable::getSortedParams(value_map_t &sorted_params, const std::string &edit_group) @@ -1517,14 +1517,14 @@ void LLPanelEditWearable::buildParamList(LLScrollingPanelList *panel_list, value LLPanel::Params p; p.name("LLScrollingPanelParam"); LLViewerWearable *wearable = this->getWearable(); - LLScrollingPanelParamBase *panel_param = NULL; + LLScrollingPanelParamBase *panel_param = nullptr; if (wearable && wearable->getType() == LLWearableType::WT_PHYSICS) // Hack to show a different panel for physics. Should generalize this later. { - panel_param = new LLScrollingPanelParamBase( p, NULL, (*it).second, TRUE, this->getWearable(), jointp); + panel_param = new LLScrollingPanelParamBase( p, nullptr, (*it).second, TRUE, this->getWearable(), jointp); } else { - panel_param = new LLScrollingPanelParam( p, NULL, (*it).second, TRUE, this->getWearable(), jointp); + panel_param = new LLScrollingPanelParam( p, nullptr, (*it).second, TRUE, this->getWearable(), jointp); } panel_list->addPanel( panel_param ); } @@ -1698,7 +1698,7 @@ void LLPanelEditWearable::onClickedImportBtn() static const LLStdStringHandle value_handle = LLXmlTree::addAttributeString("value"); U32 parse_errors = 0; - for (LLXmlTreeNode* child = archetype->getFirstChild(); child != NULL; child = archetype->getNextChild()) + for (LLXmlTreeNode* child = archetype->getFirstChild(); child != nullptr; child = archetype->getNextChild()) { if (!child->hasName("param")) continue; S32 id; @@ -1743,7 +1743,7 @@ class LLMetricSystemHandler : public LLCommandHandler public: LLMetricSystemHandler() : LLCommandHandler("metricsystem", UNTRUSTED_THROTTLE) { } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { // change height units TRUE for meters and FALSE for feet BOOL new_value = (gSavedSettings.getBOOL("HeightUnits") == FALSE) ? TRUE : FALSE; diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index b5a030abd881fdcc79e0967c8b63778f1a5c58c6..cf97d19dcd722953e4c165d7ca0ade05ac43ade2 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -51,9 +51,9 @@ public: LLPanelEditWearable( ); virtual ~LLPanelEditWearable(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ BOOL isDirty() const; // LLUICtrl - /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ BOOL isDirty() const override; // LLUICtrl + /*virtual*/ void draw() override; void onClose(); // changes camera angle to default for selected subpart @@ -76,7 +76,7 @@ public: void onSaveAsButtonClicked(); void saveAsCallback(const LLSD& notification, const LLSD& response); - virtual void setVisible(BOOL visible); + void setVisible(BOOL visible) override; private: typedef std::map<F32, LLViewerVisualParam*> value_map_t; diff --git a/indra/newview/llpanelenvironmenttools.cpp b/indra/newview/llpanelenvironmenttools.cpp index a5bbd539edf9168c3d7936af3087a2a7a39eba34..c00d6ca0966ed6e8e59887cdc9f703689c0dc714 100644 --- a/indra/newview/llpanelenvironmenttools.cpp +++ b/indra/newview/llpanelenvironmenttools.cpp @@ -975,7 +975,7 @@ class LLWindlightSLAppHandler : public LLCommandHandler public: LLWindlightSLAppHandler() : LLCommandHandler("windlight", UNTRUSTED_BLOCK) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { if (params.size() != 2) return false; diff --git a/indra/newview/llpaneleventinfo.h b/indra/newview/llpaneleventinfo.h index 09260102e00c4c416dac431ffc2ee6d540bbbf60..17cbda087546d15632b72861992d23654ba7a831 100644 --- a/indra/newview/llpaneleventinfo.h +++ b/indra/newview/llpaneleventinfo.h @@ -38,8 +38,8 @@ class LLPanelEventInfo : public LLPanel { public: LLPanelEventInfo(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; private: ~LLPanelEventInfo(); diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp index 79802f02009d94e3149c987093ed306b6572d30d..de788a60799f4eb797fa3db8359cfbc11c72c020 100644 --- a/indra/newview/llpanelexperiencelisteditor.cpp +++ b/indra/newview/llpanelexperiencelisteditor.cpp @@ -47,14 +47,14 @@ static LLPanelInjector<LLPanelExperienceListEditor> t_panel_experience_list_edit LLPanelExperienceListEditor::LLPanelExperienceListEditor() - :mItems(NULL) - ,mProfile(NULL) - ,mAdd(NULL) - ,mRemove(NULL) - ,mReadonly(false) - ,mMaxExperienceIDs(0) + :mItems(nullptr) + ,mAdd(nullptr) + ,mRemove(nullptr) + ,mProfile(nullptr) ,mAddedCallback() ,mRemovedCallback() + ,mReadonly(false) + ,mMaxExperienceIDs(0) { } @@ -133,7 +133,7 @@ void LLPanelExperienceListEditor::onRemove() std::vector<LLScrollListItem*>::iterator it = items.begin(); for(/**/; it != items.end(); ++it) { - if((*it) != NULL) + if((*it) != nullptr) { //mExperienceIds.erase((*it)->getValue()); mRemovedCallback((*it)->getValue()); @@ -165,7 +165,7 @@ void LLPanelExperienceListEditor::checkButtonsEnabled() std::vector<LLScrollListItem*>::iterator it = items.begin(); for(/**/; it != items.end() && remove_enabled; ++it) { - if((*it) != NULL) + if((*it) != nullptr) { remove_enabled = !mSticky((*it)->getValue()); } diff --git a/indra/newview/llpanelexperiencelisteditor.h b/indra/newview/llpanelexperiencelisteditor.h index bc9867752d3e4340258a32781c6a236b39b75176..5f70e4b1880948102eb6f5ac368b10945a65fdd1 100644 --- a/indra/newview/llpanelexperiencelisteditor.h +++ b/indra/newview/llpanelexperiencelisteditor.h @@ -47,7 +47,7 @@ public: typedef LLHandle<LLFloaterExperiencePicker> PickerHandle; LLPanelExperienceListEditor(); ~LLPanelExperienceListEditor(); - BOOL postBuild(); + BOOL postBuild() override; void loading(); diff --git a/indra/newview/llpanelexperiencelog.cpp b/indra/newview/llpanelexperiencelog.cpp index 6d4e3b5108d8add0a95e4cf062a3fe275bae8772..884da1c2b1d925bdf93f52680ae182e03c4e1382 100644 --- a/indra/newview/llpanelexperiencelog.cpp +++ b/indra/newview/llpanelexperiencelog.cpp @@ -49,7 +49,7 @@ static LLPanelInjector<LLPanelExperienceLog> register_experiences_panel("experie LLPanelExperienceLog::LLPanelExperienceLog( ) - : mEventList(NULL) + : mEventList(nullptr) , mPageSize(25) , mCurrentPage(0) { diff --git a/indra/newview/llpanelexperiencelog.h b/indra/newview/llpanelexperiencelog.h index 4135d9cac971d37e648ba2299343ace30cd6bc8f..9530a0ec1c779eedf22b3448f259fed1941df478 100644 --- a/indra/newview/llpanelexperiencelog.h +++ b/indra/newview/llpanelexperiencelog.h @@ -40,9 +40,9 @@ public: static LLPanelExperienceLog* create(); - /*virtual*/ BOOL postBuild(void); + /*virtual*/ BOOL postBuild(void) override; - void refresh(); + void refresh() override; protected: void logSizeChanged(); void notifyChanged(); diff --git a/indra/newview/llpanelexperiencepicker.cpp b/indra/newview/llpanelexperiencepicker.cpp index 0e83b4f764953e96304eb662ab9b49f760befb71..1a8451756fb76b3097723686c08eb9b6ae2bd82b 100644 --- a/indra/newview/llpanelexperiencepicker.cpp +++ b/indra/newview/llpanelexperiencepicker.cpp @@ -74,7 +74,7 @@ LLPanelExperiencePicker::~LLPanelExperiencePicker() BOOL LLPanelExperiencePicker::postBuild() { - getChild<LLLineEditor>(TEXT_EDIT)->setKeystrokeCallback( boost::bind(&LLPanelExperiencePicker::editKeystroke, this, _1, _2),NULL); + getChild<LLLineEditor>(TEXT_EDIT)->setKeystrokeCallback( boost::bind(&LLPanelExperiencePicker::editKeystroke, this, _1, _2), nullptr); childSetAction(BTN_FIND, boost::bind(&LLPanelExperiencePicker::onBtnFind, this)); getChildView(BTN_FIND)->setEnabled(TRUE); diff --git a/indra/newview/llpanelexperiencepicker.h b/indra/newview/llpanelexperiencepicker.h index 867b5993e35c04f3168e6f4c443e635408764fff..315f336437ef04416c2f2f6b805302864196a107 100644 --- a/indra/newview/llpanelexperiencepicker.h +++ b/indra/newview/llpanelexperiencepicker.h @@ -47,7 +47,7 @@ public: LLPanelExperiencePicker(); virtual ~LLPanelExperiencePicker(); - BOOL postBuild(); + BOOL postBuild() override; void addFilter(filter_function func){mFilters.push_back(func);} template <class IT> diff --git a/indra/newview/llpanelexperiences.cpp b/indra/newview/llpanelexperiences.cpp index 89337eb6aecf1f9e5a492a2eae281db323400d3d..f0114d40414255ab29dc4e944a1d33bac580af34 100644 --- a/indra/newview/llpanelexperiences.cpp +++ b/indra/newview/llpanelexperiences.cpp @@ -47,7 +47,7 @@ static LLPanelInjector<LLPanelExperiences> register_experiences_panel("experienc static const LLExperienceItemComparator NAME_COMPARATOR; LLPanelExperiences::LLPanelExperiences( ) - : mExperiencesList(NULL) + : mExperiencesList(nullptr) { buildFromFile("panel_experiences.xml"); } @@ -73,7 +73,7 @@ BOOL LLPanelExperiences::postBuild( void ) LLExperienceItem* LLPanelExperiences::getSelectedExperienceItem() { LLPanel* selected_item = mExperiencesList->getSelectedItem(); - if (!selected_item) return NULL; + if (!selected_item) return nullptr; return dynamic_cast<LLExperienceItem*>(selected_item); } @@ -164,7 +164,7 @@ void LLPanelExperiences::enableButton( bool enable ) LLExperienceItem::LLExperienceItem() - : mName(NULL) + : mName(nullptr) { buildFromFile("panel_experience_list_item.xml"); } diff --git a/indra/newview/llpanelexperiences.h b/indra/newview/llpanelexperiences.h index f29fdfdecb3b8ba0f40eea167989ec3e4df75036..330e06178927457c5a2462f32d1fd0e7f48868e4 100644 --- a/indra/newview/llpanelexperiences.h +++ b/indra/newview/llpanelexperiences.h @@ -41,7 +41,7 @@ class LLPanelSearchExperiences public: LLPanelSearchExperiences(){} static LLPanelSearchExperiences* create(const std::string& name); - /*virtual*/ BOOL postBuild(void); + /*virtual*/ BOOL postBuild(void) override; void doSearch(); }; @@ -54,7 +54,7 @@ public: static LLPanelExperiences* create(const std::string& name); - /*virtual*/ BOOL postBuild(void); + /*virtual*/ BOOL postBuild(void) override; /*virtual*/ void onClosePanel(); void setExperienceList(const LLSD& experiences); @@ -79,8 +79,8 @@ class LLExperienceItemComparator : public LLFlatListView::ItemComparator public: LLExperienceItemComparator() {}; virtual ~LLExperienceItemComparator() {}; - - virtual bool compare(const LLPanel* item1, const LLPanel* item2) const; + + bool compare(const LLPanel* item1, const LLPanel* item2) const override; }; class LLExperienceItem diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index a3aa00cfb3e78afcea4ac210dbb4d232141a63ed..6b5f7dee67b69e9981e4c48101c94f51c810e614 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -273,18 +273,18 @@ BOOL LLPanelFace::postBuild() LLPanelFace::LLPanelFace() : LLPanel() // <alchemy> -, mTextureCtrl(NULL) -, mShinyTextureCtrl(NULL) -, mBumpyTextureCtrl(NULL) -, mColorSwatch(NULL) -, mShinyColorSwatch(NULL) -, mComboTexGen(NULL) -, mComboMatMedia(NULL) -, mComboMatType(NULL) -, mCheckFullbright(NULL) -, mLabelColorTransp(NULL) -, mCtrlColorTransp(NULL) // transparency = 1 - alpha -, mCtrlGlow(NULL) +, mTextureCtrl(nullptr) +, mShinyTextureCtrl(nullptr) +, mBumpyTextureCtrl(nullptr) +, mColorSwatch(nullptr) +, mShinyColorSwatch(nullptr) +, mComboTexGen(nullptr) +, mComboMatMedia(nullptr) +, mComboMatType(nullptr) +, mCheckFullbright(nullptr) +, mLabelColorTransp(nullptr) +, mCtrlColorTransp(nullptr) // transparency = 1 - alpha +, mCtrlGlow(nullptr) // </alchemy> , mIsAlpha(false) { @@ -394,7 +394,8 @@ void LLPanelFace::sendGlow(const LLSD& userdata) struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor { LLPanelFaceSetTEFunctor(LLPanelFace* panel) : mPanel(panel) {} - virtual bool apply(LLViewerObject* object, S32 te) + + bool apply(LLViewerObject* object, S32 te) override { BOOL valid; F32 value; @@ -466,8 +467,8 @@ struct LLPanelFaceSetAlignedTEFunctor : public LLSelectedTEFunctor LLPanelFaceSetAlignedTEFunctor(LLPanelFace* panel, LLFace* center_face) : mPanel(panel), mCenterFace(center_face) {} - - virtual bool apply(LLViewerObject* object, S32 te) + + bool apply(LLViewerObject* object, S32 te) override { LLFace* facep = object->mDrawable->getFace(te); if (!facep) @@ -514,8 +515,8 @@ struct LLPanelFaceGetIsAlignedTEFunctor : public LLSelectedTEFunctor { LLPanelFaceGetIsAlignedTEFunctor(LLFace* center_face) : mCenterFace(center_face) {} - - virtual bool apply(LLViewerObject* object, S32 te) + + bool apply(LLViewerObject* object, S32 te) override { LLFace* facep = object->mDrawable->getFace(te); if (!facep) @@ -560,7 +561,7 @@ private: struct LLPanelFaceSendFunctor : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { object->sendTEUpdate(); return true; @@ -571,7 +572,7 @@ void LLPanelFace::sendTextureInfo() { if (childGetValue("checkbox planar align").asBoolean()) { - LLFace* last_face = NULL; + LLFace* last_face = nullptr; bool identical_face =false; LLSelectedTE::getFace(last_face, identical_face); LLPanelFaceSetAlignedTEFunctor setfunc(this, last_face); @@ -803,7 +804,7 @@ void LLPanelFace::refresh() if (align_planar && enabled) { - LLFace* last_face = NULL; + LLFace* last_face = nullptr; bool identical_face = false; LLSelectedTE::getFace(last_face, identical_face); @@ -1737,7 +1738,7 @@ void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl) struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor { - virtual bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { viewer_media_t pMediaImpl; @@ -1891,7 +1892,7 @@ void LLPanelFace::LLSelectedTE::getFace(LLFace*& face_to_return, bool& identical { struct LLSelectedTEGetFace : public LLSelectedTEGetFunctor<LLFace *> { - LLFace* get(LLViewerObject* object, S32 te) + LLFace* get(LLViewerObject* object, S32 te) override { return (object->mDrawable) ? object->mDrawable->getFace(te): NULL; } @@ -1904,7 +1905,7 @@ void LLPanelFace::LLSelectedTE::getImageFormat(LLGLenum& image_format_to_return, LLGLenum image_format = 0; struct LLSelectedTEGetImageFormat : public LLSelectedTEGetFunctor<LLGLenum> { - LLGLenum get(LLViewerObject* object, S32 te_index) + LLGLenum get(LLViewerObject* object, S32 te_index) override { LLViewerTexture* image = object->getTEImage(te_index); return image ? image->getPrimaryFormat() : GL_RGB; @@ -1918,7 +1919,7 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical) { struct LLSelectedTEGetTexId : public LLSelectedTEGetFunctor<LLUUID> { - LLUUID get(LLViewerObject* object, S32 te_index) + LLUUID get(LLViewerObject* object, S32 te_index) override { LLUUID id; LLViewerTexture* image = object->getTEImage(te_index); @@ -1953,7 +1954,7 @@ void LLPanelFace::LLSelectedTEMaterial::getCurrent(LLMaterialPtr& material_ptr, { struct MaterialFunctor : public LLSelectedTEGetFunctor<LLMaterialPtr> { - LLMaterialPtr get(LLViewerObject* object, S32 te_index) + LLMaterialPtr get(LLViewerObject* object, S32 te_index) override { return object->getTE(te_index)->getMaterialParams(); } @@ -1965,7 +1966,7 @@ void LLPanelFace::LLSelectedTEMaterial::getMaxSpecularRepeats(F32& repeats, bool { struct LLSelectedTEGetMaxSpecRepeats : public LLSelectedTEGetFunctor<F32> { - F32 get(LLViewerObject* object, S32 face) + F32 get(LLViewerObject* object, S32 face) override { LLMaterial* mat = object->getTE(face)->getMaterialParams().get(); U32 s_axis = VX; @@ -1989,7 +1990,7 @@ void LLPanelFace::LLSelectedTEMaterial::getMaxNormalRepeats(F32& repeats, bool& { struct LLSelectedTEGetMaxNormRepeats : public LLSelectedTEGetFunctor<F32> { - F32 get(LLViewerObject* object, S32 face) + F32 get(LLViewerObject* object, S32 face) override { LLMaterial* mat = object->getTE(face)->getMaterialParams().get(); U32 s_axis = VX; @@ -2017,7 +2018,7 @@ void LLPanelFace::LLSelectedTEMaterial::getCurrentDiffuseAlphaMode(U8& diffuse_a LLSelectedTEGetDiffuseAlphaMode(bool diffuse_texture_has_alpha) : _isAlpha(diffuse_texture_has_alpha) {} virtual ~LLSelectedTEGetDiffuseAlphaMode() {} - U8 get(LLViewerObject* object, S32 face) + U8 get(LLViewerObject* object, S32 face) override { U8 diffuse_mode = _isAlpha ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; @@ -2042,7 +2043,7 @@ void LLPanelFace::LLSelectedTE::getObjectScaleS(F32& scale_s, bool& identical) { struct LLSelectedTEGetObjectScaleS : public LLSelectedTEGetFunctor<F32> { - F32 get(LLViewerObject* object, S32 face) + F32 get(LLViewerObject* object, S32 face) override { U32 s_axis = VX; U32 t_axis = VY; @@ -2058,7 +2059,7 @@ void LLPanelFace::LLSelectedTE::getObjectScaleT(F32& scale_t, bool& identical) { struct LLSelectedTEGetObjectScaleS : public LLSelectedTEGetFunctor<F32> { - F32 get(LLViewerObject* object, S32 face) + F32 get(LLViewerObject* object, S32 face) override { U32 s_axis = VX; U32 t_axis = VY; @@ -2074,7 +2075,7 @@ void LLPanelFace::LLSelectedTE::getMaxDiffuseRepeats(F32& repeats, bool& identic { struct LLSelectedTEGetMaxDiffuseRepeats : public LLSelectedTEGetFunctor<F32> { - F32 get(LLViewerObject* object, S32 face) + F32 get(LLViewerObject* object, S32 face) override { U32 s_axis = VX; U32 t_axis = VY; diff --git a/indra/newview/llpanelgroup.h b/indra/newview/llpanelgroup.h index 619504b82f37b60f1ad2b85d2d5ebb8d94159f5f..6a68398301ec5c31bb19e3715864e6d3baa0bad6 100644 --- a/indra/newview/llpanelgroup.h +++ b/indra/newview/llpanelgroup.h @@ -50,20 +50,20 @@ public: LLPanelGroup(); virtual ~LLPanelGroup(); - virtual BOOL postBuild(); + BOOL postBuild() override; void setGroupID(const LLUUID& group_id); - void draw(); + void draw() override; - void onOpen(const LLSD& key); + void onOpen(const LLSD& key) override; // Group manager observer trigger. - virtual void changed(LLGroupChange gc); + void changed(LLGroupChange gc) override; // Implements LLVoiceClientStatusObserver::onChange() to enable the call // button when voice is available - /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal) override; void showNotice(const std::string& subject, const std::string& message, @@ -78,7 +78,7 @@ public: void callGroup(); void chatGroup(); - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; static void refreshCreatedGroup(const LLUUID& group_id); @@ -158,7 +158,7 @@ public: virtual void update(LLGroupChange gc) { } // This just connects the help button callback. - virtual BOOL postBuild(); + BOOL postBuild() override; virtual BOOL isVisibleByAgent(LLAgent* agentp); diff --git a/indra/newview/llpanelgroupbanlist.h b/indra/newview/llpanelgroupbanlist.h index 7c103cf3b9d272c16c9ae103a3f5622b300537a8..348f8b205f6a3030cb6a9697a03f3243d2a3d5f9 100644 --- a/indra/newview/llpanelgroupbanlist.h +++ b/indra/newview/llpanelgroupbanlist.h @@ -42,11 +42,11 @@ class LLPanelGroupBanlist : public LLPanelGroupTab public: LLPanelGroupBanlist(); ~LLPanelGroupBanlist(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void setGroupID(const LLUUID& id); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void setGroupID(const LLUUID& id) override; private: - /*virtual*/ void update(LLGroupChange gc); + /*virtual*/ void update(LLGroupChange gc) override; void onCommitBan(); void onCommitRemoveBan(); diff --git a/indra/newview/llpanelgroupbulk.cpp b/indra/newview/llpanelgroupbulk.cpp index 4dcd18ce39edb33ceb6aee9414bc1e3b7f292c87..62c9a96e73c543f623aa334847bca41b11d9e49d 100644 --- a/indra/newview/llpanelgroupbulk.cpp +++ b/indra/newview/llpanelgroupbulk.cpp @@ -54,16 +54,16 @@ ////////////////////////////////////////////////////////////////////////// LLPanelGroupBulkImpl::LLPanelGroupBulkImpl(const LLUUID& group_id) : mGroupID(group_id), - mBulkAgentList(NULL), - mOKButton(NULL), - mRemoveButton(NULL), - mGroupName(NULL), + mBulkAgentList(nullptr), + mOKButton(nullptr), + mRemoveButton(nullptr), + mGroupName(nullptr), mLoadingText(), mTooManySelected(), - mCloseCallback(NULL), - mCloseCallbackUserData(NULL), + mCloseCallback(nullptr), + mCloseCallbackUserData(nullptr), mAvatarNameCacheConnection(), - mRoleNames(NULL), + mRoleNames(nullptr), mOwnerWarning(), mAlreadyInGroup(), mConfirmedOwnerInvite(false), diff --git a/indra/newview/llpanelgroupbulk.h b/indra/newview/llpanelgroupbulk.h index 25ae71ab86f0bf6e559b10cbda712d6f23704a51..a4bf068c1d90c5ab1b223269e904bf5def34aeee 100644 --- a/indra/newview/llpanelgroupbulk.h +++ b/indra/newview/llpanelgroupbulk.h @@ -46,9 +46,9 @@ public: virtual void submit() = 0; public: - virtual void clear(); + void clear() override; virtual void update(); - virtual void draw(); + void draw() override; protected: virtual void updateGroupName(); diff --git a/indra/newview/llpanelgroupbulkban.h b/indra/newview/llpanelgroupbulkban.h index 9060d275f97973dc1f232534e0d52121072ce25a..0c46c220daccbdacb8ee721658001933873326b3 100644 --- a/indra/newview/llpanelgroupbulkban.h +++ b/indra/newview/llpanelgroupbulkban.h @@ -38,10 +38,10 @@ public: LLPanelGroupBulkBan(const LLUUID& group_id); ~LLPanelGroupBulkBan() {} - virtual BOOL postBuild(); + BOOL postBuild() override; static void callbackClickSubmit(void* userdata); - virtual void submit(); + void submit() override; private: std::string buildResidentsArgument(std::vector<LLAvatarName> avatar_names, const std::string &format); }; diff --git a/indra/newview/llpanelgroupexperiences.cpp b/indra/newview/llpanelgroupexperiences.cpp index 63e1326b933579ee53b2ca94664a492f524f0e89..4a4efe145c8920b74c254e2d52e31b03eb6dface 100644 --- a/indra/newview/llpanelgroupexperiences.cpp +++ b/indra/newview/llpanelgroupexperiences.cpp @@ -43,7 +43,7 @@ static LLPanelInjector<LLPanelGroupExperiences> t_panel_group_experiences("panel LLPanelGroupExperiences::LLPanelGroupExperiences() -: LLPanelGroupTab(), mExperiencesList(NULL) +: LLPanelGroupTab(), mExperiencesList(nullptr) { } diff --git a/indra/newview/llpanelgroupexperiences.h b/indra/newview/llpanelgroupexperiences.h index 7c79f7733250357bbd26faaeb8173e1663d1c0da..31a9b0cb08c180832e05068a0a22652789bc54cb 100644 --- a/indra/newview/llpanelgroupexperiences.h +++ b/indra/newview/llpanelgroupexperiences.h @@ -38,11 +38,11 @@ public: virtual ~LLPanelGroupExperiences(); // LLPanelGroupTab - virtual void activate(); - - virtual BOOL postBuild(); - - virtual void setGroupID(const LLUUID& id); + void activate() override; + + BOOL postBuild() override; + + void setGroupID(const LLUUID& id) override; void setExperienceList(const LLSD& experiences); diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index b9cf7e492fd013dd02f9cabd9b5ba89b78c21431..1fed25c484bcd0faaa54c23c403474743a2b64a6 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -64,20 +64,20 @@ LLPanelGroupGeneral::LLPanelGroupGeneral() : LLPanelGroupTab(), mChanged(FALSE), mFirstUse(TRUE), - mGroupNameEditor(NULL), - mFounderName(NULL), - mInsignia(NULL), - mEditCharter(NULL), - mCtrlShowInGroupList(NULL), - mCtrlOpenEnrollment(NULL), - mCtrlEnrollmentFee(NULL), - mSpinEnrollmentFee(NULL), - mCtrlReceiveNotices(NULL), - mCtrlListGroup(NULL), - mActiveTitleLabel(NULL), - mComboActiveTitle(NULL), - mComboMature(NULL), - mCtrlReceiveGroupChat(NULL) + mGroupNameEditor(nullptr), + mFounderName(nullptr), + mInsignia(nullptr), + mEditCharter(nullptr), + mCtrlShowInGroupList(nullptr), + mCtrlOpenEnrollment(nullptr), + mCtrlEnrollmentFee(nullptr), + mSpinEnrollmentFee(nullptr), + mCtrlReceiveNotices(nullptr), + mCtrlListGroup(nullptr), + mActiveTitleLabel(nullptr), + mComboActiveTitle(nullptr), + mComboMature(nullptr), + mCtrlReceiveGroupChat(nullptr) { } diff --git a/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h index 469a208202fbfe40c5ed4344f65be117e07f9fea..eb942860f4d31da09896b80b09b174f126d4790a 100644 --- a/indra/newview/llpanelgroupgeneral.h +++ b/indra/newview/llpanelgroupgeneral.h @@ -47,25 +47,25 @@ public: virtual ~LLPanelGroupGeneral(); // LLPanelGroupTab - virtual void activate(); - virtual bool needsApply(std::string& mesg); - virtual bool apply(std::string& mesg); - virtual void cancel(); + void activate() override; + bool needsApply(std::string& mesg) override; + bool apply(std::string& mesg) override; + void cancel() override; bool createGroupCallback(const LLSD& notification, const LLSD& response); - - virtual void update(LLGroupChange gc); - - virtual BOOL postBuild(); - - virtual void draw(); - virtual void setGroupID(const LLUUID& id); + void update(LLGroupChange gc) override; - virtual void setupCtrls (LLPanel* parent); + BOOL postBuild() override; + + void draw() override; + + void setGroupID(const LLUUID& id) override; + + void setupCtrls (LLPanel* parent) override; private: void reset(); - void resetDirty(); + void resetDirty() override; void onCommitAny(); void onCommitUserOnly(); diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index e08642b1fa84caafeb4e13b8576330caf2d4097a..c16b7dca8efc6d93cfdf8bf00bef692e7aa1af8d 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -99,14 +99,14 @@ public: LLPanelGroupInvite::impl::impl(const LLUUID& group_id): mGroupID( group_id ), mLoadingText (), - mInvitees ( NULL ), - mRoleNames( NULL ), - mOKButton ( NULL ), - mRemoveButton( NULL ), - mGroupName( NULL ), + mInvitees (nullptr ), + mRoleNames(nullptr ), + mOKButton (nullptr ), + mRemoveButton(nullptr ), + mGroupName(nullptr ), mConfirmedOwnerInvite( false ), - mCloseCallback( NULL ), - mCloseCallbackUserData( NULL ), + mCloseCallback(nullptr ), + mCloseCallbackUserData(nullptr ), mAvatarNameCacheConnection() { } @@ -259,7 +259,7 @@ void LLPanelGroupInvite::impl::addRoleNames(LLGroupMgrGroupData* gdatap) GP_ROLE_ASSIGN_MEMBER); bool can_assign_limited = gAgent.hasPowerInGroup(mGroupID, GP_ROLE_ASSIGN_MEMBER_LIMITED); - LLGroupMemberData* member_data = NULL; + LLGroupMemberData* member_data = nullptr; //get the member data for the agent if it exists if (agent_iter != gdatap->mMembers.end()) { diff --git a/indra/newview/llpanelgroupinvite.h b/indra/newview/llpanelgroupinvite.h index 9f7b5ae9be17790f243e260de9d51114d186a922..9d15a273875d0e8417f082506935015930052e21 100644 --- a/indra/newview/llpanelgroupinvite.h +++ b/indra/newview/llpanelgroupinvite.h @@ -43,13 +43,13 @@ public: * this callback is being used to add a user whose fullname isn't been loaded before invoking of addUsers(). */ void addUserCallback(const LLUUID& id, const LLAvatarName& av_name); - void clear(); + void clear() override; void update(); void setCloseCallback(void (*close_callback)(void*), void* data); - virtual void draw(); - virtual BOOL postBuild(); + void draw() override; + BOOL postBuild() override; protected: class impl; impl* mImplementation; diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 83c41686c6af3fa7eed12504cdc0e3016bcf8679..9e11d54e2e89ae4c8e58c73e45765a0e6db9abc0 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -149,8 +149,8 @@ public: ); virtual ~LLGroupMoneyDetailsTabEventHandler(); - virtual void requestData(LLMessageSystem* msg); - virtual void processReply(LLMessageSystem* msg, void** data); + void requestData(LLMessageSystem* msg) override; + void processReply(LLMessageSystem* msg, void** data) override; }; @@ -166,8 +166,8 @@ public: ); virtual ~LLGroupMoneySalesTabEventHandler(); - virtual void requestData(LLMessageSystem* msg); - virtual void processReply(LLMessageSystem* msg, void** data); + void requestData(LLMessageSystem* msg) override; + void processReply(LLMessageSystem* msg, void** data) override; }; class LLGroupMoneyPlanningTabEventHandler : public LLGroupMoneyTabEventHandler @@ -180,8 +180,8 @@ public: ); virtual ~LLGroupMoneyPlanningTabEventHandler(); - virtual void requestData(LLMessageSystem* msg); - virtual void processReply(LLMessageSystem* msg, void** data); + void requestData(LLMessageSystem* msg) override; + void processReply(LLMessageSystem* msg, void** data) override; }; //////////////////////////////////////////////////////////////////////////// @@ -246,15 +246,15 @@ LLPanelGroupLandMoney::impl::impl(LLPanelGroupLandMoney& panel) mNeedsSendGroupLandRequest = true; mNeedsApply = false; - mYourContributionEditorp = NULL; - mMapButtonp = NULL; - mGroupParcelsp = NULL; - mGroupOverLimitTextp = NULL; - mGroupOverLimitIconp = NULL; + mYourContributionEditorp = nullptr; + mMapButtonp = nullptr; + mGroupParcelsp = nullptr; + mGroupOverLimitTextp = nullptr; + mGroupOverLimitIconp = nullptr; - mMoneySalesTabEHp = NULL; - mMoneyPlanningTabEHp = NULL; - mMoneyDetailsTabEHp = NULL; + mMoneySalesTabEHp = nullptr; + mMoneyPlanningTabEHp = nullptr; + mMoneyDetailsTabEHp = nullptr; } LLPanelGroupLandMoney::impl::~impl() @@ -630,7 +630,7 @@ void LLPanelGroupLandMoney::update(LLGroupChange gc) { eh = get_if_there(LLGroupMoneyTabEventHandler::sTabsToHandlers, panelp, - (LLGroupMoneyTabEventHandler*)NULL); + (LLGroupMoneyTabEventHandler*)nullptr); if ( eh ) eh->onClickTab(); } } @@ -1334,8 +1334,8 @@ LLGroupMoneyPlanningTabEventHandler::LLGroupMoneyPlanningTabEventHandler(LLTextE LLTabContainer* tab_containerp, LLPanel* panelp, const std::string& loading_text) - : LLGroupMoneyTabEventHandler(NULL, - NULL, + : LLGroupMoneyTabEventHandler(nullptr, + nullptr, text_editorp, tab_containerp, panelp, @@ -1601,7 +1601,7 @@ void LLPanelGroupLandMoney::setGroupID(const LLUUID& id) } else { - if(mImplementationp->mMoneyDetailsTabEHp == 0) + if(mImplementationp->mMoneyDetailsTabEHp == nullptr) mImplementationp->mMoneyDetailsTabEHp = new LLGroupMoneyDetailsTabEventHandler(earlierp,laterp,textp,tabcp,panelp,loading_text); mImplementationp->mMoneyDetailsTabEHp->setGroupID(mGroupID); } @@ -1616,7 +1616,7 @@ void LLPanelGroupLandMoney::setGroupID(const LLUUID& id) else { panelp = getChild<LLPanel>("group_money_planning_tab", true); - if(mImplementationp->mMoneyPlanningTabEHp == 0) + if(mImplementationp->mMoneyPlanningTabEHp == nullptr) mImplementationp->mMoneyPlanningTabEHp = new LLGroupMoneyPlanningTabEventHandler(textp,tabcp,panelp,loading_text); mImplementationp->mMoneyPlanningTabEHp->setGroupID(mGroupID); } @@ -1634,7 +1634,7 @@ void LLPanelGroupLandMoney::setGroupID(const LLUUID& id) earlierp = getChild<LLButton>("earlier_sales_button", true); laterp = getChild<LLButton>("later_sales_button", true); panelp = getChild<LLPanel>("group_money_sales_tab", true); - if(mImplementationp->mMoneySalesTabEHp == NULL) + if(mImplementationp->mMoneySalesTabEHp == nullptr) mImplementationp->mMoneySalesTabEHp = new LLGroupMoneySalesTabEventHandler(earlierp,laterp,textp,tabcp,panelp,loading_text); mImplementationp->mMoneySalesTabEHp->setGroupID(mGroupID); } diff --git a/indra/newview/llpanelgrouplandmoney.h b/indra/newview/llpanelgrouplandmoney.h index 8f45c73c7052586672bd3b8ce364b50434c83708..29371ea5dbfc8d81bbdcd2baa5131cf6e65a332b 100644 --- a/indra/newview/llpanelgrouplandmoney.h +++ b/indra/newview/llpanelgrouplandmoney.h @@ -35,14 +35,14 @@ class LLPanelGroupLandMoney : public LLPanelGroupTab public: LLPanelGroupLandMoney(); virtual ~LLPanelGroupLandMoney(); - virtual BOOL postBuild(); - virtual BOOL isVisibleByAgent(LLAgent* agentp); + BOOL postBuild() override; + BOOL isVisibleByAgent(LLAgent* agentp) override; - virtual void activate(); - virtual bool needsApply(std::string& mesg); - virtual bool apply(std::string& mesg); - virtual void cancel(); - virtual void update(LLGroupChange gc); + void activate() override; + bool needsApply(std::string& mesg) override; + bool apply(std::string& mesg) override; + void cancel() override; + void update(LLGroupChange gc) override; static void processPlacesReply(LLMessageSystem* msg, void**); @@ -53,7 +53,7 @@ public: static void processGroupAccountTransactionsReply(LLMessageSystem* msg, void** data); static void processGroupAccountSummaryReply(LLMessageSystem* msg, void** data); - virtual void setGroupID(const LLUUID& id); + void setGroupID(const LLUUID& id) override; virtual void onLandSelectionChanged(); diff --git a/indra/newview/llpanelgroupnotices.h b/indra/newview/llpanelgroupnotices.h index 65082cc8c1f47b46f52150b66df7605eea95ccba..afc35a2e68fe1c412a40aeac1b533fba078cad15 100644 --- a/indra/newview/llpanelgroupnotices.h +++ b/indra/newview/llpanelgroupnotices.h @@ -45,13 +45,13 @@ public: virtual ~LLPanelGroupNotices(); // LLPanelGroupTab - virtual void activate(); + void activate() override; //virtual bool needsApply(std::string& mesg); //virtual bool apply(std::string& mesg); //virtual void update(); - - virtual BOOL postBuild(); - virtual BOOL isVisibleByAgent(LLAgent* agentp); + + BOOL postBuild() override; + BOOL isVisibleByAgent(LLAgent* agentp) override; void setItem(LLPointer<LLInventoryItem> inv_item); @@ -65,7 +65,7 @@ public: void refreshNotices(); - virtual void setGroupID(const LLUUID& id); + void setGroupID(const LLUUID& id) override; private: static void onClickRemoveAttachment(void* data); diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 180c9b98943c9bf76743b89fc72a698d639f3f5a..74739b3eadb5bfd76579c8efd12c59c65fbfe1b4 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -53,8 +53,8 @@ public: friend class LLPanelGroupRolesSubTab; friend class LLPanelGroupActionsSubTab; - virtual BOOL postBuild(); - virtual BOOL isVisibleByAgent(LLAgent* agentp); + BOOL postBuild() override; + BOOL isVisibleByAgent(LLAgent* agentp) override; bool handleSubTabSwitch(const LLSD& data); @@ -70,15 +70,15 @@ public: bool onModalClose(const LLSD& notification, const LLSD& response); // Most of these messages are just passed on to the current sub-tab. - virtual void activate(); - virtual void deactivate(); - virtual bool needsApply(std::string& mesg); - virtual BOOL hasModal(); - virtual bool apply(std::string& mesg); - virtual void cancel(); - virtual void update(LLGroupChange gc); + void activate() override; + void deactivate() override; + bool needsApply(std::string& mesg) override; + BOOL hasModal() override; + bool apply(std::string& mesg) override; + void cancel() override; + void update(LLGroupChange gc) override; - virtual void setGroupID(const LLUUID& id); + void setGroupID(const LLUUID& id) override; protected: LLPanelGroupTab* mCurrentTab; @@ -97,15 +97,15 @@ public: LLPanelGroupSubTab(); virtual ~LLPanelGroupSubTab(); - virtual BOOL postBuild(); + BOOL postBuild() override; // This allows sub-tabs to collect child widgets from a higher level in the view hierarchy. virtual BOOL postBuildSubTab(LLView* root); virtual void setSearchFilter( const std::string& filter ); - virtual void activate(); - virtual void deactivate(); + void activate() override; + void deactivate() override; // Helper functions bool matchesActionSearchFilter(std::string action); @@ -113,7 +113,7 @@ public: void setFooterEnabled(BOOL enable); - virtual void setGroupID(const LLUUID& id); + void setGroupID(const LLUUID& id) override; protected: void buildActionsList(LLScrollListCtrl* ctrl, U64 allowed_by_some, @@ -155,7 +155,7 @@ public: LLPanelGroupMembersSubTab(); virtual ~LLPanelGroupMembersSubTab(); - virtual BOOL postBuildSubTab(LLView* root); + BOOL postBuildSubTab(LLView* root) override; void handleMemberSelect(); @@ -183,17 +183,17 @@ public: void applyMemberChanges(); bool addOwnerCB(const LLSD& notification, const LLSD& response); - virtual void activate(); - virtual void deactivate(); - virtual void cancel(); - virtual bool needsApply(std::string& mesg); - virtual bool apply(std::string& mesg); - virtual void update(LLGroupChange gc); + void activate() override; + void deactivate() override; + void cancel() override; + bool needsApply(std::string& mesg) override; + bool apply(std::string& mesg) override; + void update(LLGroupChange gc) override; void updateMembers(); - virtual void draw(); + void draw() override; - virtual void setGroupID(const LLUUID& id); + void setGroupID(const LLUUID& id) override; void addMemberToList(LLGroupMemberData* data); void onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name, const LLUUID& av_id); @@ -236,15 +236,15 @@ public: LLPanelGroupRolesSubTab(); virtual ~LLPanelGroupRolesSubTab(); - virtual BOOL postBuildSubTab(LLView* root); + BOOL postBuildSubTab(LLView* root) override; - virtual void activate(); - virtual void deactivate(); - virtual bool needsApply(std::string& mesg); - virtual bool apply(std::string& mesg); - virtual void cancel(); + void activate() override; + void deactivate() override; + bool needsApply(std::string& mesg) override; + bool apply(std::string& mesg) override; + void cancel() override; bool matchesSearchFilter(std::string rolename, std::string roletitle); - virtual void update(LLGroupChange gc); + void update(LLGroupChange gc) override; void handleRoleSelect(); void buildMembersList(); @@ -268,7 +268,7 @@ public: void saveRoleChanges(bool select_saved_role); - virtual void setGroupID(const LLUUID& id); + void setGroupID(const LLUUID& id) override; BOOL mFirstOpen; @@ -300,18 +300,18 @@ public: LLPanelGroupActionsSubTab(); virtual ~LLPanelGroupActionsSubTab(); - virtual BOOL postBuildSubTab(LLView* root); + BOOL postBuildSubTab(LLView* root) override; - virtual void activate(); - virtual void deactivate(); - virtual bool needsApply(std::string& mesg); - virtual bool apply(std::string& mesg); - virtual void update(LLGroupChange gc); + void activate() override; + void deactivate() override; + bool needsApply(std::string& mesg) override; + bool apply(std::string& mesg) override; + void update(LLGroupChange gc) override; void handleActionSelect(); - virtual void setGroupID(const LLUUID& id); + void setGroupID(const LLUUID& id) override; protected: LLScrollListCtrl* mActionList; LLScrollListCtrl* mActionRoles; diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp index 1c3aecf3bb782305cd57e0163f665df98e4b16f1..c3ae8455cb0e8f9c9f44d6161fdf40dfae60f780 100644 --- a/indra/newview/llpanelhome.cpp +++ b/indra/newview/llpanelhome.cpp @@ -38,7 +38,7 @@ static LLPanelInjector<LLPanelHome> t_home("panel_sidetray_home"); LLPanelHome::LLPanelHome() : LLPanel(), LLViewerMediaObserver(), - mBrowser(NULL), + mBrowser(nullptr), mFirstView(true) { } diff --git a/indra/newview/llpanelhome.h b/indra/newview/llpanelhome.h index 748566326faf05cb816bfe38de9569583284c39f..cd0f1b95b3cdc4c0296771b73ee2934277ebea0b 100644 --- a/indra/newview/llpanelhome.h +++ b/indra/newview/llpanelhome.h @@ -44,12 +44,12 @@ class LLPanelHome : public: LLPanelHome(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; private: // inherited from LLViewerMediaObserver - /*virtual*/ void handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event); + /*virtual*/ void handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event) override; LLMediaCtrl *mBrowser; bool mFirstView; diff --git a/indra/newview/llpanelland.cpp b/indra/newview/llpanelland.cpp index d283bf7258631a7b19d0b317ee79e43fbdafd39d..744ae8bdb8e76e350502a3b8cdebc96f31836734 100644 --- a/indra/newview/llpanelland.cpp +++ b/indra/newview/llpanelland.cpp @@ -44,15 +44,15 @@ #include "llviewerwindow.h" #include "roles_constants.h" -LLPanelLandSelectObserver* LLPanelLandInfo::sObserver = NULL; -LLPanelLandInfo* LLPanelLandInfo::sInstance = NULL; +LLPanelLandSelectObserver* LLPanelLandInfo::sObserver = nullptr; +LLPanelLandInfo* LLPanelLandInfo::sInstance = nullptr; class LLPanelLandSelectObserver : public LLParcelObserver { public: LLPanelLandSelectObserver() {} virtual ~LLPanelLandSelectObserver() {} - virtual void changed() { LLPanelLandInfo::refreshAll(); } + void changed() override { LLPanelLandInfo::refreshAll(); } }; @@ -74,7 +74,7 @@ BOOL LLPanelLandInfo::postBuild() // LLPanelLandInfo::LLPanelLandInfo() : LLPanel(), - mCheckShowOwners(NULL) + mCheckShowOwners(nullptr) { if (!sInstance) { @@ -94,9 +94,9 @@ LLPanelLandInfo::~LLPanelLandInfo() { LLViewerParcelMgr::getInstance()->removeObserver( sObserver ); delete sObserver; - sObserver = NULL; + sObserver = nullptr; - sInstance = NULL; + sInstance = nullptr; } diff --git a/indra/newview/llpanelland.h b/indra/newview/llpanelland.h index 2ab1618d47457ca20199ff68f617b02fa29d97f0..edb8c33e1de2862dfac7f2c7f8724931d73b5b3b 100644 --- a/indra/newview/llpanelland.h +++ b/indra/newview/llpanelland.h @@ -43,7 +43,7 @@ public: LLPanelLandInfo(); virtual ~LLPanelLandInfo(); - void refresh(); + void refresh() override; static void refreshAll(); LLCheckBoxCtrl *mCheckShowOwners; @@ -56,7 +56,7 @@ protected: static void onClickAbout(); protected: - virtual BOOL postBuild(); + BOOL postBuild() override; static LLPanelLandSelectObserver* sObserver; static LLPanelLandInfo* sInstance; diff --git a/indra/newview/llpanellandmarkinfo.h b/indra/newview/llpanellandmarkinfo.h index 01a6fd6b3d9dd73209ec687e59bb9e36c5beba8d..5718ba8db995115dc94fdab9fda2c429c9764547 100644 --- a/indra/newview/llpanellandmarkinfo.h +++ b/indra/newview/llpanellandmarkinfo.h @@ -39,13 +39,13 @@ public: LLPanelLandmarkInfo(); /*virtual*/ ~LLPanelLandmarkInfo(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; - /*virtual*/ void resetLocation(); + /*virtual*/ void resetLocation() override; - /*virtual*/ void setInfoType(EInfoType type); + /*virtual*/ void setInfoType(EInfoType type) override; - /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data) override; // Displays landmark owner, creator and creation date info. void displayItemInfo(const LLInventoryItem* pItem); diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 346af7ff89bcb420e6bc1be0121220d22634ca17..04fa29954072040a577c3d4ff3a12bda0038adf0 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -88,8 +88,8 @@ public: mExpandedFolders(0) {} virtual ~LLCheckFolderState() {} - virtual void doFolder(LLFolderViewFolder* folder); - virtual void doItem(LLFolderViewItem* item) {} + void doFolder(LLFolderViewFolder* folder) override; + void doItem(LLFolderViewItem* item) override {} S32 getCollapsedFolders() { return mCollapsedFolders; } S32 getExpandedFolders() { return mExpandedFolders; } @@ -130,7 +130,7 @@ public: : mLP(lp) {} virtual ~LLLandmarksPanelObserver() {} - /*virtual*/ void changed(U32 mask); + /*virtual*/ void changed(U32 mask) override; private: LLLandmarksPanel* mLP; @@ -143,14 +143,14 @@ void LLLandmarksPanelObserver::changed(U32 mask) LLLandmarksPanel::LLLandmarksPanel() : LLPanelPlacesTab() - , mFavoritesInventoryPanel(NULL) - , mLandmarksInventoryPanel(NULL) + , mFavoritesInventoryPanel(nullptr) + , mLandmarksInventoryPanel(nullptr) //, mMyInventoryPanel(NULL) - , mCurrentSelectedList(NULL) - , mListCommands(NULL) - , mGearButton(NULL) - , mGearFolderMenu(NULL) - , mGearLandmarkMenu(NULL) + , mGearButton(nullptr) + , mGearLandmarkMenu(nullptr) + , mGearFolderMenu(nullptr) + , mCurrentSelectedList(nullptr) + , mListCommands(nullptr) { mInventoryObserver = new LLLandmarksPanelObserver(this); gInventory.addObserver(mInventoryObserver); @@ -195,7 +195,7 @@ void LLLandmarksPanel::onSearchEdit(const std::string& string) } LLPlacesInventoryPanel* inventory_list = dynamic_cast<LLPlacesInventoryPanel*>(tab->getAccordionView()); - if (NULL == inventory_list) continue; + if (nullptr == inventory_list) continue; filter_list(inventory_list, string); } @@ -211,7 +211,7 @@ void LLLandmarksPanel::onSearchEdit(const std::string& string) // virtual void LLLandmarksPanel::onShowOnMap() { - if (NULL == mCurrentSelectedList) + if (nullptr == mCurrentSelectedList) { LL_WARNS() << "There are no selected list. No actions are performed." << LL_ENDL; return; @@ -251,7 +251,7 @@ bool LLLandmarksPanel::isSingleItemSelected() { bool result = false; - if (mCurrentSelectedList != NULL) + if (mCurrentSelectedList != nullptr) { LLFolderView* root_view = mCurrentSelectedList->getRootFolder(); @@ -395,7 +395,7 @@ LLFolderViewModelItemInventory* LLLandmarksPanel::getCurSelectedViewModelItem() { return static_cast<LLFolderViewModelItemInventory*>(cur_item->getViewModelItem()); } - return NULL; + return nullptr; } @@ -405,13 +405,13 @@ LLFolderViewItem* LLLandmarksPanel::selectItemInAccordionTab(LLPlacesInventoryPa BOOL take_keyboard_focus) const { if (!inventory_list) - return NULL; + return nullptr; LLFolderView* root = inventory_list->getRootFolder(); LLFolderViewItem* item = inventory_list->getItemByID(obj_id); if (!item) - return NULL; + return nullptr; LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(tab_name); if (!tab->isExpanded()) @@ -555,7 +555,7 @@ void LLLandmarksPanel::onAccordionExpandedCollapsed(const LLSD& param, LLPlacesI { inventory_list->getRootFolder()->clearSelection(); - mCurrentSelectedList = NULL; + mCurrentSelectedList = nullptr; updateVerbs(); } @@ -695,7 +695,7 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const { if (item && mCurrentSelectedList == mLandmarksInventoryPanel) { - LLFolderViewModelItem* folder_bridge = NULL; + LLFolderViewModelItem* folder_bridge = nullptr; if (view_model->getInventoryType() == LLInventoryType::IT_LANDMARK) @@ -718,7 +718,7 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const else { //in case My Landmarks tab is completely empty (thus cannot be determined as being selected) - menu_create_inventory_item(mLandmarksInventoryPanel, NULL, LLSD("category"), + menu_create_inventory_item(mLandmarksInventoryPanel, nullptr, LLSD("category"), gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK)); if (mMyLandmarksAccordionTab) @@ -1123,7 +1123,7 @@ void LLLandmarksPanel::onPickPanelExit( LLPanelPickEdit* pick_panel, LLView* own LLRemoteParcelInfoProcessor::getInstance()->removeObserver(params["parcel_id"].asUUID(), this); delete pick_panel; - pick_panel = NULL; + pick_panel = nullptr; } bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data , EAcceptance* accept) @@ -1196,7 +1196,7 @@ void LLLandmarksPanel::doProcessParcelInfo(LLLandmark* landmark, landmark->getGlobalPos(landmark_global_pos); // let's toggle pick panel into panel places - LLPanel* panel_places = NULL; + LLPanel* panel_places = nullptr; LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>("places"); if (floaterp) { diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index b75e7f29ee6a1e8a06e130d1678b5f28bf0fbaeb..d7708fea38d17d0b77eeb9776911b191356e8029 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -52,13 +52,13 @@ public: LLLandmarksPanel(); virtual ~LLLandmarksPanel(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onSearchEdit(const std::string& string); - /*virtual*/ void onShowOnMap(); - /*virtual*/ void onShowProfile(); - /*virtual*/ void onTeleport(); - /*virtual*/ void updateVerbs(); - /*virtual*/ bool isSingleItemSelected(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onSearchEdit(const std::string& string) override; + /*virtual*/ void onShowOnMap() override; + /*virtual*/ void onShowProfile() override; + /*virtual*/ void onTeleport() override; + /*virtual*/ void updateVerbs() override; + /*virtual*/ bool isSingleItemSelected() override; void onSelectionChange(LLPlacesInventoryPanel* inventory_list, const std::deque<LLFolderViewItem*> &items, BOOL user_action); void onSelectorButtonClicked(); @@ -104,9 +104,9 @@ protected: void updateSortOrder(LLInventoryPanel* panel, bool byDate); //LLRemoteParcelInfoObserver interface - /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); - /*virtual*/ void setParcelID(const LLUUID& parcel_id); - /*virtual*/ void setErrorStatus(S32 status, const std::string& reason); + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data) override; + /*virtual*/ void setParcelID(const LLUUID& parcel_id) override; + /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) override; private: void initFavoritesInventoryPanel(); diff --git a/indra/newview/llpanellandmedia.cpp b/indra/newview/llpanellandmedia.cpp index 5e12d33ce37e7b5ad298225ff086647715988966..eae636ba8c5b8d4d61275fef21d8aab4f8299edf 100644 --- a/indra/newview/llpanellandmedia.cpp +++ b/indra/newview/llpanellandmedia.cpp @@ -68,17 +68,17 @@ enum LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) : LLPanel(), - mParcel(parcel), - mMediaURLEdit(NULL), - mMediaDescEdit(NULL), - mMediaTypeCombo(NULL), - mSetURLButton(NULL), - mMediaHeightCtrl(NULL), - mMediaWidthCtrl(NULL), - mMediaSizeCtrlLabel(NULL), - mMediaTextureCtrl(NULL), - mMediaAutoScaleCheck(NULL), - mMediaLoopCheck(NULL) + mMediaURLEdit(nullptr), + mMediaDescEdit(nullptr), + mMediaTypeCombo(nullptr), + mSetURLButton(nullptr), + mMediaHeightCtrl(nullptr), + mMediaWidthCtrl(nullptr), + mMediaSizeCtrlLabel(nullptr), + mMediaTextureCtrl(nullptr), + mMediaAutoScaleCheck(nullptr), + mMediaLoopCheck(nullptr), + mParcel(parcel) { } diff --git a/indra/newview/llpanellandmedia.h b/indra/newview/llpanellandmedia.h index 5a6ed55e1a6fbb63e95eea71041356d5c4758193..a44bd8054064f9db1ee6e6784955495d09696f00 100644 --- a/indra/newview/llpanellandmedia.h +++ b/indra/newview/llpanellandmedia.h @@ -40,8 +40,8 @@ class LLPanelLandMedia public: LLPanelLandMedia(LLSafeHandle<LLParcelSelection>& parcelp); /*virtual*/ ~LLPanelLandMedia(); - /*virtual*/ BOOL postBuild(); - void refresh(); + /*virtual*/ BOOL postBuild() override; + void refresh() override; void setMediaType(const std::string& media_type); void setMediaURL(const std::string& media_type); std::string getMediaURL(); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 7a0e7c7c98579118db9d9a09a95cd76afccc685d..232ae5b5741c43dd206423ae59cd5e906e36be39 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -75,7 +75,7 @@ #include "llsdserialize.h" -LLPanelLogin *LLPanelLogin::sInstance = NULL; +LLPanelLogin *LLPanelLogin::sInstance = nullptr; BOOL LLPanelLogin::sCapslockDidNotification = FALSE; class LLLoginRefreshHandler : public LLCommandHandler @@ -83,7 +83,7 @@ class LLLoginRefreshHandler : public LLCommandHandler public: // don't allow from external browsers LLLoginRefreshHandler() : LLCommandHandler("login_refresh", UNTRUSTED_BLOCK) { } - bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) override { if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) { @@ -101,9 +101,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, void *cb_data) : LLPanel(), mLogoImage(), + mListener(new LLPanelLoginListener(this)), mCallback(callback), mCallbackData(cb_data), - mListener(new LLPanelLoginListener(this)), mLoginWidgetStack(nullptr) { setBackgroundVisible(FALSE); @@ -171,12 +171,12 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, getChild<LLPanel>("links_login_panel")->setDefaultBtn("connect_btn"); LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text"); - forgot_password_text->setClickedCallback(onClickForgotPassword, NULL); + forgot_password_text->setClickedCallback(onClickForgotPassword, nullptr); - childSetAction("create_new_account_btn", onClickNewAccount, NULL); + childSetAction("create_new_account_btn", onClickNewAccount, nullptr); LLTextBox* need_help_text = getChild<LLTextBox>("login_help"); - need_help_text->setClickedCallback(onClickHelp, NULL); + need_help_text->setClickedCallback(onClickHelp, nullptr); // get the web browser control LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html"); @@ -295,11 +295,11 @@ LLPanelLogin::~LLPanelLogin() if (mGridListChangedConnection.connected()) mGridListChangedConnection.disconnect(); - LLPanelLogin::sInstance = NULL; + LLPanelLogin::sInstance = nullptr; // Controls having keyboard focus by default // must reset it on destroy. (EXT-2748) - gFocusMgr.setDefaultKeyboardFocus(NULL); + gFocusMgr.setDefaultKeyboardFocus(nullptr); } // virtual @@ -374,8 +374,8 @@ void LLPanelLogin::giveFocus() BOOL have_username = !username.empty(); BOOL have_pass = !pass.empty(); - LLLineEditor* edit = NULL; - LLComboBox* combo = NULL; + LLLineEditor* edit = nullptr; + LLComboBox* combo = nullptr; if (have_username && !have_pass) { // User saved his name but not his password. Move @@ -702,7 +702,7 @@ void LLPanelLogin::closePanel() LLPanelLogin::sInstance->getParent()->removeChild( LLPanelLogin::sInstance ); delete sInstance; - sInstance = NULL; + sInstance = nullptr; } } diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 3a0d7fdf3a8b14f8500c331fd8923e9d68554a77..88c08894398d7a08bab356e6b9dc880c97d8875c 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -50,9 +50,9 @@ public: void *callback_data); ~LLPanelLogin(); - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual void draw(); - virtual void setFocus( BOOL b ); + BOOL handleKeyHere(KEY key, MASK mask) override; + void draw() override; + void setFocus( BOOL b ) override; // Show the XUI first name, last name, and password widgets. They are // hidden on startup for reg-in-client @@ -81,7 +81,7 @@ public: static void setAlwaysRefresh(bool refresh); // inherited from LLViewerMediaObserver - /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; static void updateServer(); // update the combo box, change the login page to the new server, clear the combo /// to be called from LLStartUp::setStartSLURL diff --git a/indra/newview/llpanelloginlistener.cpp b/indra/newview/llpanelloginlistener.cpp index 0c489afee6e9f373780462713189c6a0188993af..6b89101681f5bda74df89cb6bbf78b49198c7284 100644 --- a/indra/newview/llpanelloginlistener.cpp +++ b/indra/newview/llpanelloginlistener.cpp @@ -49,5 +49,5 @@ LLPanelLoginListener::LLPanelLoginListener(LLPanelLogin* instance): void LLPanelLoginListener::onClickConnect(const LLSD&) const { - mPanel->onClickConnect(NULL); + mPanel->onClickConnect(nullptr); } diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 18f9df5d9b6638001bc893abfbd6f608345f5e46..773317ad6b0082b0797c526e1e859486638e0475 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -80,8 +80,8 @@ class LLFloaterInventoryFinder : public LLFloater { public: LLFloaterInventoryFinder( LLPanelMainInventory* inventory_view); - virtual void draw(); - /*virtual*/ BOOL postBuild(); + void draw() override; + /*virtual*/ BOOL postBuild() override; void changeFilter(LLInventoryFilter* filter); void updateElementsFromFilter(); BOOL getCheckShowLinks(); @@ -114,8 +114,8 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mFilterText(""), mItemCount(0), mTrashButton(nullptr), - mMenuAddHandle(), mGearMenuButton(nullptr), + mMenuAddHandle(), mNeedUploadCost(true) { // Menu Callbacks (non contex menus) @@ -386,7 +386,7 @@ void LLPanelMainInventory::newWindow() void LLPanelMainInventory::doCreate(const LLSD& userdata) { reset_inventory_filter(); - menu_create_inventory_item(getPanel(), NULL, userdata); + menu_create_inventory_item(getPanel(), nullptr, userdata); } void LLPanelMainInventory::resetFilters() @@ -453,7 +453,7 @@ BOOL LLPanelMainInventory::filtersVisible(void* user_data) LLPanelMainInventory* self = (LLPanelMainInventory*)user_data; if(!self) return FALSE; - return self->getFinder() != NULL; + return self->getFinder() != nullptr; } void LLPanelMainInventory::onClearSearch() @@ -520,7 +520,7 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) //static BOOL LLPanelMainInventory::incrementalFind(LLFolderViewItem* first_item, const char *find_text, BOOL backward) { - LLPanelMainInventory* active_view = NULL; + LLPanelMainInventory* active_view = nullptr; LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 63a81c2e61d8c5294f765e1bafb277a3d37fcb80..0cbc7c1e970627b918987039316ff8146911b9e5 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -60,19 +60,19 @@ public: LLPanelMainInventory(const LLPanel::Params& p = getDefaultParams()); ~LLPanelMainInventory(); - BOOL postBuild(); + BOOL postBuild() override; - virtual BOOL handleKeyHere(KEY key, MASK mask); + BOOL handleKeyHere(KEY key, MASK mask) override; // Inherited functionality /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); - /*virtual*/ void changed(U32); - /*virtual*/ void draw(); - /*virtual*/ void onVisibilityChange ( BOOL new_visibility ); + std::string& tooltip_msg) override; + /*virtual*/ void changed(U32) override; + /*virtual*/ void draw() override; + /*virtual*/ void onVisibilityChange ( BOOL new_visibility ) override; LLInventoryPanel* getPanel() { return mActivePanel; } LLInventoryPanel* getActivePanel() { return mActivePanel; } @@ -120,7 +120,7 @@ protected: bool isSaveTextureEnabled(const LLSD& userdata); void updateItemcountText(); - void onFocusReceived(); + void onFocusReceived() override; private: LLFloaterInventoryFinder* getFinder(); diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index f36c629322961c231b3802ca27f1f1e40e868218..ec018f930ab7701ad1879a9612729964b1c8cd43 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -50,9 +50,9 @@ const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams // protected LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p) : LLPanel(p) - , mFreshCountCtrl(NULL) - , mInboxButton(NULL) - , mInventoryPanel(NULL) + , mFreshCountCtrl(nullptr) + , mInboxButton(nullptr) + , mInventoryPanel(nullptr) { } diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index 9eb74581a2fd56de8f846949f0e5ab1435770959..bdc708d55d55a890f83ec72665cd0cf2dedacc4f 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -48,11 +48,11 @@ public: LLPanelMarketplaceInbox(const Params& p = getDefaultParams()); ~LLPanelMarketplaceInbox(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; - /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg); + /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) override; - /*virtual*/ void draw(); + /*virtual*/ void draw() override; LLInventoryPanel * setupInventoryPanel(); @@ -65,7 +65,7 @@ private: void onSelectionChange(); - void onFocusReceived(); + void onFocusReceived() override; private: LLUICtrl * mFreshCountCtrl; diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 66aafe83d16f92813d30dd00d3a17110c92f3e70..f15ee17f17d016f4ed458e1940eb541b767b245b 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -46,8 +46,8 @@ public: ~LLInboxInventoryPanel(); // virtual - LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop); - LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge); + LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop) override; + LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge) override; }; @@ -65,11 +65,11 @@ public: LLInboxFolderViewFolder(const Params& p); - void addItem(LLFolderViewItem* item); - void draw(); + void addItem(LLFolderViewItem* item) override; + void draw() override; - void selectItem(); - void toggleOpen(); + void selectItem() override; + void toggleOpen() override; void computeFreshness(); void deFreshify(); @@ -95,12 +95,12 @@ public: LLInboxFolderViewItem(const Params& p); - void addToFolder(LLFolderViewFolder* folder); - BOOL handleDoubleClick(S32 x, S32 y, MASK mask); + void addToFolder(LLFolderViewFolder* folder) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; - void draw(); + void draw() override; - void selectItem(); + void selectItem() override; void computeFreshness(); void deFreshify(); diff --git a/indra/newview/llpanelme.h b/indra/newview/llpanelme.h index 60e9d4317d8ee741993093ab6bf436c0177d1e54..e08dfa8d97fb2def05862e4f71c6cc84f9102d2d 100644 --- a/indra/newview/llpanelme.h +++ b/indra/newview/llpanelme.h @@ -42,9 +42,9 @@ public: LLPanelMe(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; }; #endif // LL_LLPANELMEPROFILE_H diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index c45ac1df65c8d2a0f4fb4754f7d58a265bdfce66..1915e8c185cc1b7a5b0392353a216256fad13a4c 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -61,17 +61,17 @@ const char *CHECKERBOARD_DATA_URL = "data:image/svg+xml,%3Csvg xmlns=%22http://w //////////////////////////////////////////////////////////////////////////////// // LLPanelMediaSettingsGeneral::LLPanelMediaSettingsGeneral() : - mAutoLoop( NULL ), - mFirstClick( NULL ), - mAutoZoom( NULL ), - mAutoPlay( NULL ), - mAutoScale( NULL ), - mWidthPixels( NULL ), - mHeightPixels( NULL ), - mHomeURL( NULL ), - mCurrentURL( NULL ), - mParent( NULL ), - mMediaEditable(false) + mParent(nullptr ), + mMediaEditable(false), + mAutoLoop(nullptr ), + mFirstClick(nullptr ), + mAutoZoom(nullptr ), + mAutoPlay(nullptr ), + mAutoScale(nullptr ), + mWidthPixels(nullptr ), + mHeightPixels(nullptr ), + mHomeURL(nullptr ), + mCurrentURL(nullptr ) { // build dialog from XML buildFromFile( "panel_media_settings_general.xml"); @@ -278,7 +278,7 @@ void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& _media { LLMediaEntry::HOME_URL_KEY, self->mHomeURL, "LLLineEditor" }, { LLMediaEntry::FIRST_CLICK_INTERACT_KEY, self->mFirstClick, "LLCheckBoxCtrl" }, { LLMediaEntry::WIDTH_PIXELS_KEY, self->mWidthPixels, "LLSpinCtrl" }, - { "", NULL , "" } + { "", nullptr , "" } }; for( int i = 0; data_set[ i ].key_name.length() > 0; ++i ) @@ -357,7 +357,7 @@ void LLPanelMediaSettingsGeneral::onClose(bool app_quitting) void LLPanelMediaSettingsGeneral::checkHomeUrlPassesWhitelist() { // parent floater has not constructed the security panel yet - if ( mParent->getPanelSecurity() == 0 ) + if ( mParent->getPanelSecurity() == nullptr ) return; std::string home_url = getHomeUrl(); @@ -444,7 +444,7 @@ bool LLPanelMediaSettingsGeneral::navigateHomeSelectedFace(bool only_if_current_ struct functor_navigate_media : public LLSelectedTEGetFunctor< bool> { functor_navigate_media(bool flag) : only_if_current_is_empty(flag) {} - bool get( LLViewerObject* object, S32 face ) + bool get( LLViewerObject* object, S32 face ) override { if ( object && object->getTE(face) && object->permModify() ) { @@ -496,7 +496,7 @@ void LLPanelMediaSettingsGeneral::updateCurrentUrl() { functor_getter_current_url(const LLMediaEntry& entry): mMediaEntry(entry) {} - std::string get( LLViewerObject* object, S32 face ) + std::string get( LLViewerObject* object, S32 face ) override { if ( object ) if ( object->getTE(face) ) diff --git a/indra/newview/llpanelmediasettingsgeneral.h b/indra/newview/llpanelmediasettingsgeneral.h index 0ae1401ab23373d1fd7e52296feb5b6ef7dcfbb7..36e1fe685b7b1059ca6d98bfddbfc822b3abfcad 100644 --- a/indra/newview/llpanelmediasettingsgeneral.h +++ b/indra/newview/llpanelmediasettingsgeneral.h @@ -53,8 +53,8 @@ public: // Hook that the floater calls after applying changes to the panel void postApply(); - BOOL postBuild(); - /*virtual*/ void draw(); + BOOL postBuild() override; + /*virtual*/ void draw() override; /*virtual*/ void onClose(bool app_quitting); void setParent( LLFloaterMediaSettings* parent ); diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp index d31f3c4aac4a3c7cc0acd812dac0d5e09fefded5..85026244f452cdcf6114dff8c3fff05afddb3b58 100644 --- a/indra/newview/llpanelmediasettingspermissions.cpp +++ b/indra/newview/llpanelmediasettingspermissions.cpp @@ -48,14 +48,14 @@ //////////////////////////////////////////////////////////////////////////////// // LLPanelMediaSettingsPermissions::LLPanelMediaSettingsPermissions() : - mControls( NULL ), - mPermsOwnerInteract( 0 ), - mPermsOwnerControl( 0 ), - mPermsGroupName( 0 ), - mPermsGroupInteract( 0 ), - mPermsGroupControl( 0 ), - mPermsWorldInteract( 0 ), - mPermsWorldControl( 0 ) + mControls(nullptr ), + mPermsOwnerInteract( nullptr ), + mPermsOwnerControl( nullptr ), + mPermsGroupName( nullptr ), + mPermsGroupInteract( nullptr ), + mPermsGroupControl( nullptr ), + mPermsWorldInteract( nullptr ), + mPermsWorldControl( nullptr ) { // build dialog from XML buildFromFile( "panel_media_settings_permissions.xml"); @@ -164,7 +164,7 @@ void LLPanelMediaSettingsPermissions::initValues( void* userdata, const LLSD& me { LLPanelContents::PERMS_GROUP_CONTROL_KEY, self->mPermsGroupControl, "LLCheckBoxCtrl" }, { LLPanelContents::PERMS_ANYONE_INTERACT_KEY, self->mPermsWorldInteract, "LLCheckBoxCtrl" }, { LLPanelContents::PERMS_ANYONE_CONTROL_KEY, self->mPermsWorldControl, "LLCheckBoxCtrl" }, - { "", NULL , "" } + { "", nullptr , "" } }; for( int i = 0; data_set[ i ].key_name.length() > 0; ++i ) diff --git a/indra/newview/llpanelmediasettingspermissions.h b/indra/newview/llpanelmediasettingspermissions.h index f976720180ba0c505358dace708e69d5b0a70a65..de6ab884535b10febf62079c4b1bacb945afc0eb 100644 --- a/indra/newview/llpanelmediasettingspermissions.h +++ b/indra/newview/llpanelmediasettingspermissions.h @@ -44,8 +44,8 @@ public: LLPanelMediaSettingsPermissions(); ~LLPanelMediaSettingsPermissions(); - BOOL postBuild(); - virtual void draw(); + BOOL postBuild() override; + void draw() override; // XXX TODO: put these into a common parent class? // Hook that the floater calls before applying changes from the panel diff --git a/indra/newview/llpanelmediasettingssecurity.cpp b/indra/newview/llpanelmediasettingssecurity.cpp index e24f0793a06172c306b629edf1421bb12e05555d..5a2693d518b345c05b52604841ec545a88279a7f 100644 --- a/indra/newview/llpanelmediasettingssecurity.cpp +++ b/indra/newview/llpanelmediasettingssecurity.cpp @@ -48,7 +48,7 @@ //////////////////////////////////////////////////////////////////////////////// // LLPanelMediaSettingsSecurity::LLPanelMediaSettingsSecurity() : - mParent( NULL ) + mParent(nullptr ) { mCommitCallbackRegistrar.add("Media.whitelistAdd", boost::bind(&LLPanelMediaSettingsSecurity::onBtnAdd, this)); mCommitCallbackRegistrar.add("Media.whitelistDelete", boost::bind(&LLPanelMediaSettingsSecurity::onBtnDel, this)); @@ -102,7 +102,7 @@ void LLPanelMediaSettingsSecurity::initValues( void* userdata, const LLSD& media { { LLMediaEntry::WHITELIST_ENABLE_KEY, self->mEnableWhiteList, "LLCheckBoxCtrl" }, { LLMediaEntry::WHITELIST_KEY, self->mWhiteListList, "LLScrollListCtrl" }, - { "", NULL , "" } + { "", nullptr , "" } }; for( int i = 0; data_set[ i ].key_name.length() > 0; ++i ) diff --git a/indra/newview/llpanelmediasettingssecurity.h b/indra/newview/llpanelmediasettingssecurity.h index fe8e8435713f41bc2e256046286ecdf10d960a3a..d15bb5efc3821b77c77ff0f5630ef2a9026ffdb6 100644 --- a/indra/newview/llpanelmediasettingssecurity.h +++ b/indra/newview/llpanelmediasettingssecurity.h @@ -40,8 +40,8 @@ public: LLPanelMediaSettingsSecurity(); ~LLPanelMediaSettingsSecurity(); - BOOL postBuild(); - virtual void draw(); + BOOL postBuild() override; + void draw() override; // XXX TODO: put these into a common parent class? // Hook that the floater calls before applying changes from the panel diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index c3156a26ceb7ae449da43c45f1cb26bbe672553c..2eeaf792fff351c9651cc55f1bef9cf23f1600df 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -292,7 +292,7 @@ bool LLPanelNearByMedia::getParcelAudioAutoStart() LLScrollListItem* LLPanelNearByMedia::addListItem(const LLUUID &id) { - if (NULL == mMediaList) return NULL; + if (nullptr == mMediaList) return nullptr; // Just set up the columns -- the values will be filled in by updateListItem(). @@ -324,7 +324,7 @@ LLScrollListItem* LLPanelNearByMedia::addListItem(const LLUUID &id) } LLScrollListItem* new_item = mMediaList->addElement(row); - if (NULL != new_item) + if (nullptr != new_item) { LLScrollListCheck* scroll_list_check = dynamic_cast<LLScrollListCheck*>(new_item->getColumn(CHECKBOX_COLUMN)); if (scroll_list_check) @@ -373,7 +373,7 @@ void LLPanelNearByMedia::updateListItem(LLScrollListItem* item, LLViewerMediaImp // s += llformat("%g/", (float)impl->getCPUUsage()); // s += llformat("%g/", (float)impl->getApproximateTextureInterest()); - debug_str += llformat("%g/", (float)(NULL == impl->getSomeObject()) ? 0.0 : impl->getSomeObject()->getPixelArea()); + debug_str += llformat("%g/", (float)(nullptr == impl->getSomeObject()) ? 0.0 : impl->getSomeObject()->getPixelArea()); debug_str += LLPluginClassMedia::priorityToString(impl->getPriority()); @@ -535,7 +535,7 @@ void LLPanelNearByMedia::updateListItem(LLScrollListItem* item, void LLPanelNearByMedia::removeListItem(const LLUUID &id) { - if (NULL == mMediaList) return; + if (nullptr == mMediaList) return; mMediaList->deleteSingleItem(mMediaList->getItemIndex(id)); } @@ -559,22 +559,22 @@ void LLPanelNearByMedia::refreshParcelItems() if (gSavedSettings.getBOOL("AudioStreamingMedia") &&should_include && LLViewerMedia::hasParcelMedia()) { // Yes, there is parcel media. - if (NULL == mParcelMediaItem) + if (nullptr == mParcelMediaItem) { mParcelMediaItem = addListItem(PARCEL_MEDIA_LIST_ITEM_UUID); mMediaList->setNeedsSort(true); } } else { - if (NULL != mParcelMediaItem) { + if (nullptr != mParcelMediaItem) { removeListItem(PARCEL_MEDIA_LIST_ITEM_UUID); - mParcelMediaItem = NULL; + mParcelMediaItem = nullptr; mMediaList->setNeedsSort(true); } } // ... then update it - if (NULL != mParcelMediaItem) + if (nullptr != mParcelMediaItem) { std::string name, url, tooltip; getNameAndUrlHelper(LLViewerParcelMedia::getParcelMedia(), name, url, ""); @@ -591,9 +591,9 @@ void LLPanelNearByMedia::refreshParcelItems() mParcelMediaName, tooltip, -2, // Proximity closer than anything else, before Parcel Audio - impl == NULL || impl->isMediaDisabled(), - impl != NULL && !LLViewerParcelMedia::getURL().empty(), - impl != NULL && impl->isMediaTimeBased() && impl->isMediaPlaying(), + impl == nullptr || impl->isMediaDisabled(), + impl != nullptr && !LLViewerParcelMedia::getURL().empty(), + impl != nullptr && impl->isMediaTimeBased() && impl->isMediaPlaying(), MEDIA_CLASS_ALL, "parcel media"); } @@ -602,22 +602,22 @@ void LLPanelNearByMedia::refreshParcelItems() if (should_include && LLViewerMedia::hasParcelAudio() && gSavedSettings.getBOOL("AudioStreamingMusic")) { // Yes, there is parcel audio. - if (NULL == mParcelAudioItem) + if (nullptr == mParcelAudioItem) { mParcelAudioItem = addListItem(PARCEL_AUDIO_LIST_ITEM_UUID); mMediaList->setNeedsSort(true); } } else { - if (NULL != mParcelAudioItem) { + if (nullptr != mParcelAudioItem) { removeListItem(PARCEL_AUDIO_LIST_ITEM_UUID); - mParcelAudioItem = NULL; + mParcelAudioItem = nullptr; mMediaList->setNeedsSort(true); } } // ... then update it - if (NULL != mParcelAudioItem) + if (nullptr != mParcelAudioItem) { bool is_playing = LLViewerMedia::isParcelAudioPlaying(); @@ -654,8 +654,8 @@ void LLPanelNearByMedia::refreshList() // Clear all items so the list gets regenerated. mMediaList->deleteAllItems(); - mParcelAudioItem = NULL; - mParcelMediaItem = NULL; + mParcelAudioItem = nullptr; + mParcelMediaItem = nullptr; all_items_deleted = true; updateColumns(); @@ -1017,7 +1017,7 @@ void LLPanelNearByMedia::updateControls() } else { LLViewerMediaImpl* impl = LLViewerParcelMedia::getParcelMedia(); - if (NULL == impl) + if (nullptr == impl) { // Just means it hasn't started yet showBasicControls(false, false, false, false, 0); @@ -1043,7 +1043,7 @@ void LLPanelNearByMedia::updateControls() else { LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(selected_media_id); - if (NULL == impl || !gSavedSettings.getBOOL("AudioStreamingMedia")) + if (nullptr == impl || !gSavedSettings.getBOOL("AudioStreamingMedia")) { showDisabledControls(); } @@ -1128,7 +1128,7 @@ void LLPanelNearByMedia::onClickSelectedMediaPlay() { LLViewerMediaImpl *impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ? ((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id); - if (NULL != impl) + if (nullptr != impl) { if (impl->isMediaTimeBased() && impl->isMediaPaused()) { @@ -1157,7 +1157,7 @@ void LLPanelNearByMedia::onClickSelectedMediaPause() } else { LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(selected_media_id); - if (NULL != impl && impl->isMediaTimeBased() && impl->isMediaPlaying()) + if (nullptr != impl && impl->isMediaTimeBased() && impl->isMediaPlaying()) { impl->pause(); } @@ -1174,7 +1174,7 @@ void LLPanelNearByMedia::onClickSelectedMediaMute() else { LLViewerMediaImpl* impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ? ((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id); - if (NULL != impl) + if (nullptr != impl) { F32 volume = impl->getVolume(); if(volume > 0.0) @@ -1205,7 +1205,7 @@ void LLPanelNearByMedia::onCommitSelectedMediaVolume() else { LLViewerMediaImpl* impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ? ((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id); - if (NULL != impl) + if (nullptr != impl) { impl->setVolume(mVolumeSlider->getValueF32()); } @@ -1229,7 +1229,7 @@ void LLPanelNearByMedia::onClickSelectedMediaUnzoom() // static void LLPanelNearByMedia::getNameAndUrlHelper(LLViewerMediaImpl* impl, std::string& name, std::string & url, const std::string &defaultName) { - if (NULL == impl) return; + if (nullptr == impl) return; name = impl->getName(); url = impl->getCurrentMediaURL(); // This is the URL the media impl actually has loaded diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h index a9c1b190cfb1ae0c6f7cde07c0d7648bd087ad30..4fe9dc966574835b6706ada7b519bcde1722dd38 100644 --- a/indra/newview/llpanelnearbymedia.h +++ b/indra/newview/llpanelnearbymedia.h @@ -43,14 +43,14 @@ class LLPanelNearByMedia : public LLPanel { public: - /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); - /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); - /*virtual*/ void onTopLost(); - /*virtual*/ void onVisibilityChange ( BOOL new_visibility ); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void draw() override; + /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask) override; + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override; + /*virtual*/ void onTopLost() override; + /*virtual*/ void onVisibilityChange ( BOOL new_visibility ) override; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; // this is part of the nearby media *dialog* so we can track whether // the user *implicitly* wants audio on or off via their *explicit* diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index b70d757f799bfc6633fbedaeffb44dfbcad15692..c770c9e19b152cadf2f93096ab321564759dd967 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -292,19 +292,19 @@ BOOL LLPanelObject::postBuild() LLPanelObject::LLPanelObject() : LLPanel(), - mBtnPosCopy(NULL), - mBtnPosPaste(NULL), - mBtnScaleCopy(NULL), - mBtnScalePaste(NULL), - mBtnRotCopy(NULL), - mBtnRotPaste(NULL), + mBtnPosCopy(nullptr), + mBtnPosPaste(nullptr), + mBtnScaleCopy(nullptr), + mBtnScalePaste(nullptr), + mSizeChanged(FALSE), + mBtnRotCopy(nullptr), + mBtnRotPaste(nullptr), mIsPhysical(FALSE), mIsTemporary(FALSE), mIsPhantom(FALSE), mSelectedType(MI_BOX), mSculptTextureRevert(LLUUID::null), mSculptTypeRevert(0), - mSizeChanged(FALSE), mRegionMaxHeight(256.f), mRegionMaxDepth(0.f), mUpdateLimits(true) @@ -344,7 +344,7 @@ void LLPanelObject::getState( ) LLCalc* calcp = LLCalc::getInstance(); - LLVOVolume *volobjp = NULL; + LLVOVolume *volobjp = nullptr; if ( objectp && (objectp->getPCode() == LL_PCODE_VOLUME)) { volobjp = (LLVOVolume *)objectp; @@ -355,7 +355,7 @@ void LLPanelObject::getState( ) //forfeit focus if (gFocusMgr.childHasKeyboardFocus(this)) { - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } // Disable all text input fields @@ -367,9 +367,9 @@ void LLPanelObject::getState( ) bool is_attachment = objectp->isAttachment(); // can move or rotate only linked group with move permissions, or sub-object with move and modify perms - BOOL enable_move = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && /*!objectp->isAttachment() &&*/ (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); - BOOL enable_scale = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && objectp->permModify(); - BOOL enable_rotate = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && /*!objectp->isAttachment() &&*/ (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); + BOOL enable_move = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == nullptr) || !root_objectp->isPermanentEnforced()) && /*!objectp->isAttachment() &&*/ (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); + BOOL enable_scale = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == nullptr) || !root_objectp->isPermanentEnforced()) && objectp->permModify(); + BOOL enable_rotate = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == nullptr) || !root_objectp->isPermanentEnforced()) && /*!objectp->isAttachment() &&*/ (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )) @@ -1837,12 +1837,12 @@ void LLPanelObject::refresh() getState(); if (mObject.notNull() && mObject->isDead()) { - mObject = NULL; + mObject = nullptr; } if (mRootObject.notNull() && mRootObject->isDead()) { - mRootObject = NULL; + mRootObject = nullptr; } F32 max_scale = get_default_max_prim_scale(LLPickInfo::isFlora(mObject)); diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index 74915e70a9fc61e6f7cfe965df10ef50b1d28e0e..31d6539eb3c8814f050c9927ec53a94f6fef1db4 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -50,11 +50,11 @@ public: LLPanelObject(); virtual ~LLPanelObject(); - virtual BOOL postBuild(); - virtual void draw(); - virtual void clearCtrls(); + BOOL postBuild() override; + void draw() override; + void clearCtrls() override; - void refresh(); + void refresh() override; void refreshLimits(); static bool precommitValidate(const LLSD& data); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index d4590f3dbbafa2423ec26b91d66dc138c51db9b5..447876b6b2e3ca6eee46c43007cb4a362c494b3b 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -98,62 +98,62 @@ public: U32 flags=0); virtual ~LLTaskInvFVBridge() {} - virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } - virtual std::string getLabelSuffix() const { return LLStringUtil::null; } + LLFontGL::StyleFlags getLabelStyle() const override { return LLFontGL::NORMAL; } + std::string getLabelSuffix() const override { return LLStringUtil::null; } static LLTaskInvFVBridge* createObjectBridge(LLPanelObjectInventory* panel, LLInventoryObject* object); - void showProperties(); + void showProperties() override; void buyItem(); S32 getPrice(); static bool commitBuyItem(const LLSD& notification, const LLSD& response); // LLFolderViewModelItemInventory functionality - virtual const std::string& getName() const; - virtual const std::string& getDisplayName() const; - virtual const std::string& getSearchableName() const; - - virtual PermissionMask getPermissionMask() const { return PERM_NONE; } - /*virtual*/ LLFolderType::EType getPreferredType() const { return LLFolderType::FT_NONE; } - virtual const LLUUID& getUUID() const { return mUUID; } - virtual time_t getCreationDate() const; - virtual void setCreationDate(time_t creation_date_utc); - - virtual LLUIImagePtr getIcon() const; - virtual void openItem(); + const std::string& getName() const override; + const std::string& getDisplayName() const override; + const std::string& getSearchableName() const override; + + PermissionMask getPermissionMask() const override { return PERM_NONE; } + /*virtual*/ LLFolderType::EType getPreferredType() const override { return LLFolderType::FT_NONE; } + const LLUUID& getUUID() const override { return mUUID; } + time_t getCreationDate() const override; + void setCreationDate(time_t creation_date_utc) override; + + LLUIImagePtr getIcon() const override; + void openItem() override; virtual BOOL canOpenItem() const { return FALSE; } - virtual void closeItem() {} - virtual void selectItem() {} - virtual BOOL isItemRenameable() const; - virtual BOOL renameItem(const std::string& new_name); - virtual BOOL isItemMovable() const; - virtual BOOL isItemRemovable() const; - virtual BOOL removeItem(); - virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch); - virtual void move(LLFolderViewModelItem* parent_listener); - virtual BOOL isItemCopyable() const; - virtual BOOL copyToClipboard() const; - virtual BOOL cutToClipboard(); - virtual BOOL isClipboardPasteable() const; - virtual void pasteFromClipboard(); - virtual void pasteLinkFromClipboard(); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual void performAction(LLInventoryModel* model, std::string action); - virtual BOOL isUpToDate() const { return TRUE; } - virtual bool hasChildren() const { return FALSE; } - virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::IT_NONE; } - virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; } - virtual EInventorySortGroup getSortGroup() const { return SG_ITEM; } - virtual LLInventoryObject* getInventoryObject() const { return findInvObject(); } + void closeItem() override {} + void selectItem() override {} + BOOL isItemRenameable() const override; + BOOL renameItem(const std::string& new_name) override; + BOOL isItemMovable() const override; + BOOL isItemRemovable() const override; + BOOL removeItem() override; + void removeBatch(std::vector<LLFolderViewModelItem*>& batch) override; + void move(LLFolderViewModelItem* parent_listener) override; + BOOL isItemCopyable() const override; + BOOL copyToClipboard() const override; + BOOL cutToClipboard() override; + BOOL isClipboardPasteable() const override; + void pasteFromClipboard() override; + void pasteLinkFromClipboard() override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; + void performAction(LLInventoryModel* model, std::string action) override; + BOOL isUpToDate() const override { return TRUE; } + bool hasChildren() const override { return FALSE; } + LLInventoryType::EType getInventoryType() const override { return LLInventoryType::IT_NONE; } + LLWearableType::EType getWearableType() const override { return LLWearableType::WT_NONE; } + EInventorySortGroup getSortGroup() const override { return SG_ITEM; } + LLInventoryObject* getInventoryObject() const override { return findInvObject(); } // LLDragAndDropBridge functionality - virtual LLToolDragAndDrop::ESource getDragSource() const { return LLToolDragAndDrop::SOURCE_WORLD; } - virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const; - virtual BOOL dragOrDrop(MASK mask, BOOL drop, + LLToolDragAndDrop::ESource getDragSource() const override { return LLToolDragAndDrop::SOURCE_WORLD; } + BOOL startDrag(EDragAndDropType* type, LLUUID* id) const override; + BOOL dragOrDrop(MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, - std::string& tooltip_msg); + std::string& tooltip_msg) override; }; LLTaskInvFVBridge::LLTaskInvFVBridge( @@ -184,7 +184,7 @@ LLInventoryObject* LLTaskInvFVBridge::findInvObject() const { return object->getInventoryObject(mUUID); } - return NULL; + return nullptr; } @@ -382,7 +382,7 @@ BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name) LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if(object) { - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; item = (LLViewerInventoryItem*)object->getInventoryObject(mUUID); if(item && (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE, GOD_LIKE))) @@ -554,7 +554,7 @@ BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if(object) { - LLInventoryItem* inv = NULL; + LLInventoryItem* inv = nullptr; if((inv = (LLInventoryItem*)object->getInventoryObject(mUUID))) { const LLPermissions& perm = inv->getPermissions(); @@ -706,22 +706,22 @@ public: const LLUUID& uuid, const std::string& name); - virtual LLUIImagePtr getIcon() const; - virtual const std::string& getDisplayName() const; - virtual BOOL isItemRenameable() const; + LLUIImagePtr getIcon() const override; + const std::string& getDisplayName() const override; + BOOL isItemRenameable() const override; // virtual BOOL isItemCopyable() const { return FALSE; } - virtual BOOL renameItem(const std::string& new_name); - virtual BOOL isItemRemovable() const; - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual bool hasChildren() const; - virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const; - virtual BOOL dragOrDrop(MASK mask, BOOL drop, + BOOL renameItem(const std::string& new_name) override; + BOOL isItemRemovable() const override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; + bool hasChildren() const override; + BOOL startDrag(EDragAndDropType* type, LLUUID* id) const override; + BOOL dragOrDrop(MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, - std::string& tooltip_msg); - virtual BOOL canOpenItem() const { return TRUE; } - virtual void openItem(); - virtual EInventorySortGroup getSortGroup() const { return SG_NORMAL_FOLDER; } + std::string& tooltip_msg) override; + BOOL canOpenItem() const override { return TRUE; } + void openItem() override; + EInventorySortGroup getSortGroup() const override { return SG_NORMAL_FOLDER; } }; LLTaskCategoryBridge::LLTaskCategoryBridge( @@ -881,8 +881,8 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - virtual BOOL canOpenItem() const { return TRUE; } - virtual void openItem(); + BOOL canOpenItem() const override { return TRUE; } + void openItem() override; }; void LLTaskTextureBridge::openItem() @@ -913,10 +913,10 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - virtual BOOL canOpenItem() const { return TRUE; } - virtual void openItem(); - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); + BOOL canOpenItem() const override { return TRUE; } + void openItem() override; + void performAction(LLInventoryModel* model, std::string action) override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; static void openSoundPreview(void* data); }; @@ -1038,8 +1038,8 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - virtual BOOL isItemRenameable() const; - virtual BOOL renameItem(const std::string& new_name); + BOOL isItemRenameable() const override; + BOOL renameItem(const std::string& new_name) override; }; BOOL LLTaskCallingCardBridge::isItemRenameable() const @@ -1076,9 +1076,9 @@ public: const std::string& name) : LLTaskScriptBridge(panel, uuid, name) {} - virtual BOOL canOpenItem() const { return TRUE; } - virtual void openItem(); - virtual BOOL removeItem(); + BOOL canOpenItem() const override { return TRUE; } + void openItem() override; + BOOL removeItem() override; //virtual void buildContextMenu(LLMenuGL& menu); //static void copyToInventory(void* userdata); @@ -1141,9 +1141,9 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - virtual BOOL canOpenItem() const { return TRUE; } - virtual void openItem(); - virtual BOOL removeItem(); + BOOL canOpenItem() const override { return TRUE; } + void openItem() override; + BOOL removeItem() override; }; void LLTaskNotecardBridge::openItem() @@ -1190,9 +1190,9 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - virtual BOOL canOpenItem() const { return TRUE; } - virtual void openItem(); - virtual BOOL removeItem(); + BOOL canOpenItem() const override { return TRUE; } + void openItem() override; + BOOL removeItem() override; }; void LLTaskGestureBridge::openItem() @@ -1224,9 +1224,9 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - virtual BOOL canOpenItem() const { return TRUE; } - virtual void openItem(); - virtual BOOL removeItem(); + BOOL canOpenItem() const override { return TRUE; } + void openItem() override; + BOOL removeItem() override; }; void LLTaskAnimationBridge::openItem() @@ -1263,7 +1263,7 @@ public: U32 flags) : LLTaskInvFVBridge(panel, uuid, name, flags) {} - virtual LLUIImagePtr getIcon() const; + LLUIImagePtr getIcon() const override; }; LLUIImagePtr LLTaskWearableBridge::getIcon() const @@ -1283,10 +1283,10 @@ public: const LLUUID& uuid, const std::string& name); - virtual LLUIImagePtr getIcon() const; - virtual void openItem(); - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); + LLUIImagePtr getIcon() const override; + void openItem() override; + void performAction(LLInventoryModel* model, std::string action) override; + void buildContextMenu(LLMenuGL& menu, U32 flags) override; }; LLTaskMeshBridge::LLTaskMeshBridge( @@ -1389,9 +1389,9 @@ void LLTaskMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory* panel, LLInventoryObject* object) { - LLTaskInvFVBridge* new_bridge = NULL; + LLTaskInvFVBridge* new_bridge = nullptr; const LLInventoryItem* item = dynamic_cast<LLInventoryItem*>(object); - const U32 itemflags = ( NULL == item ? 0 : item->getFlags() ); + const U32 itemflags = (nullptr == item ? 0 : item->getFlags() ); LLAssetType::EType type = object ? object->getType() : LLAssetType::AT_CATEGORY; LLUUID object_id = object ? object->getUUID() : LLUUID::null; std::string object_name = object ? object->getName() : std::string(); @@ -1490,8 +1490,8 @@ void do_nothing() // Default constructor LLPanelObjectInventory::LLPanelObjectInventory(const LLPanelObjectInventory::Params& p) : LLPanel(p), - mScroller(NULL), - mFolders(NULL), + mScroller(nullptr), + mFolders(nullptr), mHaveInventory(FALSE), mIsInventoryEmpty(TRUE), mInventoryNeedsUpdate(FALSE), @@ -1549,8 +1549,8 @@ void LLPanelObjectInventory::clearContents() // removes mFolders removeChild( mScroller ); //*TODO: Really shouldn't do this during draw()/refresh() mScroller->die(); - mScroller = NULL; - mFolders = NULL; + mScroller = nullptr; + mFolders = nullptr; } } @@ -1571,10 +1571,10 @@ void LLPanelObjectInventory::reset() p.title = "task inventory"; p.parent_panel = this; p.tool_tip= LLTrans::getString("PanelContentsTooltip"); - p.listener = LLTaskInvFVBridge::createObjectBridge(this, NULL); + p.listener = LLTaskInvFVBridge::createObjectBridge(this, nullptr); p.folder_indentation = -14; // subtract space normally reserved for folder expanders p.view_model = &mInventoryViewModel; - p.root = NULL; + p.root = nullptr; p.options_menu = "menu_inventory.xml"; mFolders = LLUICtrlFactory::create<LLFolderView>(p); @@ -1724,7 +1724,7 @@ void LLPanelObjectInventory::createFolderViews(LLInventoryObject* inventory_root return; } // Create a visible root category. - LLTaskInvFVBridge* bridge = NULL; + LLTaskInvFVBridge* bridge = nullptr; bridge = LLTaskInvFVBridge::createObjectBridge(this, inventory_root); if(bridge) { @@ -1820,7 +1820,7 @@ void LLPanelObjectInventory::refresh() //LL_INFOS() << "LLPanelObjectInventory::refresh()" << LL_ENDL; BOOL has_inventory = FALSE; const BOOL non_root_ok = TRUE; - LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(NULL, non_root_ok); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(nullptr, non_root_ok); if(node) { LLViewerObject* object = node->getObject(); @@ -1844,7 +1844,7 @@ void LLPanelObjectInventory::refresh() clearContents(); // Register for updates from this object, - registerVOInventoryListener(object,NULL); + registerVOInventoryListener(object, nullptr); } else if (mAttachmentUUID != object->getAttachmentItemID()) { @@ -1936,8 +1936,8 @@ void LLPanelObjectInventory::draw() void LLPanelObjectInventory::deleteAllChildren() { - mScroller = NULL; - mFolders = NULL; + mScroller = nullptr; + mFolders = nullptr; LLView::deleteAllChildren(); } @@ -1945,7 +1945,7 @@ BOOL LLPanelObjectInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL dro { if (mFolders && mHaveInventory) { - LLFolderViewItem* folderp = mFolders->getNextFromChild(NULL); + LLFolderViewItem* folderp = mFolders->getNextFromChild(nullptr); if (!folderp) { return FALSE; @@ -1990,7 +1990,7 @@ void LLPanelObjectInventory::onFocusLost() // inventory no longer handles cut/copy/paste/delete if (LLEditMenuHandler::gEditMenuHandler == mFolders) { - LLEditMenuHandler::gEditMenuHandler = NULL; + LLEditMenuHandler::gEditMenuHandler = nullptr; } LLPanel::onFocusLost(); @@ -2014,7 +2014,7 @@ LLFolderViewItem* LLPanelObjectInventory::getItemByID( const LLUUID& id ) return map_it->second; } - return NULL; + return nullptr; } void LLPanelObjectInventory::removeItemID( const LLUUID& id ) diff --git a/indra/newview/llpanelobjectinventory.h b/indra/newview/llpanelobjectinventory.h index d700c8f4cfb73bf96edce26ec1c45912a1c246ab..ae05628b7c3cc726c28d3c8b4cc45f28398e577d 100644 --- a/indra/newview/llpanelobjectinventory.h +++ b/indra/newview/llpanelobjectinventory.h @@ -53,14 +53,14 @@ public: LLPanelObjectInventory(const Params&); virtual ~LLPanelObjectInventory(); - - virtual BOOL postBuild(); + + BOOL postBuild() override; LLFolderViewModelInventory& getRootViewModel() { return mInventoryViewModel; } void doToSelected(const LLSD& userdata); - void refresh(); + void refresh() override; const LLUUID& getTaskUUID() { return mTaskUUID;} void clearInventoryTask(); void removeSelectedItem(); @@ -68,12 +68,12 @@ public: LLFolderView* getRootFolder() const { return mFolders; } - virtual void draw(); - virtual void deleteAllChildren(); - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg); + void draw() override; + void deleteAllChildren() override; + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) override; - /*virtual*/ void onFocusLost(); - /*virtual*/ void onFocusReceived(); + /*virtual*/ void onFocusLost() override; + /*virtual*/ void onFocusReceived() override; static void idle(void* user_data); @@ -82,7 +82,7 @@ protected: /*virtual*/ void inventoryChanged(LLViewerObject* object, LLInventoryObject::object_list_t* inventory, S32 serial_num, - void* user_data); + void* user_data) override; void updateInventory(); void createFolderViews(LLInventoryObject* inventory_root, LLInventoryObject::object_list_t& contents); void createViewsForCategory(LLInventoryObject::object_list_t* inventory, @@ -95,7 +95,7 @@ protected: void removeItemID(const LLUUID& id); void clearItemIDs(); - BOOL handleKeyHere( KEY key, MASK mask ); + BOOL handleKeyHere( KEY key, MASK mask ) override; BOOL isSelectionRemovable(); private: diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index c6ab97d8a38f491257497339937c6bfe656641ed..88df376b2bbd638b2a3fd7be8217c056656e7f6d 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -356,7 +356,7 @@ public: virtual ~LLCOFDragAndDropObserver(); - virtual void done(); + void done() override; private: LLInventoryModel* mModel; @@ -365,7 +365,7 @@ private: inline LLCOFDragAndDropObserver::LLCOFDragAndDropObserver(LLInventoryModel* model): mModel(model) { - if (model != NULL) + if (model != nullptr) { model->addObserver(this); } @@ -373,7 +373,7 @@ inline LLCOFDragAndDropObserver::LLCOFDragAndDropObserver(LLInventoryModel* mode inline LLCOFDragAndDropObserver::~LLCOFDragAndDropObserver() { - if (mModel != NULL && mModel->containsObserver(this)) + if (mModel != nullptr && mModel->containsObserver(this)) { mModel->removeObserver(this); } @@ -504,8 +504,8 @@ BOOL LLPanelOutfitEdit::postBuild() mFilterBtn = getChild<LLButton>("filter_button"); mFilterBtn->setCommitCallback(boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this)); - childSetCommitCallback("shop_btn_1", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); - childSetCommitCallback("shop_btn_2", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); + childSetCommitCallback("shop_btn_1", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), nullptr); + childSetCommitCallback("shop_btn_2", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), nullptr); setVisibleCallback(boost::bind(&LLPanelOutfitEdit::onVisibilityChanged, this, _2)); @@ -917,9 +917,9 @@ LLPanelOutfitEdit::selection_info_t LLPanelOutfitEdit::getAddMorePanelSelectionT { selection_info_t result = std::make_pair(LLWearableType::WT_NONE, 0); - if (mAddWearablesPanel != NULL && mAddWearablesPanel->getVisible()) + if (mAddWearablesPanel != nullptr && mAddWearablesPanel->getVisible()) { - if (mInventoryItemsPanel != NULL && mInventoryItemsPanel->getVisible()) + if (mInventoryItemsPanel != nullptr && mInventoryItemsPanel->getVisible()) { std::set<LLFolderViewItem*> selected_items = mInventoryItemsPanel->getRootFolder()->getSelectionList(); @@ -930,7 +930,7 @@ LLPanelOutfitEdit::selection_info_t LLPanelOutfitEdit::getAddMorePanelSelectionT result.first = getWearableTypeByItemUUID(static_cast<LLFolderViewModelItemInventory*>((*selected_items.begin())->getViewModelItem())->getUUID()); } } - else if (mWearableItemsList != NULL && mWearableItemsList->getVisible()) + else if (mWearableItemsList != nullptr && mWearableItemsList->getVisible()) { std::vector<LLUUID> selected_uuids; mWearableItemsList->getSelectedUUIDs(selected_uuids); @@ -950,7 +950,7 @@ LLPanelOutfitEdit::selection_info_t LLPanelOutfitEdit::getAddMorePanelSelectionT LLWearableType::EType LLPanelOutfitEdit::getWearableTypeByItemUUID(const LLUUID& item_uuid) const { LLViewerInventoryItem* item = gInventory.getLinkedItem(item_uuid); - return (item != NULL) ? item->getWearableType() : LLWearableType::WT_NONE; + return (item != nullptr) ? item->getWearableType() : LLWearableType::WT_NONE; } void LLPanelOutfitEdit::onRemoveFromOutfitClicked(void) @@ -1189,7 +1189,7 @@ BOOL LLPanelOutfitEdit::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EAcceptance* accept, std::string& tooltip_msg) { - if (cargo_data == NULL) + if (cargo_data == nullptr) { LL_WARNS() << "cargo_data is NULL" << LL_ENDL; return TRUE; diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index f24d3442e696da9c4337de6cdfcbb942fb856a4b..2505977291adb5315a4909c479723262c983bc78 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -112,7 +112,7 @@ public: struct LLFilterItem { std::string displayName; LLInventoryCollectFunctor* collector; - LLFilterItem() : displayName("NONE"), collector(NULL) {} + LLFilterItem() : displayName("NONE"), collector(nullptr) {} LLFilterItem(std::string name, LLInventoryCollectFunctor* _collector) : displayName(name), collector(_collector) {} ~LLFilterItem() { delete collector; } @@ -125,8 +125,8 @@ public: LLPanelOutfitEdit(); /*virtual*/ ~LLPanelOutfitEdit(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; void moveWearable(bool closer_to_body); @@ -182,11 +182,11 @@ public: void resetAccordionState(); - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; private: void onAddMoreButtonClicked(); diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 135dd776977fc5c348c42af2aadfbebe77e70c72..5a0a2951f7815da28264140c08fa9667e2362cdd 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -54,9 +54,9 @@ static const std::string COF_TAB_NAME = "cof_tab"; static LLPanelInjector<LLPanelOutfitsInventory> t_inventory("panel_outfits_inventory"); LLPanelOutfitsInventory::LLPanelOutfitsInventory() : - mMyOutfitsPanel(NULL), - mCurrentOutfitPanel(NULL), - mActivePanel(NULL), + mActivePanel(nullptr), + mMyOutfitsPanel(nullptr), + mCurrentOutfitPanel(nullptr), mInitialized(false) { gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoaded, this)); diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 05b63ea72067d4e08182f59fd0d000ae2d5fbe81..f125b1b0bd1f7bda7611d28f32e3d56848654959 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -47,8 +47,8 @@ public: LLPanelOutfitsInventory(); virtual ~LLPanelOutfitsInventory(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; void onSearchEdit(const std::string& string); void onSave(); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 8c2493b28056c19b1ad6a75b49d2aacff0e024d9..a714b18ee9450702e300f65a3a8935403691750a 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -93,7 +93,7 @@ public: virtual ~LLAvatarItemRecentComparator() {}; protected: - virtual bool doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const + bool doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const override { LLRecentPeople& people = LLRecentPeople::instance(); const LLDate& date1 = people.getDate(avatar_item1->getAvatarId()); @@ -114,7 +114,7 @@ protected: /** * @return true if item1 < item2, false otherwise */ - virtual bool doCompare(const LLAvatarListItem* item1, const LLAvatarListItem* item2) const + bool doCompare(const LLAvatarListItem* item1, const LLAvatarListItem* item2) const override { LLAvatarTracker& at = LLAvatarTracker::instance(); bool online1 = at.isBuddyOnline(item1->getAvatarId()); @@ -161,7 +161,7 @@ public: }; protected: - virtual bool doCompare(const LLAvatarListItem* item1, const LLAvatarListItem* item2) const + bool doCompare(const LLAvatarListItem* item1, const LLAvatarListItem* item2) const override { const LLVector3d& me_pos = gAgent.getPositionGlobal(); const LLVector3d& item1_pos = mAvatarsPositions.find(item1->getAvatarId())->second; @@ -181,7 +181,7 @@ public: virtual ~LLAvatarItemRecentSpeakerComparator() {}; protected: - virtual bool doCompare(const LLAvatarListItem* item1, const LLAvatarListItem* item2) const + bool doCompare(const LLAvatarListItem* item1, const LLAvatarListItem* item2) const override { LLPointer<LLSpeaker> lhs = LLActiveSpeakerMgr::instance().findSpeaker(item1->getAvatarId()); LLPointer<LLSpeaker> rhs = LLActiveSpeakerMgr::instance().findSpeaker(item2->getAvatarId()); @@ -264,7 +264,7 @@ public: LLAvatarTracker::instance().removeObserver(this); } - /*virtual*/ void changed(U32 mask) + /*virtual*/ void changed(U32 mask) override { (void) mask; update(); @@ -275,13 +275,14 @@ class LLAvatarListUpdater : public LLPanelPeople::Updater, public LLEventTimer { public: LLAvatarListUpdater(callback_t cb, F32 period) - : LLEventTimer(period), - LLPanelPeople::Updater(cb) + : LLPanelPeople::Updater(cb), + LLEventTimer(period) { mEventTimer.stop(); } - virtual BOOL tick() // from LLEventTimer + BOOL tick() override + // from LLEventTimer { return FALSE; } @@ -318,7 +319,7 @@ public: LLAvatarTracker::instance().removeObserver(this); } - /*virtual*/ void changed(U32 mask) + /*virtual*/ void changed(U32 mask) override { if (mIsActive) { @@ -332,7 +333,7 @@ public: } - /*virtual*/ BOOL tick() + /*virtual*/ BOOL tick() override { if (!mIsActive) return FALSE; @@ -349,7 +350,7 @@ public: } // virtual - void setActive(bool active) + void setActive(bool active) override { mIsActive = active; if (active) @@ -387,7 +388,7 @@ private: { gInventory.removeObserver(this); } - /*virtual*/ void changed(U32 mask) + /*virtual*/ void changed(U32 mask) override { LL_DEBUGS() << "Inventory changed: " << mask << LL_ENDL; @@ -431,7 +432,7 @@ private: bool isDescendentOfInventoryFriends(const LLUUID& invItemID) { LLViewerInventoryItem * item = gInventory.getItem(invItemID); - if (NULL == item) + if (nullptr == item) return false; return LLFriendCardsManager::instance().isItemInAnyFriendsList(item); @@ -458,7 +459,7 @@ public: setActive(false); } - /*virtual*/ void setActive(bool val) + /*virtual*/ void setActive(bool val) override { if (val) { @@ -473,7 +474,7 @@ public: } } - /*virtual*/ BOOL tick() + /*virtual*/ BOOL tick() override { update(); return FALSE; @@ -501,27 +502,27 @@ public: LLPanelPeople::LLPanelPeople() : LLPanel(), mTryToConnectToFacebook(true), - mTabContainer(NULL), - mAccordianTabOnlineFriends(nullptr), - mAccordianTabAllFriends(nullptr), - mAccordianTabSuggestFriends(nullptr), - mOnlineFriendList(NULL), - mAllFriendList(NULL), - mSuggestedFriends(nullptr), - mNearbyList(NULL), - mRecentList(NULL), - mGroupList(NULL), - mMiniMap(NULL), + mTabContainer(nullptr), mNearbyGearBtn(nullptr), mNearbyAddFriendBtn(nullptr), mNearbyDelFriendBtn(nullptr), + mMiniMap(nullptr), + mNearbyList(nullptr), mFriendGearBtn(nullptr), mFriendsDelFriendBtn(nullptr), + mAccordianTabOnlineFriends(nullptr), + mAccordianTabAllFriends(nullptr), + mAccordianTabSuggestFriends(nullptr), + mOnlineFriendList(nullptr), + mAllFriendList(nullptr), + mSuggestedFriends(nullptr), mGroupMinusBtn(nullptr), mGroupCountText(nullptr), + mGroupList(nullptr), mRecentGearBtn(nullptr), mRecentAddFriendBtn(nullptr), - mRecentDelFriendBtn(nullptr) + mRecentDelFriendBtn(nullptr), + mRecentList(nullptr) { mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList, this)); mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList, this)); @@ -943,14 +944,14 @@ void LLPanelPeople::updateButtons() if (item_selected) { selected_id = selected_uuids.front(); - is_friend = LLAvatarTracker::instance().getBuddyInfo(selected_id) != NULL; + is_friend = LLAvatarTracker::instance().getBuddyInfo(selected_id) != nullptr; is_self = gAgent.getID() == selected_id; } else if (multiple_selected) { for (uuid_vec_t::const_iterator itr = selected_uuids.begin(); itr != selected_uuids.end(); ++itr) { - if (LLAvatarTracker::instance().getBuddyInfo(*itr) != NULL) + if (LLAvatarTracker::instance().getBuddyInfo(*itr) != nullptr) { is_friend = true; } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index a8393acff64031d1f7cfdc894bfc47503af13af8..c7ff64e016b76633f89619d168c801f1e4c3c7f7 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -52,12 +52,12 @@ public: LLPanelPeople(); virtual ~LLPanelPeople(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ bool notifyChildren(const LLSD& info); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ bool notifyChildren(const LLSD& info) override; // Implements LLVoiceClientStatusObserver::onChange() to enable call buttons // when voice is available - /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal) override; bool mTryToConnectToFacebook; diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h index e0d9785c270553cc7a051ebb767e01c135c3a786..1f355a8bc0633dce16b81dcdccd9c016443f29a7 100644 --- a/indra/newview/llpanelpeoplemenus.h +++ b/indra/newview/llpanelpeoplemenus.h @@ -38,7 +38,7 @@ namespace LLPanelPeopleMenus class PeopleContextMenu : public LLListContextMenu { public: - /*virtual*/ LLContextMenu* createMenu(); + /*virtual*/ LLContextMenu* createMenu() override; protected: virtual void buildContextMenu(class LLMenuGL& menu, U32 flags); @@ -56,7 +56,7 @@ private: class NearbyPeopleContextMenu : public PeopleContextMenu { protected: - /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags); + /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags) override; }; /** @@ -65,10 +65,10 @@ protected: class SuggestedFriendsContextMenu : public PeopleContextMenu { public: - /*virtual*/ LLContextMenu * createMenu(); + /*virtual*/ LLContextMenu * createMenu() override; protected: - /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags); + /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags) override; }; extern PeopleContextMenu gPeopleContextMenu; diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index b4ec3e383cf8749d53013a128e8f9d216d9a00f8..642b1be540a78d27c45e83bbf2d7d083e81a103b 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -336,7 +336,7 @@ void LLPanelPermissions::refresh() //BOOL attachment_selected = LLSelectMgr::getInstance()->getSelection()->isAttachment(); //attachment_selected = false; - LLViewerObject* objectp = NULL; + LLViewerObject* objectp = nullptr; if(nodep) objectp = nodep->getObject(); if(!nodep || !objectp)// || attachment_selected) { @@ -1157,7 +1157,7 @@ void LLPanelPermissions::setAllSaleInfo() struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { return object->getClickAction() == CLICK_ACTION_BUY || object->getClickAction() == CLICK_ACTION_TOUCH; @@ -1177,7 +1177,7 @@ void LLPanelPermissions::setAllSaleInfo() struct LLSelectionPayable : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* obj) + bool apply(LLViewerObject* obj) override { // can pay if you or your parent has money() event in script LLViewerObject* parent = (LLViewerObject*)obj->getParent(); @@ -1233,5 +1233,5 @@ LLViewerInventoryItem* LLPanelPermissions::findItem(LLUUID &object_id) { return gInventory.getItem(object_id); } - return NULL; + return nullptr; } diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h index b5fdd578000d9a263f916ee99bb2b855d43a8c7a..e74f9418434c694b0c6ac27459d0024e675f69eb 100644 --- a/indra/newview/llpanelpermissions.h +++ b/indra/newview/llpanelpermissions.h @@ -51,9 +51,9 @@ public: LLPanelPermissions(); virtual ~LLPanelPermissions(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; - void refresh(); // refresh all labels as needed + void refresh() override; // refresh all labels as needed protected: void onClickClaim(); diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 926d4b882b18ab03770babd4295f7b276f6c8373..ab7a3315638132e8fbd4f3ce06537231ae12be6c 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -84,15 +84,15 @@ LLPanelPickInfo::LLPanelPickInfo() : LLPanel() , LLAvatarPropertiesObserver() , LLRemoteParcelInfoObserver() + , mScrollingPanelMinHeight(0) + , mScrollingPanelWidth(0) + , mScrollContainer(nullptr) + , mScrollingPanel(nullptr) + , mSnapshotCtrl(nullptr) , mAvatarId(LLUUID::null) - , mSnapshotCtrl(NULL) - , mPickId(LLUUID::null) , mParcelId(LLUUID::null) + , mPickId(LLUUID::null) , mRequestedId(LLUUID::null) - , mScrollingPanelMinHeight(0) - , mScrollingPanelWidth(0) - , mScrollingPanel(NULL) - , mScrollContainer(NULL) { } @@ -442,7 +442,7 @@ BOOL LLPanelPickEdit::postBuild() mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelPickEdit::onSnapshotChanged, this)); LLLineEditor* line_edit = getChild<LLLineEditor>("pick_name"); - line_edit->setKeystrokeCallback(boost::bind(&LLPanelPickEdit::onPickChanged, this, _1), NULL); + line_edit->setKeystrokeCallback(boost::bind(&LLPanelPickEdit::onPickChanged, this, _1), nullptr); LLTextEditor* text_edit = getChild<LLTextEditor>("pick_desc"); text_edit->setKeystrokeCallback(boost::bind(&LLPanelPickEdit::onPickChanged, this, _1)); diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h index 7a8bd66fcfe2420a503b3be2b8a107339ed9a62e..12de72916b55374cd41f1ea39e64408eb0f5abd5 100644 --- a/indra/newview/llpanelpick.h +++ b/indra/newview/llpanelpick.h @@ -60,13 +60,13 @@ public: * By default Pick will be created for current Agent location. * Use setPickData to change Pick properties. */ - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) override; /** * Sends remote parcel info request to resolve parcel name from its ID. @@ -84,9 +84,9 @@ public: virtual void setEditPickCallback(const commit_callback_t& cb); //This stuff we got from LLRemoteParcelObserver, in the last one we intentionally do nothing - /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); - /*virtual*/ void setParcelID(const LLUUID& parcel_id) { mParcelId = parcel_id; } - /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) {}; + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data) override; + /*virtual*/ void setParcelID(const LLUUID& parcel_id) override { mParcelId = parcel_id; } + /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) override {}; protected: @@ -178,11 +178,11 @@ public: /*virtual*/ ~LLPanelPickEdit(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; virtual void setPickData(const LLPickData* pick_data); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /** * Sets "Save" button click callback @@ -197,14 +197,14 @@ public: /** * Resets panel and all cantrols to unedited state */ - /*virtual*/ void resetDirty(); + /*virtual*/ void resetDirty() override; /** * Returns true if any of Pick properties was changed by user. */ - /*virtual*/ BOOL isDirty() const; + /*virtual*/ BOOL isDirty() const override; - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) override; protected: @@ -225,7 +225,7 @@ protected: */ void onPickChanged(LLUICtrl* ctrl); - /*virtual*/ void resetData(); + /*virtual*/ void resetData() override; /** * Enables/disables "Save" button diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 6909381ef1d4fa45ef3105c38e895c67b209ec05..9b0fb88b601648104f737cc62c0b4aa9a620646c 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -75,7 +75,7 @@ public: LLPickHandler() : LLCommandHandler("pick", UNTRUSTED_THROTTLE) { } bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + LLMediaCtrl* web) override { if (!LLUI::sSettingGroups["config"]->getBOOL("EnablePicks")) { @@ -145,7 +145,7 @@ public: LLFloaterSidePanelContainer::showPanel("picks", params); } - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) override { if (APT_PICK_INFO != type) { @@ -189,7 +189,7 @@ public: std::string mRequestVerb; - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { if (!LLUI::sSettingGroups["config"]->getBOOL("EnableClassifieds")) { @@ -289,7 +289,7 @@ public: } } - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) override { if (APT_CLASSIFIED_INFO != type) { @@ -323,18 +323,18 @@ LLClassifiedHandler gClassifiedHandler; LLPanelPicks::LLPanelPicks() : LLPanelProfileTab(), mPopupMenuHandle(), - mProfilePanel(NULL), - mPickPanel(NULL), - mPicksList(NULL), - mClassifiedsList(NULL), - mPanelPickInfo(NULL), - mPanelPickEdit(NULL), + mProfilePanel(nullptr), + mPickPanel(nullptr), + mPicksList(nullptr), + mClassifiedsList(nullptr), + mPanelPickInfo(nullptr), + mPanelClassifiedInfo(nullptr), + mPanelPickEdit(nullptr), mPlusMenuHandle(), - mPicksAccTab(NULL), - mClassifiedsAccTab(NULL), - mPanelClassifiedInfo(NULL), - mNoClassifieds(false), - mNoPicks(false) + mPicksAccTab(nullptr), + mClassifiedsAccTab(nullptr), + mNoPicks(false), + mNoClassifieds(false) { } @@ -497,7 +497,7 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) LLPickItem* LLPanelPicks::getSelectedPickItem() { LLPanel* selected_item = mPicksList->getSelectedItem(); - if (!selected_item) return NULL; + if (!selected_item) return nullptr; return dynamic_cast<LLPickItem*>(selected_item); } @@ -507,7 +507,7 @@ LLClassifiedItem* LLPanelPicks::getSelectedClassifiedItem() LLPanel* selected_item = mClassifiedsList->getSelectedItem(); if (!selected_item) { - return NULL; + return nullptr; } return dynamic_cast<LLClassifiedItem*>(selected_item); } @@ -889,7 +889,7 @@ void LLPanelPicks::createNewPick() void LLPanelPicks::createNewClassified() { - LLPanelClassifiedEdit* panel = NULL; + LLPanelClassifiedEdit* panel = nullptr; createClassifiedEditPanel(&panel); getProfilePanel()->openPanel(panel, LLSD()); @@ -1166,7 +1166,7 @@ LLClassifiedItem *LLPanelPicks::findClassifiedById(const LLUUID& classified_id) // HACK - find item by classified id. Should be a better way. std::vector<LLPanel*> items; mClassifiedsList->getItems(items); - LLClassifiedItem* c_item = NULL; + LLClassifiedItem* c_item = nullptr; for(std::vector<LLPanel*>::iterator it = items.begin(); it != items.end(); ++it) { LLClassifiedItem *test_item = dynamic_cast<LLClassifiedItem*>(*it); diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 7928e1b36436081e9734a8ae6e210f32cbd46e3d..75717799942cc7bcab3e3b9130bb5a38d757eccf 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -71,15 +71,15 @@ public: static void* create(void* data); - /*virtual*/ BOOL postBuild(void); + /*virtual*/ BOOL postBuild(void) override; - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; - /*virtual*/ void onClosePanel(); + /*virtual*/ void onClosePanel() override; - void processProperties(void* data, EAvatarProcessorType type); + void processProperties(void* data, EAvatarProcessorType type) override; - void updateData(); + void updateData() override; // returns the selected pick item LLPickItem* getSelectedPickItem(); @@ -94,7 +94,7 @@ public: void createNewClassified(); protected: - /*virtual*/void updateButtons(); + /*virtual*/void updateButtons() override; private: void onClickDelete(); @@ -221,16 +221,16 @@ public: const std::string& getPickDesc() { return mPickDescription; } - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) override; void update(); ~LLPickItem(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /** setting on/off background icon to indicate selected state */ - /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void setValue(const LLSD& value) override; protected: @@ -256,11 +256,11 @@ public: virtual ~LLClassifiedItem(); - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) override; - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; - /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void setValue(const LLSD& value) override; void fillIn(LLPanelClassifiedEdit* panel); diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 6ace797911624e2c4ce3aa8768e5dfac0673574f..668040c21556fd244ab05116efde147b0b11ebfd 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -57,9 +57,9 @@ LLPanelPlaceInfo::LLPanelPlaceInfo() mScrollingPanelMinHeight(0), mScrollingPanelWidth(0), mInfoType(UNKNOWN), - mScrollingPanel(NULL), - mScrollContainer(NULL), - mDescEditor(NULL) + mScrollContainer(nullptr), + mScrollingPanel(nullptr), + mDescEditor(nullptr) {} //virtual diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index 30327378eff8c09a9d382e83ff3f7ca0881878e3..3555eacbcd0d5fe9bc72b2446f235c1d94d6cff0 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -63,7 +63,7 @@ public: LLPanelPlaceInfo(); /*virtual*/ ~LLPanelPlaceInfo(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; // Ignore all old location information, useful if you are // recycling an existing dialog and need to clear it. @@ -71,7 +71,7 @@ public: // Sends a request for data about the given parcel, which will // only update the location if there is none already available. - /*virtual*/ void setParcelID(const LLUUID& parcel_id); + /*virtual*/ void setParcelID(const LLUUID& parcel_id) override; // Depending on how the panel was triggered // (from landmark or current location, or other) @@ -86,11 +86,11 @@ public: void displayParcelInfo(const LLUUID& region_id, const LLVector3d& pos_global); - /*virtual*/ void setErrorStatus(S32 status, const std::string& reason); + /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) override; - /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data) override; - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; // Create a pick for the location specified // by global_pos. diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index f6fd57a92d7258f5a7b842ca9149390d51cbdab7..1ecb77690d27d2eee2dd8e5d75f61ae5683bb074 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -80,11 +80,11 @@ static std::string icon_see_avs_off; LLPanelPlaceProfile::LLPanelPlaceProfile() : LLPanelPlaceInfo(), - mNextCovenantUpdateTime(0), - mForSalePanel(NULL), - mYouAreHerePanel(NULL), mSelectedParcelID(-1), - mAccordionCtrl(NULL) + mNextCovenantUpdateTime(0), + mForSalePanel(nullptr), + mYouAreHerePanel(nullptr), + mAccordionCtrl(nullptr) {} // virtual @@ -284,7 +284,7 @@ void LLPanelPlaceProfile::setInfoType(EInfoType type) break; } - if (mAccordionCtrl != NULL) + if (mAccordionCtrl != nullptr) { mAccordionCtrl->expandDefaultTab(); } diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h index 3d2654fc129121cc1b5563257f83c845745243d5..6ac997ea5de26b4dcda0688c3efebf0cde397260 100644 --- a/indra/newview/llpanelplaceprofile.h +++ b/indra/newview/llpanelplaceprofile.h @@ -39,15 +39,15 @@ public: LLPanelPlaceProfile(); /*virtual*/ ~LLPanelPlaceProfile(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; - /*virtual*/ void resetLocation(); + /*virtual*/ void resetLocation() override; - /*virtual*/ void setInfoType(EInfoType type); + /*virtual*/ void setInfoType(EInfoType type) override; - /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data) override; - /*virtual*/ void onVisibilityChange(BOOL new_visibility); + /*virtual*/ void onVisibilityChange(BOOL new_visibility) override; // Displays information about the currently selected parcel // without sending a request to the server. diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index c3d1b9bc534bb05e6acb16dfb3fd930d13363e98..facdfa03ea7b96dba123957a3d4d28dc2df4690a 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -57,8 +57,8 @@ public: LLPanelPlaces(); virtual ~LLPanelPlaces(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; // Called on parcel selection change to update place information. void changedParcelSelection(); @@ -79,7 +79,7 @@ public: bool tabsCreated() { return mTabsCreated;} - /*virtual*/ S32 notifyParent(const LLSD& info); + /*virtual*/ S32 notifyParent(const LLSD& info) override; private: void onLandmarkLoaded(LLLandmark* landmark); @@ -102,7 +102,7 @@ private: void togglePickPanel(BOOL visible); void togglePlaceInfoPanel(BOOL visible); - /*virtual*/ void onVisibilityChange(BOOL new_visibility); + /*virtual*/ void onVisibilityChange(BOOL new_visibility) override; void updateVerbs(); diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 63a1493cb8f4545a4240ace21abdfeb29fe19d8f..ddf11963da2287878442e1704d740e450c293906 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -83,12 +83,15 @@ const int LLPanelPrimMediaControls::kNumZoomLevels = 2; // LLPanelPrimMediaControls::LLPanelPrimMediaControls() : - mAlpha(1.f), - mCurrentURL(""), - mPreviousURL(""), + mWindowShade(nullptr), mPauseFadeout(false), mUpdateSlider(true), mClearFaceOnFade(false), + mHideImmediately(false), + mSecureURL(false), + mAlpha(1.f), + mCurrentURL(""), + mPreviousURL(""), mCurrentRate(0.0), mMovieDuration(0.0), mTargetObjectID(LLUUID::null), @@ -97,10 +100,7 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() : mTargetObjectNormal(LLVector3::zero), mZoomObjectID(LLUUID::null), mZoomObjectFace(0), - mVolumeSliderVisible(0), - mWindowShade(NULL), - mHideImmediately(false), - mSecureURL(false), + mVolumeSliderVisible(0), mMediaPlaySliderCtrlMouseDownValue(0.0) { mCommitCallbackRegistrar.add("MediaCtrl.Close", boost::bind(&LLPanelPrimMediaControls::onClickClose, this)); @@ -288,7 +288,7 @@ LLPluginClassMedia* LLPanelPrimMediaControls::getTargetMediaPlugin() return impl->getMediaPlugin(); } - return NULL; + return nullptr; } void LLPanelPrimMediaControls::updateShape() @@ -302,7 +302,7 @@ void LLPanelPrimMediaControls::updateShape() return; } - LLPluginClassMedia* media_plugin = NULL; + LLPluginClassMedia* media_plugin = nullptr; if(media_impl->hasMedia()) { media_plugin = media_impl->getMediaPlugin(); @@ -359,11 +359,11 @@ void LLPanelPrimMediaControls::updateShape() mSecureURL = false; mCurrentURL = media_impl->getCurrentMediaURL(); - mBackCtrl->setEnabled((media_impl != NULL) && media_impl->canNavigateBack() && can_navigate); - mFwdCtrl->setEnabled((media_impl != NULL) && media_impl->canNavigateForward() && can_navigate); + mBackCtrl->setEnabled((media_impl != nullptr) && media_impl->canNavigateBack() && can_navigate); + mFwdCtrl->setEnabled((media_impl != nullptr) && media_impl->canNavigateForward() && can_navigate); mStopCtrl->setEnabled(has_focus && can_navigate); mHomeCtrl->setEnabled(has_focus && can_navigate); - LLPluginClassMediaOwner::EMediaStatus result = ((media_impl != NULL) && media_impl->hasMedia()) ? media_plugin->getStatus() : LLPluginClassMediaOwner::MEDIA_NONE; + LLPluginClassMediaOwner::EMediaStatus result = ((media_impl != nullptr) && media_impl->hasMedia()) ? media_plugin->getStatus() : LLPluginClassMediaOwner::MEDIA_NONE; mVolumeCtrl->setVisible(has_focus); mVolumeCtrl->setEnabled(has_focus); @@ -808,7 +808,7 @@ void LLPanelPrimMediaControls::draw() // draw control background UI image LLViewerObject* objectp = getTargetObject(); - LLMediaEntry *media_data(0); + LLMediaEntry *media_data(nullptr); if( objectp ) media_data = objectp->getTE(mTargetObjectFace)->getMediaData(); diff --git a/indra/newview/llpanelprimmediacontrols.h b/indra/newview/llpanelprimmediacontrols.h index 21d52360744d7e53c0f4847bccb14efb3029a5b7..e72283088031e372b93f0a4e95bad4c227b608ca 100644 --- a/indra/newview/llpanelprimmediacontrols.h +++ b/indra/newview/llpanelprimmediacontrols.h @@ -45,13 +45,13 @@ class LLPanelPrimMediaControls : public LLPanel public: LLPanelPrimMediaControls(); virtual ~LLPanelPrimMediaControls(); - /*virtual*/ BOOL postBuild(); - virtual void draw(); - virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + /*virtual*/ BOOL postBuild() override; + void draw() override; + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleKeyHere(KEY key, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleKeyHere(KEY key, MASK mask) override; void updateShape(); bool isMouseOver(); diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index df38ea393946c9a27b36bd5df567d3c95951405b..f16e16979a7bdaafb0a27be007ce85a4399d054c 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -63,7 +63,7 @@ public: LLProfileHandler() : LLCommandHandler("profile", UNTRUSTED_THROTTLE) { } bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + LLMediaCtrl* web) override { if (params.size() < 1) return false; std::string agent_name = params[0]; @@ -83,7 +83,7 @@ public: LLAgentHandler() : LLCommandHandler("agent", UNTRUSTED_THROTTLE) { } bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + LLMediaCtrl* web) override { if (params.size() < 2) return false; LLUUID avatar_id; @@ -189,7 +189,7 @@ LLAgentHandler gAgentHandler; //-- LLPanelProfile::ChildStack begins ---------------------------------------- LLPanelProfile::ChildStack::ChildStack() -: mParent(NULL) +: mParent(nullptr) { } @@ -390,7 +390,7 @@ void LLPanelProfile::onOpen(const LLSD& key) void LLPanelProfile::onTabSelected(const LLSD& param) { std::string tab_name = param.asString(); - if (NULL != getTabContainer()[tab_name]) + if (nullptr != getTabContainer()[tab_name]) { getTabContainer()[tab_name]->onOpen(getAvatarId()); } diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index d97f60ed229ab16320932951e9a13c896e9b7177..5a9ea42cb910072325eeee46d0b29e569f9604d8 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -42,15 +42,15 @@ class LLPanelProfile : public LLPanel LOG_CLASS(LLPanelProfile); public: - /*virtual*/ BOOL postBuild(); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + /*virtual*/ void onOpen(const LLSD& key) override; virtual void openPanel(LLPanel* panel, const LLSD& params); virtual void closePanel(LLPanel* panel); - S32 notifyParent(const LLSD& info); + S32 notifyParent(const LLSD& info) override; protected: diff --git a/indra/newview/llpanelprofilelegacy.h b/indra/newview/llpanelprofilelegacy.h index f78c6dcb6fb653b5c9310f5e8f36f9aa8588d034..9bbbaffe6c29be654bd55b3e9f48e54dbe309f26 100644 --- a/indra/newview/llpanelprofilelegacy.h +++ b/indra/newview/llpanelprofilelegacy.h @@ -48,9 +48,9 @@ class LLPanelProfileLegacy : public LLPanelProfileTab { public: LLPanelProfileLegacy(); - virtual BOOL postBuild(); - /* virtual */ void onOpen(const LLSD& key); - /* virtual */ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + BOOL postBuild() override; + /* virtual */ void onOpen(const LLSD& key) override; + /* virtual */ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; protected: void openPanel(LLPanel* panel, const LLSD& params); @@ -58,9 +58,9 @@ protected: private: ~LLPanelProfileLegacy(); - /* virtual */ void updateData(); - /* virtual */ void processProperties(void* data, EAvatarProcessorType type); - /* virtual */ void resetControls(); + /* virtual */ void updateData() override; + /* virtual */ void processProperties(void* data, EAvatarProcessorType type) override; + /* virtual */ void resetControls() override; void setProgress(bool started); void showAccordion(const std::string& name, bool show); void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); @@ -111,18 +111,18 @@ public: friend class LLPanelProfileLegacy; public: LLPanelProfilePicks(); - /* virtual */ BOOL postBuild(); + /* virtual */ BOOL postBuild() override; protected: - /* virtual */ void onOpen(const LLSD& key); + /* virtual */ void onOpen(const LLSD& key) override; private: - /* virtual */ void updateData(); - /* virtual */ void processProperties(void* data, EAvatarProcessorType type); - /* virtual */ void resetControls() {}; + /* virtual */ void updateData() override; + /* virtual */ void processProperties(void* data, EAvatarProcessorType type) override; + /* virtual */ void resetControls() override {}; void showAccordion(const std::string& name, bool show); void setProfilePanel(LLPanelProfileLegacy* profile_panel); LLPanelProfileLegacy* getProfilePanel(); void onPanelPickClose(LLPanel* panel); - void updateButtons(); + void updateButtons() override; void onClickInfo(); void onClickTeleport(); void onClickShowOnMap(); @@ -144,13 +144,13 @@ public: friend class LLPanelProfileLegacy; public: LLPanelProfileGroups(); - /* virtual */ BOOL postBuild(); + /* virtual */ BOOL postBuild() override; protected: - /* virtual */ void onOpen(const LLSD& key); + /* virtual */ void onOpen(const LLSD& key) override; private: - /* virtual */ void updateData(); - /* virtual */ void processProperties(void* data, EAvatarProcessorType type); - /* virtual */ void resetControls() {}; + /* virtual */ void updateData() override; + /* virtual */ void processProperties(void* data, EAvatarProcessorType type) override; + /* virtual */ void resetControls() override {}; void showGroup(const LLUUID& id); LLTextBase* mGroupsText; @@ -169,15 +169,15 @@ public: ~LLProfileGroupItem(); static LLProfileGroupItem* create(); void init(const LLAvatarGroups::LLGroupData& data); - /* virtual */ BOOL postBuild(); + /* virtual */ BOOL postBuild() override; - void setValue(const LLSD& value); + void setValue(const LLSD& value) override; void setId(const LLUUID& id); void setInsignia(const LLUUID& id); void setName(const std::string& name); void setCharter(const std::string& charter); protected: - /* virtual */ void changed(LLGroupChange gc); + /* virtual */ void changed(LLGroupChange gc) override; private: LLUUID mInsignia; std::string mGroupName; diff --git a/indra/newview/llpanelsearchbase.h b/indra/newview/llpanelsearchbase.h index 29aad0651708291b2ca1d8508c1a08231aba6046..4d7821d8aaa5ecaaa477466cf7923d925647eaa7 100644 --- a/indra/newview/llpanelsearchbase.h +++ b/indra/newview/llpanelsearchbase.h @@ -40,7 +40,7 @@ class LLPanelSearch : public LLPanel { public: LLPanelSearch(); - /* virtual */ BOOL postBuild() { return FALSE; } + /* virtual */ BOOL postBuild() override { return FALSE; } void setSearchFloater(LLFloaterDirectory* floater); protected: diff --git a/indra/newview/llpanelsearchclassifieds.h b/indra/newview/llpanelsearchclassifieds.h index 993950e7c48cf6a24f172643dc4d2ec5029a0e82..bdce2da629bb74541df0c16853b53c081aa01d3e 100644 --- a/indra/newview/llpanelsearchclassifieds.h +++ b/indra/newview/llpanelsearchclassifieds.h @@ -40,11 +40,11 @@ class LLPanelSearchClassifieds : public LLPanelSearch { public: LLPanelSearchClassifieds(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; private: - /*virtual*/ void onCommitSearch(LLUICtrl* ctrl); - /*virtual*/ void search(); + /*virtual*/ void onCommitSearch(LLUICtrl* ctrl) override; + /*virtual*/ void search() override; LLSearchEditor* mSearchEditor; LLComboBox* mClassifiedsCategory; diff --git a/indra/newview/llpanelsearchevents.h b/indra/newview/llpanelsearchevents.h index c11421fd77613c2d8e0239acf08248ae09722f7c..54667328180f3cdd9d3d2461173abf8fc3719e94 100644 --- a/indra/newview/llpanelsearchevents.h +++ b/indra/newview/llpanelsearchevents.h @@ -40,11 +40,11 @@ class LLPanelSearchEvents : public LLPanelSearch { public: LLPanelSearchEvents(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; private: - /*virtual*/ void onCommitSearch(LLUICtrl* ctrl); - /*virtual*/ void search(); + /*virtual*/ void onCommitSearch(LLUICtrl* ctrl) override; + /*virtual*/ void search() override; void setDate(S32 day); void addDay(); void minusDay(); diff --git a/indra/newview/llpanelsearchgroups.h b/indra/newview/llpanelsearchgroups.h index 160fecf4855aaa42d9180e73b6dcd05262531234..65a5a90902d6fada25b00cd01ba2da777167def1 100644 --- a/indra/newview/llpanelsearchgroups.h +++ b/indra/newview/llpanelsearchgroups.h @@ -39,11 +39,11 @@ class LLPanelSearchGroups : public LLPanelSearch { public: LLPanelSearchGroups(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; private: - /*virtual*/ void onCommitSearch(LLUICtrl* ctrl); - /*virtual*/ void search(); + /*virtual*/ void onCommitSearch(LLUICtrl* ctrl) override; + /*virtual*/ void search() override; LLSearchEditor* mSearchEditor; }; diff --git a/indra/newview/llpanelsearchlandsales.h b/indra/newview/llpanelsearchlandsales.h index 0ade87ed6f4f1e04af3cc17f2305de1c8e2528a8..64b57b225b60f4955634cac6910d03f3f97803b0 100644 --- a/indra/newview/llpanelsearchlandsales.h +++ b/indra/newview/llpanelsearchlandsales.h @@ -37,11 +37,11 @@ class LLPanelSearchLandSales : public LLPanelSearch { public: LLPanelSearchLandSales(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; private: - /*virtual*/ void search(); - /*virtual*/ void onCommitSearch(LLUICtrl* ctrl); + /*virtual*/ void search() override; + /*virtual*/ void onCommitSearch(LLUICtrl* ctrl) override; }; #endif // LL_PANELSEARCHLANDSALES_H diff --git a/indra/newview/llpanelsearchpeople.h b/indra/newview/llpanelsearchpeople.h index f3009945ca29b06d00b2e0c2cddbcea0048b09a4..c437292fb9ae669833ec4ff6ae91dc8b565ce296 100644 --- a/indra/newview/llpanelsearchpeople.h +++ b/indra/newview/llpanelsearchpeople.h @@ -39,11 +39,11 @@ class LLPanelSearchPeople : public LLPanelSearch { public: LLPanelSearchPeople(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; private: - /*virtual*/ void onCommitSearch(LLUICtrl* ctrl); - /*virtual*/ void search(); + /*virtual*/ void onCommitSearch(LLUICtrl* ctrl) override; + /*virtual*/ void search() override; LLSearchEditor* mSearchEditor; }; diff --git a/indra/newview/llpanelsearchplaces.h b/indra/newview/llpanelsearchplaces.h index 4614ad7a4217bc88e55da21cadc7915ef4b57b63..5d2f6f7f058b8bfa51425eeff574c5c5aa25e831 100644 --- a/indra/newview/llpanelsearchplaces.h +++ b/indra/newview/llpanelsearchplaces.h @@ -40,11 +40,11 @@ class LLPanelSearchPlaces : public LLPanelSearch { public: LLPanelSearchPlaces(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; private: - /*virtual*/ void onCommitSearch(LLUICtrl* ctrl); - /*virtual*/ void search(); + /*virtual*/ void onCommitSearch(LLUICtrl* ctrl) override; + /*virtual*/ void search() override; LLSearchEditor* mSearchEditor; LLComboBox* mPlacesCategory; diff --git a/indra/newview/llpanelsearchweb.cpp b/indra/newview/llpanelsearchweb.cpp index 4cfa06aa4c71280cc7e034d088a7e20312ffc59a..7f2a495c94981891cdee7ed8c22165309bb925a6 100644 --- a/indra/newview/llpanelsearchweb.cpp +++ b/indra/newview/llpanelsearchweb.cpp @@ -48,13 +48,13 @@ static LLPanelInjector<LLPanelSearchWeb> t_panel_search_web("panel_search_web"); LLPanelSearchWeb::LLPanelSearchWeb() : LLPanel() -, mWebBrowser(nullptr) , mStatusBarText(nullptr) , mStatusBarProgress(nullptr) , mBtnBack(nullptr) , mBtnForward(nullptr) , mBtnReload(nullptr) , mBtnStop(nullptr) +, mWebBrowser(nullptr) { mCategoryPaths = LLSD::emptyMap(); mCategoryPaths["all"] = "search"; diff --git a/indra/newview/llpanelsearchweb.h b/indra/newview/llpanelsearchweb.h index b76fdf288b92702152bf9060b700f4d743b77bb9..4f5695106908d5536e4b41192236d12f09301285 100644 --- a/indra/newview/llpanelsearchweb.h +++ b/indra/newview/llpanelsearchweb.h @@ -43,7 +43,7 @@ class LLPanelSearchWeb : public LLPanel, public LLViewerMediaObserver { public: LLPanelSearchWeb(); - BOOL postBuild(); + BOOL postBuild() override; void loadUrl(const SearchQuery& query); private: @@ -52,7 +52,7 @@ private: void onClickForward(); void onClickReload(); void onClickStop(); - /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; LLTextBox* mStatusBarText; LLProgressBar* mStatusBarProgress; diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp index 0bf4bb2cb66c068bab13f7d1ebe07f1f461cda02..af49ebf81e7a21317ea537d4ec8cb32b6f4e884a 100644 --- a/indra/newview/llpanelsnapshot.cpp +++ b/indra/newview/llpanelsnapshot.cpp @@ -55,7 +55,7 @@ S32 power_of_two(S32 sz, S32 upper) } LLPanelSnapshot::LLPanelSnapshot() - : mSnapshotFloater(NULL) + : mSnapshotFloater(nullptr) {} // virtual @@ -144,7 +144,7 @@ LLSideTrayPanelContainer* LLPanelSnapshot::getParentContainer() if (!parent) { LL_WARNS() << "Cannot find panel container" << LL_ENDL; - return NULL; + return nullptr; } return parent; diff --git a/indra/newview/llpanelsnapshot.h b/indra/newview/llpanelsnapshot.h index 55273797cc04e5a4948caf50a69b8fadb53892b0..f7b438b412b44c61867cbfd6fe38ed61742e16b9 100644 --- a/indra/newview/llpanelsnapshot.h +++ b/indra/newview/llpanelsnapshot.h @@ -43,8 +43,8 @@ class LLPanelSnapshot: public LLPanel public: LLPanelSnapshot(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; virtual std::string getWidthSpinnerName() const = 0; virtual std::string getHeightSpinnerName() const = 0; diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp index 20f4125a348278a207f79067e602455f85a466aa..09cbdc0751dba3b9dd0796f87eac779bb9308385 100644 --- a/indra/newview/llpanelsnapshotinventory.cpp +++ b/indra/newview/llpanelsnapshotinventory.cpp @@ -51,10 +51,10 @@ class LLPanelSnapshotInventoryBase public: LLPanelSnapshotInventoryBase(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; protected: void onSend(); - /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType(); + /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType() override; }; class LLPanelSnapshotInventory @@ -64,18 +64,18 @@ class LLPanelSnapshotInventory public: LLPanelSnapshotInventory(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; void onResolutionCommit(LLUICtrl* ctrl); private: - /*virtual*/ std::string getWidthSpinnerName() const { return "inventory_snapshot_width"; } - /*virtual*/ std::string getHeightSpinnerName() const { return "inventory_snapshot_height"; } - /*virtual*/ std::string getAspectRatioCBName() const { return "inventory_keep_aspect_check"; } - /*virtual*/ std::string getImageSizeComboName() const { return "texture_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return LLStringUtil::null; } - /*virtual*/ void updateControls(const LLSD& info); + /*virtual*/ std::string getWidthSpinnerName() const override { return "inventory_snapshot_width"; } + /*virtual*/ std::string getHeightSpinnerName() const override { return "inventory_snapshot_height"; } + /*virtual*/ std::string getAspectRatioCBName() const override { return "inventory_keep_aspect_check"; } + /*virtual*/ std::string getImageSizeComboName() const override { return "texture_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const override { return LLStringUtil::null; } + /*virtual*/ void updateControls(const LLSD& info) override; }; @@ -86,18 +86,18 @@ class LLPanelOutfitSnapshotInventory public: LLPanelOutfitSnapshotInventory(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; private: - /*virtual*/ std::string getWidthSpinnerName() const { return ""; } - /*virtual*/ std::string getHeightSpinnerName() const { return ""; } - /*virtual*/ std::string getAspectRatioCBName() const { return ""; } - /*virtual*/ std::string getImageSizeComboName() const { return "texture_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return LLStringUtil::null; } - /*virtual*/ void updateControls(const LLSD& info); - - /*virtual*/ void cancel(); + /*virtual*/ std::string getWidthSpinnerName() const override { return ""; } + /*virtual*/ std::string getHeightSpinnerName() const override { return ""; } + /*virtual*/ std::string getAspectRatioCBName() const override { return ""; } + /*virtual*/ std::string getImageSizeComboName() const override { return "texture_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const override { return LLStringUtil::null; } + /*virtual*/ void updateControls(const LLSD& info) override; + + /*virtual*/ void cancel() override; }; static LLPanelInjector<LLPanelSnapshotInventory> panel_class1("llpanelsnapshotinventory"); diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp index ed3f9058fcf484cf6c12242d07c7c3d8b47d1d9e..aa793b37b241af0f92a765b354e821e1e0eef118 100644 --- a/indra/newview/llpanelsnapshotlocal.cpp +++ b/indra/newview/llpanelsnapshotlocal.cpp @@ -49,18 +49,18 @@ class LLPanelSnapshotLocal public: LLPanelSnapshotLocal(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; private: - /*virtual*/ std::string getWidthSpinnerName() const { return "local_snapshot_width"; } - /*virtual*/ std::string getHeightSpinnerName() const { return "local_snapshot_height"; } - /*virtual*/ std::string getAspectRatioCBName() const { return "local_keep_aspect_check"; } - /*virtual*/ std::string getImageSizeComboName() const { return "local_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return "local_image_size_lp"; } - /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const; - /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType(); - /*virtual*/ void updateControls(const LLSD& info); + /*virtual*/ std::string getWidthSpinnerName() const override { return "local_snapshot_width"; } + /*virtual*/ std::string getHeightSpinnerName() const override { return "local_snapshot_height"; } + /*virtual*/ std::string getAspectRatioCBName() const override { return "local_keep_aspect_check"; } + /*virtual*/ std::string getImageSizeComboName() const override { return "local_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const override { return "local_image_size_lp"; } + /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const override; + /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType() override; + /*virtual*/ void updateControls(const LLSD& info) override; S32 mLocalFormat; diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp index 45b60da6f33d0970b57784a30719dd340e920464..3b9c14dbe4f6dc284ba8f8a00d8eec336286ba1e 100644 --- a/indra/newview/llpanelsnapshotoptions.cpp +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -50,9 +50,9 @@ class LLPanelSnapshotOptions public: LLPanelSnapshotOptions(); ~LLPanelSnapshotOptions(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onEconomyDataChange() { updateUploadCost(); } + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void onEconomyDataChange() override { updateUploadCost(); } private: void updateUploadCost(); diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp index a72ee27e2a81a65d9b99a82f8cc2cba2033936f0..133cae4b999aeb65689f328c2d025e71ec66c605 100644 --- a/indra/newview/llpanelsnapshotpostcard.cpp +++ b/indra/newview/llpanelsnapshotpostcard.cpp @@ -57,18 +57,18 @@ class LLPanelSnapshotPostcard public: LLPanelSnapshotPostcard(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; private: - /*virtual*/ std::string getWidthSpinnerName() const { return "postcard_snapshot_width"; } - /*virtual*/ std::string getHeightSpinnerName() const { return "postcard_snapshot_height"; } - /*virtual*/ std::string getAspectRatioCBName() const { return "postcard_keep_aspect_check"; } - /*virtual*/ std::string getImageSizeComboName() const { return "postcard_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return "postcard_image_size_lp"; } - /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const { return LLSnapshotModel::SNAPSHOT_FORMAT_JPEG; } - /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType(); - /*virtual*/ void updateControls(const LLSD& info); + /*virtual*/ std::string getWidthSpinnerName() const override { return "postcard_snapshot_width"; } + /*virtual*/ std::string getHeightSpinnerName() const override { return "postcard_snapshot_height"; } + /*virtual*/ std::string getAspectRatioCBName() const override { return "postcard_keep_aspect_check"; } + /*virtual*/ std::string getImageSizeComboName() const override { return "postcard_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const override { return "postcard_image_size_lp"; } + /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const override { return LLSnapshotModel::SNAPSHOT_FORMAT_JPEG; } + /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType() override; + /*virtual*/ void updateControls(const LLSD& info) override; bool missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response); static void sendPostcardFinished(LLSD result); diff --git a/indra/newview/llpanelsnapshotprofile.cpp b/indra/newview/llpanelsnapshotprofile.cpp index 255d8f75f23e22ef6f56b35036c93a294ff1899a..4352c77b085be133bbb7da02d60892dbfc90688c 100644 --- a/indra/newview/llpanelsnapshotprofile.cpp +++ b/indra/newview/llpanelsnapshotprofile.cpp @@ -51,17 +51,17 @@ class LLPanelSnapshotProfile public: LLPanelSnapshotProfile(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; private: - /*virtual*/ std::string getWidthSpinnerName() const { return "profile_snapshot_width"; } - /*virtual*/ std::string getHeightSpinnerName() const { return "profile_snapshot_height"; } - /*virtual*/ std::string getAspectRatioCBName() const { return "profile_keep_aspect_check"; } - /*virtual*/ std::string getImageSizeComboName() const { return "profile_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return "profile_image_size_lp"; } - /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const { return LLSnapshotModel::SNAPSHOT_FORMAT_PNG; } - /*virtual*/ void updateControls(const LLSD& info); + /*virtual*/ std::string getWidthSpinnerName() const override { return "profile_snapshot_width"; } + /*virtual*/ std::string getHeightSpinnerName() const override { return "profile_snapshot_height"; } + /*virtual*/ std::string getAspectRatioCBName() const override { return "profile_keep_aspect_check"; } + /*virtual*/ std::string getImageSizeComboName() const override { return "profile_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const override { return "profile_image_size_lp"; } + /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const override { return LLSnapshotModel::SNAPSHOT_FORMAT_PNG; } + /*virtual*/ void updateControls(const LLSD& info) override; void onSend(); }; diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 335df851fa093733a6e714089589dd941c2e57fd..e877e33f32cf79ca9dfb1d9dd25c58c50dfd58a6 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -62,9 +62,9 @@ public: LLDate date, const std::string &hl); virtual ~LLTeleportHistoryFlatItem(); - virtual BOOL postBuild(); + BOOL postBuild() override; - /*virtual*/ S32 notify(const LLSD& info); + /*virtual*/ S32 notify(const LLSD& info) override; S32 getIndex() { return mIndex; } void setIndex(S32 index) { mIndex = index; } @@ -76,11 +76,11 @@ public: void updateTimestamp(); std::string getTimestamp(); - /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void setValue(const LLSD& value) override; - void onMouseEnter(S32 x, S32 y, MASK mask); - void onMouseLeave(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + void onMouseEnter(S32 x, S32 y, MASK mask) override; + void onMouseLeave(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; static void showPlaceInfoPanel(S32 index); @@ -135,11 +135,11 @@ private: LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name, LLDate date, const std::string &hl) : LLPanel(), - mIndex(index), mContextMenu(context_menu), + mIndex(index), mRegionName(region_name), - mDate(date), - mHighlight(hl) + mHighlight(hl), + mDate(date) { buildFromFile( "panel_teleport_history_item.xml"); } @@ -170,9 +170,9 @@ S32 LLTeleportHistoryFlatItem::notify(const LLSD& info) if(info.has("detach")) { delete mMouseDownSignal; - mMouseDownSignal = NULL; + mMouseDownSignal = nullptr; delete mRightMouseDownSignal; - mRightMouseDownSignal = NULL; + mRightMouseDownSignal = nullptr; return 1; } return 0; @@ -299,11 +299,11 @@ LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem ( const S32 cur_item_index, const std::string &hl) { - LLTeleportHistoryFlatItem* item = NULL; + LLTeleportHistoryFlatItem* item = nullptr; if ( cur_item_index < (S32) mItems.size() ) { item = mItems[cur_item_index].get(); - if (item->getParent() == NULL) + if (item->getParent() == nullptr) { item->setIndex(cur_item_index); item->setRegionName(persistent_item.mTitle); @@ -316,7 +316,7 @@ LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem ( else { // Item already added to parent - item = NULL; + item = nullptr; } } @@ -355,7 +355,7 @@ void LLTeleportHistoryFlatItemStorage::purge() it != it_end; ++it ) { LLHandle <LLTeleportHistoryFlatItem> item_handle = *it; - if ( !item_handle.isDead() && item_handle.get()->getParent() == NULL ) + if ( !item_handle.isDead() && item_handle.get()->getParent() == nullptr ) { item_handle.get()->die(); } @@ -448,14 +448,14 @@ void LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard() LLTeleportHistoryPanel::LLTeleportHistoryPanel() : LLPanelPlacesTab(), + mTeleportHistory(nullptr), + mHistoryAccordion(nullptr), + mLastSelectedFlatlList(nullptr), + mLastSelectedItemIndex(-1), mDirty(true), mCurrentItem(0), - mTeleportHistory(NULL), - mHistoryAccordion(NULL), mAccordionTabMenuHandle(), - mLastSelectedFlatlList(NULL), - mLastSelectedItemIndex(-1), - mMenuGearButton(NULL) + mMenuGearButton(nullptr) { buildFromFile( "panel_teleport_history.xml"); } @@ -648,9 +648,9 @@ void LLTeleportHistoryPanel::updateVerbs() LLTeleportHistoryFlatItem* itemp = dynamic_cast<LLTeleportHistoryFlatItem *> (mLastSelectedFlatlList->getSelectedItem()); - mTeleportBtn->setEnabled(NULL != itemp); - mShowProfile->setEnabled(NULL != itemp); - mShowOnMapBtn->setEnabled(NULL != itemp); + mTeleportBtn->setEnabled(nullptr != itemp); + mShowProfile->setEnabled(nullptr != itemp); + mShowOnMapBtn->setEnabled(nullptr != itemp); } void LLTeleportHistoryPanel::getNextTab(const LLDate& item_date, S32& tab_idx, LLDate& tab_date) @@ -725,7 +725,7 @@ void LLTeleportHistoryPanel::refresh() // That leads to call to getNextTab to get right tab_idx in first pass LLDate tab_boundary_date = LLDate::now(); - LLFlatListView* curr_flat_view = NULL; + LLFlatListView* curr_flat_view = nullptr; std::string filter_string = sFilterSubString; LLStringUtil::toUpper(filter_string); @@ -838,7 +838,7 @@ void LLTeleportHistoryPanel::onTeleportHistoryChange(S32 removed_index) void LLTeleportHistoryPanel::replaceItem(S32 removed_index) { // Flat list for 'Today' (mItemContainers keeps accordion tabs in reverse order) - LLFlatListView* fv = NULL; + LLFlatListView* fv = nullptr; if (mItemContainers.size() > 0) { @@ -1089,7 +1089,7 @@ LLFlatListView* LLTeleportHistoryPanel::getFlatListViewFromTab(LLAccordionCtrlTa } } - return NULL; + return nullptr; } bool LLTeleportHistoryPanel::isActionEnabled(const LLSD& userdata) const diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h index cc3be7c841f84346094a43763028afd78b145b70..613a5fe110f21854a3b16a26061d2aaa89e27e60 100644 --- a/indra/newview/llpanelteleporthistory.h +++ b/indra/newview/llpanelteleporthistory.h @@ -63,16 +63,16 @@ public: LLTeleportHistoryPanel(); virtual ~LLTeleportHistoryPanel(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void draw() override; - /*virtual*/ void onSearchEdit(const std::string& string); - /*virtual*/ void onShowOnMap(); - /*virtual*/ void onShowProfile(); - /*virtual*/ void onTeleport(); + /*virtual*/ void onSearchEdit(const std::string& string) override; + /*virtual*/ void onShowOnMap() override; + /*virtual*/ void onShowProfile() override; + /*virtual*/ void onTeleport() override; ///*virtual*/ void onCopySLURL(); - /*virtual*/ void updateVerbs(); - /*virtual*/ bool isSingleItemSelected(); + /*virtual*/ void updateVerbs() override; + /*virtual*/ bool isSingleItemSelected() override; private: @@ -86,7 +86,7 @@ private: void onClearTeleportHistory(); bool onClearTeleportHistoryDialog(const LLSD& notification, const LLSD& response); - void refresh(); + void refresh() override; void getNextTab(const LLDate& item_date, S32& curr_tab, LLDate& tab_date); void onTeleportHistoryChange(S32 removed_index); void replaceItem(S32 removed_index); diff --git a/indra/newview/llpaneltiptoast.cpp b/indra/newview/llpaneltiptoast.cpp index 84b0c7acd4f4e210bf7527934d7f325633f3474b..1f24fde06af8418b47b2819bc5bc2355fb539352 100644 --- a/indra/newview/llpaneltiptoast.cpp +++ b/indra/newview/llpaneltiptoast.cpp @@ -34,7 +34,7 @@ BOOL LLPanelTipToast::postBuild() { mMessageText= findChild<LLUICtrl>("message"); - if (mMessageText != NULL) + if (mMessageText != nullptr) { mMessageText->setMouseUpCallback(boost::bind(&LLPanelTipToast::onMessageTextClick,this)); setMouseUpCallback(boost::bind(&LLPanelTipToast::onPanelClick, this, _2, _3, _4)); diff --git a/indra/newview/llpaneltiptoast.h b/indra/newview/llpaneltiptoast.h index 2e9fd6b7aacdcae5ad11a2286ea4c553b621b6ac..be38e38df03637e3155916caf12a631d43fb0391 100644 --- a/indra/newview/llpaneltiptoast.h +++ b/indra/newview/llpaneltiptoast.h @@ -39,7 +39,7 @@ class LLPanelTipToast : public LLToastPanel LOG_CLASS(LLPanelTipToast); public: LLPanelTipToast(const LLNotificationPtr& notification) : LLToastPanel(notification), mMessageText(nullptr) {} - virtual BOOL postBuild(); + BOOL postBuild() override; private: void onMessageTextClick(); void onPanelClick(S32 x, S32 y, MASK mask); diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index af4dd9be16b29026ce3fcb6bfcca4fa2716f8534..417b702929c7ca8299de56cdf2e4a3bc0f7f0a1d 100644 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -54,7 +54,7 @@ public: LLParcelChangeObserver(LLPanelTopInfoBar* topInfoBar) : mTopInfoBar(topInfoBar) {} private: - /*virtual*/ void changed() + /*virtual*/ void changed() override { if (mTopInfoBar) { @@ -65,7 +65,7 @@ private: LLPanelTopInfoBar* mTopInfoBar; }; -LLPanelTopInfoBar::LLPanelTopInfoBar(): mParcelChangedObserver(0) +LLPanelTopInfoBar::LLPanelTopInfoBar(): mParcelChangedObserver(nullptr) { buildFromFile( "panel_topinfo_bar.xml"); } @@ -457,7 +457,7 @@ void LLPanelTopInfoBar::onContextMenuItemClicked(const LLSD::String& item) { LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); - if(landmark == NULL) + if(landmark == nullptr) { LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); } diff --git a/indra/newview/llpaneltopinfobar.h b/indra/newview/llpaneltopinfobar.h index 78dd99702906f95f2f32bc6aa0045d838ceb6dbb..b6c263e33157fc1386baccec0d0d2b68b256ac1f 100644 --- a/indra/newview/llpaneltopinfobar.h +++ b/indra/newview/llpaneltopinfobar.h @@ -46,8 +46,8 @@ class LLPanelTopInfoBar : public LLPanel, public LLSingleton<LLPanelTopInfoBar>, public: typedef boost::signals2::signal<void ()> resize_signal_t; - /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void draw() override; /** * Updates location and parcel icons on login complete @@ -83,7 +83,7 @@ private: */ void initParcelIcons(); - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; /** * Handles clicks on the parcel icons. diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp index 95f5a8779a0c3e34fce36ec1bf22011957c039e8..6295380faf3ebfdd0f22d2a30af64b03254b829a 100644 --- a/indra/newview/llpanelvoicedevicesettings.cpp +++ b/indra/newview/llpanelvoicedevicesettings.cpp @@ -46,8 +46,8 @@ static const std::string DEFAULT_DEVICE("Default"); LLPanelVoiceDeviceSettings::LLPanelVoiceDeviceSettings() : LLPanel() { - mCtrlInputDevices = NULL; - mCtrlOutputDevices = NULL; + mCtrlInputDevices = nullptr; + mCtrlOutputDevices = nullptr; mInputDevice = gSavedSettings.getString("VoiceInputAudioDevice"); mOutputDevice = gSavedSettings.getString("VoiceOutputAudioDevice"); mDevicesUpdated = FALSE; //obsolete diff --git a/indra/newview/llpanelvoicedevicesettings.h b/indra/newview/llpanelvoicedevicesettings.h index 355bc02b05473627abea9311b615d09da5dfc62d..17df31286d431877e8dbe0c211b9f2502fcfa9b4 100644 --- a/indra/newview/llpanelvoicedevicesettings.h +++ b/indra/newview/llpanelvoicedevicesettings.h @@ -36,15 +36,15 @@ public: LLPanelVoiceDeviceSettings(); ~LLPanelVoiceDeviceSettings(); - /*virtual*/ void draw(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ void draw() override; + /*virtual*/ BOOL postBuild() override; void apply(); void cancel(); - void refresh(); + void refresh() override; void initialize(); void cleanup(); - /*virtual*/ void onVisibilityChange ( BOOL new_visibility ); + /*virtual*/ void onVisibilityChange ( BOOL new_visibility ) override; void setUseTuningMode(bool use) { mUseTuningMode = use; }; diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index ede5384e62696ce6cd3ad568baf4d0864ff36295..e953f36c78d483665cbadae84a2cf1ba9803a2d1 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -42,7 +42,7 @@ static LLPanelInjector<LLPanelVoiceEffect> t_panel_voice_effect("panel_voice_effect"); LLPanelVoiceEffect::LLPanelVoiceEffect() - : mVoiceEffectCombo(NULL) + : mVoiceEffectCombo(nullptr) { mCommitCallbackRegistrar.add("Voice.CommitVoiceEffect", boost::bind(&LLPanelVoiceEffect::onCommitVoiceEffect, this)); } diff --git a/indra/newview/llpanelvoiceeffect.h b/indra/newview/llpanelvoiceeffect.h index bba525e1df2639e58369000f19a7cc6dfc5e9025..80f8c5d22f06facbcacd31349cc76c5971d70b21 100644 --- a/indra/newview/llpanelvoiceeffect.h +++ b/indra/newview/llpanelvoiceeffect.h @@ -43,14 +43,14 @@ public: LLPanelVoiceEffect(); virtual ~LLPanelVoiceEffect(); - virtual BOOL postBuild(); + BOOL postBuild() override; private: void onCommitVoiceEffect(); void update(bool list_updated); /// Called by voice effect provider when voice effect list is changed. - virtual void onVoiceEffectChanged(bool effect_list_updated); + void onVoiceEffectChanged(bool effect_list_updated) override; // Fixed entries in the Voice Morph list typedef enum e_voice_effect_combo_items diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 1782cca805561dd107da4dfb4e521c0cffd205ff..9569f3d78718c955cdd864755424d3ee97c07c3f 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -246,7 +246,7 @@ void LLPanelVolume::getState( ) } } - LLVOVolume *volobjp = NULL; + LLVOVolume *volobjp = nullptr; if ( objectp && (objectp->getPCode() == LL_PCODE_VOLUME)) { volobjp = (LLVOVolume *)objectp; @@ -257,7 +257,7 @@ void LLPanelVolume::getState( ) //forfeit focus if (gFocusMgr.childHasKeyboardFocus(this)) { - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } // Disable all text input fields @@ -420,7 +420,7 @@ void LLPanelVolume::getState( ) U8 material_code = 0; struct f : public LLSelectedTEGetFunctor<U8> { - U8 get(LLViewerObject* object, S32 te) + U8 get(LLViewerObject* object, S32 te) override { return object->getMaterial(); } @@ -499,7 +499,7 @@ void LLPanelVolume::getState( ) mComboPhysicsShapeType->add(getString("Convex Hull"), LLSD(2)); mComboPhysicsShapeType->setValue(LLSD(objectp->getPhysicsShapeType())); - mComboPhysicsShapeType->setEnabled(editable && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced())); + mComboPhysicsShapeType->setEnabled(editable && !objectp->isPermanentEnforced() && ((root_objectp == nullptr) || !root_objectp->isPermanentEnforced())); mObject = objectp; mRootObject = root_objectp; @@ -510,12 +510,12 @@ void LLPanelVolume::refresh() getState(); if (mObject.notNull() && mObject->isDead()) { - mObject = NULL; + mObject = nullptr; } if (mRootObject.notNull() && mRootObject->isDead()) { - mRootObject = NULL; + mRootObject = nullptr; } BOOL visible = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 0 ? TRUE : FALSE; diff --git a/indra/newview/llpanelvolume.h b/indra/newview/llpanelvolume.h index 9965339a2742662800c8c7059fc3f30ac4e20e6a..9b341bbcd07b236587e2ecaaf668b0c0bcd6d3f8 100644 --- a/indra/newview/llpanelvolume.h +++ b/indra/newview/llpanelvolume.h @@ -48,12 +48,12 @@ public: LLPanelVolume(); virtual ~LLPanelVolume(); - virtual void draw(); - virtual void clearCtrls(); + void draw() override; + void clearCtrls() override; - virtual BOOL postBuild(); + BOOL postBuild() override; - void refresh(); + void refresh() override; void sendIsLight(); void sendIsFlexible(); diff --git a/indra/newview/llpanelvolumepulldown.h b/indra/newview/llpanelvolumepulldown.h index f39e9bb80504e449645965c045a3fc178afdea8d..b672f0db574d8fb9645d7e165385f72945c5f84a 100644 --- a/indra/newview/llpanelvolumepulldown.h +++ b/indra/newview/llpanelvolumepulldown.h @@ -36,12 +36,12 @@ class LLPanelVolumePulldown : public LLPanel { public: LLPanelVolumePulldown(); - /*virtual*/ void draw(); - /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); - /*virtual*/ void onTopLost(); - /*virtual*/ void onVisibilityChange ( BOOL new_visibility ); - /*virtual*/ BOOL postBuild(); + /*virtual*/ void draw() override; + /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask) override; + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override; + /*virtual*/ void onTopLost() override; + /*virtual*/ void onVisibilityChange ( BOOL new_visibility ) override; + /*virtual*/ BOOL postBuild() override; private: void setControlFalse(const LLSD& user_data); diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index ef829a49a3c6543607d92177680bbc8894ffd477..08f7c90a8c77034d4926f29e1c47c200687a9f44 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -61,7 +61,7 @@ class LLWearingGearMenu { public: LLWearingGearMenu(LLPanelWearing* panel_wearing) - : mMenu(NULL), mPanelWearing(panel_wearing) + : mMenu(nullptr), mPanelWearing(panel_wearing) { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; @@ -97,7 +97,7 @@ private: class LLWearingContextMenu : public LLListContextMenu { protected: - /* virtual */ LLContextMenu* createMenu() + /* virtual */ LLContextMenu* createMenu() override { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; @@ -167,7 +167,7 @@ public: : mPanelWearing(panel_wearing) {} protected: - /* virtual */ LLContextMenu* createMenu() + /* virtual */ LLContextMenu* createMenu() override { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; @@ -201,9 +201,9 @@ static LLPanelInjector<LLPanelWearing> t_panel_wearing("panel_wearing"); LLPanelWearing::LLPanelWearing() : LLPanelAppearanceTab() - , mCOFItemsList(NULL) - , mIsInitialized(false) + , mCOFItemsList(nullptr) , mAttachmentsChangedConnection() + , mIsInitialized(false) { mCategoriesObserver = new LLInventoryCategoriesObserver(); @@ -504,7 +504,7 @@ void LLPanelWearing::onTempAttachmentsListRightClick(LLUICtrl* ctrl, S32 x, S32 bool LLPanelWearing::hasItemSelected() { - return mCOFItemsList->getSelectedItem() != NULL; + return mCOFItemsList->getSelectedItem() != nullptr; } void LLPanelWearing::getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const @@ -546,7 +546,7 @@ void LLPanelWearing::copyToClipboard() LLViewerInventoryItem* item = gInventory.getItem(uuid); iter++; - if (item != NULL) + if (item != nullptr) { // Append a newline to all but the last line text += iter != data.end() ? item->getName() + "\n" : item->getName(); diff --git a/indra/newview/llpanelwearing.h b/indra/newview/llpanelwearing.h index c5cb79092ad5aee9c15b50c3369ab68c7431f6bb..a36af4aa488a3ad174ffeef1291df71b553aa858 100644 --- a/indra/newview/llpanelwearing.h +++ b/indra/newview/llpanelwearing.h @@ -55,17 +55,17 @@ public: LLPanelWearing(); virtual ~LLPanelWearing(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; - /*virtual*/ void draw(); + /*virtual*/ void draw() override; - /*virtual*/ void onOpen(const LLSD& info); + /*virtual*/ void onOpen(const LLSD& info) override; - /*virtual*/ void setFilterSubString(const std::string& string); + /*virtual*/ void setFilterSubString(const std::string& string) override; - /*virtual*/ bool isActionEnabled(const LLSD& userdata); + /*virtual*/ bool isActionEnabled(const LLSD& userdata) override; - /*virtual*/ void getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const; + /*virtual*/ void getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const override; /*virtual*/ void copyToClipboard(); diff --git a/indra/newview/llparcelselection.cpp b/indra/newview/llparcelselection.cpp index 073156e5d6d354463b926fa4788e960198adbd45..a7702e68e4d4ae945f2606a2d8f9b996d95bce6f 100644 --- a/indra/newview/llparcelselection.cpp +++ b/indra/newview/llparcelselection.cpp @@ -37,7 +37,7 @@ // LLParcelSelection // LLParcelSelection::LLParcelSelection() : - mParcel(NULL), + mParcel(nullptr), mSelectedMultipleOwners(FALSE), mWholeParcelSelected(FALSE), mSelectedSelfCount(0), diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 2bf6f0e724e0bf416d9b6dae542bf0489fdf80ef..ddb107409040192eeb70497b9b13171203ba72cd 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -82,7 +82,7 @@ public: mAvalineCallers.insert(avaline_caller_id); } - void onParticipantsChanged() + void onParticipantsChanged() override { uuid_set_t participant_uuids; LLVoiceClient::getInstance()->getParticipantList(participant_uuids); @@ -376,7 +376,7 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id) bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(avatar_id); - LLConversationItemParticipant* participant = NULL; + LLConversationItemParticipant* participant = nullptr; if (is_avatar) { diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index ac7c48bc6a36b92fe3b719fc21cfc45b5892bcc8..5b48ad3e8f49fe9ed7872ee1e08bc56662f11eaa 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -54,7 +54,7 @@ public: /** * Refreshes the participant list. */ - void update(); + void update() override; /** * Set a callback to be called before adding a speaker. Invalid speakers will not be added. @@ -93,35 +93,35 @@ protected: { public: SpeakerAddListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); + /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override; }; class SpeakerRemoveListener : public BaseSpeakerListener { public: SpeakerRemoveListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); + /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override; }; class SpeakerClearListener : public BaseSpeakerListener { public: SpeakerClearListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); + /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override; }; class SpeakerUpdateListener : public BaseSpeakerListener { public: SpeakerUpdateListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); + /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override; }; class SpeakerModeratorUpdateListener : public BaseSpeakerListener { public: SpeakerModeratorUpdateListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); + /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override; }; class SpeakerMuteListener : public BaseSpeakerListener @@ -129,7 +129,7 @@ protected: public: SpeakerMuteListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); + /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override; }; private: diff --git a/indra/newview/llpatchvertexarray.cpp b/indra/newview/llpatchvertexarray.cpp index 4c2f7413c1af38340cf31cb3c46b618403313f7d..f1c52962c64f17988a8886288bd0528209cc8865 100644 --- a/indra/newview/llpatchvertexarray.cpp +++ b/indra/newview/llpatchvertexarray.cpp @@ -37,14 +37,14 @@ LLPatchVertexArray::LLPatchVertexArray() : mSurfaceWidth(0), mPatchWidth(0), mPatchOrder(0), - mRenderLevelp(NULL), - mRenderStridep(NULL) + mRenderLevelp(nullptr), + mRenderStridep(nullptr) { } LLPatchVertexArray::LLPatchVertexArray(U32 surface_width, U32 patch_width, F32 meters_per_grid) : - mRenderLevelp(NULL), - mRenderStridep(NULL) + mRenderLevelp(nullptr), + mRenderStridep(nullptr) { create(surface_width, patch_width, meters_per_grid); } @@ -116,7 +116,7 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p mRenderStridep = new U32 [mPatchOrder + 1]; } - if (NULL == mRenderLevelp || NULL == mRenderStridep) + if (nullptr == mRenderLevelp || nullptr == mRenderStridep) { // init() and some other things all want to deref these // pointers, so this is serious. diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index a14697dbf9dc235ed084ae0547ce2631eb58c6c5..87bb0fb5aa409d2a795f8156ed66e040fa937238 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -75,7 +75,7 @@ class LLNavMeshSimStateChangeNode : public LLHTTPNode { public: - virtual void post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const; + void post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const override; }; LLHTTPRegistration<LLNavMeshSimStateChangeNode> gHTTPRegistrationNavMeshSimStateChangeNode(SIM_MESSAGE_NAVMESH_STATUS_UPDATE); @@ -87,7 +87,7 @@ LLHTTPRegistration<LLNavMeshSimStateChangeNode> gHTTPRegistrationNavMeshSimState class LLAgentStateChangeNode : public LLHTTPNode { public: - virtual void post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const; + void post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const override; }; LLHTTPRegistration<LLAgentStateChangeNode> gHTTPRegistrationAgentStateChangeNode(SIM_MESSAGE_AGENT_STATE_UPDATE); @@ -151,7 +151,7 @@ LLPathfindingManager::~LLPathfindingManager() void LLPathfindingManager::initSystem() { - if (LLPathingLib::getInstance() == NULL) + if (LLPathingLib::getInstance() == nullptr) { LLPathingLib::initSystem(); } @@ -159,7 +159,7 @@ void LLPathfindingManager::initSystem() void LLPathfindingManager::quitSystem() { - if (LLPathingLib::getInstance() != NULL) + if (LLPathingLib::getInstance() != nullptr) { LLPathingLib::quitSystem(); } @@ -167,7 +167,7 @@ void LLPathfindingManager::quitSystem() bool LLPathfindingManager::isPathfindingViewEnabled() const { - return (LLPathingLib::getInstance() != NULL); + return (LLPathingLib::getInstance() != nullptr); } bool LLPathfindingManager::isPathfindingEnabledForCurrentRegion() const @@ -186,7 +186,7 @@ bool LLPathfindingManager::isPathfindingEnabledForRegion(LLViewerRegion *pRegion bool LLPathfindingManager::isAllowViewTerrainProperties() const { LLViewerRegion* region = getCurrentRegion(); - return (gAgent.isGodlike() || ((region != NULL) && region->canManageEstate())); + return (gAgent.isGodlike() || ((region != nullptr) && region->canManageEstate())); } LLPathfindingNavMesh::navmesh_slot_t LLPathfindingManager::registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback) @@ -199,7 +199,7 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion, b { LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion); - if (pRegion == NULL) + if (pRegion == nullptr) { navMeshPtr->handleNavMeshNotEnabled(); } @@ -229,7 +229,7 @@ void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, object_re LLPathfindingObjectListPtr emptyLinksetListPtr; LLViewerRegion *currentRegion = getCurrentRegion(); - if (currentRegion == NULL) + if (currentRegion == nullptr) { pLinksetsCallback(pRequestId, kRequestNotEnabled, emptyLinksetListPtr); } @@ -275,7 +275,7 @@ void LLPathfindingManager::requestSetLinksets(request_id_t pRequestId, const LLP { pLinksetsCallback(pRequestId, kRequestNotEnabled, emptyLinksetListPtr); } - else if ((pLinksetListPtr == NULL) || pLinksetListPtr->isEmpty()) + else if ((pLinksetListPtr == nullptr) || pLinksetListPtr->isEmpty()) { pLinksetsCallback(pRequestId, kRequestCompleted, emptyLinksetListPtr); } @@ -321,7 +321,7 @@ void LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, object_ LLViewerRegion *currentRegion = getCurrentRegion(); - if (currentRegion == NULL) + if (currentRegion == nullptr) { pCharactersCallback(pRequestId, kRequestNotEnabled, emptyCharacterListPtr); } @@ -356,7 +356,7 @@ void LLPathfindingManager::requestGetAgentState() { LLViewerRegion *currentRegion = getCurrentRegion(); - if (currentRegion == NULL) + if (currentRegion == nullptr) { mAgentStateSignal(FALSE); } @@ -385,7 +385,7 @@ void LLPathfindingManager::requestRebakeNavMesh(rebake_navmesh_callback_t pRebak { LLViewerRegion *currentRegion = getCurrentRegion(); - if (currentRegion == NULL) + if (currentRegion == nullptr) { pRebakeNavMeshCallback(false); } @@ -407,7 +407,7 @@ void LLPathfindingManager::handleDeferredGetAgentStateForRegion(const LLUUID &pR { LLViewerRegion *currentRegion = getCurrentRegion(); - if ((currentRegion != NULL) && (currentRegion->getRegionID() == pRegionUUID)) + if ((currentRegion != nullptr) && (currentRegion->getRegionID() == pRegionUUID)) { requestGetAgentState(); } @@ -417,7 +417,7 @@ void LLPathfindingManager::handleDeferredGetNavMeshForRegion(const LLUUID &pRegi { LLViewerRegion *currentRegion = getCurrentRegion(); - if ((currentRegion != NULL) && (currentRegion->getRegionID() == pRegionUUID)) + if ((currentRegion != nullptr) && (currentRegion->getRegionID() == pRegionUUID)) { requestGetNavMeshForRegion(currentRegion, pIsGetStatusOnly); } @@ -427,7 +427,7 @@ void LLPathfindingManager::handleDeferredGetLinksetsForRegion(const LLUUID &pReg { LLViewerRegion *currentRegion = getCurrentRegion(); - if ((currentRegion != NULL) && (currentRegion->getRegionID() == pRegionUUID)) + if ((currentRegion != nullptr) && (currentRegion->getRegionID() == pRegionUUID)) { requestGetLinksets(pRequestId, pLinksetsCallback); } @@ -437,7 +437,7 @@ void LLPathfindingManager::handleDeferredGetCharactersForRegion(const LLUUID &pR { LLViewerRegion *currentRegion = getCurrentRegion(); - if ((currentRegion != NULL) && (currentRegion->getRegionID() == pRegionUUID)) + if ((currentRegion != nullptr) && (currentRegion->getRegionID() == pRegionUUID)) { requestGetCharacters(pRequestId, pCharactersCallback); } @@ -458,7 +458,7 @@ void LLPathfindingManager::navMeshStatusRequestCoro(std::string url, U64 regionH } LLUUID regionUUID = region->getRegionID(); - region = NULL; + region = nullptr; LLSD result = httpAdapter->getAndSuspend(httpRequest, url); region = LLWorld::getInstance()->getRegionFromHandle(regionHandle); @@ -678,13 +678,13 @@ void LLPathfindingManager::charactersCoro(std::string url, request_id_t requestI LL_WARNS("PathfindingManager") << "HTTP status, " << status.toTerseString() << ". characters failed." << LL_ENDL; - LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList()); + LLPathfindingObjectListPtr characterListPtr = std::static_pointer_cast<LLPathfindingObjectList>(std::make_shared<LLPathfindingCharacterList>()); callback(requestId, LLPathfindingManager::kRequestError, characterListPtr); } else { result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS); - LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList(result)); + LLPathfindingObjectListPtr characterListPtr = std::static_pointer_cast<LLPathfindingObjectList>(std::make_shared<LLPathfindingCharacterList>(result)); callback(requestId, LLPathfindingManager::kRequestCompleted, characterListPtr); } } @@ -714,7 +714,7 @@ LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(const LLUUID & NavMeshMap::iterator navMeshIter = mNavMeshMap.find(pRegionUUID); if (navMeshIter == mNavMeshMap.end()) { - navMeshPtr = LLPathfindingNavMeshPtr(new LLPathfindingNavMesh(pRegionUUID)); + navMeshPtr = std::make_shared<LLPathfindingNavMesh>(pRegionUUID); mNavMeshMap.insert(std::pair<LLUUID, LLPathfindingNavMeshPtr>(pRegionUUID, navMeshPtr)); } else @@ -728,7 +728,7 @@ LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(const LLUUID & LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion *pRegion) { LLUUID regionUUID; - if (pRegion != NULL) + if (pRegion != nullptr) { regionUUID = pRegion->getRegionID(); } @@ -780,7 +780,7 @@ std::string LLPathfindingManager::getCapabilityURLForRegion(LLViewerRegion *pReg { std::string capabilityURL(""); - if (pRegion != NULL) + if (pRegion != nullptr) { capabilityURL = pRegion->getCapability(pCapabilityName); } @@ -788,7 +788,7 @@ std::string LLPathfindingManager::getCapabilityURLForRegion(LLViewerRegion *pReg if (capabilityURL.empty()) { LL_WARNS() << "cannot find capability '" << pCapabilityName << "' for current region '" - << ((pRegion != NULL) ? pRegion->getName() : "<null>") << "'" << LL_ENDL; + << ((pRegion != nullptr) ? pRegion->getName() : "<null>") << "'" << LL_ENDL; } return capabilityURL; @@ -845,7 +845,7 @@ LinksetsResponder::~LinksetsResponder() void LinksetsResponder::handleObjectLinksetsResult(const LLSD &pContent) { - mObjectLinksetListPtr = LLPathfindingObjectListPtr(new LLPathfindingLinksetList(pContent)); + mObjectLinksetListPtr = std::static_pointer_cast<LLPathfindingObjectList>(std::make_shared<LLPathfindingLinksetList>(pContent)); mObjectMessagingState = kReceivedGood; if (mTerrainMessagingState != kWaiting) @@ -866,7 +866,7 @@ void LinksetsResponder::handleObjectLinksetsError() void LinksetsResponder::handleTerrainLinksetsResult(const LLSD &pContent) { - mTerrainLinksetPtr = LLPathfindingObjectPtr(new LLPathfindingLinkset(pContent)); + mTerrainLinksetPtr = std::static_pointer_cast<LLPathfindingObject>(std::make_shared<LLPathfindingLinkset>(pContent)); mTerrainMessagingState = kReceivedGood; if (mObjectMessagingState != kWaiting) @@ -896,7 +896,7 @@ void LinksetsResponder::sendCallback() if (mObjectMessagingState != kReceivedGood) { - mObjectLinksetListPtr = LLPathfindingObjectListPtr(new LLPathfindingLinksetList()); + mObjectLinksetListPtr = std::static_pointer_cast<LLPathfindingObjectList>(std::make_shared<LLPathfindingLinksetList>()); } if (mTerrainMessagingState == kReceivedGood) diff --git a/indra/newview/llpathfindingobjectlist.cpp b/indra/newview/llpathfindingobjectlist.cpp index 12c8ee78baab3d2fb982abf90af22bfd2f0ce894..814ff9f80a1633411e4d662c8e3890279d8d659c 100644 --- a/indra/newview/llpathfindingobjectlist.cpp +++ b/indra/newview/llpathfindingobjectlist.cpp @@ -62,7 +62,7 @@ void LLPathfindingObjectList::clear() void LLPathfindingObjectList::update(LLPathfindingObjectPtr pUpdateObjectPtr) { - if (pUpdateObjectPtr != NULL) + if (pUpdateObjectPtr != nullptr) { std::string updateObjectId = pUpdateObjectPtr->getUUID().asString(); @@ -80,7 +80,7 @@ void LLPathfindingObjectList::update(LLPathfindingObjectPtr pUpdateObjectPtr) void LLPathfindingObjectList::update(LLPathfindingObjectListPtr pUpdateObjectListPtr) { - if ((pUpdateObjectListPtr != NULL) && !pUpdateObjectListPtr->isEmpty()) + if ((pUpdateObjectListPtr != nullptr) && !pUpdateObjectListPtr->isEmpty()) { for (LLPathfindingObjectMap::const_iterator updateObjectIter = pUpdateObjectListPtr->begin(); updateObjectIter != pUpdateObjectListPtr->end(); ++updateObjectIter) diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index fed2df79bdaf72784b16d65f10101d29916f7459..e9576dde3441a990dee2b3f9fd6aca59a251edeb 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -102,21 +102,21 @@ public: const LLVector3 &motion_direction_vec, const controller_map_t &controllers) : mParamDriverName(param_driver_name), - mJointName(joint_name), mMotionDirectionVec(motion_direction_vec), - mParamDriver(NULL), - mParamControllers(controllers), - mCharacter(character), - mLastTime(0), + mJointName(joint_name), mPosition_local(0), mVelocityJoint_local(0), - mPositionLastUpdate_local(0) + mPositionLastUpdate_local(0), + mParamDriver(nullptr), + mParamControllers(controllers), + mCharacter(character), + mLastTime(0) { mJointState = new LLJointState; for (U32 i = 0; i < NUM_PARAMS; ++i) { - mParamCache[i] = NULL; + mParamCache[i] = nullptr; } } @@ -224,7 +224,7 @@ BOOL LLPhysicsMotion::initialize() mJointState->setUsage(LLJointState::ROT); mParamDriver = (LLViewerVisualParam*)mCharacter->getVisualParam(mParamDriverName.c_str()); - if (mParamDriver == NULL) + if (mParamDriver == nullptr) { LL_INFOS() << "Failure reading in [ " << mParamDriverName << " ]" << LL_ENDL; return FALSE; @@ -235,7 +235,7 @@ BOOL LLPhysicsMotion::initialize() LLPhysicsMotionController::LLPhysicsMotionController(const LLUUID &id) : LLMotion(id), - mCharacter(NULL) + mCharacter(nullptr) { mName = "breast_motion"; } @@ -699,7 +699,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) const F32 area_for_this_setting = area_for_max_settings + (area_for_min_settings-area_for_max_settings)*(1.0-lod_factor); const F32 pixel_area = sqrtf(mCharacter->getPixelArea()); - const BOOL is_self = (dynamic_cast<LLVOAvatarSelf *>(mCharacter) != NULL); + const BOOL is_self = (dynamic_cast<LLVOAvatarSelf *>(mCharacter) != nullptr); if ((pixel_area > area_for_this_setting) || is_self) { const F32 position_diff_local = llabs(mPositionLastUpdate_local-position_new_local_clamped); diff --git a/indra/newview/llphysicsmotion.h b/indra/newview/llphysicsmotion.h index b246fa99bb5e8190bb99f5b6a9736c544c8a0d03..5d1c6a98b2ad8277a882e1e24f7930c2b38c4329 100644 --- a/indra/newview/llphysicsmotion.h +++ b/indra/newview/llphysicsmotion.h @@ -66,42 +66,42 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return TRUE; } + BOOL getLoop() override { return TRUE; } // motions must report their total duration - virtual F32 getDuration() { return 0.0; } + F32 getDuration() override { return 0.0; } // motions must report their "ease in" duration - virtual F32 getEaseInDuration() { return PHYSICS_MOTION_FADEIN_TIME; } + F32 getEaseInDuration() override { return PHYSICS_MOTION_FADEIN_TIME; } // motions must report their "ease out" duration. - virtual F32 getEaseOutDuration() { return PHYSICS_MOTION_FADEOUT_TIME; } + F32 getEaseOutDuration() override { return PHYSICS_MOTION_FADEOUT_TIME; } // called to determine when a motion should be activated/deactivated based on avatar pixel coverage - virtual F32 getMinPixelArea(); + F32 getMinPixelArea() override; // motions must report their priority - virtual LLJoint::JointPriority getPriority() { return LLJoint::MEDIUM_PRIORITY; } + LLJoint::JointPriority getPriority() override { return LLJoint::MEDIUM_PRIORITY; } - virtual LLMotionBlendType getBlendType() { return ADDITIVE_BLEND; } + LLMotionBlendType getBlendType() override { return ADDITIVE_BLEND; } // run-time (post constructor) initialization, // called after parameters have been set // must return true to indicate success and be available for activation - virtual LLMotionInitStatus onInitialize(LLCharacter *character); + LLMotionInitStatus onInitialize(LLCharacter *character) override; // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + BOOL onActivate() override; // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + BOOL onUpdate(F32 time, U8* joint_mask) override; // called when a motion is deactivated - virtual void onDeactivate(); + void onDeactivate() override; LLCharacter* getCharacter() { return mCharacter; } diff --git a/indra/newview/llplacesfolderview.h b/indra/newview/llplacesfolderview.h index 65fe76007ac75674e2e120cc9ebcfc755034e1b6..9989af2b93cf780b8ae54a3ea5dbb788cf88b194 100644 --- a/indra/newview/llplacesfolderview.h +++ b/indra/newview/llplacesfolderview.h @@ -49,9 +49,9 @@ public: * Contains workaround for EXT-2786: sets current selected list for landmark * panel using @c mParentLandmarksPanel which is set in @c LLLandmarksPanel::initLandmarksPanel */ - /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); + /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ) override; - /*virtual*/ void updateMenu(); + /*virtual*/ void updateMenu() override; void setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle); diff --git a/indra/newview/llplacesinventorybridge.cpp b/indra/newview/llplacesinventorybridge.cpp index e25999aa8c37cfaddd6911e61541ecae447a711c..1bad6fe0229ef904ab1b880d94a9a24321adb842 100644 --- a/indra/newview/llplacesinventorybridge.cpp +++ b/indra/newview/llplacesinventorybridge.cpp @@ -40,7 +40,7 @@ static const std::string LANDMARKS_INVENTORY_LIST_NAME("landmarks_list"); bool is_landmarks_panel(const LLInventoryPanel* inv_panel) { - if (NULL == inv_panel) + if (nullptr == inv_panel) return false; return inv_panel->getName() == LANDMARKS_INVENTORY_LIST_NAME; } @@ -94,7 +94,7 @@ void LLPlacesFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (inv_panel) { LLFolderViewFolder* folder = dynamic_cast<LLFolderViewFolder*>(inv_panel->getItemByID(mUUID)); - is_open = (NULL != folder) && folder->isOpen(); + is_open = (nullptr != folder) && folder->isOpen(); } // collect all items' names @@ -136,7 +136,7 @@ void LLPlacesFolderBridge::performAction(LLInventoryModel* model, std::string ac LLFolderViewFolder* LLPlacesFolderBridge::getFolder() { - LLFolderViewFolder* folder = NULL; + LLFolderViewFolder* folder = nullptr; LLInventoryPanel* inv_panel = mInventoryPanel.get(); if (inv_panel) { @@ -157,7 +157,7 @@ LLInvFVBridge* LLPlacesInventoryBridgeBuilder::createBridge( const LLUUID& uuid, U32 flags/* = 0x00*/) const { - LLInvFVBridge* new_listener = NULL; + LLInvFVBridge* new_listener = nullptr; switch(asset_type) { case LLAssetType::AT_LANDMARK: diff --git a/indra/newview/llplacesinventorybridge.h b/indra/newview/llplacesinventorybridge.h index 108991210fc2ce398d30a312035750813880cabb..30be230d17144b62d584139c24099230be6c8c53 100644 --- a/indra/newview/llplacesinventorybridge.h +++ b/indra/newview/llplacesinventorybridge.h @@ -39,7 +39,7 @@ class LLPlacesLandmarkBridge : public LLLandmarkBridge friend class LLPlacesInventoryBridgeBuilder; public: - /*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags); + /*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags) override; protected: LLPlacesLandmarkBridge(LLInventoryType::EType type, @@ -61,8 +61,8 @@ class LLPlacesFolderBridge : public LLFolderBridge friend class LLPlacesInventoryBridgeBuilder; public: - /*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags); - /*virtual*/ void performAction(LLInventoryModel* model, std::string action); + /*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags) override; + /*virtual*/ void performAction(LLInventoryModel* model, std::string action) override; protected: LLPlacesFolderBridge(LLInventoryType::EType type, @@ -94,7 +94,7 @@ public: LLFolderViewModelInventory* view_model, LLFolderView* root, const LLUUID& uuid, - U32 flags = 0x00) const; + U32 flags = 0x00) const override; }; #endif // LL_LLPLACESINVENTORYBRIDGE_H diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp index b774cc3c7eafaea80a7d54c2db6419c08364c6bf..cebfb6e021ed42a8acce704540086f480f556b5e 100644 --- a/indra/newview/llplacesinventorypanel.cpp +++ b/indra/newview/llplacesinventorypanel.cpp @@ -46,7 +46,7 @@ static const LLPlacesInventoryBridgeBuilder PLACES_INVENTORY_BUILDER; LLPlacesInventoryPanel::LLPlacesInventoryPanel(const Params& p) : LLInventoryPanel(p), - mSavedFolderState(NULL) + mSavedFolderState(nullptr) { mInvFVBridgeBuilder = &PLACES_INVENTORY_BUILDER; @@ -75,14 +75,14 @@ LLFolderView * LLPlacesInventoryPanel::createFolderRoot(LLUUID root_id ) LLInventoryType::IT_CATEGORY, this, &mInventoryViewModel, - NULL, + nullptr, root_id); p.view_model = &mInventoryViewModel; p.use_label_suffix = mParams.use_label_suffix; p.allow_multiselect = mAllowMultiSelect; p.show_empty_message = mShowEmptyMessage; p.show_item_link_overlays = mShowItemLinkOverlays; - p.root = NULL; + p.root = nullptr; p.use_ellipses = mParams.folder_view.use_ellipses; p.options_menu = "menu_inventory.xml"; diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h index 27d9b83bd170731c599cb7db6d9e76741160cde1..6e6aa079cbbb04ad6907561d35f518344ae133a4 100644 --- a/indra/newview/llplacesinventorypanel.h +++ b/indra/newview/llplacesinventorypanel.h @@ -45,11 +45,11 @@ public: LLPlacesInventoryPanel(const Params& p); ~LLPlacesInventoryPanel(); - LLFolderView * createFolderRoot(LLUUID root_id ); + LLFolderView * createFolderRoot(LLUUID root_id ) override; void saveFolderState(); void restoreFolderState(); - virtual S32 notify(const LLSD& info) ; + S32 notify(const LLSD& info) override; private: LLSaveFolderState* mSavedFolderState; diff --git a/indra/newview/llpopupview.h b/indra/newview/llpopupview.h index b5b4ffc47603bf783ea27eb783ad98e68c8222ea..a625a3e2866c13c45ea38073b36f26fcf6fcfbf5 100644 --- a/indra/newview/llpopupview.h +++ b/indra/newview/llpopupview.h @@ -35,17 +35,17 @@ public: LLPopupView(const Params& p = LLPanel::Params()); ~LLPopupView(); - /*virtual*/ void draw(); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); + /*virtual*/ void draw() override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; void addPopup(LLView* popup); void removePopup(LLView* popup); diff --git a/indra/newview/llpostcard.h b/indra/newview/llpostcard.h index 07b8cb043663fe0039baea179a08b1da6e9c805b..34aeda4d422abcd5a604a907ddab43fe5eee50c7 100644 --- a/indra/newview/llpostcard.h +++ b/indra/newview/llpostcard.h @@ -57,7 +57,7 @@ public: std::string subject, std::string message, LLVector3d globalPosition, LLPointer<LLImageFormatted> image, invnUploadFinish_f finish); - virtual LLSD generatePostBody(); + LLSD generatePostBody() override; private: std::string mNameFrom; std::string mEmailTo; diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 0abc1c4818cba4a7a8963802b7a7561dfd9e23a2..c7465a75a9cd689a99a51f525ce58c8240a291c6 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -62,14 +62,14 @@ LLPreview::LLPreview(const LLSD& key) : LLFloater(key), - mItemUUID(key.has("itemid") ? key.get("itemid").asUUID() : key.asUUID()), - mObjectUUID(), // set later by setObjectID() - mCopyToInvBtn( NULL ), + mDirty(TRUE), + mItemUUID(key.has("itemid") ? key.get("itemid").asUUID() : key.asUUID()), // set later by setObjectID() + mObjectUUID(), + mCopyToInvBtn(nullptr ), mForceClose(FALSE), mUserResized(FALSE), mCloseAfterSave(FALSE), - mAssetStatus(PREVIEW_ASSET_UNLOADED), - mDirty(TRUE) + mAssetStatus(PREVIEW_ASSET_UNLOADED) { mAuxItem = new LLInventoryItem; // don't necessarily steal focus on creation -- sometimes these guys pop up without user action @@ -114,7 +114,7 @@ void LLPreview::setItem( LLInventoryItem* item ) const LLInventoryItem *LLPreview::getItem() const { - const LLInventoryItem *item = NULL; + const LLInventoryItem *item = nullptr; if (mItem.notNull()) { item = mItem; @@ -322,7 +322,7 @@ BOOL LLPreview::handleMouseUp(S32 x, S32 y, MASK mask) { if(hasMouseCapture()) { - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); return TRUE; } return LLFloater::handleMouseUp(x, y, mask); @@ -536,16 +536,16 @@ void LLMultiPreview::tabOpen(LLFloater* opened_floater, bool from_click) LLFloaterSearchReplace* pSearchFloater = LLFloaterReg::getTypedInstance<LLFloaterSearchReplace>("search_replace"); if ( (pSearchFloater) && (pSearchFloater->getDependee() == this) ) { - LLPreviewNotecard* pPreviewNotecard = NULL; LLPreviewLSL* pPreviewScript = NULL; LLLiveLSLEditor* pPreviewScriptLive = NULL; - if ((pPreviewNotecard = dynamic_cast<LLPreviewNotecard*>(opened_preview)) != NULL) + LLPreviewNotecard* pPreviewNotecard = nullptr; LLPreviewLSL* pPreviewScript = nullptr; LLLiveLSLEditor* pPreviewScriptLive = nullptr; + if ((pPreviewNotecard = dynamic_cast<LLPreviewNotecard*>(opened_preview)) != nullptr) { LLFloaterSearchReplace::show(pPreviewNotecard->getEditor()); } - else if ((pPreviewScript = dynamic_cast<LLPreviewLSL*>(opened_preview)) != NULL) + else if ((pPreviewScript = dynamic_cast<LLPreviewLSL*>(opened_preview)) != nullptr) { LLFloaterSearchReplace::show(pPreviewScript->getEditor()); } - else if ((pPreviewScriptLive = dynamic_cast<LLLiveLSLEditor*>(opened_preview)) != NULL) + else if ((pPreviewScriptLive = dynamic_cast<LLLiveLSLEditor*>(opened_preview)) != nullptr) { LLFloaterSearchReplace::show(pPreviewScriptLive->getEditor()); } @@ -561,7 +561,7 @@ void LLMultiPreview::tabOpen(LLFloater* opened_floater, bool from_click) void LLPreview::setAssetId(const LLUUID& asset_id) { const LLViewerInventoryItem* item = dynamic_cast<const LLViewerInventoryItem*>(getItem()); - if(NULL == item) + if(nullptr == item) { return; } @@ -578,7 +578,7 @@ void LLPreview::setAssetId(const LLUUID& asset_id) { // Update object inventory asset_id. LLViewerObject* object = gObjectList.findObject(mObjectUUID); - if(NULL == object) + if(nullptr == object) { return; } diff --git a/indra/newview/llpreview.h b/indra/newview/llpreview.h index f5645c2a09e2f22687228b55c19b1d142e9e1401..94ac5e441a63671a94f5470b14a26b3a1fa76c24 100644 --- a/indra/newview/llpreview.h +++ b/indra/newview/llpreview.h @@ -44,9 +44,9 @@ class LLMultiPreview : public LLMultiFloater public: LLMultiPreview(); - /*virtual*/void onOpen(const LLSD& key); - /*virtual*/void tabOpen(LLFloater* opened_floater, bool from_click); - /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); + /*virtual*/void onOpen(const LLSD& key) override; + /*virtual*/void tabOpen(LLFloater* opened_floater, bool from_click) override; + /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false) override; }; @@ -66,7 +66,7 @@ public: LLPreview(const LLSD& key ); virtual ~LLPreview(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; virtual void setObjectID(const LLUUID& object_id); void setItem( LLInventoryItem* item ); @@ -76,11 +76,11 @@ public: static void hide(const LLUUID& item_uuid, BOOL no_saving = FALSE ); static void dirty(const LLUUID& item_uuid); - - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual void onOpen(const LLSD& key); + + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + void onOpen(const LLSD& key) override; void setAuxItem( const LLInventoryItem* item ); @@ -89,7 +89,7 @@ public: void addKeepDiscardButtons(); static void onKeepBtn(void* data); static void onDiscardBtn(void* data); - /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); + /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false) override; void userResized() { mUserResized = TRUE; }; @@ -102,7 +102,7 @@ public: void setNotecardInfo(const LLUUID& notecard_inv_id, const LLUUID& object_id); // llview - /*virtual*/ void draw(); + /*virtual*/ void draw() override; void refreshFromItem(); // We can't modify Item or description in preview if either in-world Object @@ -110,7 +110,7 @@ public: static BOOL canModify(const LLUUID taskUUID, const LLInventoryItem* item); protected: - virtual void onCommit(); + void onCommit() override; void addDescriptionUI(); @@ -118,7 +118,7 @@ protected: static void onRadio(LLUICtrl*, void* userdata); // for LLInventoryObserver - virtual void changed(U32 mask); + void changed(U32 mask) override; BOOL mDirty; protected: diff --git a/indra/newview/llpreviewanim.h b/indra/newview/llpreviewanim.h index 8eaed6ca1f9ce1bcb29847a082f20034aa365aad..501f94d77653e81b9fe6dac4ee4f2404ed55abac 100644 --- a/indra/newview/llpreviewanim.h +++ b/indra/newview/llpreviewanim.h @@ -35,9 +35,9 @@ class LLPreviewAnim : public LLPreview public: LLPreviewAnim(const LLSD& key); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); - void draw(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onClose(bool app_quitting) override; + void draw() override; void cleanup(); void play(const LLSD& param); diff --git a/indra/newview/llpreviewgesture.h b/indra/newview/llpreviewgesture.h index 3ba4f562952505e041100a5c23f905d6b920d3b3..f488c2089664ef1b51f5d91d2e7ff8899a7aa2e2 100644 --- a/indra/newview/llpreviewgesture.h +++ b/indra/newview/llpreviewgesture.h @@ -52,22 +52,22 @@ public: virtual ~LLPreviewGesture(); // LLView - /*virtual*/ void draw(); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ void draw() override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask) override; /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; // LLPanel - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; // LLFloater - /*virtual*/ BOOL canClose(); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ BOOL canClose() override; + /*virtual*/ void onClose(bool app_quitting) override; /*virtual*/ void onUpdateSucceeded(); - /*virtual*/ void refresh(); + /*virtual*/ void refresh() override; protected: // Populate various comboboxes @@ -78,7 +78,7 @@ protected: void initDefaultGesture(); - void loadAsset(); + void loadAsset() override; static void onLoadComplete(LLVFS *vfs, const LLUUID& asset_uuid, diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 57007ba9dc355e477328628693e371ce2084dd24..a2385536b087d0b55a91766f1096e3dc32ff283f 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -180,7 +180,7 @@ const LLInventoryItem* LLPreviewNotecard::getDragItem() { return editor->getDragItem(); } - return NULL; + return nullptr; } // [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-11-05 (Catznip-3.0.0) | Added: Catznip-2.3.0 @@ -192,7 +192,7 @@ LLTextEditor* LLPreviewNotecard::getEditor() bool LLPreviewNotecard::hasEmbeddedInventory() { - LLViewerTextEditor* editor = NULL; + LLViewerTextEditor* editor = nullptr; editor = getChild<LLViewerTextEditor>("Notecard Editor"); if (!editor) return false; return editor->hasEmbeddedInventory(); @@ -515,14 +515,14 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) if (mObjectUUID.isNull() && !agent_url.empty()) { - uploadInfo = LLResourceUploadInfo::ptr_t(new LLBufferedAssetUploadInfo(mItemUUID, LLAssetType::AT_NOTECARD, buffer, - boost::bind(&LLPreviewNotecard::finishInventoryUpload, _1, _2, _3))); + uploadInfo = boost::static_pointer_cast<LLResourceUploadInfo>(boost::make_shared<LLBufferedAssetUploadInfo>(mItemUUID, LLAssetType::AT_NOTECARD, buffer, + boost::bind(&LLPreviewNotecard::finishInventoryUpload, _1, _2, _3))); url = agent_url; } else if (!mObjectUUID.isNull() && !task_url.empty()) { - uploadInfo = LLResourceUploadInfo::ptr_t(new LLBufferedAssetUploadInfo(mObjectUUID, mItemUUID, LLAssetType::AT_NOTECARD, buffer, - boost::bind(&LLPreviewNotecard::finishTaskUpload, _1, _3, mObjectUUID))); + uploadInfo = boost::static_pointer_cast<LLResourceUploadInfo>(boost::make_shared<LLBufferedAssetUploadInfo>(mObjectUUID, mItemUUID, LLAssetType::AT_NOTECARD, buffer, + boost::bind(&LLPreviewNotecard::finishTaskUpload, _1, _3, mObjectUUID))); url = task_url; } @@ -606,7 +606,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data else { LLViewerObject* object = gObjectList.findObject(info->mObjectUUID); - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; if(object) { item = (LLViewerInventoryItem*)object->getInventoryObject(info->mItemUUID); @@ -694,7 +694,7 @@ bool LLPreviewNotecard::handleConfirmDeleteDialog(const LLSD& notification, cons { // move item from agent's inventory into trash LLViewerInventoryItem* item = gInventory.getItem(mItemUUID); - if (item != NULL) + if (item != nullptr) { const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); gInventory.changeItemParent(item, trash_id, FALSE); @@ -707,7 +707,7 @@ bool LLPreviewNotecard::handleConfirmDeleteDialog(const LLSD& notification, cons if(object) { LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(object->getInventoryObject(mItemUUID)); - if (item != NULL) + if (item != nullptr) { object->removeInventory(mItemUUID); } diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index 6b666d489c1a74f122d620f8e81d2f67aa627d04..850947e84c2a3df41775c54e13508fd820c71f27 100644 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -52,18 +52,18 @@ public: bool saveItem(); // llview - virtual void draw(); + void draw() override; // [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-11-05 (Catznip-3.0.0) | Added: Catznip-2.3.0 - virtual bool hasAccelerators() const { return true; } + bool hasAccelerators() const override { return true; } // [/SL:KB] - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual void setEnabled( BOOL enabled ); + BOOL handleKeyHere(KEY key, MASK mask) override; + void setEnabled( BOOL enabled ) override; // llfloater - virtual BOOL canClose(); + BOOL canClose() override; // llpanel - virtual BOOL postBuild(); + BOOL postBuild() override; // reach into the text editor, and grab the drag item const LLInventoryItem* getDragItem(); @@ -82,9 +82,9 @@ public: protected: - void updateTitleButtons(); - virtual void loadAsset(); - bool saveIfNeeded(LLInventoryItem* copyitem = NULL); + void updateTitleButtons() override; + void loadAsset() override; + bool saveIfNeeded(LLInventoryItem* copyitem = nullptr); void deleteNotecard(); diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 21576d7054e23251dc43340f7907eec04dfb3c4f..fdd86645e84574499b8317c0a8834cdc6940a3ae 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -79,8 +79,8 @@ public: void processKeywords(); void processLoaded(); - virtual void draw(); - /*virtual*/ BOOL postBuild(); + void draw() override; + /*virtual*/ BOOL postBuild() override; BOOL canClose(); void setEnableEditing(bool enable); bool canLoadOrSaveToFile( void* userdata ); @@ -109,7 +109,7 @@ public: static bool enableSaveToFileMenu(void* userdata); static bool enableLoadFromFileMenu(void* userdata); - virtual bool hasAccelerators() const { return true; } + bool hasAccelerators() const override { return true; } LLUUID getAssociatedExperience()const; void setAssociatedExperience( const LLUUID& experience_id ); @@ -126,7 +126,7 @@ private: void selectFirstError(); - virtual BOOL handleKeyHere(KEY key, MASK mask); + BOOL handleKeyHere(KEY key, MASK mask) override; void enableSave(BOOL b) {mEnableSave = b;} @@ -194,19 +194,19 @@ public: virtual void callbackLSLCompileSucceeded(); virtual void callbackLSLCompileFailed(const LLSD& compile_errors); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; // [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-11-05 (Catznip-3.0.0) | Added: Catznip-2.3.0 LLTextEditor* getEditor(); // [/SL:KB] protected: - virtual void draw(); - virtual BOOL canClose(); + void draw() override; + BOOL canClose() override; void closeIfNeeded(); - virtual void loadAsset(); - /*virtual*/ void saveIfNeeded(bool sync = true); + void loadAsset() override; + /*virtual*/ void saveIfNeeded(bool sync = true) override; static void onSearchReplace(void* userdata); static void onLoad(void* userdata); @@ -243,7 +243,7 @@ public: bool is_script_running); virtual void callbackLSLCompileFailed(const LLSD& compile_errors); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void setIsNew() { mIsNew = TRUE; } @@ -263,13 +263,13 @@ public: void addAssociatedExperience(const LLSD& experience); private: - virtual BOOL canClose(); + BOOL canClose() override; void closeIfNeeded(); - virtual void draw(); + void draw() override; - virtual void loadAsset(); + void loadAsset() override; void loadAsset(BOOL is_new); - /*virtual*/ void saveIfNeeded(bool sync = true); + /*virtual*/ void saveIfNeeded(bool sync = true) override; BOOL monoChecked() const; diff --git a/indra/newview/llpreviewsound.h b/indra/newview/llpreviewsound.h index 0453bfd9367535fdfe40b9cb8414a8370a27d15a..faee94f05ef33be386b0fe02deffe9d6aa4b31bc 100644 --- a/indra/newview/llpreviewsound.h +++ b/indra/newview/llpreviewsound.h @@ -38,7 +38,7 @@ public: static void auditionSound( void* userdata ); protected: - /* virtual */ BOOL postBuild(); + /* virtual */ BOOL postBuild() override; }; #endif // LL_LLPREVIEWSOUND_H diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index b104a91c756de0b2ae2cd07b5bd0fff076070043..1159d3d1b5c42d08584f3f141e2677c52f4c7091 100644 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -41,16 +41,16 @@ public: LLPreviewTexture(const LLSD& key); ~LLPreviewTexture(); - virtual void draw(); + void draw() override; - virtual BOOL canSaveAs() const; - virtual void saveAs(); + BOOL canSaveAs() const override; + void saveAs() override; - virtual void loadAsset(); - virtual EAssetStatus getAssetStatus(); - - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - virtual void onFocusReceived(); + void loadAsset() override; + EAssetStatus getAssetStatus() override; + + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + void onFocusReceived() override; static void onFileLoadedForSave( BOOL success, @@ -64,10 +64,10 @@ public: static void onSaveAsBtn(void* data); - /*virtual*/ void setObjectID(const LLUUID& object_id); + /*virtual*/ void setObjectID(const LLUUID& object_id) override; protected: void init(); - /* virtual */ BOOL postBuild(); + /* virtual */ BOOL postBuild() override; bool setAspectRatio(const F32 width, const F32 height); static void onAspectRatioCommit(LLUICtrl*,void* userdata); void adjustAspectRatio(); diff --git a/indra/newview/llproductinforequest.h b/indra/newview/llproductinforequest.h index d1036374e8008302ff83f8b8d68ee12f4d7eaade..0b94c39d1147ad7965022d34672206f0216f7f79 100644 --- a/indra/newview/llproductinforequest.h +++ b/indra/newview/llproductinforequest.h @@ -46,7 +46,7 @@ public: std::string getDescriptionForSku(const std::string& sku); private: - /* virtual */ void initSingleton(); + /* virtual */ void initSingleton() override; void getLandDescriptionsCoro(std::string url); LLSD mSkuDescriptions; diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 83a5b25887d45c4302050ef575e5ae07b6e6b6c3..a87bae0721c01817a008efe9bdb1d54d46fca07c 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -55,7 +55,7 @@ #include "lluictrlfactory.h" #include "llpanellogin.h" -LLProgressView* LLProgressView::sInstance = NULL; +LLProgressView* LLProgressView::sInstance = nullptr; S32 gStartImageWidth = 1; S32 gStartImageHeight = 1; @@ -66,16 +66,16 @@ static LLPanelInjector<LLProgressView> r("progress_view"); // XUI: Translate LLProgressView::LLProgressView() : LLPanel(), - mMediaCtrl( NULL ), + mMediaCtrl(nullptr ), mPercentDone(0.f), mProgressText(nullptr), mMessageText(nullptr), mCancelBtn(nullptr), - mMouseDownInActiveArea( false ), - mUpdateEvents("LLProgressView"), mFadeToWorldTimer(), mFadeFromLoginTimer(), - mStartupComplete(false) + mMouseDownInActiveArea( false ), + mStartupComplete(false), + mUpdateEvents("LLProgressView") { mUpdateEvents.listen("self", boost::bind(&LLProgressView::handleUpdate, this, _1)); mFadeToWorldTimer.stop(); @@ -94,7 +94,7 @@ BOOL LLProgressView::postBuild() LLViewerMedia::setOnlyAudibleMediaTextureID(mMediaCtrl->getTextureID()); mCancelBtn = getChild<LLButton>("cancel_btn"); - mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL ); + mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, nullptr ); getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle())); @@ -120,12 +120,12 @@ LLProgressView::~LLProgressView() gFocusMgr.releaseFocusIfNeeded( this ); - sInstance = NULL; + sInstance = nullptr; } BOOL LLProgressView::handleHover(S32 x, S32 y, MASK mask) { - if( childrenHandleHover( x, y, mask ) == NULL ) + if( childrenHandleHover( x, y, mask ) == nullptr ) { gViewerWindow->setCursor(UI_CURSOR_WAIT); } @@ -291,7 +291,7 @@ void LLProgressView::draw() // FIXME: this causes a crash that i haven't been able to fix mMediaCtrl->unloadMediaSource(); - gStartTexture = NULL; + gStartTexture = nullptr; } return; } @@ -347,7 +347,7 @@ void LLProgressView::onCancelButtonClicked(void*) void LLProgressView::onClickMessage(void* data) { LLProgressView* viewp = (LLProgressView*)data; - if ( viewp != NULL && ! viewp->mMessage.empty() ) + if ( viewp != nullptr && ! viewp->mMessage.empty() ) { std::string url_to_open( "" ); diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index 93a815191aedb094d9d2b0e72884e2faeb19a834..b7152a5a82d59ce5fcea104c2a33e1af278f39ba 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -48,17 +48,17 @@ public: LLProgressView(); virtual ~LLProgressView(); - BOOL postBuild(); + BOOL postBuild() override; - /*virtual*/ void draw(); + /*virtual*/ void draw() override; void drawStartTexture(F32 alpha); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); - /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask) override; + /*virtual*/ void setVisible(BOOL visible) override; // inherited from LLViewerMediaObserver - /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; void setText(const std::string& text); void setPercent(const F32 percent); diff --git a/indra/newview/llrecentpeople.cpp b/indra/newview/llrecentpeople.cpp index 77474bbd7b8e5bba1ffc9e5d96144e256e291af1..65ca52c475e549904853f950893536cc9e00a4d7 100644 --- a/indra/newview/llrecentpeople.cpp +++ b/indra/newview/llrecentpeople.cpp @@ -55,7 +55,7 @@ bool LLRecentPeople::add(const LLUUID& id, LLSD& userdata) if (id == gAgent.getID()) return false; - bool is_not_group_id = LLGroupMgr::getInstance()->getGroupData(id) == NULL; + bool is_not_group_id = LLGroupMgr::getInstance()->getGroupData(id) == nullptr; if (is_not_group_id) { diff --git a/indra/newview/llrecentpeople.h b/indra/newview/llrecentpeople.h index 6b8fd720fa3f8915705d7215c605f1cbba100dc5..abfcb0ac0fb8b81535e45d077840cf97e4697a43 100644 --- a/indra/newview/llrecentpeople.h +++ b/indra/newview/llrecentpeople.h @@ -110,7 +110,7 @@ public: /** * LLSimpleListener interface. */ - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); + /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override; /** * Saves recent people to file diff --git a/indra/newview/llregioninfomodel.cpp b/indra/newview/llregioninfomodel.cpp index f2ce042d7b546a1a602db1615e031af70490fd8f..71e4d4e70cdddcef87562bb7dc6b12441f642ad7 100644 --- a/indra/newview/llregioninfomodel.cpp +++ b/indra/newview/llregioninfomodel.cpp @@ -215,7 +215,7 @@ void LLRegionInfoModel::sendEstateOwnerMessage( if (strings.empty()) { msg->nextBlock("ParamList"); - msg->addString("Parameter", NULL); + msg->addString("Parameter", nullptr); } else { diff --git a/indra/newview/llregionposition.cpp b/indra/newview/llregionposition.cpp index c0a70e9960d0f320431dc35d1c0fec79fce9af7f..eb325c47352d195578c98fc2e6816184773a326b 100644 --- a/indra/newview/llregionposition.cpp +++ b/indra/newview/llregionposition.cpp @@ -36,7 +36,7 @@ LLRegionPosition::LLRegionPosition() { - mRegionp = NULL; + mRegionp = nullptr; } LLRegionPosition::LLRegionPosition(LLViewerRegion *regionp, const LLVector3 &position) diff --git a/indra/newview/llregionposition.h b/indra/newview/llregionposition.h index 8f72fa2e4e916a918741159176f9bd31802fc465..8c028d1c1198968c5737c72ab6b2234dea9d7853 100644 --- a/indra/newview/llregionposition.h +++ b/indra/newview/llregionposition.h @@ -54,7 +54,7 @@ public: const LLVector3 getPositionAgent() const; - void clear() { mRegionp = NULL; mPositionRegion.clearVec(); } + void clear() { mRegionp = nullptr; mPositionRegion.clearVec(); } // LLRegionPosition operator+(const LLRegionPosition &pos) const; }; diff --git a/indra/newview/llsaveoutfitcombobtn.cpp b/indra/newview/llsaveoutfitcombobtn.cpp index 81dce487fea508eaa57d0f59d76a318fed660652..01e97b631b8efcb83dbfc533033a9515a8129a84 100644 --- a/indra/newview/llsaveoutfitcombobtn.cpp +++ b/indra/newview/llsaveoutfitcombobtn.cpp @@ -38,7 +38,7 @@ static const std::string SAVE_BTN("save_btn"); static const std::string SAVE_FLYOUT_BTN("save_flyout_btn"); LLSaveOutfitComboBtn::LLSaveOutfitComboBtn(LLPanel* parent, bool saveAsDefaultAction): - mParent(parent), mSaveAsDefaultAction(saveAsDefaultAction) + mSaveAsDefaultAction(saveAsDefaultAction), mParent(parent) { // register action mapping before creating menu LLUICtrl::CommitCallbackRegistry::ScopedRegistrar save_registar; diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index c06faa2d600a22c14b2b4f17065dfb8a3aea33d8..4b1e163f7b9af2ca2e4746f2c5d3a451c4a2cedd 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -44,7 +44,7 @@ #include "llviewerparcelmgr.h" #include "llviewerpartsim.h" -LLSceneMonitorView* gSceneMonitorView = NULL; +LLSceneMonitorView* gSceneMonitorView = nullptr; // //The procedures of monitoring when the scene finishes loading visually, @@ -60,16 +60,16 @@ LLSceneMonitorView* gSceneMonitorView = NULL; LLSceneMonitor::LLSceneMonitor() : mEnabled(false), - mDiff(NULL), - mDiffResult(0.f), - mDiffTolerance(0.1f), - mDiffState(WAITING_FOR_NEXT_DIFF), mDebugViewerVisible(false), + mDiffState(WAITING_FOR_NEXT_DIFF), + mDiff(nullptr), mQueryObject(0), + mDiffResult(0.f), + mDiffTolerance(0.1f), mDiffPixelRatio(0.5f) { - mFrames[0] = NULL; - mFrames[1] = NULL; + mFrames[0] = nullptr; + mFrames[1] = nullptr; } LLSceneMonitor::~LLSceneMonitor() @@ -77,7 +77,7 @@ LLSceneMonitor::~LLSceneMonitor() mDiffState = VIEWER_QUITTING; reset(); - mDitheringTexture = NULL; + mDitheringTexture = nullptr; } void LLSceneMonitor::reset() @@ -86,9 +86,9 @@ void LLSceneMonitor::reset() delete mFrames[1]; delete mDiff; - mFrames[0] = NULL; - mFrames[1] = NULL; - mDiff = NULL; + mFrames[0] = nullptr; + mFrames[1] = nullptr; + mDiff = nullptr; mMonitorRecording.reset(); mSceneLoadRecording.reset(); @@ -171,7 +171,7 @@ void LLSceneMonitor::setDebugViewerVisible(bool visible) LLRenderTarget& LLSceneMonitor::getCaptureTarget() { - LLRenderTarget* cur_target = NULL; + LLRenderTarget* cur_target = nullptr; S32 width = gViewerWindow->getWorldViewWidthRaw(); S32 height = gViewerWindow->getWorldViewHeightRaw(); @@ -447,7 +447,7 @@ void LLSceneMonitor::calcDiffAggregate() glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); } - LLGLSLShader* cur_shader = NULL; + LLGLSLShader* cur_shader = nullptr; cur_shader = LLGLSLShader::sCurBoundShaderPtr; gOneTextureFilterProgram.bind(); @@ -468,7 +468,7 @@ void LLSceneMonitor::calcDiffAggregate() gOneTextureFilterProgram.unbind(); - if(cur_shader != NULL) + if(cur_shader != nullptr) { cur_shader->bind(); } diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h index 6767f42105b76d01d5817b267756347f61dd6e19..2ef00f779006c368d869ea175fbb7c3324b74142 100644 --- a/indra/newview/llscenemonitor.h +++ b/indra/newview/llscenemonitor.h @@ -111,13 +111,13 @@ class LLSceneMonitorView : public LLFloater public: LLSceneMonitorView(const LLRect& rect); ~LLSceneMonitorView(); - virtual void draw(); + void draw() override; - virtual void onVisibilityChange(BOOL visible); + void onVisibilityChange(BOOL visible) override; protected: - virtual void onClose(bool app_quitting=false); - virtual void onClickCloseBtn(bool app_quitting=false); + void onClose(bool app_quitting=false) override; + void onClickCloseBtn(bool app_quitting=false) override; void onTeleportFinished(); boost::signals2::connection sTeleportFinishConnection; }; diff --git a/indra/newview/llsceneview.cpp b/indra/newview/llsceneview.cpp index 97ff5d228449e9c41e3049dc75fa677b7aa24cd5..6e03e72fe41c23c29a3128a76c610ebcc82af987 100644 --- a/indra/newview/llsceneview.cpp +++ b/indra/newview/llsceneview.cpp @@ -36,7 +36,7 @@ #include "llagent.h" #include "llvolumemgr.h" -LLSceneView* gSceneView = NULL; +LLSceneView* gSceneView = nullptr; //borrow this helper function from llfasttimerview.cpp template <class VEC_TYPE> diff --git a/indra/newview/llsceneview.h b/indra/newview/llsceneview.h index e077c358b4c3639fa8aa728ceb9f9bcbf8df6e70..7ddb524a98b511e7ca2d822ce2c7c9d0cc28ff38 100644 --- a/indra/newview/llsceneview.h +++ b/indra/newview/llsceneview.h @@ -35,11 +35,11 @@ class LLSceneView : public LLFloater public: LLSceneView(const LLRect& rect); - virtual void draw(); + void draw() override; protected: - virtual void onClose(bool app_qutting = false); - virtual void onClickCloseBtn(bool app_qutting = false); + void onClose(bool app_qutting = false) override; + void onClickCloseBtn(bool app_qutting = false) override; }; diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index dad390eeed84c7b2ff7017c7272f24cc8eca5909..cbc1f9ff90b38e091fdb75e9a31cdee8ce0d507e 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -56,12 +56,12 @@ LLRect LLScreenChannelBase::getChannelRect() { LL_RECORD_BLOCK_TIME(FTM_GET_CHANNEL_RECT); - if (mFloaterSnapRegion == NULL) + if (mFloaterSnapRegion == nullptr) { mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); } - if (mChicletRegion == NULL) + if (mChicletRegion == nullptr) { mChicletRegion = gViewerWindow->getRootView()->getChildView("chiclet_container"); } @@ -84,17 +84,17 @@ LLRect LLScreenChannelBase::getChannelRect() LLScreenChannelBase::LLScreenChannelBase(const Params& p) : LLUICtrl(p), - mToastAlignment(p.toast_align), - mCanStoreToasts(true), - mHiddenToastsNum(0), - mHoveredToast(NULL), mControlHovering(false), - mShowToasts(true), - mID(p.id), + mHoveredToast(nullptr), + mCanStoreToasts(true), mDisplayToastsAlways(p.display_toasts_always), + mShowToasts(true), + mToastAlignment(p.toast_align), mChannelAlignment(p.channel_align), - mFloaterSnapRegion(NULL), - mChicletRegion(NULL) + mHiddenToastsNum(0), + mID(p.id), + mFloaterSnapRegion(nullptr), + mChicletRegion(nullptr) { mID = p.id; @@ -104,12 +104,12 @@ LLScreenChannelBase::LLScreenChannelBase(const Params& p) BOOL LLScreenChannelBase::postBuild() { - if (mFloaterSnapRegion == NULL) + if (mFloaterSnapRegion == nullptr) { mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region"); } - if (mChicletRegion == NULL) + if (mChicletRegion == nullptr) { mChicletRegion = gViewerWindow->getRootView()->getChildView("chiclet_container"); } @@ -187,7 +187,7 @@ void LLScreenChannelBase::updateRect() //-------------------------------------------------------------------------- LLScreenChannel::LLScreenChannel(const Params& p) : LLScreenChannelBase(p), - mStartUpToastPanel(NULL) + mStartUpToastPanel(nullptr) { } @@ -291,7 +291,7 @@ void LLScreenChannel::addToast(const LLToast::Params& p) // It was assumed that the toast would take ownership of the panel pointer. // But since we have decided not to display the toast, kill the panel to // prevent the memory leak. - if (p.panel != NULL) + if (p.panel != nullptr) { p.panel()->die(); } @@ -348,7 +348,7 @@ void LLScreenChannel::onToastDestroyed(LLToast* toast) // if destroyed toast is hovered - reset hovered if (mHoveredToast == toast) { - mHoveredToast = NULL; + mHoveredToast = nullptr; } } @@ -391,7 +391,7 @@ void LLScreenChannel::deleteToast(LLToast* toast) // turning hovering off manually because onMouseLeave won't happen if a toast was closed using a keyboard if(mHoveredToast == toast) { - mHoveredToast = NULL; + mHoveredToast = nullptr; } } @@ -942,10 +942,10 @@ void LLScreenChannel::onStartUpToastHide() //-------------------------------------------------------------------------- void LLScreenChannel::closeStartUpToast() { - if(mStartUpToastPanel != NULL) + if(mStartUpToastPanel != nullptr) { mStartUpToastPanel->setVisible(FALSE); - mStartUpToastPanel = NULL; + mStartUpToastPanel = nullptr; } } @@ -1013,7 +1013,7 @@ void LLScreenChannel::closeHiddenToasts(const Matcher& matcher) { LLToast* toast = it->getToast(); // add to list valid toast that match to provided matcher criteria - if (toast != NULL && !toast->isDead() && toast->getNotification() != NULL + if (toast != nullptr && !toast->isDead() && toast->getNotification() != nullptr && !toast->getVisible() && matcher.matches(toast->getNotification())) { toasts.push_back(toast); @@ -1098,11 +1098,11 @@ void LLScreenChannel::onToastHover(LLToast* toast, bool mouse_enter) mHoveredToast = toast; } } - else if (mHoveredToast != NULL) + else if (mHoveredToast != nullptr) { if (!mHoveredToast->isHovered()) { - mHoveredToast = NULL; + mHoveredToast = nullptr; } } @@ -1131,7 +1131,7 @@ LLToast* LLScreenChannel::getToastByNotificationID(LLUUID id) mStoredToastList.end(), id); if (it == mStoredToastList.end()) - return NULL; + return nullptr; return it->getToast(); } diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 6c4e5ff9bd6a9d60e9ed8c32ed918469684194fb..d72f8afc51ccba959767b04b2359491520a517f0 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -67,9 +67,9 @@ public: LLScreenChannelBase(const Params&); - BOOL postBuild(); + BOOL postBuild() override; - void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; // Channel's outfit-functions // update channel's size and position in the World View @@ -164,20 +164,20 @@ public: // Channel's outfit-functions // update channel's size and position in the World View - void updatePositionAndSize(LLRect new_rect); + void updatePositionAndSize(LLRect new_rect) override; // initialization of channel's shape and position - void init(S32 channel_left, S32 channel_right); + void init(S32 channel_left, S32 channel_right) override; // Operating with toasts // add a toast to a channel void addToast(const LLToast::Params& p); // kill or modify a toast by its ID - void killToastByNotificationID(LLUUID id); - void removeToastByNotificationID(LLUUID id); + void killToastByNotificationID(LLUUID id) override; + void removeToastByNotificationID(LLUUID id) override; void killMatchedToasts(const Matcher& matcher); void modifyToastByNotificationID(LLUUID id, LLPanel* panel); // hide all toasts from screen, but not remove them from a channel - void hideToastsFromScreen(); + void hideToastsFromScreen() override; // hide toast by notification id void hideToast(const LLUUID& notification_id); @@ -187,9 +187,9 @@ public: void closeHiddenToasts(const Matcher& matcher); // removes all toasts from a channel - void removeToastsFromChannel(); + void removeToastsFromChannel() override; // show all toasts in a channel - void redrawToasts(); + void redrawToasts() override; // void loadStoredToastsToChannel(); // finds a toast among stored by its Notification ID and throws it on a screen to a channel diff --git a/indra/newview/llscripteditor.h b/indra/newview/llscripteditor.h index f458203a396ac6638ec883ca0feb8757825f6a7a..b9bf1a22ca01ef0c470ed814b5bc449508c0a020 100644 --- a/indra/newview/llscripteditor.h +++ b/indra/newview/llscripteditor.h @@ -44,7 +44,7 @@ public: virtual ~LLScriptEditor() {}; // LLView override - virtual void draw(); + void draw() override; void initKeywords(); void loadKeywords(); @@ -58,8 +58,8 @@ protected: private: void drawLineNumbers(); - /* virtual */ void updateSegments(); - /* virtual */ void drawSelectionBackground(); + /* virtual */ void updateSegments() override; + /* virtual */ void drawSelectionBackground() override; void loadKeywords(const std::string& filename_keywords, const std::string& filename_colors); diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index ea6a46b256c79e2fbeec14c81859e4e64bccac1a..ac93823d3ed256abeaf155d5105e39a18bb6580f 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -64,8 +64,8 @@ LLUUID notification_id_to_object_id(const LLUUID& notification_id) ////////////////////////////////////////////////////////////////////////// LLScriptFloater::LLScriptFloater(const LLSD& key) -: LLDockableFloater(NULL, true, key) -, mScriptForm(NULL) +: LLDockableFloater(nullptr, true, key) +, mScriptForm(nullptr) , mSaveFloaterPosition(false) { setMouseDownCallback(boost::bind(&LLScriptFloater::onMouseDown, this)); @@ -98,7 +98,7 @@ bool LLScriptFloater::toggle(const LLUUID& notification_id) } LLChicletPanel * chiclet_panelp = LLChicletBar::getInstance()->getChicletPanel(); - if (NULL != chiclet_panelp) + if (nullptr != chiclet_panelp) { chiclet_panelp->setChicletToggleState(notification_id, true); } @@ -148,7 +148,7 @@ void LLScriptFloater::createForm(const LLUUID& notification_id) } LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); - if(NULL == notification) + if(nullptr == notification) { return; } @@ -214,10 +214,10 @@ void LLScriptFloater::setVisible(BOOL visible) if(!visible) { LLChicletPanel * chiclet_panelp = LLChicletBar::getInstance()->getChicletPanel(); - if (NULL != chiclet_panelp) + if (nullptr != chiclet_panelp) { LLIMChiclet * chicletp = chiclet_panelp->findChiclet<LLIMChiclet>(getNotificationId()); - if(NULL != chicletp) + if(nullptr != chicletp) { chicletp->setToggleState(false); } @@ -230,11 +230,11 @@ void LLScriptFloater::onMouseDown() if(getNotificationId().notNull()) { LLChicletPanel * chiclet_panelp = LLChicletBar::getInstance()->getChicletPanel(); - if (NULL != chiclet_panelp) + if (nullptr != chiclet_panelp) { LLIMChiclet * chicletp = chiclet_panelp->findChiclet<LLIMChiclet>(getNotificationId()); // Remove new message icon - if (NULL == chicletp) + if (nullptr == chicletp) { LL_ERRS() << "Dock chiclet for LLScriptFloater doesn't exist" << LL_ENDL; } @@ -278,7 +278,7 @@ void LLScriptFloater::onFocusLost() if(getNotificationId().notNull()) { LLChicletPanel * chiclet_panelp = LLChicletBar::getInstance()->getChicletPanel(); - if (NULL != chiclet_panelp) + if (nullptr != chiclet_panelp) { chiclet_panelp->setChicletToggleState(getNotificationId(), false); } @@ -291,7 +291,7 @@ void LLScriptFloater::onFocusReceived() if(getNotificationId().notNull()) { LLChicletPanel * chiclet_panelp = LLChicletBar::getInstance()->getChicletPanel(); - if (NULL != chiclet_panelp) + if (nullptr != chiclet_panelp) { chiclet_panelp->setChicletToggleState(getNotificationId(), true); } @@ -300,13 +300,13 @@ void LLScriptFloater::onFocusReceived() void LLScriptFloater::dockToChiclet(bool dock) { - if (getDockControl() == NULL) + if (getDockControl() == nullptr) { LLChicletPanel * chiclet_panelp = LLChicletBar::getInstance()->getChicletPanel(); - if (NULL != chiclet_panelp) + if (nullptr != chiclet_panelp) { LLChiclet * chicletp = chiclet_panelp->findChiclet<LLChiclet>(getNotificationId()); - if (NULL == chicletp) + if (nullptr == chicletp) { LL_WARNS() << "Dock chiclet for LLScriptFloater doesn't exist" << LL_ENDL; return; @@ -374,10 +374,10 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) { LLUUID old_id = it->first; // </alchemy> copy LLUUID to prevent use after free LLChicletPanel * chiclet_panelp = LLChicletBar::getInstance()->getChicletPanel(); - if (NULL != chiclet_panelp) + if (nullptr != chiclet_panelp) { LLIMChiclet * chicletp = chiclet_panelp->findChiclet<LLIMChiclet>(old_id); - if(NULL != chicletp) + if(nullptr != chicletp) { // Pass the new_message icon state further. set_new_message = chicletp->getShowNewMessagesIcon(); @@ -398,7 +398,7 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) mNotifications.insert(std::make_pair(notification_id, object_id)); LLChicletPanel * chiclet_panelp = LLChicletBar::getInstance()->getChicletPanel(); - if (NULL != chiclet_panelp) + if (nullptr != chiclet_panelp) { // Create inventory offer chiclet for offer type notifications if( OBJ_GIVE_INVENTORY == obj_type ) @@ -425,7 +425,7 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) void LLScriptFloaterManager::removeNotification(const LLUUID& notification_id) { LLNotificationPtr notification = LLNotifications::instance().find(notification_id); - if (notification != NULL && !notification->isCancelled()) + if (notification != nullptr && !notification->isCancelled()) { LLNotificationsUtil::cancel(notification); } @@ -445,7 +445,7 @@ void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id) if (LLChicletBar::instanceExists()) { LLChicletPanel * chiclet_panelp = LLChicletBar::getInstance()->getChicletPanel(); - if (NULL != chiclet_panelp) + if (nullptr != chiclet_panelp) { chiclet_panelp->removeChiclet(notification_id); } diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index c0b84abdcb1f9eb6123a6b2524828f92914dddd7..b7bbb728777332667499716bae02a2e4bda49a53 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -159,17 +159,17 @@ public: /** * Close notification if script floater is closed. */ - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onClose(bool app_quitting) override; /** * Hide all notification toasts when we show dockable floater */ - /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); + /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true) override; /** * Hide all notification toasts when we show dockable floater */ - /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ void setVisible(BOOL visible) override; bool getSavePosition() { return mSaveFloaterPosition; } @@ -196,9 +196,9 @@ protected: */ void onMouseDown(); - /*virtual*/ void onFocusLost(); + /*virtual*/ void onFocusLost() override; - /*virtual*/ void onFocusReceived(); + /*virtual*/ void onFocusReceived() override; void dockToChiclet(bool dock); diff --git a/indra/newview/llscrollingpanelparam.h b/indra/newview/llscrollingpanelparam.h index c7a47d5c7a585fe924de09d0ea07ed269d99ac01..5156b80bcf9d04c5aabb39a4599b86bcba463356 100644 --- a/indra/newview/llscrollingpanelparam.h +++ b/indra/newview/llscrollingpanelparam.h @@ -44,9 +44,9 @@ public: LLViewerJointMesh* mesh, LLViewerVisualParam* param, BOOL allow_modify, LLWearable* wearable, LLJoint* jointp, BOOL use_hints = TRUE ); virtual ~LLScrollingPanelParam(); - virtual void draw(); - virtual void setVisible( BOOL visible ); - virtual void updatePanel(BOOL allow_modify); + void draw() override; + void setVisible( BOOL visible ) override; + void updatePanel(BOOL allow_modify) override; static void onSliderMouseDown(LLUICtrl* ctrl, void* userdata); static void onSliderMouseUp(LLUICtrl* ctrl, void* userdata); diff --git a/indra/newview/llscrollingpanelparambase.h b/indra/newview/llscrollingpanelparambase.h index 95388262514bc455c4e6f0170157d9c9c366fd37..4c188d08549e4cff197b4d82fc7c6f50c9608db7 100644 --- a/indra/newview/llscrollingpanelparambase.h +++ b/indra/newview/llscrollingpanelparambase.h @@ -45,7 +45,7 @@ public: LLViewerJointMesh* mesh, LLViewerVisualParam* param, BOOL allow_modify, LLWearable* wearable, LLJoint* jointp, BOOL use_hints = FALSE ); virtual ~LLScrollingPanelParamBase(); - virtual void updatePanel(BOOL allow_modify); + void updatePanel(BOOL allow_modify) override; static void onSliderMoved(LLUICtrl* ctrl, void* userdata); diff --git a/indra/newview/llsearchcombobox.cpp b/indra/newview/llsearchcombobox.cpp index 87f4521b7524cc084f01b436c08aaaf84b8086f1..f506d62fd2714122d8f633365909d8254121ab82 100644 --- a/indra/newview/llsearchcombobox.cpp +++ b/indra/newview/llsearchcombobox.cpp @@ -76,7 +76,7 @@ LLSearchComboBox::LLSearchComboBox(const Params&p) setButtonVisible(p.dropdown_button_visible); mTextEntry->setCommitCallback(boost::bind(&LLComboBox::onTextCommit, this, _2)); - mTextEntry->setKeystrokeCallback(boost::bind(&LLComboBox::onTextEntry, this, _1), NULL); + mTextEntry->setKeystrokeCallback(boost::bind(&LLComboBox::onTextEntry, this, _1), nullptr); setCommitCallback(boost::bind(&LLSearchComboBox::onSelectionCommit, this)); setPrearrangeCallback(boost::bind(&LLSearchComboBox::onSearchPrearrange, this, _2)); mSearchButton->setCommitCallback(boost::bind(&LLSearchComboBox::onTextCommit, this, _2)); @@ -238,7 +238,7 @@ void LLSearchHistoryBuilder::buildSearchHistory() { mFilteredSearchHistory.clear(); - LLSearchHistory::search_history_list_t* itemsp = NULL; + LLSearchHistory::search_history_list_t* itemsp = nullptr; LLSearchHistory* sh = LLSearchHistory::getInstance(); if (mFilter.empty()) diff --git a/indra/newview/llsearchcombobox.h b/indra/newview/llsearchcombobox.h index 68f397953291b68025b77280c9de915d0091332d..6cf2b90a71a312ecea6ebdef377c3e45b1f8e196 100644 --- a/indra/newview/llsearchcombobox.h +++ b/indra/newview/llsearchcombobox.h @@ -57,7 +57,7 @@ public: */ void clearHistory(); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask) override; ~LLSearchComboBox(); @@ -69,12 +69,12 @@ protected: /** * Handles typing in text box */ - void onTextEntry(LLLineEditor* line_editor); + void onTextEntry(LLLineEditor* line_editor) override; /** * Hides drop down list and focuses text box */ - void hideList(); + void hideList() override; /** * Rebuilds search history, case insensitive diff --git a/indra/newview/llsechandler_basic.h b/indra/newview/llsechandler_basic.h index 5accdb0da063312b38299ed5cb86e83e7f033178..2cf764f9f11746388f192e41cd88fec52e5a850f 100644 --- a/indra/newview/llsechandler_basic.h +++ b/indra/newview/llsechandler_basic.h @@ -51,12 +51,12 @@ public: LLBasicCertificate(X509* openSSLX509); virtual ~LLBasicCertificate(); - - virtual std::string getPem() const; - virtual std::vector<U8> getBinary() const; - virtual void getLLSD(LLSD &llsd); - virtual X509* getOpenSSLX509() const; + std::string getPem() const override; + std::vector<U8> getBinary() const override; + void getLLSD(LLSD &llsd) override; + + X509* getOpenSSLX509() const override; // set llsd elements for testing void setLLSD(const std::string name, const LLSD& value) { mLLSDInfo[name] = value; } @@ -92,7 +92,7 @@ public: BasicIteratorImpl(std::vector<LLPointer<LLCertificate> >::iterator _iter) { mIter = _iter;} virtual ~BasicIteratorImpl() {}; // seek forward or back. Used by the operator++/operator-- implementations - virtual void seek(bool incr) + void seek(bool incr) override { if(incr) { @@ -104,19 +104,20 @@ public: } } // create a copy of the iterator implementation class, used by the iterator copy constructor - virtual LLPointer<iterator_impl> clone() const + LLPointer<iterator_impl> clone() const override { return new BasicIteratorImpl(mIter); } - - virtual bool equals(const LLPointer<iterator_impl>& _iter) const + + bool equals(const LLPointer<iterator_impl>& _iter) const override { const BasicIteratorImpl *rhs_iter = dynamic_cast<const BasicIteratorImpl *>(_iter.get()); llassert(rhs_iter); if (!rhs_iter) return 0; return (mIter == rhs_iter->mIter); } - virtual LLPointer<LLCertificate> get() + + LLPointer<LLCertificate> get() override { return *mIter; } @@ -126,27 +127,27 @@ public: }; // numeric index of the vector - virtual LLPointer<LLCertificate> operator[](int _index) { return mCerts[_index];} + LLPointer<LLCertificate> operator[](int _index) override { return mCerts[_index];} // Iteration - virtual iterator begin() { return iterator(new BasicIteratorImpl(mCerts.begin())); } - - virtual iterator end() { return iterator(new BasicIteratorImpl(mCerts.end())); } + iterator begin() override { return iterator(new BasicIteratorImpl(mCerts.begin())); } + + iterator end() override { return iterator(new BasicIteratorImpl(mCerts.end())); } // find a cert given params - virtual iterator find(const LLSD& params); + iterator find(const LLSD& params) override; // return the number of certs in the store - virtual int size() const { return mCerts.size(); } + int size() const override { return mCerts.size(); } // insert the cert to the store. if a copy of the cert already exists in the store, it is removed first - virtual void add(LLPointer<LLCertificate> cert) { insert(end(), cert); } + void add(LLPointer<LLCertificate> cert) override { insert(end(), cert); } // insert the cert to the store. if a copy of the cert already exists in the store, it is removed first - virtual void insert(iterator _iter, LLPointer<LLCertificate> cert); + void insert(iterator _iter, LLPointer<LLCertificate> cert) override; // remove a certificate from the store - virtual LLPointer<LLCertificate> erase(iterator _iter); + LLPointer<LLCertificate> erase(iterator _iter) override; protected: std::vector<LLPointer<LLCertificate> >mCerts; @@ -166,16 +167,16 @@ public: virtual ~LLBasicCertificateStore(); // persist the store - virtual void save(); + void save() override; // return the store id - virtual std::string storeId() const; + std::string storeId() const override; // validate a certificate chain against a certificate store, using the // given validation policy. - virtual void validate(int validation_policy, + void validate(int validation_policy, LLPointer<LLCertificateChain> ca_chain, - const LLSD& validation_params); + const LLSD& validation_params) override; protected: std::vector<LLPointer<LLCertificate> > mCerts; @@ -211,10 +212,10 @@ public: LLSecAPIBasicCredential(const std::string& grid) : LLCredential(grid) {} virtual ~LLSecAPIBasicCredential() {} // return a value representing the user id, (could be guid, name, whatever) - virtual std::string userID() const; + std::string userID() const override; // printible string identifying the credential. - virtual std::string asString() const; + std::string asString() const override; }; // LLSecAPIBasicHandler Class @@ -227,49 +228,49 @@ public: const std::string& legacy_password_path); LLSecAPIBasicHandler(); - void init(); + void init() override; virtual ~LLSecAPIBasicHandler(); // instantiate a certificate from a pem string - virtual LLPointer<LLCertificate> getCertificate(const std::string& pem_cert); + LLPointer<LLCertificate> getCertificate(const std::string& pem_cert) override; // instiate a certificate from an openssl X509 structure - virtual LLPointer<LLCertificate> getCertificate(X509* openssl_cert); + LLPointer<LLCertificate> getCertificate(X509* openssl_cert) override; // instantiate a chain from an X509_STORE_CTX - virtual LLPointer<LLCertificateChain> getCertificateChain(X509_STORE_CTX* chain); + LLPointer<LLCertificateChain> getCertificateChain(X509_STORE_CTX* chain) override; // instantiate a cert store given it's id. if a persisted version // exists, it'll be loaded. If not, one will be created (but not // persisted) - virtual LLPointer<LLCertificateStore> getCertificateStore(const std::string& store_id); + LLPointer<LLCertificateStore> getCertificateStore(const std::string& store_id) override; // persist data in a protected store - virtual void setProtectedData(const std::string& data_type, + void setProtectedData(const std::string& data_type, const std::string& data_id, - const LLSD& data); + const LLSD& data) override; // retrieve protected data - virtual LLSD getProtectedData(const std::string& data_type, - const std::string& data_id); + LLSD getProtectedData(const std::string& data_type, + const std::string& data_id) override; // delete a protected data item from the store - virtual void deleteProtectedData(const std::string& data_type, - const std::string& data_id); + void deleteProtectedData(const std::string& data_type, + const std::string& data_id) override; // credential management routines - - virtual LLPointer<LLCredential> createCredential(const std::string& grid, + + LLPointer<LLCredential> createCredential(const std::string& grid, const LLSD& identifier, - const LLSD& authenticator); - - virtual LLPointer<LLCredential> loadCredential(const std::string& grid); + const LLSD& authenticator) override; - virtual void saveCredential(LLPointer<LLCredential> cred, bool save_authenticator); - - virtual void deleteCredential(LLPointer<LLCredential> cred); + LLPointer<LLCredential> loadCredential(const std::string& grid) override; + + void saveCredential(LLPointer<LLCredential> cred, bool save_authenticator) override; + + void deleteCredential(LLPointer<LLCredential> cred) override; protected: void _readProtectedData(); diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 988484fa1cf83dbc6d872557e6e5d7903f5c7a5f..12dd61a2b8d4e5719a5f433b07b1fab04c7e8e78 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -243,7 +243,7 @@ public: { bool operator()(LLSelectNode* node) { - return (node->getObject() != NULL); + return (node->getObject() != nullptr); } }; typedef boost::filter_iterator<is_non_null, list_t::iterator > iterator; @@ -254,7 +254,7 @@ public: { bool operator()(LLSelectNode* node) { - return (node->getObject() != NULL) && node->mValid; + return (node->getObject() != nullptr) && node->mValid; } }; typedef boost::filter_iterator<is_valid, list_t::iterator > valid_iterator; @@ -292,8 +292,8 @@ public: BOOL isEmpty() const; - LLSelectNode* getFirstNode(LLSelectedNodeFunctor* func = NULL); - LLSelectNode* getFirstRootNode(LLSelectedNodeFunctor* func = NULL, BOOL non_root_ok = FALSE); + LLSelectNode* getFirstNode(LLSelectedNodeFunctor* func = nullptr); + LLSelectNode* getFirstRootNode(LLSelectedNodeFunctor* func = nullptr, BOOL non_root_ok = FALSE); LLViewerObject* getFirstSelectedObject(LLSelectedNodeFunctor* func, BOOL get_parent = FALSE); LLViewerObject* getFirstObject(); LLViewerObject* getFirstRootObject(BOOL non_root_ok = FALSE); @@ -324,8 +324,8 @@ public: F32 getSelectedLinksetPhysicsCost(); S32 getSelectedObjectRenderCost(); - F32 getSelectedObjectStreamingCost(S32* total_bytes = NULL, S32* visible_bytes = NULL); - U32 getSelectedObjectTriangleCount(S32* vcount = NULL); + F32 getSelectedObjectStreamingCost(S32* total_bytes = nullptr, S32* visible_bytes = nullptr); + U32 getSelectedObjectTriangleCount(S32* vcount = nullptr); S32 getTECount(); S32 getRootObjectCount(); @@ -418,17 +418,17 @@ public: static void cleanupGlobals(); // LLEditMenuHandler interface - virtual BOOL canUndo() const; - virtual void undo(); + BOOL canUndo() const override; + void undo() override; - virtual BOOL canRedo() const; - virtual void redo(); + BOOL canRedo() const override; + void redo() override; - virtual BOOL canDoDelete() const; - virtual void doDelete(); + BOOL canDoDelete() const override; + void doDelete() override; - virtual void deselect(); - virtual BOOL canDeselect() const; + void deselect() override; + BOOL canDeselect() const override; virtual void duplicate(); virtual BOOL canDuplicate() const; diff --git a/indra/newview/llshareavatarhandler.cpp b/indra/newview/llshareavatarhandler.cpp index 22196ba22836f601e1ee28b7c66f3d7a1f407f2e..72d453c3d88ae0409e9efa534e2ccc1f274225e3 100644 --- a/indra/newview/llshareavatarhandler.cpp +++ b/indra/newview/llshareavatarhandler.cpp @@ -40,7 +40,7 @@ public: { } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { if (!LLUI::sSettingGroups["config"]->getBOOL("EnableAvatarShare")) { diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index fc9bb49e1bf9fb8d048ed11ffe1d501bd926a8f3..838fac77e84659113916cb9fd830f7f9df84580b 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -62,7 +62,8 @@ public: mPanel(panel) {} ~LLCurrentlyWornFetchObserver() {} - virtual void done() + + void done() override { mPanel->inventoryFetched(); gInventory.removeObserver(this); @@ -75,10 +76,10 @@ private: LLSidepanelAppearance::LLSidepanelAppearance() : LLPanel(), mOutfitLoadingIndicator(nullptr), - mFilterEditor(NULL), - mOutfitEdit(NULL), + mFilterEditor(nullptr), + mOutfitEdit(nullptr), mEditOutfitBtn(nullptr), - mCurrOutfitPanel(NULL), + mCurrOutfitPanel(nullptr), mFilterSubString(LLStringUtil::null), mOpened(false) { @@ -315,7 +316,7 @@ void LLSidepanelAppearance::showOutfitEditPanel() // is returning back to the mOutfitEdit panel from the mEditWearable panel. // The simplest way to control this is to check the visibility state of the mEditWearable // BEFORE it is changed by the call to the toggleWearableEditPanel(FALSE, NULL, TRUE). - if (mEditWearable != NULL && !mEditWearable->getVisible() && mOutfitEdit != NULL) + if (mEditWearable != nullptr && !mEditWearable->getVisible() && mOutfitEdit != nullptr) { mOutfitEdit->resetAccordionState(); } @@ -323,14 +324,14 @@ void LLSidepanelAppearance::showOutfitEditPanel() // If we're exiting the edit wearable view, and the camera was not focused on the avatar // (e.g. such as if we were editing a physics param), then skip the outfits edit mode since // otherwise this would trigger the camera focus mode. - if (mEditWearable != NULL && mEditWearable->getVisible() && !gAgentCamera.cameraCustomizeAvatar()) + if (mEditWearable != nullptr && mEditWearable->getVisible() && !gAgentCamera.cameraCustomizeAvatar()) { showOutfitsInventoryPanel(); return; } toggleMyOutfitsPanel(FALSE); - toggleWearableEditPanel(FALSE, NULL, TRUE); // don't switch out of edit appearance mode + toggleWearableEditPanel(FALSE, nullptr, TRUE); // don't switch out of edit appearance mode toggleOutfitEditPanel(TRUE); } @@ -428,7 +429,7 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLViewerWearab { // Save changes if closing. mEditWearable->saveChanges(); - mEditWearable->setWearable(NULL); + mEditWearable->setWearable(nullptr); LLAppearanceMgr::getInstance()->updateIsDirty(); if (change_state) { diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 23499e9d88ec91a9c14b588b848f89bb3526bf66..49ec6b01b90302689757c5143363e68fb4b9778e 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -47,8 +47,8 @@ public: LLSidepanelAppearance(); virtual ~LLSidepanelAppearance(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; void refreshCurrentOutfitName(const std::string& name = ""); @@ -60,7 +60,7 @@ public: void showOutfitsInventoryPanel(); void showOutfitEditPanel(); - void showWearableEditPanel(LLViewerWearable *wearable = NULL, BOOL disable_camera_switch = FALSE); + void showWearableEditPanel(LLViewerWearable *wearable = nullptr, BOOL disable_camera_switch = FALSE); void setWearablesLoading(bool val); void showDefaultSubpart(); void updateScrollingPanelList(); @@ -76,7 +76,7 @@ private: void toggleMyOutfitsPanel(BOOL visible); void toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch = FALSE); - void toggleWearableEditPanel(BOOL visible, LLViewerWearable* wearable = NULL, BOOL disable_camera_switch = FALSE); + void toggleWearableEditPanel(BOOL visible, LLViewerWearable* wearable = nullptr, BOOL disable_camera_switch = FALSE); LLLoadingIndicator* mOutfitLoadingIndicator; LLFilterEditor* mFilterEditor; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 847ef1169c990e377afeee90bc8e028e9a23ab7b..8d229fbaf5525ee0a0360c41885f0b8c78b122ca 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -87,7 +87,7 @@ public: { } - void done() + void done() override { for (cat_vec_t::iterator it = mAddedCategories.begin(); it != mAddedCategories.end(); ++it) { @@ -118,12 +118,12 @@ private: LLSidepanelInventory::LLSidepanelInventory() : LLPanel() , mInventoryPanel(nullptr) - , mItemPanel(NULL) + , mItemPanel(nullptr) , mTaskPanel(nullptr) - , mPanelMainInventory(NULL) + , mPanelMainInventory(nullptr) , mInboxEnabled(false) - , mCategoriesObserver(NULL) - , mInboxAddedObserver(NULL) + , mCategoriesObserver(nullptr) + , mInboxAddedObserver(nullptr) { //buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() } @@ -288,7 +288,7 @@ void LLSidepanelInventory::observeInboxCreation() // Set up observer to track inbox folder creation // - if (mInboxAddedObserver == NULL) + if (mInboxAddedObserver == nullptr) { mInboxAddedObserver = new LLInboxAddedObserver(this); @@ -303,7 +303,7 @@ void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID) // (this can happen multiple times on the initial session that creates the inbox) // - if (mInventoryPanelInbox.get() != NULL) + if (mInventoryPanelInbox.get() != nullptr) { return; } @@ -318,7 +318,7 @@ void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID) return; } - if (mCategoriesObserver == NULL) + if (mCategoriesObserver == nullptr) { mCategoriesObserver = new LLInventoryCategoriesObserver(); gInventory.addObserver(mCategoriesObserver); @@ -698,13 +698,13 @@ LLInventoryPanel *LLSidepanelInventory::getActivePanel() { if (!getVisible()) { - return NULL; + return nullptr; } if (mInventoryPanel->getVisible()) { return mPanelMainInventory->getActivePanel(); } - return NULL; + return nullptr; } BOOL LLSidepanelInventory::isMainInventoryPanelActive() const diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 95146252d7c99e57ffde00dda21d71d493cde1eb..713eff46608be1ef31e06e59e1e1376c71fe2896 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -53,8 +53,8 @@ public: void observeInboxCreation(); void observeInboxModifications(const LLUUID& inboxID); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onOpen(const LLSD& key) override; LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any. LLInventoryPanel* getInboxPanel() const { return mInventoryPanelInbox.get(); } diff --git a/indra/newview/llsidepanelinventorysubpanel.cpp b/indra/newview/llsidepanelinventorysubpanel.cpp index 59b7248f57cf75c76de212234afb97f3570ccd92..9d68a93774e30b99b3494ae5f7fd55ab6263286f 100644 --- a/indra/newview/llsidepanelinventorysubpanel.cpp +++ b/indra/newview/llsidepanelinventorysubpanel.cpp @@ -50,10 +50,10 @@ // Default constructor LLSidepanelInventorySubpanel::LLSidepanelInventorySubpanel(const LLPanel::Params& p) : LLPanel(p), + mSaveBtn(nullptr), + mCancelBtn(nullptr), mIsDirty(TRUE), - mIsEditing(FALSE), - mCancelBtn(NULL), - mSaveBtn(NULL) + mIsEditing(FALSE) { } diff --git a/indra/newview/llsidepanelinventorysubpanel.h b/indra/newview/llsidepanelinventorysubpanel.h index b5cf3aaf17a175fa433c4e50d7c5bac33ac45744..b5932ded7eb1d98b3f05de9e956e7add4c951d97 100644 --- a/indra/newview/llsidepanelinventorysubpanel.h +++ b/indra/newview/llsidepanelinventorysubpanel.h @@ -43,15 +43,15 @@ public: LLSidepanelInventorySubpanel(const LLPanel::Params& p = getDefaultParams()); virtual ~LLSidepanelInventorySubpanel(); - /*virtual*/ void setVisible(BOOL visible); - virtual BOOL postBuild(); - virtual void draw(); + /*virtual*/ void setVisible(BOOL visible) override; + BOOL postBuild() override; + void draw() override; virtual void reset(); void dirty(); void setIsEditing(BOOL edit); protected: - virtual void refresh() = 0; + void refresh() override = 0; virtual void save() = 0; virtual void updateVerbs(); diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 892e565be61166a3e94facc7515092c22bf3f575..c8df5da179ca45fd314394b6af08338dde0b566d 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -119,7 +119,8 @@ public: { gInventory.removeObserver(this); } - virtual void changed(U32 mask); + + void changed(U32 mask) override; private: LLSidepanelItemInfo* mFloater; }; @@ -157,7 +158,7 @@ public: LLObjectInventoryObserver(LLSidepanelItemInfo* floater, LLViewerObject* object) : mFloater(floater) { - registerVOInventoryListener(object, NULL); + registerVOInventoryListener(object, nullptr); } virtual ~LLObjectInventoryObserver() { @@ -166,7 +167,7 @@ public: /*virtual*/ void inventoryChanged(LLViewerObject* object, LLInventoryObject::object_list_t* inventory, S32 serial_num, - void* user_data); + void* user_data) override; private: LLSidepanelItemInfo* mFloater; }; @@ -190,7 +191,7 @@ static LLPanelInjector<LLSidepanelItemInfo> t_item_info("sidepanel_item_info"); LLSidepanelItemInfo::LLSidepanelItemInfo(const LLPanel::Params& p) : LLSidepanelInventorySubpanel(p) , mItemID(LLUUID::null) - , mObjectInventoryObserver(NULL) + , mObjectInventoryObserver(nullptr) { mPropertiesObserver = new LLItemPropertiesObserver(this); } @@ -199,7 +200,7 @@ LLSidepanelItemInfo::LLSidepanelItemInfo(const LLPanel::Params& p) LLSidepanelItemInfo::~LLSidepanelItemInfo() { delete mPropertiesObserver; - mPropertiesObserver = NULL; + mPropertiesObserver = nullptr; stopObjectInventoryObserver(); } @@ -338,7 +339,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) // You need permission to modify the object to modify an inventory // item in it. - LLViewerObject* object = NULL; + LLViewerObject* object = nullptr; if(!mObjectID.isNull()) object = gObjectList.findObject(mObjectID); BOOL is_obj_modify = TRUE; if(object) @@ -732,7 +733,7 @@ void LLSidepanelItemInfo::startObjectInventoryObserver() void LLSidepanelItemInfo::stopObjectInventoryObserver() { delete mObjectInventoryObserver; - mObjectInventoryObserver = NULL; + mObjectInventoryObserver = nullptr; } void LLSidepanelItemInfo::onClickCreator() @@ -1014,7 +1015,7 @@ void LLSidepanelItemInfo::onCommitChanges(LLPointer<LLViewerInventoryItem> item) LLViewerInventoryItem* LLSidepanelItemInfo::findItem() const { - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; if(mObjectID.isNull()) { // it is in agent inventory diff --git a/indra/newview/llsidepaneliteminfo.h b/indra/newview/llsidepaneliteminfo.h index 74cf7afe3530707e6c3fc9d5ad0b7dbfacac168f..660597ea6cd6603132fede21f18e3aeb9842d2ab 100644 --- a/indra/newview/llsidepaneliteminfo.h +++ b/indra/newview/llsidepaneliteminfo.h @@ -47,8 +47,8 @@ public: LLSidepanelItemInfo(const LLPanel::Params& p = getDefaultParams()); virtual ~LLSidepanelItemInfo(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void reset(); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void reset() override; void setObjectID(const LLUUID& object_id); void setItemID(const LLUUID& item_id); @@ -58,8 +58,8 @@ public: const LLUUID& getItemID() const; protected: - /*virtual*/ void refresh(); - /*virtual*/ void save(); + /*virtual*/ void refresh() override; + /*virtual*/ void save() override; LLViewerInventoryItem* findItem() const; LLViewerObject* findObject() const; diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 8c0f285708c2d680cf285b065c34f037ab2ab0c3..c31a0bd0b1603ed67e234363cfb12137fb9c4534 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -88,7 +88,7 @@ static const std::array<std::string, 18> sNoItemNames{{ /// Class llsidepaneltaskinfo ///---------------------------------------------------------------------------- -LLSidepanelTaskInfo* LLSidepanelTaskInfo::sActivePanel = NULL; +LLSidepanelTaskInfo* LLSidepanelTaskInfo::sActivePanel = nullptr; static LLPanelInjector<LLSidepanelTaskInfo> t_task_info("sidepanel_task_info"); @@ -104,7 +104,7 @@ LLSidepanelTaskInfo::LLSidepanelTaskInfo() LLSidepanelTaskInfo::~LLSidepanelTaskInfo() { if (sActivePanel == this) - sActivePanel = NULL; + sActivePanel = nullptr; } // virtual @@ -205,9 +205,9 @@ BOOL LLSidepanelTaskInfo::postBuild() } else { - sActivePanel = NULL; + sActivePanel = nullptr; // drop selection reference - mObjectSelection = NULL; + mObjectSelection = nullptr; } } @@ -316,7 +316,7 @@ void LLSidepanelTaskInfo::refresh() root_selected = FALSE; } - LLViewerObject* objectp = NULL; + LLViewerObject* objectp = nullptr; if (nodep) { objectp = nodep->getObject(); @@ -1135,7 +1135,7 @@ void LLSidepanelTaskInfo::setAllSaleInfo() struct LLSelectionPayable : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* obj) + bool apply(LLViewerObject* obj) override { // can pay if you or your parent has money() event in script LLViewerObject* parent = (LLViewerObject*)obj->getParent(); @@ -1281,7 +1281,7 @@ void LLSidepanelTaskInfo::refreshAll() { // update UI as soon as we have an object // but remove keyboard focus first so fields are free to update - LLFocusableElement* focus = NULL; + LLFocusableElement* focus = nullptr; if (hasFocus()) { focus = gFocusMgr.getKeyboardFocus(); @@ -1310,7 +1310,7 @@ LLViewerObject* LLSidepanelTaskInfo::getObject() { if (!mObject->isDead()) return mObject; - return NULL; + return nullptr; } LLViewerObject* LLSidepanelTaskInfo::getFirstSelectedObject() @@ -1320,7 +1320,7 @@ LLViewerObject* LLSidepanelTaskInfo::getFirstSelectedObject() { return node->getObject(); } - return NULL; + return nullptr; } const LLUUID& LLSidepanelTaskInfo::getSelectedUUID() diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h index 7d9eaa551d9c61e1b327aec5a0cf02050c9d03b1..b180e4fa9e5326ea7514cc0b3b6b3cf9e4b5437b 100644 --- a/indra/newview/llsidepaneltaskinfo.h +++ b/indra/newview/llsidepaneltaskinfo.h @@ -51,8 +51,8 @@ public: LLSidepanelTaskInfo(); virtual ~LLSidepanelTaskInfo(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onVisibilityChange ( BOOL new_visibility ); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onVisibilityChange ( BOOL new_visibility ) override; void setObjectSelection(LLObjectSelectionHandle selection); @@ -61,9 +61,9 @@ public: static LLSidepanelTaskInfo *getActivePanel(); protected: - /*virtual*/ void refresh(); // refresh all labels as needed - /*virtual*/ void save(); - /*virtual*/ void updateVerbs(); + /*virtual*/ void refresh() override; // refresh all labels as needed + /*virtual*/ void save() override; + /*virtual*/ void updateVerbs() override; void refreshAll(); // ignore current keyboard focus and update all fields diff --git a/indra/newview/llsidetraypanelcontainer.h b/indra/newview/llsidetraypanelcontainer.h index 93a85ed3745589e360e14392f656b8663d775e98..4f3b9933d9103438dad36c52464716f4b8fa6c09 100644 --- a/indra/newview/llsidetraypanelcontainer.h +++ b/indra/newview/llsidetraypanelcontainer.h @@ -54,7 +54,7 @@ public: * @param key - params to be passed to panel, use key[PARAM_SUB_PANEL_NAME] * to specify panel name to be opened. */ - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key) override; /** * Opens given subpanel. @@ -70,7 +70,7 @@ public: * Overrides LLTabContainer::handleKeyHere to disable panel switch on * Alt + Left/Right button press. */ - BOOL handleKeyHere(KEY key, MASK mask); + BOOL handleKeyHere(KEY key, MASK mask) override; /** * Name of parameter that stores panel name to open. diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index 356c845abebbeaf8a61c00cbd24f462151811209..a17314b08caa165bdc41ec85960732397e2af3f1 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -82,7 +82,7 @@ void LLSkinningUtil::initSkinningMatrixPalette( { for (U32 j = 0; j < count; ++j) { - LLJoint *joint = NULL; + LLJoint *joint = nullptr; if (skin->mJointNums[j] == -1) { joint = avatar->getJoint(skin->mJointNames[j]); diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index 28e14d5d61f0b1f257904e42b837214e2632a9b4..e1341924e53847355e5bdd069fc6123a3606d263 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -89,9 +89,9 @@ LLSky::~LLSky() void LLSky::cleanup() { - mVOSkyp = NULL; - mVOWLSkyp = NULL; - mVOGroundp = NULL; + mVOSkyp = nullptr; + mVOWLSkyp = nullptr; + mVOGroundp = nullptr; } void LLSky::destroyGL() @@ -286,14 +286,14 @@ void LLSky::init(const LLVector3 &sun_direction) LLGLState::checkStates(); LLGLState::checkTextureChannels(); - mVOWLSkyp = static_cast<LLVOWLSky*>(gObjectList.createObjectViewer(LLViewerObject::LL_VO_WL_SKY, NULL)); + mVOWLSkyp = static_cast<LLVOWLSky*>(gObjectList.createObjectViewer(LLViewerObject::LL_VO_WL_SKY, nullptr)); mVOWLSkyp->initSunDirection(sun_direction, LLVector3::zero); gPipeline.createObject(mVOWLSkyp.get()); LLGLState::checkStates(); LLGLState::checkTextureChannels(); - mVOSkyp = (LLVOSky *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_SKY, NULL); + mVOSkyp = (LLVOSky *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_SKY, nullptr); LLGLState::checkStates(); LLGLState::checkTextureChannels(); @@ -308,7 +308,7 @@ void LLSky::init(const LLVector3 &sun_direction) LLGLState::checkStates(); LLGLState::checkTextureChannels(); - mVOGroundp = (LLVOGround*)gObjectList.createObjectViewer(LLViewerObject::LL_VO_GROUND, NULL); + mVOGroundp = (LLVOGround*)gObjectList.createObjectViewer(LLViewerObject::LL_VO_GROUND, nullptr); LLVOGround *groundp = mVOGroundp; gPipeline.createObject((LLViewerObject *)groundp); diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h index b689c503205ca2d2b4528e91ff1f55a3b7ba1c65..be5290c3e9f84368ab25b21ba6133be69e2fe44f 100644 --- a/indra/newview/llsnapshotlivepreview.h +++ b/indra/newview/llsnapshotlivepreview.h @@ -56,8 +56,8 @@ public: void setContainer(LLView* container) { mViewContainer = container; } - /*virtual*/ void draw(); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent); + /*virtual*/ void draw() override; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent) override; void setSize(S32 w, S32 h); void setWidth(S32 w) { mWidth[mCurImageIndex] = w; } @@ -109,7 +109,7 @@ public: void setThumbnailPlaceholderRect(const LLRect& rect) {mThumbnailPlaceholderRect = rect; } BOOL setThumbnailImageSize() ; void generateThumbnailImage(BOOL force_update = FALSE) ; - void resetThumbnailImage() { mThumbnailImage = NULL ; } + void resetThumbnailImage() { mThumbnailImage = nullptr ; } void drawPreviewRect(S32 offset_x, S32 offset_y) ; void prepareFreezeFrame(); diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 3680c410a1ac961d2762b97966c8d07095d89d17..c9189fb9ef03fba554a16fb2c360e94347ccc191 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -301,10 +301,10 @@ public: LLSpatialPartition* getSpatialPartition() {return (LLSpatialPartition*)mSpatialPartition;} //LISTENER FUNCTIONS - virtual void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* face); - virtual void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* face); - virtual void handleDestruction(const TreeNode* node); - virtual void handleChildAddition(const OctreeNode* parent, OctreeNode* child); + void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* face) override; + void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* face) override; + void handleDestruction(const TreeNode* node) override; + void handleChildAddition(const OctreeNode* parent, OctreeNode* child) override; public: LL_ALIGN_16(LLVector4a mViewAngle); @@ -366,10 +366,10 @@ public: BOOL pick_transparent, BOOL pick_rigged, S32* face_hit, // return the face hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point + LLVector4a* intersection = nullptr, // return the intersection point + LLVector2* tex_coord = nullptr, // return the texture coordinates of the intersection point + LLVector4a* normal = nullptr, // return the surface normal at the intersection point + LLVector4a* tangent = nullptr // return the surface tangent at the intersection point ); @@ -380,18 +380,18 @@ public: virtual F32 calcDistance(LLSpatialGroup* group, LLCamera& camera); virtual F32 calcPixelArea(LLSpatialGroup* group, LLCamera& camera); - virtual void rebuildGeom(LLSpatialGroup* group); - virtual void rebuildMesh(LLSpatialGroup* group); + void rebuildGeom(LLSpatialGroup* group) override; + void rebuildMesh(LLSpatialGroup* group) override; BOOL visibleObjectsInFrustum(LLCamera& camera); - /*virtual*/ S32 cull(LLCamera &camera, bool do_occlusion=false); // Cull on arbitrary frustum + /*virtual*/ S32 cull(LLCamera &camera, bool do_occlusion=false) override; // Cull on arbitrary frustum S32 cull(LLCamera &camera, std::vector<LLDrawable *>* results, BOOL for_select); // Cull on arbitrary frustum BOOL isVisible(const LLVector3& v); bool isHUDPartition() ; LLSpatialBridge* asBridge() { return mBridge; } - BOOL isBridge() { return asBridge() != NULL; } + BOOL isBridge() { return asBridge() != nullptr; } void renderPhysicsShapes(); void renderDebug(); @@ -429,17 +429,17 @@ public: void destroyTree(); - virtual BOOL isSpatialBridge() const { return TRUE; } - virtual void updateSpatialExtents(); - virtual void updateBinRadius(); - virtual void setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results = NULL, BOOL for_select = FALSE); - virtual void updateDistance(LLCamera& camera_in, bool force_update); - virtual void makeActive(); - virtual void move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL immediate = FALSE); - virtual BOOL updateMove(); - virtual void shiftPos(const LLVector4a& vec); - virtual void cleanupReferences(); - virtual LLSpatialPartition* asPartition() { return this; } + BOOL isSpatialBridge() const override { return TRUE; } + void updateSpatialExtents() override; + void updateBinRadius() override; + void setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results = nullptr, BOOL for_select = FALSE) override; + void updateDistance(LLCamera& camera_in, bool force_update) override; + void makeActive() override; + void move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL immediate = FALSE) override; + BOOL updateMove() override; + void shiftPos(const LLVector4a& vec) override; + void cleanupReferences() override; + LLSpatialPartition* asPartition() override { return this; } virtual LLCamera transformCamera(LLCamera& camera); @@ -548,8 +548,8 @@ class LLWaterPartition : public LLSpatialPartition { public: LLWaterPartition(LLViewerRegion* regionp); - virtual void getGeometry(LLSpatialGroup* group) { } - virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { } + void getGeometry(LLSpatialGroup* group) override { } + void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) override { } }; //spatial partition for hole and edge water (implemented in LLVOWater.cpp) @@ -564,8 +564,8 @@ class LLTerrainPartition : public LLSpatialPartition { public: LLTerrainPartition(LLViewerRegion* regionp); - virtual void getGeometry(LLSpatialGroup* group); - virtual LLVertexBuffer* createVertexBuffer(U32 type_mask, U32 usage); + void getGeometry(LLSpatialGroup* group) override; + LLVertexBuffer* createVertexBuffer(U32 type_mask, U32 usage) override; }; //spatial partition for trees @@ -573,8 +573,8 @@ class LLTreePartition : public LLSpatialPartition { public: LLTreePartition(LLViewerRegion* regionp); - virtual void getGeometry(LLSpatialGroup* group) { } - virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { } + void getGeometry(LLSpatialGroup* group) override { } + void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) override { } }; @@ -583,10 +583,10 @@ class LLParticlePartition : public LLSpatialPartition { public: LLParticlePartition(LLViewerRegion* regionp); - virtual void rebuildGeom(LLSpatialGroup* group); - virtual void getGeometry(LLSpatialGroup* group); - virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count); - virtual F32 calcPixelArea(LLSpatialGroup* group, LLCamera& camera); + void rebuildGeom(LLSpatialGroup* group) override; + void getGeometry(LLSpatialGroup* group) override; + void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) override; + F32 calcPixelArea(LLSpatialGroup* group, LLCamera& camera) override; protected: U32 mRenderPass; }; @@ -602,8 +602,8 @@ class LLGrassPartition : public LLSpatialPartition { public: LLGrassPartition(LLViewerRegion* regionp); - virtual void getGeometry(LLSpatialGroup* group); - virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count); + void getGeometry(LLSpatialGroup* group) override; + void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) override; protected: U32 mRenderPass; }; @@ -621,9 +621,9 @@ class LLVolumeGeometryManager: public LLGeometryManager LLVolumeGeometryManager(); virtual ~LLVolumeGeometryManager(); - virtual void rebuildGeom(LLSpatialGroup* group); - virtual void rebuildMesh(LLSpatialGroup* group); - virtual void getGeometry(LLSpatialGroup* group); + void rebuildGeom(LLSpatialGroup* group) override; + void rebuildMesh(LLSpatialGroup* group) override; + void getGeometry(LLSpatialGroup* group) override; void genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, BOOL distance_sort = FALSE, BOOL batch_textures = FALSE); void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); @@ -646,10 +646,10 @@ class LLVolumePartition : public LLSpatialPartition, public LLVolumeGeometryMana { public: LLVolumePartition(LLViewerRegion* regionp); - virtual void rebuildGeom(LLSpatialGroup* group) { LLVolumeGeometryManager::rebuildGeom(group); } - virtual void getGeometry(LLSpatialGroup* group) { LLVolumeGeometryManager::getGeometry(group); } - virtual void rebuildMesh(LLSpatialGroup* group) { LLVolumeGeometryManager::rebuildMesh(group); } - virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { LLVolumeGeometryManager::addGeometryCount(group, vertex_count, index_count); } + void rebuildGeom(LLSpatialGroup* group) override { LLVolumeGeometryManager::rebuildGeom(group); } + void getGeometry(LLSpatialGroup* group) override { LLVolumeGeometryManager::getGeometry(group); } + void rebuildMesh(LLSpatialGroup* group) override { LLVolumeGeometryManager::rebuildMesh(group); } + void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) override { LLVolumeGeometryManager::addGeometryCount(group, vertex_count, index_count); } }; //spatial bridge that uses volume geometry manager (implemented in LLVOVolume.cpp) @@ -657,18 +657,18 @@ class LLVolumeBridge : public LLSpatialBridge, public LLVolumeGeometryManager { public: LLVolumeBridge(LLDrawable* drawable, LLViewerRegion* regionp); - virtual void rebuildGeom(LLSpatialGroup* group) { LLVolumeGeometryManager::rebuildGeom(group); } - virtual void getGeometry(LLSpatialGroup* group) { LLVolumeGeometryManager::getGeometry(group); } - virtual void rebuildMesh(LLSpatialGroup* group) { LLVolumeGeometryManager::rebuildMesh(group); } - virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { LLVolumeGeometryManager::addGeometryCount(group, vertex_count, index_count); } + void rebuildGeom(LLSpatialGroup* group) override { LLVolumeGeometryManager::rebuildGeom(group); } + void getGeometry(LLSpatialGroup* group) override { LLVolumeGeometryManager::getGeometry(group); } + void rebuildMesh(LLSpatialGroup* group) override { LLVolumeGeometryManager::rebuildMesh(group); } + void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) override { LLVolumeGeometryManager::addGeometryCount(group, vertex_count, index_count); } }; class LLHUDBridge : public LLVolumeBridge { public: LLHUDBridge(LLDrawable* drawablep, LLViewerRegion* regionp); - virtual void shiftPos(const LLVector4a& vec); - virtual F32 calcPixelArea(LLSpatialGroup* group, LLCamera& camera); + void shiftPos(const LLVector4a& vec) override; + F32 calcPixelArea(LLSpatialGroup* group, LLCamera& camera) override; }; //spatial partition that holds nothing but spatial bridges @@ -676,15 +676,15 @@ class LLBridgePartition : public LLSpatialPartition { public: LLBridgePartition(LLViewerRegion* regionp); - virtual void getGeometry(LLSpatialGroup* group) { } - virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { } + void getGeometry(LLSpatialGroup* group) override { } + void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) override { } }; class LLHUDPartition : public LLBridgePartition { public: LLHUDPartition(LLViewerRegion* regionp); - virtual void shift(const LLVector4a &offset); + void shift(const LLVector4a &offset) override; }; extern const F32 SG_BOX_SIDE; diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 06c543fac6347d6ab7e0039c9e2cbf8926aa7c36..95b0f3a9951aebe9cb771fe0f07a20ffe78133d6 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -86,7 +86,7 @@ class LLSpeakerUpdateSpeakerEvent : public LLOldEvents::LLEvent { public: LLSpeakerUpdateSpeakerEvent(LLSpeaker* source); - /*virtual*/ LLSD getValue(); + /*virtual*/ LLSD getValue() override; private: const LLUUID& mSpeakerID; }; @@ -95,7 +95,7 @@ class LLSpeakerUpdateModeratorEvent : public LLOldEvents::LLEvent { public: LLSpeakerUpdateModeratorEvent(LLSpeaker* source); - /*virtual*/ LLSD getValue(); + /*virtual*/ LLSD getValue() override; private: const LLUUID& mSpeakerID; BOOL mIsModerator; @@ -105,21 +105,21 @@ class LLSpeakerTextModerationEvent : public LLOldEvents::LLEvent { public: LLSpeakerTextModerationEvent(LLSpeaker* source); - /*virtual*/ LLSD getValue(); + /*virtual*/ LLSD getValue() override; }; class LLSpeakerVoiceModerationEvent : public LLOldEvents::LLEvent { public: LLSpeakerVoiceModerationEvent(LLSpeaker* source); - /*virtual*/ LLSD getValue(); + /*virtual*/ LLSD getValue() override; }; class LLSpeakerListChangeEvent : public LLOldEvents::LLEvent { public: LLSpeakerListChangeEvent(LLSpeakerMgr* source, const LLUUID& speaker_id); - /*virtual*/ LLSD getValue(); + /*virtual*/ LLSD getValue() override; private: const LLUUID& mSpeakerID; @@ -159,7 +159,7 @@ public: * * If action callback is not specified returns true. Instance will be deleted by LLEventTimer::updateClass(). */ - virtual BOOL tick(); + BOOL tick() override; /** * Clears the callback. @@ -327,7 +327,7 @@ public: void processSessionUpdate(const LLSD& session_update); protected: - virtual void updateSpeakerList(); + void updateSpeakerList() override; void moderateVoiceSession(const LLUUID& session_id, bool disallow_voice); @@ -346,7 +346,7 @@ class LLActiveSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLActiveSpeak LOG_CLASS(LLActiveSpeakerMgr); protected: - virtual void updateSpeakerList(); + void updateSpeakerList() override; }; class LLLocalSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLLocalSpeakerMgr> @@ -355,7 +355,7 @@ class LLLocalSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLLocalSpeaker ~LLLocalSpeakerMgr (); LOG_CLASS(LLLocalSpeakerMgr); protected: - virtual void updateSpeakerList(); + void updateSpeakerList() override; }; #endif // LL_LLSPEAKERS_H diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp index 7684d9a6d12cafb24ec432de9bfc01649bcb7ab0..62cdf26a8795d9fabcf14500c21bdb47c8062f5e 100644 --- a/indra/newview/llspeakingindicatormanager.cpp +++ b/indra/newview/llspeakingindicatormanager.cpp @@ -86,7 +86,7 @@ public: * So, method does not calculate difference between these list it only switches off already * switched on indicators and switches on indicators of voice channel participants */ - void onParticipantsChanged(); + void onParticipantsChanged() override; private: typedef std::set<LLUUID> speaker_ids_t; diff --git a/indra/newview/llsplitbutton.cpp b/indra/newview/llsplitbutton.cpp index 304ee8bad667666c7ad731d1c287faee0bb3c31e..3e05c25da36a9c7c3c28629d6c5238e3121d6e8c 100644 --- a/indra/newview/llsplitbutton.cpp +++ b/indra/newview/llsplitbutton.cpp @@ -56,9 +56,9 @@ LLSplitButton::ItemParams::ItemParams() LLSplitButton::Params::Params() : arrow_position("arrow_position", LEFT), - items("item"), arrow_button("arrow_button"), - items_panel("items_panel") + items_panel("items_panel"), + items("item") { } @@ -125,12 +125,12 @@ void LLSplitButton::onItemSelected(LLUICtrl* ctrl) mSelectionCallback(this, ctrl->getName()); } - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } BOOL LLSplitButton::handleMouseUp(S32 x, S32 y, MASK mask) { - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); if (mShownItem->parentPointInView(x, y)) { @@ -186,9 +186,9 @@ void LLSplitButton::hideButtons() LLSplitButton::LLSplitButton(const LLSplitButton::Params& p) : LLUICtrl(p), - mArrowBtn(NULL), - mShownItem(NULL), - mItemsPanel(NULL), + mItemsPanel(nullptr), + mArrowBtn(nullptr), + mShownItem(nullptr), mArrowPosition(p.arrow_position) { LLRect rc(p.rect); diff --git a/indra/newview/llsplitbutton.h b/indra/newview/llsplitbutton.h index 4f20c8b3795f5dfc51008d1f6a6baba076f408b9..d1e3ddcd6709a380ea118adb2eb72b9ea25e88c9 100644 --- a/indra/newview/llsplitbutton.h +++ b/indra/newview/llsplitbutton.h @@ -70,9 +70,9 @@ public: virtual ~LLSplitButton() {}; //Overridden - virtual void onFocusLost(); - virtual void setFocus(BOOL b); - virtual void setEnabled(BOOL enabled); + void onFocusLost() override; + void setFocus(BOOL b) override; + void setEnabled(BOOL enabled) override; //Callbacks void onArrowBtnDown(); @@ -80,7 +80,7 @@ public: void onItemSelected(LLUICtrl* ctrl); void setSelectionCallback(commit_callback_t cb) { mSelectionCallback = cb; } - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; virtual void showButtons(); virtual void hideButtons(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 1e6320c0ab63d1ffa1168ce9669c2a733f24a0f6..5185dd680388c9ceb5f53e2637b85431b68713cc 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -421,7 +421,7 @@ bool idle_startup() std::string xml_file = LLUI::locateSkin("xui_version.xml"); LLXMLNodePtr root; bool xml_ok = false; - if (LLXMLNode::parseFile(xml_file, root, NULL)) + if (LLXMLNode::parseFile(xml_file, root, nullptr)) { if( (root->hasName("xui_version") ) ) { @@ -461,7 +461,7 @@ bool idle_startup() std::string message_template_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"message_template.msg"); - LLFILE* found_template = NULL; + LLFILE* found_template = nullptr; found_template = LLFile::fopen(message_template_path, "r"); /* Flawfinder: ignore */ #if LL_WINDOWS @@ -502,7 +502,7 @@ bool idle_startup() const F32 circuit_heartbeat_interval = 5; const F32 circuit_timeout = 100; - const LLUseCircuitCodeResponder* responder = NULL; + const LLUseCircuitCodeResponder* responder = nullptr; bool failure_is_fatal = true; if(!start_messaging_system( @@ -553,10 +553,10 @@ bool idle_startup() LLMessageSystem* msg = gMessageSystem; msg->setExceptionFunc(MX_UNREGISTERED_MESSAGE, invalid_message_callback, - NULL); + nullptr); msg->setExceptionFunc(MX_PACKET_TOO_SHORT, invalid_message_callback, - NULL); + nullptr); // running off end of a packet is now valid in the case // when a reader has a newer message template than @@ -566,7 +566,7 @@ bool idle_startup() NULL);*/ msg->setExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE, invalid_message_callback, - NULL); + nullptr); if (gSavedSettings.getBOOL("LogMessages")) { @@ -753,7 +753,7 @@ bool idle_startup() // Login screen needs menus for preferences, but we can enter // this startup phase more than once. - if (gLoginMenuBarView == NULL) + if (gLoginMenuBarView == nullptr) { LL_DEBUGS("AppInit") << "initializing menu bar" << LL_ENDL; initialize_edit_menu(); @@ -824,7 +824,7 @@ bool idle_startup() // first made visible. #ifdef _WIN32 MSG msg; - while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) ) + while( PeekMessage( &msg, /*All hWnds owned by this thread */ nullptr, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) ) { } #endif display_startup(); @@ -1369,7 +1369,7 @@ bool idle_startup() update_texture_fetch(); display_startup(); - if ( gViewerWindow != NULL) + if ( gViewerWindow != nullptr) { // This isn't the first logon attempt, so show the UI gViewerWindow->setNormalControlsVisible( TRUE ); } @@ -1422,8 +1422,8 @@ bool idle_startup() // *Note: this is where gWorldMap used to be initialized. // register null callbacks for audio until the audio system is initialized - gMessageSystem->setHandlerFuncFast(_PREHASH_SoundTrigger, null_message_callback, NULL); - gMessageSystem->setHandlerFuncFast(_PREHASH_AttachedSound, null_message_callback, NULL); + gMessageSystem->setHandlerFuncFast(_PREHASH_SoundTrigger, null_message_callback, nullptr); + gMessageSystem->setHandlerFuncFast(_PREHASH_AttachedSound, null_message_callback, nullptr); display_startup(); //reset statistics @@ -1519,7 +1519,7 @@ bool idle_startup() FALSE, (F32Seconds)gSavedSettings.getF32("UseCircuitCodeTimeout"), use_circuit_callback, - NULL); + nullptr); timeout.reset(); display_startup(); @@ -2203,7 +2203,7 @@ bool idle_startup() LL_INFOS("AppInit") << "Done first audio_update_volume." << LL_ENDL; // reset keyboard focus to sane state of pointing at world - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); LLAppViewer::instance()->handleLoginComplete(); @@ -2236,7 +2236,7 @@ void login_show() gToolBarView->setVisible(FALSE); } - LLPanelLogin::show( gViewerWindow->getWindowRectScaled(), login_callback, NULL ); + LLPanelLogin::show( gViewerWindow->getWindowRectScaled(), login_callback, nullptr ); } // Callback for when login screen is closed. Option 0 = connect, option 1 = quit. @@ -2379,18 +2379,18 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFunc("RegionInfo", LLViewerRegion::processRegionInfo); msg->setHandlerFuncFast(_PREHASH_ChatFromSimulator, process_chat_from_simulator); - msg->setHandlerFuncFast(_PREHASH_KillObject, process_kill_object, NULL); - msg->setHandlerFuncFast(_PREHASH_SimulatorViewerTimeMessage, process_time_synch, NULL); + msg->setHandlerFuncFast(_PREHASH_KillObject, process_kill_object, nullptr); + msg->setHandlerFuncFast(_PREHASH_SimulatorViewerTimeMessage, process_time_synch, nullptr); msg->setHandlerFuncFast(_PREHASH_EnableSimulator, process_enable_simulator); msg->setHandlerFuncFast(_PREHASH_DisableSimulator, process_disable_simulator); - msg->setHandlerFuncFast(_PREHASH_KickUser, process_kick_user, NULL); + msg->setHandlerFuncFast(_PREHASH_KickUser, process_kick_user, nullptr); msg->setHandlerFunc("CrossedRegion", process_crossed_region); msg->setHandlerFuncFast(_PREHASH_TeleportFinish, process_teleport_finish); msg->setHandlerFuncFast(_PREHASH_AlertMessage, process_alert_message); msg->setHandlerFunc("AgentAlertMessage", process_agent_alert_message); - msg->setHandlerFuncFast(_PREHASH_MeanCollisionAlert, process_mean_collision_alert_message, NULL); + msg->setHandlerFuncFast(_PREHASH_MeanCollisionAlert, process_mean_collision_alert_message, nullptr); msg->setHandlerFunc("ViewerFrozenMessage", process_frozen_message); msg->setHandlerFuncFast(_PREHASH_NameValuePair, process_name_value); @@ -2406,14 +2406,14 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_ImprovedInstantMessage, process_improved_im); msg->setHandlerFuncFast(_PREHASH_ScriptQuestion, process_script_question); - msg->setHandlerFuncFast(_PREHASH_ObjectProperties, LLSelectMgr::processObjectProperties, NULL); - msg->setHandlerFuncFast(_PREHASH_ObjectPropertiesFamily, LLSelectMgr::processObjectPropertiesFamily, NULL); + msg->setHandlerFuncFast(_PREHASH_ObjectProperties, LLSelectMgr::processObjectProperties, nullptr); + msg->setHandlerFuncFast(_PREHASH_ObjectPropertiesFamily, LLSelectMgr::processObjectPropertiesFamily, nullptr); msg->setHandlerFunc("ForceObjectSelect", LLSelectMgr::processForceObjectSelect); - msg->setHandlerFuncFast(_PREHASH_MoneyBalanceReply, process_money_balance_reply, NULL); - msg->setHandlerFuncFast(_PREHASH_CoarseLocationUpdate, LLWorld::processCoarseUpdate, NULL); - msg->setHandlerFuncFast(_PREHASH_ReplyTaskInventory, LLViewerObject::processTaskInv, NULL); - msg->setHandlerFuncFast(_PREHASH_DerezContainer, process_derez_container, NULL); + msg->setHandlerFuncFast(_PREHASH_MoneyBalanceReply, process_money_balance_reply, nullptr); + msg->setHandlerFuncFast(_PREHASH_CoarseLocationUpdate, LLWorld::processCoarseUpdate, nullptr); + msg->setHandlerFuncFast(_PREHASH_ReplyTaskInventory, LLViewerObject::processTaskInv, nullptr); + msg->setHandlerFuncFast(_PREHASH_DerezContainer, process_derez_container, nullptr); msg->setHandlerFuncFast(_PREHASH_ScriptRunningReply, &LLLiveLSLEditor::processScriptRunningReply); @@ -2491,14 +2491,14 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_UserInfoReply, process_user_info_reply); - msg->setHandlerFunc("RegionHandshake", process_region_handshake, NULL); + msg->setHandlerFunc("RegionHandshake", process_region_handshake, nullptr); msg->setHandlerFunc("TeleportStart", process_teleport_start ); msg->setHandlerFunc("TeleportProgress", process_teleport_progress); - msg->setHandlerFunc("TeleportFailed", process_teleport_failed, NULL); - msg->setHandlerFunc("TeleportLocal", process_teleport_local, NULL); + msg->setHandlerFunc("TeleportFailed", process_teleport_failed, nullptr); + msg->setHandlerFunc("TeleportLocal", process_teleport_local, nullptr); - msg->setHandlerFunc("ImageNotInDatabase", LLViewerTextureList::processImageNotInDatabase, NULL); + msg->setHandlerFunc("ImageNotInDatabase", LLViewerTextureList::processImageNotInDatabase, nullptr); msg->setHandlerFuncFast(_PREHASH_GroupMembersReply, LLGroupMgr::processGroupMembersReply); @@ -2669,7 +2669,7 @@ void init_start_screen(S32 location_id) { if (gStartTexture.notNull()) { - gStartTexture = NULL; + gStartTexture = nullptr; LL_INFOS("AppInit") << "re-initializing start screen" << LL_ENDL; } @@ -2698,7 +2698,7 @@ void init_start_screen(S32 location_id) else if(!start_image_bmp->load(temp_str) ) { LL_WARNS("AppInit") << "Bitmap load failed" << LL_ENDL; - gStartTexture = NULL; + gStartTexture = nullptr; } else { @@ -2709,7 +2709,7 @@ void init_start_screen(S32 location_id) if (!start_image_bmp->decode(raw, 0.0f)) { LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL; - gStartTexture = NULL; + gStartTexture = nullptr; } else { @@ -2731,7 +2731,7 @@ void init_start_screen(S32 location_id) void release_start_screen() { LL_DEBUGS("AppInit") << "Releasing bitmap..." << LL_ENDL; - gStartTexture = NULL; + gStartTexture = nullptr; } @@ -2872,7 +2872,7 @@ void LLStartUp::cleanupNameCache() SUBSYSTEM_CLEANUP(LLAvatarNameCache); delete gCacheName; - gCacheName = NULL; + gCacheName = nullptr; } bool LLStartUp::dispatchURL() @@ -2898,7 +2898,7 @@ bool LLStartUp::dispatchURL() || (dy*dy > SLOP*SLOP) ) { LLURLDispatcher::dispatch(getStartSLURL().getSLURLString(), "clicked", - NULL, false); + nullptr, false); } return true; } @@ -3315,13 +3315,13 @@ bool process_login_success_response(U32& first_sim_size_x, U32& first_sim_size_y text = response["circuit_code"].asString(); if(!text.empty()) { - gMessageSystem->mOurCircuitCode = strtoul(text.c_str(), NULL, 10); + gMessageSystem->mOurCircuitCode = strtoul(text.c_str(), nullptr, 10); } std::string sim_ip_str = response["sim_ip"]; std::string sim_port_str = response["sim_port"]; if(!sim_ip_str.empty() && !sim_port_str.empty()) { - U32 sim_port = strtoul(sim_port_str.c_str(), NULL, 10); + U32 sim_port = strtoul(sim_port_str.c_str(), nullptr, 10); gFirstSim.set(sim_ip_str, sim_port); if (gFirstSim.isOk()) { @@ -3332,8 +3332,8 @@ bool process_login_success_response(U32& first_sim_size_x, U32& first_sim_size_y std::string region_y_str = response["region_y"]; if(!region_x_str.empty() && !region_y_str.empty()) { - U32 region_x = strtoul(region_x_str.c_str(), NULL, 10); - U32 region_y = strtoul(region_y_str.c_str(), NULL, 10); + U32 region_x = strtoul(region_x_str.c_str(), nullptr, 10); + U32 region_y = strtoul(region_y_str.c_str(), nullptr, 10); gFirstSimHandle = to_region_handle(region_x, region_y); } @@ -3358,10 +3358,10 @@ bool process_login_success_response(U32& first_sim_size_x, U32& first_sim_size_y text = response["seconds_since_epoch"].asString(); if(!text.empty()) { - U32 server_utc_time = strtoul(text.c_str(), NULL, 10); + U32 server_utc_time = strtoul(text.c_str(), nullptr, 10); if(server_utc_time) { - time_t now = time(NULL); + time_t now = time(nullptr); gUTCOffset = (server_utc_time - now); // Print server timestamp diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 81457a26e180983a29f7decf07557551c7d54b16..027455b3523cb97cca0c2ddda1922bd68fe338d0 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -89,7 +89,7 @@ // // Globals // -LLStatusBar *gStatusBar = NULL; +LLStatusBar *gStatusBar = nullptr; S32 STATUS_BAR_HEIGHT = 26; extern S32 MENU_BAR_HEIGHT; @@ -133,10 +133,10 @@ LLStatusBar::LLStatusBar(const LLRect& rect) LLStatusBar::~LLStatusBar() { delete mBalanceTimer; - mBalanceTimer = NULL; + mBalanceTimer = nullptr; delete mHealthTimer; - mHealthTimer = NULL; + mHealthTimer = nullptr; // LLView destructor cleans up children } @@ -632,7 +632,7 @@ class LLBalanceHandler : public LLCommandHandler public: // Requires "trusted" browser/URL source LLBalanceHandler() : LLCommandHandler("balance", UNTRUSTED_BLOCK) { } - bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) override { if (tokens.size() == 1 && tokens[0].asString() == "request") diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 30de92574b16fca614fc83e448b49734e9cc7167..0c1b372499baf24e7973f766f648e790a1271511 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -54,10 +54,10 @@ public: LLStatusBar(const LLRect& rect ); /*virtual*/ ~LLStatusBar(); - /*virtual*/ void draw(); + /*virtual*/ void draw() override; - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL postBuild() override; // MANIPULATORS void setBalance(S32 balance); @@ -72,7 +72,7 @@ public: void setLandCredit(S32 credit); void setLandCommitted(S32 committed); - void refresh(); + void refresh() override; void setVisibleForMouselook(bool visible); // some elements should hide in mouselook diff --git a/indra/newview/llstreaminfo.h b/indra/newview/llstreaminfo.h index 9a5ba7db3bf827be751ce03b52eb5eddc6322111..f1c121102e4ed370901f94ad89e65f28f34c0d37 100644 --- a/indra/newview/llstreaminfo.h +++ b/indra/newview/llstreaminfo.h @@ -39,7 +39,7 @@ public: LLStreamInfo(); private: ~LLStreamInfo() {} - BOOL tick(); + BOOL tick() override; }; #endif // LL_STREAMINFO_H diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h index 33a64ae7d5a591bd96ea54c083ccca2031b8d936..aaa88a628ad430c217a9202982fb76746cf72b2e 100644 --- a/indra/newview/llsurface.h +++ b/indra/newview/llsurface.h @@ -66,7 +66,7 @@ class LLGroupHeader; class LLSurface { public: - LLSurface(U32 type, LLViewerRegion *regionp = NULL); + LLSurface(U32 type, LLViewerRegion *regionp = nullptr); virtual ~LLSurface(); static void initClasses(); // Do class initialization for LLSurface and its child classes. diff --git a/indra/newview/llsyntaxid.cpp b/indra/newview/llsyntaxid.cpp index a97e1bfea89e7b959b0afa4b4d7c025b47f40173..4cb6df3d4f290064d470dbe6a5728dab783032fb 100644 --- a/indra/newview/llsyntaxid.cpp +++ b/indra/newview/llsyntaxid.cpp @@ -48,10 +48,10 @@ const std::string FILENAME_DEFAULT = "keywords_lsl_default.xml"; * @brief LLSyntaxIdLSL constructor */ LLSyntaxIdLSL::LLSyntaxIdLSL() -: mKeywordsXml(LLSD()) -, mCapabilityURL(std::string()) +: mCapabilityURL(std::string()) , mFilePath(LL_PATH_APP_SETTINGS) , mSyntaxId(LLUUID()) +, mKeywordsXml(LLSD()) , mInitialized(false) { loadDefaultKeywordsIntoLLSD(); diff --git a/indra/newview/llsyswellitem.cpp b/indra/newview/llsyswellitem.cpp index 5330dffe80d0930347a31bef9d6ec68841fbe7fe..552588dabd38163fce55c4cd6a6ecb49df1516ea 100644 --- a/indra/newview/llsyswellitem.cpp +++ b/indra/newview/llsyswellitem.cpp @@ -38,8 +38,8 @@ //--------------------------------------------------------------------------------- LLSysWellItem::LLSysWellItem(const Params& p) : LLPanel(p), - mTitle(NULL), - mCloseBtn(NULL) + mTitle(nullptr), + mCloseBtn(nullptr) { buildFromFile( "panel_sys_well_item.xml"); diff --git a/indra/newview/llsyswellitem.h b/indra/newview/llsyswellitem.h index 5654c7934c380cc9ff9cbfdbc6428487519966d5..07e579423f627251973dc85a2c65fe90f328fa03 100644 --- a/indra/newview/llsyswellitem.h +++ b/indra/newview/llsyswellitem.h @@ -53,9 +53,9 @@ public: LLUUID getID() { return mID; } // handlers - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual void onMouseEnter(S32 x, S32 y, MASK mask); - virtual void onMouseLeave(S32 x, S32 y, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + void onMouseEnter(S32 x, S32 y, MASK mask) override; + void onMouseLeave(S32 x, S32 y, MASK mask) override; //callbacks typedef std::function<void (LLSysWellItem* item)> syswell_item_callback_t; diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 8689614488819923499851eadff731196719bde6..a5ed30b1bf88ebf3ee7dfd2576572faca8f40bc4 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -40,12 +40,12 @@ #include "llviewercontrol.h" //--------------------------------------------------------------------------------- -LLSysWellWindow::LLSysWellWindow(const LLSD& key) : LLTransientDockableFloater(NULL, true, key), - mChannel(NULL), - mMessageList(NULL), - mSysWellChiclet(NULL), +LLSysWellWindow::LLSysWellWindow(const LLSD& key) : LLTransientDockableFloater(nullptr, true, key), NOTIFICATION_WELL_ANCHOR_NAME("notification_well_panel"), IM_WELL_ANCHOR_NAME("im_well_panel"), + mChannel(nullptr), + mMessageList(nullptr), + mSysWellChiclet(nullptr), mIsReshapedByUser(false) { @@ -86,7 +86,7 @@ void LLSysWellWindow::onStartUpToastClick(S32 x, S32 y, MASK mask) void LLSysWellWindow::setSysWellChiclet(LLSysWellChiclet* chiclet) { mSysWellChiclet = chiclet; - if(NULL != mSysWellChiclet) + if(nullptr != mSysWellChiclet) { mSysWellChiclet->updateWidget(isWindowEmpty()); } @@ -102,7 +102,7 @@ void LLSysWellWindow::removeItemByID(const LLUUID& id) { if(mMessageList->removeItemByValue(id)) { - if (NULL != mSysWellChiclet) + if (nullptr != mSysWellChiclet) { mSysWellChiclet->updateWidget(isWindowEmpty()); } @@ -133,7 +133,7 @@ void LLSysWellWindow::initChannel() LLNotificationsUI::LLScreenChannelBase* channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID( LLUUID(gSavedSettings.getString("NotificationChannelUUID"))); mChannel = dynamic_cast<LLNotificationsUI::LLScreenChannel*>(channel); - if(NULL == mChannel) + if(nullptr == mChannel) { LL_WARNS() << "LLSysWellWindow::initChannel() - could not get a requested screen channel" << LL_ENDL; } @@ -144,7 +144,7 @@ void LLSysWellWindow::setVisible(BOOL visible) { if (visible) { - if (NULL == getDockControl() && getDockTongue().notNull()) + if (nullptr == getDockControl() && getDockTongue().notNull()) { setDockControl(new LLDockControl( LLChicletBar::getInstance()->getChild<LLView>(getAnchorViewName()), this, @@ -153,7 +153,7 @@ void LLSysWellWindow::setVisible(BOOL visible) } // do not show empty window - if (NULL == mMessageList || isWindowEmpty()) visible = FALSE; + if (nullptr == mMessageList || isWindowEmpty()) visible = FALSE; LLTransientDockableFloater::setVisible(visible); @@ -225,7 +225,7 @@ bool LLSysWellWindow::isWindowEmpty() LLIMWellWindow::ObjectRowPanel::ObjectRowPanel(const LLUUID& notification_id, bool new_message/* = false*/) : LLPanel() - , mChiclet(NULL) + , mChiclet(nullptr) { buildFromFile( "panel_active_object_row.xml"); @@ -338,11 +338,11 @@ BOOL LLIMWellWindow::postBuild() LLChiclet* LLIMWellWindow::findObjectChiclet(const LLUUID& notification_id) { - if (!mMessageList) return NULL; + if (!mMessageList) return nullptr; - LLChiclet* res = NULL; + LLChiclet* res = nullptr; ObjectRowPanel* panel = mMessageList->getTypedItemByValue<ObjectRowPanel>(notification_id); - if (panel != NULL) + if (panel != nullptr) { res = panel->mChiclet; } @@ -355,7 +355,7 @@ LLChiclet* LLIMWellWindow::findObjectChiclet(const LLUUID& notification_id) void LLIMWellWindow::addObjectRow(const LLUUID& notification_id, bool new_message/* = false*/) { - if (mMessageList->getItemByValue(notification_id) == NULL) + if (mMessageList->getItemByValue(notification_id) == nullptr) { ObjectRowPanel* item = new ObjectRowPanel(notification_id, new_message); if (!mMessageList->addItem(item, notification_id)) diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index b96a2573a1f934f51054878676c6ed5bfe228092..3cd827cb1127dd197d47adbe1d4eb1133f1d8ab9 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -48,7 +48,7 @@ public: LLSysWellWindow(const LLSD& key); virtual ~LLSysWellWindow(); - BOOL postBuild(); + BOOL postBuild() override; // other interface functions // check is window empty @@ -59,12 +59,12 @@ public: LLPanel * findItemByID(const LLUUID& id); // Operating with outfit - virtual void setVisible(BOOL visible); + void setVisible(BOOL visible) override; void adjustWindowPosition(); - /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); + /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true) override; // override LLFloater's minimization according to EXT-1216 - /*virtual*/ void setMinimized(BOOL minimize); - /*virtual*/ void handleReshape(const LLRect& rect, bool by_user); + /*virtual*/ void setMinimized(BOOL minimize) override; + /*virtual*/ void handleReshape(const LLRect& rect, bool by_user) override; void onStartUpToastClick(S32 x, S32 y, MASK mask); @@ -111,14 +111,14 @@ public: static LLIMWellWindow* findInstance(const LLSD& key = LLSD()); static void initClass() { getInstance(); } - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; void addObjectRow(const LLUUID& notification_id, bool new_message = false); void removeObjectRow(const LLUUID& notification_id); void closeAll(); protected: - /*virtual*/ const std::string& getAnchorViewName() { return IM_WELL_ANCHOR_NAME; } + /*virtual*/ const std::string& getAnchorViewName() override { return IM_WELL_ANCHOR_NAME; } private: LLChiclet* findObjectChiclet(const LLUUID& notification_id); @@ -131,10 +131,10 @@ private: public: ObjectRowPanel(const LLUUID& notification_id, bool new_message = false); virtual ~ObjectRowPanel(); - /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask) override; + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; private: void onClosePanel(); diff --git a/indra/newview/lltable.h b/indra/newview/lltable.h index d75ef84ae4767d880ceb91b2cb98d7624f811d88..9f1b7eef1ef24263ae0757466d83e3afbbc26d3e 100644 --- a/indra/newview/lltable.h +++ b/indra/newview/lltable.h @@ -35,7 +35,7 @@ private: U32 _h; U32 _size; public: - LLTable(U32 w, U32 h = 0) : _tab(0), _w(w), _h(h) + LLTable(U32 w, U32 h = 0) : _tab(nullptr), _w(w), _h(h) { if (_w < 0) _w = 0; if (_h < 0) _h = 0; diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp index 0334c450a505990e755fb9f259e3e26e29e51564..facfcc9227e72212c9684d71d8e6bff6ca03ad71 100644 --- a/indra/newview/llteleporthistory.cpp +++ b/indra/newview/llteleporthistory.cpp @@ -59,7 +59,7 @@ LLTeleportHistory::LLTeleportHistory(): mCurrentItem(-1), mRequestedItem(-1), mGotInitialUpdate(false), - mTeleportHistoryStorage(NULL) + mTeleportHistoryStorage(nullptr) { mTeleportFinishedConn = LLViewerParcelMgr::getInstance()-> setTeleportFinishedCallback(boost::bind(&LLTeleportHistory::updateCurrentLocation, this, _1)); diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 896fd6ae0a89fc4cf0c424fc29456516aeaf7325..407975bcdab4708d05ed19be64335ffbc788aa85 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -53,8 +53,8 @@ private: struct Entry { Entry() : - mBodySize(0), - mImageSize(0), + mImageSize(0), + mBodySize(0), mTime(0) { } @@ -81,7 +81,7 @@ public: { public: ReadResponder(); - void setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, BOOL imagelocal); + void setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, BOOL imagelocal) override; void setImage(LLImageFormatted* image) { mFormattedImage = image; } protected: LLPointer<LLImageFormatted> mFormattedImage; @@ -91,7 +91,7 @@ public: class WriteResponder : public Responder { - void setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, BOOL imagelocal) + void setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, BOOL imagelocal) override { // not used } @@ -100,7 +100,7 @@ public: LLTextureCache(bool threaded); ~LLTextureCache(); - /*virtual*/ S32 update(F32 max_time_ms); + /*virtual*/ S32 update(F32 max_time_ms) override; void purgeCache(ELLPath location, bool remove_dir = true); void setReadOnly(BOOL read_only) ; diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 8b78ec761c850be3132b10b5382bfbe76009f17c..8a4bbfb5f6efaa4bfdd295f2510a1d8198480a36 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -111,26 +111,26 @@ public: // LLView interface - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, - std::string& tooltip_msg); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleUnicodeCharHere(llwchar uni_char); + std::string& tooltip_msg) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleUnicodeCharHere(llwchar uni_char) override; - virtual void draw(); - virtual void setVisible( BOOL visible ); - virtual void setEnabled( BOOL enabled ); + void draw() override; + void setVisible( BOOL visible ) override; + void setEnabled( BOOL enabled ) override; void setValid(BOOL valid); // LLUICtrl interface - virtual void clear(); + void clear() override; // Takes a UUID, wraps get/setImageAssetID - virtual void setValue(const LLSD& value); - virtual LLSD getValue() const; + void setValue(const LLSD& value) override; + LLSD getValue() const override; // LLTextureCtrl interface void showPicker(BOOL take_focus); @@ -274,13 +274,13 @@ public: /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, - std::string& tooltip_msg); - /*virtual*/ void draw(); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + std::string& tooltip_msg) override; + /*virtual*/ void draw() override; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask) override; // LLFloater overrides - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_settings); + /*virtual*/ BOOL postBuild() override; + /*virtual*/ void onClose(bool app_settings) override; // New functions void setImageID(const LLUUID& image_asset_id, bool set_selection = true); diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index d19e9ef382cd06dd30a44815c02ccbef9a14874b..eabd0526a6d8c8329b51702d412c632c8c5d1759 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -62,7 +62,7 @@ public: class TFRequest; // Threads: Tmain - /*virtual*/ S32 update(F32 max_time_ms); + /*virtual*/ S32 update(F32 max_time_ms) override; // called in the main thread after the TextureCacheThread shuts down. // Threads: Tmain @@ -133,7 +133,7 @@ public: U32 getTotalNumHTTPRequests(); // Threads: T* - S32 getPending(); + S32 getPending() override; // Threads: T* void lockQueue() { mQueueMutex.lock(); } @@ -244,20 +244,20 @@ protected: // Overrides from the LLThread tree // Locks: Ct - bool runCondition(); + bool runCondition() override; private: // Threads: Tmain void sendRequestListToSimulators(); // Threads: Ttf - /*virtual*/ void startThread(void); + /*virtual*/ void startThread(void) override; // Threads: Ttf - /*virtual*/ void endThread(void); + /*virtual*/ void endThread(void) override; // Threads: Ttf - /*virtual*/ void threadedUpdate(void); + /*virtual*/ void threadedUpdate(void) override; // Threads: Ttf void commonUpdate(); @@ -550,7 +550,7 @@ public: // Inherited from LLCore::HttpHandler // Threads: Ttf - virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) override; void startWork(e_debug_state state); void setStopDebug() {mStopDebug = TRUE;} diff --git a/indra/newview/lltextureinfodetails.cpp b/indra/newview/lltextureinfodetails.cpp index ea6849dc9870cfeb22e868073298985d5c8d153f..bd8f5972b7e6f3241435e6e76ad56d940c44712f 100644 --- a/indra/newview/lltextureinfodetails.cpp +++ b/indra/newview/lltextureinfodetails.cpp @@ -31,8 +31,8 @@ #include "lltextureinfodetails.h" LLTextureInfoDetails::LLTextureInfoDetails() -: mType(REQUEST_TYPE_NONE), - mOffset(0) +: mOffset(0), + mType(REQUEST_TYPE_NONE) { } diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 029252c7c89fd716f8b40e1bc66fb086f0957850..276c2150a42ee6f4cc94227504187870b7b06c44 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -61,7 +61,7 @@ extern F32 texmem_lower_bound_scale; -LLTextureView *gTextureView = NULL; +LLTextureView *gTextureView = nullptr; #define HIGH_PRIORITY 100000000.f @@ -106,9 +106,9 @@ public: mTextureView(p.texture_view) {} - virtual void draw(); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual LLRect getRequiredRect(); // Return the height of this object, given the set options. + void draw() override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + LLRect getRequiredRect() override; // Return the height of this object, given the set options. // Used for sorting struct sort @@ -401,9 +401,9 @@ public: mTextureView(p.texture_view) {} - virtual void draw(); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual LLRect getRequiredRect(); // Return the height of this object, given the set options. + void draw() override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + LLRect getRequiredRect() override; // Return the height of this object, given the set options. private: LLTextureView* mTextureView; @@ -501,9 +501,9 @@ public: mTextureView(p.texture_view) {} - virtual void draw(); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual LLRect getRequiredRect(); // Return the height of this object, given the set options. + void draw() override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + LLRect getRequiredRect() override; // Return the height of this object, given the set options. private: LLTextureView* mTextureView; @@ -730,18 +730,18 @@ LLTextureView::LLTextureView(const LLTextureView::Params& p) setVisible(FALSE); setDisplayChildren(TRUE); - mGLTexMemBar = 0; - mAvatarTexBar = 0; + mGLTexMemBar = nullptr; + mAvatarTexBar = nullptr; } LLTextureView::~LLTextureView() { // Children all cleaned up by default view destructor. delete mGLTexMemBar; - mGLTexMemBar = 0; + mGLTexMemBar = nullptr; delete mAvatarTexBar; - mAvatarTexBar = 0; + mAvatarTexBar = nullptr; } typedef std::pair<F32,LLViewerFetchedTexture*> decode_pair_t; @@ -776,14 +776,14 @@ void LLTextureView::draw() { removeChild(mGLTexMemBar); mGLTexMemBar->die(); - mGLTexMemBar = 0; + mGLTexMemBar = nullptr; } if (mAvatarTexBar) { removeChild(mAvatarTexBar); mAvatarTexBar->die(); - mAvatarTexBar = 0; + mAvatarTexBar = nullptr; } typedef std::multiset<decode_pair_t, compare_decode_pair > display_list_t; @@ -849,7 +849,8 @@ void LLTextureView::draw() { LLViewerFetchedTexture* mImage; f(LLViewerFetchedTexture* image) : mImage(image) {} - virtual bool apply(LLViewerObject* object, S32 te) + + bool apply(LLViewerObject* object, S32 te) override { return (mImage == object->getTEImage(te)); } diff --git a/indra/newview/lltextureview.h b/indra/newview/lltextureview.h index 397711b1c8e007087cde9ec74bcfb667331925d3..c772d1b9e42cb91e10dbb459bde3c289ab9215c5 100644 --- a/indra/newview/lltextureview.h +++ b/indra/newview/lltextureview.h @@ -45,10 +45,10 @@ protected: public: ~LLTextureView(); - /*virtual*/ void draw(); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); + /*virtual*/ void draw() override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent) override; static void addDebugImage(LLViewerFetchedTexture* image) { sDebugImages.insert(image); } static void removeDebugImage(LLViewerFetchedTexture* image) { sDebugImages.insert(image); } diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index c7c96a9c4e66bd3b021bd5925d8e356cdcf5f066..e8f30e1ced618675b440cf5e166b2a44f365bfc2 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -39,8 +39,8 @@ using namespace LLNotificationsUI; //-------------------------------------------------------------------------- LLToastLifeTimer::LLToastLifeTimer(LLToast* toast, F32 period) - : mToast(toast), - LLEventTimer(period) + : LLEventTimer(period), + mToast(toast) { } @@ -88,33 +88,33 @@ F32 LLToastLifeTimer::getRemainingTimeF32() //-------------------------------------------------------------------------- LLToast::Params::Params() -: can_fade("can_fade", true), +: lifetime_secs("lifetime_secs", gSavedSettings.getS32("NotificationToastLifeTime")), + fading_time_secs("fading_time_secs", gSavedSettings.getS32("ToastFadingTime")), + can_fade("can_fade", true), can_be_stored("can_be_stored", true), + enable_hide_btn("enable_hide_btn", true), is_modal("is_modal", false), is_tip("is_tip", false), - enable_hide_btn("enable_hide_btn", true), force_show("force_show", false), - force_store("force_store", false), - fading_time_secs("fading_time_secs", gSavedSettings.getS32("ToastFadingTime")), - lifetime_secs("lifetime_secs", gSavedSettings.getS32("NotificationToastLifeTime")) + force_store("force_store", false) {}; LLToast::LLToast(const LLToast::Params& p) : LLModalDialog(LLSD(), p.is_modal), + mNotificationID(p.notif_id), + mSessionID(p.session_id), + mNotification(p.notification), + mWrapperPanel(nullptr), mToastLifetime(p.lifetime_secs), mToastFadingTime(p.fading_time_secs), - mNotificationID(p.notif_id), - mSessionID(p.session_id), + mPanel(nullptr), + mHideBtn(nullptr), mCanFade(p.can_fade), mCanBeStored(p.can_be_stored), mHideBtnEnabled(p.enable_hide_btn), - mHideBtn(NULL), - mPanel(NULL), - mNotification(p.notification), - mIsHidden(false), mHideBtnPressed(false), + mIsHidden(false), mIsTip(p.is_tip), - mWrapperPanel(NULL), mIsFading(false), mIsHovered(false) { @@ -611,7 +611,7 @@ void LLToast::updateClass() // static void LLToast::cleanupToasts() { - LLToast * toastp = NULL; + LLToast * toastp = nullptr; while (LLInstanceTracker<LLToast>::instanceCount() > 0) { diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 7576f4c568846d0c02f845a0396660fa533f0d32..b34714315a30b32114f3e69721bda71414dcf97e 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -49,7 +49,7 @@ public: LLToastLifeTimer(LLToast* toast, F32 period); /*virtual*/ - BOOL tick(); + BOOL tick() override; void stop(); void start(); void restart(); @@ -107,12 +107,12 @@ public: LLToast(const LLToast::Params& p); virtual ~LLToast(); - BOOL postBuild(); + BOOL postBuild() override; - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; // Toast handlers - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; //Fading @@ -139,19 +139,19 @@ public: // LLToastLifeTimer* getTimer() { return mTimer.get();} // - virtual void draw(); + void draw() override; // - virtual void setVisible(BOOL show); + void setVisible(BOOL show) override; /*virtual*/ void setBackgroundOpaque(BOOL b); // virtual void hide(); - /*virtual*/ void setFocus(BOOL b); + /*virtual*/ void setFocus(BOOL b) override; - /*virtual*/ void onFocusLost(); + /*virtual*/ void onFocusLost() override; - /*virtual*/ void onFocusReceived(); + /*virtual*/ void onFocusReceived() override; void setLifetime(S32 seconds); @@ -194,7 +194,7 @@ public: boost::signals2::connection setMouseEnterCallback( const commit_signal_t::slot_type& cb ) { return mToastMouseEnterSignal.connect(cb); }; boost::signals2::connection setMouseLeaveCallback( const commit_signal_t::slot_type& cb ) { return mToastMouseLeaveSignal.connect(cb); }; - virtual S32 notifyParent(const LLSD& info); + S32 notifyParent(const LLSD& info) override; LLHandle<LLToast> getHandle() const { return getDerivedHandle<LLToast>(); } diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index b0fb447507cd14a423aeff2754d797e4765aef14..b89823fa1e8cfdf1254e173b1fac7ec8b30a96d3 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -48,7 +48,7 @@ const S32 MAX_ALLOWED_MSG_WIDTH = 400; const F32 DEFAULT_BUTTON_DELAY = 0.5f; -/*static*/ LLControlGroup* LLToastAlertPanel::sSettings = NULL; +/*static*/ LLControlGroup* LLToastAlertPanel::sSettings = nullptr; /*static*/ LLToastAlertPanel::URLLoader* LLToastAlertPanel::sURLLoader; //----------------------------------------------------------------------------- @@ -61,10 +61,10 @@ static const S32 BTN_HPAD = 8; LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal) : LLToastPanel(notification), mDefaultOption( 0 ), - mCheck(NULL), + mCheck(nullptr), mCaution(notification->getPriority() >= NOTIFICATION_PRIORITY_HIGH), mLabel(notification->getName()), - mLineEditor(NULL) + mLineEditor(nullptr) { // EXP-1822 // save currently focused view, so that return focus to it @@ -544,7 +544,7 @@ void LLToastAlertPanel::onButtonPressed( const LLSD& data, S32 button ) response[button_data->mButton->getName()] = true; // If we declared a URL and chose the URL option, go to the url - if (!button_data->mURL.empty() && sURLLoader != NULL) + if (!button_data->mURL.empty() && sURLLoader != nullptr) { sURLLoader->load(button_data->mURL, button_data->mURLExternal); } diff --git a/indra/newview/lltoastalertpanel.h b/indra/newview/lltoastalertpanel.h index d1be5e018ead9eae01a34701e18eaef821f7726d..dbda62030c880ea4f59eddef1594530cb6f2608c 100644 --- a/indra/newview/lltoastalertpanel.h +++ b/indra/newview/lltoastalertpanel.h @@ -70,10 +70,10 @@ public: // User's responsibility to call show() after creating these. LLToastAlertPanel( LLNotificationPtr notep, bool is_modal ); - virtual BOOL handleKeyHere(KEY key, MASK mask ); + BOOL handleKeyHere(KEY key, MASK mask ) override; - virtual void draw(); - virtual void setVisible( BOOL visible ); + void draw() override; + void setVisible( BOOL visible ) override; bool setCheckBox( const std::string&, const std::string& ); void setCaution(BOOL val = TRUE) { mCaution = val; } diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp index 5abc6545b23f891076f5838d8afb4d608fe9aea5..47307e284e0cc8cefe1954ee6c03845641e41533 100644 --- a/indra/newview/lltoastgroupnotifypanel.cpp +++ b/indra/newview/lltoastgroupnotifypanel.cpp @@ -56,7 +56,7 @@ const S32 LLToastGroupNotifyPanel::DEFAULT_MESSAGE_MAX_LINE_COUNT = 7; LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(const LLNotificationPtr& notification) : LLToastPanel(notification), - mInventoryOffer(NULL) + mInventoryOffer(nullptr) { buildFromFile( "panel_group_notify.xml"); const LLSD& payload = notification->getPayload(); @@ -166,10 +166,10 @@ void LLToastGroupNotifyPanel::close() // The group notice dialog may be an inventory offer. // If it has an inventory save button and that button is still enabled // Then we need to send the inventory declined message - if(mInventoryOffer != NULL) + if(mInventoryOffer != nullptr) { mInventoryOffer->forceResponse(IOR_DECLINE); - mInventoryOffer = NULL; + mInventoryOffer = nullptr; } die(); @@ -184,7 +184,7 @@ void LLToastGroupNotifyPanel::onClickOk() void LLToastGroupNotifyPanel::onClickAttachment() { - if (mInventoryOffer != NULL) { + if (mInventoryOffer != nullptr) { mInventoryOffer->forceResponse(IOR_ACCEPT); LLTextBox * pAttachLink = getChild<LLTextBox> ("attachment"); @@ -201,7 +201,7 @@ void LLToastGroupNotifyPanel::onClickAttachment() LLNotifications::instance().add("AttachmentSaved", LLSD(), LLSD()); } - mInventoryOffer = NULL; + mInventoryOffer = nullptr; } } diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index ddc759f737ba6ddb8dec41549df88f2be156a62a..bdcb255d9e06672fa1ca12ba1eb55edb0b9435ac 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -49,8 +49,8 @@ const S32 LLToastIMPanel::DEFAULT_MESSAGE_MAX_LINE_COUNT = 6; //-------------------------------------------------------------------------- LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notification), - mAvatarIcon(NULL), mAvatarName(NULL), - mTime(NULL), mMessage(NULL), mGroupIcon(NULL) + mAvatarIcon(nullptr), mGroupIcon(nullptr), + mAvatarName(nullptr), mTime(nullptr), mMessage(nullptr) { buildFromFile( "panel_instant_message.xml"); diff --git a/indra/newview/lltoastimpanel.h b/indra/newview/lltoastimpanel.h index 7906832c0c59b82c91693ab912750abe37296699..e8bff75eb0f51a24ae5959d70022d69444bc700e 100644 --- a/indra/newview/lltoastimpanel.h +++ b/indra/newview/lltoastimpanel.h @@ -51,8 +51,8 @@ public: LLToastIMPanel(LLToastIMPanel::Params &p); virtual ~LLToastIMPanel(); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override; private: void showInspector(); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 691fd616901b33f03b8fe0a944fbcf7ff0ddef75..807ab023a4f0a96254cf4378067f7265aa00aaa3 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -54,8 +54,8 @@ const S32 MAX_LENGTH = 512 + 20 + DB_FIRST_NAME_BUF_SIZE + DB_LAST_NAME_BUF_SIZE //static -const LLFontGL* LLToastNotifyPanel::sFont = NULL; -const LLFontGL* LLToastNotifyPanel::sFontSmall = NULL; +const LLFontGL* LLToastNotifyPanel::sFont = nullptr; +const LLFontGL* LLToastNotifyPanel::sFontSmall = nullptr; LLToastNotifyPanel::button_click_signal_t LLToastNotifyPanel::sButtonClickSignal; @@ -147,8 +147,8 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vector<index_button_pair //reserve place for ignore button S32 bottom_offset = mIsScriptDialog ? (BTN_HEIGHT + IGNORE_BTN_TOP_DELTA + BOTTOM_PAD) : BOTTOM_PAD; S32 max_width = mControlPanel->getRect().getWidth(); - LLButton* ignore_btn = NULL; - LLButton* mute_btn = NULL; + LLButton* ignore_btn = nullptr; + LLButton* mute_btn = nullptr; for (std::vector<index_button_pair_t>::const_iterator it = buttons.begin(); it != buttons.end(); it++) { if (-2 == it->first) @@ -182,7 +182,7 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vector<index_button_pair U32 ignore_btn_width = 0; U32 mute_btn_pad = 0; - if (mIsScriptDialog && ignore_btn != NULL) + if (mIsScriptDialog && ignore_btn != nullptr) { LLRect ignore_btn_rect(ignore_btn->getRect()); S32 ignore_btn_left = max_width - ignore_btn_rect.getWidth(); @@ -194,7 +194,7 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vector<index_button_pair mute_btn_pad = 4 * HPAD; //only use a 4 * HPAD padding if an ignore button exists } - if (mIsScriptDialog && mute_btn != NULL) + if (mIsScriptDialog && mute_btn != nullptr) { LLRect mute_btn_rect(mute_btn->getRect()); // Place mute (Block) button to the left of the ignore button. @@ -254,9 +254,9 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) { deleteAllChildren(); - mTextBox = NULL; - mInfoPanel = NULL; - mControlPanel = NULL; + mTextBox = nullptr; + mInfoPanel = nullptr; + mControlPanel = nullptr; mNumOptions = 0; mNumButtons = 0; mAddedDefaultBtn = false; @@ -449,8 +449,8 @@ bool LLToastNotifyPanel::isControlPanelEnabled() const LLIMToastNotifyPanel::LLIMToastNotifyPanel(LLNotificationPtr& pNotification, const LLUUID& session_id, const LLRect& rect /* = LLRect::null */, bool show_images /* = true */, LLTextBase* parent_text) -: mSessionID(session_id), LLToastNotifyPanel(pNotification, rect, show_images), - mParentText(parent_text) +: LLToastNotifyPanel(pNotification, rect, show_images), mParentText(parent_text), + mSessionID(session_id) { compactButtons(); } @@ -497,7 +497,7 @@ void LLIMToastNotifyPanel::compactButtons() for (child_list_t::const_reverse_iterator it = children->rbegin(); it != children->rend(); it++) { LLButton * button = dynamic_cast<LLButton*> (*it); - if (button != NULL) + if (button != nullptr) { button->setOrigin( offset,button->getRect().mBottom); button->setLeftHPad(2 * HPAD); diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h index f423bed7191ca2edeb49b285800c40fca0e87ded..361c34a384e800bdaa729cb0994757a907963d27 100644 --- a/indra/newview/lltoastnotifypanel.h +++ b/indra/newview/lltoastnotifypanel.h @@ -141,16 +141,16 @@ public: const LLUUID& session_id, const LLRect& rect = LLRect::null, bool show_images = true, - LLTextBase* parent_text = NULL); + LLTextBase* parent_text = nullptr); void compactButtons(); - virtual void updateNotification(); - virtual void init( LLRect rect, bool show_images ); + void updateNotification() override; + void init( LLRect rect, bool show_images ) override; ~LLIMToastNotifyPanel(); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; protected: LLTextBase* mParentText; diff --git a/indra/newview/lltoastpanel.cpp b/indra/newview/lltoastpanel.cpp index 2719c2066832c13d1b2cc54530086225cba32373..7b8787e37e8509ca6d8efc898aee35838402853c 100644 --- a/indra/newview/lltoastpanel.cpp +++ b/indra/newview/lltoastpanel.cpp @@ -113,7 +113,7 @@ void LLToastPanel::snapToMessageHeight(LLTextBase* message, S32 maxLineCount) LLToastPanel* LLToastPanel::buidPanelFromNotification( const LLNotificationPtr& notification) { - LLToastPanel* res = NULL; + LLToastPanel* res = nullptr; //process tip toast panels if ("notifytip" == notification->getType()) diff --git a/indra/newview/lltoastscriptquestion.h b/indra/newview/lltoastscriptquestion.h index 343dc57db6d5b984ff6830e245d5407992b6287e..74b9e378b5fb2e54b714d1507283e9bbc95ecf05 100644 --- a/indra/newview/lltoastscriptquestion.h +++ b/indra/newview/lltoastscriptquestion.h @@ -36,10 +36,10 @@ class LLToastScriptQuestion : public LLToastPanel public: LLToastScriptQuestion(const LLNotificationPtr& notification); - virtual BOOL postBuild(); + BOOL postBuild() override; virtual ~LLToastScriptQuestion(){}; - /*virtual*/ void setFocus(BOOL b); + /*virtual*/ void setFocus(BOOL b) override; private: void snapToMessageHeight(); diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index 1a9b3aed64b6dc88ff47d840c9f4e7692814740a..f8b0f1df8f8381152b4211b21971890d9250b23c 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -72,7 +72,7 @@ BOOL LLTool::handleAnyMouseClick(S32 x, S32 y, MASK mask, LLMouseHandler::EClick // This is necessary to force clicks in the world to cause edit // boxes that might have keyboard focus to relinquish it, and hence // cause a commit to update their value. JC - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } return result; @@ -168,7 +168,7 @@ void LLTool::setMouseCapture( BOOL b ) else if( hasMouseCapture() ) { - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); } } @@ -191,7 +191,7 @@ LLTool* LLTool::getOverrideTool(MASK mask) // NOTE: if in flycam mode, ALT-ZOOM camera should be disabled if (LLViewerJoystick::getInstance()->getOverrideCamera()) { - return NULL; + return nullptr; } { if (mask & MASK_ALT) @@ -199,5 +199,5 @@ LLTool* LLTool::getOverrideTool(MASK mask) return LLToolCamera::getInstance(); } } - return NULL; + return nullptr; } diff --git a/indra/newview/lltool.h b/indra/newview/lltool.h index c5bad9d53272635821f71587dfe9764290faeebb..1548d4d0511a6c4fd17b1c76ea665cdf2603f80c 100644 --- a/indra/newview/lltool.h +++ b/indra/newview/lltool.h @@ -42,38 +42,39 @@ class LLTool : public LLMouseHandler, public LLThreadSafeRefCount { public: - LLTool( const std::string& name, LLToolComposite* composite = NULL ); + LLTool( const std::string& name, LLToolComposite* composite = nullptr ); virtual ~LLTool(); // Hack to support LLFocusMgr virtual BOOL isView() const { return FALSE; } // Virtual functions inherited from LLMouseHandler - virtual BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask); - - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); + BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down) override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) override; + + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleToolTip(S32 x, S32 y, MASK mask) override; // Return FALSE to allow context menu to be shown. - virtual void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const - { *local_x = screen_x; *local_y = screen_y; } - virtual void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const - { *screen_x = local_x; *screen_y = local_y; } + void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const override + { *local_x = screen_x; *local_y = screen_y; } - virtual const std::string& getName() const { return mName; } + void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const override + { *screen_x = local_x; *screen_y = local_y; } + + const std::string& getName() const override { return mName; } // New virtual functions - virtual LLViewerObject* getEditingObject() { return NULL; } + virtual LLViewerObject* getEditingObject() { return nullptr; } virtual LLVector3d getEditingPointGlobal() { return LLVector3d(); } - virtual BOOL isEditing() { return (getEditingObject() != NULL); } + virtual BOOL isEditing() { return (getEditingObject() != nullptr); } virtual void stopEditing() {} virtual BOOL clipMouseWhenDown() { return TRUE; } @@ -94,8 +95,8 @@ public: // Note: NOT virtual. Subclasses should call this version. void setMouseCapture(BOOL b); - BOOL hasMouseCapture(); - virtual void onMouseCaptureLost() {} // override this one as needed. + BOOL hasMouseCapture() override; + void onMouseCaptureLost() override {} // override this one as needed. protected: LLToolComposite* mComposite; // Composite will handle mouse captures. diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index 2e5092932bb3194943dd21dfa3ca05b0c6d2cf2e..a9c865262623b304f8d7870866180852f327f493 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -44,7 +44,7 @@ #include "lltooldraganddrop.h" #include "llxmlnode.h" -LLToolBarView* gToolBarView = NULL; +LLToolBarView* gToolBarView = nullptr; static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view"); @@ -69,16 +69,16 @@ LLToolBarView::ToolbarSet::ToolbarSet() LLToolBarView::LLToolBarView(const LLToolBarView::Params& p) : LLUICtrl(p), + mToolbarsLoaded(false), mDragStarted(false), + mDragToolbarButton(nullptr), + mDragItem(nullptr), mShowToolbars(true), - mDragToolbarButton(NULL), - mDragItem(NULL), - mToolbarsLoaded(false), - mBottomToolbarPanel(NULL) + mBottomToolbarPanel(nullptr) { for (S32 i = 0; i < LLToolBarEnums::TOOLBAR_COUNT; i++) { - mToolbars[i] = NULL; + mToolbars[i] = nullptr; } } @@ -229,7 +229,7 @@ bool LLToolBarView::loadToolbars(bool force_default) } LLXMLNodePtr root; - if(!LLXMLNode::parseFile(toolbar_file, root, NULL)) + if(!LLXMLNode::parseFile(toolbar_file, root, nullptr)) { LL_WARNS() << "Unable to load toolbars from file: " << toolbar_file << LL_ENDL; err = true; @@ -449,7 +449,7 @@ void LLToolBarView::saveToolbars() const { const std::string& filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "toolbars.xml"); LLFILE *fp = LLFile::fopen(filename, "w"); - if (fp != NULL) + if (fp != nullptr) { LLXMLNode::writeHeaderToFile(fp); output_node->writeToFile(fp); @@ -497,7 +497,7 @@ void LLToolBarView::onToolBarButtonAdded(LLView* button) LLCallDialog* incoming = static_cast<LLCallDialog *>(incoming_floater); LLDockControl* dock_control = incoming->getDockControl(); - if (dock_control->getDock() == NULL) + if (dock_control->getDock() == nullptr) { incoming->dockToToolbarButton("speak"); } @@ -508,7 +508,7 @@ void LLToolBarView::onToolBarButtonAdded(LLView* button) LLCallDialog* outgoing = static_cast<LLCallDialog *>(outgoing_floater); LLDockControl* dock_control = outgoing->getDockControl(); - if (dock_control->getDock() == NULL) + if (dock_control->getDock() == nullptr) { outgoing->dockToToolbarButton("speak"); } @@ -541,7 +541,7 @@ void LLToolBarView::onToolBarButtonRemoved(LLView* button) llassert(incoming); LLDockControl* dock_control = incoming->getDockControl(); - dock_control->setDock(NULL); + dock_control->setDock(nullptr); } if (outgoing_floater && outgoing_floater->isShown()) @@ -550,7 +550,7 @@ void LLToolBarView::onToolBarButtonRemoved(LLView* button) llassert(outgoing); LLDockControl* dock_control = outgoing->getDockControl(); - dock_control->setDock(NULL); + dock_control->setDock(nullptr); } } else if (button->getName() == "voice") @@ -668,7 +668,7 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t // Suppress the command from the toolbars (including the one it's dropped in, // this will handle move position). S32 old_toolbar_loc = gToolBarView->hasCommand(command_id); - LLToolBar* old_toolbar = NULL; + LLToolBar* old_toolbar = nullptr; if (old_toolbar_loc != LLToolBarEnums::TOOLBAR_NONE) { @@ -701,7 +701,7 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t } } - resetDragTool(NULL); + resetDragTool(nullptr); return handled; } diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index e7de5389e4d003004eca061332253ef3eb6445ae..18b10643375811e347d1dafaad79ab25a2b5121f 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -69,8 +69,8 @@ public: // Derived methods virtual ~LLToolBarView(); - virtual BOOL postBuild(); - virtual void draw(); + BOOL postBuild() override; + void draw() override; // Toolbar view interface with the rest of the world // Checks if the commandId is being used somewhere in one of the toolbars, returns EToolBarLocation diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index d9843d3639e693bc7d67fd1b5fd7698b73b6338e..bed20fac5e382567d2426d3ad86761803fe0574d 100644 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -461,7 +461,7 @@ void LLToolBrushLand::handleDeselect() { if( gEditMenuHandler == this ) { - gEditMenuHandler = NULL; + gEditMenuHandler = nullptr; } LLViewerParcelMgr::getInstance()->setSelectionVisible(TRUE); mBrushSelected = FALSE; @@ -591,7 +591,7 @@ void LLToolBrushLand::determineAffectedRegions(region_list_t& regions, LLVector3d corner(spot); corner.mdV[VX] -= (mBrushSize / 2); corner.mdV[VY] -= (mBrushSize / 2); - LLViewerRegion* region = NULL; + LLViewerRegion* region = nullptr; region = LLWorld::getInstance()->getRegionFromPosGlobal(corner); if(region && regions.find(region) == regions.end()) { diff --git a/indra/newview/lltoolbrush.h b/indra/newview/lltoolbrush.h index c108d8325681b0f54317f5d5899f05444bcb5ae7..30bc22755aa41cd3600d4d9b9489649eadeba6ad 100644 --- a/indra/newview/lltoolbrush.h +++ b/indra/newview/lltoolbrush.h @@ -49,27 +49,27 @@ class LLToolBrushLand : public LLTool, public LLEditMenuHandler, public LLSingle public: // x,y in window coords, 0,0 = left,bot - virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); - virtual BOOL handleHover( S32 x, S32 y, MASK mask ); - virtual void handleSelect(); - virtual void handleDeselect(); + BOOL handleMouseDown( S32 x, S32 y, MASK mask ) override; + BOOL handleMouseUp( S32 x, S32 y, MASK mask ) override; + BOOL handleHover( S32 x, S32 y, MASK mask ) override; + void handleSelect() override; + void handleDeselect() override; // isAlwaysRendered() - return true if this is a tool that should // always be rendered regardless of selection. - virtual BOOL isAlwaysRendered() { return TRUE; } + BOOL isAlwaysRendered() override { return TRUE; } // Draw the area that will be affected. - virtual void render(); + void render() override; // on Idle is where the land modification actually occurs static void onIdle(void* brush_tool); - void onMouseCaptureLost(); + void onMouseCaptureLost() override; void modifyLandInSelectionGlobal(); - virtual void undo(); - virtual BOOL canUndo() const { return TRUE; } + void undo() override; + BOOL canUndo() const override { return TRUE; } protected: void brush( void ); diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index 23639fcb243e91e05d57448dbe3de38f6fa4a32b..cf5375b3f7edf20b24d18cdba4efe8b5086b5152 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -57,7 +57,7 @@ #include "lleventtimer.h" // we use this in various places instead of NULL -static LLPointer<LLTool> sNullTool(new LLTool(std::string("null"), NULL)); +static LLPointer<LLTool> sNullTool(new LLTool(std::string("null"), nullptr)); //----------------------------------------------------------------------- // LLToolComposite @@ -85,7 +85,7 @@ LLToolComposite::LLToolComposite(const std::string& name) mCur(sNullTool), mDefault(sNullTool), mSelected(FALSE), - mMouseDown(FALSE), mManip(NULL), mSelectRect(NULL) + mMouseDown(FALSE), mManip(nullptr), mSelectRect(nullptr) { } @@ -145,7 +145,7 @@ LLToolCompInspect::LLToolCompInspect() LLToolCompInspect::~LLToolCompInspect() { delete mSelectRect; - mSelectRect = NULL; + mSelectRect = nullptr; } BOOL LLToolCompInspect::handleMouseDown(S32 x, S32 y, MASK mask) @@ -250,10 +250,10 @@ LLToolCompTranslate::LLToolCompTranslate() LLToolCompTranslate::~LLToolCompTranslate() { delete mManip; - mManip = NULL; + mManip = nullptr; delete mSelectRect; - mSelectRect = NULL; + mSelectRect = nullptr; } BOOL LLToolCompTranslate::handleHover(S32 x, S32 y, MASK mask) @@ -701,14 +701,14 @@ LLToolCompGun::LLToolCompGun() LLToolCompGun::~LLToolCompGun() { delete mGun; - mGun = NULL; + mGun = nullptr; delete mGrab; - mGrab = NULL; + mGrab = nullptr; // don't delete a static object // delete mNull; - mNull = NULL; + mNull = nullptr; } BOOL LLToolCompGun::handleHover(S32 x, S32 y, MASK mask) diff --git a/indra/newview/lltoolcomp.h b/indra/newview/lltoolcomp.h index fc40ae08d43396a810bbe7c51086ea794bd04111..a705a92f2d7d6782ae500638ec9085d5bf778c8e 100644 --- a/indra/newview/lltoolcomp.h +++ b/indra/newview/lltoolcomp.h @@ -45,37 +45,39 @@ class LLToolComposite : public LLTool public: LLToolComposite(const std::string& name); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) = 0; // Sets the current tool - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); // Returns to the default tool - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask) = 0; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override = 0; // Sets the current tool + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; // Returns to the default tool + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override = 0; // Map virtual functions to the currently active internal tool - virtual BOOL handleHover(S32 x, S32 y, MASK mask) { return mCur->handleHover( x, y, mask ); } - virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) { return mCur->handleScrollWheel( x, y, clicks ); } - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) { return mCur->handleRightMouseDown( x, y, mask ); } + BOOL handleHover(S32 x, S32 y, MASK mask) override { return mCur->handleHover( x, y, mask ); } + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override { return mCur->handleScrollWheel( x, y, clicks ); } + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override { return mCur->handleRightMouseDown( x, y, mask ); } - virtual LLViewerObject* getEditingObject() { return mCur->getEditingObject(); } - virtual LLVector3d getEditingPointGlobal() { return mCur->getEditingPointGlobal(); } - virtual BOOL isEditing() { return mCur->isEditing(); } - virtual void stopEditing() { mCur->stopEditing(); mCur = mDefault; } + LLViewerObject* getEditingObject() override { return mCur->getEditingObject(); } + LLVector3d getEditingPointGlobal() override { return mCur->getEditingPointGlobal(); } + BOOL isEditing() override { return mCur->isEditing(); } - virtual BOOL clipMouseWhenDown() { return mCur->clipMouseWhenDown(); } + void stopEditing() override + { mCur->stopEditing(); mCur = mDefault; } - virtual void handleSelect(); - virtual void handleDeselect(); + BOOL clipMouseWhenDown() override { return mCur->clipMouseWhenDown(); } - virtual void render() { mCur->render(); } - virtual void draw() { mCur->draw(); } + void handleSelect() override; + void handleDeselect() override; - virtual BOOL handleKey(KEY key, MASK mask) { return mCur->handleKey( key, mask ); } + void render() override { mCur->render(); } + void draw() override { mCur->draw(); } - virtual void onMouseCaptureLost(); + BOOL handleKey(KEY key, MASK mask) override { return mCur->handleKey( key, mask ); } - virtual void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const - { mCur->screenPointToLocal(screen_x, screen_y, local_x, local_y); } + void onMouseCaptureLost() override; - virtual void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const - { mCur->localPointToScreen(local_x, local_y, screen_x, screen_y); } + void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const override + { mCur->screenPointToLocal(screen_x, screen_y, local_x, local_y); } + + void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const override + { mCur->localPointToScreen(local_x, local_y, screen_x, screen_y); } BOOL isSelecting(); LLTool* getCurrentTool() { return mCur; } @@ -108,11 +110,11 @@ class LLToolCompInspect : public LLToolComposite, public LLSingleton<LLToolCompI public: // Overridden from LLToolComposite - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual BOOL handleKey(KEY key, MASK mask); - virtual void onMouseCaptureLost(); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + BOOL handleKey(KEY key, MASK mask) override; + void onMouseCaptureLost() override; void keyUp(KEY key, MASK mask); static void pickCallback(const LLPickInfo& pick_info); @@ -133,13 +135,13 @@ class LLToolCompTranslate : public LLToolComposite, public LLSingleton<LLToolCom public: // Overridden from LLToolComposite - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); // Returns to the default tool - virtual void render(); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; // Returns to the default tool + void render() override; - virtual LLTool* getOverrideTool(MASK mask); + LLTool* getOverrideTool(MASK mask) override; static void pickCallback(const LLPickInfo& pick_info); }; @@ -154,13 +156,13 @@ class LLToolCompScale : public LLToolComposite, public LLSingleton<LLToolCompSca public: // Overridden from LLToolComposite - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); // Returns to the default tool - virtual void render(); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; // Returns to the default tool + void render() override; - virtual LLTool* getOverrideTool(MASK mask); + LLTool* getOverrideTool(MASK mask) override; static void pickCallback(const LLPickInfo& pick_info); }; @@ -176,13 +178,13 @@ class LLToolCompRotate : public LLToolComposite, public LLSingleton<LLToolCompRo public: // Overridden from LLToolComposite - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual void render(); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + void render() override; - virtual LLTool* getOverrideTool(MASK mask); + LLTool* getOverrideTool(MASK mask) override; static void pickCallback(const LLPickInfo& pick_info); @@ -199,9 +201,9 @@ class LLToolCompCreate : public LLToolComposite, public LLSingleton<LLToolCompCr public: // Overridden from LLToolComposite - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; static void pickCallback(const LLPickInfo& pick_info); protected: @@ -223,20 +225,20 @@ class LLToolCompGun : public LLToolComposite, public LLSingleton<LLToolCompGun> virtual ~LLToolCompGun(); public: - virtual void draw(); + void draw() override; // Overridden from LLToolComposite - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - virtual void onMouseCaptureLost(); - virtual void handleSelect(); - virtual void handleDeselect(); - virtual LLTool* getOverrideTool(MASK mask) { return NULL; } + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + void onMouseCaptureLost() override; + void handleSelect() override; + void handleDeselect() override; + LLTool* getOverrideTool(MASK mask) override { return nullptr; } protected: LLToolGun* mGun; diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 11dda51dc40177b45b7d0ed5c1a86624a116ba9c..98b55fc27facd3cbdaf0290596596c1bdef9bf63 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -73,8 +73,9 @@ class LLNoPreferredType : public LLInventoryCollectFunctor public: LLNoPreferredType() {} virtual ~LLNoPreferredType() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item) + + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override { if (cat && (cat->getPreferredType() == LLFolderType::FT_NONE)) { @@ -89,8 +90,9 @@ class LLNoPreferredTypeOrItem : public LLInventoryCollectFunctor public: LLNoPreferredTypeOrItem() {} virtual ~LLNoPreferredTypeOrItem() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item) + + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override { if (item) return true; if (cat && (cat->getPreferredType() == LLFolderType::FT_NONE)) @@ -107,8 +109,8 @@ public: LLDroppableItem(BOOL is_transfer) : mCountLosing(0), mIsTransfer(is_transfer) {} virtual ~LLDroppableItem() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; S32 countNoCopy() const { return mCountLosing; } protected: @@ -144,7 +146,7 @@ class LLDropCopyableItems : public LLInventoryCollectFunctor public: LLDropCopyableItems() {} virtual ~LLDropCopyableItems() {} - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override; }; @@ -177,7 +179,8 @@ public: LLInventoryFetchComboObserver(folder_ids, item_ids) {} ~LLCategoryFireAndForget() {} - virtual void done() + + void done() override { /* no-op: it's fire n forget right? */ LL_DEBUGS() << "LLCategoryFireAndForget::done()" << LL_ENDL; @@ -195,7 +198,7 @@ public: mSource(src) {} ~LLCategoryDropObserver() {} - virtual void done(); + void done() override; protected: LLUUID mObjectID; @@ -209,7 +212,7 @@ void LLCategoryDropObserver::done() if (dst_obj) { // *FIX: coalesce these... - LLInventoryItem* item = NULL; + LLInventoryItem* item = nullptr; uuid_vec_t::iterator it = mComplete.begin(); uuid_vec_t::iterator end = mComplete.end(); for(; it < end; ++it) @@ -339,7 +342,7 @@ LLToolDragAndDrop::LLDragAndDropDictionary::LLDragAndDropDictionary() }; LLToolDragAndDrop::LLToolDragAndDrop() -: LLTool(std::string("draganddrop"), NULL), +: LLTool(std::string("draganddrop"), nullptr), mCargoCount(0), mDragStartX(0), mDragStartY(0), @@ -403,7 +406,7 @@ void LLToolDragAndDrop::beginDrag(EDragAndDropType type, LLNoPreferredTypeOrItem is_not_preferred; uuid_vec_t folder_ids; uuid_vec_t item_ids; - if (is_not_preferred(cat, NULL)) + if (is_not_preferred(cat, nullptr)) { folder_ids.push_back(cargo_id); } @@ -463,7 +466,7 @@ void LLToolDragAndDrop::beginMultiDrag( if ((mSource == SOURCE_AGENT) || (mSource == SOURCE_LIBRARY)) { // find categories (i.e. inventory folders) in the cargo. - LLInventoryCategory* cat = NULL; + LLInventoryCategory* cat = nullptr; S32 count = llmin(cargo_ids.size(), types.size()); std::set<LLUUID> cat_ids; for(S32 i = 0; i < count; ++i) @@ -474,7 +477,7 @@ void LLToolDragAndDrop::beginMultiDrag( LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; LLNoPreferredType is_not_preferred; - if (is_not_preferred(cat, NULL)) + if (is_not_preferred(cat, nullptr)) { cat_ids.insert(cat->getUUID()); } @@ -863,7 +866,7 @@ void LLToolDragAndDrop::dragOrDrop3D( S32 x, S32 y, MASK mask, BOOL drop, EAccep void LLToolDragAndDrop::pickCallback(const LLPickInfo& pick_info) { - if (getInstance() != NULL) + if (getInstance() != nullptr) { getInstance()->pick(pick_info); } @@ -878,7 +881,7 @@ void LLToolDragAndDrop::pick(const LLPickInfo& pick_info) LLSelectMgr::getInstance()->unhighlightAll(); bool highlight_object = false; // Treat attachments as part of the avatar they are attached to. - if (hit_obj != NULL) + if (hit_obj != nullptr) { // don't allow drag and drop on grass, trees, etc. if (pick_info.mPickType == LLPickInfo::PICK_FLORA) @@ -1551,7 +1554,7 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL // gAgent.getGroupID()) // && (obj->mPermModify || obj->mFlagAllowInventoryAdd)); BOOL worn = FALSE; - LLVOAvatarSelf* my_avatar = NULL; + LLVOAvatarSelf* my_avatar = nullptr; switch(item->getType()) { case LLAssetType::AT_OBJECT: @@ -1616,7 +1619,7 @@ static void give_inventory_cb(const LLSD& notification, const LLSD& response) const LLUUID& agent_id = payload["agent_id"]; LLViewerInventoryItem * inv_item = gInventory.getItem(payload["item_id"]); LLViewerInventoryCategory * inv_cat = gInventory.getCategory(payload["item_id"]); - if (NULL == inv_item && NULL == inv_cat) + if (nullptr == inv_item && nullptr == inv_cat) { llassert( FALSE ); return; @@ -1711,7 +1714,7 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ LLIMModel::LLIMSession * session = LLIMModel::instance().findIMSession(session_id); // If no IM session found get the destination agent's name by id. - if (NULL == session) + if (nullptr == session) { LLAvatarName av_name; @@ -1809,7 +1812,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( { if(mSource == SOURCE_LIBRARY) { - LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0)); + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)nullptr)); copy_inventory_item( gAgent.getID(), item->getPermissions().getOwner(), @@ -1820,7 +1823,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( } else { - rez_attachment(item, 0); + rez_attachment(item, nullptr); } } return ACCEPT_YES_SINGLE; @@ -2298,7 +2301,7 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { LL_DEBUGS() << "LLToolDragAndDrop::dad3dUpdateInventoryCategory()" << LL_ENDL; - if (obj == NULL) + if (obj == nullptr) { LL_WARNS() << "obj is NULL; aborting func with ACCEPT_NO" << LL_ENDL; return ACCEPT_NO; @@ -2313,8 +2316,8 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( return ACCEPT_NO_LOCKED; } - LLViewerInventoryItem* item = NULL; - LLViewerInventoryCategory* cat = NULL; + LLViewerInventoryItem* item = nullptr; + LLViewerInventoryCategory* cat = nullptr; locateInventory(item, cat); if (!cat) { @@ -2499,8 +2502,8 @@ EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezFromObjectOnLand()" << LL_ENDL; - LLViewerInventoryItem* item = NULL; - LLViewerInventoryCategory* cat = NULL; + LLViewerInventoryItem* item = nullptr; + LLViewerInventoryCategory* cat = nullptr; locateInventory(item, cat); if (!item || !item->isFinished()) return ACCEPT_NO; @@ -2624,13 +2627,13 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory( LLViewerInventoryItem*& item, LLViewerInventoryCategory*& cat) { - item = NULL; - cat = NULL; + item = nullptr; + cat = nullptr; if (mCargoIDs.empty() || (mSource == SOURCE_PEOPLE)) ///< There is no inventory item for people drag and drop. { - return NULL; + return nullptr; } if((mSource == SOURCE_AGENT) || (mSource == SOURCE_LIBRARY)) @@ -2671,7 +2674,7 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory( if(item) return item; if(cat) return cat; - return NULL; + return nullptr; } /* diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index 766046785b6cd13ac7e0ddc0d45a4528faeb6f7a..d8c3ffdee665a2159dc588f09d130afa64d14f1b 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -48,12 +48,12 @@ public: typedef boost::signals2::signal<void ()> enddrag_signal_t; // overridden from LLTool - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleKey(KEY key, MASK mask); - virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); - virtual void onMouseCaptureLost(); - virtual void handleDeselect(); + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleKey(KEY key, MASK mask) override; + BOOL handleToolTip(S32 x, S32 y, MASK mask) override; + void onMouseCaptureLost() override; + void handleDeselect() override; void setDragStart( S32 x, S32 y ); // In screen space BOOL isOverThreshold( S32 x, S32 y ); // In screen space diff --git a/indra/newview/lltoolface.h b/indra/newview/lltoolface.h index e4b8ae12b87d4a62e95e727feee1527acc97b149..d3e832cb62768625b6f378a1b440f968533d3261 100644 --- a/indra/newview/lltoolface.h +++ b/indra/newview/lltoolface.h @@ -39,11 +39,11 @@ class LLToolFace virtual ~LLToolFace(); public: - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual void handleSelect(); - virtual void handleDeselect(); - virtual void render(); // draw face highlights + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + void handleSelect() override; + void handleDeselect() override; + void render() override; // draw face highlights static void pickCallback(const LLPickInfo& pick_info); }; diff --git a/indra/newview/lltoolfocus.h b/indra/newview/lltoolfocus.h index cfc235b6c2a411fba999d95e0de805f7fb13b532..a89884bc0ca41934e6602c729be7b098b03cd512 100644 --- a/indra/newview/lltoolfocus.h +++ b/indra/newview/lltoolfocus.h @@ -38,16 +38,16 @@ class LLToolCamera virtual ~LLToolCamera(); public: - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; - virtual void onMouseCaptureLost(); + void onMouseCaptureLost() override; - virtual void handleSelect(); - virtual void handleDeselect(); + void handleSelect() override; + void handleDeselect() override; - virtual LLTool* getOverrideTool(MASK mask) { return NULL; } + LLTool* getOverrideTool(MASK mask) override { return nullptr; } static void pickCallback(const LLPickInfo& pick_info); BOOL mouseSteerMode() { return mMouseSteering; } diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index 15d29365fd86270408d1eed9b23775ce069310f7..222dbd1d7e4602a0e7b2220dcc71c94506830727 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -65,7 +65,7 @@ const S32 SLOP_DIST_SQ = 4; // Override modifier key behavior with these buttons BOOL gGrabBtnVertical = FALSE; BOOL gGrabBtnSpin = FALSE; -LLTool* gGrabTransientTool = NULL; +LLTool* gGrabTransientTool = nullptr; extern BOOL gDebugClicks; // @@ -86,8 +86,8 @@ LLToolGrabBase::LLToolGrabBase( LLToolComposite* composite ) mLastFace(0), mSpinGrabbing( FALSE ), mSpinRotation(), - mClickedInMouselook( FALSE ), - mHideBuildHighlight(FALSE) + mHideBuildHighlight(FALSE), + mClickedInMouselook( FALSE ) { } LLToolGrabBase::~LLToolGrabBase() @@ -194,7 +194,7 @@ BOOL LLToolGrabBase::handleObjectHit(const LLPickInfo& info) LL_INFOS() << "LLToolGrab handleObjectHit " << info.mMousePt.mX << "," << info.mMousePt.mY << LL_ENDL; } - if (NULL == objectp) // unexpected + if (nullptr == objectp) // unexpected { LL_WARNS() << "objectp was NULL; returning FALSE" << LL_ENDL; return FALSE; @@ -205,7 +205,7 @@ BOOL LLToolGrabBase::handleObjectHit(const LLPickInfo& info) if (gGrabTransientTool) { gBasicToolset->selectTool( gGrabTransientTool ); - gGrabTransientTool = NULL; + gGrabTransientTool = nullptr; } return TRUE; } @@ -310,7 +310,7 @@ BOOL LLToolGrabBase::handleObjectHit(const LLPickInfo& info) && (mMode == GRAB_NONPHYSICAL || mMode == GRAB_LOCKED)) { gBasicToolset->selectTool( gGrabTransientTool ); - gGrabTransientTool = NULL; + gGrabTransientTool = nullptr; } return TRUE; @@ -951,7 +951,7 @@ BOOL LLToolGrabBase::handleMouseUp(S32 x, S32 y, MASK mask) if (gGrabTransientTool) { gBasicToolset->selectTool( gGrabTransientTool ); - gGrabTransientTool = NULL; + gGrabTransientTool = nullptr; } } if (mClickedInMouselook) diff --git a/indra/newview/lltoolgrab.h b/indra/newview/lltoolgrab.h index 42acc86cf37a17d3c398570a143527a35dbb5345..3060c134aff6f3c2ff137ef8242355086049c9e1 100644 --- a/indra/newview/lltoolgrab.h +++ b/indra/newview/lltoolgrab.h @@ -53,25 +53,25 @@ void send_ObjectDeGrab_message(LLViewerObject* object, const LLPickInfo & pick); class LLToolGrabBase : public LLTool { public: - LLToolGrabBase(LLToolComposite* composite=NULL); + LLToolGrabBase(LLToolComposite* composite= nullptr); ~LLToolGrabBase(); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - /*virtual*/ void render(); // 3D elements - /*virtual*/ void draw(); // 2D elements - - virtual void handleSelect(); - virtual void handleDeselect(); - - virtual LLViewerObject* getEditingObject(); - virtual LLVector3d getEditingPointGlobal(); - virtual BOOL isEditing(); - virtual void stopEditing(); - - virtual void onMouseCaptureLost(); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + /*virtual*/ void render() override; // 3D elements + /*virtual*/ void draw() override; // 2D elements + + void handleSelect() override; + void handleDeselect() override; + + LLViewerObject* getEditingObject() override; + LLVector3d getEditingPointGlobal() override; + BOOL isEditing() override; + void stopEditing() override; + + void onMouseCaptureLost() override; BOOL hasGrabOffset() { return TRUE; } // HACK LLVector3 getGrabOffset(S32 x, S32 y); // HACK diff --git a/indra/newview/lltoolgun.h b/indra/newview/lltoolgun.h index e00be321ff725425d8b6e2548b1c0dc747538203..ca70fd08b16f8c1635a6cc6cdfac0d8a4bbc3f09 100644 --- a/indra/newview/lltoolgun.h +++ b/indra/newview/lltoolgun.h @@ -34,18 +34,18 @@ class LLToolGun : public LLTool { public: - LLToolGun( LLToolComposite* composite=NULL ); + LLToolGun( LLToolComposite* composite= nullptr ); - virtual void draw(); + void draw() override; - virtual void handleSelect(); - virtual void handleDeselect(); + void handleSelect() override; + void handleDeselect() override; - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; - virtual LLTool* getOverrideTool(MASK mask) { return NULL; } - virtual BOOL clipMouseWhenDown() { return FALSE; } + LLTool* getOverrideTool(MASK mask) override { return nullptr; } + BOOL clipMouseWhenDown() override { return FALSE; } private: BOOL mIsSelected; diff --git a/indra/newview/lltoolindividual.h b/indra/newview/lltoolindividual.h index e7c2060fba01909da6a84bc444dc7f03d9e256bf..a4622c798e2bb0a107515af30076c751cc57b243 100644 --- a/indra/newview/lltoolindividual.h +++ b/indra/newview/lltoolindividual.h @@ -43,9 +43,9 @@ class LLToolIndividual : public LLTool, public LLSingleton<LLToolIndividual> virtual ~LLToolIndividual(); public: - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual void handleSelect(); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + void handleSelect() override; //virtual void handleDeselect(); //virtual void render(); diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 7e5802303571d86ebf9b4b10db5b20cc38cf8ff0..cc4c505a4e1f3785c232a5c54b0491cbdbc5d37e 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -62,25 +62,25 @@ // Used when app not active to avoid processing hover. -LLTool* gToolNull = NULL; +LLTool* gToolNull = nullptr; -LLToolset* gBasicToolset = NULL; -LLToolset* gCameraToolset = NULL; +LLToolset* gBasicToolset = nullptr; +LLToolset* gCameraToolset = nullptr; //LLToolset* gLandToolset = NULL; -LLToolset* gMouselookToolset = NULL; -LLToolset* gFaceEditToolset = NULL; +LLToolset* gMouselookToolset = nullptr; +LLToolset* gFaceEditToolset = nullptr; ///////////////////////////////////////////////////// // LLToolMgr LLToolMgr::LLToolMgr() : - mBaseTool(NULL), - mSavedTool(NULL), - mTransientTool( NULL ), - mOverrideTool( NULL ), - mSelectedTool( NULL ), - mCurrentToolset( NULL ) + mBaseTool(nullptr), + mSavedTool(nullptr), + mTransientTool(nullptr ), + mOverrideTool(nullptr ), + mSelectedTool(nullptr ), + mCurrentToolset(nullptr ) { // Not a panel, register these callbacks globally. LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this)); @@ -130,19 +130,19 @@ void LLToolMgr::initTools() LLToolMgr::~LLToolMgr() { delete gBasicToolset; - gBasicToolset = NULL; + gBasicToolset = nullptr; delete gMouselookToolset; - gMouselookToolset = NULL; + gMouselookToolset = nullptr; delete gFaceEditToolset; - gFaceEditToolset = NULL; + gFaceEditToolset = nullptr; delete gCameraToolset; - gCameraToolset = NULL; + gCameraToolset = nullptr; delete gToolNull; - gToolNull = NULL; + gToolNull = nullptr; } BOOL LLToolMgr::usingTransientTool() @@ -179,24 +179,24 @@ void LLToolMgr::setCurrentTool( LLTool* tool ) { if (mTransientTool) { - mTransientTool = NULL; + mTransientTool = nullptr; } mBaseTool = tool; updateToolStatus(); - mSavedTool = NULL; + mSavedTool = nullptr; } LLTool* LLToolMgr::getCurrentTool() { MASK override_mask = gKeyboard ? gKeyboard->currentMask(TRUE) : 0; - LLTool* cur_tool = NULL; + LLTool* cur_tool = nullptr; // always use transient tools if available if (mTransientTool) { - mOverrideTool = NULL; + mOverrideTool = nullptr; cur_tool = mTransientTool; } // tools currently grabbing mouse input will stay active @@ -382,7 +382,7 @@ void LLToolMgr::setTransientTool(LLTool* tool) { if (mTransientTool) { - mTransientTool = NULL; + mTransientTool = nullptr; } mTransientTool = tool; @@ -395,7 +395,7 @@ void LLToolMgr::clearTransientTool() { if (mTransientTool) { - mTransientTool = NULL; + mTransientTool = nullptr; if (!mBaseTool) { LL_WARNS() << "mBaseTool is NULL" << LL_ENDL; @@ -428,7 +428,7 @@ void LLToolMgr::onAppFocusGained() void LLToolMgr::clearSavedTool() { - mSavedTool = NULL; + mSavedTool = nullptr; } ///////////////////////////////////////////////////// @@ -477,7 +477,7 @@ void LLToolset::selectFirstTool() void LLToolset::selectNextTool() { - LLTool* next = NULL; + LLTool* next = nullptr; for( tool_list_t::iterator iter = mToolList.begin(); iter != mToolList.end(); ) { @@ -502,7 +502,7 @@ void LLToolset::selectNextTool() void LLToolset::selectPrevTool() { - LLTool* prev = NULL; + LLTool* prev = nullptr; for( tool_list_t::reverse_iterator iter = mToolList.rbegin(); iter != mToolList.rend(); ) { diff --git a/indra/newview/lltoolmgr.h b/indra/newview/lltoolmgr.h index 28465d5d2cd1e83de8cbe1829bfd840822413fe9..a1adb7effa6d3d8ea756e256f3c845e41690a243 100644 --- a/indra/newview/lltoolmgr.h +++ b/indra/newview/lltoolmgr.h @@ -92,7 +92,7 @@ protected: class LLToolset { public: - LLToolset() : mSelectedTool(NULL), mIsShowFloaterTools(true) {} + LLToolset() : mSelectedTool(nullptr), mIsShowFloaterTools(true) {} LLTool* getSelectedTool() { return mSelectedTool; } diff --git a/indra/newview/lltoolmorph.h b/indra/newview/lltoolmorph.h index 6086e127e1b6f7b356fd8aad399ba3f40d1f8b60..62a5d7090f00ae347071250265563aaa539fc9c1 100644 --- a/indra/newview/lltoolmorph.h +++ b/indra/newview/lltoolmorph.h @@ -61,11 +61,11 @@ public: F32 param_weight, LLJoint* jointp); - /*virtual*/ S8 getType() const ; + /*virtual*/ S8 getType() const override; - BOOL needsRender(); - void preRender(BOOL clear_depth); - BOOL render(); + BOOL needsRender() override; + void preRender(BOOL clear_depth) override; + BOOL render() override; void requestUpdate( S32 delay_frames ) {mNeedsUpdate = TRUE; mDelayFrames = delay_frames; } void setUpdateDelayFrames( S32 delay_frames ) { mDelayFrames = delay_frames; } void draw(F32 alpha); @@ -79,7 +79,7 @@ public: const LLRect& getRect() { return mRect; } // Requests updates for all instances (excluding two possible exceptions) Grungy but efficient. - static void requestHintUpdates( LLVisualParamHint* exception1 = NULL, LLVisualParamHint* exception2 = NULL ); + static void requestHintUpdates( LLVisualParamHint* exception1 = nullptr, LLVisualParamHint* exception2 = nullptr ); protected: BOOL mNeedsUpdate; // does this texture need to be re-rendered? @@ -107,8 +107,8 @@ protected: /*virtual */ ~LLVisualParamReset(){} public: LLVisualParamReset(); - /*virtual */ BOOL render(); - /*virtual*/ S8 getType() const ; + /*virtual */ BOOL render() override; + /*virtual*/ S8 getType() const override; static BOOL sDirty; }; diff --git a/indra/newview/lltoolobjpicker.cpp b/indra/newview/lltoolobjpicker.cpp index 89576b53b5dbdc0023408863d17fe8c332962b69..7acba0275d41402a1f9888191a461691c87464b8 100644 --- a/indra/newview/lltoolobjpicker.cpp +++ b/indra/newview/lltoolobjpicker.cpp @@ -48,11 +48,11 @@ LLToolObjPicker::LLToolObjPicker() -: LLTool( std::string("ObjPicker"), NULL ), +: LLTool( std::string("ObjPicker"), nullptr ), mPicked( FALSE ), mHitObjectID( LLUUID::null ), - mExitCallback( NULL ), - mExitCallbackData( NULL ) + mExitCallback(nullptr ), + mExitCallbackData(nullptr ) { } @@ -140,8 +140,8 @@ void LLToolObjPicker::onMouseCaptureLost() { mExitCallback(mExitCallbackData); - mExitCallback = NULL; - mExitCallbackData = NULL; + mExitCallback = nullptr; + mExitCallbackData = nullptr; } mPicked = FALSE; diff --git a/indra/newview/lltoolobjpicker.h b/indra/newview/lltoolobjpicker.h index 5ad9b67e217859e85709603b33b0ea29b775e53b..e7a4ac58149caa1bf9a85b31df3e93547ed90374 100644 --- a/indra/newview/lltoolobjpicker.h +++ b/indra/newview/lltoolobjpicker.h @@ -38,14 +38,14 @@ class LLToolObjPicker : public LLTool, public LLSingleton<LLToolObjPicker> LLSINGLETON(LLToolObjPicker); public: - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; - virtual void handleSelect(); - virtual void handleDeselect(); + void handleSelect() override; + void handleDeselect() override; - virtual void onMouseCaptureLost(); + void onMouseCaptureLost() override; virtual void setExitCallback(void (*callback)(void *), void *callback_data); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index de7ca8576039e696fade7b32c86bea373b532fc9..eb549380bbc27a9159ac92b087934fae33a6dc30 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -173,13 +173,13 @@ BOOL LLToolPie::handleLeftClickPick() } } - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); return LLTool::handleMouseDown(x, y, mask); } // didn't click in any UI object, so must have clicked in the world LLViewerObject *object = mPick.getObject(); - LLViewerObject *parent = NULL; + LLViewerObject *parent = nullptr; if (mPick.mPickType != LLPickInfo::PICK_LAND) { @@ -220,7 +220,7 @@ BOOL LLToolPie::handleLeftClickPick() { handle_object_sit_or_stand(); // put focus in world when sitting on an object - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); return TRUE; } // else nothing (fall through to touch) } @@ -308,7 +308,7 @@ BOOL LLToolPie::handleLeftClickPick() { // don't click to walk on attempt to give focus to world mBlockClickToWalk = true; - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } BOOL touchable = (object && object->flagHandleTouch()) @@ -410,7 +410,7 @@ U8 final_click_action(LLViewerObject* obj) ECursorType LLToolPie::cursorFromObject(LLViewerObject* object) { - LLViewerObject* parent = NULL; + LLViewerObject* parent = nullptr; if (object) { parent = object->getRootEdit(); @@ -469,8 +469,8 @@ ECursorType LLToolPie::cursorFromObject(LLViewerObject* object) void LLToolPie::resetSelection() { - mLeftClickSelection = NULL; - mClickActionObject = NULL; + mLeftClickSelection = nullptr; + mClickActionObject = nullptr; mClickAction = 0; } @@ -536,7 +536,7 @@ void LLToolPie::selectionPropertiesReceived() BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) { mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE, FALSE); - LLViewerObject *parent = NULL; + LLViewerObject *parent = nullptr; LLViewerObject *object = mHoverPick.getObject(); LLSelectMgr::getInstance()->setHoverObject(object, mHoverPick.mObjectFace); if (object) @@ -621,7 +621,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) static LLCachedControl<bool> enable_highlight( gSavedSettings, "RenderHoverGlowEnable", false); - LLDrawable* drawable = NULL; + LLDrawable* drawable = nullptr; if (enable_highlight && show_highlight && object) { drawable = object->mDrawable; @@ -1111,7 +1111,7 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l if (mep) { viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); - LLPluginClassMedia* media_plugin = NULL; + LLPluginClassMedia* media_plugin = nullptr; if (media_impl.notNull() && (media_impl->hasMedia())) { @@ -1284,7 +1284,7 @@ void LLToolPie::playCurrentMedia(const LLPickInfo& info) //TODO: Can you Use it? - LLPluginClassMedia* media_plugin = NULL; + LLPluginClassMedia* media_plugin = nullptr; viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); @@ -1336,7 +1336,7 @@ void LLToolPie::VisitHomePage(const LLPickInfo& info) //TODO: Can you Use it? - LLPluginClassMedia* media_plugin = NULL; + LLPluginClassMedia* media_plugin = nullptr; viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); @@ -1364,7 +1364,7 @@ void LLToolPie::handleDeselect() setMouseCapture( FALSE ); // Calls onMouseCaptureLost() indirectly } // remove temporary selection for pie menu - LLSelectMgr::getInstance()->setHoverObject(NULL); + LLSelectMgr::getInstance()->setHoverObject(nullptr); // Menu may be still up during transfer to different tool. // toolfocus and toolgrab should retain menu, they will clear it if needed @@ -1658,7 +1658,7 @@ static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp) if( face < 0 || face >= objectp->getNumTEs() ) return; // is media playing on this face? - if (LLViewerMedia::getMediaImplFromTextureID(objectp->getTE(face)->getID()) != NULL) + if (LLViewerMedia::getMediaImplFromTextureID(objectp->getTE(face)->getID()) != nullptr) { handle_click_action_play(); return; @@ -1806,7 +1806,7 @@ BOOL LLToolPie::handleRightClickPick() // non UI object - put focus back "in world" if (gFocusMgr.getKeyboardFocus()) { - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } LLTool::handleRightMouseDown(x, y, mask); diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index a179a3aff083bd68a262dd25fe7478d9f662ec30..9b84ff34ff020d01824f44865816829f44be7abb 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -42,24 +42,24 @@ class LLToolPie : public LLTool, public LLSingleton<LLToolPie> public: // Virtual functions inherited from LLMouseHandler - virtual BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); + BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down) override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override; + BOOL handleToolTip(S32 x, S32 y, MASK mask) override; - virtual void render(); + void render() override; - virtual void stopEditing(); + void stopEditing() override; - virtual void onMouseCaptureLost(); - virtual void handleSelect(); - virtual void handleDeselect(); - virtual LLTool* getOverrideTool(MASK mask); + void onMouseCaptureLost() override; + void handleSelect() override; + void handleDeselect() override; + LLTool* getOverrideTool(MASK mask) override; LLPickInfo& getPick() { return mPick; } U8 getClickAction() { return mClickAction; } diff --git a/indra/newview/lltoolpipette.h b/indra/newview/lltoolpipette.h index 5cac91a60ec92b5c90065b1e0adb88c59a48d805..19e690d4ff3fa9b698deb64bb85f0d16cdbbd58d 100644 --- a/indra/newview/lltoolpipette.h +++ b/indra/newview/lltoolpipette.h @@ -45,10 +45,10 @@ class LLToolPipette virtual ~LLToolPipette(); public: - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleToolTip(S32 x, S32 y, MASK mask) override; // Note: Don't return connection; use boost::bind + boost::signals2::trackable to disconnect slots typedef boost::signals2::signal<void (const LLTextureEntry& te)> signal_t; diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp index 02d97c666fed1d3a60dbd4f8ae42cb776d546996..742d2f3361c459e098fa8ae616da5041809bbc97 100644 --- a/indra/newview/lltoolplacer.cpp +++ b/indra/newview/lltoolplacer.cpp @@ -111,7 +111,7 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, // representations (if any) are NOT the same as their viewer representation. if (pick.mPickType == LLPickInfo::PICK_FLORA) { - *hit_obj = NULL; + *hit_obj = nullptr; *hit_face = -1; } else @@ -184,10 +184,10 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) { LLVector3 ray_start_region; LLVector3 ray_end_region; - LLViewerRegion* regionp = NULL; + LLViewerRegion* regionp = nullptr; BOOL b_hit_land = FALSE; S32 hit_face = -1; - LLViewerObject* hit_obj = NULL; + LLViewerObject* hit_obj = nullptr; U8 state = 0; BOOL success = raycastForNewObjPos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, ®ionp ); if( !success ) @@ -201,7 +201,7 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) return FALSE; } - if (NULL == regionp) + if (nullptr == regionp) { LL_WARNS() << "regionp was NULL; aborting function." << LL_ENDL; return FALSE; @@ -427,7 +427,7 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) break; default: - LLVolumeMessage::packVolumeParams(0, gMessageSystem); + LLVolumeMessage::packVolumeParams(nullptr, gMessageSystem); volume_pcode = pcode; break; } @@ -486,10 +486,10 @@ BOOL LLToolPlacer::addDuplicate(S32 x, S32 y) { LLVector3 ray_start_region; LLVector3 ray_end_region; - LLViewerRegion* regionp = NULL; + LLViewerRegion* regionp = nullptr; BOOL b_hit_land = FALSE; S32 hit_face = -1; - LLViewerObject* hit_obj = NULL; + LLViewerObject* hit_obj = nullptr; BOOL success = raycastForNewObjPos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, ®ionp ); if( !success ) { diff --git a/indra/newview/lltoolplacer.h b/indra/newview/lltoolplacer.h index ad59cb0daaa0168abfa93bfac05904100116aa35..906b145bc0a09ae074ed579a8621a1ed7b874c40 100644 --- a/indra/newview/lltoolplacer.h +++ b/indra/newview/lltoolplacer.h @@ -43,9 +43,9 @@ public: LLToolPlacer(); virtual BOOL placeObject(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual void handleSelect(); // do stuff when your tool is selected - virtual void handleDeselect(); // clean up when your tool is deselected + BOOL handleHover(S32 x, S32 y, MASK mask) override; + void handleSelect() override; // do stuff when your tool is selected + void handleDeselect() override; // clean up when your tool is deselected static void setObjectType( LLPCode type ) { sObjectType = type; } static LLPCode getObjectType() { return sObjectType; } diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index 9281c4da482af324a17bae65f3e2c03f9cc064d0..c62bfdcc097e5be343b9b96bab0ff848b27fb14f 100644 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -197,7 +197,7 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi { LLQuaternion target_rot; target_rot.shortestArc(LLVector3::x_axis, selection_dir); - gAgent.startAutoPilotGlobal(gAgent.getPositionGlobal(), "", &target_rot, NULL, NULL, 1.f, SELECTION_ROTATION_TRESHOLD); + gAgent.startAutoPilotGlobal(gAgent.getPositionGlobal(), "", &target_rot, nullptr, nullptr, 1.f, SELECTION_ROTATION_TRESHOLD); } } diff --git a/indra/newview/lltoolselect.h b/indra/newview/lltoolselect.h index 74dababe8c899ca242a976ae590e3a56cf055bb9..a8821c7faeacfea529aba85c9b864289d44816f4 100644 --- a/indra/newview/lltoolselect.h +++ b/indra/newview/lltoolselect.h @@ -39,15 +39,15 @@ class LLToolSelect : public LLTool public: LLToolSelect( LLToolComposite* composite ); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; - virtual void stopEditing(); + void stopEditing() override; static LLSafeHandle<LLObjectSelection> handleObjectSelection(const LLPickInfo& pick, BOOL ignore_group, BOOL temp_select, BOOL select_root = FALSE); - virtual void onMouseCaptureLost(); - virtual void handleDeselect(); + void onMouseCaptureLost() override; + void handleDeselect() override; protected: BOOL mIgnoreGroup; diff --git a/indra/newview/lltoolselectland.cpp b/indra/newview/lltoolselectland.cpp index f0ee7880ab106172ac42460b3003e18cf21cf5e8..86ce206d6c346e852bf577e630e93280ef375dc0 100644 --- a/indra/newview/lltoolselectland.cpp +++ b/indra/newview/lltoolselectland.cpp @@ -215,7 +215,7 @@ void LLToolSelectLand::handleSelect() void LLToolSelectLand::handleDeselect() { - mSelection = NULL; + mSelection = nullptr; } diff --git a/indra/newview/lltoolselectland.h b/indra/newview/lltoolselectland.h index b5ba72f16d5d0073e3bcb6127cf12c136b1352c4..efaec6b91cc5bf2643507fd3a7d26a48adb91d1f 100644 --- a/indra/newview/lltoolselectland.h +++ b/indra/newview/lltoolselectland.h @@ -39,15 +39,15 @@ class LLToolSelectLand virtual ~LLToolSelectLand(); public: - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ void render(); // draw the select rectangle - /*virtual*/ BOOL isAlwaysRendered() { return TRUE; } + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ void render() override; // draw the select rectangle + /*virtual*/ BOOL isAlwaysRendered() override { return TRUE; } - /*virtual*/ void handleSelect(); - /*virtual*/ void handleDeselect(); + /*virtual*/ void handleSelect() override; + /*virtual*/ void handleDeselect() override; protected: BOOL outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y); diff --git a/indra/newview/lltoolselectrect.h b/indra/newview/lltoolselectrect.h index 5fdf622b49402fa58587598403ba204565b7f569..98d382c114038cdd5ca243427a735d1fa435f768 100644 --- a/indra/newview/lltoolselectrect.h +++ b/indra/newview/lltoolselectrect.h @@ -36,10 +36,10 @@ class LLToolSelectRect public: LLToolSelectRect( LLToolComposite* composite ); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual void draw(); // draw the select rectangle + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + void draw() override; // draw the select rectangle void handlePick(const LLPickInfo& pick); diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 8b559efe9a2df6010b67e3182d5be0bdac0d9a18..cbf9feb03901a18f5e58baff6c905a4e3d7919a3 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -822,7 +822,7 @@ void LLTracker::purgeBeaconText() if(!mBeaconText.isNull()) { mBeaconText->markDead(); - mBeaconText = NULL; + mBeaconText = nullptr; } } diff --git a/indra/newview/lltransientdockablefloater.cpp b/indra/newview/lltransientdockablefloater.cpp index c5d3073859396b5fcc725d4ecfd57156b45013ef..059ec249e022bd52c4ebe55dc45cf31743d462f0 100644 --- a/indra/newview/lltransientdockablefloater.cpp +++ b/indra/newview/lltransientdockablefloater.cpp @@ -47,7 +47,7 @@ LLTransientDockableFloater::~LLTransientDockableFloater() LLView* dock = getDockWidget(); LLTransientFloaterMgr::getInstance()->removeControlView( LLTransientFloaterMgr::DOCKED, this); - if (dock != NULL) + if (dock != nullptr) { LLTransientFloaterMgr::getInstance()->removeControlView( LLTransientFloaterMgr::DOCKED, dock); @@ -60,7 +60,7 @@ void LLTransientDockableFloater::setVisible(BOOL visible) if(visible && isDocked()) { LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::DOCKED, this); - if (dock != NULL) + if (dock != nullptr) { LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::DOCKED, dock); } @@ -68,7 +68,7 @@ void LLTransientDockableFloater::setVisible(BOOL visible) else { LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::DOCKED, this); - if (dock != NULL) + if (dock != nullptr) { LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::DOCKED, dock); } @@ -83,7 +83,7 @@ void LLTransientDockableFloater::setDocked(bool docked, bool pop_on_undock) if(docked) { LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::DOCKED, this); - if (dock != NULL) + if (dock != nullptr) { LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::DOCKED, dock); } @@ -91,7 +91,7 @@ void LLTransientDockableFloater::setDocked(bool docked, bool pop_on_undock) else { LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::DOCKED, this); - if (dock != NULL) + if (dock != nullptr) { LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::DOCKED, dock); } diff --git a/indra/newview/lltransientdockablefloater.h b/indra/newview/lltransientdockablefloater.h index 5fb79597f4b600886c2ebc9166ac6a3b05eb5a70..5f261bfaf12679f676f250cea39ade4dd7e73408 100644 --- a/indra/newview/lltransientdockablefloater.h +++ b/indra/newview/lltransientdockablefloater.h @@ -45,9 +45,9 @@ public: const LLSD& key, const Params& params = getDefaultParams()); virtual ~LLTransientDockableFloater(); - /*virtual*/ void setVisible(BOOL visible); - /* virtual */void setDocked(bool docked, bool pop_on_undock = true); - virtual LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::GLOBAL; } + /*virtual*/ void setVisible(BOOL visible) override; + /* virtual */void setDocked(bool docked, bool pop_on_undock = true) override; + LLTransientFloaterMgr::ETransientGroup getGroup() override { return LLTransientFloaterMgr::GLOBAL; } }; #endif /* LL_TRANSIENTDOCKABLEFLOATER_H */ diff --git a/indra/newview/lltransientfloatermgr.cpp b/indra/newview/lltransientfloatermgr.cpp index 8ac0d1afc68c84e6b95afa8306f5f03f031bfebb..3ef74c8032d96fb0b4d34d6804ba58879cde7a07 100644 --- a/indra/newview/lltransientfloatermgr.cpp +++ b/indra/newview/lltransientfloatermgr.cpp @@ -112,7 +112,7 @@ bool LLTransientFloaterMgr::isControlClicked(ETransientGroup group, controls_set for (controls_set_t::iterator it = set.begin(); it != set.end(); it++) { - LLView* control_view = NULL; + LLView* control_view = nullptr; LLHandle<LLView> handle = *it; if (handle.isDead()) @@ -150,7 +150,7 @@ void LLTransientFloaterMgr::leftMouseClickCallback(S32 x, S32 y, MASK mask) { // don't hide transient floater if any context menu opened - if (LLMenuGL::sMenuContainer->getVisibleMenu() != NULL) + if (LLMenuGL::sMenuContainer->getVisibleMenu() != nullptr) { return; } diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index ef75034e2f525b0d50ffffdc234815738710cd53..1bf84772673fc5bc891e110b2156db7cbe50ed39 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -236,18 +236,18 @@ public: /*virtual*/ std::string getTranslateURL( const std::string &from_lang, const std::string &to_lang, - const std::string &text) const; + const std::string &text) const override; /*virtual*/ std::string getKeyVerificationURL( - const std::string &key) const; + const std::string &key) const override; /*virtual*/ bool parseResponse( int& status, const std::string& body, std::string& translation, std::string& detected_lang, - std::string& err_msg) const; - /*virtual*/ bool isConfigured() const; + std::string& err_msg) const override; + /*virtual*/ bool isConfigured() const override; - /*virtual*/ void verifyKey(const std::string &key, LLTranslate::KeyVerificationResult_fn fnc); + /*virtual*/ void verifyKey(const std::string &key, LLTranslate::KeyVerificationResult_fn fnc) override; private: static void parseErrorResponse( @@ -398,18 +398,18 @@ public: /*virtual*/ std::string getTranslateURL( const std::string &from_lang, const std::string &to_lang, - const std::string &text) const; + const std::string &text) const override; /*virtual*/ std::string getKeyVerificationURL( - const std::string &key) const; + const std::string &key) const override; /*virtual*/ bool parseResponse( int& status, const std::string& body, std::string& translation, std::string& detected_lang, - std::string& err_msg) const; - /*virtual*/ bool isConfigured() const; + std::string& err_msg) const override; + /*virtual*/ bool isConfigured() const override; - /*virtual*/ void verifyKey(const std::string &key, LLTranslate::KeyVerificationResult_fn fnc); + /*virtual*/ void verifyKey(const std::string &key, LLTranslate::KeyVerificationResult_fn fnc) override; private: static std::string getAPIKey(); static std::string getAPILanguageCode(const std::string& lang); diff --git a/indra/newview/lluilistener.cpp b/indra/newview/lluilistener.cpp index a2e811330f6f96ce74472795ca1d6500c0fd1639..e4ea8acb517aa04e3400457189de1a2db472563c 100644 --- a/indra/newview/lluilistener.cpp +++ b/indra/newview/lluilistener.cpp @@ -78,7 +78,7 @@ void LLUIListener::call(const LLSD& event) const // two parameters but discards the first. Only the second is passed to // handleEvent(). Therefore we feel completely safe passing NULL for // the first parameter. - (*func)(NULL, event["parameter"]); + (*func)(nullptr, event["parameter"]); } } diff --git a/indra/newview/lluploaddialog.cpp b/indra/newview/lluploaddialog.cpp index 44e9b8b729bec2ed7993d488d1780cab855a446f..2c0005f296d37b3d6efd8450abca8fca8b0e55a4 100644 --- a/indra/newview/lluploaddialog.cpp +++ b/indra/newview/lluploaddialog.cpp @@ -40,7 +40,7 @@ #include "llrootview.h" // static -LLUploadDialog* LLUploadDialog::sDialog = NULL; +LLUploadDialog* LLUploadDialog::sDialog = nullptr; // static LLUploadDialog* LLUploadDialog::modalUploadDialog(const std::string& msg) @@ -54,7 +54,7 @@ void LLUploadDialog::modalUploadFinished() { // Note: object adds, removes, and destroys itself. delete LLUploadDialog::sDialog; - LLUploadDialog::sDialog = NULL; + LLUploadDialog::sDialog = nullptr; } //////////////////////////////////////////////////////////// @@ -114,7 +114,7 @@ void LLUploadDialog::setMessage( const std::string& msg) S32 cur_width = S32(font->getWidth(tokstr) + 0.99f) + TEXT_PAD; max_msg_width = llmax( max_msg_width, cur_width ); msg_lines.push_back( tokstr ); - token = strtok( NULL, "\n" ); + token = strtok(nullptr, "\n" ); } S32 line_height = font->getLineHeight(); @@ -156,7 +156,7 @@ LLUploadDialog::~LLUploadDialog() // LLFilePicker::instance().reset(); - LLUploadDialog::sDialog = NULL; + LLUploadDialog::sDialog = nullptr; } diff --git a/indra/newview/lluploaddialog.h b/indra/newview/lluploaddialog.h index 4d7d62032238c113fa69c2b1021394c4867c2fbf..4e9cf682618b849d384b53346ef59f7a1cd40478 100644 --- a/indra/newview/lluploaddialog.h +++ b/indra/newview/lluploaddialog.h @@ -38,7 +38,7 @@ public: static LLUploadDialog* modalUploadDialog(const std::string& msg); // Message to display static void modalUploadFinished(); // Message to display - static bool modalUploadIsFinished() { return (sDialog == NULL); } + static bool modalUploadIsFinished() { return (sDialog == nullptr); } void setMessage( const std::string& msg ); diff --git a/indra/newview/llurl.cpp b/indra/newview/llurl.cpp index 66dc1afd026dd374d76070a68d781c358e075aee..0763f1441139589a64cb3e7cabd5d3d97dbc28f6 100644 --- a/indra/newview/llurl.cpp +++ b/indra/newview/llurl.cpp @@ -264,7 +264,7 @@ const char* LLURL::updateRelativePath(const LLURL &url) strncat(new_path,parse, LL_MAX_PATH - strlen(new_path) -1 ); /* Flawfinder: ignore */ strcat(new_path,"/"); /* Flawfinder: ignore */ } - parse = strtok(NULL,"/"); + parse = strtok(nullptr,"/"); } strncpy(mPath,new_path, LL_MAX_PATH -1); /* Flawfinder: ignore */ mPath[LL_MAX_PATH -1] = '\0'; diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 62ed580c6b764cddd415cd0cfe0c93697b69e67b..448d00777cf3cad326275e3c7143e99c7e260e50 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -141,7 +141,7 @@ bool LLURLDispatcherImpl::dispatch(const LLSLURL& slurl, bool LLURLDispatcherImpl::dispatchRightClick(const LLSLURL& slurl) { const bool right_click = true; - LLMediaCtrl* web = NULL; + LLMediaCtrl* web = nullptr; const bool trusted_browser = false; return dispatchCore(slurl, "clicked", right_click, web, trusted_browser); } @@ -274,7 +274,7 @@ public: bool handle(const LLSD& tokens, const LLSD& query_map, - LLMediaCtrl* web) + LLMediaCtrl* web) override { // construct a "normal" SLURL, resolve the region to // a global position, and teleport to it @@ -360,7 +360,7 @@ bool LLURLDispatcher::dispatchFromTextEditor(const std::string& slurl, bool trus // click on it. // *TODO: Make this trust model more refined. JC - LLMediaCtrl* web = NULL; + LLMediaCtrl* web = nullptr; return LLURLDispatcherImpl::dispatch(LLSLURL(slurl), "clicked", web, trusted_content); } diff --git a/indra/newview/llurldispatcherlistener.cpp b/indra/newview/llurldispatcherlistener.cpp index 8a983f3ed06d3286db7a9cf417796becfcfe0ecd..72e4131afee2ceffa96ffeaefc8b612ed1c40428 100644 --- a/indra/newview/llurldispatcherlistener.cpp +++ b/indra/newview/llurldispatcherlistener.cpp @@ -63,7 +63,7 @@ void LLURLDispatcherListener::dispatch(const LLSD& params) const // But for testing, allow a caller to specify untrusted. trusted_browser = params["trusted"].asBoolean(); } - LLURLDispatcher::dispatch(params["url"], "clicked", NULL, trusted_browser); + LLURLDispatcher::dispatch(params["url"], "clicked", nullptr, trusted_browser); } void LLURLDispatcherListener::dispatchRightClick(const LLSD& params) const diff --git a/indra/newview/llurllineeditorctrl.h b/indra/newview/llurllineeditorctrl.h index baf2f8ec3813fb77d3adb3c60c172b60051afb0f..2c47d57874d93cbdda2759ee5e64c57d6cc7c3e9 100644 --- a/indra/newview/llurllineeditorctrl.h +++ b/indra/newview/llurllineeditorctrl.h @@ -35,8 +35,8 @@ class LLURLLineEditor: public LLLineEditor { public: // LLLineEditor overrides to do necessary escaping - /*virtual*/ void copy(); - /*virtual*/ void cut(); + /*virtual*/ void copy() override; + /*virtual*/ void cut() override; protected: LLURLLineEditor(const Params&); diff --git a/indra/newview/llurlwhitelist.cpp b/indra/newview/llurlwhitelist.cpp index a996eacc1c3df91adc5ff3b90f2f2060847b7355..03a4528ca9df82a603f134eddf37bbbb66aa278b 100644 --- a/indra/newview/llurlwhitelist.cpp +++ b/indra/newview/llurlwhitelist.cpp @@ -33,7 +33,7 @@ #include <iostream> #include <fstream> -LLUrlWhiteList* LLUrlWhiteList::sInstance = 0; +LLUrlWhiteList* LLUrlWhiteList::sInstance = nullptr; /////////////////////////////////////////////////////////////////////////////// // @@ -66,7 +66,7 @@ void LLUrlWhiteList::initClass () void LLUrlWhiteList::cleanupClass () { delete sInstance; - sInstance = NULL; + sInstance = nullptr; } LLUrlWhiteList* LLUrlWhiteList::getInstance () diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index a2783c8a9c46bcfcde658825de68e6f8f77255ea..2d218e574836de4795d0db92ba54666da0698eb8 100644 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -267,14 +267,14 @@ namespace LLViewerAssetStatsFF // ------------------------------------------------------ // Global data definitions // ------------------------------------------------------ -LLViewerAssetStats * gViewerAssetStats(0); +LLViewerAssetStats * gViewerAssetStats(nullptr); // ------------------------------------------------------ // LLViewerAssetStats class definition // ------------------------------------------------------ LLViewerAssetStats::LLViewerAssetStats() : mRegionHandle(U64(0)), - mCurRecording(NULL) + mCurRecording(nullptr) { start(); } @@ -549,7 +549,7 @@ void cleanup() { delete gViewerAssetStats; - gViewerAssetStats = 0; + gViewerAssetStats = nullptr; } diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h index 7b1163d9f00c80a4aceb864a27afacc12ecd4166..f6e225977f3cb7e41eefd81b8323bd4f28b91de8 100644 --- a/indra/newview/llviewerassetstats.h +++ b/indra/newview/llviewerassetstats.h @@ -165,9 +165,9 @@ public: LLSD asLLSD(bool compact_output); protected: - void handleStart(); - void handleStop(); - void handleReset(); + void handleStart() override; + void handleStop() override; + void handleReset() override; typedef std::map<region_handle_t, LLTrace::Recording > PerRegionRecordingContainer; diff --git a/indra/newview/llviewerassetstorage.h b/indra/newview/llviewerassetstorage.h index 6baec647e60e0886cb6a0e9e5f3cb1ac33338eee..d2239249c5c903eb076999ddd8ca6504c2c530f6 100644 --- a/indra/newview/llviewerassetstorage.h +++ b/indra/newview/llviewerassetstorage.h @@ -42,7 +42,7 @@ public: LLVFS *vfs, LLVFS *static_vfs); using LLAssetStorage::storeAssetData; - virtual void storeAssetData( + void storeAssetData( const LLTransactionID& tid, LLAssetType::EType atype, LLStoreAssetCallback callback, @@ -51,9 +51,9 @@ public: bool is_priority = false, bool store_local = false, bool user_waiting=FALSE, - F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT); - - virtual void storeAssetData( + F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT) override; + + void storeAssetData( const std::string& filename, const LLTransactionID& tid, LLAssetType::EType type, @@ -62,7 +62,7 @@ public: bool temp_file = false, bool is_priority = false, bool user_waiting=FALSE, - F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT) override; protected: using LLAssetStorage::_queueDataRequest; @@ -73,7 +73,7 @@ protected: void (*callback) (LLVFS *vfs, const LLUUID&, LLAssetType::EType, void *, S32, LLExtStat), void *user_data, BOOL duplicate, - BOOL is_priority); + BOOL is_priority) override; }; #endif diff --git a/indra/newview/llviewerassetupload.h b/indra/newview/llviewerassetupload.h index 43e23a0d42ff36315dafd90e986ac0b2b9ee4832..976562f9e5629bd7bdb3a2f801aadd8b17f3f484 100644 --- a/indra/newview/llviewerassetupload.h +++ b/indra/newview/llviewerassetupload.h @@ -148,7 +148,7 @@ public: U32 everyonePerms, S32 expectedCost); - virtual LLSD prepareUpload(); + LLSD prepareUpload() override; std::string getFileName() const { return mFileName; }; @@ -172,15 +172,15 @@ public: LLBufferedAssetUploadInfo(LLUUID itemId, LLPointer<LLImageFormatted> image, invnUploadFinish_f finish); LLBufferedAssetUploadInfo(LLUUID taskId, LLUUID itemId, LLAssetType::EType assetType, std::string buffer, taskUploadFinish_f finish); - virtual LLSD prepareUpload(); - virtual LLSD generatePostBody(); - virtual LLUUID finishUpload(LLSD &result); + LLSD prepareUpload() override; + LLSD generatePostBody() override; + LLUUID finishUpload(LLSD &result) override; LLUUID getTaskId() const { return mTaskId; } const std::string & getContents() const { return mContents; } - virtual bool showUploadDialog() const { return false; } - virtual bool showInventoryPanel() const { return false; } + bool showUploadDialog() const override { return false; } + bool showInventoryPanel() const override { return false; } protected: @@ -208,7 +208,7 @@ public: LLScriptAssetUpload(LLUUID taskId, LLUUID itemId, TargetType_t targetType, bool isRunning, LLUUID exerienceId, std::string buffer, taskUploadFinish_f finish); - virtual LLSD generatePostBody(); + LLSD generatePostBody() override; LLUUID getExerienceId() const { return mExerienceId; } TargetType_t getTargetType() const { return mTargetType; } diff --git a/indra/newview/llviewerattachmenu.cpp b/indra/newview/llviewerattachmenu.cpp index fb4f9c755d8fe9ae2137ea2f697efa128d508282..43d90a4a81939f2ce5d07b0bf44ec28d89a9b155 100644 --- a/indra/newview/llviewerattachmenu.cpp +++ b/indra/newview/llviewerattachmenu.cpp @@ -95,7 +95,7 @@ void LLViewerAttachMenu::populateMenus(const std::string& attach_to_menu_name, c // static void LLViewerAttachMenu::attachObjects(const uuid_vec_t& items, const std::string& joint_name) { - LLViewerJointAttachment* attachmentp = NULL; + LLViewerJointAttachment* attachmentp = nullptr; for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin(); iter != gAgentAvatarp->mAttachmentPoints.end(); ) { @@ -107,7 +107,7 @@ void LLViewerAttachMenu::attachObjects(const uuid_vec_t& items, const std::strin break; } } - if (attachmentp == NULL) + if (attachmentp == nullptr) { return; } diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 92570716602e9f1cabaafca47b042c8cdf8aa734..491e8012033a92e349f2344ff47781a063a312f5 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -53,8 +53,8 @@ LLViewerAudio::LLViewerAudio() : mDone(true), - mFadeState(FADE_IDLE), mFadeTime(), + mFadeState(FADE_IDLE), mIdleListnerActive(false), mForcedTeleportFade(false), mWasPlaying(false) diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index 1cd7f4ba1345d3b0d6d75d5ace3b9fe25c6aeb00..50398ffeb15d411d3b282c1a5272113866b3431a 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -103,7 +103,7 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, mLastPointOfInterest = point_of_interest; LLViewerRegion * regp = gAgent.getRegion(); - F32 water_height = (NULL != regp) ? regp->getWaterHeight() : 0.f; + F32 water_height = (nullptr != regp) ? regp->getWaterHeight() : 0.f; LLVector3 origin = center; if (origin.mV[2] > water_height) diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index a18f481b4a11dc68f69e467b67bb279efb025fb3..4de3edbe1caa146dcd40addbb56ed7035c7fe982 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -109,7 +109,7 @@ public: LLVector3 roundToPixel(const LLVector3 &pos_agent); // Sets the current matrix - /* virtual */ void setView(F32 vertical_fov_rads); + /* virtual */ void setView(F32 vertical_fov_rads) override; void setDefaultFOV(F32 fov) ; F32 getDefaultFOV() { return mCameraFOVDefault; } diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp index c3bd5aac08cb1fd249362f3bfcc3dd4fe05b4acc..72a1b8944e9cf2182e204039eec07452f9e216d8 100644 --- a/indra/newview/llviewerchat.cpp +++ b/indra/newview/llviewerchat.cpp @@ -189,7 +189,7 @@ void LLViewerChat::getChatColor(const LLChat& chat, std::string& r_color_name, F LLFontGL* LLViewerChat::getChatFont() { S32 font_size = gSavedSettings.getS32("ChatFontSize"); - LLFontGL* fontp = NULL; + LLFontGL* fontp = nullptr; switch(font_size) { case 0: diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 57eedb955c797359e21006d3db8a012c2d3bd17e..bf0f464625dc04f0c5cdd9efccddc045453ca564 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -619,7 +619,7 @@ bool handleWindlightCloudChanged(const LLSD& new_value) } else { - LLDrawPoolWLSky::sCloudNoiseRawImage = NULL; + LLDrawPoolWLSky::sCloudNoiseRawImage = nullptr; } } return true; diff --git a/indra/newview/llviewercontrollistener.cpp b/indra/newview/llviewercontrollistener.cpp index 55935cee9e124403202339bda8fae327cee1f6dd..744b371e5824e42693dcda745ee1fea5385fc2cc 100644 --- a/indra/newview/llviewercontrollistener.cpp +++ b/indra/newview/llviewercontrollistener.cpp @@ -97,7 +97,7 @@ struct Info groupname(request["group"]), group(LLControlGroup::getInstance(groupname)), key(request["key"]), - control(NULL) + control(nullptr) { if (! group) { @@ -197,7 +197,7 @@ struct CollectVars: public LLControlGroup::ApplyFunctor mGroup(g) {} - virtual void apply(const std::string& name, LLControlVariable* control) + void apply(const std::string& name, LLControlVariable* control) override { vars.append(LLSDMap ("name", name) diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 669890f436d3c676b2302408cbc44fcb838688c9..2a93aa9092a4d04e88ed5924a4f916fb0947649a 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -129,7 +129,7 @@ public: /*virtual*/ void post( LLHTTPNode::ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { LLSD body = input["body"]; @@ -167,7 +167,7 @@ class LLDisplayNameUpdate : public LLHTTPNode /*virtual*/ void post( LLHTTPNode::ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { LLSD body = input["body"]; LLUUID agent_id = body["agent_id"]; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 4fb81756dda64293e3a185d09f57e45e71736506..8059bbe66f69566510785d3cbeec1747406d6678 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -178,7 +178,7 @@ public: LLFloaterOpenHandler() : LLCommandHandler("openfloater", UNTRUSTED_THROTTLE) { } bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + LLMediaCtrl* web) override { if (params.size() != 1) { diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index a0cd78742df1722b194efcce2e32007fc6456e93..064669b41bdb5bcaebb42b962981ca1f08393b4d 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -48,9 +48,9 @@ struct ViewerFolderEntry : public LLDictionaryEntry ) : LLDictionaryEntry(dictionary_name), - mNewCategoryName(new_category_name), mIconNameOpen(icon_name_open), mIconNameClosed(icon_name_closed), + mNewCategoryName(new_category_name), mIsQuiet(is_quiet), mHideIfEmpty(hide_if_empty) { diff --git a/indra/newview/llviewergenericmessage.cpp b/indra/newview/llviewergenericmessage.cpp index 53f6022a15f893d355783f5a612697564b4c7824..8b340b75c197d5a397e843a2982355826cb8e114 100644 --- a/indra/newview/llviewergenericmessage.cpp +++ b/indra/newview/llviewergenericmessage.cpp @@ -58,7 +58,7 @@ void send_generic_message(const std::string& method, if(strings.empty()) { msg->nextBlock("ParamList"); - msg->addString("Parameter", NULL); + msg->addString("Parameter", nullptr); } else { diff --git a/indra/newview/llviewergesture.h b/indra/newview/llviewergesture.h index d4fb22409cb6a83ddf74fd2fae4a7dae0dcb91cd..bdccef273875949077121a931316b35ead8297d8 100644 --- a/indra/newview/llviewergesture.h +++ b/indra/newview/llviewergesture.h @@ -45,10 +45,10 @@ public: LLViewerGesture(const LLViewerGesture &gesture); // Triggers if a key/mask matches it - virtual BOOL trigger(KEY key, MASK mask); + BOOL trigger(KEY key, MASK mask) override; // Triggers if case-insensitive substring matches (assumes string is lowercase) - virtual BOOL trigger(const std::string &string); + BOOL trigger(const std::string &string) override; void doTrigger( BOOL send_chat ); @@ -74,7 +74,7 @@ public: static void xferCallback(void *data, S32 size, void** /*user_data*/, S32 status); protected: - LLGesture *create_gesture(U8 **buffer, S32 max_size); + LLGesture *create_gesture(U8 **buffer, S32 max_size) override; protected: BOOL mIsLoaded; diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 798f7500afe3a2c953a19d7590695793d1733cfd..31fbd0fa3904c16d1c68101dbbc48ef14ad8649d 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -47,7 +47,7 @@ public: // requests will be throttled from a non-trusted browser LLHelpHandler() : LLCommandHandler("help", UNTRUSTED_THROTTLE) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { LLViewerHelp* vhelp = LLViewerHelp::getInstance(); if (! vhelp) diff --git a/indra/newview/llviewerhelp.h b/indra/newview/llviewerhelp.h index e82ebe21c3f8970f7defe94c0ed3e2d0b79cab55..ffacfea89cf9a4f881b7e6319375d81d83a90375 100644 --- a/indra/newview/llviewerhelp.h +++ b/indra/newview/llviewerhelp.h @@ -42,21 +42,21 @@ class LLViewerHelp : public LLHelp, public LLSingleton<LLViewerHelp> public: /// display the specified help topic in the help viewer - /*virtual*/ void showTopic(const std::string &topic); + /*virtual*/ void showTopic(const std::string &topic) override; - std::string getURL(const std::string& topic); + std::string getURL(const std::string& topic) override; // return topic derived from viewer UI focus, else default topic std::string getTopicFromFocus(); /// return default (fallback) topic name suitable for showTopic() - /*virtual*/ std::string defaultTopic(); + /*virtual*/ std::string defaultTopic() override; // return topic to use before the user logs in - /*virtual*/ std::string preLoginTopic(); + /*virtual*/ std::string preLoginTopic() override; // return topic to use for the top-level help, invoked by F1 - /*virtual*/ std::string f1HelpTopic(); + /*virtual*/ std::string f1HelpTopic() override; }; #endif // header guard diff --git a/indra/newview/llviewerjoint.h b/indra/newview/llviewerjoint.h index abe11bbf5c47a14dccfcea7c5ff0283539417b5b..edbd8cef2e61a63ba63983150e7354e6b27dac88 100644 --- a/indra/newview/llviewerjoint.h +++ b/indra/newview/llviewerjoint.h @@ -47,14 +47,14 @@ public: LLViewerJoint(S32 joint_num); // *TODO: Only used for LLVOAvatarSelf::mScreenp. *DOES NOT INITIALIZE mResetAfterRestoreOldXform* - LLViewerJoint(const std::string &name, LLJoint *parent = NULL); + LLViewerJoint(const std::string &name, LLJoint *parent = nullptr); virtual ~LLViewerJoint(); // Render character hierarchy. // Traverses the entire joint hierarchy, setting up // transforms and calling the drawShape(). // Derived classes may add text/graphic output. - virtual U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ); // Returns triangle count + U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ) override; // Returns triangle count // Draws the shape attached to a joint. // Called by render(). diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp index 6158e67c28e9f9505282db0d8c6d7a4621a86b05..b66efe8492411b9cc7b8b0ee1923735ea5de588e 100644 --- a/indra/newview/llviewerjointattachment.cpp +++ b/indra/newview/llviewerjointattachment.cpp @@ -449,7 +449,7 @@ const LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &o return attached_object; } } - return NULL; + return nullptr; } LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &object_id) @@ -464,5 +464,5 @@ LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &object_ return attached_object; } } - return NULL; + return nullptr; } diff --git a/indra/newview/llviewerjointattachment.h b/indra/newview/llviewerjointattachment.h index 0ecd1c92b7ba96f4ffa2e3c9a374febfdb87d40d..7078df7eee9348b76449056df16db59ccb02ea9c 100644 --- a/indra/newview/llviewerjointattachment.h +++ b/indra/newview/llviewerjointattachment.h @@ -52,13 +52,13 @@ public: // Returns true if this object is transparent. // This is used to determine in which order to draw objects. - /*virtual*/ BOOL isTransparent(); + /*virtual*/ BOOL isTransparent() override; // Draws the shape attached to a joint. // Called by render(). - /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy ); + /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) override; - /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate); + /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate) override; // // accessors @@ -73,7 +73,7 @@ public: void setIsHUDAttachment(BOOL is_hud) { mIsHUDAttachment = is_hud; } BOOL getIsHUDAttachment() const { return mIsHUDAttachment; } - BOOL isAnimatable() const { return FALSE; } + BOOL isAnimatable() const override { return FALSE; } S32 getGroup() const { return mGroup; } S32 getPieSlice() const { return mPieSlice; } diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 42ab951b8a40b2a5049c2ee1eaf90c508b67efab..c850acfa3d115adb8d904a116bdafe3c6c151430 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -219,7 +219,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) if (!mValid || !mMesh || !mFace || !mVisible || !mFace->getVertexBuffer() || mMesh->getNumFaces() == 0 || - (LLGLSLShader::sNoFixedFunction && LLGLSLShader::sCurBoundShaderPtr == NULL)) + (LLGLSLShader::sNoFixedFunction && LLGLSLShader::sCurBoundShaderPtr == nullptr)) { return 0; } diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h index 0db2836e150b749e8e2c03e1a0fa34340deb1e48..37276a0de0138d9a7593c4d76f32dc5194b0c21d 100644 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -54,19 +54,19 @@ public: void uploadJointMatrices(); // overloaded from base class - /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy ); + /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) override; // necessary because MS's compiler warns on function inheritance via dominance in the diamond inheritance here. // warns even though LLViewerJoint holds the only non virtual implementation. - /*virtual*/ U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ) { return LLViewerJoint::render(pixelArea,first_pass,is_dummy);} + /*virtual*/ U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ) override { return LLViewerJoint::render(pixelArea,first_pass,is_dummy);} - /*virtual*/ void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); - /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false); - /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate); - /*virtual*/ void updateJointGeometry(); - /*virtual*/ void dump(); + /*virtual*/ void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area) override; + /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false) override; + /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate) override; + /*virtual*/ void updateJointGeometry() override; + /*virtual*/ void dump() override; - /*virtual*/ BOOL isAnimatable() const { return FALSE; } + /*virtual*/ BOOL isAnimatable() const override { return FALSE; } private: diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index 6d0327ea6941bb907a655547bf74865c564b83cd..ad9c10e02104077d3d70533601a465895c9278d8 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -139,7 +139,7 @@ void LLViewerJoystick::HotPlugRemovalCallback(NDOF_Device *dev) // ----------------------------------------------------------------------------- LLViewerJoystick::LLViewerJoystick() : mDriverState(JDS_UNINITIALIZED), - mNdofDev(NULL), + mNdofDev(nullptr), mResetFlag(false), mCameraUpdated(true), mOverrideCamera(false), @@ -176,8 +176,8 @@ void LLViewerJoystick::init(bool autoenable) { // Note: The HotPlug callbacks are not actually getting called on Windows if (ndof_libinit(HotPlugAddCallback, - HotPlugRemovalCallback, - NULL)) + HotPlugRemovalCallback, + nullptr)) { mDriverState = JDS_UNINITIALIZED; } @@ -214,7 +214,7 @@ void LLViewerJoystick::init(bool autoenable) mNdofDev->absolute = 1; // init & use the first suitable NDOF device found on the USB chain - if (ndof_init_first(mNdofDev, NULL)) + if (ndof_init_first(mNdofDev, nullptr)) { mDriverState = JDS_UNINITIALIZED; LL_WARNS() << "ndof_init_first FAILED" << LL_ENDL; diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index c3dc2f92b299bd42a2d564021c4b4cc11f908fcd..ecc619cd09a38388092f3cd2e402ea099d5d8226 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -598,11 +598,11 @@ void start_chat( EKeystate s ) if (sChatInWindow || (LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"))->isChatVisible()) { - LLFloaterIMNearbyChat::startChat(NULL); + LLFloaterIMNearbyChat::startChat(nullptr); } else { - LLChatBar::startChat(NULL); + LLChatBar::startChat(nullptr); } } @@ -624,7 +624,7 @@ void start_gesture( EKeystate s ) else { // Don't overwrite existing text in chat editor - LLFloaterIMNearbyChat::startChat(NULL); + LLFloaterIMNearbyChat::startChat(nullptr); } } else @@ -635,7 +635,7 @@ void start_gesture( EKeystate s ) } else { - LLChatBar::startChat(NULL); + LLChatBar::startChat(nullptr); } } } diff --git a/indra/newview/llviewerlayer.cpp b/indra/newview/llviewerlayer.cpp index 30dd673a57a797c840915173d38535170d05f04d..f76aa627fbbd09fa48a09fe5c61feab6b9120f17 100644 --- a/indra/newview/llviewerlayer.cpp +++ b/indra/newview/llviewerlayer.cpp @@ -48,7 +48,7 @@ LLViewerLayer::LLViewerLayer(const S32 width, const F32 scale) LLViewerLayer::~LLViewerLayer() { delete[] mDatap; - mDatap = NULL; + mDatap = nullptr; } F32 LLViewerLayer::getValue(const S32 x, const S32 y) const diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 20bb98fc4d2336faf55670f29ba8a0b0439c21b7..878cdfb55a6b3aae9345c4d65ce91138c96c5cb6 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -148,10 +148,10 @@ LLViewerMediaObserver::~LLViewerMediaObserver() } -LLPluginCookieStore *LLViewerMedia::sCookieStore = NULL; +LLPluginCookieStore *LLViewerMedia::sCookieStore = nullptr; LLURL LLViewerMedia::sOpenIDURL; std::string LLViewerMedia::sOpenIDCookie; -LLPluginClassMedia* LLViewerMedia::sSpareBrowserMediaSource = NULL; +LLPluginClassMedia* LLViewerMedia::sSpareBrowserMediaSource = nullptr; static LLViewerMedia::impl_list sViewerMediaImplList; static LLViewerMedia::impl_id_map sViewerMediaTextureIDMap; static LLTimer sMediaCreateTimer; @@ -190,7 +190,7 @@ static void remove_media_impl(LLViewerMediaImpl* media) class LLViewerMediaMuteListObserver : public LLMuteListObserver { - /* virtual */ void onChange() { LLViewerMedia::muteListChanged();} + /* virtual */ void onChange() override { LLViewerMedia::muteListChanged();} }; static LLViewerMediaMuteListObserver sViewerMediaMuteListObserver; @@ -210,7 +210,7 @@ viewer_media_t LLViewerMedia::newMediaImpl( U8 media_loop) { LLViewerMediaImpl* media_impl = getMediaImplFromTextureID(texture_id); - if(media_impl == NULL || texture_id.isNull()) + if(media_impl == nullptr || texture_id.isNull()) { // Create the media impl media_impl = new LLViewerMediaImpl(texture_id, media_width, media_height, media_auto_scale, media_loop); @@ -331,7 +331,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s // static LLViewerMediaImpl* LLViewerMedia::getMediaImplFromTextureID(const LLUUID& texture_id) { - LLViewerMediaImpl* result = NULL; + LLViewerMediaImpl* result = nullptr; // Look up the texture ID in the texture id->impl map. impl_id_map::iterator iter = sViewerMediaTextureIDMap.find(texture_id); @@ -465,7 +465,7 @@ bool LLViewerMedia::isInterestingEnough(const LLVOVolume *object, const F64 &obj { bool result = false; - if (NULL == object) + if (nullptr == object) { result = false; } @@ -656,7 +656,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) // Setting max_cpu to 0.0 disables CPU usage checking. bool check_cpu_usage = (max_cpu != 0.0f); - LLViewerMediaImpl* lowest_interest_loadable = NULL; + LLViewerMediaImpl* lowest_interest_loadable = nullptr; // Notes on tweakable params: // max_instances must be set high enough to allow the various instances used in the UI (for the help browser, search, etc.) to be loaded. @@ -1156,7 +1156,7 @@ void LLViewerMedia::setProxyConfig(bool enable, const std::string &host, int por // static LLPluginCookieStore *LLViewerMedia::getCookieStore() { - if(sCookieStore == NULL) + if(sCookieStore == nullptr) { sCookieStore = new LLPluginCookieStore; } @@ -1572,7 +1572,7 @@ void LLViewerMedia::createSpareBrowserMediaSource() // The null owner will keep the browser plugin from fully initializing // (specifically, it keeps LLPluginClassMedia from negotiating a size change, // which keeps MediaPluginWebkit::initBrowserWindow from doing anything until we have some necessary data, like the background color) - sSpareBrowserMediaSource = LLViewerMediaImpl::newSourceFromMediaType(HTTP_CONTENT_TEXT_HTML, NULL, 0, 0, 1.0); + sSpareBrowserMediaSource = LLViewerMediaImpl::newSourceFromMediaType(HTTP_CONTENT_TEXT_HTML, nullptr, 0, 0, 1.0); } } @@ -1581,7 +1581,7 @@ void LLViewerMedia::createSpareBrowserMediaSource() LLPluginClassMedia* LLViewerMedia::getSpareBrowserMediaSource() { LLPluginClassMedia* result = sSpareBrowserMediaSource; - sSpareBrowserMediaSource = NULL; + sSpareBrowserMediaSource = nullptr; return result; }; @@ -1627,7 +1627,7 @@ std::string LLViewerMedia::getParcelAudioURL() // static void LLViewerMedia::initClass() { - gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL); + gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, nullptr); sTeleportFinishConnection = LLViewerParcelMgr::getInstance()-> setTeleportFinishedCallback(boost::bind(&LLViewerMedia::onTeleportFinished)); } @@ -1636,18 +1636,18 @@ void LLViewerMedia::initClass() // static void LLViewerMedia::cleanupClass() { - gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); + gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, nullptr); sTeleportFinishConnection.disconnect(); - if (sSpareBrowserMediaSource != NULL) + if (sSpareBrowserMediaSource != nullptr) { delete sSpareBrowserMediaSource; - sSpareBrowserMediaSource = NULL; + sSpareBrowserMediaSource = nullptr; } - if (sCookieStore != NULL) + if (sCookieStore != nullptr) { delete sCookieStore; - sCookieStore = NULL; + sCookieStore = nullptr; } } @@ -1680,7 +1680,8 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, U8 media_auto_scale, U8 media_loop) : - mMediaSource( NULL ), + mMediaSource(nullptr ), + mZoomFactor(1.0), mMovieImageHasMips(false), mMediaWidth(media_width), mMediaHeight(media_height), @@ -1715,10 +1716,9 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, mBackgroundColor(LLColor4::white), mNavigateSuspended(false), mNavigateSuspendedDeferred(false), - mIsUpdated(false), mTrustedBrowser(false), - mZoomFactor(1.0), - mCleanBrowser(false), + mCleanBrowser(false), + mIsUpdated(false), mMimeProbe(), mCanceling(false) { @@ -1788,7 +1788,7 @@ bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type) mMimeType = mime_type; } - return (mMediaSource != NULL); + return (mMediaSource != nullptr); } ////////////////////////////////////////////////////////////////////////////////////////// @@ -1832,7 +1832,7 @@ void LLViewerMediaImpl::destroyMediaSource() { mMediaSource->setDeleteOK(true) ; delete mMediaSource; - mMediaSource = NULL; + mMediaSource = nullptr; } } @@ -1847,7 +1847,7 @@ void LLViewerMediaImpl::setMediaType(const std::string& media_type) LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be NULL */, S32 default_width, S32 default_height, F64 zoom_factor, const std::string target, bool clean_browser) { std::string plugin_basename = LLMIMETypes::implType(media_type); - LLPluginClassMedia* media_source = NULL; + LLPluginClassMedia* media_source = nullptr; // HACK: we always try to keep a spare running webkit plugin around to improve launch times. // If a spare was already created before PluginAttachDebuggerToPlugins was set, don't use it. @@ -1962,7 +1962,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ sMimeTypesFailed.push_back(media_type); } } - return NULL; + return nullptr; } ////////////////////////////////////////////////////////////////////////////////////////// @@ -2135,7 +2135,7 @@ void LLViewerMediaImpl::hideNotification() void LLViewerMediaImpl::play() { // If the media source isn't there, try to initialize it and load an URL. - if(mMediaSource == NULL) + if(mMediaSource == nullptr) { if(!initializeMedia(mMimeType)) { @@ -2948,7 +2948,7 @@ static LLTrace::BlockTimerStatHandle FTM_MEDIA_SET_SUBIMAGE("Set Subimage"); void LLViewerMediaImpl::update() { LL_RECORD_BLOCK_TIME(FTM_MEDIA_DO_UPDATE); - if(mMediaSource == NULL) + if(mMediaSource == nullptr) { if(mPriority == LLPluginClassMedia::PRIORITY_UNLOADED) { @@ -2993,7 +2993,7 @@ void LLViewerMediaImpl::update() } - if(mMediaSource == NULL) + if(mMediaSource == nullptr) { return; } @@ -3005,7 +3005,7 @@ void LLViewerMediaImpl::update() setNavigateSuspended(false); - if(mMediaSource == NULL) + if(mMediaSource == nullptr) { return; } @@ -3047,7 +3047,7 @@ void LLViewerMediaImpl::update() if(width > 0 && height > 0) { - U8* data = NULL; + U8* data = nullptr; { LL_RECORD_BLOCK_TIME(FTM_MEDIA_GET_DATA); data = mMediaSource->getBitsData(); @@ -3090,7 +3090,7 @@ LLViewerMediaTexture* LLViewerMediaImpl::updatePlaceholderImage() if(mTextureId.isNull()) { // The code that created this instance will read from the plugin's bits. - return NULL; + return nullptr; } LLViewerMediaTexture* placeholder_image = LLViewerTextureManager::getMediaTexture( mTextureId ); @@ -3238,7 +3238,7 @@ bool LLViewerMediaImpl::isMediaPaused() // bool LLViewerMediaImpl::hasMedia() const { - return mMediaSource != NULL; + return mMediaSource != nullptr; } ////////////////////////////////////////////////////////////////////////////////////////// @@ -3330,7 +3330,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla LL_DEBUGS("Media") << "MEDIA_EVENT_CLICK_LINK_NOFOLLOW, uri is: " << plugin->getClickURL() << LL_ENDL; std::string url = plugin->getClickURL(); std::string nav_type = plugin->getClickNavType(); - LLURLDispatcher::dispatch(url, nav_type, NULL, mTrustedBrowser); + LLURLDispatcher::dispatch(url, nav_type, nullptr, mTrustedBrowser); } break; case MEDIA_EVENT_CLICK_LINK_HREF: @@ -3644,7 +3644,7 @@ void LLViewerMediaImpl::calculateInterest() LL_RECORD_BLOCK_TIME(FTM_MEDIA_CALCULATE_INTEREST); LLViewerMediaTexture* texture = LLViewerTextureManager::findMediaTexture( mTextureId ); - if(texture != NULL) + if(texture != nullptr) { mInterest = texture->getMaxVirtualSize(); } @@ -3891,7 +3891,7 @@ const std::list< LLVOVolume* >* LLViewerMediaImpl::getObjectList() const LLVOVolume *LLViewerMediaImpl::getSomeObject() { - LLVOVolume *result = NULL; + LLVOVolume *result = nullptr; std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ; if(iter != mObjectList.end()) @@ -3997,13 +3997,13 @@ bool LLViewerMediaImpl::isObjectAttachedToAnotherAvatar(LLVOVolume *obj) bool result = false; LLXform *xform = obj; // Walk up parent chain - while (NULL != xform) + while (nullptr != xform) { LLViewerObject *object = dynamic_cast<LLViewerObject*> (xform); - if (NULL != object) + if (nullptr != object) { LLVOAvatar *avatar = object->asAvatar(); - if ((NULL != avatar) && (avatar != gAgentAvatarp)) + if ((nullptr != avatar) && (avatar != gAgentAvatarp)) { result = true; break; diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 0212bf88bf7514bffd332428b7dbc77885a474d7..c193f479f26ba5447a400da5c6594d5da5c1fbd1 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -112,7 +112,7 @@ public: // Set all media paused(stopped for non time based) or playing, depending on val. Does not include media in the UI. static void setAllMediaPaused(bool val); - static void updateMedia(void* dummy_arg = NULL); + static void updateMedia(void* dummy_arg = nullptr); static void initClass(); static void cleanupClass(); @@ -203,7 +203,7 @@ public: ~LLViewerMediaImpl(); // Override inherited version from LLViewerMediaEventEmitter - virtual void emitEvent(LLPluginClassMedia* self, LLViewerMediaObserver::EMediaEvent event); + void emitEvent(LLPluginClassMedia* self, LLViewerMediaObserver::EMediaEvent event) override; void createMediaSource(); void destroyMediaSource(); @@ -315,39 +315,39 @@ public: static bool handleSkinCurrentChanged(const LLSD& newvalue); // need these to handle mouseup... - /*virtual*/ void onMouseCaptureLost(); - /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); + /*virtual*/ void onMouseCaptureLost() override; + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; // Grr... the only thing I want as an LLMouseHandler are the onMouseCaptureLost and handleMouseUp calls. // Sadly, these are all pure virtual, so I have to supply implementations here: - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; }; - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) { return FALSE; }; - /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) { return FALSE; }; - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) { return FALSE; }; - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) { return FALSE; }; - /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) { return FALSE; }; - /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) { return FALSE; }; - /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; }; - /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) {return FALSE; }; - /*virtual*/ const std::string& getName() const; - - /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const {}; - /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const {}; - /*virtual*/ BOOL hasMouseCapture() { return gFocusMgr.getMouseCapture() == this; }; + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override { return FALSE; }; + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override { return FALSE; }; + /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override { return FALSE; }; + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override { return FALSE; }; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override { return FALSE; }; + /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override { return FALSE; }; + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) override { return FALSE; }; + /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) override { return FALSE; }; + /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) override {return FALSE; }; + /*virtual*/ const std::string& getName() const override; + + /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const override {}; + /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const override {}; + /*virtual*/ BOOL hasMouseCapture() override { return gFocusMgr.getMouseCapture() == this; }; // Inherited from LLPluginClassMediaOwner - /*virtual*/ void handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent); - /*virtual*/ void handleCookieSet(LLPluginClassMedia* self, const std::string &cookie); + /*virtual*/ void handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent) override; + /*virtual*/ void handleCookieSet(LLPluginClassMedia* self, const std::string &cookie) override; // LLEditMenuHandler overrides - /*virtual*/ void cut(); - /*virtual*/ BOOL canCut() const; + /*virtual*/ void cut() override; + /*virtual*/ BOOL canCut() const override; - /*virtual*/ void copy(); - /*virtual*/ BOOL canCopy() const; + /*virtual*/ void copy() override; + /*virtual*/ BOOL canCopy() const override; - /*virtual*/ void paste(); - /*virtual*/ BOOL canPaste() const; + /*virtual*/ void paste() override; + /*virtual*/ BOOL canPaste() const override; void addObject(LLVOVolume* obj) ; void removeObject(LLVOVolume* obj) ; diff --git a/indra/newview/llviewermedia_streamingaudio.cpp b/indra/newview/llviewermedia_streamingaudio.cpp index d3ef0c2a95f7153e648b38ec9bf0d49d2430eaa3..4462e883d8af553b913f176a342ad9c1b2b3f1ee 100644 --- a/indra/newview/llviewermedia_streamingaudio.cpp +++ b/indra/newview/llviewermedia_streamingaudio.cpp @@ -40,7 +40,7 @@ LLStreamingAudio_MediaPlugins::LLStreamingAudio_MediaPlugins() : - mMediaPlugin(NULL), + mMediaPlugin(nullptr), mGain(1.0) { // nothing interesting to do? @@ -50,7 +50,7 @@ LLStreamingAudio_MediaPlugins::LLStreamingAudio_MediaPlugins() : LLStreamingAudio_MediaPlugins::~LLStreamingAudio_MediaPlugins() { delete mMediaPlugin; - mMediaPlugin = NULL; + mMediaPlugin = nullptr; } void LLStreamingAudio_MediaPlugins::start(const std::string& url) @@ -154,7 +154,7 @@ std::string LLStreamingAudio_MediaPlugins::getURL() LLPluginClassMedia* LLStreamingAudio_MediaPlugins::initializeMedia(const std::string& media_type) { - LLPluginClassMediaOwner* owner = NULL; + LLPluginClassMediaOwner* owner = nullptr; S32 default_size = 1; // audio-only - be minimal, doesn't matter F64 default_zoom = 1.0; LLPluginClassMedia* media_source = LLViewerMediaImpl::newSourceFromMediaType(media_type, owner, default_size, default_size, default_zoom); diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h index 368c671f84b96cb553b86c4184d1c84efae91660..ccad64db36fac02433987f830f3a472f29fe96c1 100644 --- a/indra/newview/llviewermediafocus.h +++ b/indra/newview/llviewermediafocus.h @@ -55,9 +55,9 @@ public: void clearHover(); /*virtual*/ bool getFocus(); - /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); - /*virtual*/ BOOL handleKeyUp(KEY key, MASK mask, BOOL called_from_parent); - /*virtual*/ BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); + /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent) override; + /*virtual*/ BOOL handleKeyUp(KEY key, MASK mask, BOOL called_from_parent) override; + /*virtual*/ BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) override; BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); void update(); @@ -89,12 +89,12 @@ public: LLUUID getControlsMediaID(); // The MoaP object wants keyup and keydown events. Overridden to return true. - virtual bool wantsKeyUpKeyDown() const; - virtual bool wantsReturnKey() const; + bool wantsKeyUpKeyDown() const override; + bool wantsReturnKey() const override; protected: - /*virtual*/ void onFocusReceived(); - /*virtual*/ void onFocusLost(); + /*virtual*/ void onFocusReceived() override; + /*virtual*/ void onFocusLost() override; private: diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 9aa014f08a88c872d499c7301d03d710d032c783..fd6573a05d5e164e05289e669adbb6d0b2c742b1 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -154,12 +154,12 @@ public: LLViewerMenuHolderGL(const Params& p); - virtual BOOL hideMenus(); + BOOL hideMenus() override; void setParcelSelection(LLSafeHandle<LLParcelSelection> selection); void setObjectSelection(LLSafeHandle<LLObjectSelection> selection); - virtual const LLRect getMenuRect() const; + const LLRect getMenuRect() const override; protected: LLSafeHandle<LLParcelSelection> mParcelSelection; diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 186c97bc1baf569b8144916c52424665e408dda2..de3217441a976d2de217e71500d1412b59492323 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -94,8 +94,8 @@ LLUUID upload_new_resource( void upload_new_resource( LLResourceUploadInfo::ptr_t &uploadInfo, - LLAssetStorage::LLStoreAssetCallback callback = NULL, - void *userdata = NULL); + LLAssetStorage::LLStoreAssetCallback callback = nullptr, + void *userdata = nullptr); void assign_defaults_and_show_upload_message( @@ -128,7 +128,7 @@ public: void getFile(); - virtual void run(); + void run() override; virtual void notify(const std::string& filename) = 0; }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 136ea70d7cad2849dc515619bf0a49e8b7ed92d0..c33af987895beb9778b4fdde5b0ad475e9cdd64e 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -607,7 +607,7 @@ void process_places_reply(LLMessageSystem* msg, void** data) void send_sound_trigger(const LLUUID& sound_id, F32 gain) { - if (sound_id.isNull() || gAgent.getRegion() == NULL) + if (sound_id.isNull() || gAgent.getRegion() == nullptr) { // disconnected agent or zero guids don't get sent (no sound) return; @@ -745,7 +745,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) static void highlight_inventory_objects_in_panel(const std::vector<LLUUID>& items, LLInventoryPanel *inventory_panel) { - if (NULL == inventory_panel) return; + if (nullptr == inventory_panel) return; for (std::vector<LLUUID>::const_iterator item_iter = items.begin(); item_iter != items.end(); @@ -803,7 +803,7 @@ public: const std::string& from_name) : LLInventoryFetchItemsObserver(object_id), mFromName(from_name) {} - /*virtual*/ void startFetch() + /*virtual*/ void startFetch() override { for (uuid_vec_t::const_iterator it = mIDs.begin(); it < mIDs.end(); ++it) { @@ -815,7 +815,7 @@ public: } LLInventoryFetchItemsObserver::startFetch(); } - /*virtual*/ void done() + /*virtual*/ void done() override { open_inventory_offer(mComplete, mFromName); gInventory.removeObserver(this); @@ -843,7 +843,7 @@ public: void setMoveIntoFolderID(const LLUUID& into_folder_uuid) {mMoveIntoFolderID = into_folder_uuid; } private: - /*virtual */void onAssetAdded(const LLUUID& asset_id) + /*virtual */void onAssetAdded(const LLUUID& asset_id) override { // Store active Inventory panel. if (LLInventoryPanel::getActiveInventoryPanel()) @@ -870,7 +870,7 @@ private: * Selects added inventory items watched by their Asset UUIDs if selection was not changed since * all items were started to watch (dropped into a folder). */ - void done() + void done() override { LLInventoryPanel* active_panel = dynamic_cast<LLInventoryPanel*>(mActivePanel.get()); @@ -890,7 +890,7 @@ private: { LLInventoryPanel* active_panel = dynamic_cast<LLInventoryPanel*>(mActivePanel.get()); - if (NULL == active_panel) + if (nullptr == active_panel) { return true; } @@ -937,7 +937,7 @@ private: LLUUID mMoveIntoFolderID; }; -LLViewerInventoryMoveFromWorldObserver* gInventoryMoveObserver = NULL; +LLViewerInventoryMoveFromWorldObserver* gInventoryMoveObserver = nullptr; void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder_uuid) { @@ -969,7 +969,7 @@ public: } virtual ~LLViewerInventoryMoveObserver() {} - virtual void changed(U32 mask); + void changed(U32 mask) override; private: LLUUID mObjectID; @@ -981,7 +981,7 @@ void LLViewerInventoryMoveObserver::changed(U32 mask) { LLInventoryPanel* active_panel = dynamic_cast<LLInventoryPanel*>(mActivePanel.get()); - if (NULL == active_panel) + if (nullptr == active_panel) { gInventory.removeObserver(this); return; @@ -1024,7 +1024,7 @@ void set_dad_inbox_object(const LLUUID& object_id) class LLOpenTaskOffer : public LLInventoryAddedObserver { protected: - /*virtual*/ void done() + /*virtual*/ void done() override { uuid_vec_t added; for(uuid_set_t::const_iterator it = gInventory.getAddedIDs().begin(); it != gInventory.getAddedIDs().end(); ++it) @@ -1065,7 +1065,7 @@ protected: class LLOpenTaskGroupOffer : public LLInventoryAddedObserver { protected: - /*virtual*/ void done() + /*virtual*/ void done() override { uuid_vec_t added; for(uuid_set_t::const_iterator it = gInventory.getAddedIDs().begin(); it != gInventory.getAddedIDs().end(); ++it) @@ -1079,17 +1079,17 @@ protected: }; //one global instance to bind them -LLOpenTaskOffer* gNewInventoryObserver=NULL; +LLOpenTaskOffer* gNewInventoryObserver= nullptr; class LLNewInventoryHintObserver : public LLInventoryAddedObserver { protected: - /*virtual*/ void done() + /*virtual*/ void done() override { LLFirstUse::newInventory(); } }; -LLNewInventoryHintObserver* gNewInventoryHintObserver=NULL; +LLNewInventoryHintObserver* gNewInventoryHintObserver= nullptr; void start_new_inventory_observer() { @@ -1125,7 +1125,7 @@ public: mFolderID(folder_id), mObjectID(object_id) {} - virtual void done() + void done() override { LL_DEBUGS("Messaging") << "LLDiscardAgentOffer::done()" << LL_ENDL; @@ -1388,7 +1388,7 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id, { public: OfferMatcher(const LLUUID& to_block) : blocked_id(to_block) {} - bool matches(const LLNotificationPtr notification) const + bool matches(const LLNotificationPtr notification) const override { if(notification->getName() == "ObjectGiveItem" || notification->getName() == "OwnObjectGiveItem" @@ -1418,9 +1418,9 @@ std::string LLOfferInfo::mResponderType = "offer_info"; LLOfferInfo::LLOfferInfo() : LLNotificationResponderInterface() + , mIM(IM_NOTHING_SPECIAL) , mFromGroup(FALSE) , mFromObject(FALSE) - , mIM(IM_NOTHING_SPECIAL) , mType(LLAssetType::AT_NONE) , mPersist(false) { @@ -1542,10 +1542,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& std::string log_message; S32 button = LLNotificationsUtil::getSelectedOption(notification, response); - LLInventoryObserver* opener = NULL; - LLViewerInventoryCategory* catp = NULL; + LLInventoryObserver* opener = nullptr; + LLViewerInventoryCategory* catp = nullptr; catp = (LLViewerInventoryCategory*)gInventory.getCategory(mObjectID); - LLViewerInventoryItem* itemp = NULL; + LLViewerInventoryItem* itemp = nullptr; if(!catp) { itemp = (LLViewerInventoryItem*)gInventory.getItem(mObjectID); @@ -1560,7 +1560,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // * we can't build two messages at once. if (IOR_MUTE == button) // Block { - if (notification_ptr != NULL) + if (notification_ptr != nullptr) { if (mFromGroup) { @@ -1625,7 +1625,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& break; } - if (modified_form != NULL) + if (modified_form != nullptr) { modified_form->setElementEnabled("Show", false); } @@ -1645,7 +1645,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& break; case IOR_MUTE: - if (modified_form != NULL) + if (modified_form != nullptr) { modified_form->setElementEnabled("Mute", false); } @@ -1679,7 +1679,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& opener = discard_agent_offer; } - if (modified_form != NULL) + if (modified_form != nullptr) { modified_form->setElementEnabled("Show", false); modified_form->setElementEnabled("Discard", false); @@ -1724,7 +1724,7 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const LLNotificationPtr notification_ptr = LLNotifications::instance().find(notification["id"].asUUID()); llassert(notification_ptr != NULL); - if (notification_ptr != NULL) + if (notification_ptr != nullptr) { if (mFromGroup) { @@ -1755,7 +1755,7 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const msg->addU32Fast(_PREHASH_ParentEstateID, 0); msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); - LLInventoryObserver* opener = NULL; + LLInventoryObserver* opener = nullptr; std::string from_string; // Used in the pop-up. std::string chatHistory_string; // Used in chat history. @@ -1898,7 +1898,7 @@ class LLPostponedOfferNotification: public LLPostponedNotification { protected: /* virtual */ - void modifyNotificationParams() + void modifyNotificationParams() override { LLSD substitutions = mParams.substitutions; substitutions["NAME"] = mName; @@ -2195,7 +2195,7 @@ class LLPostponedServerObjectNotification: public LLPostponedNotification { protected: /* virtual */ - void modifyNotificationParams() + void modifyNotificationParams() override { LLSD payload = mParams.payload; mParams.payload = payload; @@ -2349,7 +2349,7 @@ class LLPostponedIMSystemTipNotification: public LLPostponedNotification { protected: /* virtual */ - void modifyNotificationParams() + void modifyNotificationParams() override { LLSD payload = mParams.payload; payload["SESSION_NAME"] = mName; @@ -2446,7 +2446,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // object IMs contain sender object id in session_id (STORM-1209) || (dialog == IM_FROM_TASK && LLMuteList::getInstance()->isMuted(session_id)); bool is_owned_by_me = false; - bool is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL) ? false : true; + bool is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == nullptr) ? false : true; bool accept_im_from_only_friend = gSavedSettings.getBOOL("VoiceCallsFriendsOnly"); bool is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT && LLMuteList::getInstance()->isLinden(name); @@ -2775,7 +2775,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) std::string item_name = ll_safe_string((const char*) notice_bin_bucket->item_name); // If there is inventory, give the user the inventory offer. - LLOfferInfo* info = NULL; + LLOfferInfo* info = nullptr; if (has_inventory) { @@ -3208,7 +3208,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { return; } - else if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL)) + else if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(from_id) == nullptr)) { return; } @@ -4067,7 +4067,8 @@ public: LLFetchInWelcomeArea(const uuid_vec_t &ids) : LLInventoryFetchDescendentsObserver(ids) {} - virtual void done() + + void done() override { LLIsType is_landmark(LLAssetType::AT_LANDMARK); LLIsType is_card(LLAssetType::AT_CALLINGCARD); @@ -4109,7 +4110,7 @@ public: virtual ~LLPostTeleportNotifiers(); //function to be called at the supplied frequency - virtual BOOL tick(); + BOOL tick() override; }; LLPostTeleportNotifiers::LLPostTeleportNotifiers() : LLEventTimer( 2.0 ) @@ -4578,7 +4579,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) } // no region to send update to - if(gAgent.getRegion() == NULL) + if(gAgent.getRegion() == nullptr) { return; } @@ -4893,7 +4894,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) U32 ip = mesgsys->getSenderIP(); U32 port = mesgsys->getSenderPort(); - LLViewerRegion* regionp = NULL; + LLViewerRegion* regionp = nullptr; { LLHost host(ip, port); regionp = LLWorld::getInstance()->getRegion(host); @@ -5129,7 +5130,7 @@ void process_attached_sound_gain_change(LLMessageSystem *mesgsys, void **user_da { F32 gain = 0; LLUUID object_guid; - LLViewerObject *objectp = NULL; + LLViewerObject *objectp = nullptr; mesgsys->getUUIDFast(_PREHASH_DataBlock, _PREHASH_ObjectID, object_guid); @@ -5387,7 +5388,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data) } else { - gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(sit_spot), "Sit", &sitRotation, near_sit_object, NULL, 0.5f); + gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(sit_spot), "Sit", &sitRotation, near_sit_object, nullptr, 0.5f); } } else @@ -6031,7 +6032,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) } } - if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) + if ((maturityLevelNotification == nullptr) || maturityLevelNotification->isIgnored()) { // Given a simple notification if no maturityLevelNotification is set or it is ignore LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock); @@ -6157,7 +6158,7 @@ bool handle_teleport_access_blocked(LLSD& llsdBlock, const std::string & notific returnValue = true; } - if ((tp_failure_notification == NULL) || tp_failure_notification->isIgnored()) + if ((tp_failure_notification == nullptr) || tp_failure_notification->isIgnored()) { // Given a simple notification if no tp_failure_notification is set or it is ignore LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock); @@ -6367,7 +6368,7 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data) bool handle_not_age_verified_alert(const std::string &pAlertName) { LLNotificationPtr notification = LLNotificationsUtil::add(pAlertName); - if ((notification == NULL) || notification->isIgnored()) + if ((notification == nullptr) || notification->isIgnored()) { LLNotificationsUtil::add(pAlertName + "_Notify"); } @@ -6773,8 +6774,8 @@ void script_question_mute(const LLUUID& task_id, const std::string& object_name) { public: OfferMatcher(const LLUUID& to_block) : blocked_id(to_block) {} - bool matches(const LLNotificationPtr notification) const - { + bool matches(const LLNotificationPtr notification) const override + { if (notification->getName() == "ScriptQuestionCaution" || notification->getName() == "ScriptQuestion" || notification->getName() == "UnknownScriptQuestion") @@ -7908,7 +7909,7 @@ void process_covenant_reply(LLMessageSystem* msg, void**) LLAssetType::AT_NOTECARD, ET_Covenant, onCovenantLoadComplete, - NULL, + nullptr, high_priority); } else diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index 71b23110415367a21ba77cd2596c7c3f5cbc9e6d..cecc6830c17e426d7d8d99615ab40d62527662f0 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -241,9 +241,9 @@ public: bool mPersist; // LLNotificationResponderInterface implementation - /*virtual*/ LLSD asLLSD(); - /*virtual*/ void fromLLSD(const LLSD& params); - /*virtual*/ void handleRespond(const LLSD& notification, const LLSD& response); + /*virtual*/ LLSD asLLSD() override; + /*virtual*/ void fromLLSD(const LLSD& params) override; + /*virtual*/ void handleRespond(const LLSD& notification, const LLSD& response) override; void send_auto_receive_response(void); diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 735367d88865c307547c59aed75225e5c6caad06..a71b5fc470681303c3bd8c6b11435a899f84c7e8 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -103,8 +103,8 @@ const std::string ALCHEMY_UPDATE_SERVICE = "https://app.alchemyviewer.org/update const std::string GRIDS_USER_FILE = "grids_user.xml"; LLGridManager::LLGridManager() -: mPlatform(NOPLATFORM) -, mLoggedIn(false) +: mLoggedIn(false) +, mPlatform(NOPLATFORM) { // by default, we use the 'grids.xml' file in the user settings directory // this file is an LLSD file containing multiple grid definitions. @@ -515,7 +515,7 @@ void LLGridManager::gridInfoResponderCoro(const std::string url, bool hypergrid) std::string goof_troop(raw_results.begin(), raw_results.end()); LLPointer<LLXMLNode> xmlnode; if (!LLXMLNode::parseBuffer(reinterpret_cast<U8*>(&goof_troop[0]), - goof_troop.size(), xmlnode, NULL)) + goof_troop.size(), xmlnode, nullptr)) { LLNotificationsUtil::add("MalformedGridInfo", LLSD().with("GRID", grid[GRID_VALUE])); return; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 027f19961b722a8e8369220ec886b14b95e7665d..df173dd1d2b4e2b46be226b71dbdb6deec3b9573 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -196,7 +196,7 @@ public: virtual LLDrawable* createDrawable(LLPipeline *pipeline); virtual BOOL updateGeometry(LLDrawable *drawable); - virtual void updateGL(); + void updateGL() override; virtual void updateFaceSize(S32 idx); virtual BOOL updateLOD(); virtual BOOL setDrawableParent(LLDrawable* parentp); @@ -267,11 +267,11 @@ public: S32 face = -1, // which face to check, -1 = ALL_SIDES BOOL pick_transparent = FALSE, BOOL pick_rigged = FALSE, - S32* face_hit = NULL, // which face was hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point + S32* face_hit = nullptr, // which face was hit + LLVector4a* intersection = nullptr, // return the intersection point + LLVector2* tex_coord = nullptr, // return the texture coordinates of the intersection point + LLVector4a* normal = nullptr, // return the surface normal at the intersection point + LLVector4a* tangent = nullptr // return the surface tangent at the intersection point ); virtual BOOL lineSegmentBoundingBox(const LLVector4a& start, const LLVector4a& end); @@ -304,39 +304,39 @@ public: inline void setRotation(const F32 x, const F32 y, const F32 z, BOOL damped = FALSE); inline void setRotation(const LLQuaternion& quat, BOOL damped = FALSE); - /*virtual*/ void setNumTEs(const U8 num_tes); - /*virtual*/ void setTE(const U8 te, const LLTextureEntry &texture_entry); - /*virtual*/ S32 setTETexture(const U8 te, const LLUUID &uuid); + /*virtual*/ void setNumTEs(const U8 num_tes) override; + /*virtual*/ void setTE(const U8 te, const LLTextureEntry &texture_entry) override; + /*virtual*/ S32 setTETexture(const U8 te, const LLUUID &uuid) override; /*virtual*/ S32 setTENormalMap(const U8 te, const LLUUID &uuid); /*virtual*/ S32 setTESpecularMap(const U8 te, const LLUUID &uuid); S32 setTETextureCore(const U8 te, LLViewerTexture *image); S32 setTENormalMapCore(const U8 te, LLViewerTexture *image); S32 setTESpecularMapCore(const U8 te, LLViewerTexture *image); - /*virtual*/ S32 setTEColor(const U8 te, const LLColor3 &color); - /*virtual*/ S32 setTEColor(const U8 te, const LLColor4 &color); - /*virtual*/ S32 setTEScale(const U8 te, const F32 s, const F32 t); - /*virtual*/ S32 setTEScaleS(const U8 te, const F32 s); - /*virtual*/ S32 setTEScaleT(const U8 te, const F32 t); - /*virtual*/ S32 setTEOffset(const U8 te, const F32 s, const F32 t); - /*virtual*/ S32 setTEOffsetS(const U8 te, const F32 s); - /*virtual*/ S32 setTEOffsetT(const U8 te, const F32 t); - /*virtual*/ S32 setTERotation(const U8 te, const F32 r); - /*virtual*/ S32 setTEBumpmap(const U8 te, const U8 bump ); - /*virtual*/ S32 setTETexGen(const U8 te, const U8 texgen ); - /*virtual*/ S32 setTEMediaTexGen(const U8 te, const U8 media ); // *FIXME: this confusingly acts upon a superset of setTETexGen's flags without absorbing its semantics - /*virtual*/ S32 setTEShiny(const U8 te, const U8 shiny ); - /*virtual*/ S32 setTEFullbright(const U8 te, const U8 fullbright ); - /*virtual*/ S32 setTEMediaFlags(const U8 te, const U8 media_flags ); - /*virtual*/ S32 setTEGlow(const U8 te, const F32 glow); - /*virtual*/ S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID); - /*virtual*/ S32 setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams); + /*virtual*/ S32 setTEColor(const U8 te, const LLColor3 &color) override; + /*virtual*/ S32 setTEColor(const U8 te, const LLColor4 &color) override; + /*virtual*/ S32 setTEScale(const U8 te, const F32 s, const F32 t) override; + /*virtual*/ S32 setTEScaleS(const U8 te, const F32 s) override; + /*virtual*/ S32 setTEScaleT(const U8 te, const F32 t) override; + /*virtual*/ S32 setTEOffset(const U8 te, const F32 s, const F32 t) override; + /*virtual*/ S32 setTEOffsetS(const U8 te, const F32 s) override; + /*virtual*/ S32 setTEOffsetT(const U8 te, const F32 t) override; + /*virtual*/ S32 setTERotation(const U8 te, const F32 r) override; + /*virtual*/ S32 setTEBumpmap(const U8 te, const U8 bump ) override; + /*virtual*/ S32 setTETexGen(const U8 te, const U8 texgen ) override; + /*virtual*/ S32 setTEMediaTexGen(const U8 te, const U8 media ) override; // *FIXME: this confusingly acts upon a superset of setTETexGen's flags without absorbing its semantics + /*virtual*/ S32 setTEShiny(const U8 te, const U8 shiny ) override; + /*virtual*/ S32 setTEFullbright(const U8 te, const U8 fullbright ) override; + /*virtual*/ S32 setTEMediaFlags(const U8 te, const U8 media_flags ) override; + /*virtual*/ S32 setTEGlow(const U8 te, const F32 glow) override; + /*virtual*/ S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) override; + /*virtual*/ S32 setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) override; // Used by Materials update functions to properly kick off rebuilds // of VBs etc when materials updates require changes. // void refreshMaterials(); - /*virtual*/ BOOL setMaterial(const U8 material); + /*virtual*/ BOOL setMaterial(const U8 material) override; virtual void setTEImage(const U8 te, LLViewerTexture *imagep); // Not derived from LLPrimitive virtual void changeTEImage(S32 index, LLViewerTexture* new_image) ; virtual void changeTENormalMap(S32 index, LLViewerTexture* new_image) ; @@ -352,8 +352,8 @@ public: virtual void setScale(const LLVector3 &scale, BOOL damped = FALSE); - virtual F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const; - virtual U32 getTriangleCount(S32* vcount = NULL) const; + virtual F32 getStreamingCost(S32* bytes = nullptr, S32* visible_bytes = nullptr, F32* unscaled_value = nullptr) const; + virtual U32 getTriangleCount(S32* vcount = nullptr) const; virtual U32 getHighLODTriangleCount(); void setObjectCost(F32 cost); @@ -382,11 +382,11 @@ public: // Owner id is this object's owner void setAttachedSound(const LLUUID &audio_uuid, const LLUUID& owner_id, const F32 gain, const U8 flags); void adjustAudioGain(const F32 gain); - void clearAttachedSound() { mAudioSourcep = NULL; } + void clearAttachedSound() { mAudioSourcep = nullptr; } // Create if necessary LLAudioSource *getAudioSource(const LLUUID& owner_id); - bool isAudioSource() {return mAudioSourcep != NULL;} + bool isAudioSource() {return mAudioSourcep != nullptr;} U8 getMediaType() const; void setMediaType(U8 media_type); @@ -896,7 +896,7 @@ public: : LLViewerObject(id,pcode,regionp, is_global) { } - virtual void updateDrawable(BOOL force_damped); + void updateDrawable(BOOL force_damped) override; }; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index a3feee9b7d920e60e6d9171562fbbadeda9af30b..53cfb9caa48540b50044ac43c0751245f1ae63f8 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -235,7 +235,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, bool just_created, bool from_cache) { - LLMessageSystem* msg = NULL; + LLMessageSystem* msg = nullptr; if(!from_cache) { @@ -264,14 +264,14 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, // RN: this must be called after we have a drawable // (from gPipeline.addObject) // so that the drawable parent is set properly - if(msg != NULL) + if(msg != nullptr) { findOrphans(objectp, msg->getSenderIP(), msg->getSenderPort()); } else { LLViewerRegion* regionp = objectp->getRegion(); - if(regionp != NULL) + if(regionp != nullptr) { findOrphans(objectp, regionp->getHost().getAddress(), regionp->getHost().getPort()); } @@ -304,7 +304,7 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* if (!cached_dpp) { - return NULL; //nothing cached. + return nullptr; //nothing cached. } LLViewerObject *objectp; @@ -359,7 +359,7 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* { LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL; recorder.objectUpdateFailure(entry->getLocalID(), OUT_FULL_CACHED, 0); - return NULL; + return nullptr; } justCreated = true; mNumNewObjects++; @@ -370,7 +370,7 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* LL_WARNS() << "Dead object " << objectp->mID << " in UUID map 1!" << LL_ENDL; } - processUpdateCore(objectp, NULL, 0, OUT_FULL_CACHED, cached_dpp, justCreated, true); + processUpdateCore(objectp, nullptr, 0, OUT_FULL_CACHED, cached_dpp, justCreated, true); objectp->loadFlags(entry->getUpdateFlags()); //just in case, reload update flags from cache. if(entry->getHitCount() > 0) @@ -654,7 +654,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, { objectp->mLocalID = local_id; } - processUpdateCore(objectp, user_data, i, update_type, NULL, justCreated); + processUpdateCore(objectp, user_data, i, update_type, nullptr, justCreated); } recorder.objectUpdateEvent(local_id, update_type, objectp, msg_size); objectp->setLastUpdateType(update_type); @@ -768,7 +768,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent) // Selected struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* objectp) + bool apply(LLViewerObject* objectp) override { objectp->boostTexturePriority(); return true; @@ -852,7 +852,7 @@ void LLViewerObjectList::update(LLAgent &agent) const F64 frame_time = LLFrameTimer::getElapsedSeconds(); - LLViewerObject *objectp = NULL; + LLViewerObject *objectp = nullptr; // Make a copy of the list in case something in idleUpdate() messes with it static std::vector<LLViewerObject*> idle_list; @@ -1416,7 +1416,7 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer) { // Scan for all of the dead objects and put them all on the end of the list with no ref count ops objectp = *iter; - if (objectp == NULL) + if (objectp == nullptr) { //we caught up to the dead tail break; } @@ -1424,7 +1424,7 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer) if (objectp->isDead()) { LLPointer<LLViewerObject>::swap(*iter, *target); - *target = NULL; + *target = nullptr; ++target; num_removed++; @@ -1833,7 +1833,7 @@ void LLViewerObjectList::generatePickList(LLCamera &camera) if( !drawablep ) continue; - LLViewerObject* last_objectp = NULL; + LLViewerObject* last_objectp = nullptr; for (S32 face_num = 0; face_num < drawablep->getNumFaces(); face_num++) { LLFace * facep = drawablep->getFace(face_num); @@ -1933,7 +1933,7 @@ LLViewerObject *LLViewerObjectList::getSelectedObject(const U32 object_id) return (*pick_it); } } - return NULL; + return nullptr; } void LLViewerObjectList::addDebugBeacon(const LLVector3 &pos_agent, @@ -1966,7 +1966,7 @@ LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLVi if (!objectp) { // LL_WARNS() << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << LL_ENDL; - return NULL; + return nullptr; } mUUIDObjectMap[fullid] = objectp; @@ -1986,7 +1986,7 @@ LLViewerObject *LLViewerObjectList::createObjectFromCache(const LLPCode pcode, L if (!objectp) { // LL_WARNS() << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << LL_ENDL; - return NULL; + return nullptr; } objectp->mLocalID = local_id; @@ -2020,7 +2020,7 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe if (!objectp) { // LL_WARNS() << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << LL_ENDL; - return NULL; + return nullptr; } if(regionp) { @@ -2050,7 +2050,7 @@ LLViewerObject *LLViewerObjectList::replaceObject(const LLUUID &id, const LLPCod return createObject(pcode, regionp, id, old_instance->getLocalID(), LLHost()); } - return NULL; + return nullptr; } S32 LLViewerObjectList::findReferences(LLDrawable *drawablep) const diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 3ee48f2854ca4725cc6ba55d388740a5e432a0eb..a3169c12f70dcb460c2c8dba28018a7ece24db02 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -270,7 +270,7 @@ inline LLViewerObject *LLViewerObjectList::findObject(const LLUUID &id) } else { - return NULL; + return nullptr; } } @@ -281,7 +281,7 @@ inline LLViewerObject *LLViewerObjectList::getObject(const S32 index) if (objectp->isDead()) { //LL_WARNS() << "Dead object " << objectp->mID << " in getObject" << LL_ENDL; - return NULL; + return nullptr; } return objectp; } diff --git a/indra/newview/llvieweroctree.h b/indra/newview/llvieweroctree.h index 9bfda684ebab210ec52c271a66ba3263a241c9cb..c507b45fa378d8054e563c2a4cb8cf91d38de008 100644 --- a/indra/newview/llvieweroctree.h +++ b/indra/newview/llvieweroctree.h @@ -91,9 +91,9 @@ public: void removeData(LLViewerOctreeEntryData* data); LLViewerOctreeEntryData* getDrawable() const {return mData[LLDRAWABLE];} - bool hasDrawable() const {return mData[LLDRAWABLE] != NULL;} + bool hasDrawable() const {return mData[LLDRAWABLE] != nullptr;} LLViewerOctreeEntryData* getVOCacheEntry() const {return mData[LLVOCACHEENTRY];} - bool hasVOCacheEntry() const {return mData[LLVOCACHEENTRY] != NULL;} + bool hasVOCacheEntry() const {return mData[LLVOCACHEENTRY] != nullptr;} const LLVector4a* getSpatialExtents() const {return mExtents;} const LLVector4a& getPositionGroup() const {return mPositionGroup;} @@ -225,12 +225,12 @@ public: void clearState(U32 state) {mState &= ~state;} //LISTENER FUNCTIONS - virtual void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* obj); - virtual void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* obj); - virtual void handleDestruction(const TreeNode* node); - virtual void handleStateChange(const TreeNode* node); - virtual void handleChildAddition(const OctreeNode* parent, OctreeNode* child); - virtual void handleChildRemoval(const OctreeNode* parent, const OctreeNode* child); + void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* obj) override; + void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* obj) override; + void handleDestruction(const TreeNode* node) override; + void handleStateChange(const TreeNode* node) override; + void handleChildAddition(const OctreeNode* parent, OctreeNode* child) override; + void handleChildRemoval(const OctreeNode* parent, const OctreeNode* child) override; OctreeNode* getOctreeNode() {return mOctreeNode;} LLViewerOctreeGroup* getParent(); @@ -301,7 +301,7 @@ public: void setOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE); void clearOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE); void checkOcclusion(); //read back last occlusion query (if any) - void doOcclusion(LLCamera* camera, const LLVector4a* shift = NULL); //issue occlusion query + void doOcclusion(LLCamera* camera, const LLVector4a* shift = nullptr); //issue occlusion query BOOL isOcclusionState(U32 state) const { return mOcclusionState[LLViewerCamera::sCurCameraID] & state ? TRUE : FALSE; } U32 getOcclusionState() const { return mOcclusionState[LLViewerCamera::sCurCameraID];} @@ -309,10 +309,10 @@ public: U32 getLastOcclusionIssuedTime(); //virtual - void handleChildAddition(const OctreeNode* parent, OctreeNode* child); + void handleChildAddition(const OctreeNode* parent, OctreeNode* child) override; //virtual - BOOL isRecentlyVisible() const; + BOOL isRecentlyVisible() const override; LLViewerOctreePartition* getSpatialPartition()const {return mSpatialPartition;} BOOL isAnyRecentlyVisible() const; @@ -363,8 +363,8 @@ class LLViewerOctreeCull : public OctreeTraveler public: LLViewerOctreeCull(LLCamera* camera) : mCamera(camera), mRes(0) { } - - virtual void traverse(const OctreeNode* n); + + void traverse(const OctreeNode* n) override; protected: virtual bool earlyFail(LLViewerOctreeGroup* group); @@ -396,7 +396,7 @@ protected: virtual bool checkObjects(const OctreeNode* branch, const LLViewerOctreeGroup* group); virtual void preprocess(LLViewerOctreeGroup* group); virtual void processGroup(LLViewerOctreeGroup* group); - virtual void visit(const OctreeNode* branch); + void visit(const OctreeNode* branch) override; protected: LLCamera *mCamera; @@ -408,7 +408,7 @@ class LLViewerOctreeDebug : public OctreeTraveler { public: virtual void processGroup(LLViewerOctreeGroup* group); - virtual void visit(const OctreeNode* branch); + void visit(const OctreeNode* branch) override; public: static BOOL sInDebug; diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 580c5c6579c955446f4f269949786e0f60abfc09..348ca658474f41b26761fff75dd8714e3adfec29 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -67,7 +67,7 @@ void LLViewerParcelMedia::initClass() void LLViewerParcelMedia::cleanupClass() { // This needs to be destroyed before global destructor time. - sMediaImpl = NULL; + sMediaImpl = nullptr; } ////////////////////////////////////////////////////////////////////////////////////////// @@ -181,7 +181,7 @@ void LLViewerParcelMedia::play(LLParcel* parcel) // Since the texture id is different, we need to generate a new impl // Delete the old one first so they don't fight over the texture. - sMediaImpl = NULL; + sMediaImpl = nullptr; // A new impl will be created below. } @@ -223,7 +223,7 @@ void LLViewerParcelMedia::stop() LLViewerMediaFocus::getInstance()->clearFocus(); // This will unload & kill the media instance. - sMediaImpl = NULL; + sMediaImpl = nullptr; } // static diff --git a/indra/newview/llviewerparcelmedia.h b/indra/newview/llviewerparcelmedia.h index 534f65b4193795f4f045e0eaffa73f7d6e31c04d..962c7c3f9dd122a65c14a4e37eff24fe8d5b3268 100644 --- a/indra/newview/llviewerparcelmedia.h +++ b/indra/newview/llviewerparcelmedia.h @@ -74,7 +74,7 @@ class LLViewerParcelMedia : public LLViewerMediaObserver static void sendMediaNavigateMessage(const std::string& url); // inherited from LLViewerMediaObserver - virtual void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; public: static S32 sMediaParcelLocalID; diff --git a/indra/newview/llviewerparcelmediaautoplay.cpp b/indra/newview/llviewerparcelmediaautoplay.cpp index 2ecedb8d858d02166f4e536ca720920c700e6e57..6c6133d08adb251cf32d0a3ecc977809374fc310 100644 --- a/indra/newview/llviewerparcelmediaautoplay.cpp +++ b/indra/newview/llviewerparcelmediaautoplay.cpp @@ -53,7 +53,7 @@ LLViewerParcelMediaAutoPlay::LLViewerParcelMediaAutoPlay() : { } -static LLViewerParcelMediaAutoPlay *sAutoPlay = NULL; +static LLViewerParcelMediaAutoPlay *sAutoPlay = nullptr; // static void LLViewerParcelMediaAutoPlay::initClass() @@ -80,8 +80,8 @@ void LLViewerParcelMediaAutoPlay::playStarted() BOOL LLViewerParcelMediaAutoPlay::tick() { - LLParcel *this_parcel = NULL; - LLViewerRegion *this_region = NULL; + LLParcel *this_parcel = nullptr; + LLViewerRegion *this_region = nullptr; std::string this_media_url; std::string this_media_type; LLUUID this_media_texture_id; diff --git a/indra/newview/llviewerparcelmediaautoplay.h b/indra/newview/llviewerparcelmediaautoplay.h index a05236282931ce83b9233bc4884a3566f9e5a059..e25c15a3fd81a329b71623d98b9d196b93f319e1 100644 --- a/indra/newview/llviewerparcelmediaautoplay.h +++ b/indra/newview/llviewerparcelmediaautoplay.h @@ -35,7 +35,7 @@ class LLViewerParcelMediaAutoPlay : LLEventTimer { public: LLViewerParcelMediaAutoPlay(); - virtual BOOL tick(); + BOOL tick() override; static void initClass(); static void cleanupClass(); static void playStarted(); diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 5a0fdc8fbbb4a7010dea3df965160403e48754a3..98249c8cd6e6ee34554370eaa4ebbf07f8e690b1 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -62,8 +62,8 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_ mTimeSinceLastUpdate(), mOverlayTextureIdx(-1), mVertexCount(0), - mVertexArray(NULL), - mColorArray(NULL) + mVertexArray(nullptr), + mColorArray(nullptr) // mTexCoordArray(NULL), { // Create a texture to hold color information. @@ -101,19 +101,19 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_ LLViewerParcelOverlay::~LLViewerParcelOverlay() { delete[] mOwnership; - mOwnership = NULL; + mOwnership = nullptr; delete[] mVertexArray; - mVertexArray = NULL; + mVertexArray = nullptr; delete[] mColorArray; - mColorArray = NULL; + mColorArray = nullptr; // JC No textures. // delete mTexCoordArray; // mTexCoordArray = NULL; - mImageRaw = NULL; + mImageRaw = nullptr; } //--------------------------------------------------------------------------- @@ -613,9 +613,9 @@ void LLViewerParcelOverlay::updatePropertyLines() { // ...need new arrays delete[] mVertexArray; - mVertexArray = NULL; + mVertexArray = nullptr; delete[] mColorArray; - mColorArray = NULL; + mColorArray = nullptr; mVertexCount = new_vertex_count; diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h index 0fd3efe73b2d0b278c7e3ebdfcd5364803f18a8c..7cf08fd9266b47fe75f9d8deacc1daf701387485 100644 --- a/indra/newview/llviewerparceloverlay.h +++ b/indra/newview/llviewerparceloverlay.h @@ -79,7 +79,7 @@ public: void setDirty(); void idleUpdate(bool update_now = false); - void updateGL(); + void updateGL() override; private: // This is in parcel rows and columns, not grid rows and columns diff --git a/indra/newview/llviewerpartsource.h b/indra/newview/llviewerpartsource.h index 12e926173b4f33f5cdf2e8a114fd566506a077c1..3f33fe3a7e7083c6339b9af794c56ecadfbc382f 100644 --- a/indra/newview/llviewerpartsource.h +++ b/indra/newview/llviewerpartsource.h @@ -106,9 +106,9 @@ class LLViewerPartSourceScript : public LLViewerPartSource { public: LLViewerPartSourceScript(LLViewerObject *source_objp); - /*virtual*/ void update(const F32 dt); + /*virtual*/ void update(const F32 dt) override; - /*virtual*/ void setDead(); + /*virtual*/ void setDead() override; BOOL updateFromMesg(); @@ -139,9 +139,9 @@ class LLViewerPartSourceSpiral : public LLViewerPartSource public: LLViewerPartSourceSpiral(const LLVector3 &pos); - /*virtual*/ void setDead(); + /*virtual*/ void setDead() override; - /*virtual*/ void update(const F32 dt); + /*virtual*/ void update(const F32 dt) override; void setSourceObject(LLViewerObject *objp); void setColor(const LLColor4 &color); @@ -163,9 +163,9 @@ class LLViewerPartSourceBeam : public LLViewerPartSource public: LLViewerPartSourceBeam(); - /*virtual*/ void setDead(); + /*virtual*/ void setDead() override; - /*virtual*/ void update(const F32 dt); + /*virtual*/ void update(const F32 dt) override; void setSourceObject(LLViewerObject *objp); void setTargetObject(LLViewerObject *objp); @@ -193,9 +193,9 @@ class LLViewerPartSourceChat : public LLViewerPartSource public: LLViewerPartSourceChat(const LLVector3 &pos); - /*virtual*/ void setDead(); + /*virtual*/ void setDead() override; - /*virtual*/ void update(const F32 dt); + /*virtual*/ void update(const F32 dt) override; void setSourceObject(LLViewerObject *objp); void setColor(const LLColor4 &color); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index b1dd79cbc19f055ded307ef2c61630474313c692..96fd538b395fadcee9ce5173a8a67e3fe1a2161b 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -125,7 +125,7 @@ public: // requests will be throttled from a non-trusted browser LLRegionHandler() : LLCommandHandler("region", UNTRUSTED_THROTTLE) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { // make sure that we at least have a region name int num_params = params.size(); @@ -158,17 +158,17 @@ class LLViewerRegionImpl { public: LLViewerRegionImpl(LLViewerRegion * region, LLHost const & host): + mLandp(nullptr), mHost(host), - mCompositionp(NULL), - mEventPoll(NULL), + mCompositionp(nullptr), + mVOCachePartition(nullptr), + mEventPoll(nullptr), mSeedCapMaxAttempts(MAX_CAP_REQUEST_ATTEMPTS), mSeedCapMaxAttemptsBeforeLogin(MAX_SEED_CAP_ATTEMPTS_BEFORE_LOGIN), mSeedCapAttempts(0), mHttpResponderID(0), - mLastCameraUpdate(0), mLastCameraOrigin(), - mVOCachePartition(NULL), - mLandp(NULL) + mLastCameraUpdate(0) {} void buildCapabilityNames(LLSD& capabilityNames); @@ -239,7 +239,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle) LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); LLSD result; - LLViewerRegion *regionp = NULL; + LLViewerRegion *regionp = nullptr; // This loop is used for retrying a capabilities request. do @@ -280,7 +280,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle) LL_INFOS("AppInit", "Capabilities") << "Requesting seed from " << url << " (attempt #" << mSeedCapAttempts + 1 << ")" << LL_ENDL; - regionp = NULL; + regionp = nullptr; result = httpAdapter->postAndSuspend(httpRequest, url, capabilityNames); ++mSeedCapAttempts; @@ -352,7 +352,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle) LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); LLSD result; - LLViewerRegion *regionp = NULL; + LLViewerRegion *regionp = nullptr; // This loop is used for retrying a capabilities request. do @@ -376,7 +376,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle) LL_INFOS("AppInit", "Capabilities") << "Requesting second Seed from " << url << LL_ENDL; - regionp = NULL; + regionp = nullptr; result = httpAdapter->postAndSuspend(httpRequest, url, capabilityNames); LLSD httpResults = result["http_result"]; @@ -458,7 +458,7 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("BaseCapabilitiesRequest", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLViewerRegion *regionp = NULL; + LLViewerRegion *regionp = nullptr; S32 attemptNumber = 0; // This loop is used for retrying a capabilities request. do @@ -479,7 +479,7 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region break; // this error condition is not recoverable. } - regionp = NULL; + regionp = nullptr; LLSD result = httpAdapter->getAndSuspend(httpRequest, url); LLSD httpResults = result["http_result"]; @@ -513,7 +513,10 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, const U32 grids_per_region_edge, const U32 grids_per_patch_edge, const F32 region_width_meters) -: mImpl(new LLViewerRegionImpl(this, host)), +: mBitsReceived(0.f), + mPacketsReceived(0.f), + mImpl(new LLViewerRegionImpl(this, host)), + mWidth(region_width_meters), mHandle(handle), mTimeDilation(1.0f), mName(""), @@ -525,6 +528,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mBillableFactor(1.0), mMaxTasks(DEFAULT_MAX_REGION_WIDE_PRIM_COUNT), mCentralBakeVersion(0), + mLastVisitedEntry(nullptr), + mInvisibilityCheckHistory(-1), mClassID(0), mCPURatio(0), mColoName("unknown"), @@ -533,21 +538,16 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mHttpUrl(""), mCacheLoaded(FALSE), mCacheDirty(FALSE), - mReleaseNotesRequested(FALSE), mCapabilitiesReceived(false), mSimulatorFeaturesReceived(false), - mBitsReceived(0.f), - mPacketsReceived(0.f), + mReleaseNotesRequested(FALSE), mDead(FALSE), - mLastVisitedEntry(NULL), - mInvisibilityCheckHistory(-1), - mPaused(FALSE), - mWidth(region_width_meters) + mPaused(FALSE) { mImpl->mOriginGlobal = from_region_handle(handle); updateRenderMatrix(); - mImpl->mLandp = new LLSurface('l', NULL); + mImpl->mLandp = new LLSurface('l', nullptr); // Create the composition layer for the surface mImpl->mCompositionp = @@ -589,7 +589,7 @@ void LLViewerRegion::initPartitions() mImpl->mObjectPartition.push_back(new LLBridgePartition(this)); //PARTITION_BRIDGE mImpl->mObjectPartition.push_back(new LLHUDParticlePartition(this));//PARTITION_HUD_PARTICLE mImpl->mObjectPartition.push_back(new LLVOCachePartition(this)); //PARTITION_VO_CACHE - mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE + mImpl->mObjectPartition.push_back(nullptr); //PARTITION_NONE mImpl->mVOCachePartition = getVOCachePartition(); setCapabilitiesReceivedCallback(boost::bind(&LLAvatarRenderInfoAccountant::scanNewRegion, _1)); @@ -646,7 +646,7 @@ LLViewerRegion::~LLViewerRegion() saveObjectCache(); delete mImpl; - mImpl = NULL; + mImpl = nullptr; for (LLPointer<LLViewerTexture> tile : mWorldMapTiles) tile->setBoostLevel(LLViewerTexture::BOOST_NONE); @@ -1036,7 +1036,7 @@ void LLViewerRegion::killCacheEntry(LLVOCacheEntry* entry, bool for_rendering) else if(entry->getNumOfChildren() > 0)//remove children from cache if has any { LLVOCacheEntry* child = entry->getChild(); - while(child != NULL) + while(child != nullptr) { killCacheEntry(child, for_rendering); child = entry->getChild(); @@ -1095,7 +1095,7 @@ void LLViewerRegion::removeActiveCacheEntry(LLVOCacheEntry* entry, LLDrawable* d } //shift to the local regional space from agent space - if(drawablep != NULL && drawablep->getVObj().notNull()) + if(drawablep != nullptr && drawablep->getVObj().notNull()) { const LLVector3& pos = drawablep->getVObj()->getPositionRegion(); LLVector4a shift; @@ -1219,9 +1219,9 @@ void LLViewerRegion::addVisibleChildCacheEntry(LLVOCacheEntry* parent, LLVOCache else if(parent && parent->getNumOfChildren() > 0) //add all children { child = parent->getChild(); - while(child != NULL) + while(child != nullptr) { - addVisibleChildCacheEntry(NULL, child); + addVisibleChildCacheEntry(nullptr, child); child = parent->getChild(); } } @@ -1395,7 +1395,7 @@ void LLViewerRegion::clearCachedVisibleObjects() } //remove all visible entries. - mLastVisitedEntry = NULL; + mLastVisitedEntry = nullptr; std::vector<LLDrawable*> delete_list; for(LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mActiveSet.begin(); iter != mImpl->mActiveSet.end(); ++iter) @@ -1588,7 +1588,7 @@ void LLViewerRegion::killInvisibleObjects(F32 max_time) if(iter == mImpl->mActiveSet.end()) { - mLastVisitedEntry = NULL; + mLastVisitedEntry = nullptr; } else { @@ -1667,10 +1667,10 @@ LLViewerObject* LLViewerRegion::addNewObject(LLVOCacheEntry* entry) mImpl->mVisibleEntries.erase(entry); entry->setState(LLVOCacheEntry::INACTIVE); } - return NULL; + return nullptr; } - LLViewerObject* obj = NULL; + LLViewerObject* obj = nullptr; if(!entry->getEntry()->hasDrawable()) //not added to the rendering pipeline yet { //add the object @@ -1694,7 +1694,7 @@ LLViewerObject* LLViewerRegion::addNewObject(LLVOCacheEntry* entry) //server should soon send update message to remove one region for this object. LL_WARNS() << "Entry: " << entry->getLocalID() << " exists in two regions at the same time." << LL_ENDL; - return NULL; + return nullptr; } LL_WARNS() << "Entry: " << entry->getLocalID() << " in rendering pipeline but not set to be active." << LL_ENDL; @@ -2018,10 +2018,10 @@ BOOL LLViewerRegion::isOwnedGroup(const LLVector3& pos) class CoarseLocationUpdate : public LLHTTPNode { public: - virtual void post( + void post( ResponsePtr responder, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { LLHost host(input["sender"].asString()); LLViewerRegion* region = LLWorld::getInstance()->getRegion(host); @@ -2292,7 +2292,7 @@ void LLViewerRegion::findOrphans(U32 parent_id) for(S32 i = 0; i < children->size(); i++) { //parent is visible, so is the child. - addVisibleChildCacheEntry(NULL, getCacheEntry((*children)[i])); + addVisibleChildCacheEntry(nullptr, getCacheEntry((*children)[i])); } children->clear(); mOrphanMap.erase(parent_id); @@ -2313,7 +2313,7 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry) if(!entry->getEntry()) { - entry->setOctreeEntry(NULL); + entry->setOctreeEntry(nullptr); } if(entry->getEntry()->hasDrawable()) //already in the rendering pipeline @@ -2396,7 +2396,7 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry) if(isNonCacheableObjectCreated(parent_id)) { //parent is visible, so is the child. - addVisibleChildCacheEntry(NULL, entry); + addVisibleChildCacheEntry(nullptr, entry); } else { @@ -2525,7 +2525,7 @@ LLVOCacheEntry* LLViewerRegion::getCacheEntryForOctree(U32 local_id) { if(!sVOCacheCullingEnabled) { - return NULL; + return nullptr; } LLVOCacheEntry* entry = getCacheEntry(local_id); @@ -2544,7 +2544,7 @@ LLVOCacheEntry* LLViewerRegion::getCacheEntry(U32 local_id, bool valid) return iter->second; } } - return NULL; + return nullptr; } void LLViewerRegion::addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type) @@ -3032,7 +3032,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url) } delete mImpl->mEventPoll; - mImpl->mEventPoll = NULL; + mImpl->mEventPoll = nullptr; mImpl->mCapabilities.clear(); setCapability("Seed", url); @@ -3079,7 +3079,7 @@ void LLViewerRegion::setCapability(const std::string& name, const std::string& u if(name == "EventQueueGet") { delete mImpl->mEventPoll; - mImpl->mEventPoll = NULL; + mImpl->mEventPoll = nullptr; mImpl->mEventPoll = new LLEventPoll(url, getHost()); } else if(name == "UntrustedSimulatorMessage") @@ -3240,7 +3240,7 @@ LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type) { return (LLSpatialPartition*)mImpl->mObjectPartition[type]; } - return NULL; + return nullptr; } LLVOCachePartition* LLViewerRegion::getVOCachePartition() @@ -3249,7 +3249,7 @@ LLVOCachePartition* LLViewerRegion::getVOCachePartition() { return (LLVOCachePartition*)mImpl->mObjectPartition[PARTITION_VO_CACHE]; } - return NULL; + return nullptr; } // the viewer can not yet distinquish between normal- and estate-owned objects @@ -3259,7 +3259,7 @@ const U64 ALLOW_RETURN_ENCROACHING_OBJECT = REGION_FLAGS_ALLOW_RETURN_ENCROACHIN bool LLViewerRegion::objectIsReturnable(const LLVector3& pos, const std::vector<LLBBox>& boxes) const { - return (mParcelOverlay != NULL) + return (mParcelOverlay != nullptr) && (mParcelOverlay->isOwnedSelf(pos) || mParcelOverlay->isOwnedGroup(pos) || (getRegionFlag(ALLOW_RETURN_ENCROACHING_OBJECT) diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 189a680278be7ad317e13a73b54751b51da5423e..a0e4ca65fc614b90f5f87bb3eb6564844dadf7ae 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -257,7 +257,7 @@ public: void setCapabilityDebug(const std::string& name, const std::string& url); bool isCapabilityAvailable(const std::string& name) const; // implements LLCapabilityProvider - virtual std::string getCapability(const std::string& name) const; + std::string getCapability(const std::string& name) const override; std::string getCapabilityDebug(const std::string& name) const; @@ -274,7 +274,7 @@ public: void logActiveCapabilities() const; /// implements LLCapabilityProvider - /*virtual*/ const LLHost& getHost() const; + /*virtual*/ const LLHost& getHost() const override; const U64 &getHandle() const { return mHandle; } LLSurface &getLand() const; @@ -358,7 +358,7 @@ public: friend std::ostream& operator<<(std::ostream &s, const LLViewerRegion ®ion); /// implements LLCapabilityProvider - virtual std::string getDescription() const; + std::string getDescription() const override; std::string getHttpUrl() const { return mHttpUrl ;} U32 getNumOfVisibleGroups() const; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index e0dce60e559482cad76aff6e0cbf7a9460f96a7d..f8c574865a4765e8e134bd86401df96c4c011ca3 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -334,7 +334,7 @@ LLViewerShaderMgr::~LLViewerShaderMgr() // static LLViewerShaderMgr * LLViewerShaderMgr::instance() { - if(NULL == sInstance) + if(nullptr == sInstance) { sInstance = new LLViewerShaderMgr(); } @@ -345,10 +345,10 @@ LLViewerShaderMgr * LLViewerShaderMgr::instance() // static void LLViewerShaderMgr::releaseInstance() { - if (sInstance != NULL) + if (sInstance != nullptr) { delete sInstance; - sInstance = NULL; + sInstance = nullptr; } } @@ -927,7 +927,7 @@ BOOL LLViewerShaderMgr::loadShadersEnvironment() gTerrainProgram.mShaderFiles.push_back(std::make_pair("environment/terrainV.glsl", GL_VERTEX_SHADER)); gTerrainProgram.mShaderFiles.push_back(std::make_pair("environment/terrainF.glsl", GL_FRAGMENT_SHADER)); gTerrainProgram.mShaderLevel = mVertexShaderLevel[SHADER_ENVIRONMENT]; - success = gTerrainProgram.createShader(NULL, NULL); + success = gTerrainProgram.createShader(nullptr, nullptr); } if (!success) @@ -965,7 +965,7 @@ BOOL LLViewerShaderMgr::loadShadersWater() gWaterProgram.mShaderFiles.push_back(std::make_pair("environment/waterV.glsl", GL_VERTEX_SHADER)); gWaterProgram.mShaderFiles.push_back(std::make_pair("environment/waterF.glsl", GL_FRAGMENT_SHADER)); gWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_WATER]; - success = gWaterProgram.createShader(NULL, NULL); + success = gWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -979,7 +979,7 @@ BOOL LLViewerShaderMgr::loadShadersWater() gUnderWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_WATER]; gUnderWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gUnderWaterProgram.createShader(NULL, NULL); + success = gUnderWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -997,7 +997,7 @@ BOOL LLViewerShaderMgr::loadShadersWater() gTerrainWaterProgram.mShaderFiles.push_back(std::make_pair("environment/terrainWaterF.glsl", GL_FRAGMENT_SHADER)); gTerrainWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_ENVIRONMENT]; gTerrainWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - terrainWaterSuccess = gTerrainWaterProgram.createShader(NULL, NULL); + terrainWaterSuccess = gTerrainWaterProgram.createShader(nullptr, nullptr); } /// Keep track of water shader levels @@ -1044,7 +1044,7 @@ BOOL LLViewerShaderMgr::loadShadersEffects() gGlowProgram.mShaderFiles.push_back(std::make_pair("effects/glowV.glsl", GL_VERTEX_SHADER)); gGlowProgram.mShaderFiles.push_back(std::make_pair("effects/glowF.glsl", GL_FRAGMENT_SHADER)); gGlowProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT]; - success = gGlowProgram.createShader(NULL, NULL); + success = gGlowProgram.createShader(nullptr, nullptr); if (!success) { LLPipeline::sRenderGlow = FALSE; @@ -1058,7 +1058,7 @@ BOOL LLViewerShaderMgr::loadShadersEffects() gGlowExtractProgram.mShaderFiles.push_back(std::make_pair("effects/glowExtractV.glsl", GL_VERTEX_SHADER)); gGlowExtractProgram.mShaderFiles.push_back(std::make_pair("effects/glowExtractF.glsl", GL_FRAGMENT_SHADER)); gGlowExtractProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT]; - success = gGlowExtractProgram.createShader(NULL, NULL); + success = gGlowExtractProgram.createShader(nullptr, nullptr); if (!success) { LLPipeline::sRenderGlow = FALSE; @@ -1147,7 +1147,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredDiffuseProgram.mShaderFiles.push_back(std::make_pair("deferred/diffuseIndexedF.glsl", GL_FRAGMENT_SHADER)); gDeferredDiffuseProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredDiffuseProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredDiffuseProgram.createShader(NULL, NULL); + success = gDeferredDiffuseProgram.createShader(nullptr, nullptr); } if (success) @@ -1158,7 +1158,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("deferred/diffuseAlphaMaskIndexedF.glsl", GL_FRAGMENT_SHADER)); gDeferredDiffuseAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredDiffuseAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredDiffuseAlphaMaskProgram.createShader(NULL, NULL); + success = gDeferredDiffuseAlphaMaskProgram.createShader(nullptr, nullptr); } if (success) @@ -1168,7 +1168,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER)); gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("deferred/diffuseAlphaMaskF.glsl", GL_FRAGMENT_SHADER)); gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredNonIndexedDiffuseAlphaMaskProgram.createShader(NULL, NULL); + success = gDeferredNonIndexedDiffuseAlphaMaskProgram.createShader(nullptr, nullptr); } if (success) @@ -1178,7 +1178,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.push_back(std::make_pair("deferred/diffuseNoColorV.glsl", GL_VERTEX_SHADER)); gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.push_back(std::make_pair("deferred/diffuseAlphaMaskNoColorF.glsl", GL_FRAGMENT_SHADER)); gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.createShader(NULL, NULL); + success = gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.createShader(nullptr, nullptr); } if (success) @@ -1188,7 +1188,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredNonIndexedDiffuseProgram.mShaderFiles.push_back(std::make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER)); gDeferredNonIndexedDiffuseProgram.mShaderFiles.push_back(std::make_pair("deferred/diffuseF.glsl", GL_FRAGMENT_SHADER)); gDeferredNonIndexedDiffuseProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredNonIndexedDiffuseProgram.createShader(NULL, NULL); + success = gDeferredNonIndexedDiffuseProgram.createShader(nullptr, nullptr); } @@ -1200,7 +1200,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedDiffuseProgram.mShaderFiles.push_back(std::make_pair("deferred/diffuseSkinnedV.glsl", GL_VERTEX_SHADER)); gDeferredSkinnedDiffuseProgram.mShaderFiles.push_back(std::make_pair("deferred/diffuseF.glsl", GL_FRAGMENT_SHADER)); gDeferredSkinnedDiffuseProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredSkinnedDiffuseProgram.createShader(NULL, NULL); + success = gDeferredSkinnedDiffuseProgram.createShader(nullptr, nullptr); } if (success) @@ -1211,7 +1211,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedBumpProgram.mShaderFiles.push_back(std::make_pair("deferred/bumpSkinnedV.glsl", GL_VERTEX_SHADER)); gDeferredSkinnedBumpProgram.mShaderFiles.push_back(std::make_pair("deferred/bumpF.glsl", GL_FRAGMENT_SHADER)); gDeferredSkinnedBumpProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredSkinnedBumpProgram.createShader(NULL, NULL); + success = gDeferredSkinnedBumpProgram.createShader(nullptr, nullptr); } if (success) @@ -1230,7 +1230,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.addPermutation("HAS_SKIN", "1"); gDeferredSkinnedAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredSkinnedAlphaProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); - success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL); + success = gDeferredSkinnedAlphaProgram.createShader(nullptr, nullptr); // Hack to include uniforms for lighting without linking in lighting file gDeferredSkinnedAlphaProgram.mFeatures.calculatesLighting = true; @@ -1244,7 +1244,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredBumpProgram.mShaderFiles.push_back(std::make_pair("deferred/bumpV.glsl", GL_VERTEX_SHADER)); gDeferredBumpProgram.mShaderFiles.push_back(std::make_pair("deferred/bumpF.glsl", GL_FRAGMENT_SHADER)); gDeferredBumpProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredBumpProgram.createShader(NULL, NULL); + success = gDeferredBumpProgram.createShader(nullptr, nullptr); } gDeferredMaterialProgram[1].mFeatures.hasLighting = false; @@ -1289,7 +1289,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMaterialProgram[i].mFeatures.hasObjectSkinning = true; } - success = gDeferredMaterialProgram[i].createShader(NULL, NULL); + success = gDeferredMaterialProgram[i].createShader(nullptr, nullptr); } if (success) @@ -1317,7 +1317,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMaterialWaterProgram[i].mFeatures.hasObjectSkinning = true; } - success = gDeferredMaterialWaterProgram[i].createShader(NULL, NULL);//&mWLUniforms); + success = gDeferredMaterialWaterProgram[i].createShader(nullptr, nullptr);//&mWLUniforms); } } @@ -1347,7 +1347,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredTreeProgram.mShaderFiles.push_back(std::make_pair("deferred/treeV.glsl", GL_VERTEX_SHADER)); gDeferredTreeProgram.mShaderFiles.push_back(std::make_pair("deferred/treeF.glsl", GL_FRAGMENT_SHADER)); gDeferredTreeProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredTreeProgram.createShader(NULL, NULL); + success = gDeferredTreeProgram.createShader(nullptr, nullptr); } if (success) @@ -1358,7 +1358,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredTreeShadowProgram.mShaderFiles.push_back(std::make_pair("deferred/treeShadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredTreeShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredTreeShadowProgram.addPermutation("DEPTH_CLAMP", /*gGLManager.mHasDepthClamp ? "1" :*/ "0"); - success = gDeferredTreeShadowProgram.createShader(NULL, NULL); + success = gDeferredTreeShadowProgram.createShader(nullptr, nullptr); } if (success) @@ -1368,7 +1368,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredImpostorProgram.mShaderFiles.push_back(std::make_pair("deferred/impostorV.glsl", GL_VERTEX_SHADER)); gDeferredImpostorProgram.mShaderFiles.push_back(std::make_pair("deferred/impostorF.glsl", GL_FRAGMENT_SHADER)); gDeferredImpostorProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredImpostorProgram.createShader(NULL, NULL); + success = gDeferredImpostorProgram.createShader(nullptr, nullptr); } if (success) @@ -1379,7 +1379,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredLightProgram.mShaderFiles.push_back(std::make_pair("deferred/pointLightF.glsl", GL_FRAGMENT_SHADER)); gDeferredLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredLightProgram.createShader(NULL, NULL); + success = gDeferredLightProgram.createShader(nullptr, nullptr); } for (U32 i = 0; i < LL_DEFERRED_MULTI_LIGHT_COUNT; i++) @@ -1392,7 +1392,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMultiLightProgram[i].mShaderFiles.push_back(std::make_pair("deferred/multiPointLightF.glsl", GL_FRAGMENT_SHADER)); gDeferredMultiLightProgram[i].mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredMultiLightProgram[i].addPermutation("LIGHT_COUNT", llformat("%d", i+1)); - success = gDeferredMultiLightProgram[i].createShader(NULL, NULL); + success = gDeferredMultiLightProgram[i].createShader(nullptr, nullptr); } } @@ -1404,7 +1404,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSpotLightProgram.mShaderFiles.push_back(std::make_pair("deferred/spotLightF.glsl", GL_FRAGMENT_SHADER)); gDeferredSpotLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredSpotLightProgram.createShader(NULL, NULL); + success = gDeferredSpotLightProgram.createShader(nullptr, nullptr); } if (success) @@ -1415,7 +1415,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMultiSpotLightProgram.mShaderFiles.push_back(std::make_pair("deferred/multiSpotLightF.glsl", GL_FRAGMENT_SHADER)); gDeferredMultiSpotLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredMultiSpotLightProgram.createShader(NULL, NULL); + success = gDeferredMultiSpotLightProgram.createShader(nullptr, nullptr); } if (success) @@ -1442,7 +1442,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSunProgram.mShaderFiles.push_back(std::make_pair(fragment, GL_FRAGMENT_SHADER)); gDeferredSunProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredSunProgram.createShader(NULL, NULL); + success = gDeferredSunProgram.createShader(nullptr, nullptr); } if (gSavedSettings.getBOOL("RenderDeferredSSAO")) @@ -1454,7 +1454,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSSAOProgram.mShaderFiles.push_back(std::make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredSSAOProgram.mShaderFiles.push_back(std::make_pair("deferred/SSAOF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSSAOProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredSSAOProgram.createShader(NULL, NULL); + success = gDeferredSSAOProgram.createShader(nullptr, nullptr); } if (success) @@ -1464,7 +1464,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredDownsampleDepthNearestProgram.mShaderFiles.push_back(std::make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredDownsampleDepthNearestProgram.mShaderFiles.push_back(std::make_pair("deferred/downsampleDepthNearestF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredDownsampleDepthNearestProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredDownsampleDepthNearestProgram.createShader(NULL, NULL); + success = gDeferredDownsampleDepthNearestProgram.createShader(nullptr, nullptr); } } @@ -1476,7 +1476,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredBlurLightProgram.mShaderFiles.push_back(std::make_pair("deferred/blurLightF.glsl", GL_FRAGMENT_SHADER)); gDeferredBlurLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredBlurLightProgram.createShader(NULL, NULL); + success = gDeferredBlurLightProgram.createShader(nullptr, nullptr); } if (success) @@ -1504,7 +1504,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAlphaProgram.createShader(NULL, NULL); + success = gDeferredAlphaProgram.createShader(nullptr, nullptr); // Hack gDeferredAlphaProgram.mFeatures.calculatesLighting = true; @@ -1538,7 +1538,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaImpostorProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAlphaImpostorProgram.createShader(NULL, NULL); + success = gDeferredAlphaImpostorProgram.createShader(nullptr, nullptr); // Hack gDeferredAlphaImpostorProgram.mFeatures.calculatesLighting = true; @@ -1570,7 +1570,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaWaterProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); gDeferredAlphaWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAlphaWaterProgram.createShader(NULL, NULL); + success = gDeferredAlphaWaterProgram.createShader(nullptr, nullptr); // Hack gDeferredAlphaWaterProgram.mFeatures.calculatesLighting = true; @@ -1588,7 +1588,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarEyesProgram.mShaderFiles.push_back(std::make_pair("deferred/avatarEyesV.glsl", GL_VERTEX_SHADER)); gDeferredAvatarEyesProgram.mShaderFiles.push_back(std::make_pair("deferred/diffuseF.glsl", GL_FRAGMENT_SHADER)); gDeferredAvatarEyesProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAvatarEyesProgram.createShader(NULL, NULL); + success = gDeferredAvatarEyesProgram.createShader(nullptr, nullptr); } if (success) @@ -1602,7 +1602,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightProgram.mShaderFiles.push_back(std::make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER)); gDeferredFullbrightProgram.mShaderFiles.push_back(std::make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gDeferredFullbrightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredFullbrightProgram.createShader(NULL, NULL); + success = gDeferredFullbrightProgram.createShader(nullptr, nullptr); } if (success) @@ -1617,7 +1617,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gDeferredFullbrightAlphaMaskProgram.addPermutation("HAS_ALPHA_MASK","1"); gDeferredFullbrightAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredFullbrightAlphaMaskProgram.createShader(NULL, NULL); + success = gDeferredFullbrightAlphaMaskProgram.createShader(nullptr, nullptr); } if (success) @@ -1633,7 +1633,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredFullbrightWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; gDeferredFullbrightWaterProgram.addPermutation("WATER_FOG","1"); - success = gDeferredFullbrightWaterProgram.createShader(NULL, NULL); + success = gDeferredFullbrightWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -1650,7 +1650,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightAlphaMaskWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; gDeferredFullbrightAlphaMaskWaterProgram.addPermutation("HAS_ALPHA_MASK","1"); gDeferredFullbrightAlphaMaskWaterProgram.addPermutation("WATER_FOG","1"); - success = gDeferredFullbrightAlphaMaskWaterProgram.createShader(NULL, NULL); + success = gDeferredFullbrightAlphaMaskWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -1664,7 +1664,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightShinyProgram.mShaderFiles.push_back(std::make_pair("deferred/fullbrightShinyV.glsl", GL_VERTEX_SHADER)); gDeferredFullbrightShinyProgram.mShaderFiles.push_back(std::make_pair("deferred/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER)); gDeferredFullbrightShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredFullbrightShinyProgram.createShader(NULL, NULL); + success = gDeferredFullbrightShinyProgram.createShader(nullptr, nullptr); } if (success) @@ -1679,7 +1679,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedFullbrightProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightSkinnedV.glsl", GL_VERTEX_SHADER)); gDeferredSkinnedFullbrightProgram.mShaderFiles.push_back(std::make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gDeferredSkinnedFullbrightProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gDeferredSkinnedFullbrightProgram.createShader(NULL, NULL); + success = gDeferredSkinnedFullbrightProgram.createShader(nullptr, nullptr); } if (success) @@ -1694,7 +1694,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedFullbrightShinyProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightShinySkinnedV.glsl", GL_VERTEX_SHADER)); gDeferredSkinnedFullbrightShinyProgram.mShaderFiles.push_back(std::make_pair("deferred/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER)); gDeferredSkinnedFullbrightShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gDeferredSkinnedFullbrightShinyProgram.createShader(NULL, NULL); + success = gDeferredSkinnedFullbrightShinyProgram.createShader(nullptr, nullptr); } if (success) @@ -1708,7 +1708,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredEmissiveProgram.mShaderFiles.push_back(std::make_pair("deferred/emissiveV.glsl", GL_VERTEX_SHADER)); gDeferredEmissiveProgram.mShaderFiles.push_back(std::make_pair("deferred/emissiveF.glsl", GL_FRAGMENT_SHADER)); gDeferredEmissiveProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredEmissiveProgram.createShader(NULL, NULL); + success = gDeferredEmissiveProgram.createShader(nullptr, nullptr); } if (success) @@ -1722,7 +1722,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWaterProgram.mShaderFiles.push_back(std::make_pair("deferred/waterV.glsl", GL_VERTEX_SHADER)); gDeferredWaterProgram.mShaderFiles.push_back(std::make_pair("deferred/waterF.glsl", GL_FRAGMENT_SHADER)); gDeferredWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredWaterProgram.createShader(NULL, NULL); + success = gDeferredWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -1736,7 +1736,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredUnderWaterProgram.mShaderFiles.push_back(std::make_pair("deferred/waterV.glsl", GL_VERTEX_SHADER)); gDeferredUnderWaterProgram.mShaderFiles.push_back(std::make_pair("deferred/underWaterF.glsl", GL_FRAGMENT_SHADER)); gDeferredUnderWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredUnderWaterProgram.createShader(NULL, NULL); + success = gDeferredUnderWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -1752,7 +1752,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSoftenProgram.mShaderLevel = llmax(gDeferredSoftenProgram.mShaderLevel, 2); } - success = gDeferredSoftenProgram.createShader(NULL, NULL); + success = gDeferredSoftenProgram.createShader(nullptr, nullptr); } if (success) @@ -1771,7 +1771,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSoftenWaterProgram.mShaderLevel = llmax(gDeferredSoftenWaterProgram.mShaderLevel, 2); } - success = gDeferredSoftenWaterProgram.createShader(NULL, NULL); + success = gDeferredSoftenWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -1782,7 +1782,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowProgram.mShaderFiles.push_back(std::make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredShadowProgram.addPermutation("DEPTH_CLAMP", /*gGLManager.mHasDepthClamp ? "1" :*/ "0"); - success = gDeferredShadowProgram.createShader(NULL, NULL); + success = gDeferredShadowProgram.createShader(nullptr, nullptr); } if (success) @@ -1793,7 +1793,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowCubeProgram.mShaderFiles.push_back(std::make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredShadowCubeProgram.addPermutation("DEPTH_CLAMP", /*gGLManager.mHasDepthClamp ? "1" :*/ "0"); gDeferredShadowCubeProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredShadowCubeProgram.createShader(NULL, NULL); + success = gDeferredShadowCubeProgram.createShader(nullptr, nullptr); } if (success) @@ -1805,7 +1805,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER)); gDeferredShadowAlphaMaskProgram.addPermutation("DEPTH_CLAMP", /*gGLManager.mHasDepthClamp ? "1" :*/ "0"); gDeferredShadowAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredShadowAlphaMaskProgram.createShader(NULL, NULL); + success = gDeferredShadowAlphaMaskProgram.createShader(nullptr, nullptr); } if (success) @@ -1817,7 +1817,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarShadowProgram.mShaderFiles.push_back(std::make_pair("deferred/avatarShadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredAvatarShadowProgram.addPermutation("DEPTH_CLAMP", /*gGLManager.mHasDepthClamp ? "1" :*/ "0"); gDeferredAvatarShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAvatarShadowProgram.createShader(NULL, NULL); + success = gDeferredAvatarShadowProgram.createShader(nullptr, nullptr); } if (success) @@ -1829,7 +1829,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAttachmentShadowProgram.mShaderFiles.push_back(std::make_pair("deferred/attachmentShadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredAttachmentShadowProgram.addPermutation("DEPTH_CLAMP", /*gGLManager.mHasDepthClamp ? "1" :*/ "0"); gDeferredAttachmentShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAttachmentShadowProgram.createShader(NULL, NULL); + success = gDeferredAttachmentShadowProgram.createShader(nullptr, nullptr); } if (success) @@ -1839,7 +1839,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredTerrainProgram.mShaderFiles.push_back(std::make_pair("deferred/terrainV.glsl", GL_VERTEX_SHADER)); gDeferredTerrainProgram.mShaderFiles.push_back(std::make_pair("deferred/terrainF.glsl", GL_FRAGMENT_SHADER)); gDeferredTerrainProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredTerrainProgram.createShader(NULL, NULL); + success = gDeferredTerrainProgram.createShader(nullptr, nullptr); } if (success) @@ -1851,7 +1851,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarProgram.mShaderFiles.push_back(std::make_pair("deferred/avatarF.glsl", GL_FRAGMENT_SHADER)); gDeferredAvatarProgram.addPermutation("AVATAR_CLOTH", (mVertexShaderLevel[SHADER_AVATAR] == 3) ? "1" : "0"); gDeferredAvatarProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAvatarProgram.createShader(NULL, NULL); + success = gDeferredAvatarProgram.createShader(nullptr, nullptr); } if (success) @@ -1870,7 +1870,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAvatarAlphaProgram.createShader(NULL, NULL); + success = gDeferredAvatarAlphaProgram.createShader(nullptr, nullptr); gDeferredAvatarAlphaProgram.mFeatures.calculatesLighting = true; gDeferredAvatarAlphaProgram.mFeatures.hasLighting = true; @@ -1883,7 +1883,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(std::make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(std::make_pair("deferred/postDeferredGammaCorrectF.glsl", GL_FRAGMENT_SHADER)); gDeferredPostGammaCorrectProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredPostGammaCorrectProgram.createShader(NULL, NULL); + success = gDeferredPostGammaCorrectProgram.createShader(nullptr, nullptr); } if (success) @@ -1894,7 +1894,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gFXAAProgram.mShaderFiles.push_back(std::make_pair("deferred/fxaaF.glsl", GL_FRAGMENT_SHADER)); gFXAAProgram.addPermutation("FXAA_QUALITY_PRESET", std::to_string(gSavedSettings.getU32("RenderDeferredFXAAQuality"))); // <alchemy/> gFXAAProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gFXAAProgram.createShader(NULL, NULL); + success = gFXAAProgram.createShader(nullptr, nullptr); } if (success) @@ -1904,7 +1904,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredPostProgram.mShaderFiles.push_back(std::make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); gDeferredPostProgram.mShaderFiles.push_back(std::make_pair("deferred/postDeferredF.glsl", GL_FRAGMENT_SHADER)); gDeferredPostProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredPostProgram.createShader(NULL, NULL); + success = gDeferredPostProgram.createShader(nullptr, nullptr); } if (success) @@ -1914,7 +1914,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredCoFProgram.mShaderFiles.push_back(std::make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); gDeferredCoFProgram.mShaderFiles.push_back(std::make_pair("deferred/cofF.glsl", GL_FRAGMENT_SHADER)); gDeferredCoFProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredCoFProgram.createShader(NULL, NULL); + success = gDeferredCoFProgram.createShader(nullptr, nullptr); } if (success) @@ -1925,7 +1925,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredDoFCombineProgram.mShaderFiles.push_back(std::make_pair("deferred/dofCombineF.glsl", GL_FRAGMENT_SHADER)); gDeferredDoFCombineProgram.addPermutation("USE_FILM_GRAIN", gSavedSettings.getBOOL("RenderDeferredDoFGrain") ? "1" : "0"); gDeferredDoFCombineProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredDoFCombineProgram.createShader(NULL, NULL); + success = gDeferredDoFCombineProgram.createShader(nullptr, nullptr); } if (success) @@ -1935,7 +1935,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredPostNoDoFProgram.mShaderFiles.push_back(std::make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); gDeferredPostNoDoFProgram.mShaderFiles.push_back(std::make_pair("deferred/postDeferredNoDoFF.glsl", GL_FRAGMENT_SHADER)); gDeferredPostNoDoFProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredPostNoDoFProgram.createShader(NULL, NULL); + success = gDeferredPostNoDoFProgram.createShader(nullptr, nullptr); } if (success) @@ -1947,7 +1947,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLSkyProgram.mShaderFiles.push_back(std::make_pair("deferred/skyF.glsl", GL_FRAGMENT_SHADER)); gDeferredWLSkyProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredWLSkyProgram.mShaderGroup = LLGLSLShader::SG_SKY; - success = gDeferredWLSkyProgram.createShader(NULL, NULL); + success = gDeferredWLSkyProgram.createShader(nullptr, nullptr); } if (success) @@ -1958,7 +1958,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLCloudProgram.mShaderFiles.push_back(std::make_pair("deferred/cloudsF.glsl", GL_FRAGMENT_SHADER)); gDeferredWLCloudProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredWLCloudProgram.mShaderGroup = LLGLSLShader::SG_SKY; - success = gDeferredWLCloudProgram.createShader(NULL, NULL); + success = gDeferredWLCloudProgram.createShader(nullptr, nullptr); } if (success) @@ -1970,7 +1970,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredStarProgram.mShaderFiles.push_back(std::make_pair("deferred/starsF.glsl", GL_FRAGMENT_SHADER)); gDeferredStarProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredStarProgram.mShaderGroup = LLGLSLShader::SG_SKY; - success = gDeferredStarProgram.createShader(NULL, &shaderUniforms); + success = gDeferredStarProgram.createShader(nullptr, &shaderUniforms); } if (success) @@ -1981,7 +1981,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gNormalMapGenProgram.mShaderFiles.push_back(std::make_pair("deferred/normgenF.glsl", GL_FRAGMENT_SHADER)); gNormalMapGenProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gNormalMapGenProgram.mShaderGroup = LLGLSLShader::SG_SKY; - success = gNormalMapGenProgram.createShader(NULL, NULL); + success = gNormalMapGenProgram.createShader(nullptr, nullptr); } return success; @@ -2057,7 +2057,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleNonIndexedProgram.mShaderFiles.push_back(std::make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); gObjectSimpleNonIndexedProgram.mShaderFiles.push_back(std::make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectSimpleNonIndexedProgram.createShader(NULL, NULL); + success = gObjectSimpleNonIndexedProgram.createShader(nullptr, nullptr); } if (success) @@ -2073,7 +2073,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.push_back(std::make_pair("objects/simpleTexGenV.glsl", GL_VERTEX_SHADER)); gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.push_back(std::make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleNonIndexedTexGenProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectSimpleNonIndexedTexGenProgram.createShader(NULL, NULL); + success = gObjectSimpleNonIndexedTexGenProgram.createShader(nullptr, nullptr); } @@ -2091,7 +2091,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleNonIndexedWaterProgram.mShaderFiles.push_back(std::make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectSimpleNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectSimpleNonIndexedWaterProgram.createShader(NULL, NULL); + success = gObjectSimpleNonIndexedWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2108,7 +2108,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.push_back(std::make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleNonIndexedTexGenWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectSimpleNonIndexedTexGenWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectSimpleNonIndexedTexGenWaterProgram.createShader(NULL, NULL); + success = gObjectSimpleNonIndexedTexGenWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2125,7 +2125,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(std::make_pair("objects/simpleNonIndexedV.glsl", GL_VERTEX_SHADER)); gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(std::make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectAlphaMaskNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectAlphaMaskNonIndexedProgram.createShader(NULL, NULL); + success = gObjectAlphaMaskNonIndexedProgram.createShader(nullptr, nullptr); } if (success) @@ -2143,7 +2143,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(std::make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectAlphaMaskNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectAlphaMaskNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectAlphaMaskNonIndexedWaterProgram.createShader(NULL, NULL); + success = gObjectAlphaMaskNonIndexedWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2160,7 +2160,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(std::make_pair("objects/simpleNoColorV.glsl", GL_VERTEX_SHADER)); gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(std::make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectAlphaMaskNoColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectAlphaMaskNoColorProgram.createShader(NULL, NULL); + success = gObjectAlphaMaskNoColorProgram.createShader(nullptr, nullptr); } if (success) @@ -2178,7 +2178,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectAlphaMaskNoColorWaterProgram.mShaderFiles.push_back(std::make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectAlphaMaskNoColorWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectAlphaMaskNoColorWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectAlphaMaskNoColorWaterProgram.createShader(NULL, NULL); + success = gObjectAlphaMaskNoColorWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2195,7 +2195,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gTreeProgram.mShaderFiles.push_back(std::make_pair("objects/treeV.glsl", GL_VERTEX_SHADER)); gTreeProgram.mShaderFiles.push_back(std::make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gTreeProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gTreeProgram.createShader(NULL, NULL); + success = gTreeProgram.createShader(nullptr, nullptr); } if (success) @@ -2213,7 +2213,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gTreeWaterProgram.mShaderFiles.push_back(std::make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gTreeWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gTreeWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gTreeWaterProgram.createShader(NULL, NULL); + success = gTreeWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2228,7 +2228,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightNonIndexedProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER)); gObjectFullbrightNonIndexedProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectFullbrightNonIndexedProgram.createShader(NULL, NULL); + success = gObjectFullbrightNonIndexedProgram.createShader(nullptr, nullptr); } if (success) @@ -2244,7 +2244,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightNonIndexedWaterProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectFullbrightNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectFullbrightNonIndexedWaterProgram.createShader(NULL, NULL); + success = gObjectFullbrightNonIndexedWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2259,7 +2259,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectEmissiveNonIndexedProgram.mShaderFiles.push_back(std::make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER)); gObjectEmissiveNonIndexedProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gObjectEmissiveNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectEmissiveNonIndexedProgram.createShader(NULL, NULL); + success = gObjectEmissiveNonIndexedProgram.createShader(nullptr, nullptr); } if (success) @@ -2275,7 +2275,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectEmissiveNonIndexedWaterProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectEmissiveNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectEmissiveNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectEmissiveNonIndexedWaterProgram.createShader(NULL, NULL); + success = gObjectEmissiveNonIndexedWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2290,7 +2290,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightNoColorProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightNoColorV.glsl", GL_VERTEX_SHADER)); gObjectFullbrightNoColorProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightNoColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectFullbrightNoColorProgram.createShader(NULL, NULL); + success = gObjectFullbrightNoColorProgram.createShader(nullptr, nullptr); } if (success) @@ -2306,7 +2306,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightNoColorWaterProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightNoColorWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectFullbrightNoColorWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectFullbrightNoColorWaterProgram.createShader(NULL, NULL); + success = gObjectFullbrightNoColorWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2322,7 +2322,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectShinyNonIndexedProgram.mShaderFiles.push_back(std::make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER)); gObjectShinyNonIndexedProgram.mShaderFiles.push_back(std::make_pair("objects/shinyF.glsl", GL_FRAGMENT_SHADER)); gObjectShinyNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectShinyNonIndexedProgram.createShader(NULL, NULL); + success = gObjectShinyNonIndexedProgram.createShader(nullptr, nullptr); } if (success) @@ -2339,7 +2339,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectShinyNonIndexedWaterProgram.mShaderFiles.push_back(std::make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER)); gObjectShinyNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectShinyNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectShinyNonIndexedWaterProgram.createShader(NULL, NULL); + success = gObjectShinyNonIndexedWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2355,7 +2355,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyNonIndexedProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightShinyV.glsl", GL_VERTEX_SHADER)); gObjectFullbrightShinyNonIndexedProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightShinyNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectFullbrightShinyNonIndexedProgram.createShader(NULL, NULL); + success = gObjectFullbrightShinyNonIndexedProgram.createShader(nullptr, nullptr); } if (success) @@ -2373,7 +2373,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyNonIndexedWaterProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightShinyWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightShinyNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectFullbrightShinyNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectFullbrightShinyNonIndexedWaterProgram.createShader(NULL, NULL); + success = gObjectFullbrightShinyNonIndexedWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2384,7 +2384,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gImpostorProgram.mShaderFiles.push_back(std::make_pair("objects/impostorV.glsl", GL_VERTEX_SHADER)); gImpostorProgram.mShaderFiles.push_back(std::make_pair("objects/impostorF.glsl", GL_FRAGMENT_SHADER)); gImpostorProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gImpostorProgram.createShader(NULL, NULL); + success = gImpostorProgram.createShader(nullptr, nullptr); } if (success) @@ -2401,7 +2401,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectPreviewProgram.mShaderFiles.push_back(std::make_pair("objects/previewV.glsl", GL_VERTEX_SHADER)); gObjectPreviewProgram.mShaderFiles.push_back(std::make_pair("objects/previewF.glsl", GL_FRAGMENT_SHADER)); gObjectPreviewProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectPreviewProgram.createShader(NULL, NULL); + success = gObjectPreviewProgram.createShader(nullptr, nullptr); gObjectPreviewProgram.mFeatures.hasLighting = true; } @@ -2418,7 +2418,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleProgram.mShaderFiles.push_back(std::make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); gObjectSimpleProgram.mShaderFiles.push_back(std::make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectSimpleProgram.createShader(NULL, NULL); + success = gObjectSimpleProgram.createShader(nullptr, nullptr); } if (success) @@ -2439,7 +2439,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleImpostorProgram.mShaderFiles.push_back(std::make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleImpostorProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectSimpleImpostorProgram.createShader(NULL, NULL); + success = gObjectSimpleImpostorProgram.createShader(nullptr, nullptr); } if (success) @@ -2456,7 +2456,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleWaterProgram.mShaderFiles.push_back(std::make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectSimpleWaterProgram.createShader(NULL, NULL); + success = gObjectSimpleWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2472,7 +2472,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectBumpProgram.mShaderFiles.push_back(std::make_pair("objects/bumpV.glsl", GL_VERTEX_SHADER)); gObjectBumpProgram.mShaderFiles.push_back(std::make_pair("objects/bumpF.glsl", GL_FRAGMENT_SHADER)); gObjectBumpProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectBumpProgram.createShader(NULL, NULL); + success = gObjectBumpProgram.createShader(nullptr, nullptr); if (success) { //lldrawpoolbump assumes "texture0" has channel 0 and "texture1" has channel 1 gObjectBumpProgram.bind(); @@ -2497,7 +2497,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectSimpleAlphaMaskProgram.createShader(NULL, NULL); + success = gObjectSimpleAlphaMaskProgram.createShader(nullptr, nullptr); } if (success) @@ -2515,7 +2515,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleWaterAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleWaterAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectSimpleWaterAlphaMaskProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectSimpleWaterAlphaMaskProgram.createShader(NULL, NULL); + success = gObjectSimpleWaterAlphaMaskProgram.createShader(nullptr, nullptr); } if (success) @@ -2530,7 +2530,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER)); gObjectFullbrightProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectFullbrightProgram.createShader(NULL, NULL); + success = gObjectFullbrightProgram.createShader(nullptr, nullptr); } if (success) @@ -2546,7 +2546,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightWaterProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectFullbrightWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectFullbrightWaterProgram.createShader(NULL, NULL); + success = gObjectFullbrightWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2561,7 +2561,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectEmissiveProgram.mShaderFiles.push_back(std::make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER)); gObjectEmissiveProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gObjectEmissiveProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectEmissiveProgram.createShader(NULL, NULL); + success = gObjectEmissiveProgram.createShader(nullptr, nullptr); } if (success) @@ -2577,7 +2577,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectEmissiveWaterProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectEmissiveWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectEmissiveWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectEmissiveWaterProgram.createShader(NULL, NULL); + success = gObjectEmissiveWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2593,7 +2593,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER)); gObjectFullbrightAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectFullbrightAlphaMaskProgram.createShader(NULL, NULL); + success = gObjectFullbrightAlphaMaskProgram.createShader(nullptr, nullptr); } if (success) @@ -2610,7 +2610,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightWaterAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightWaterAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectFullbrightWaterAlphaMaskProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectFullbrightWaterAlphaMaskProgram.createShader(NULL, NULL); + success = gObjectFullbrightWaterAlphaMaskProgram.createShader(nullptr, nullptr); } if (success) @@ -2626,7 +2626,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectShinyProgram.mShaderFiles.push_back(std::make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER)); gObjectShinyProgram.mShaderFiles.push_back(std::make_pair("objects/shinyF.glsl", GL_FRAGMENT_SHADER)); gObjectShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectShinyProgram.createShader(NULL, NULL); + success = gObjectShinyProgram.createShader(nullptr, nullptr); } if (success) @@ -2643,7 +2643,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectShinyWaterProgram.mShaderFiles.push_back(std::make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER)); gObjectShinyWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectShinyWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectShinyWaterProgram.createShader(NULL, NULL); + success = gObjectShinyWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2659,7 +2659,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightShinyV.glsl", GL_VERTEX_SHADER)); gObjectFullbrightShinyProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectFullbrightShinyProgram.createShader(NULL, NULL); + success = gObjectFullbrightShinyProgram.createShader(nullptr, nullptr); } if (success) @@ -2677,7 +2677,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightShinyWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightShinyWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectFullbrightShinyWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectFullbrightShinyWaterProgram.createShader(NULL, NULL); + success = gObjectFullbrightShinyWaterProgram.createShader(nullptr, nullptr); } if (mVertexShaderLevel[SHADER_AVATAR] > 0) @@ -2697,7 +2697,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectSimpleProgram.mShaderFiles.push_back(std::make_pair("objects/simpleSkinnedV.glsl", GL_VERTEX_SHADER)); gSkinnedObjectSimpleProgram.mShaderFiles.push_back(std::make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gSkinnedObjectSimpleProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectSimpleProgram.createShader(NULL, NULL); + success = gSkinnedObjectSimpleProgram.createShader(nullptr, nullptr); } if (success) @@ -2714,7 +2714,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectFullbrightProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightSkinnedV.glsl", GL_VERTEX_SHADER)); gSkinnedObjectFullbrightProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gSkinnedObjectFullbrightProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectFullbrightProgram.createShader(NULL, NULL); + success = gSkinnedObjectFullbrightProgram.createShader(nullptr, nullptr); } if (success) @@ -2730,7 +2730,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectEmissiveProgram.mShaderFiles.push_back(std::make_pair("objects/emissiveSkinnedV.glsl", GL_VERTEX_SHADER)); gSkinnedObjectEmissiveProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gSkinnedObjectEmissiveProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectEmissiveProgram.createShader(NULL, NULL); + success = gSkinnedObjectEmissiveProgram.createShader(nullptr, nullptr); } if (success) @@ -2747,7 +2747,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectEmissiveWaterProgram.mShaderFiles.push_back(std::make_pair("objects/emissiveSkinnedV.glsl", GL_VERTEX_SHADER)); gSkinnedObjectEmissiveWaterProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); gSkinnedObjectEmissiveWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectEmissiveWaterProgram.createShader(NULL, NULL); + success = gSkinnedObjectEmissiveWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2765,7 +2765,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectFullbrightShinyProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightShinySkinnedV.glsl", GL_VERTEX_SHADER)); gSkinnedObjectFullbrightShinyProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER)); gSkinnedObjectFullbrightShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectFullbrightShinyProgram.createShader(NULL, NULL); + success = gSkinnedObjectFullbrightShinyProgram.createShader(nullptr, nullptr); } if (success) @@ -2783,7 +2783,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectShinySimpleProgram.mShaderFiles.push_back(std::make_pair("objects/shinySimpleSkinnedV.glsl", GL_VERTEX_SHADER)); gSkinnedObjectShinySimpleProgram.mShaderFiles.push_back(std::make_pair("objects/shinyF.glsl", GL_FRAGMENT_SHADER)); gSkinnedObjectShinySimpleProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectShinySimpleProgram.createShader(NULL, NULL); + success = gSkinnedObjectShinySimpleProgram.createShader(nullptr, nullptr); } if (success) @@ -2803,7 +2803,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectSimpleWaterProgram.mShaderFiles.push_back(std::make_pair("objects/simpleSkinnedV.glsl", GL_VERTEX_SHADER)); gSkinnedObjectSimpleWaterProgram.mShaderFiles.push_back(std::make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gSkinnedObjectSimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectSimpleWaterProgram.createShader(NULL, NULL); + success = gSkinnedObjectSimpleWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2822,7 +2822,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectFullbrightWaterProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightSkinnedV.glsl", GL_VERTEX_SHADER)); gSkinnedObjectFullbrightWaterProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); gSkinnedObjectFullbrightWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectFullbrightWaterProgram.createShader(NULL, NULL); + success = gSkinnedObjectFullbrightWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2842,7 +2842,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightShinySkinnedV.glsl", GL_VERTEX_SHADER)); gSkinnedObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(std::make_pair("objects/fullbrightShinyWaterF.glsl", GL_FRAGMENT_SHADER)); gSkinnedObjectFullbrightShinyWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectFullbrightShinyWaterProgram.createShader(NULL, NULL); + success = gSkinnedObjectFullbrightShinyWaterProgram.createShader(nullptr, nullptr); } if (success) @@ -2862,7 +2862,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectShinySimpleWaterProgram.mShaderFiles.push_back(std::make_pair("objects/shinySimpleSkinnedV.glsl", GL_VERTEX_SHADER)); gSkinnedObjectShinySimpleWaterProgram.mShaderFiles.push_back(std::make_pair("objects/shinyWaterF.glsl", GL_FRAGMENT_SHADER)); gSkinnedObjectShinySimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectShinySimpleWaterProgram.createShader(NULL, NULL); + success = gSkinnedObjectShinySimpleWaterProgram.createShader(nullptr, nullptr); } } @@ -2902,7 +2902,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarProgram.mShaderFiles.push_back(std::make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER)); gAvatarProgram.mShaderFiles.push_back(std::make_pair("avatar/avatarF.glsl", GL_FRAGMENT_SHADER)); gAvatarProgram.mShaderLevel = mVertexShaderLevel[SHADER_AVATAR]; - success = gAvatarProgram.createShader(NULL, NULL); + success = gAvatarProgram.createShader(nullptr, nullptr); if (success) { @@ -2921,7 +2921,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() // Note: no cloth under water: gAvatarWaterProgram.mShaderLevel = llmin(mVertexShaderLevel[SHADER_AVATAR], 1); gAvatarWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gAvatarWaterProgram.createShader(NULL, NULL); + success = gAvatarWaterProgram.createShader(nullptr, nullptr); } /// Keep track of avatar levels @@ -2940,7 +2940,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarPickProgram.mShaderFiles.push_back(std::make_pair("avatar/pickAvatarV.glsl", GL_VERTEX_SHADER)); gAvatarPickProgram.mShaderFiles.push_back(std::make_pair("avatar/pickAvatarF.glsl", GL_FRAGMENT_SHADER)); gAvatarPickProgram.mShaderLevel = mVertexShaderLevel[SHADER_AVATAR]; - success = gAvatarPickProgram.createShader(NULL, NULL); + success = gAvatarPickProgram.createShader(nullptr, nullptr); } if( !success ) @@ -2970,7 +2970,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gHighlightProgram.mShaderFiles.push_back(std::make_pair("interface/highlightV.glsl", GL_VERTEX_SHADER)); gHighlightProgram.mShaderFiles.push_back(std::make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER)); gHighlightProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gHighlightProgram.createShader(NULL, NULL); + success = gHighlightProgram.createShader(nullptr, nullptr); } if (success) @@ -2980,7 +2980,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gHighlightNormalProgram.mShaderFiles.push_back(std::make_pair("interface/highlightNormV.glsl", GL_VERTEX_SHADER)); gHighlightNormalProgram.mShaderFiles.push_back(std::make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER)); gHighlightNormalProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gHighlightNormalProgram.createShader(NULL, NULL); + success = gHighlightNormalProgram.createShader(nullptr, nullptr); } if (success) @@ -2990,7 +2990,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gHighlightSpecularProgram.mShaderFiles.push_back(std::make_pair("interface/highlightSpecV.glsl", GL_VERTEX_SHADER)); gHighlightSpecularProgram.mShaderFiles.push_back(std::make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER)); gHighlightSpecularProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gHighlightSpecularProgram.createShader(NULL, NULL); + success = gHighlightSpecularProgram.createShader(nullptr, nullptr); } if (success) @@ -3000,7 +3000,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gUIProgram.mShaderFiles.push_back(std::make_pair("interface/uiV.glsl", GL_VERTEX_SHADER)); gUIProgram.mShaderFiles.push_back(std::make_pair("interface/uiF.glsl", GL_FRAGMENT_SHADER)); gUIProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gUIProgram.createShader(NULL, NULL); + success = gUIProgram.createShader(nullptr, nullptr); } if (success) @@ -3010,7 +3010,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gCustomAlphaProgram.mShaderFiles.push_back(std::make_pair("interface/customalphaV.glsl", GL_VERTEX_SHADER)); gCustomAlphaProgram.mShaderFiles.push_back(std::make_pair("interface/customalphaF.glsl", GL_FRAGMENT_SHADER)); gCustomAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gCustomAlphaProgram.createShader(NULL, NULL); + success = gCustomAlphaProgram.createShader(nullptr, nullptr); } if (success) @@ -3020,7 +3020,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gSplatTextureRectProgram.mShaderFiles.push_back(std::make_pair("interface/splattexturerectV.glsl", GL_VERTEX_SHADER)); gSplatTextureRectProgram.mShaderFiles.push_back(std::make_pair("interface/splattexturerectF.glsl", GL_FRAGMENT_SHADER)); gSplatTextureRectProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gSplatTextureRectProgram.createShader(NULL, NULL); + success = gSplatTextureRectProgram.createShader(nullptr, nullptr); if (success) { gSplatTextureRectProgram.bind(); @@ -3036,7 +3036,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gGlowCombineProgram.mShaderFiles.push_back(std::make_pair("interface/glowcombineV.glsl", GL_VERTEX_SHADER)); gGlowCombineProgram.mShaderFiles.push_back(std::make_pair("interface/glowcombineF.glsl", GL_FRAGMENT_SHADER)); gGlowCombineProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gGlowCombineProgram.createShader(NULL, NULL); + success = gGlowCombineProgram.createShader(nullptr, nullptr); if (success) { gGlowCombineProgram.bind(); @@ -3053,7 +3053,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gGlowCombineFXAAProgram.mShaderFiles.push_back(std::make_pair("interface/glowcombineFXAAV.glsl", GL_VERTEX_SHADER)); gGlowCombineFXAAProgram.mShaderFiles.push_back(std::make_pair("interface/glowcombineFXAAF.glsl", GL_FRAGMENT_SHADER)); gGlowCombineFXAAProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gGlowCombineFXAAProgram.createShader(NULL, NULL); + success = gGlowCombineFXAAProgram.createShader(nullptr, nullptr); if (success) { gGlowCombineFXAAProgram.bind(); @@ -3071,7 +3071,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gTwoTextureAddProgram.mShaderFiles.push_back(std::make_pair("interface/twotextureaddV.glsl", GL_VERTEX_SHADER)); gTwoTextureAddProgram.mShaderFiles.push_back(std::make_pair("interface/twotextureaddF.glsl", GL_FRAGMENT_SHADER)); gTwoTextureAddProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gTwoTextureAddProgram.createShader(NULL, NULL); + success = gTwoTextureAddProgram.createShader(nullptr, nullptr); if (success) { gTwoTextureAddProgram.bind(); @@ -3088,7 +3088,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gTwoTextureCompareProgram.mShaderFiles.push_back(std::make_pair("interface/twotexturecompareV.glsl", GL_VERTEX_SHADER)); gTwoTextureCompareProgram.mShaderFiles.push_back(std::make_pair("interface/twotexturecompareF.glsl", GL_FRAGMENT_SHADER)); gTwoTextureCompareProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gTwoTextureCompareProgram.createShader(NULL, NULL); + success = gTwoTextureCompareProgram.createShader(nullptr, nullptr); if (success) { gTwoTextureCompareProgram.bind(); @@ -3105,7 +3105,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gOneTextureFilterProgram.mShaderFiles.push_back(std::make_pair("interface/onetexturefilterV.glsl", GL_VERTEX_SHADER)); gOneTextureFilterProgram.mShaderFiles.push_back(std::make_pair("interface/onetexturefilterF.glsl", GL_FRAGMENT_SHADER)); gOneTextureFilterProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gOneTextureFilterProgram.createShader(NULL, NULL); + success = gOneTextureFilterProgram.createShader(nullptr, nullptr); if (success) { gOneTextureFilterProgram.bind(); @@ -3121,7 +3121,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gOneTextureNoColorProgram.mShaderFiles.push_back(std::make_pair("interface/onetexturenocolorV.glsl", GL_VERTEX_SHADER)); gOneTextureNoColorProgram.mShaderFiles.push_back(std::make_pair("interface/onetexturenocolorF.glsl", GL_FRAGMENT_SHADER)); gOneTextureNoColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gOneTextureNoColorProgram.createShader(NULL, NULL); + success = gOneTextureNoColorProgram.createShader(nullptr, nullptr); if (success) { gOneTextureNoColorProgram.bind(); @@ -3136,7 +3136,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gSolidColorProgram.mShaderFiles.push_back(std::make_pair("interface/solidcolorV.glsl", GL_VERTEX_SHADER)); gSolidColorProgram.mShaderFiles.push_back(std::make_pair("interface/solidcolorF.glsl", GL_FRAGMENT_SHADER)); gSolidColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gSolidColorProgram.createShader(NULL, NULL); + success = gSolidColorProgram.createShader(nullptr, nullptr); if (success) { gSolidColorProgram.bind(); @@ -3152,7 +3152,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gOcclusionProgram.mShaderFiles.push_back(std::make_pair("interface/occlusionV.glsl", GL_VERTEX_SHADER)); gOcclusionProgram.mShaderFiles.push_back(std::make_pair("interface/occlusionF.glsl", GL_FRAGMENT_SHADER)); gOcclusionProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gOcclusionProgram.createShader(NULL, NULL); + success = gOcclusionProgram.createShader(nullptr, nullptr); } if (success) @@ -3162,7 +3162,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gOcclusionCubeProgram.mShaderFiles.push_back(std::make_pair("interface/occlusionCubeV.glsl", GL_VERTEX_SHADER)); gOcclusionCubeProgram.mShaderFiles.push_back(std::make_pair("interface/occlusionF.glsl", GL_FRAGMENT_SHADER)); gOcclusionCubeProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gOcclusionCubeProgram.createShader(NULL, NULL); + success = gOcclusionCubeProgram.createShader(nullptr, nullptr); } if (success) @@ -3172,7 +3172,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gDebugProgram.mShaderFiles.push_back(std::make_pair("interface/debugV.glsl", GL_VERTEX_SHADER)); gDebugProgram.mShaderFiles.push_back(std::make_pair("interface/debugF.glsl", GL_FRAGMENT_SHADER)); gDebugProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gDebugProgram.createShader(NULL, NULL); + success = gDebugProgram.createShader(nullptr, nullptr); } if (success) @@ -3182,7 +3182,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gClipProgram.mShaderFiles.push_back(std::make_pair("interface/clipV.glsl", GL_VERTEX_SHADER)); gClipProgram.mShaderFiles.push_back(std::make_pair("interface/clipF.glsl", GL_FRAGMENT_SHADER)); gClipProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gClipProgram.createShader(NULL, NULL); + success = gClipProgram.createShader(nullptr, nullptr); } if (success) @@ -3192,7 +3192,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gDownsampleDepthProgram.mShaderFiles.push_back(std::make_pair("interface/downsampleDepthV.glsl", GL_VERTEX_SHADER)); gDownsampleDepthProgram.mShaderFiles.push_back(std::make_pair("interface/downsampleDepthF.glsl", GL_FRAGMENT_SHADER)); gDownsampleDepthProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gDownsampleDepthProgram.createShader(NULL, NULL); + success = gDownsampleDepthProgram.createShader(nullptr, nullptr); } if (success) @@ -3202,7 +3202,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkV.glsl", GL_VERTEX_SHADER)); gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkF.glsl", GL_FRAGMENT_SHADER)); gBenchmarkProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gBenchmarkProgram.createShader(NULL, NULL); + success = gBenchmarkProgram.createShader(nullptr, nullptr); } if (success) @@ -3212,7 +3212,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("interface/alphamaskV.glsl", GL_VERTEX_SHADER)); gAlphaMaskProgram.mShaderFiles.push_back(std::make_pair("interface/alphamaskF.glsl", GL_FRAGMENT_SHADER)); gAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gAlphaMaskProgram.createShader(NULL, NULL); + success = gAlphaMaskProgram.createShader(nullptr, nullptr); } if( !success ) @@ -3244,7 +3244,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() gWLSkyProgram.mShaderFiles.push_back(std::make_pair("windlight/skyF.glsl", GL_FRAGMENT_SHADER)); gWLSkyProgram.mShaderLevel = mVertexShaderLevel[SHADER_WINDLIGHT]; gWLSkyProgram.mShaderGroup = LLGLSLShader::SG_SKY; - success = gWLSkyProgram.createShader(NULL, NULL); + success = gWLSkyProgram.createShader(nullptr, nullptr); } if (success) @@ -3256,7 +3256,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() gWLCloudProgram.mShaderFiles.push_back(std::make_pair("windlight/cloudsF.glsl", GL_FRAGMENT_SHADER)); gWLCloudProgram.mShaderLevel = mVertexShaderLevel[SHADER_WINDLIGHT]; gWLCloudProgram.mShaderGroup = LLGLSLShader::SG_SKY; - success = gWLCloudProgram.createShader(NULL, NULL); + success = gWLCloudProgram.createShader(nullptr, nullptr); } return success; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 03ac4d21476ff705ce8e3d54e09aeac21166d00a..e17d54f1362e09736bfc9dabf637f0c5543c3ae6 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -45,7 +45,7 @@ public: static LLViewerShaderMgr * instance(); static void releaseInstance(); - void initAttribsAndUniforms(void); + void initAttribsAndUniforms(void) override; void setShaders(); void unloadShaders(); S32 getVertexShaderLevel(S32 type); @@ -122,9 +122,9 @@ public: shader_iter beginShaders() const; shader_iter endShaders() const; - /* virtual */ std::string getShaderDirPrefix(void); + /* virtual */ std::string getShaderDirPrefix(void) override; - /* virtual */ void updateShaderUniforms(LLGLSLShader * shader); + /* virtual */ void updateShaderUniforms(LLGLSLShader * shader) override; private: diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 97a060d95e401102b79c8281e891a065b47201c1..ede0d0cd153fdd2fa1d4287902f71dcd9da7e926 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -107,7 +107,7 @@ struct SimMeasurement : public LLTrace::SampleStatHandle<T>, public SimMeasureme // LLTrace::sample(static_cast<LLTrace::SampleStatHandle<T>& >(measurement), value); //} - /*virtual*/ void sample(F64 value) + /*virtual*/ void sample(F64 value) override { LLTrace::sample(static_cast<LLTrace::SampleStatHandle<T>& >(*this), value); //LLStatViewer::sample(*this, value); diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp index eec9f049411d0fddace12a2ca258dc6dfb960b95..283c9992cbac4d3e85fb2bfebddcc55c86e9f988 100644 --- a/indra/newview/llviewerstatsrecorder.cpp +++ b/indra/newview/llviewerstatsrecorder.cpp @@ -42,14 +42,14 @@ static const std::string STATS_FILE_NAME("/tmp/viewerstats.csv"); #endif -LLViewerStatsRecorder* LLViewerStatsRecorder::sInstance = NULL; +LLViewerStatsRecorder* LLViewerStatsRecorder::sInstance = nullptr; LLViewerStatsRecorder::LLViewerStatsRecorder() : - mObjectCacheFile(NULL), + mObjectCacheFile(nullptr), mTimer(), mStartTime(0.0), mLastSnapshotTime(0.0) { - if (NULL != sInstance) + if (nullptr != sInstance) { LL_ERRS() << "Attempted to create multiple instances of LLViewerStatsRecorder!" << LL_ENDL; } @@ -59,12 +59,12 @@ LLViewerStatsRecorder::LLViewerStatsRecorder() : LLViewerStatsRecorder::~LLViewerStatsRecorder() { - if (mObjectCacheFile != NULL) + if (mObjectCacheFile != nullptr) { // last chance snapshot writeToLog(0.f); LLFile::close(mObjectCacheFile); - mObjectCacheFile = NULL; + mObjectCacheFile = nullptr; } } @@ -190,7 +190,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << mObjectUpdateFailures << " update failures" << LL_ENDL; - if (mObjectCacheFile == NULL) + if (mObjectCacheFile == nullptr) { mStartTime = LLTimer::getTotalSeconds(); mObjectCacheFile = LLFile::fopen(STATS_FILE_NAME, "wb"); diff --git a/indra/newview/llviewertexlayer.h b/indra/newview/llviewertexlayer.h index 0de6bbe389ef769acf2ed308f4bfc9d3e42b2ae6..ec23d4362d581c0956bed8831364bea379e44506 100644 --- a/indra/newview/llviewertexlayer.h +++ b/indra/newview/llviewertexlayer.h @@ -46,13 +46,13 @@ public: LLViewerTexLayerSet(LLAvatarAppearance* const appearance); virtual ~LLViewerTexLayerSet(); - /*virtual*/void requestUpdate(); + /*virtual*/void requestUpdate() override; void requestUpload(); void cancelUpload(); BOOL isLocalTextureDataAvailable() const; BOOL isLocalTextureDataFinal() const; void updateComposite(); - /*virtual*/void createComposite(); + /*virtual*/void createComposite() override; void setUpdatesEnabled(BOOL b); BOOL getUpdatesEnabled() const { return mUpdatesEnabled; } @@ -80,12 +80,12 @@ public: virtual ~LLViewerTexLayerSetBuffer(); public: - /*virtual*/ S8 getType() const; + /*virtual*/ S8 getType() const override; BOOL isInitialized(void) const; static void dumpTotalByteCount(); const std::string dumpTextureInfo() const; - virtual void restoreGLTexture(); - virtual void destroyGLTexture(); + void restoreGLTexture() override; + void destroyGLTexture() override; private: LLViewerTexLayerSet* getViewerTexLayerSet() { return dynamic_cast<LLViewerTexLayerSet*> (mTexLayerSet); } @@ -96,24 +96,24 @@ private: //-------------------------------------------------------------------- // Tex Layer Render //-------------------------------------------------------------------- - virtual void preRenderTexLayerSet(); - virtual void midRenderTexLayerSet(BOOL success); - virtual void postRenderTexLayerSet(BOOL success); - virtual S32 getCompositeOriginX() const { return getOriginX(); } - virtual S32 getCompositeOriginY() const { return getOriginY(); } - virtual S32 getCompositeWidth() const { return getFullWidth(); } - virtual S32 getCompositeHeight() const { return getFullHeight(); } + void preRenderTexLayerSet() override; + void midRenderTexLayerSet(BOOL success) override; + void postRenderTexLayerSet(BOOL success) override; + S32 getCompositeOriginX() const override { return getOriginX(); } + S32 getCompositeOriginY() const override { return getOriginY(); } + S32 getCompositeWidth() const override { return getFullWidth(); } + S32 getCompositeHeight() const override { return getFullHeight(); } //-------------------------------------------------------------------- // Dynamic Texture Interface //-------------------------------------------------------------------- public: - /*virtual*/ BOOL needsRender(); + /*virtual*/ BOOL needsRender() override; protected: // Pass these along for tex layer rendering. - virtual void preRender(BOOL clear_depth) { preRenderTexLayerSet(); } - virtual void postRender(BOOL success) { postRenderTexLayerSet(success); } - virtual BOOL render() { return renderTexLayerSet(); } + void preRender(BOOL clear_depth) override { preRenderTexLayerSet(); } + void postRender(BOOL success) override { postRenderTexLayerSet(success); } + BOOL render() override { return renderTexLayerSet(); } //-------------------------------------------------------------------- diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index 33cfca4f902a6888d9264a81f54fd7845558dc31..d1eeab01e109b89df61d0906a045f636f2c0e906 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -45,25 +45,25 @@ protected: public: virtual ~LLViewerTextEditor(); - virtual void makePristine(); + void makePristine() override; - /*virtual*/ void onVisibilityChange( BOOL new_visibility ); + /*virtual*/ void onVisibilityChange( BOOL new_visibility ) override; // mousehandler overrides - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask ); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick(S32 x, S32 y, MASK mask ) override; - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, - void *cargo_data, EAcceptance *accept, std::string& tooltip_msg); + void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) override; const class LLInventoryItem* getDragItem() const { return mDragItem; } - virtual BOOL importBuffer(const char* buffer, S32 length); + BOOL importBuffer(const char* buffer, S32 length) override; virtual bool importStream(std::istream& str); - virtual BOOL exportBuffer(std::string& buffer); - virtual void onValueChange(S32 start, S32 end); + BOOL exportBuffer(std::string& buffer) override; + void onValueChange(S32 start, S32 end) override; void setNotecardInfo(const LLUUID& notecard_item_id, const LLUUID& object_id, const LLUUID& preview_id) { @@ -92,7 +92,7 @@ public: private: // Embedded object operations void findEmbeddedItemSegments(S32 start, S32 end); - virtual llwchar pasteEmbeddedItem(llwchar ext_char); + llwchar pasteEmbeddedItem(llwchar ext_char) override; BOOL openEmbeddedItemAtPos( S32 pos ); BOOL openEmbeddedItem(LLPointer<LLInventoryItem> item, llwchar wc); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 2d139197640c47e0b3a7c86a1474d27f7d300f6a..968e1ca916aa11cbf1061af17df42cb01c953b2f 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -117,16 +117,16 @@ public: LLViewerTexture(const LLImageRaw* raw, BOOL usemipmaps) ; LLViewerTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps) ; - virtual S8 getType() const; + S8 getType() const override; virtual BOOL isMissingAsset() const ; - virtual void dump(); // debug info to LL_INFOS() + void dump() override; // debug info to LL_INFOS() - /*virtual*/ bool bindDefaultImage(const S32 stage = 0) ; - /*virtual*/ bool bindDebugImage(const S32 stage = 0) ; - /*virtual*/ void forceImmediateUpdate() ; - /*virtual*/ bool isActiveFetching(); + /*virtual*/ bool bindDefaultImage(const S32 stage = 0) override; + /*virtual*/ bool bindDebugImage(const S32 stage = 0) override; + /*virtual*/ void forceImmediateUpdate() override; + /*virtual*/ bool isActiveFetching() override; - /*virtual*/ const LLUUID& getID() const { return mID; } + /*virtual*/ const LLUUID& getID() const override { return mID; } void setBoostLevel(S32 level); S32 getBoostLevel() { return mBoostLevel; } void setTextureListType(S32 tex_type) { mTextureListType = tex_type; } @@ -144,7 +144,7 @@ public: S32 getFullWidth() const { return mFullWidth; } S32 getFullHeight() const { return mFullHeight; } - /*virtual*/ void setKnownDrawSize(S32 width, S32 height); + /*virtual*/ void setKnownDrawSize(S32 width, S32 height) override; virtual void addFace(U32 channel, LLFace* facep) ; virtual void removeFace(U32 channel, LLFace* facep) ; @@ -162,10 +162,10 @@ public: BOOL isLargeImage() ; void setParcelMedia(LLViewerMediaTexture* media) {mParcelMedia = media;} - BOOL hasParcelMedia() const { return mParcelMedia != NULL;} + BOOL hasParcelMedia() const { return mParcelMedia != nullptr;} LLViewerMediaTexture* getParcelMedia() const { return mParcelMedia;} - /*virtual*/ void updateBindStatsForTester() ; + /*virtual*/ void updateBindStatsForTester() override; protected: void cleanup() ; void init(bool firstinit) ; @@ -299,10 +299,10 @@ public: }; public: - /*virtual*/ S8 getType() const ; + /*virtual*/ S8 getType() const override; FTType getFTType() const; - /*virtual*/ void forceImmediateUpdate() ; - /*virtual*/ void dump() ; + /*virtual*/ void forceImmediateUpdate() override; + /*virtual*/ void dump() override; // Set callbacks to get called when the image gets updated with higher // resolution versions. @@ -358,10 +358,10 @@ public: // Override the computation of discard levels if we know the exact output // size of the image. Used for UI textures to not decode, even if we have // more data. - /*virtual*/ void setKnownDrawSize(S32 width, S32 height); + /*virtual*/ void setKnownDrawSize(S32 width, S32 height) override; void setIsMissingAsset(BOOL is_missing = true); - /*virtual*/ BOOL isMissingAsset() const { return mIsMissingAsset; } + /*virtual*/ BOOL isMissingAsset() const override { return mIsMissingAsset; } // returns dimensions of original image for local files (before power of two scaling) // and returns 0 for all asset system images @@ -404,7 +404,7 @@ public: BOOL isRawImageValid()const { return mIsRawImageValid ; } void forceToSaveRawImage(S32 desired_discard = 0, F32 kept_time = 0.f) ; void forceToRefetchTexture(S32 desired_discard = 0, F32 kept_time = 60.f); - /*virtual*/ void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ; + /*virtual*/ void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) override; void destroySavedRawImage() ; LLImageRaw* getSavedRawImage() ; BOOL hasSavedRawImage() const ; @@ -419,14 +419,14 @@ public: void setInFastCacheList(bool in_list) { mInFastCacheList = in_list; } bool isInFastCacheList() { return mInFastCacheList; } - /*virtual*/bool isActiveFetching(); //is actively in fetching by the fetching pipeline. + /*virtual*/bool isActiveFetching() override; //is actively in fetching by the fetching pipeline. LLUUID getUploader(); LLDate getUploadTime(); std::string getComment(); protected: - /*virtual*/ void switchToCachedImage(); + /*virtual*/ void switchToCachedImage() override; S32 getCurrentDiscardLevelForFetching() ; private: @@ -543,9 +543,9 @@ public: LLViewerLODTexture(const LLUUID& id, FTType f_type, const LLHost& host = LLHost(), BOOL usemipmaps = TRUE); LLViewerLODTexture(const std::string& url, FTType f_type, const LLUUID& id, BOOL usemipmaps = TRUE); - /*virtual*/ S8 getType() const; + /*virtual*/ S8 getType() const override; // Process image stats to determine priority/quality requirements. - /*virtual*/ void processTextureStats(); + /*virtual*/ void processTextureStats() override; BOOL isUpdateFrozen() ; private: @@ -567,9 +567,9 @@ protected: /*virtual*/ ~LLViewerMediaTexture() ; public: - LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = NULL) ; + LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = nullptr) ; - /*virtual*/ S8 getType() const; + /*virtual*/ S8 getType() const override; void reinit(BOOL usemipmaps = TRUE); BOOL getUseMipMaps() {return mUseMipMaps ; } @@ -585,10 +585,10 @@ public: void addMediaToFace(LLFace* facep) ; void removeMediaFromFace(LLFace* facep) ; - /*virtual*/ void addFace(U32 ch, LLFace* facep) ; - /*virtual*/ void removeFace(U32 ch, LLFace* facep) ; + /*virtual*/ void addFace(U32 ch, LLFace* facep) override; + /*virtual*/ void removeFace(U32 ch, LLFace* facep) override; - /*virtual*/ F32 getMaxVirtualSize() ; + /*virtual*/ F32 getMaxVirtualSize() override; private: void switchTexture(U32 ch, LLFace* facep) ; BOOL findFaces() ; @@ -643,12 +643,12 @@ public: static LLViewerFetchedTexture* findFetchedTexture(const LLUUID& id, S32 tex_type); static LLViewerMediaTexture* findMediaTexture(const LLUUID& id) ; - static LLViewerMediaTexture* createMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = NULL) ; + static LLViewerMediaTexture* createMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = nullptr) ; // //"get-texture" will create a new texture if the texture does not exist. // - static LLViewerMediaTexture* getMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = NULL) ; + static LLViewerMediaTexture* getMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = nullptr) ; static LLPointer<LLViewerTexture> getLocalTexture(BOOL usemipmaps = TRUE, BOOL generate_gl_tex = TRUE); static LLPointer<LLViewerTexture> getLocalTexture(const LLUUID& id, BOOL usemipmaps, BOOL generate_gl_tex = TRUE) ; @@ -715,7 +715,7 @@ private: void reset() ; void updateStablizingTime() ; - /*virtual*/ void outputTestRecord(LLSD* sd) ; + /*virtual*/ void outputTestRecord(LLSD* sd) override; private: BOOL mPause ; @@ -781,8 +781,8 @@ private: S32 mInstantPerformanceListCounter ; }; - /*virtual*/ LLMetricPerformanceTesterWithSession::LLTestSession* loadTestSession(LLSD* log) ; - /*virtual*/ void compareTestSessions(llofstream* os) ; + /*virtual*/ LLMetricPerformanceTesterWithSession::LLTestSession* loadTestSession(LLSD* log) override; + /*virtual*/ void compareTestSessions(llofstream* os) override; }; #endif diff --git a/indra/newview/llviewertextureanim.h b/indra/newview/llviewertextureanim.h index abbfabceb9bb9ac023b00b4b0f10862c7a06bca1..73d74097c67a6ae79f69f3a0e1bf2035b9962277 100644 --- a/indra/newview/llviewertextureanim.h +++ b/indra/newview/llviewertextureanim.h @@ -44,7 +44,7 @@ public: LLViewerTextureAnim(LLVOVolume* vobj); virtual ~LLViewerTextureAnim(); - /*virtual*/ void reset(); + /*virtual*/ void reset() override; S32 animateTextures(F32 &off_s, F32 &off_t, F32 &scale_s, F32 &scale_t, F32 &rotate); enum diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index cd983040c89b6f356789fbde6cc76b453172c1dc..ed234065387cbfbb493cefa22efae850f472fa2a 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -239,9 +239,9 @@ class LLUIImageList : public LLImageProviderInterface, public LLSingleton<LLUIIm LLSINGLETON_EMPTY_CTOR(LLUIImageList); public: // LLImageProviderInterface - /*virtual*/ LLPointer<LLUIImage> getUIImageByID(const LLUUID& id, S32 priority); - /*virtual*/ LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority); - void cleanUp(); + /*virtual*/ LLPointer<LLUIImage> getUIImageByID(const LLUUID& id, S32 priority) override; + /*virtual*/ LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority) override; + void cleanUp() override; bool initFromFile(); diff --git a/indra/newview/llviewerthrottle.cpp b/indra/newview/llviewerthrottle.cpp index f8adc5f1b22f1556d9a73662b38094fbf35605b9..2d1c5472d382249b97a6f520edf88a96cc206eda 100644 --- a/indra/newview/llviewerthrottle.cpp +++ b/indra/newview/llviewerthrottle.cpp @@ -189,7 +189,7 @@ void LLViewerThrottleGroup::dump() class LLBPSListener : public LLSimpleListener { public: - virtual bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) override { gViewerThrottle.setMaxBandwidth((F32) event->getValue().asReal()*1024); return true; diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index fad424bfb4ac7108cdedbe551f004525d54517af..38d9f4d3bd1ad2e1e0f49a18a27362cf7d77b076 100644 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -131,7 +131,7 @@ LLWearable::EImportResult LLViewerWearable::importStream( std::istream& input_st LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture( textureid ); if(gSavedSettings.getBOOL("DebugAvatarLocalTexLoadedTime")) { - image->setLoadedCallback(LLVOAvatarSelf::debugOnTimingLocalTexLoaded,0,TRUE,FALSE, new LLVOAvatarSelf::LLAvatarTexData(textureid, (LLAvatarAppearanceDefines::ETextureIndex)te), NULL); + image->setLoadedCallback(LLVOAvatarSelf::debugOnTimingLocalTexLoaded,0,TRUE,FALSE, new LLVOAvatarSelf::LLAvatarTexData(textureid, (LLAvatarAppearanceDefines::ETextureIndex)te), nullptr); } } @@ -430,7 +430,7 @@ void LLViewerWearable::copyDataFrom(const LLViewerWearable* src) { te_map_t::const_iterator iter = src->mTEMap.find(te); LLUUID image_id; - LLViewerFetchedTexture *image = NULL; + LLViewerFetchedTexture *image = nullptr; if(iter != src->mTEMap.end()) { image = dynamic_cast<LLViewerFetchedTexture*> (src->getLocalTextureObject(te)->getImage()); diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h index 8a5f496a8149d8046a101f4f333656bd6563a00d..f9fe7dd9cfc631d0b17eaedc424f9a98b34ebcf8 100644 --- a/indra/newview/llviewerwearable.h +++ b/indra/newview/llviewerwearable.h @@ -61,18 +61,18 @@ public: BOOL isDirty() const; BOOL isOldVersion() const; - /*virtual*/ void writeToAvatar(LLAvatarAppearance *avatarp); + /*virtual*/ void writeToAvatar(LLAvatarAppearance *avatarp) override; void removeFromAvatar( BOOL upload_bake ) { LLViewerWearable::removeFromAvatar( mType, upload_bake ); } static void removeFromAvatar( LLWearableType::EType type, BOOL upload_bake ); - /*virtual*/ EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp ); + /*virtual*/ EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp ) override; void setParamsToDefaults(); void setTexturesToDefaults(); void setVolatile(BOOL is_volatile) { mVolatile = is_volatile; } // TRUE when doing preview renders, some updates will be suppressed. BOOL getVolatile() { return mVolatile; } - /*virtual*/ LLUUID getDefaultTextureImageID(LLAvatarAppearanceDefines::ETextureIndex index) const; + /*virtual*/ LLUUID getDefaultTextureImageID(LLAvatarAppearanceDefines::ETextureIndex index) const override; void saveNewAsset() const; @@ -82,18 +82,18 @@ public: friend std::ostream& operator<<(std::ostream &s, const LLViewerWearable &w); - /*virtual*/ void revertValues(); - /*virtual*/ void saveValues(); + /*virtual*/ void revertValues() override; + /*virtual*/ void saveValues() override; void revertValuesWithoutUpdate(); // Something happened that requires the wearable's label to be updated (e.g. worn/unworn). - /*virtual*/void setUpdated() const; + /*virtual*/void setUpdated() const override; // the wearable was worn. make sure the name of the wearable object matches the LLViewerInventoryItem, // not the wearable asset itself. void refreshName(); - /*virtual*/void addToBakedTextureHash(LLMD5& hash) const; + /*virtual*/void addToBakedTextureHash(LLMD5& hash) const override; protected: LLAssetID mAssetID; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 3f057ad0ba1cb18bd2424442ad042f64ddc96bab..494437e2dda2233f1b8b1a061d8975244a02b430 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -227,15 +227,15 @@ extern BOOL gDisplaySwapBuffers; extern BOOL gDepthDirty; extern BOOL gResizeScreenTexture; -LLViewerWindow *gViewerWindow = NULL; +LLViewerWindow *gViewerWindow = nullptr; LLFrameTimer gAwayTimer; LLFrameTimer gAwayTriggerTimer; BOOL gShowOverlayTitle = FALSE; -LLViewerObject* gDebugRaycastObject = NULL; -LLVOPartGroup* gDebugRaycastParticle = NULL; +LLViewerObject* gDebugRaycastObject = nullptr; +LLVOPartGroup* gDebugRaycastParticle = nullptr; LLVector4a gDebugRaycastIntersection; LLVector4a gDebugRaycastParticleIntersection; LLVector2 gDebugRaycastTexCoord; @@ -740,7 +740,7 @@ public: } // only display these messages if we are actually rendering beacons at this moment - if (LLPipeline::getRenderBeacons(NULL) && LLFloaterReg::instanceVisible("beacons")) + if (LLPipeline::getRenderBeacons(nullptr) && LLFloaterReg::instanceVisible("beacons")) { static const std::string beacon_particle = LLTrans::getString("BeaconParticle"); static const std::string beacon_physical = LLTrans::getString("BeaconPhysical"); @@ -750,7 +750,7 @@ public: static const std::string beacon_media = LLTrans::getString("BeaconMedia"); static const std::string particle_hiding = LLTrans::getString("ParticleHiding"); - if (LLPipeline::getRenderMOAPBeacons(NULL)) + if (LLPipeline::getRenderMOAPBeacons(nullptr)) { addText(xpos, ypos, beacon_media); ypos += y_inc; @@ -762,31 +762,31 @@ public: ypos += y_inc; } - if (LLPipeline::getRenderParticleBeacons(NULL)) + if (LLPipeline::getRenderParticleBeacons(nullptr)) { addText(xpos, ypos, beacon_particle); ypos += y_inc; } - if (LLPipeline::getRenderSoundBeacons(NULL)) + if (LLPipeline::getRenderSoundBeacons(nullptr)) { addText(xpos, ypos, beacon_sound); ypos += y_inc; } - if (LLPipeline::getRenderScriptedBeacons(NULL)) + if (LLPipeline::getRenderScriptedBeacons(nullptr)) { addText(xpos, ypos, beacon_scripted); ypos += y_inc; } else - if (LLPipeline::getRenderScriptedTouchBeacons(NULL)) + if (LLPipeline::getRenderScriptedTouchBeacons(nullptr)) { addText(xpos, ypos, beacon_scripted_touch); ypos += y_inc; } - if (LLPipeline::getRenderPhysicalBeacons(NULL)) + if (LLPipeline::getRenderPhysicalBeacons(nullptr)) { addText(xpos, ypos, beacon_physical); ypos += y_inc; @@ -814,7 +814,7 @@ public: static LLCachedControl<bool> debugShowTextureInfo(gSavedSettings, "DebugShowTextureInfo"); if (debugShowTextureInfo) { - LLViewerObject* objectp = NULL ; + LLViewerObject* objectp = nullptr ; LLSelectNode* nodep = LLSelectMgr::instance().getHoverNode(); if (nodep) @@ -867,7 +867,7 @@ public: const Line& line = *iter; LLFontGL::getFontMonospace()->renderUTF8(line.text, 0, (F32)line.x, (F32)line.y, mTextColor, LLFontGL::LEFT, LLFontGL::TOP, - LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); + LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, nullptr, FALSE); } mLineList.clear(); } @@ -893,8 +893,8 @@ LLViewerWindow::Params::Params() height("height"), min_width("min_width"), min_height("min_height"), - window_mode("window_mode", 0), - ignore_pixel_depth("ignore_pixel_depth", false) + ignore_pixel_depth("ignore_pixel_depth", false), + window_mode("window_mode", 0) {} @@ -1134,7 +1134,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi { if (drop) { - LLURLDispatcher::dispatch( dropped_slurl.getSLURLString(), "clicked", NULL, true ); + LLURLDispatcher::dispatch( dropped_slurl.getSLURLString(), "clicked", nullptr, true ); return LLWindowCallbacks::DND_MOVE; } return LLWindowCallbacks::DND_COPY; @@ -1212,13 +1212,13 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi } } LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); - mDragHoveredObject = NULL; + mDragHoveredObject = nullptr; } else { // Check the whitelist, if there's media (otherwise just show it) - if (te->getMediaData() == NULL || te->getMediaData()->checkCandidateUrl(url)) + if (te->getMediaData() == nullptr || te->getMediaData()->checkCandidateUrl(url)) { if ( obj != mDragHoveredObject) { @@ -1246,7 +1246,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi result == LLWindowCallbacks::DND_NONE && !mDragHoveredObject.isNull()) { LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); - mDragHoveredObject = NULL; + mDragHoveredObject = nullptr; } } @@ -1348,7 +1348,7 @@ void LLViewerWindow::handleFocusLost(LLWindow *window) gFocusMgr.setAppHasFocus(FALSE); //LLModalDialog::onAppFocusLost(); LLToolMgr::getInstance()->onAppFocusLost(); - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture(nullptr ); if (gMenuBarView) { @@ -1538,7 +1538,7 @@ void LLViewerWindow::handleDataCopy(LLWindow *window, S32 data_type, void *data) case SLURL_MESSAGE_TYPE: // received URL std::string url = (const char*)data; - LLMediaCtrl* web = NULL; + LLMediaCtrl* web = nullptr; const bool trusted_browser = false; // don't treat slapps coming from external browsers as "clicks" as this would bypass throttling if (LLURLDispatcher::dispatch(url, "", web, trusted_browser)) @@ -1630,7 +1630,7 @@ std::string LLViewerWindow::translateString(const char* tag, // Classes // LLViewerWindow::LLViewerWindow(const Params& p) -: mWindow(NULL), +: mWindow(nullptr), mActive(true), mUIVisible(true), mWindowRectRaw(0, p.height, p.width, 0), @@ -1639,16 +1639,16 @@ LLViewerWindow::LLViewerWindow(const Params& p) mLeftMouseDown(FALSE), mMiddleMouseDown(FALSE), mRightMouseDown(FALSE), + mProgressView(nullptr), mMouseInWindow( FALSE ), mLastMask( MASK_NONE ), - mToolStored( NULL ), + mToolStored(nullptr ), mHideCursorPermanent( FALSE ), mCursorHidden(FALSE), mIgnoreActivate( FALSE ), mResDirty(false), mStatesDirty(false), mCurrResolutionIndex(0), - mProgressView(NULL), mSystemUIScaleFactorChanged(false) { // gKeyboard is still NULL, so it doesn't do LLWindowListener any good to @@ -1700,7 +1700,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) LLViewerShaderMgr::instance()->setShaders(); } - if (NULL == mWindow) + if (nullptr == mWindow) { LLSplashScreen::update(LLTrans::getString("StartupRequireDriverUpdate")); @@ -2062,7 +2062,7 @@ void LLViewerWindow::initWorldUI() topinfo_bar->setVisible(FALSE); } - if ( gHUDView == NULL ) + if ( gHUDView == nullptr ) { LLRect hud_rect = full_window; hud_rect.mBottom += 50; @@ -2137,7 +2137,7 @@ void LLViewerWindow::initWorldUI() void LLViewerWindow::shutdownViews() { delete mDebugText; - mDebugText = NULL; + mDebugText = nullptr; LL_INFOS() << "DebugText deleted." << LL_ENDL ; @@ -2171,21 +2171,21 @@ void LLViewerWindow::shutdownViews() // Delete all child views. delete mRootView; - mRootView = NULL; + mRootView = nullptr; LL_INFOS() << "RootView deleted." << LL_ENDL ; LLMenuOptionPathfindingRebakeNavmesh::getInstance()->quit(); // Automatically deleted as children of mRootView. Fix the globals. - gStatusBar = NULL; - gIMMgr = NULL; - gToolTipView = NULL; + gStatusBar = nullptr; + gIMMgr = nullptr; + gToolTipView = nullptr; - gToolBarView = NULL; - gFloaterView = NULL; - gMorphView = NULL; + gToolBarView = nullptr; + gFloaterView = nullptr; + gMorphView = nullptr; - gHUDView = NULL; + gHUDView = nullptr; } void LLViewerWindow::shutdownGL() @@ -2242,7 +2242,7 @@ LLViewerWindow::~LLViewerWindow() destroyWindow(); delete mDebugText; - mDebugText = NULL; + mDebugText = nullptr; if (LLViewerShaderMgr::sInitialized) { @@ -2613,7 +2613,7 @@ BOOL LLViewerWindow::handleKeyUp(KEY key, MASK mask) else if (key < 0x80) { // Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first. - return (gFocusMgr.getKeyboardFocus() != NULL); + return (gFocusMgr.getKeyboardFocus() != nullptr); } } @@ -2656,7 +2656,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) else if (key < 0x80) { // Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first. - return (keyboard_focus != NULL); + return (keyboard_focus != nullptr); } } @@ -2703,7 +2703,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // give floaters first chance to handle TAB key // so frontmost floater gets focus // if nothing has focus, go to first or last UI element as appropriate - if (key == KEY_TAB && (mask & MASK_CONTROL || keyboard_focus == NULL)) + if (key == KEY_TAB && (mask & MASK_CONTROL || keyboard_focus == nullptr)) { LL_WARNS() << "LLviewerWindow::handleKey give floaters first chance at tab key " << LL_ENDL; if (gMenuHolder) gMenuHolder->hideMenus(); @@ -2820,7 +2820,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) if (chat_editor) { // passing NULL here, character will be added later when it is handled by character handler. - nearby_chat->startChat(NULL); + nearby_chat->startChat(nullptr); return TRUE; } } @@ -2830,7 +2830,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) if (!chat_bar) LLFloaterReg::toggleInstanceOrBringToFront("chatbar"); - LLChatBar::startChat(NULL); + LLChatBar::startChat(nullptr); return TRUE; } } @@ -2937,7 +2937,7 @@ void LLViewerWindow::handleScrollWheel(S32 clicks) // Zoom the camera in and out behavior - if(top_ctrl == 0 + if(top_ctrl == nullptr && getWorldViewRectScaled().pointInRect(mCurrentMousePoint.mX, mCurrentMousePoint.mY) && gAgentCamera.isInitialized()) gAgentCamera.handleScrollWheel(clicks); @@ -3064,7 +3064,7 @@ void LLViewerWindow::updateUI() if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST)) { gDebugRaycastFaceHit = -1; - gDebugRaycastObject = cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE, FALSE, + gDebugRaycastObject = cursorIntersect(-1, -1, 512.f, nullptr, -1, FALSE, FALSE, &gDebugRaycastFaceHit, &gDebugRaycastIntersection, &gDebugRaycastTexCoord, @@ -3073,7 +3073,7 @@ void LLViewerWindow::updateUI() &gDebugRaycastStart, &gDebugRaycastEnd); - gDebugRaycastParticle = gPipeline.lineSegmentIntersectParticle(gDebugRaycastStart, gDebugRaycastEnd, &gDebugRaycastParticleIntersection, NULL); + gDebugRaycastParticle = gPipeline.lineSegmentIntersectParticle(gDebugRaycastStart, gDebugRaycastEnd, &gDebugRaycastParticleIntersection, nullptr); } updateMouseDelta(); @@ -3423,8 +3423,8 @@ void LLViewerWindow::updateLayout() { static LLCachedControl<bool> sFreezeTime(gSavedSettings, "FreezeTime", false); LLTool* tool = LLToolMgr::getInstance()->getCurrentTool(); - if (gFloaterTools != NULL - && tool != NULL + if (gFloaterTools != nullptr + && tool != nullptr && tool != gToolNull && tool != LLToolCompInspect::getInstance() && tool != LLToolDragAndDrop::getInstance() @@ -3445,7 +3445,7 @@ void LLViewerWindow::updateLayout() && tool != LLToolCompGun::getInstance() // not coming out of mouselook && !suppress_toolbox // not override in third person && LLToolMgr::getInstance()->getCurrentToolset()->isShowFloaterTools() - && (!captor || dynamic_cast<LLView*>(captor) != NULL))) // not dragging + && (!captor || dynamic_cast<LLView*>(captor) != nullptr))) // not dragging { // Force floater tools to be visible (unless minimized) if (!gFloaterTools->getVisible()) @@ -3521,7 +3521,7 @@ void LLViewerWindow::updateKeyboardFocus() { if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } // clean up current focus @@ -3572,7 +3572,7 @@ void LLViewerWindow::updateKeyboardFocus() } // last ditch force of edit menu to selection manager - if (LLEditMenuHandler::gEditMenuHandler == NULL && LLSelectMgr::getInstance()->getSelection()->getObjectCount()) + if (LLEditMenuHandler::gEditMenuHandler == nullptr && LLSelectMgr::getInstance()->getSelection()->getObjectCount()) { LLEditMenuHandler::gEditMenuHandler = LLSelectMgr::getInstance(); } @@ -3740,7 +3740,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { LLDrawable* drawable = object->mDrawable; if (drawable && drawable->isLight()) @@ -3800,10 +3800,10 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, { LLSelectNode* nodep = *iter; LLViewerObject* object = nodep->getObject(); - LLViewerObject *root_object = (object == NULL) ? NULL : object->getRootEdit(); + LLViewerObject *root_object = (object == nullptr) ? NULL : object->getRootEdit(); BOOL this_object_movable = FALSE; if (object && object->permMove() && !object->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && (object->permModify() || selecting_linked_set)) { moveable_object_selected = TRUE; @@ -3973,7 +3973,7 @@ LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, BOOL pick_transp // shortcut queueing in mPicks and just update mLastPick in place MASK key_mask = gKeyboard->currentMask(TRUE); - mLastPick = LLPickInfo(LLCoordGL(x, y_from_bot), key_mask, pick_transparent, pick_rigged, pick_particle, TRUE, FALSE, NULL); + mLastPick = LLPickInfo(LLCoordGL(x, y_from_bot), key_mask, pick_transparent, pick_rigged, pick_particle, TRUE, FALSE, nullptr); mLastPick.fetchResults(); return mLastPick; @@ -4074,7 +4074,7 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de *end = mw_end; } - LLViewerObject* found = NULL; + LLViewerObject* found = nullptr; if (this_object) // check only this object { @@ -4476,7 +4476,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei } if(image_width * image_height > (1 << 22)) //if snapshot image is larger than 2K by 2K { - if(!LLMemory::tryToAlloc(NULL, image_width * image_height * 3)) + if(!LLMemory::tryToAlloc(nullptr, image_width * image_height * 3)) { LL_WARNS() << "No enough memory to take the snapshot with size (w : h): " << image_width << " : " << image_height << LL_ENDL ; return FALSE ; //there is no enough memory for taking this snapshot. @@ -4784,7 +4784,7 @@ void LLViewerWindow::destroyWindow() { LLWindowManager::destroyWindow(mWindow); } - mWindow = NULL; + mWindow = nullptr; } @@ -5408,21 +5408,21 @@ void LLViewerWindow::setWindowTitle(const std::string& title) // LLPickInfo::LLPickInfo() : mKeyMask(MASK_NONE), - mPickCallback(NULL), + mPickCallback(nullptr), mPickType(PICK_INVALID), - mWantSurfaceInfo(FALSE), mObjectFace(-1), + mHUDIcon(nullptr), + mIntersection(), mUVCoords(-1.f, -1.f), mSTCoords(-1.f, -1.f), mXYCoords(-1, -1), - mIntersection(), mNormal(), mTangent(), mBinormal(), - mHUDIcon(NULL), mPickTransparent(FALSE), mPickRigged(FALSE), - mPickParticle(FALSE) + mPickParticle(FALSE), + mWantSurfaceInfo(FALSE) { } @@ -5438,19 +5438,19 @@ LLPickInfo::LLPickInfo(const LLCoordGL& mouse_pos, mKeyMask(keyboard_mask), mPickCallback(pick_callback), mPickType(PICK_INVALID), - mWantSurfaceInfo(pick_uv_coords), mObjectFace(-1), + mHUDIcon(nullptr), mUVCoords(-1.f, -1.f), mSTCoords(-1.f, -1.f), mXYCoords(-1, -1), mNormal(), mTangent(), mBinormal(), - mHUDIcon(NULL), mPickTransparent(pick_transparent), mPickRigged(pick_rigged), mPickParticle(pick_particle), - mPickUnselectable(pick_unselectable) + mPickUnselectable(pick_unselectable), + mWantSurfaceInfo(pick_uv_coords) { } @@ -5480,7 +5480,7 @@ void LLPickInfo::fetchResults() } LLViewerObject* hit_object = gViewerWindow->cursorIntersect(mMousePt.mX, mMousePt.mY, 512.f, - NULL, -1, mPickTransparent, mPickRigged, &face_hit, + nullptr, -1, mPickTransparent, mPickRigged, &face_hit, &intersection, &uv, &normal, &tangent, &start, &end); mPickPt = mMousePt; @@ -5567,7 +5567,7 @@ void LLPickInfo::fetchResults() { //search for closest particle to click origin out to intersection point S32 part_face = -1; - LLVOPartGroup* group = gPipeline.lineSegmentIntersectParticle(start, particle_end, NULL, &part_face); + LLVOPartGroup* group = gPipeline.lineSegmentIntersectParticle(start, particle_end, nullptr, &part_face); if (group) { mParticleOwnerID = group->getPartOwner(part_face); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 10a97e23d17d7e0573a393d9f4edc956a990e8a7..ae701e265b7efd1c2cf273c8c6a26ee595da85b6 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -180,43 +180,43 @@ public: // // LLWindowCallback interface implementation // - /*virtual*/ BOOL handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated); - /*virtual*/ BOOL handleTranslatedKeyUp(KEY key, MASK mask); - /*virtual*/ void handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level); - /*virtual*/ BOOL handleUnicodeChar(llwchar uni_char, MASK mask); // NOT going to handle extended - /*virtual*/ BOOL handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ BOOL handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ BOOL handleCloseRequest(LLWindow *window); - /*virtual*/ void handleQuit(LLWindow *window); - /*virtual*/ BOOL handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ LLWindowCallbacks::DragNDropResult handleDragNDrop(LLWindow *window, LLCoordGL pos, MASK mask, LLWindowCallbacks::DragNDropAction action, std::string data); - /*virtual*/ void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ void handleMouseLeave(LLWindow *window); - /*virtual*/ void handleResize(LLWindow *window, S32 width, S32 height); - /*virtual*/ void handleFocus(LLWindow *window); - /*virtual*/ void handleFocusLost(LLWindow *window); - /*virtual*/ BOOL handleActivate(LLWindow *window, BOOL activated); - /*virtual*/ BOOL handleActivateApp(LLWindow *window, BOOL activating); - /*virtual*/ void handleMenuSelect(LLWindow *window, S32 menu_item); - /*virtual*/ BOOL handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S32 height); - /*virtual*/ void handleScrollWheel(LLWindow *window, S32 clicks); - /*virtual*/ BOOL handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ void handleWindowBlock(LLWindow *window); - /*virtual*/ void handleWindowUnblock(LLWindow *window); - /*virtual*/ void handleDataCopy(LLWindow *window, S32 data_type, void *data); - /*virtual*/ BOOL handleTimerEvent(LLWindow *window); - /*virtual*/ BOOL handleDeviceChange(LLWindow *window); - /*virtual*/ BOOL handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height); - - /*virtual*/ void handlePingWatchdog(LLWindow *window, const char * msg); - /*virtual*/ void handlePauseWatchdog(LLWindow *window); - /*virtual*/ void handleResumeWatchdog(LLWindow *window); - /*virtual*/ std::string translateString(const char* tag); + /*virtual*/ BOOL handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated) override; + /*virtual*/ BOOL handleTranslatedKeyUp(KEY key, MASK mask) override; + /*virtual*/ void handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level) override; + /*virtual*/ BOOL handleUnicodeChar(llwchar uni_char, MASK mask) override; // NOT going to handle extended + /*virtual*/ BOOL handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask) override; + /*virtual*/ BOOL handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) override; + /*virtual*/ BOOL handleCloseRequest(LLWindow *window) override; + /*virtual*/ void handleQuit(LLWindow *window) override; + /*virtual*/ BOOL handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK mask) override; + /*virtual*/ BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) override; + /*virtual*/ BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask) override; + /*virtual*/ BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) override; + /*virtual*/ LLWindowCallbacks::DragNDropResult handleDragNDrop(LLWindow *window, LLCoordGL pos, MASK mask, LLWindowCallbacks::DragNDropAction action, std::string data) override; + /*virtual*/ void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask) override; + /*virtual*/ void handleMouseLeave(LLWindow *window) override; + /*virtual*/ void handleResize(LLWindow *window, S32 width, S32 height) override; + /*virtual*/ void handleFocus(LLWindow *window) override; + /*virtual*/ void handleFocusLost(LLWindow *window) override; + /*virtual*/ BOOL handleActivate(LLWindow *window, BOOL activated) override; + /*virtual*/ BOOL handleActivateApp(LLWindow *window, BOOL activating) override; + /*virtual*/ void handleMenuSelect(LLWindow *window, S32 menu_item) override; + /*virtual*/ BOOL handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S32 height) override; + /*virtual*/ void handleScrollWheel(LLWindow *window, S32 clicks) override; + /*virtual*/ BOOL handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask) override; + /*virtual*/ void handleWindowBlock(LLWindow *window) override; + /*virtual*/ void handleWindowUnblock(LLWindow *window) override; + /*virtual*/ void handleDataCopy(LLWindow *window, S32 data_type, void *data) override; + /*virtual*/ BOOL handleTimerEvent(LLWindow *window) override; + /*virtual*/ BOOL handleDeviceChange(LLWindow *window) override; + /*virtual*/ BOOL handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height) override; + + /*virtual*/ void handlePingWatchdog(LLWindow *window, const char * msg) override; + /*virtual*/ void handlePauseWatchdog(LLWindow *window) override; + /*virtual*/ void handleResumeWatchdog(LLWindow *window) override; + /*virtual*/ std::string translateString(const char* tag) override; /*virtual*/ std::string translateString(const char* tag, - const std::map<std::string, std::string>& args); + const std::map<std::string, std::string>& args) override; // signal on update of WorldView rect typedef std::function<void (LLRect old_world_rect, LLRect new_world_rect)> world_rect_callback_t; @@ -375,17 +375,17 @@ public: LLVector4a* intersection); LLViewerObject* cursorIntersect(S32 mouse_x = -1, S32 mouse_y = -1, F32 depth = 512.f, - LLViewerObject *this_object = NULL, + LLViewerObject *this_object = nullptr, S32 this_face = -1, BOOL pick_transparent = FALSE, BOOL pick_rigged = FALSE, - S32* face_hit = NULL, - LLVector4a *intersection = NULL, - LLVector2 *uv = NULL, - LLVector4a *normal = NULL, - LLVector4a *tangent = NULL, - LLVector4a* start = NULL, - LLVector4a* end = NULL); + S32* face_hit = nullptr, + LLVector4a *intersection = nullptr, + LLVector2 *uv = nullptr, + LLVector4a *normal = nullptr, + LLVector4a *tangent = nullptr, + LLVector4a* start = nullptr, + LLVector4a* end = nullptr); // Returns a pointer to the last object hit diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index aa77831ae56e14e56a65eadf4dc6c8dff31f3c20..4461698d6f5eca5c4d9de807645046f403ddaaf3 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -103,7 +103,7 @@ void LLVLComposition::setDetailTextureID(S32 corner, const LLUUID& id) } mDetailTextures[corner] = LLViewerTextureManager::getFetchedTexture(id); mDetailTextures[corner]->setNoDelete() ; - mRawImages[corner] = NULL; + mRawImages[corner] = nullptr; } BOOL LLVLComposition::generateHeights(const F32 x, const F32 y, @@ -282,7 +282,7 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y, min_dim /= 2; } - BOOL delete_raw = (mDetailTextures[i]->reloadRawImage(ddiscard) != NULL) ; + BOOL delete_raw = (mDetailTextures[i]->reloadRawImage(ddiscard) != nullptr) ; if(mDetailTextures[i]->getRawImageLevel() != ddiscard)//raw iamge is not ready, will enter here again later. { if(delete_raw) diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp index 952255fc41a2a8baee175ff1a4b6fb925fe3ad49..01fb0a2b3dd41af0f9812a64745d9aa24c0ea9b1 100644 --- a/indra/newview/llvlmanager.cpp +++ b/indra/newview/llvlmanager.cpp @@ -189,6 +189,6 @@ LLVLData::LLVLData(LLViewerRegion *regionp, const S8 type, U8 *data, const S32 s LLVLData::~LLVLData() { delete [] mData; - mData = NULL; - mRegionp = NULL; + mData = nullptr; + mRegionp = nullptr; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c5a13d36e85df2410e5aa78810a6cbbbb2a4cdae..bdc8337c23755b21ebfbc20d971d3ed65827e769 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -287,29 +287,29 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return TRUE; } + BOOL getLoop() override { return TRUE; } // motions must report their total duration - virtual F32 getDuration() { return 0.f; } + F32 getDuration() override { return 0.f; } // motions must report their "ease in" duration - virtual F32 getEaseInDuration() { return 0.f; } + F32 getEaseInDuration() override { return 0.f; } // motions must report their "ease out" duration. - virtual F32 getEaseOutDuration() { return 0.f; } + F32 getEaseOutDuration() override { return 0.f; } // motions must report their priority - virtual LLJoint::JointPriority getPriority() { return LLJoint::HIGH_PRIORITY; } + LLJoint::JointPriority getPriority() override { return LLJoint::HIGH_PRIORITY; } - virtual LLMotionBlendType getBlendType() { return ADDITIVE_BLEND; } + LLMotionBlendType getBlendType() override { return ADDITIVE_BLEND; } // called to determine when a motion should be activated/deactivated based on avatar pixel coverage - virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_BODY_NOISE; } + F32 getMinPixelArea() override { return MIN_REQUIRED_PIXEL_AREA_BODY_NOISE; } // run-time (post constructor) initialization, // called after parameters have been set // must return true to indicate success and be available for activation - virtual LLMotionInitStatus onInitialize(LLCharacter *character) + LLMotionInitStatus onInitialize(LLCharacter *character) override { if( !mTorsoState->setJoint( character->getJoint("mTorso") )) { @@ -325,12 +325,12 @@ public: // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate() { return TRUE; } + BOOL onActivate() override { return TRUE; } // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask) + BOOL onUpdate(F32 time, U8* joint_mask) override { F32 nx[2]; nx[0]=time*TORSO_NOISE_SPEED; @@ -351,7 +351,7 @@ public: } // called when a motion is deactivated - virtual void onDeactivate() {} + void onDeactivate() override {} private: //------------------------------------------------------------------------- @@ -371,7 +371,7 @@ public: LLBreatheMotionRot(const LLUUID &id) : LLMotion(id), mBreatheRate(1.f), - mCharacter(NULL) + mCharacter(nullptr) { mName = "breathe_rot"; mChestState = new LLJointState; @@ -394,29 +394,29 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return TRUE; } + BOOL getLoop() override { return TRUE; } // motions must report their total duration - virtual F32 getDuration() { return 0.f; } + F32 getDuration() override { return 0.f; } // motions must report their "ease in" duration - virtual F32 getEaseInDuration() { return 0.f; } + F32 getEaseInDuration() override { return 0.f; } // motions must report their "ease out" duration. - virtual F32 getEaseOutDuration() { return 0.f; } + F32 getEaseOutDuration() override { return 0.f; } // motions must report their priority - virtual LLJoint::JointPriority getPriority() { return LLJoint::MEDIUM_PRIORITY; } + LLJoint::JointPriority getPriority() override { return LLJoint::MEDIUM_PRIORITY; } - virtual LLMotionBlendType getBlendType() { return NORMAL_BLEND; } + LLMotionBlendType getBlendType() override { return NORMAL_BLEND; } // called to determine when a motion should be activated/deactivated based on avatar pixel coverage - virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_BREATHE; } + F32 getMinPixelArea() override { return MIN_REQUIRED_PIXEL_AREA_BREATHE; } // run-time (post constructor) initialization, // called after parameters have been set // must return true to indicate success and be available for activation - virtual LLMotionInitStatus onInitialize(LLCharacter *character) + LLMotionInitStatus onInitialize(LLCharacter *character) override { mCharacter = character; BOOL success = true; @@ -445,12 +445,12 @@ public: // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate() { return TRUE; } + BOOL onActivate() override { return TRUE; } // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask) + BOOL onUpdate(F32 time, U8* joint_mask) override { mBreatheRate = 1.f; @@ -462,7 +462,7 @@ public: } // called when a motion is deactivated - virtual void onDeactivate() {} + void onDeactivate() override {} private: //------------------------------------------------------------------------- @@ -482,7 +482,7 @@ class LLPelvisFixMotion : public: // Constructor LLPelvisFixMotion(const LLUUID &id) - : LLMotion(id), mCharacter(NULL) + : LLMotion(id), mCharacter(nullptr) { mName = "pelvis_fix"; @@ -506,29 +506,29 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return TRUE; } + BOOL getLoop() override { return TRUE; } // motions must report their total duration - virtual F32 getDuration() { return 0.f; } + F32 getDuration() override { return 0.f; } // motions must report their "ease in" duration - virtual F32 getEaseInDuration() { return 0.5f; } + F32 getEaseInDuration() override { return 0.5f; } // motions must report their "ease out" duration. - virtual F32 getEaseOutDuration() { return 0.5f; } + F32 getEaseOutDuration() override { return 0.5f; } // motions must report their priority - virtual LLJoint::JointPriority getPriority() { return LLJoint::LOW_PRIORITY; } + LLJoint::JointPriority getPriority() override { return LLJoint::LOW_PRIORITY; } - virtual LLMotionBlendType getBlendType() { return NORMAL_BLEND; } + LLMotionBlendType getBlendType() override { return NORMAL_BLEND; } // called to determine when a motion should be activated/deactivated based on avatar pixel coverage - virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_PELVIS_FIX; } + F32 getMinPixelArea() override { return MIN_REQUIRED_PIXEL_AREA_PELVIS_FIX; } // run-time (post constructor) initialization, // called after parameters have been set // must return true to indicate success and be available for activation - virtual LLMotionInitStatus onInitialize(LLCharacter *character) + LLMotionInitStatus onInitialize(LLCharacter *character) override { mCharacter = character; @@ -546,12 +546,12 @@ public: // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate() { return TRUE; } + BOOL onActivate() override { return TRUE; } // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask) + BOOL onUpdate(F32 time, U8* joint_mask) override { mPelvisState->setPosition(LLVector3::zero); @@ -559,7 +559,7 @@ public: } // called when a motion is deactivated - virtual void onDeactivate() {} + void onDeactivate() override {} private: //------------------------------------------------------------------------- @@ -579,7 +579,7 @@ private: //----------------------------------------------------------------------------- // Static Data //----------------------------------------------------------------------------- -LLAvatarAppearanceDictionary *LLVOAvatar::sAvatarDictionary = NULL; +LLAvatarAppearanceDictionary *LLVOAvatar::sAvatarDictionary = nullptr; S32 LLVOAvatar::sFreezeCounter = 0; U32 LLVOAvatar::sMaxNonImpostors = 12; // overridden based on graphics setting F32 LLVOAvatar::sRenderDistance = 256.f; @@ -637,61 +637,61 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, LLViewerRegion* regionp) : LLAvatarAppearance(&gAgentWearables), LLViewerObject(id, pcode, regionp), + mLastRezzedStatus(-1), + mFirstFullyVisible(TRUE), + mFullyLoaded(FALSE), + mPreviousFullyLoaded(FALSE), + mFullyLoadedInitialized(FALSE), + mFullyLoadedFrameCounter(0), + mMutedAVColor(LLColor4::white /* used for "uninitialize" */), + mLastSkeletonSerialNum( 0 ), mSpecialRenderMode(0), mAttachmentSurfaceArea(0.f), - mReportedVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), - mTurning(FALSE), - mLastSkeletonSerialNum( 0 ), - mIsSitting(FALSE), - mTimeVisible(), - mTyping(FALSE), - mTypingLast(false), - mMeshValid(FALSE), + mNeedsSkin(FALSE), + mLastSkinTime(0.f), + mUpdatePeriod(1), + mNumInitFaces(0), + mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), + mVisualComplexityStale(true), + mReportedVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), + mCachedInMuteList(false), + mCachedMuteListUpdateTime(0), + mVisuallyMuteSetting(AV_RENDER_NORMALLY), + mVisibilityRank(0), mVisible(FALSE), - mWindFreq(0.f), + mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar", false)), mRipplePhase( 0.f ), mBelowWater(FALSE), - mLastAppearanceBlendTime(0.f), + mWindFreq(0.f), + mCulled( FALSE ), + mLoadedCallbacksPaused(FALSE), + mFirstTEMessageReceived( FALSE ), + mFirstAppearanceMessageReceived( FALSE ), + mMeshValid(FALSE), mAppearanceAnimating(FALSE), - mNameIsSet(false), + mLastAppearanceBlendTime(0.f), + mIsEditingAppearance(FALSE), + mUseLocalAppearance(FALSE), + mUseServerBakes(FALSE), + mVisibleChat(FALSE), + mTurning(FALSE), + mIsSitting(FALSE), + mNameIsSet(false), mTitle(), mNameAway(false), mNameDoNotDisturb(false), mNameMute(false), mNameAppearance(false), mNameFriend(false), + mNameCloud(false), mNameAlpha(0.f), - mVisibleChat(FALSE), - mColorLast(LLColor4::white), mRenderGroupTitles(sRenderGroupTitles), - mNameCloud(false), - mFirstTEMessageReceived( FALSE ), - mFirstAppearanceMessageReceived( FALSE ), - mCulled( FALSE ), - mVisibilityRank(0), - mNeedsSkin(FALSE), - mLastSkinTime(0.f), - mUpdatePeriod(1), - mNumInitFaces(0), - mVisualComplexityStale(true), - mVisuallyMuteSetting(AV_RENDER_NORMALLY), - mMutedAVColor(LLColor4::white /* used for "uninitialize" */), - mFirstFullyVisible(TRUE), - mFullyLoaded(FALSE), - mPreviousFullyLoaded(FALSE), - mFullyLoadedInitialized(FALSE), - mFullyLoadedFrameCounter(0), - mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), - mLoadedCallbacksPaused(FALSE), - mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar", false)), - mLastRezzedStatus(-1), - mIsEditingAppearance(FALSE), - mUseLocalAppearance(FALSE), - mUseServerBakes(FALSE), + mTimeVisible(), + mTyping(FALSE), + mTypingLast(false), + mColorLast(LLColor4::white), mLastUpdateRequestCOFVersion(-1), - mLastUpdateReceivedCOFVersion(-1), - mCachedMuteListUpdateTime(0), - mCachedInMuteList(false) + mLastUpdateReceivedCOFVersion(-1) { LL_DEBUGS("AvatarRender") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; @@ -703,11 +703,11 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim ); LL_DEBUGS("Avatar","Message") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; - mPelvisp = NULL; + mPelvisp = nullptr; mDirtyMesh = 2; // Dirty geometry, need to regenerate. mMeshTexturesDirty = FALSE; - mHeadp = NULL; + mHeadp = nullptr; // set up animation variables @@ -746,8 +746,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mStepMaterial = 0; mLipSyncActive = false; - mOohMorph = NULL; - mAahMorph = NULL; + mOohMorph = nullptr; + mAahMorph = nullptr; mCurrentGesticulationLevel = 0; @@ -828,7 +828,7 @@ void LLVOAvatar::markDead() if (mNameText) { mNameText->markDead(); - mNameText = NULL; + mNameText = nullptr; sNumVisibleChatBubbles--; } mVoiceVisualizer->markDead(); @@ -1726,10 +1726,10 @@ LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector { if (isSelf() && !gAgent.needsRenderAvatar()) { - return NULL; + return nullptr; } - LLViewerObject* hit = NULL; + LLViewerObject* hit = nullptr; if (lineSegmentBoundingBox(start, end)) { @@ -2092,7 +2092,7 @@ void LLVOAvatar::updateMeshData() part_index-- ; } - LLFace* facep = NULL; + LLFace* facep = nullptr; if(f_num < mDrawable->getNumFaces()) { facep = mDrawable->getFace(f_num); @@ -2211,7 +2211,7 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUUID& uuid) { - LLViewerFetchedTexture *result = NULL; + LLViewerFetchedTexture *result = nullptr; if (uuid == IMG_DEFAULT_AVATAR || uuid == IMG_DEFAULT || @@ -2888,7 +2888,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) { // ...clean up old name tag mNameText->markDead(); - mNameText = NULL; + mNameText = nullptr; sNumVisibleChatBubbles--; } return; @@ -2934,7 +2934,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) if (mNameText) { mNameText->markDead(); - mNameText = NULL; + mNameText = nullptr; sNumVisibleChatBubbles--; } return; @@ -3510,7 +3510,7 @@ void LLVOAvatar::updateDebugText() if (!mDebugText.size() && mText.notNull()) { mText->markDead(); - mText = NULL; + mText = nullptr; } else if (mDebugText.size()) { @@ -4738,7 +4738,7 @@ void LLVOAvatar::collectLocalTextureUUIDs(std::set<LLUUID>& ids) const LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)texture_index); U32 num_wearables = gAgentWearables.getWearableCount(wearable_type); - LLViewerFetchedTexture *imagep = NULL; + LLViewerFetchedTexture *imagep = nullptr; for (U32 wearable_index = 0; wearable_index < num_wearables; wearable_index++) { imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture_index, wearable_index), TRUE); @@ -4761,7 +4761,7 @@ void LLVOAvatar::collectBakedTextureUUIDs(std::set<LLUUID>& ids) const { for (U32 texture_index = 0; texture_index < getNumTEs(); texture_index++) { - LLViewerFetchedTexture *imagep = NULL; + LLViewerFetchedTexture *imagep = nullptr; if (isIndexBakedTexture((ETextureIndex) texture_index)) { imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture_index,0), TRUE); @@ -4897,7 +4897,7 @@ void LLVOAvatar::updateTextures() LL_WARNS() << "getTE( " << texture_index << " ) returned 0" <<LL_ENDL; } - LLViewerFetchedTexture *imagep = NULL; + LLViewerFetchedTexture *imagep = nullptr; for (U32 wearable_index = 0; wearable_index < num_wearables; wearable_index++) { imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture_index, wearable_index), TRUE); @@ -5070,7 +5070,7 @@ const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid) } const LLAvatarAppearanceDictionary::TextureEntry* texture_entry = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)te); - if (texture_entry != NULL) + if (texture_entry != nullptr) { url = appearance_service_url + "texture/" + getID().asString() + "/" + texture_entry->mDefaultImageName + "/" + uuid.asString(); //LL_INFOS() << "baked texture url: " << url << LL_ENDL; @@ -5489,9 +5489,9 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) { joint_map_t::iterator iter = mJointMap.find(name); - LLJoint* jointp = NULL; + LLJoint* jointp = nullptr; - if (iter == mJointMap.end() || iter->second == NULL) + if (iter == mJointMap.end() || iter->second == nullptr) { //search for joint and cache found joint in lookup table jointp = mRoot->findJoint(name); mJointMap[name] = jointp; @@ -5512,7 +5512,7 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) LLJoint *LLVOAvatar::getJoint( S32 joint_num ) { - LLJoint *pJoint = NULL; + LLJoint *pJoint = nullptr; S32 collision_start = mNumBones; S32 attachment_start = mNumBones + mNumCollisionVolumes; if (joint_num>=attachment_start) @@ -6095,7 +6095,7 @@ void LLVOAvatar::initAttachmentPoints(bool ignore_hud_joints) continue; } - LLViewerJointAttachment* attachment = NULL; + LLViewerJointAttachment* attachment = nullptr; bool newly_created = false; if (mAttachmentPoints.find(attachmentID) == mAttachmentPoints.end()) { @@ -6288,7 +6288,7 @@ LLDrawable *LLVOAvatar::createDrawable(LLPipeline *pipeline) // Only a single face (one per avatar) //this face will be splitted into several if its vertex buffer is too long. mDrawable->setState(LLDrawable::ACTIVE); - mDrawable->addFace(poolp, NULL); + mDrawable->addFace(poolp, nullptr); mDrawable->setRenderType(LLPipeline::RENDER_TYPE_AVATAR); mNumInitFaces = mDrawable->getNumFaces() ; @@ -6373,7 +6373,7 @@ void LLVOAvatar::hideSkirt() BOOL LLVOAvatar::setParent(LLViewerObject* parent) { BOOL ret ; - if (parent == NULL) + if (parent == nullptr) { getOffObject(); ret = LLViewerObject::setParent(parent); @@ -6444,7 +6444,7 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi attachmentID &= ~ATTACHMENT_ADD; } - LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attachmentID, (LLViewerJointAttachment*)NULL); + LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attachmentID, (LLViewerJointAttachment*)nullptr); if (!attachment) { @@ -6452,7 +6452,7 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi << " trying to use 1 (chest)" << LL_ENDL; - attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) + attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)nullptr); // Arbitrary using 1 (chest) if (attachment) { LL_WARNS() << "Object attachment point invalid: " << attachmentID @@ -6494,7 +6494,7 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o LLViewerInventoryItem *item = gInventory.getItem(item_id); LL_WARNS("Avatar") << "ATT attach failed " << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL; - return 0; + return nullptr; } updateVisualComplexity(); @@ -6793,7 +6793,7 @@ void LLVOAvatar::getOffObject() sitDown(FALSE); - mRoot->getXform()->setParent(NULL); // LLVOAvatar::getOffObject + mRoot->getXform()->setParent(nullptr); // LLVOAvatar::getOffObject // SL-315 mRoot->setPosition(cur_position_world); mRoot->setRotation(cur_rotation_world); @@ -6841,7 +6841,7 @@ LLVOAvatar* LLVOAvatar::findAvatarFromAttachment( LLViewerObject* obj ) return (LLVOAvatar*)obj; } } - return NULL; + return nullptr; } S32 LLVOAvatar::getAttachmentCount() @@ -6915,7 +6915,7 @@ LLViewerObject * LLVOAvatar::findAttachmentByID( const LLUUID & target_id ) cons } } - return NULL; + return nullptr; } // virtual @@ -7312,7 +7312,7 @@ void LLVOAvatar::updateMeshTextures() } const BOOL other_culled = !isSelf() && mCulled; - LLLoadedCallbackEntry::source_callback_list_t* src_callback_list = NULL ; + LLLoadedCallbackEntry::source_callback_list_t* src_callback_list = nullptr ; BOOL paused = FALSE; if(!isSelf()) { @@ -7331,7 +7331,7 @@ void LLVOAvatar::updateMeshTextures() for (U32 i=0; i < mBakedTextureDatas.size(); i++) { is_layer_baked[i] = isTextureDefined(mBakedTextureDatas[i].mTextureIndex); - LLViewerTexLayerSet* layerset = NULL; + LLViewerTexLayerSet* layerset = nullptr; bool layerset_invalid = false; if (!other_culled) { @@ -7724,7 +7724,7 @@ LLBBox LLVOAvatar::getHUDBBox() const ++attachment_iter) { const LLViewerObject* attached_object = (*attachment_iter); - if (attached_object == NULL) + if (attached_object == nullptr) { LL_WARNS() << "HUD attached object is NULL!" << LL_ENDL; continue; @@ -7758,7 +7758,7 @@ void LLVOAvatar::onFirstTEMessageReceived() { mFirstTEMessageReceived = TRUE; - LLLoadedCallbackEntry::source_callback_list_t* src_callback_list = NULL ; + LLLoadedCallbackEntry::source_callback_list_t* src_callback_list = nullptr ; BOOL paused = FALSE ; if(!isSelf()) { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index d1f0ee016b50453b29ee7cd657abefe1c66abe9e..1332896df968096a296daae89da3a4f2029df9a2 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -100,10 +100,10 @@ public: } LLVOAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - virtual void markDead(); + void markDead() override; static void initClass(); // Initialize data that's only init'd once per class. static void cleanupClass(); // Cleanup data that's only init'd once per class. - virtual void initInstance(); // Called after construction to initialize the class. + void initInstance() override; // Called after construction to initialize the class. protected: virtual ~LLVOAvatar(); @@ -120,19 +120,19 @@ protected: // LLViewerObject interface and related //-------------------------------------------------------------------- public: - /*virtual*/ void updateGL(); - /*virtual*/ LLVOAvatar* asAvatar(); - virtual U32 processUpdateMessage(LLMessageSystem *mesgsys, + /*virtual*/ void updateGL() override; + /*virtual*/ LLVOAvatar* asAvatar() override; + U32 processUpdateMessage(LLMessageSystem *mesgsys, void **user_data, U32 block_num, const EObjectUpdateType update_type, - LLDataPacker *dp); - virtual void idleUpdate(LLAgent &agent, const F64 &time); - /*virtual*/ BOOL updateLOD(); + LLDataPacker *dp) override; + void idleUpdate(LLAgent &agent, const F64 &time) override; + /*virtual*/ BOOL updateLOD() override; BOOL updateJointLODs(); void updateLODRiggedAttachments( void ); void updateSoftwareSkinnedVertices(const LLMeshSkinInfo* skin, const LLVector4a* weight, const LLVolumeFace& vol_face, LLVertexBuffer *buffer); - /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. + /*virtual*/ BOOL isActive() const override; // Whether this object needs to do an idleUpdate. S32Bytes totalTextureMemForUUIDS(std::set<LLUUID>& ids); bool allTexturesCompletelyDownloaded(std::set<LLUUID>& ids) const; bool allLocalTexturesCompletelyDownloaded() const; @@ -144,58 +144,58 @@ public: void collectBakedTextureUUIDs(std::set<LLUUID>& ids) const; void collectTextureUUIDs(std::set<LLUUID>& ids); void releaseOldTextures(); - /*virtual*/ void updateTextures(); + /*virtual*/ void updateTextures() override; LLViewerFetchedTexture* getBakedTextureImage(const U8 te, const LLUUID& uuid); - /*virtual*/ S32 setTETexture(const U8 te, const LLUUID& uuid); // If setting a baked texture, need to request it from a non-local sim. - /*virtual*/ void onShift(const LLVector4a& shift_vector); - /*virtual*/ U32 getPartitionType() const; - /*virtual*/ const LLVector3 getRenderPosition() const; - /*virtual*/ void updateDrawable(BOOL force_damped); - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); - /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); - /*virtual*/ void updateRegion(LLViewerRegion *regionp); - /*virtual*/ void updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax); + /*virtual*/ S32 setTETexture(const U8 te, const LLUUID& uuid) override; // If setting a baked texture, need to request it from a non-local sim. + /*virtual*/ void onShift(const LLVector4a& shift_vector) override; + /*virtual*/ U32 getPartitionType() const override; + /*virtual*/ const LLVector3 getRenderPosition() const override; + /*virtual*/ void updateDrawable(BOOL force_damped) override; + /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) override; + /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; + /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent) override; + /*virtual*/ void updateRegion(LLViewerRegion *regionp) override; + /*virtual*/ void updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax) override; /*virtual*/ void getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax); /*virtual*/ BOOL lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face = -1, // which face to check, -1 = ALL_SIDES BOOL pick_transparent = FALSE, BOOL pick_rigged = FALSE, - S32* face_hit = NULL, // which face was hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL); // return the surface tangent at the intersection point + S32* face_hit = nullptr, // which face was hit + LLVector4a* intersection = nullptr, // return the intersection point + LLVector2* tex_coord = nullptr, // return the texture coordinates of the intersection point + LLVector4a* normal = nullptr, // return the surface normal at the intersection point + LLVector4a* tangent = nullptr) override; // return the surface tangent at the intersection point LLViewerObject* lineSegmentIntersectRiggedAttachments(const LLVector4a& start, const LLVector4a& end, S32 face = -1, // which face to check, -1 = ALL_SIDES BOOL pick_transparent = FALSE, BOOL pick_rigged = FALSE, - S32* face_hit = NULL, // which face was hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL); // return the surface tangent at the intersection point + S32* face_hit = nullptr, // which face was hit + LLVector4a* intersection = nullptr, // return the intersection point + LLVector2* tex_coord = nullptr, // return the texture coordinates of the intersection point + LLVector4a* normal = nullptr, // return the surface normal at the intersection point + LLVector4a* tangent = nullptr); // return the surface tangent at the intersection point //-------------------------------------------------------------------- // LLCharacter interface and related //-------------------------------------------------------------------- public: - /*virtual*/ LLVector3 getCharacterPosition(); - /*virtual*/ LLQuaternion getCharacterRotation(); - /*virtual*/ LLVector3 getCharacterVelocity(); - /*virtual*/ LLVector3 getCharacterAngularVelocity(); + /*virtual*/ LLVector3 getCharacterPosition() override; + /*virtual*/ LLQuaternion getCharacterRotation() override; + /*virtual*/ LLVector3 getCharacterVelocity() override; + /*virtual*/ LLVector3 getCharacterAngularVelocity() override; /*virtual*/ LLUUID remapMotionID(const LLUUID& id); - /*virtual*/ BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f); - /*virtual*/ BOOL stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE); + /*virtual*/ BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f) override; + /*virtual*/ BOOL stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE) override; virtual bool hasMotionFromSource(const LLUUID& source_id); virtual void stopMotionFromSource(const LLUUID& source_id); - virtual void requestStopMotion(LLMotion* motion); + void requestStopMotion(LLMotion* motion) override; LLMotion* findMotion(const LLUUID& id) const; void startDefaultMotions(); void dumpAnimationState(); - virtual LLJoint* getJoint(const std::string &name); + LLJoint* getJoint(const std::string &name) override; LLJoint* getJoint(S32 num); void addAttachmentOverridesForObject(LLViewerObject *vo); @@ -209,14 +209,14 @@ public: void getAttachmentOverrideNames(std::set<std::string>& pos_names, std::set<std::string>& scale_names) const; - /*virtual*/ const LLUUID& getID() const; - /*virtual*/ void addDebugText(const std::string& text); - /*virtual*/ F32 getTimeDilation(); - /*virtual*/ void getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm); - /*virtual*/ F32 getPixelArea() const; - /*virtual*/ LLVector3d getPosGlobalFromAgent(const LLVector3 &position); - /*virtual*/ LLVector3 getPosAgentFromGlobal(const LLVector3d &position); - virtual void updateVisualParams(); + /*virtual*/ const LLUUID& getID() const override; + /*virtual*/ void addDebugText(const std::string& text) override; + /*virtual*/ F32 getTimeDilation() override; + /*virtual*/ void getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm) override; + /*virtual*/ F32 getPixelArea() const override; + /*virtual*/ LLVector3d getPosGlobalFromAgent(const LLVector3 &position) override; + /*virtual*/ LLVector3 getPosAgentFromGlobal(const LLVector3d &position) override; + void updateVisualParams() override; /** Inherited ** ** @@ -228,7 +228,7 @@ public: **/ public: - virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent + bool isSelf() const override { return false; } // True if this avatar is for this viewer's agent private: //aligned members LL_ALIGN_16(LLVector4a mImpostorExtents[2]); @@ -361,17 +361,17 @@ protected: **/ protected: - /*virtual*/ LLAvatarJoint* createAvatarJoint(); // Returns LLViewerJoint - /*virtual*/ LLAvatarJoint* createAvatarJoint(S32 joint_num); // Returns LLViewerJoint - /*virtual*/ LLAvatarJointMesh* createAvatarJointMesh(); // Returns LLViewerJointMesh + /*virtual*/ LLAvatarJoint* createAvatarJoint() override; // Returns LLViewerJoint + /*virtual*/ LLAvatarJoint* createAvatarJoint(S32 joint_num) override; // Returns LLViewerJoint + /*virtual*/ LLAvatarJointMesh* createAvatarJointMesh() override; // Returns LLViewerJointMesh public: void updateHeadOffset(); void debugBodySize() const; void postPelvisSetRecalc( void ); - /*virtual*/ BOOL loadSkeletonNode(); + /*virtual*/ BOOL loadSkeletonNode() override; void initAttachmentPoints(bool ignore_hud_joints = false); - /*virtual*/ void buildCharacter(); + /*virtual*/ void buildCharacter() override; void resetVisualParams(); void resetSkeleton(bool reset_animations); @@ -441,7 +441,7 @@ public: // Morph masks //-------------------------------------------------------------------- public: - /*virtual*/ void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES); + /*virtual*/ void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES) override; BOOL morphMaskNeedsUpdate(LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES); @@ -449,7 +449,7 @@ public: // Global colors //-------------------------------------------------------------------- public: - /*virtual*/void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake); + /*virtual*/void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) override; //-------------------------------------------------------------------- // Visibility @@ -540,7 +540,7 @@ public: // Loading status //-------------------------------------------------------------------- public: - virtual BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; + BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const override; virtual BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; virtual BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const; @@ -553,7 +553,7 @@ public: // Baked textures //-------------------------------------------------------------------- public: - /*virtual*/ LLTexLayerSet* createTexLayerSet(); // Return LLViewerTexLayerSet + /*virtual*/ LLTexLayerSet* createTexLayerSet() override; // Return LLViewerTexLayerSet void releaseComponentTextures(); // ! BACKWARDS COMPATIBILITY ! protected: static void onBakedTextureMasksLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); @@ -599,7 +599,7 @@ protected: // Composites //-------------------------------------------------------------------- public: - virtual void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result); + void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result) override; virtual void invalidateAll(); virtual void setCompositeUpdatesEnabled(bool b) {} virtual void setCompositeUpdatesEnabled(U32 index, bool b) {} @@ -635,15 +635,15 @@ private: public: void debugColorizeSubMeshes(U32 i, const LLColor4& color); - virtual void updateMeshTextures(); + void updateMeshTextures() override; void updateSexDependentLayerSets(BOOL upload_bake); - virtual void dirtyMesh(); // Dirty the avatar mesh + void dirtyMesh() override; // Dirty the avatar mesh void updateMeshData(); protected: void releaseMeshData(); virtual void restoreMeshData(); private: - virtual void dirtyMesh(S32 priority); // Dirty the avatar mesh, with priority + void dirtyMesh(S32 priority) override; // Dirty the avatar mesh, with priority LLViewerJoint* getViewerJoint(S32 idx); S32 mDirtyMesh; // 0 -- not dirty, 1 -- morphed, 2 -- LOD BOOL mMeshTexturesDirty; @@ -672,7 +672,7 @@ public: void applyParsedAppearanceMessage(LLAppearanceMessageContents& contents, bool slam_params); void hideSkirt(); void startAppearanceAnimation(); - /*virtual*/ void bodySizeChanged(); + /*virtual*/ void bodySizeChanged() override; //-------------------------------------------------------------------- // Appearance morphing @@ -683,14 +683,14 @@ public: // True if we are computing our appearance via local compositing // instead of baked textures, as for example during wearable // editing or when waiting for a subsequent server rebake. - /*virtual*/ BOOL isUsingLocalAppearance() const { return mUseLocalAppearance; } + /*virtual*/ BOOL isUsingLocalAppearance() const override { return mUseLocalAppearance; } - BOOL isUsingServerBakes() const; + BOOL isUsingServerBakes() const override; void setIsUsingServerBakes(BOOL newval); // True if we are currently in appearance editing mode. Often but // not always the same as isUsingLocalAppearance(). - /*virtual*/ BOOL isEditingAppearance() const { return mIsEditingAppearance; } + /*virtual*/ BOOL isEditingAppearance() const override { return mIsEditingAppearance; } // FIXME review isUsingLocalAppearance uses, some should be isEditing instead. @@ -728,7 +728,7 @@ public: static bool getRiggedMeshID( LLViewerObject* pVO, LLUUID& mesh_id ); void cleanupAttachedMesh( LLViewerObject* pVO ); static LLVOAvatar* findAvatarFromAttachment(LLViewerObject* obj); - /*virtual*/ BOOL isWearingWearableType(LLWearableType::EType type ) const; + /*virtual*/ BOOL isWearingWearableType(LLWearableType::EType type ) const override; LLViewerObject * findAttachmentByID( const LLUUID & target_id ) const; protected: @@ -866,9 +866,9 @@ private: **/ public: - /*virtual*/ BOOL setParent(LLViewerObject* parent); - /*virtual*/ void addChild(LLViewerObject *childp); - /*virtual*/ void removeChild(LLViewerObject *childp); + /*virtual*/ BOOL setParent(LLViewerObject* parent) override; + /*virtual*/ void addChild(LLViewerObject *childp) override; + /*virtual*/ void removeChild(LLViewerObject *childp) override; //-------------------------------------------------------------------- // Sitting diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 7b41b9d84c9eac9a18d8b62aaa4232fa4bd99746..45d0e2ba1fd25805beb9d9876a7c2ed709e71194 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -55,11 +55,11 @@ class LLVOAvatarSelf : public: LLVOAvatarSelf(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); virtual ~LLVOAvatarSelf(); - virtual void markDead(); - virtual void initInstance(); // Called after construction to initialize the class. + void markDead() override; + void initInstance() override; // Called after construction to initialize the class. void cleanup(); protected: - /*virtual*/ BOOL loadAvatar(); + /*virtual*/ BOOL loadAvatar() override; BOOL loadAvatarSelf(); BOOL buildSkeletonSelf(const LLAvatarSkeletonInfo *info); BOOL buildMenus(); @@ -80,24 +80,24 @@ public: boost::signals2::connection mRegionChangedSlot; void onSimulatorFeaturesReceived(const LLUUID& region_id); - /*virtual*/ void updateRegion(LLViewerRegion *regionp); - /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); + /*virtual*/ void updateRegion(LLViewerRegion *regionp) override; + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time) override; //-------------------------------------------------------------------- // LLCharacter interface and related //-------------------------------------------------------------------- public: - /*virtual*/ bool hasMotionFromSource(const LLUUID& source_id); - /*virtual*/ void stopMotionFromSource(const LLUUID& source_id); - /*virtual*/ void requestStopMotion(LLMotion* motion); - /*virtual*/ LLJoint* getJoint(const std::string &name); + /*virtual*/ bool hasMotionFromSource(const LLUUID& source_id) override; + /*virtual*/ void stopMotionFromSource(const LLUUID& source_id) override; + /*virtual*/ void requestStopMotion(LLMotion* motion) override; + /*virtual*/ LLJoint* getJoint(const std::string &name) override; - /*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake = FALSE); - /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake = FALSE); - /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake = FALSE); - /*virtual*/ void updateVisualParams(); + /*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake = FALSE) override; + /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake = FALSE) override; + /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake = FALSE) override; + /*virtual*/ void updateVisualParams() override; void writeWearablesToAvatar(); - /*virtual*/ void idleUpdateAppearanceAnimation(); + /*virtual*/ void idleUpdateAppearanceAnimation() override; private: // helper function. Passed in param is assumed to be in avatar's parameter list. @@ -117,14 +117,14 @@ private: **/ public: - /*virtual*/ bool isSelf() const { return true; } - /*virtual*/ BOOL isValid() const; + /*virtual*/ bool isSelf() const override { return true; } + /*virtual*/ BOOL isValid() const override; //-------------------------------------------------------------------- // Updates //-------------------------------------------------------------------- public: - /*virtual*/ BOOL updateCharacter(LLAgent &agent); + /*virtual*/ BOOL updateCharacter(LLAgent &agent) override; /*virtual*/ void idleUpdateTractorBeam(); bool checkStuckAppearance(); @@ -132,7 +132,7 @@ public: // Loading state //-------------------------------------------------------------------- public: - /*virtual*/ bool getIsCloud() const; + /*virtual*/ bool getIsCloud() const override; //-------------------------------------------------------------------- // Region state @@ -167,9 +167,9 @@ private: // LLVOAvatar Constants //-------------------------------------------------------------------- public: - /*virtual*/ LLViewerTexture::EBoostLevel getAvatarBoostLevel() const { return LLGLTexture::BOOST_AVATAR_SELF; } - /*virtual*/ LLViewerTexture::EBoostLevel getAvatarBakedBoostLevel() const { return LLGLTexture::BOOST_AVATAR_BAKED_SELF; } - /*virtual*/ S32 getTexImageSize() const { return LLVOAvatar::getTexImageSize()*4; } + /*virtual*/ LLViewerTexture::EBoostLevel getAvatarBoostLevel() const override { return LLGLTexture::BOOST_AVATAR_SELF; } + /*virtual*/ LLViewerTexture::EBoostLevel getAvatarBakedBoostLevel() const override { return LLGLTexture::BOOST_AVATAR_BAKED_SELF; } + /*virtual*/ S32 getTexImageSize() const override { return LLVOAvatar::getTexImageSize()*4; } /** Rendering ** ** @@ -191,9 +191,9 @@ public: BOOL isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const; BOOL isBakedTextureFinal(const LLAvatarAppearanceDefines::EBakedTextureIndex index) const; // If you want to check all textures of a given type, pass gAgentWearables.getWearableCount() for index - /*virtual*/ BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; - /*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; - /*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const; + /*virtual*/ BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const override; + /*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const override; + /*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const override; //-------------------------------------------------------------------- @@ -204,19 +204,19 @@ public: LLViewerFetchedTexture* getLocalTextureGL(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; const LLUUID& getLocalTextureID(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; void setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index); - /*virtual*/ void setLocalTexture(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerTexture* tex, BOOL baked_version_exits, U32 index); + /*virtual*/ void setLocalTexture(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerTexture* tex, BOOL baked_version_exits, U32 index) override; protected: - /*virtual*/ void setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type, BOOL baked_version_exists, U32 index); + /*virtual*/ void setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type, BOOL baked_version_exists, U32 index) override; void localTextureLoaded(BOOL succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); void getLocalTextureByteCount(S32* gl_byte_count) const; - /*virtual*/ void addLocalTextureStats(LLAvatarAppearanceDefines::ETextureIndex i, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked); + /*virtual*/ void addLocalTextureStats(LLAvatarAppearanceDefines::ETextureIndex i, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked) override; LLLocalTextureObject* getLocalTextureObject(LLAvatarAppearanceDefines::ETextureIndex i, U32 index) const; private: static void onLocalTextureLoaded(BOOL succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); - /*virtual*/ void setImage(const U8 te, LLViewerTexture *imagep, const U32 index); - /*virtual*/ LLViewerTexture* getImage(const U8 te, const U32 index) const; + /*virtual*/ void setImage(const U8 te, LLViewerTexture *imagep, const U32 index) override; + /*virtual*/ LLViewerTexture* getImage(const U8 te, const U32 index) const override; //-------------------------------------------------------------------- @@ -233,7 +233,7 @@ public: static void processRebakeAvatarTextures(LLMessageSystem* msg, void**); protected: - /*virtual*/ void removeMissingBakedTextures(); + /*virtual*/ void removeMissingBakedTextures() override; //-------------------------------------------------------------------- // Layers @@ -250,11 +250,11 @@ public: // Composites //-------------------------------------------------------------------- public: - /* virtual */ void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result); - /* virtual */ void invalidateAll(); - /* virtual */ void setCompositeUpdatesEnabled(bool b); // only works for self - /* virtual */ void setCompositeUpdatesEnabled(U32 index, bool b); - /* virtual */ bool isCompositeUpdateEnabled(U32 index); + /* virtual */ void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result) override; + /* virtual */ void invalidateAll() override; + /* virtual */ void setCompositeUpdatesEnabled(bool b) override; // only works for self + /* virtual */ void setCompositeUpdatesEnabled(U32 index, bool b) override; + /* virtual */ bool isCompositeUpdateEnabled(U32 index) override; void setupComposites(); void updateComposites(); @@ -280,7 +280,7 @@ private: ** MESHES **/ protected: - /*virtual*/ void restoreMeshData(); + /*virtual*/ void restoreMeshData() override; /** Meshes ** ** @@ -304,8 +304,8 @@ public: BOOL isWearingAttachment(const LLUUID& inv_item_id) const; LLViewerObject* getWornAttachment(const LLUUID& inv_item_id); bool getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const; - /*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object); - /*virtual*/ BOOL detachObject(LLViewerObject *viewer_object); + /*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object) override; + /*virtual*/ BOOL detachObject(LLViewerObject *viewer_object) override; static BOOL detachAttachmentIntoInventory(const LLUUID& item_id); //-------------------------------------------------------------------- @@ -337,7 +337,7 @@ public: // -- care and feeding of hover height. void setHoverIfRegionEnabled(); void sendHoverHeight() const; - /*virtual*/ void setHoverOffset(const LLVector3& hover_offset, bool send_update=true); + /*virtual*/ void setHoverOffset(const LLVector3& hover_offset, bool send_update=true) override; private: mutable LLVector3 mLastHoverOffsetSent; diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 649cd8361b073829751820303fe7ba8ae6836400..6209d0fd3ef002cec3bcc6f2d25bf92ff322e42c 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -62,18 +62,18 @@ BOOL check_write(LLAPRFile* apr_file, void* src, S32 n_bytes) //--------------------------------------------------------------------------- LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &dp) -: LLTrace::MemTrackable<LLVOCacheEntry, 16>("LLVOCacheEntry"), - LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY), +: LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY), + LLTrace::MemTrackable<LLVOCacheEntry, 16>("LLVOCacheEntry"), mLocalID(local_id), + mParentID(0), mCRC(crc), mUpdateFlags(-1), mHitCount(0), mDupeCount(0), mCRCChangeCount(0), - mState(INACTIVE), mSceneContrib(0.f), + mState(INACTIVE), mValid(TRUE), - mParentID(0), mBSphereRadius(-1.0f) { mBuffer = new U8[dp.getBufferSize()]; @@ -82,33 +82,33 @@ LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer & } LLVOCacheEntry::LLVOCacheEntry() -: LLTrace::MemTrackable<LLVOCacheEntry, 16>("LLVOCacheEntry"), - LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY), +: LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY), + LLTrace::MemTrackable<LLVOCacheEntry, 16>("LLVOCacheEntry"), mLocalID(0), + mParentID(0), mCRC(0), mUpdateFlags(-1), mHitCount(0), mDupeCount(0), mCRCChangeCount(0), - mBuffer(NULL), - mState(INACTIVE), + mBuffer(nullptr), mSceneContrib(0.f), + mState(INACTIVE), mValid(TRUE), - mParentID(0), mBSphereRadius(-1.0f) { mDP.assignBuffer(mBuffer, 0); } LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) -: LLTrace::MemTrackable<LLVOCacheEntry, 16>("LLVOCacheEntry"), - LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY), - mBuffer(NULL), +: LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY), + LLTrace::MemTrackable<LLVOCacheEntry, 16>("LLVOCacheEntry"), + mParentID(0), mUpdateFlags(-1), - mState(INACTIVE), + mBuffer(nullptr), mSceneContrib(0.f), + mState(INACTIVE), mValid(FALSE), - mParentID(0), mBSphereRadius(-1.0f) { S32 size = -1; @@ -159,7 +159,7 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) else { delete[] mBuffer ; - mBuffer = NULL ; + mBuffer = nullptr ; } } @@ -170,8 +170,8 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) mHitCount = 0; mDupeCount = 0; mCRCChangeCount = 0; - mBuffer = NULL; - mEntry = NULL; + mBuffer = nullptr; + mEntry = nullptr; mState = INACTIVE; } } @@ -288,7 +288,7 @@ void LLVOCacheEntry::addChild(LLVOCacheEntry* entry) mChildrenList.insert(entry); //update parent bbox - if(getEntry() != NULL && isState(INACTIVE)) + if(getEntry() != nullptr && isState(INACTIVE)) { updateParentBoundingInfo(entry); resetVisible(); @@ -309,7 +309,7 @@ void LLVOCacheEntry::removeChild(LLVOCacheEntry* entry) //remove the first child, and return it. LLVOCacheEntry* LLVOCacheEntry::getChild() { - LLVOCacheEntry* child = NULL; + LLVOCacheEntry* child = nullptr; vocache_entry_set_t::iterator iter = mChildrenList.begin(); if(iter != mChildrenList.end()) { @@ -325,7 +325,7 @@ LLDataPackerBinaryBuffer *LLVOCacheEntry::getDP() if (mDP.getBufferSize() == 0) { //LL_INFOS() << "Not getting cache entry, invalid!" << LL_ENDL; - return NULL; + return nullptr; } return &mDP; @@ -677,7 +677,7 @@ bool LLVOCachePartition::addEntry(LLViewerOctreeEntry* entry) void LLVOCachePartition::removeEntry(LLViewerOctreeEntry* entry) { - entry->getVOCacheEntry()->setGroup(NULL); + entry->getVOCacheEntry()->setGroup(nullptr); llassert(!entry->getGroup()); } @@ -688,8 +688,8 @@ public: LLVOCacheOctreeCull(LLCamera* camera, LLViewerRegion* regionp, const LLVector3& shift, bool use_object_cache_occlusion, F32 pixel_threshold, LLVOCachePartition* part) : LLViewerOctreeCull(camera), - mRegionp(regionp), mPartition(part), + mRegionp(regionp), mPixelThreshold(pixel_threshold) { mLocalShift = shift; @@ -697,7 +697,7 @@ public: mNearRadius = LLVOCacheEntry::sNearRadius; } - virtual bool earlyFail(LLViewerOctreeGroup* base_group) + bool earlyFail(LLViewerOctreeGroup* base_group) override { if( mUseObjectCacheOcclusion && base_group->getOctreeNode()->getParent()) //never occlusion cull the root node @@ -720,7 +720,7 @@ public: return false; } - virtual S32 frustumCheck(const LLViewerOctreeGroup* group) + S32 frustumCheck(const LLViewerOctreeGroup* group) override { #if 0 S32 res = AABBInRegionFrustumGroupBounds(group); @@ -735,7 +735,7 @@ public: return res; } - virtual S32 frustumCheckObjects(const LLViewerOctreeGroup* group) + S32 frustumCheckObjects(const LLViewerOctreeGroup* group) override { #if 0 S32 res = AABBInRegionFrustumObjectBounds(group); @@ -757,7 +757,7 @@ public: return res; } - virtual void processGroup(LLViewerOctreeGroup* base_group) + void processGroup(LLViewerOctreeGroup* base_group) override { if( !mUseObjectCacheOcclusion || !base_group->getOctreeNode()->getParent()) @@ -812,8 +812,8 @@ public: mLocalShift = shift; mSphereRadius = LLVOCacheEntry::sRearFarRadius; } - - virtual bool earlyFail(LLViewerOctreeGroup* base_group) + + bool earlyFail(LLViewerOctreeGroup* base_group) override { if( mUseObjectCacheOcclusion && base_group->getOctreeNode()->getParent()) //never occlusion cull the root node @@ -829,13 +829,13 @@ public: return false; } - virtual S32 frustumCheck(const LLViewerOctreeGroup* group) + S32 frustumCheck(const LLViewerOctreeGroup* group) override { const LLVector4a* exts = group->getExtents(); return backSphereCheck(exts[0], exts[1]); } - virtual S32 frustumCheckObjects(const LLViewerOctreeGroup* group) + S32 frustumCheckObjects(const LLViewerOctreeGroup* group) override { const LLVector4a* exts = group->getObjectExtents(); if(backSphereCheck(exts[0], exts[1])) @@ -847,7 +847,7 @@ public: return false; } - virtual void processGroup(LLViewerOctreeGroup* base_group) + void processGroup(LLViewerOctreeGroup* base_group) override { mRegionp->addVisibleGroup(base_group); return; @@ -1053,8 +1053,8 @@ const char* header_filename = "object.cache"; LLVOCache::LLVOCache(): mInitialized(false), mReadOnly(true), - mNumEntries(0), - mCacheSize(1) + mCacheSize(1), + mNumEntries(0) { mEnabled = gSavedSettings.getBOOL("ObjectCacheEnabled"); mLocalAPRFilePoolp = new LLVolatileAPRPool() ; @@ -1259,7 +1259,7 @@ void LLVOCache::readCacheHeader() if(success) { - HeaderEntryInfo* entry = NULL ; + HeaderEntryInfo* entry = nullptr ; mNumEntries = 0 ; U32 num_read = 0 ; while(num_read++ < MAX_NUM_OBJECT_ENTRIES) @@ -1274,7 +1274,7 @@ void LLVOCache::readCacheHeader() { LL_WARNS() << "Error reading cache header entry. (entry_index=" << mNumEntries << ")" << LL_ENDL; delete entry ; - entry = NULL ; + entry = nullptr ; break ; } else if(entry->mTime == INVALID_TIME) @@ -1285,7 +1285,7 @@ void LLVOCache::readCacheHeader() entry->mIndex = mNumEntries++ ; mHeaderEntryQueue.insert(entry) ; mHandleEntryMap[entry->mHandle] = entry ; - entry = NULL ; + entry = nullptr ; } if(entry) { @@ -1488,7 +1488,7 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry: entry = new HeaderEntryInfo(); entry->mHandle = handle ; - entry->mTime = time(NULL) ; + entry->mTime = time(nullptr) ; entry->mIndex = mNumEntries++; mHeaderEntryQueue.insert(entry) ; mHandleEntryMap[handle] = entry ; @@ -1501,7 +1501,7 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry: //resort mHeaderEntryQueue.erase(entry) ; - entry->mTime = time(NULL) ; + entry->mTime = time(nullptr) ; mHeaderEntryQueue.insert(entry) ; } diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 7aabde1b2da66d2ac36360dcaaf7db9080098efd..d079ff03ff59cadb9dcb032db4fa9c5247b187c0 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -111,7 +111,7 @@ public: void recordHit(); void recordDupe() { mDupeCount++; } - /*virtual*/ void setOctreeEntry(LLViewerOctreeEntry* entry); + /*virtual*/ void setOctreeEntry(LLViewerOctreeEntry* entry) override; void setParentID(U32 id); U32 getParentID() const {return mParentID;} @@ -179,7 +179,7 @@ public: LLVOCacheGroup(OctreeNode* node, LLViewerOctreePartition* part) : LLOcclusionCullingGroup(node, part){} //virtual - void handleChildAddition(const OctreeNode* parent, OctreeNode* child); + void handleChildAddition(const OctreeNode* parent, OctreeNode* child) override; protected: virtual ~LLVOCacheGroup(); @@ -192,7 +192,7 @@ public: bool addEntry(LLViewerOctreeEntry* entry); void removeEntry(LLViewerOctreeEntry* entry); - /*virtual*/ S32 cull(LLCamera &camera, bool do_occlusion); + /*virtual*/ S32 cull(LLCamera &camera, bool do_occlusion) override; void addOccluders(LLViewerOctreeGroup* gp); void resetOccluders(); void processOccluders(LLCamera* camera); diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 64b8692fc265c6af8d180eed3aa93b4b1fd8a854..657c04d05ae54057c205d18ad0954951b754fc0c 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -72,7 +72,7 @@ S32 LLVOGrass::sMaxGrassSpecies = 0; LLVOGrass::LLVOGrass(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : LLAlphaObject(id, pcode, regionp) { - mPatch = NULL; + mPatch = nullptr; mLastPatchUpdateTime = 0; mGrassVel.clearVec(); mGrassBend.clearVec(); @@ -454,7 +454,7 @@ void LLVOGrass::plantBlades() if (mDrawable->getNumFaces() < 1) { - mDrawable->setNumFaces(1, NULL, getTEImage(0)); + mDrawable->setNumFaces(1, nullptr, getTEImage(0)); } LLFace *face = mDrawable->getFace(0); @@ -463,7 +463,7 @@ void LLVOGrass::plantBlades() face->setTexture(getTEImage(0)); face->setState(LLFace::GLOBAL); face->setSize(mNumBlades * 8, mNumBlades * 12); - face->setVertexBuffer(NULL); + face->setVertexBuffer(nullptr); face->setTEOffset(0); face->mCenterLocal = mPosition + mRegionp->getOriginAgent(); } @@ -900,18 +900,18 @@ BOOL LLVOGrass::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& getTEImage(0)->getMask(hit_tc)) { closest_t = t; - if (intersection != NULL) + if (intersection != nullptr) { dir.mul(closest_t); intersection->setAdd(start, dir); } - if (tex_coord != NULL) + if (tex_coord != nullptr) { *tex_coord = hit_tc; } - if (normal != NULL) + if (normal != nullptr) { normal->load3(normal1.mV); } diff --git a/indra/newview/llvograss.h b/indra/newview/llvograss.h index e55e97cfc936514c5120b6b045e7b1751eded8ef..3367db6f51745235197c171a783713932df63d2b 100644 --- a/indra/newview/llvograss.h +++ b/indra/newview/llvograss.h @@ -42,48 +42,48 @@ public: static void initClass(); static void cleanupClass(); - virtual U32 getPartitionType() const; + U32 getPartitionType() const override; /*virtual*/ U32 processUpdateMessage(LLMessageSystem *mesgsys, void **user_data, U32 block_num, const EObjectUpdateType update_type, - LLDataPacker *dp); + LLDataPacker *dp) override; static void import(LLFILE *file, LLMessageSystem *mesgsys, const LLVector3 &pos); /*virtual*/ void exportFile(LLFILE *file, const LLVector3 &position); - void updateDrawable(BOOL force_damped); + void updateDrawable(BOOL force_damped) override; - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); + /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) override; + /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; /*virtual*/ void getGeometry(S32 idx, LLStrider<LLVector4a>& verticesp, LLStrider<LLVector3>& normalsp, LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, LLStrider<LLColor4U>& emissivep, - LLStrider<U16>& indicesp); + LLStrider<U16>& indicesp) override; - void updateFaceSize(S32 idx) { } - /*virtual*/ void updateTextures(); - /*virtual*/ BOOL updateLOD(); - /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area + void updateFaceSize(S32 idx) override { } + /*virtual*/ void updateTextures() override; + /*virtual*/ BOOL updateLOD() override; + /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent) override; // generate accurate apparent angle and area void plantBlades(); - /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. - /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); + /*virtual*/ BOOL isActive() const override; // Whether this object needs to do an idleUpdate. + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time) override; /*virtual*/ BOOL lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face = -1, // which face to check, -1 = ALL_SIDES BOOL pick_transparent = FALSE, BOOL pick_rigged = FALSE, - S32* face_hit = NULL, // which face was hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point - ); + S32* face_hit = nullptr, // which face was hit + LLVector4a* intersection = nullptr, // return the intersection point + LLVector2* tex_coord = nullptr, // return the texture coordinates of the intersection point + LLVector4a* normal = nullptr, // return the surface normal at the intersection point + LLVector4a* tangent = nullptr // return the surface tangent at the intersection point + ) override; static S32 sMaxGrassSpecies; diff --git a/indra/newview/llvoground.cpp b/indra/newview/llvoground.cpp index f60f1344ee030a0ee809ccc66329912a7b26c77d..e887ae37c9046cdec88e26346883c57e969340d0 100644 --- a/indra/newview/llvoground.cpp +++ b/indra/newview/llvoground.cpp @@ -69,7 +69,7 @@ LLDrawable *LLVOGround::createDrawable(LLPipeline *pipeline) mDrawable->setRenderType(LLPipeline::RENDER_TYPE_GROUND); LLDrawPoolGround *poolp = (LLDrawPoolGround*) gPipeline.getPool(LLDrawPool::POOL_GROUND); - mDrawable->addFace(poolp, NULL); + mDrawable->addFace(poolp, nullptr); return mDrawable; } @@ -87,7 +87,7 @@ BOOL LLVOGround::updateGeometry(LLDrawable *drawable) LLDrawPoolGround *poolp = (LLDrawPoolGround*) gPipeline.getPool(LLDrawPool::POOL_GROUND); if (drawable->getNumFaces() < 1) - drawable->addFace(poolp, NULL); + drawable->addFace(poolp, nullptr); face = drawable->getFace(0); if (!face) return TRUE; diff --git a/indra/newview/llvoground.h b/indra/newview/llvoground.h index a53f309e468eefcdaf546a7f569273aa8c4eba97..b1c3eec743c9f3c44cac1e209f84298c0365c1e5 100644 --- a/indra/newview/llvoground.h +++ b/indra/newview/llvoground.h @@ -41,13 +41,13 @@ protected: public: LLVOGround(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time) override; // Graphical stuff for objects - maybe broken out into render class // later? - /*virtual*/ void updateTextures(); - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); + /*virtual*/ void updateTextures() override; + /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) override; + /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; void cleanupGL(); }; diff --git a/indra/newview/llvoicecallhandler.cpp b/indra/newview/llvoicecallhandler.cpp index 9002d51e0cf69df47745d098b0c1e51029f39a52..f8b1484799c034946d028eaa2ff47256d62addfc 100644 --- a/indra/newview/llvoicecallhandler.cpp +++ b/indra/newview/llvoicecallhandler.cpp @@ -40,7 +40,7 @@ public: { } - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { if (!LLUI::sSettingGroups["config"]->getBOOL("EnableVoiceCall")) { diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 8fb0641e07ac949c7614486429f55ce0993c84d0..4f0c5a0ea6bd378fd5fc428f0038aee8300cf0f3 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -42,8 +42,8 @@ LLVoiceChannel::voice_channel_map_t LLVoiceChannel::sVoiceChannelMap; LLVoiceChannel::voice_channel_map_uri_t LLVoiceChannel::sVoiceChannelURIMap; -LLVoiceChannel* LLVoiceChannel::sCurrentVoiceChannel = NULL; -LLVoiceChannel* LLVoiceChannel::sSuspendedVoiceChannel = NULL; +LLVoiceChannel* LLVoiceChannel::sCurrentVoiceChannel = nullptr; +LLVoiceChannel* LLVoiceChannel::sSuspendedVoiceChannel = nullptr; LLVoiceChannel::channel_changed_signal_t LLVoiceChannel::sCurrentVoiceChannelChangedSignal; BOOL LLVoiceChannel::sSuspended = FALSE; @@ -57,12 +57,12 @@ const U32 DEFAULT_RETRIES_COUNT = 3; // LLVoiceChannel // LLVoiceChannel::LLVoiceChannel(const LLUUID& session_id, const std::string& session_name) : + mCallDirection(OUTGOING_CALL), mSessionID(session_id), - mState(STATE_NO_CHANNEL_INFO), + mState(STATE_NO_CHANNEL_INFO), mSessionName(session_name), - mCallDirection(OUTGOING_CALL), - mIgnoreNextSessionLeave(FALSE), - mCallEndedByAgent(false) + mCallEndedByAgent(false), + mIgnoreNextSessionLeave(FALSE) { mNotifyArgs["VOICE_CHANNEL_NAME"] = mSessionName; @@ -289,7 +289,7 @@ LLVoiceChannel* LLVoiceChannel::getChannelByID(const LLUUID& session_id) voice_channel_map_t::iterator found_it = sVoiceChannelMap.find(session_id); if (found_it == sVoiceChannelMap.end()) { - return NULL; + return nullptr; } else { @@ -303,7 +303,7 @@ LLVoiceChannel* LLVoiceChannel::getChannelByURI(std::string uri) voice_channel_map_uri_t::iterator found_it = sVoiceChannelURIMap.find(uri); if (found_it == sVoiceChannelURIMap.end()) { - return NULL; + return nullptr; } else { diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index 714bbebaf383d54dfbc28a59c69447643a69edbb..1b13585bf93dc794c2dbba3509667d16b0e390c0 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -66,7 +66,7 @@ public: LLVoiceChannel(const LLUUID& session_id, const std::string& session_name); virtual ~LLVoiceChannel(); - /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal) override; virtual void handleStatusChange(EStatusType status); virtual void handleError(EStatusType status); @@ -146,17 +146,17 @@ class LLVoiceChannelGroup : public LLVoiceChannel public: LLVoiceChannelGroup(const LLUUID& session_id, const std::string& session_name); - /*virtual*/ void handleStatusChange(EStatusType status); - /*virtual*/ void handleError(EStatusType status); - /*virtual*/ void activate(); - /*virtual*/ void deactivate(); + /*virtual*/ void handleStatusChange(EStatusType status) override; + /*virtual*/ void handleError(EStatusType status) override; + /*virtual*/ void activate() override; + /*virtual*/ void deactivate() override; /*vritual*/ void setChannelInfo( const std::string& uri, - const std::string& credentials); - /*virtual*/ void getChannelInfo(); + const std::string& credentials) override; + /*virtual*/ void getChannelInfo() override; protected: - virtual void setState(EState state); + void setState(EState state) override; private: void voiceCallCapCoro(std::string url); @@ -170,12 +170,12 @@ class LLVoiceChannelProximal : public LLVoiceChannel, public LLSingleton<LLVoice LLSINGLETON(LLVoiceChannelProximal); public: - /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); - /*virtual*/ void handleStatusChange(EStatusType status); - /*virtual*/ void handleError(EStatusType status); - /*virtual*/ BOOL isActive(); - /*virtual*/ void activate(); - /*virtual*/ void deactivate(); + /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal) override; + /*virtual*/ void handleStatusChange(EStatusType status) override; + /*virtual*/ void handleError(EStatusType status) override; + /*virtual*/ BOOL isActive() override; + /*virtual*/ void activate() override; + /*virtual*/ void deactivate() override; }; @@ -184,15 +184,15 @@ class LLVoiceChannelP2P : public LLVoiceChannelGroup public: LLVoiceChannelP2P(const LLUUID& session_id, const std::string& session_name, const LLUUID& other_user_id); - /*virtual*/ void handleStatusChange(EStatusType status); - /*virtual*/ void handleError(EStatusType status); - /*virtual*/ void activate(); - /*virtual*/ void getChannelInfo(); + /*virtual*/ void handleStatusChange(EStatusType status) override; + /*virtual*/ void handleError(EStatusType status) override; + /*virtual*/ void activate() override; + /*virtual*/ void getChannelInfo() override; void setSessionHandle(const std::string& handle, const std::string &inURI); protected: - virtual void setState(EState state); + void setState(EState state) override; private: diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 1fa7e62fdf9298974af84e260625252b520c9c5d..678535091b5372cbf0bbf73202d04c05087ff341 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -54,7 +54,7 @@ public: // requests will be throttled from a non-trusted browser LLVoiceHandler() : LLCommandHandler("voice", UNTRUSTED_THROTTLE) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { if (params[0].asString() == "effects") { @@ -114,8 +114,8 @@ std::string LLVoiceClientStatusObserver::status2string(LLVoiceClientStatusObserv LLVoiceClient::LLVoiceClient() : - mVoiceModule(NULL), - m_servicePump(NULL), + mVoiceModule(nullptr), + m_servicePump(nullptr), mVoiceEffectEnabled(LLCachedControl<bool>(gSavedSettings, "VoiceMorphingEnabled", true)), mVoiceEffectDefault(LLCachedControl<std::string>(gSavedPerAccountSettings, "VoiceEffectDefault", "00000000-0000-0000-0000-000000000000")), mPTTDirty(true), @@ -156,7 +156,7 @@ void LLVoiceClient::userAuthorized(const std::string& user_id, const LLUUID &age } else { - mVoiceModule = NULL; + mVoiceModule = nullptr; return; } mVoiceModule->init(m_servicePump); @@ -166,7 +166,7 @@ void LLVoiceClient::userAuthorized(const std::string& user_id, const LLUUID &age void LLVoiceClient::terminate() { if (mVoiceModule) mVoiceModule->terminate(); - mVoiceModule = NULL; + mVoiceModule = nullptr; if (LLSpeakerVolumeStorage::instanceExists()) { @@ -860,10 +860,11 @@ LLVoiceEffectInterface* LLVoiceClient::getVoiceEffectInterface() const class LLViewerRequiredVoiceVersion : public LLHTTPNode { static BOOL sAlertedUser; - virtual void post( + + void post( LLHTTPNode::ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { //You received this messsage (most likely on region cross or //teleport) @@ -890,10 +891,10 @@ class LLViewerRequiredVoiceVersion : public LLHTTPNode class LLViewerParcelVoiceInfo : public LLHTTPNode { - virtual void post( + void post( LLHTTPNode::ResponsePtr response, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { //the parcel you are in has changed something about its //voice information diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp index 4dc209a790ce4ac5b4343120ed7e4f40a1f0dc49..2bf40a9d793d81a856242c8c7bc358c760db4c82 100644 --- a/indra/newview/llvoicevisualizer.cpp +++ b/indra/newview/llvoicevisualizer.cpp @@ -79,15 +79,15 @@ const LLVector3 WORLD_UPWARD_DIRECTION = LLVector3( 0.0f, 0.0f, 1.0f ); // Z is //------------------------------------------------------------------ bool LLVoiceVisualizer::sPrefsInitialized = false; BOOL LLVoiceVisualizer::sLipSyncEnabled = FALSE; -F32* LLVoiceVisualizer::sOoh = NULL; -F32* LLVoiceVisualizer::sAah = NULL; +F32* LLVoiceVisualizer::sOoh = nullptr; +F32* LLVoiceVisualizer::sAah = nullptr; U32 LLVoiceVisualizer::sOohs = 0; U32 LLVoiceVisualizer::sAahs = 0; F32 LLVoiceVisualizer::sOohAahRate = 0.0f; -F32* LLVoiceVisualizer::sOohPowerTransfer = NULL; +F32* LLVoiceVisualizer::sOohPowerTransfer = nullptr; U32 LLVoiceVisualizer::sOohPowerTransfers = 0; F32 LLVoiceVisualizer::sOohPowerTransfersf = 0.0f; -F32* LLVoiceVisualizer::sAahPowerTransfer = NULL; +F32* LLVoiceVisualizer::sAahPowerTransfer = nullptr; U32 LLVoiceVisualizer::sAahPowerTransfers = 0; F32 LLVoiceVisualizer::sAahPowerTransfersf = 0.0f; diff --git a/indra/newview/llvoicevisualizer.h b/indra/newview/llvoicevisualizer.h index 36c78252d13556c5fc72a0904ee1d996b0bc271f..7432bedacb5dc7084780f78b955d48e4fc014a01 100644 --- a/indra/newview/llvoicevisualizer.h +++ b/indra/newview/llvoicevisualizer.h @@ -84,10 +84,10 @@ class LLVoiceVisualizer : public LLHUDEffect bool getCurrentlySpeaking(); // the get for the above set VoiceGesticulationLevel getCurrentGesticulationLevel(); // based on voice amplitude, I'll give you the current "energy level" of avatar speech void lipSyncOohAah( F32& ooh, F32& aah ); - void render(); // inherited from HUD Effect - void packData(LLMessageSystem *mesgsys); // inherited from HUD Effect - void unpackData(LLMessageSystem *mesgsys, S32 blocknum); // inherited from HUD Effect - void markDead(); // inherited from HUD Effect + void render() override; // inherited from HUD Effect + void packData(LLMessageSystem *mesgsys) override; // inherited from HUD Effect + void unpackData(LLMessageSystem *mesgsys, S32 blocknum) override; // inherited from HUD Effect + void markDead() override; // inherited from HUD Effect //---------------------------------------------------------------------------------------------- // "setMaxGesticulationAmplitude" and "setMinGesticulationAmplitude" allow for the tuning of the diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 242a9f1b92b547b98780a2fa3ced32e9a78441f7..798012e3cdb99a62a73914be231c8f4505d246fd 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -143,7 +143,7 @@ static int scale_speaker_volume(float volume) class LLVivoxVoiceClientMuteListObserver : public LLMuteListObserver { - /* virtual */ void onChange() { LLVivoxVoiceClient::getInstance()->muteListChanged();} + /* virtual */ void onChange() override { LLVivoxVoiceClient::getInstance()->muteListChanged();} }; @@ -169,69 +169,69 @@ static void killGateway() /////////////////////////////////////////////////////////////////////////////////////////////// LLVivoxVoiceClient::LLVivoxVoiceClient() : + mAvatarNameCacheConnection(), mSessionTerminateRequested(false), mRelogRequested(false), + mSpatialJoiningNum(0), mConnected(false), mTerminateDaemon(false), - mPump(NULL), - mSpatialJoiningNum(0), + mPump(nullptr), mTuningMode(false), mTuningEnergy(0.0f), mTuningMicVolume(0), - mTuningMicVolumeDirty(true), - mTuningSpeakerVolume(50), // Set to 50 so the user can hear himself when he sets his mic volume + mTuningMicVolumeDirty(true), // Set to 50 so the user can hear himself when he sets his mic volume + mTuningSpeakerVolume(50), mTuningSpeakerVolumeDirty(true), - mDevicesListUpdated(false), + mDevicesListUpdated(false), mAreaVoiceDisabled(false), mAudioSession(), mAudioSessionChanged(false), - mNextAudioSession(), - mCurrentParcelLocalID(0), + mNextAudioSession(), + mCurrentParcelLocalID(0), mConnectorEstablished(false), - mAccountLoggedIn(false), + mAccountLoggedIn(false), mNumberOfAliases(0), mCommandCookie(0), - mLoginRetryCount(0), + mLoginRetryCount(0), mBuddyListMapPopulated(false), mBlockRulesListReceived(false), - mAutoAcceptRulesListReceived(false), + mAutoAcceptRulesListReceived(false), mCaptureDeviceDirty(false), mRenderDeviceDirty(false), - mSpatialCoordsDirty(false), mIsInitialized(false), + mShutdownComplete(true), + mSpatialCoordsDirty(false), mMuteMic(false), + mMuteMicDirty(false), mFriendsListDirty(true), - mEarLocation(0), mSpeakerVolumeDirty(true), mSpeakerMuteDirty(true), + mMicVolume(0), mMicVolumeDirty(true), mVoiceEnabled(false), - mWriteInProgress(false), + mWriteInProgress(false), mLipSyncEnabled(false), - mVoiceFontsReceived(false), + mVoiceFontsNew(false), mVoiceFontListDirty(false), - mCaptureBufferMode(false), mCaptureBufferRecording(false), mCaptureBufferRecorded(false), mCaptureBufferPlaying(false), - mShutdownComplete(true), - mPlayRequestCount(0), - mAvatarNameCacheConnection(), + mPlayRequestCount(0), mIsInTuningMode(false), mIsInChannel(false), mIsJoiningSession(false), @@ -808,7 +808,7 @@ bool LLVivoxVoiceClient::provisionVoiceAccount() LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("voiceAccountProvision", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = boost::make_shared<LLCore::HttpOptions>(); int retryCount(0); LLSD result; @@ -1080,7 +1080,7 @@ bool LLVivoxVoiceClient::requestParcelVoiceInfo() //_INFOS("Voice") << "Requesting voice info for Parcel" << LL_ENDL; LLViewerRegion * region = gAgent.getRegion(); - if (region == NULL || !region->capabilitiesReceived()) + if (region == nullptr || !region->capabilitiesReceived()) { LL_DEBUGS("Voice") << "ParcelVoiceInfoRequest capability not yet available, deferring" << LL_ENDL; return false; @@ -1457,7 +1457,7 @@ bool LLVivoxVoiceClient::waitForChannel() { recordingAndPlaybackMode(); } - else if (checkParcelChanged() || (mNextAudioSession == NULL)) + else if (checkParcelChanged() || (mNextAudioSession == nullptr)) { // the parcel is changed, or we have no pending audio sessions, // so try to request the parcel voice info @@ -3841,13 +3841,13 @@ void LLVivoxVoiceClient::muteListChanged() // Managing list of participants LLVivoxVoiceClient::participantState::participantState(const std::string &uri) : mURI(uri), - mPTT(false), - mIsSpeaking(false), - mIsModeratorMuted(false), mLastSpokeTimestamp(0.f), mPower(0.f), mVolume(LLVoiceClient::VOLUME_DEFAULT), - mUserVolume(0), + mUserVolume(0), + mPTT(false), + mIsSpeaking(false), + mIsModeratorMuted(false), mOnMuteList(false), mVolumeSet(false), mVolumeDirty(false), @@ -4311,7 +4311,7 @@ void LLVivoxVoiceClient::endUserIMSession(const LLUUID &uuid) } bool LLVivoxVoiceClient::isValidChannel(std::string &sessionHandle) { - return(findSession(sessionHandle) != NULL); + return(findSession(sessionHandle) != nullptr); } bool LLVivoxVoiceClient::answerInvite(std::string &sessionHandle) @@ -4378,7 +4378,7 @@ BOOL LLVivoxVoiceClient::isSessionCallBackPossible(const LLUUID &session_id) BOOL result = TRUE; sessionStatePtr_t session(findSession(session_id)); - if(session != NULL) + if(session != nullptr) { result = session->isCallBackPossible(); } @@ -4393,7 +4393,7 @@ BOOL LLVivoxVoiceClient::isSessionTextIMPossible(const LLUUID &session_id) bool result = TRUE; sessionStatePtr_t session(findSession(session_id)); - if(session != NULL) + if(session != nullptr) { result = session->isTextIMPossible(); } @@ -5045,7 +5045,7 @@ void LLVivoxVoiceClient::recordingLoopSave(const std::string& filename) { // LL_DEBUGS("Voice") << "sending SessionGroup.ControlRecording (Flush)" << LL_ENDL; - if(mAudioSession != NULL && !mAudioSession->mGroupHandle.empty()) + if(mAudioSession != nullptr && !mAudioSession->mGroupHandle.empty()) { std::ostringstream stream; stream @@ -5063,7 +5063,7 @@ void LLVivoxVoiceClient::recordingStop() { // LL_DEBUGS("Voice") << "sending SessionGroup.ControlRecording (Stop)" << LL_ENDL; - if(mAudioSession != NULL && !mAudioSession->mGroupHandle.empty()) + if(mAudioSession != nullptr && !mAudioSession->mGroupHandle.empty()) { std::ostringstream stream; stream @@ -5080,7 +5080,7 @@ void LLVivoxVoiceClient::filePlaybackStart(const std::string& filename) { // LL_DEBUGS("Voice") << "sending SessionGroup.ControlPlayback (Start)" << LL_ENDL; - if(mAudioSession != NULL && !mAudioSession->mGroupHandle.empty()) + if(mAudioSession != nullptr && !mAudioSession->mGroupHandle.empty()) { std::ostringstream stream; stream @@ -5098,7 +5098,7 @@ void LLVivoxVoiceClient::filePlaybackStop() { // LL_DEBUGS("Voice") << "sending SessionGroup.ControlPlayback (Stop)" << LL_ENDL; - if(mAudioSession != NULL && !mAudioSession->mGroupHandle.empty()) + if(mAudioSession != nullptr && !mAudioSession->mGroupHandle.empty()) { std::ostringstream stream; stream @@ -5829,7 +5829,7 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, font_id.generate(llformat("%d:%s", font_type, name.c_str())); } - voiceFontEntry *font = NULL; + voiceFontEntry *font = nullptr; voice_font_map_t& font_map = template_font ? mVoiceFontTemplateMap : mVoiceFontMap; voice_effect_list_t& font_list = template_font ? mVoiceFontTemplateList : mVoiceFontList; @@ -6182,7 +6182,7 @@ void LLVivoxVoiceClient::removeObserver(LLVoiceEffectObserver* observer) bool LLVivoxVoiceClient::onCheckVoiceEffect(const std::string& voice_effect_name) { LLVoiceEffectInterface * effect_interfacep = LLVoiceClient::instance().getVoiceEffectInterface(); - if (NULL != effect_interfacep) + if (nullptr != effect_interfacep) { const LLUUID& currect_voice_effect_id = effect_interfacep->getVoiceEffect(); @@ -6210,7 +6210,7 @@ bool LLVivoxVoiceClient::onCheckVoiceEffect(const std::string& voice_effect_name void LLVivoxVoiceClient::onClickVoiceEffect(const std::string& voice_effect_name) { LLVoiceEffectInterface * effect_interfacep = LLVoiceClient::instance().getVoiceEffectInterface(); - if (NULL != effect_interfacep) + if (nullptr != effect_interfacep) { if (voice_effect_name == "NoVoiceMorphing") { @@ -6245,7 +6245,7 @@ void LLVivoxVoiceClient::updateVoiceMorphingMenu() { LLMenuGL * voice_morphing_menup = gMenuBarView->findChildMenuByName("VoiceMorphing", TRUE); - if (NULL != voice_morphing_menup) + if (nullptr != voice_morphing_menup) { S32 items = voice_morphing_menup->getItemCount(); if (items > 0) @@ -6472,7 +6472,7 @@ void LLVivoxVoiceClient::captureBufferPlayStopSendMessage() LLVivoxProtocolParser::LLVivoxProtocolParser() { - parser = XML_ParserCreate(NULL); + parser = XML_ParserCreate(nullptr); reset(); } @@ -6542,7 +6542,7 @@ LLIOPipe::EStatus LLVivoxProtocolParser::process_impl( // Reset internal state of the LLVivoxProtocolParser (no effect on the expat parser) reset(); - XML_ParserReset(parser, NULL); + XML_ParserReset(parser, nullptr); XML_SetElementHandler(parser, ExpatStartTag, ExpatEndTag); XML_SetCharacterDataHandler(parser, ExpatCharHandler); XML_SetUserData(parser, this); @@ -6732,21 +6732,21 @@ void LLVivoxProtocolParser::EndTag(const char *tag) // Closing a tag. Finalize the text we've accumulated and reset if (!stricmp("ReturnCode", tag)) - returnCode = strtol(string.c_str(), NULL, 10); + returnCode = strtol(string.c_str(), nullptr, 10); else if (!stricmp("SessionHandle", tag)) sessionHandle = string; else if (!stricmp("SessionGroupHandle", tag)) sessionGroupHandle = string; else if (!stricmp("StatusCode", tag)) - statusCode = strtol(string.c_str(), NULL, 10); + statusCode = strtol(string.c_str(), nullptr, 10); else if (!stricmp("StatusString", tag)) statusString = string; else if (!stricmp("ParticipantURI", tag)) uriString = string; else if (!stricmp("Volume", tag)) - volume = strtol(string.c_str(), NULL, 10); + volume = strtol(string.c_str(), nullptr, 10); else if (!stricmp("Energy", tag)) - energy = (F32)strtod(string.c_str(), NULL); + energy = (F32)strtod(string.c_str(), nullptr); else if (!stricmp("IsModeratorMuted", tag)) isModeratorMuted = !stricmp(string.c_str(), "true"); else if (!stricmp("IsSpeaking", tag)) @@ -6754,7 +6754,7 @@ void LLVivoxProtocolParser::EndTag(const char *tag) else if (!stricmp("Alias", tag)) alias = string; else if (!stricmp("NumberOfAliases", tag)) - numberOfAliases = strtol(string.c_str(), NULL, 10); + numberOfAliases = strtol(string.c_str(), nullptr, 10); else if (!stricmp("Application", tag)) applicationString = string; else if (!stricmp("ConnectorHandle", tag)) @@ -6764,7 +6764,7 @@ void LLVivoxProtocolParser::EndTag(const char *tag) else if (!stricmp("AccountHandle", tag)) accountHandle = string; else if (!stricmp("State", tag)) - state = strtol(string.c_str(), NULL, 10); + state = strtol(string.c_str(), nullptr, 10); else if (!stricmp("URI", tag)) uriString = string; else if (!stricmp("IsChannel", tag)) @@ -6784,11 +6784,11 @@ void LLVivoxProtocolParser::EndTag(const char *tag) else if (!stricmp("AccountName", tag)) nameString = string; else if (!stricmp("ParticipantType", tag)) - participantType = strtol(string.c_str(), NULL, 10); + participantType = strtol(string.c_str(), nullptr, 10); else if (!stricmp("IsLocallyMuted", tag)) isLocallyMuted = !stricmp(string.c_str(), "true"); else if (!stricmp("MicEnergy", tag)) - energy = (F32)strtod(string.c_str(), NULL); + energy = (F32)strtod(string.c_str(), nullptr); else if (!stricmp("ChannelName", tag)) nameString = string; else if (!stricmp("ChannelURI", tag)) @@ -6845,7 +6845,7 @@ void LLVivoxProtocolParser::EndTag(const char *tag) } else if (!stricmp("ID", tag)) { - id = strtol(string.c_str(), NULL, 10); + id = strtol(string.c_str(), nullptr, 10); } else if (!stricmp("Description", tag)) { @@ -6861,11 +6861,11 @@ void LLVivoxProtocolParser::EndTag(const char *tag) } else if (!stricmp("Type", tag)) { - fontType = strtol(string.c_str(), NULL, 10); + fontType = strtol(string.c_str(), nullptr, 10); } else if (!stricmp("Status", tag)) { - fontStatus = strtol(string.c_str(), NULL, 10); + fontStatus = strtol(string.c_str(), nullptr, 10); } else if (!stricmp("MediaCompletionType", tag)) { diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index d3bb847e6f698c47aeaf7337df42be9d6c8032dd..de3f6a7a6a5ce91a61c74e58ce2fd5d9a1a55cb2 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -64,26 +64,26 @@ public: /// @name LLVoiceModuleInterface virtual implementations /// @see LLVoiceModuleInterface //@{ - virtual void init(LLPumpIO *pump); // Call this once at application startup (creates connector) - virtual void terminate(); // Call this to clean up during shutdown - - virtual const LLVoiceVersionInfo& getVersion(); - - virtual void updateSettings(); // call after loading settings and whenever they change + void init(LLPumpIO *pump) override; // Call this once at application startup (creates connector) + void terminate() override; // Call this to clean up during shutdown + + const LLVoiceVersionInfo& getVersion() override; + + void updateSettings() override; // call after loading settings and whenever they change // Returns true if vivox has successfully logged in and is not in error state - virtual bool isVoiceWorking() const; + bool isVoiceWorking() const override; ///////////////////// /// @name Tuning //@{ - virtual void tuningStart(); - virtual void tuningStop(); - virtual bool inTuningMode(); - - virtual void tuningSetMicVolume(float volume); - virtual void tuningSetSpeakerVolume(float volume); - virtual float tuningGetEnergy(void); + void tuningStart() override; + void tuningStop() override; + bool inTuningMode() override; + + void tuningSetMicVolume(float volume) override; + void tuningSetSpeakerVolume(float volume) override; + float tuningGetEnergy(void) override; //@} ///////////////////// @@ -91,40 +91,40 @@ public: //@{ // This returns true when it's safe to bring up the "device settings" dialog in the prefs. // i.e. when the daemon is running and connected, and the device lists are populated. - virtual bool deviceSettingsAvailable(); - virtual bool deviceSettingsUpdated(); //return if the list has been updated and never fetched, only to be called from the voicepanel. + bool deviceSettingsAvailable() override; + bool deviceSettingsUpdated() override; //return if the list has been updated and never fetched, only to be called from the voicepanel. // Requery the vivox daemon for the current list of input/output devices. // If you pass true for clearCurrentList, deviceSettingsAvailable() will be false until the query has completed // (use this if you want to know when it's done). // If you pass false, you'll have no way to know when the query finishes, but the device lists will not appear empty in the interim. - virtual void refreshDeviceLists(bool clearCurrentList = true); - - virtual void setCaptureDevice(const std::string& name); - virtual void setRenderDevice(const std::string& name); - - virtual LLVoiceDeviceList& getCaptureDevices(); - virtual LLVoiceDeviceList& getRenderDevices(); + void refreshDeviceLists(bool clearCurrentList = true) override; + + void setCaptureDevice(const std::string& name) override; + void setRenderDevice(const std::string& name) override; + + LLVoiceDeviceList& getCaptureDevices() override; + LLVoiceDeviceList& getRenderDevices() override; //@} - - virtual void getParticipantList(std::set<LLUUID> &participants); - virtual bool isParticipant(const LLUUID& speaker_id); + + void getParticipantList(std::set<LLUUID> &participants) override; + bool isParticipant(const LLUUID& speaker_id) override; // Send a text message to the specified user, initiating the session if necessary. // virtual BOOL sendTextMessage(const LLUUID& participant_id, const std::string& message) const {return false;}; // close any existing text IM session with the specified user - virtual void endUserIMSession(const LLUUID &uuid); + void endUserIMSession(const LLUUID &uuid) override; // Returns true if calling back the session URI after the session has closed is possible. // Currently this will be false only for PSTN P2P calls. // NOTE: this will return true if the session can't be found. - virtual BOOL isSessionCallBackPossible(const LLUUID &session_id); + BOOL isSessionCallBackPossible(const LLUUID &session_id) override; // Returns true if the session can accepte text IM's. // Currently this will be false only for PSTN P2P calls. // NOTE: this will return true if the session can't be found. - virtual BOOL isSessionTextIMPossible(const LLUUID &session_id); + BOOL isSessionTextIMPossible(const LLUUID &session_id) override; //////////////////////////// @@ -132,21 +132,21 @@ public: //@{ // returns true iff the user is currently in a proximal (local spatial) channel. // Note that gestures should only fire if this returns true. - virtual bool inProximalChannel(); - - virtual void setNonSpatialChannel(const std::string &uri, - const std::string &credentials); - - virtual bool setSpatialChannel(const std::string &uri, - const std::string &credentials); - - virtual void leaveNonSpatialChannel(); - - virtual void leaveChannel(void); + bool inProximalChannel() override; + + void setNonSpatialChannel(const std::string &uri, + const std::string &credentials) override; + + bool setSpatialChannel(const std::string &uri, + const std::string &credentials) override; + + void leaveNonSpatialChannel() override; + + void leaveChannel(void) override; // Returns the URI of the current channel, or an empty string if not currently in a channel. // NOTE that it will return an empty string if it's in the process of joining a channel. - virtual std::string getCurrentChannel(); + std::string getCurrentChannel() override; //@} @@ -154,59 +154,59 @@ public: /// @name invitations //@{ // start a voice channel with the specified user - virtual void callUser(const LLUUID &uuid); - virtual bool isValidChannel(std::string &channelHandle); - virtual bool answerInvite(std::string &channelHandle); - virtual void declineInvite(std::string &channelHandle); + void callUser(const LLUUID &uuid) override; + bool isValidChannel(std::string &channelHandle) override; + bool answerInvite(std::string &channelHandle) override; + void declineInvite(std::string &channelHandle) override; //@} ///////////////////////// /// @name Volume/gain //@{ - virtual void setVoiceVolume(F32 volume); - virtual void setMicGain(F32 volume); + void setVoiceVolume(F32 volume) override; + void setMicGain(F32 volume) override; //@} ///////////////////////// /// @name enable disable voice and features //@{ - virtual bool voiceEnabled(); - virtual void setVoiceEnabled(bool enabled); - virtual BOOL lipSyncEnabled(); - virtual void setLipSyncEnabled(BOOL enabled); - virtual void setMuteMic(bool muted); // Set the mute state of the local mic. + bool voiceEnabled() override; + void setVoiceEnabled(bool enabled) override; + BOOL lipSyncEnabled() override; + void setLipSyncEnabled(BOOL enabled) override; + void setMuteMic(bool muted) override; // Set the mute state of the local mic. //@} ////////////////////////// /// @name nearby speaker accessors //@{ - virtual BOOL getVoiceEnabled(const LLUUID& id); // true if we've received data for this avatar - virtual std::string getDisplayName(const LLUUID& id); - virtual BOOL isParticipantAvatar(const LLUUID &id); - virtual BOOL getIsSpeaking(const LLUUID& id); - virtual BOOL getIsModeratorMuted(const LLUUID& id); - virtual F32 getCurrentPower(const LLUUID& id); // "power" is related to "amplitude" in a defined way. I'm just not sure what the formula is... - virtual BOOL getOnMuteList(const LLUUID& id); - virtual F32 getUserVolume(const LLUUID& id); - virtual void setUserVolume(const LLUUID& id, F32 volume); // set's volume for specified agent, from 0-1 (where .5 is nominal) + BOOL getVoiceEnabled(const LLUUID& id) override; // true if we've received data for this avatar + std::string getDisplayName(const LLUUID& id) override; + BOOL isParticipantAvatar(const LLUUID &id) override; + BOOL getIsSpeaking(const LLUUID& id) override; + BOOL getIsModeratorMuted(const LLUUID& id) override; + F32 getCurrentPower(const LLUUID& id) override; // "power" is related to "amplitude" in a defined way. I'm just not sure what the formula is... + BOOL getOnMuteList(const LLUUID& id) override; + F32 getUserVolume(const LLUUID& id) override; + void setUserVolume(const LLUUID& id, F32 volume) override; // set's volume for specified agent, from 0-1 (where .5 is nominal) //@} // authorize the user - virtual void userAuthorized(const std::string& user_id, - const LLUUID &agentID); + void userAuthorized(const std::string& user_id, + const LLUUID &agentID) override; ////////////////////////////// /// @name Status notification //@{ - virtual void addObserver(LLVoiceClientStatusObserver* observer); - virtual void removeObserver(LLVoiceClientStatusObserver* observer); - virtual void addObserver(LLFriendObserver* observer); - virtual void removeObserver(LLFriendObserver* observer); - virtual void addObserver(LLVoiceClientParticipantObserver* observer); - virtual void removeObserver(LLVoiceClientParticipantObserver* observer); + void addObserver(LLVoiceClientStatusObserver* observer) override; + void removeObserver(LLVoiceClientStatusObserver* observer) override; + void addObserver(LLFriendObserver* observer) override; + void removeObserver(LLFriendObserver* observer) override; + void addObserver(LLVoiceClientParticipantObserver* observer) override; + void removeObserver(LLVoiceClientParticipantObserver* observer) override; //@} - - virtual std::string sipURIFromID(const LLUUID &id); + + std::string sipURIFromID(const LLUUID &id) override; //@} /// @name LLVoiceEffectInterface virtual implementations @@ -216,32 +216,32 @@ public: ////////////////////////// /// @name Accessors //@{ - virtual bool setVoiceEffect(const LLUUID& id); - virtual const LLUUID getVoiceEffect(); - virtual LLSD getVoiceEffectProperties(const LLUUID& id); + bool setVoiceEffect(const LLUUID& id) override; + const LLUUID getVoiceEffect() override; + LLSD getVoiceEffectProperties(const LLUUID& id) override; - virtual void refreshVoiceEffectLists(bool clear_lists); - virtual const voice_effect_list_t& getVoiceEffectList() const; - virtual const voice_effect_list_t& getVoiceEffectTemplateList() const; + void refreshVoiceEffectLists(bool clear_lists) override; + const voice_effect_list_t& getVoiceEffectList() const override; + const voice_effect_list_t& getVoiceEffectTemplateList() const override; //@} ////////////////////////////// /// @name Status notification //@{ - virtual void addObserver(LLVoiceEffectObserver* observer); - virtual void removeObserver(LLVoiceEffectObserver* observer); + void addObserver(LLVoiceEffectObserver* observer) override; + void removeObserver(LLVoiceEffectObserver* observer) override; //@} ////////////////////////////// /// @name Effect preview buffer //@{ - virtual void enablePreviewBuffer(bool enable); - virtual void recordPreviewBuffer(); - virtual void playPreviewBuffer(const LLUUID& effect_id = LLUUID::null); - virtual void stopPreviewBuffer(); + void enablePreviewBuffer(bool enable) override; + void recordPreviewBuffer() override; + void playPreviewBuffer(const LLUUID& effect_id = LLUUID::null) override; + void stopPreviewBuffer() override; - virtual bool isPreviewRecording(); - virtual bool isPreviewPlaying(); + bool isPreviewRecording() override; + bool isPreviewPlaying() override; //@} //@} @@ -932,12 +932,12 @@ protected: /** * @brief Process the data in buffer */ - virtual EStatus process_impl( + EStatus process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, bool& eos, LLSD& context, - LLPumpIO* pump); + LLPumpIO* pump) override; //@} std::string mInput; diff --git a/indra/newview/llvoinventorylistener.cpp b/indra/newview/llvoinventorylistener.cpp index 0ff3e287ddc2ad8912dc8cd0a4d477bfefe98c43..1d5c043da495b3092bd3b25fbd4da5da86017851 100644 --- a/indra/newview/llvoinventorylistener.cpp +++ b/indra/newview/llvoinventorylistener.cpp @@ -36,14 +36,14 @@ void LLVOInventoryListener::removeVOInventoryListener() if (mListenerVObject) { mListenerVObject->removeInventoryListener(this); - mListenerVObject = NULL; + mListenerVObject = nullptr; } } void LLVOInventoryListener::registerVOInventoryListener(LLViewerObject* object, void* user_data) { removeVOInventoryListener(); - if (object != NULL) + if (object != nullptr) { mListenerVObject = object; object->registerInventoryListener(this,user_data); @@ -61,5 +61,5 @@ void LLVOInventoryListener::requestVOInventory() // This assumes mListenerVObject is clearing it's own lists void LLVOInventoryListener::clearVOInventoryListener() { - mListenerVObject = NULL; + mListenerVObject = nullptr; } diff --git a/indra/newview/llvoinventorylistener.h b/indra/newview/llvoinventorylistener.h index c50c475478a66d90e92b1274d92419ddc75714db..3b2df0a8f0695faab5286b7f95af81c1081519ac 100644 --- a/indra/newview/llvoinventorylistener.h +++ b/indra/newview/llvoinventorylistener.h @@ -49,7 +49,7 @@ public: void clearVOInventoryListener(); protected: - LLVOInventoryListener() : mListenerVObject(NULL) { } + LLVOInventoryListener() : mListenerVObject(nullptr) { } virtual ~LLVOInventoryListener() { removeVOInventoryListener(); } void registerVOInventoryListener(LLViewerObject* object, void* user_data); diff --git a/indra/newview/llvopartgroup.h b/indra/newview/llvopartgroup.h index 05bfdbda9b4390dcbee792794c423f5a9c16965a..09009862ee00ec9e8e3dcddc16c0a62ca311dcc4 100644 --- a/indra/newview/llvopartgroup.h +++ b/indra/newview/llvopartgroup.h @@ -63,12 +63,12 @@ public: LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. - void idleUpdate(LLAgent &agent, const F64 &time); + /*virtual*/ BOOL isActive() const override; // Whether this object needs to do an idleUpdate. + void idleUpdate(LLAgent &agent, const F64 &time) override; - virtual F32 getBinRadius(); - virtual void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax); - virtual U32 getPartitionType() const; + F32 getBinRadius() override; + void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) override; + U32 getPartitionType() const override; /*virtual*/ BOOL lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face, @@ -78,13 +78,13 @@ public: LLVector4a* intersection, LLVector2* tex_coord, LLVector4a* normal, - LLVector4a* tangent); + LLVector4a* tangent) override; - /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); - /*virtual*/ void updateTextures(); + /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent) override; + /*virtual*/ void updateTextures() override; - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); + /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) override; + /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; void getGeometry(const LLViewerPart& part, LLStrider<LLVector4a>& verticesp); @@ -94,11 +94,11 @@ public: LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, LLStrider<LLColor4U>& emissivep, - LLStrider<U16>& indicesp); + LLStrider<U16>& indicesp) override; - void updateFaceSize(S32 idx) { } - F32 getPartSize(S32 idx); - void getBlendFunc(S32 idx, U32& src, U32& dst); + void updateFaceSize(S32 idx) override { } + F32 getPartSize(S32 idx) override; + void getBlendFunc(S32 idx, U32& src, U32& dst) override; LLUUID getPartOwner(S32 idx); LLUUID getPartSource(S32 idx); @@ -123,9 +123,9 @@ public: { } protected: - LLDrawable* createDrawable(LLPipeline *pipeline); - U32 getPartitionType() const; - virtual LLVector3 getCameraPosition() const; + LLDrawable* createDrawable(LLPipeline *pipeline) override; + U32 getPartitionType() const override; + LLVector3 getCameraPosition() const override; }; #endif // LL_LLVOPARTGROUP_H diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 23b10b3941cf27600f3ce54731e65c3f799ee62f..243437744cf027c43ded3b6d961f2def669b6b1c 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -207,8 +207,8 @@ S32 LLSkyTex::sCurrent = 0; LLSkyTex::LLSkyTex() : - mSkyData(NULL), - mSkyDirs(NULL) + mSkyData(nullptr), + mSkyDirs(nullptr) { } @@ -229,8 +229,8 @@ void LLSkyTex::init() void LLSkyTex::cleanupGL() { - mTexture[0] = NULL; - mTexture[1] = NULL; + mTexture[0] = nullptr; + mTexture[1] = nullptr; } void LLSkyTex::restoreGL() @@ -245,10 +245,10 @@ void LLSkyTex::restoreGL() LLSkyTex::~LLSkyTex() { delete[] mSkyData; - mSkyData = NULL; + mSkyData = nullptr; delete[] mSkyDirs; - mSkyDirs = NULL; + mSkyDirs = nullptr; } @@ -317,7 +317,8 @@ S32 LLVOSky::sTileResY = sResolution/NUM_TILES_Y; LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : LLStaticViewerObject(id, pcode, regionp, TRUE), - mSun(SUN_DISK_RADIUS), mMoon(MOON_DISK_RADIUS), + mBumpSunDir(0.f, 0.f, 1.f), mSun(SUN_DISK_RADIUS), + mMoon(MOON_DISK_RADIUS), mBrightnessScale(1.f), mBrightnessScaleNew(0.f), mBrightnessScaleGuess(1.f), @@ -325,8 +326,7 @@ LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) mCloudDensity(0.2f), mWind(0.f), mForceUpdate(FALSE), - mWorldScale(1.f), - mBumpSunDir(0.f, 0.f, 1.f) + mWorldScale(1.f) { bool error = false; @@ -361,7 +361,7 @@ LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) } for (S32 i=0; i<FACE_COUNT; i++) { - mFace[i] = NULL; + mFace[i] = nullptr; } mCameraPosAgent = gAgentCamera.getCameraPositionAgent(); @@ -403,7 +403,7 @@ LLVOSky::~LLVOSky() // Don't delete images - it'll get deleted by gTextureList on shutdown // This needs to be done for each texture - mCubeMap = NULL; + mCubeMap = nullptr; } void LLVOSky::init() @@ -1187,7 +1187,7 @@ LLDrawable *LLVOSky::createDrawable(LLPipeline *pipeline) for (S32 i = 0; i < 6; ++i) { - mFace[FACE_SIDE0 + i] = mDrawable->addFace(poolp, NULL); + mFace[FACE_SIDE0 + i] = mDrawable->addFace(poolp, nullptr); } mFace[FACE_SUN] = mDrawable->addFace(poolp, mSunTexturep); @@ -1207,7 +1207,7 @@ void LLVOSky::createDummyVertexBuffer() if(!mFace[FACE_DUMMY]) { LLDrawPoolSky *poolp = (LLDrawPoolSky*) gPipeline.getPool(LLDrawPool::POOL_SKY); - mFace[FACE_DUMMY] = mDrawable->addFace(poolp, NULL); + mFace[FACE_DUMMY] = mDrawable->addFace(poolp, nullptr); } if(!mFace[FACE_DUMMY]->getVertexBuffer()) @@ -1249,12 +1249,12 @@ static LLTrace::BlockTimerStatHandle FTM_GEO_SKY("Sky Geometry"); BOOL LLVOSky::updateGeometry(LLDrawable *drawable) { LL_RECORD_BLOCK_TIME(FTM_GEO_SKY); - if (mFace[FACE_REFLECTION] == NULL) + if (mFace[FACE_REFLECTION] == nullptr) { LLDrawPoolWater *poolp = (LLDrawPoolWater*) gPipeline.getPool(LLDrawPool::POOL_WATER); if (gPipeline.getPool(LLDrawPool::POOL_WATER)->getVertexShaderLevel() != 0) { - mFace[FACE_REFLECTION] = drawable->addFace(poolp, NULL); + mFace[FACE_REFLECTION] = drawable->addFace(poolp, nullptr); } } diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h index 7f8b665d7fd2f9516cd85a66b01caa2247340925..dc6d6e1d8b6ca76a3bea6599c4bca9efa6375eff 100644 --- a/indra/newview/llvosky.h +++ b/indra/newview/llvosky.h @@ -213,8 +213,8 @@ protected: public: LLHeavenBody(const F32 rad) : mDirectionCached(LLVector3(0,0,0)), - mDirection(LLVector3(0,0,0)), mIntensity(0.f), + mDirection(LLVector3(0,0,0)), mDiskRadius(rad), mDraw(FALSE), mHorizonVisibility(1.f), mVisibility(1.f), mVisible(FALSE) @@ -452,14 +452,14 @@ public: void cleanupGL(); void restoreGL(); - /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time) override; BOOL updateSky(); // Graphical stuff for objects - maybe broken out into render class // later? - /*virtual*/ void updateTextures(); - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); + /*virtual*/ void updateTextures() override; + /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) override; + /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; void initSkyTextureDirs(const S32 side, const S32 tile); void createSkyTexture(const S32 side, const S32 tile); diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp index d6acaaeef8eba815bf99b890255cba96971001e5..71df9deb7d0b1b6470e3e9d6d8361e28c2c7f46a 100644 --- a/indra/newview/llvosurfacepatch.cpp +++ b/indra/newview/llvosurfacepatch.cpp @@ -59,7 +59,7 @@ public: }; // virtual - void setupVertexBuffer(U32 data_mask) + void setupVertexBuffer(U32 data_mask) override { if (LLGLSLShader::sNoFixedFunction) { //just use default if shaders are in play @@ -126,9 +126,9 @@ public: LLVOSurfacePatch::LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : LLStaticViewerObject(id, pcode, regionp), mDirtiedPatch(FALSE), - mPool(NULL), + mPool(nullptr), mBaseComp(0), - mPatchp(NULL), + mPatchp(nullptr), mDirtyTexture(FALSE), mDirtyTerrain(FALSE), mLastNorthStride(0), @@ -144,7 +144,7 @@ LLVOSurfacePatch::LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLView LLVOSurfacePatch::~LLVOSurfacePatch() { - mPatchp = NULL; + mPatchp = nullptr; } @@ -153,7 +153,7 @@ void LLVOSurfacePatch::markDead() if (mPatchp) { mPatchp->clearVObj(); - mPatchp = NULL; + mPatchp = nullptr; } LLViewerObject::markDead(); } @@ -209,7 +209,7 @@ LLDrawable *LLVOSurfacePatch::createDrawable(LLPipeline *pipeline) LLFacePool *poolp = getPool(); - mDrawable->addFace(poolp, NULL); + mDrawable->addFace(poolp, nullptr); return mDrawable; } @@ -867,7 +867,7 @@ void LLVOSurfacePatch::dirtyGeom() LLFace* facep = mDrawable->getFace(0); if (facep) { - facep->setVertexBuffer(NULL); + facep->setVertexBuffer(nullptr); } mDrawable->movePartition(); } diff --git a/indra/newview/llvosurfacepatch.h b/indra/newview/llvosurfacepatch.h index 884dbb3be393425f3e758e11b88d1edce618774a..8c30879f87109d6e0dcbd00e65eb4b079332c421 100644 --- a/indra/newview/llvosurfacepatch.h +++ b/indra/newview/llvosurfacepatch.h @@ -51,29 +51,29 @@ public: LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - /*virtual*/ void markDead(); + /*virtual*/ void markDead() override; // Initialize data that's only inited once per class. static void initClass(); - virtual U32 getPartitionType() const; + U32 getPartitionType() const override; - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); - /*virtual*/ void updateGL(); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); - /*virtual*/ BOOL updateLOD(); - /*virtual*/ void updateFaceSize(S32 idx); + /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) override; + /*virtual*/ void updateGL() override; + /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; + /*virtual*/ BOOL updateLOD() override; + /*virtual*/ void updateFaceSize(S32 idx) override; void getGeometry(LLStrider<LLVector3> &verticesp, LLStrider<LLVector3> &normalsp, LLStrider<LLVector2> &texCoords0p, LLStrider<LLVector2> &texCoords1p, LLStrider<U16> &indicesp); - /*virtual*/ void updateTextures(); - /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area + /*virtual*/ void updateTextures() override; + /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent) override; // generate accurate apparent angle and area - /*virtual*/ void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax); - /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. + /*virtual*/ void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) override; + /*virtual*/ BOOL isActive() const override; // Whether this object needs to do an idleUpdate. void setPatch(LLSurfacePatch *patchp); LLSurfacePatch *getPatch() const { return mPatchp; } @@ -85,12 +85,12 @@ public: S32 face = -1, // which face to check, -1 = ALL_SIDES BOOL pick_transparent = FALSE, BOOL pick_rigged = FALSE, - S32* face_hit = NULL, // which face was hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point - ); + S32* face_hit = nullptr, // which face was hit + LLVector4a* intersection = nullptr, // return the intersection point + LLVector2* tex_coord = nullptr, // return the texture coordinates of the intersection point + LLVector4a* normal = nullptr, // return the surface normal at the intersection point + LLVector4a* tangent = nullptr // return the surface tangent at the intersection point + ) override; BOOL mDirtiedPatch; protected: diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 975e4fc9daf337561dff92d21b07478e7a226d4e..b45cd7e12a69c1e7299939deb4ae286ea25b1f06 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -99,7 +99,7 @@ LLVOTree::~LLVOTree() if (mData) { delete[] mData; - mData = NULL; + mData = nullptr; } } @@ -494,11 +494,11 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) if(mTrunkLOD >= sMAX_NUM_TREE_LOD_LEVELS) //do not display the tree. { - mReferenceBuffer = NULL ; + mReferenceBuffer = nullptr ; LLFace * facep = drawable->getFace(0); if (facep) { - facep->setVertexBuffer(NULL); + facep->setVertexBuffer(nullptr); } return TRUE ; } diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h index 4ea6388e631bd1125836b47b6d823b07c5306dbc..201ca476e97ff941860fb788745d709cde45e882 100644 --- a/indra/newview/llvotree.h +++ b/indra/newview/llvotree.h @@ -58,21 +58,21 @@ public: void **user_data, U32 block_num, const EObjectUpdateType update_type, - LLDataPacker *dp); - /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); + LLDataPacker *dp) override; + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time) override; // Graphical stuff for objects - maybe broken out into render class later? /*virtual*/ void render(LLAgent &agent); - /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); - /*virtual*/ void updateTextures(); + /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent) override; + /*virtual*/ void updateTextures() override; - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); - /*virtual*/ void updateSpatialExtents(LLVector4a &min, LLVector4a &max); + /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) override; + /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; + /*virtual*/ void updateSpatialExtents(LLVector4a &min, LLVector4a &max) override; - virtual U32 getPartitionType() const; + U32 getPartitionType() const override; - void updateRadius(); + void updateRadius() override; void calcNumVerts(U32& vert_count, U32& index_count, S32 trunk_LOD, S32 stop_level, U16 depth, U16 trunk_depth, F32 branches); @@ -110,12 +110,12 @@ public: S32 face = -1, // which face to check, -1 = ALL_SIDES BOOL pick_transparent = FALSE, BOOL pick_rigged = FALSE, - S32* face_hit = NULL, // which face was hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point - ); + S32* face_hit = nullptr, // which face was hit + LLVector4a* intersection = nullptr, // return the intersection point + LLVector2* tex_coord = nullptr, // return the texture coordinates of the intersection point + LLVector4a* normal = nullptr, // return the surface normal at the intersection point + LLVector4a* tangent = nullptr // return the surface tangent at the intersection point + ) override; static S32 sMaxTreeSpecies; diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 54cdef8907cdddc05c232611f98bacccf12fe514..6eb04f649ce8f9ce30f733a3ebbf0541eb7b0715 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -108,44 +108,44 @@ public: public: LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - /*virtual*/ void markDead(); // Override (and call through to parent) to clean up media references + /*virtual*/ void markDead() override; // Override (and call through to parent) to clean up media references - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); + /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) override; void deleteFaces(); void animateTextures(); BOOL isVisible() const ; - /*virtual*/ BOOL isActive() const; - /*virtual*/ BOOL isAttachment() const; - /*virtual*/ BOOL isRootEdit() const; // overridden for sake of attachments treating themselves as a root object - /*virtual*/ BOOL isHUDAttachment() const; + /*virtual*/ BOOL isActive() const override; + /*virtual*/ BOOL isAttachment() const override; + /*virtual*/ BOOL isRootEdit() const override; // overridden for sake of attachments treating themselves as a root object + /*virtual*/ BOOL isHUDAttachment() const override; void generateSilhouette(LLSelectNode* nodep, const LLVector3& view_point); - /*virtual*/ BOOL setParent(LLViewerObject* parent); - S32 getLOD() const { return mLOD; } - const LLVector3 getPivotPositionAgent() const; + /*virtual*/ BOOL setParent(LLViewerObject* parent) override; + S32 getLOD() const override { return mLOD; } + const LLVector3 getPivotPositionAgent() const override; const LLMatrix4& getRelativeXform() const { return mRelativeXform; } const LLMatrix3& getRelativeXformInvTrans() const { return mRelativeXformInvTrans; } - /*virtual*/ const LLMatrix4 getRenderMatrix() const; + /*virtual*/ const LLMatrix4 getRenderMatrix() const override; typedef std::map<LLUUID, S32> texture_cost_t; U32 getRenderCost(texture_cost_t &textures) const; - F32 getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const; - /*virtual*/ F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL) { return getStreamingCost(bytes, visible_bytes, NULL); } + F32 getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const override; + /*virtual*/ F32 getStreamingCost(S32* bytes = nullptr, S32* visible_bytes = nullptr) { return getStreamingCost(bytes, visible_bytes, nullptr); } - /*virtual*/ U32 getTriangleCount(S32* vcount = NULL) const; - /*virtual*/ U32 getHighLODTriangleCount(); + /*virtual*/ U32 getTriangleCount(S32* vcount = nullptr) const override; + /*virtual*/ U32 getHighLODTriangleCount() override; /*virtual*/ BOOL lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face = -1, // which face to check, -1 = ALL_SIDES BOOL pick_transparent = FALSE, BOOL pick_rigged = FALSE, - S32* face_hit = NULL, // which face was hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point - ); + S32* face_hit = nullptr, // which face was hit + LLVector4a* intersection = nullptr, // return the intersection point + LLVector2* tex_coord = nullptr, // return the texture coordinates of the intersection point + LLVector4a* normal = nullptr, // return the surface normal at the intersection point + LLVector4a* tangent = nullptr // return the surface tangent at the intersection point + ) override; LLVector3 agentPositionToVolume(const LLVector3& pos) const; LLVector3 agentDirectionToVolume(const LLVector3& dir) const; @@ -156,54 +156,54 @@ public: BOOL getVolumeChanged() const { return mVolumeChanged; } /*virtual*/ F32 getRadius() const { return mVObjRadius; }; - const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const; + const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const override; void markForUpdate(BOOL priority) { LLViewerObject::markForUpdate(priority); mVolumeChanged = TRUE; } void faceMappingChanged() { mFaceMappingChanged=TRUE; }; - /*virtual*/ void onShift(const LLVector4a &shift_vector); // Called when the drawable shifts + /*virtual*/ void onShift(const LLVector4a &shift_vector) override; // Called when the drawable shifts - /*virtual*/ void parameterChanged(U16 param_type, bool local_origin); - /*virtual*/ void parameterChanged(U16 param_type, LLNetworkData* data, BOOL in_use, bool local_origin); + /*virtual*/ void parameterChanged(U16 param_type, bool local_origin) override; + /*virtual*/ void parameterChanged(U16 param_type, LLNetworkData* data, BOOL in_use, bool local_origin) override; /*virtual*/ U32 processUpdateMessage(LLMessageSystem *mesgsys, void **user_data, U32 block_num, const EObjectUpdateType update_type, - LLDataPacker *dp); - - /*virtual*/ void setSelected(BOOL sel); - /*virtual*/ BOOL setDrawableParent(LLDrawable* parentp); - - /*virtual*/ void setScale(const LLVector3 &scale, BOOL damped); - - /*virtual*/ void changeTEImage(S32 index, LLViewerTexture* new_image) ; - /*virtual*/ void setNumTEs(const U8 num_tes); - /*virtual*/ void setTEImage(const U8 te, LLViewerTexture *imagep); - /*virtual*/ S32 setTETexture(const U8 te, const LLUUID &uuid); - /*virtual*/ S32 setTEColor(const U8 te, const LLColor3 &color); - /*virtual*/ S32 setTEColor(const U8 te, const LLColor4 &color); - /*virtual*/ S32 setTEBumpmap(const U8 te, const U8 bump); - /*virtual*/ S32 setTEShiny(const U8 te, const U8 shiny); - /*virtual*/ S32 setTEFullbright(const U8 te, const U8 fullbright); - /*virtual*/ S32 setTEBumpShinyFullbright(const U8 te, const U8 bump); - /*virtual*/ S32 setTEMediaFlags(const U8 te, const U8 media_flags); - /*virtual*/ S32 setTEGlow(const U8 te, const F32 glow); - /*virtual*/ S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID); + LLDataPacker *dp) override; + + /*virtual*/ void setSelected(BOOL sel) override; + /*virtual*/ BOOL setDrawableParent(LLDrawable* parentp) override; + + /*virtual*/ void setScale(const LLVector3 &scale, BOOL damped) override; + + /*virtual*/ void changeTEImage(S32 index, LLViewerTexture* new_image) override; + /*virtual*/ void setNumTEs(const U8 num_tes) override; + /*virtual*/ void setTEImage(const U8 te, LLViewerTexture *imagep) override; + /*virtual*/ S32 setTETexture(const U8 te, const LLUUID &uuid) override; + /*virtual*/ S32 setTEColor(const U8 te, const LLColor3 &color) override; + /*virtual*/ S32 setTEColor(const U8 te, const LLColor4 &color) override; + /*virtual*/ S32 setTEBumpmap(const U8 te, const U8 bump) override; + /*virtual*/ S32 setTEShiny(const U8 te, const U8 shiny) override; + /*virtual*/ S32 setTEFullbright(const U8 te, const U8 fullbright) override; + /*virtual*/ S32 setTEBumpShinyFullbright(const U8 te, const U8 bump) override; + /*virtual*/ S32 setTEMediaFlags(const U8 te, const U8 media_flags) override; + /*virtual*/ S32 setTEGlow(const U8 te, const F32 glow) override; + /*virtual*/ S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) override; static void setTEMaterialParamsCallbackTE(const LLUUID& objectID, const LLMaterialID& pMaterialID, const LLMaterialPtr pMaterialParams, U32 te); - /*virtual*/ S32 setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams); - /*virtual*/ S32 setTEScale(const U8 te, const F32 s, const F32 t); - /*virtual*/ S32 setTEScaleS(const U8 te, const F32 s); - /*virtual*/ S32 setTEScaleT(const U8 te, const F32 t); - /*virtual*/ S32 setTETexGen(const U8 te, const U8 texgen); - /*virtual*/ S32 setTEMediaTexGen(const U8 te, const U8 media); - /*virtual*/ BOOL setMaterial(const U8 material); + /*virtual*/ S32 setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) override; + /*virtual*/ S32 setTEScale(const U8 te, const F32 s, const F32 t) override; + /*virtual*/ S32 setTEScaleS(const U8 te, const F32 s) override; + /*virtual*/ S32 setTEScaleT(const U8 te, const F32 t) override; + /*virtual*/ S32 setTETexGen(const U8 te, const U8 texgen) override; + /*virtual*/ S32 setTEMediaTexGen(const U8 te, const U8 media) override; + /*virtual*/ BOOL setMaterial(const U8 material) override; void setTexture(const S32 face); S32 getIndexInTex() const {return mIndexInTex ;} - /*virtual*/ BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false); + /*virtual*/ BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false) override; void updateSculptTexture(); void setIndexInTex(S32 index) { mIndexInTex = index ;} void sculpt(); @@ -213,21 +213,21 @@ public: void* user_data, S32 status, LLExtStat ext_status); void updateRelativeXform(bool force_identity = false); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); - /*virtual*/ void updateFaceSize(S32 idx); - /*virtual*/ BOOL updateLOD(); - void updateRadius(); - /*virtual*/ void updateTextures(); + /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; + /*virtual*/ void updateFaceSize(S32 idx) override; + /*virtual*/ BOOL updateLOD() override; + void updateRadius() override; + /*virtual*/ void updateTextures() override; void updateTextureVirtualSize(bool forced = false); void updateFaceFlags(); void regenFaces(); BOOL genBBoxes(BOOL force_global); void preRebuild(); - virtual void updateSpatialExtents(LLVector4a& min, LLVector4a& max); - virtual F32 getBinRadius(); - - virtual U32 getPartitionType() const; + void updateSpatialExtents(LLVector4a& min, LLVector4a& max) override; + F32 getBinRadius() override; + + U32 getPartitionType() const override; // For Lights void setIsLight(BOOL is_light); @@ -256,10 +256,10 @@ public: // Flexible Objects U32 getVolumeInterfaceID() const; - virtual BOOL isFlexible() const; - virtual BOOL isSculpted() const; - virtual BOOL isMesh() const; - virtual BOOL hasLightTexture() const; + BOOL isFlexible() const override; + BOOL isSculpted() const override; + BOOL isMesh() const override; + BOOL hasLightTexture() const override; BOOL isVolumeGlobal() const; BOOL canBeFlexible() const; diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 266b0584e4b80e7387d9c574dd689084bf0735a9..22534305843b38c0eb5aa3b100eacb02a25d0b7f 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -126,7 +126,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable) if (drawable->getNumFaces() < 1) { LLDrawPoolWater *poolp = (LLDrawPoolWater*) gPipeline.getPool(LLDrawPool::POOL_WATER); - drawable->addFace(poolp, NULL); + drawable->addFace(poolp, nullptr); } face = drawable->getFace(0); if (!face) diff --git a/indra/newview/llvowater.h b/indra/newview/llvowater.h index 7a8d8192153571a6ca8958a26374e037fd5cc40f..239109801d9eaab7e5d4c3633003b07fa79195cc 100644 --- a/indra/newview/llvowater.h +++ b/indra/newview/llvowater.h @@ -52,23 +52,23 @@ public: LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - /*virtual*/ void markDead(); + /*virtual*/ void markDead() override; // Initialize data that's only inited once per class. static void initClass(); static void cleanupClass(); - /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); - /*virtual*/ void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time) override; + /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) override; + /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; + /*virtual*/ void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) override; - /*virtual*/ void updateTextures(); - /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area + /*virtual*/ void updateTextures() override; + /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent) override; // generate accurate apparent angle and area - virtual U32 getPartitionType() const; + U32 getPartitionType() const override; - /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. + /*virtual*/ BOOL isActive() const override; // Whether this object needs to do an idleUpdate. void setUseTexture(const BOOL use_texture); void setIsEdgePatch(const BOOL edge_patch); @@ -89,7 +89,7 @@ public: mRenderType = LLPipeline::RENDER_TYPE_VOIDWATER; } - /*virtual*/ U32 getPartitionType() const; + /*virtual*/ U32 getPartitionType() const override; }; diff --git a/indra/newview/llvowlsky.h b/indra/newview/llvowlsky.h index 1d419b5fea290e62762794636aab1fe37ac182de..b00685ab37fcbc7348aa0a4a941817701ca5bac1 100644 --- a/indra/newview/llvowlsky.h +++ b/indra/newview/llvowlsky.h @@ -53,10 +53,10 @@ public: void initSunDirection(LLVector3 const & sun_direction, LLVector3 const & sun_angular_velocity); - /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); - /*virtual*/ BOOL isActive(void) const; - /*virtual*/ LLDrawable * createDrawable(LLPipeline *pipeline); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time) override; + /*virtual*/ BOOL isActive(void) const override; + /*virtual*/ LLDrawable * createDrawable(LLPipeline *pipeline) override; + /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; void drawStars(void); void drawDome(void); diff --git a/indra/newview/llwatchdog.cpp b/indra/newview/llwatchdog.cpp index 209d474776bf4ac5f58ea4fcc4323fdcb1e59ba6..7404df082aa67fab5e3ab8ef09ca37de882a90d7 100644 --- a/indra/newview/llwatchdog.cpp +++ b/indra/newview/llwatchdog.cpp @@ -37,7 +37,7 @@ const U32 WATCHDOG_SLEEP_TIME_USEC = 1000000; void default_killer_callback() { #ifdef LL_WINDOWS - RaiseException(0,0,0,0); + RaiseException(0,0,0,nullptr); #else raise(SIGQUIT); #endif @@ -63,7 +63,7 @@ public: mSleepMsecs = 1; } - /* virtual */ void run() + /* virtual */ void run() override { while(!mStopping) { @@ -158,8 +158,8 @@ void LLWatchdogTimeout::ping(const std::string& state) // LLWatchdog LLWatchdog::LLWatchdog() : - mSuspectsAccessMutex(NULL), - mTimer(NULL), + mSuspectsAccessMutex(nullptr), + mTimer(nullptr), mLastClockCount(0), mKillerCallback(&default_killer_callback) { @@ -205,13 +205,13 @@ void LLWatchdog::cleanup() { mTimer->stop(); delete mTimer; - mTimer = NULL; + mTimer = nullptr; } if(mSuspectsAccessMutex) { delete mSuspectsAccessMutex; - mSuspectsAccessMutex = NULL; + mSuspectsAccessMutex = nullptr; } mLastClockCount = 0; @@ -263,7 +263,7 @@ void LLWatchdog::run() void LLWatchdog::lockThread() { - if(mSuspectsAccessMutex != NULL) + if(mSuspectsAccessMutex != nullptr) { mSuspectsAccessMutex->lock(); } @@ -271,7 +271,7 @@ void LLWatchdog::lockThread() void LLWatchdog::unlockThread() { - if(mSuspectsAccessMutex != NULL) + if(mSuspectsAccessMutex != nullptr) { mSuspectsAccessMutex->unlock(); } diff --git a/indra/newview/llwatchdog.h b/indra/newview/llwatchdog.h index 2fc3e3c92e06a1f8096eac21f5bf724745d80ef4..4f20270370ccdbaa7f3d4d178bfc755e5d3f8668 100644 --- a/indra/newview/llwatchdog.h +++ b/indra/newview/llwatchdog.h @@ -54,10 +54,10 @@ public: LLWatchdogTimeout(); virtual ~LLWatchdogTimeout(); - /* virtual */ bool isAlive() const; - /* virtual */ void reset(); - /* virtual */ void start() { start(""); } - /* virtual */ void stop(); + /* virtual */ bool isAlive() const override; + /* virtual */ void reset() override; + /* virtual */ void start() override { start(""); } + /* virtual */ void stop() override; void start(const std::string& state); void setTimeout(F32 d); diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index 49727d14e6ee6698d43f3551674d5ce7b8f52f0c..b108ee4792474936136912a6eaca1fb3f0bb421b 100644 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -68,13 +68,13 @@ LLWaterParamManager::LLWaterParamManager() : mFogDensity(4, "waterFogDensity", 2), mUnderWaterFogMod(0.25, "underWaterFogMod"), mNormalScale(2.f, 2.f, 2.f, "normScale"), + mWave1Dir(.5f, .5f, "wave1Dir"), + mWave2Dir(.5f, .5f, "wave2Dir"), mFresnelScale(0.5f, "fresnelScale"), mFresnelOffset(0.4f, "fresnelOffset"), mScaleAbove(0.025f, "scaleAbove"), mScaleBelow(0.2f, "scaleBelow"), mBlurMultiplier(0.1f, "blurMultiplier"), - mWave1Dir(.5f, .5f, "wave1Dir"), - mWave2Dir(.5f, .5f, "wave2Dir"), mDensitySliderValue(1.0f), mWaterFogKS(1.0f) { diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h index 053668fd0f0bebac2231b3ccc717a265167bc76f..bdffec2e2b843b78f8e7002cb2fa6db870838b29 100644 --- a/indra/newview/llwaterparammanager.h +++ b/indra/newview/llwaterparammanager.h @@ -317,7 +317,7 @@ public: F32 mDensitySliderValue; private: - /*virtual*/ void initSingleton(); + /*virtual*/ void initSingleton() override; void loadAllPresets(); void loadPresetsFromDir(const std::string& dir); bool loadPreset(const std::string& path); diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 785b109e29926e7369aad6a8f014a6d1763270a7..641b523ca7c40ec511e64e1f6045afc1956bda91 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -51,8 +51,8 @@ class LLFindOutfitItems : public LLInventoryCollectFunctor public: LLFindOutfitItems() {} virtual ~LLFindOutfitItems() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; }; bool LLFindOutfitItems::operator()(LLInventoryCategory* cat, @@ -102,7 +102,7 @@ LLPanelWearableListItem::LLPanelWearableListItem(LLViewerInventoryItem* item, co LLPanelWearableOutfitItem* LLPanelWearableOutfitItem::create(LLViewerInventoryItem* item, bool worn_indication_enabled) { - LLPanelWearableOutfitItem* list_item = NULL; + LLPanelWearableOutfitItem* list_item = nullptr; if (item) { const LLPanelInventoryListItemBase::Params& params = LLUICtrlFactory::getDefaultParams<LLPanelInventoryListItemBase>(); @@ -159,7 +159,7 @@ LLPanelClothingListItem::Params::Params() // static LLPanelClothingListItem* LLPanelClothingListItem::create(LLViewerInventoryItem* item) { - LLPanelClothingListItem* list_item = NULL; + LLPanelClothingListItem* list_item = nullptr; if(item) { const LLPanelClothingListItem::Params& params = LLUICtrlFactory::getDefaultParams<LLPanelClothingListItem>(); @@ -236,15 +236,15 @@ static LLWidgetNameRegistry::StaticRegistrar sRegisterPanelBodyPartsListItem(&ty LLPanelBodyPartsListItem::Params::Params() : edit_btn("edit_btn"), - edit_panel("edit_panel"), lock_panel("lock_panel"), + edit_panel("edit_panel"), lock_icon("lock_icon") {} // static LLPanelBodyPartsListItem* LLPanelBodyPartsListItem::create(LLViewerInventoryItem* item) { - LLPanelBodyPartsListItem* list_item = NULL; + LLPanelBodyPartsListItem* list_item = nullptr; if(item) { const Params& params = LLUICtrlFactory::getDefaultParams<LLPanelBodyPartsListItem>(); @@ -311,7 +311,7 @@ LLPanelDeletableWearableListItem::Params::Params() // static LLPanelDeletableWearableListItem* LLPanelDeletableWearableListItem::create(LLViewerInventoryItem* item) { - LLPanelDeletableWearableListItem* list_item = NULL; + LLPanelDeletableWearableListItem* list_item = nullptr; if(item) { const Params& params = LLUICtrlFactory::getDefaultParams<LLPanelDeletableWearableListItem>(); @@ -352,7 +352,7 @@ BOOL LLPanelDeletableWearableListItem::postBuild() // static LLPanelAttachmentListItem* LLPanelAttachmentListItem::create(LLViewerInventoryItem* item) { - LLPanelAttachmentListItem* list_item = NULL; + LLPanelAttachmentListItem* list_item = nullptr; if(item) { const Params& params = LLUICtrlFactory::getDefaultParams<LLPanelDeletableWearableListItem>(); @@ -427,7 +427,7 @@ LLWearableType::EType LLPanelDummyClothingListItem::getWearableType() const } LLPanelDummyClothingListItem::LLPanelDummyClothingListItem(LLWearableType::EType w_type, const LLPanelDummyClothingListItem::Params& params) -: LLPanelWearableListItem(NULL, params), +: LLPanelWearableListItem(nullptr, params), mWearableType(w_type) { LLPanel::Params panel_params(params.add_panel); @@ -665,7 +665,7 @@ LLPanel* LLWearableItemsList::createNewItem(LLViewerInventoryItem* item) { LL_WARNS() << "No inventory item. Couldn't create flat list item." << LL_ENDL; llassert(item != NULL); - return NULL; + return nullptr; } return LLPanelWearableOutfitItem::create(item, mWornIndicationEnabled); @@ -778,7 +778,7 @@ void LLWearableItemsList::setSortOrder(ESortOrder sort_order, bool sort_now) ////////////////////////////////////////////////////////////////////////// LLWearableItemsList::ContextMenu::ContextMenu() -: mParent(NULL) +: mParent(nullptr) { } @@ -786,7 +786,7 @@ void LLWearableItemsList::ContextMenu::show(LLView* spawning_view, const uuid_ve { mParent = dynamic_cast<LLWearableItemsList*>(spawning_view); LLListContextMenu::show(spawning_view, uuids, x, y); - mParent = NULL; // to avoid dereferencing an invalid pointer + mParent = nullptr; // to avoid dereferencing an invalid pointer } // virtual diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 74759c8e8c68e63459009158817961737a50993c..2027d08b0a1a9a2ee38ca5d6dba690d16fbffc4d 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -52,12 +52,12 @@ public: /** * Shows buttons when mouse is over */ - /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); + /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask) override; /** * Hides buttons when mouse is out */ - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override; protected: @@ -82,7 +82,7 @@ public: * Updates item name and (worn) suffix. */ /*virtual*/ void updateItem(const std::string& name, - EItemState item_state = IS_DEFAULT); + EItemState item_state = IS_DEFAULT) override; protected: LLPanelWearableOutfitItem(LLViewerInventoryItem* item, @@ -108,7 +108,7 @@ public: virtual ~LLPanelDeletableWearableListItem() {}; - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /** * Make button visible during mouse over event. @@ -129,7 +129,7 @@ public: /** Set item title. Joint name is added to the title in parenthesis */ /*virtual*/ void updateItem(const std::string& name, - EItemState item_state = IS_DEFAULT); + EItemState item_state = IS_DEFAULT) override; protected: LLPanelAttachmentListItem(LLViewerInventoryItem* item, const Params& params) : LLPanelDeletableWearableListItem(item, params) {}; @@ -161,7 +161,7 @@ public: virtual ~LLPanelClothingListItem(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /** * Make button visible during mouse over event. @@ -196,7 +196,7 @@ public: virtual ~LLPanelBodyPartsListItem(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /** * Make button visible during mouse over event. @@ -225,7 +225,7 @@ public: }; static LLPanelDummyClothingListItem* create(LLWearableType::EType w_type); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; LLWearableType::EType getWearableType() const; protected: @@ -250,7 +250,7 @@ public: LLWearableListItemComparator() {}; virtual ~LLWearableListItemComparator() {}; - virtual bool compare(const LLPanel* item1, const LLPanel* item2) const + bool compare(const LLPanel* item1, const LLPanel* item2) const override { const LLPanelInventoryListItemBase* wearable_item1 = dynamic_cast<const LLPanelInventoryListItemBase*>(item1); const LLPanelInventoryListItemBase* wearable_item2 = dynamic_cast<const LLPanelInventoryListItemBase*>(item2); @@ -287,7 +287,7 @@ public: virtual ~LLWearableItemNameComparator() {}; protected: - /*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const; + /*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const override; }; /** @@ -350,7 +350,7 @@ protected: * * holds in mWearableOrder map as VALUES (struct LLWearableTypeOrder). */ - /*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const; + /*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* wearable_item1, const LLPanelInventoryListItemBase* wearable_item2) const override; private: @@ -387,7 +387,7 @@ public: LLWearableItemCreationDateComparator() {} protected: - /*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* item1, const LLPanelInventoryListItemBase* item2) const; + /*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* item1, const LLPanelInventoryListItemBase* item2) const override; }; /** @@ -412,7 +412,7 @@ public: { LLSINGLETON(ContextMenu); public: - /*virtual*/ void show(LLView* spawning_view, const uuid_vec_t& uuids, S32 x, S32 y); + /*virtual*/ void show(LLView* spawning_view, const uuid_vec_t& uuids, S32 x, S32 y) override; protected: enum { @@ -423,7 +423,7 @@ public: MASK_UNKNOWN = 0x10, }; - /* virtual */ LLContextMenu* createMenu(); + /* virtual */ LLContextMenu* createMenu() override; void updateItemsVisibility(LLContextMenu* menu); void updateItemsLabels(LLContextMenu* menu); static void setMenuItemVisible(LLContextMenu* menu, const std::string& name, bool val); @@ -453,7 +453,7 @@ public: virtual ~LLWearableItemsList(); - /*virtual*/ LLPanel* createNewItem(LLViewerInventoryItem* item); + /*virtual*/ LLPanel* createNewItem(LLViewerInventoryItem* item) override; void updateList(const LLUUID& category_id); diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index ca12ab812d1496ea468ad19d8c8da93444dc6cd3..9708ca482cd45bf379a308225a5277f1dc948669 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -80,7 +80,7 @@ void LLWearableList::cleanup() void LLWearableList::getAsset(const LLAssetID& assetID, const std::string& wearable_name, LLAvatarAppearance* avatarp, LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLViewerWearable*, void* userdata), void* userdata) { llassert( (asset_type == LLAssetType::AT_CLOTHING) || (asset_type == LLAssetType::AT_BODYPART) ); - LLViewerWearable* instance = get_if_there(mList, assetID, (LLViewerWearable*)NULL ); + LLViewerWearable* instance = get_if_there(mList, assetID, (LLViewerWearable*)nullptr ); if( instance ) { LL_DEBUGS("Avatar") << "wearable " << assetID << " found in LLWearableList" << LL_ENDL; @@ -101,7 +101,7 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID { BOOL isNewWearable = FALSE; LLWearableArrivedData* data = (LLWearableArrivedData*) userdata; - LLViewerWearable* wearable = NULL; // NULL indicates failure + LLViewerWearable* wearable = nullptr; // NULL indicates failure LLAvatarAppearance *avatarp = data->mAvatarp; if( !filename ) @@ -132,7 +132,7 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID isNewWearable = TRUE; } delete wearable; - wearable = NULL; + wearable = nullptr; } if(filename) diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 238240f155ab33d981c9d2d8e4ad8583d3f9f395..14d0edf3646ff0e5027b26fb7bfe009386988a6b 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -61,7 +61,7 @@ bool on_load_url_external_response(const LLSD& notification, const LLSD& respons class URLLoader : public LLToastAlertPanel::URLLoader { - virtual void load(const std::string& url , bool force_open_externally) + void load(const std::string& url , bool force_open_externally) override { if (force_open_externally) { diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index 519051fc38a812877c9a85ad13dd8caf0358dd2d..d667426c0af345abe6215b52d2164612fdac1c31 100644 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -105,10 +105,10 @@ void LLWebProfile::uploadImageCoro(LLPointer<LLImageFormatted> image, std::strin LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); LLCore::HttpHeaders::ptr_t httpHeaders; - if (dynamic_cast<LLImagePNG*>(image.get()) == 0) + if (dynamic_cast<LLImagePNG*>(image.get()) == nullptr) { LL_WARNS() << "Image to upload is not a PNG" << LL_ENDL; - llassert(dynamic_cast<LLImagePNG*>(image.get()) != 0); + llassert(dynamic_cast<LLImagePNG*>(image.get()) != nullptr); return; } diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index a02a832f140931a2d00305560a985d197f19239d..6d5ea30f04d3464f579e7a9d92d9efdbb0ac504f 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -209,7 +209,7 @@ void LLWindowListener::getInfo(LLSD const & evt) { std::string path(evt["path"]); LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), path); - if (target_view != 0) + if (target_view != nullptr) { response.setResponse(target_view->getInfo()); } @@ -229,7 +229,7 @@ void LLWindowListener::getInfo(LLSD const & evt) void LLWindowListener::getPaths(LLSD const & request) { Response response(LLSD(), request); - LLView *root(LLUI::getRootView()), *base(NULL); + LLView *root(LLUI::getRootView()), *base(nullptr); // Capturing request["under"] as string means we conflate the case in // which there is no ["under"] key with the case in which its value is the // empty string. That seems to make sense to me. @@ -268,7 +268,7 @@ void LLWindowListener::keyDown(LLSD const & evt) { std::string path(evt["path"]); LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), path); - if (target_view == 0) + if (target_view == nullptr) { response.error(STRINGIZE(evt["op"].asString() << " request " "specified invalid \"path\": '" << path << "'")); @@ -303,7 +303,7 @@ void LLWindowListener::keyUp(LLSD const & evt) { std::string path(evt["path"]); LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), path); - if (target_view == 0 ) + if (target_view == nullptr ) { response.error(STRINGIZE(evt["op"].asString() << " request " "specified invalid \"path\": '" << path << "'")); @@ -487,5 +487,5 @@ void LLWindowListener::mouseScroll(LLSD const & request) { S32 clicks = request["clicks"].asInteger(); - mWindow->handleScrollWheel(NULL, clicks); + mWindow->handleScrollWheel(nullptr, clicks); } diff --git a/indra/newview/llwlanimator.cpp b/indra/newview/llwlanimator.cpp index 1f907e383450dd3c434515fb9ec7302e2507a6ac..628ff6e303fdb2f5a91a5d5eb7380c5e16fd13d7 100644 --- a/indra/newview/llwlanimator.cpp +++ b/indra/newview/llwlanimator.cpp @@ -37,7 +37,7 @@ F64 LLWLAnimator::INTERP_TOTAL_SECONDS = 3.f; LLWLAnimator::LLWLAnimator() : mStartTime(0.f), mDayRate(1.f), mDayTime(0.f), - mIsRunning(FALSE), mIsInterpolating(FALSE), mTimeType(TIME_LINDEN), + mTimeType(TIME_LINDEN), mIsRunning(FALSE), mIsInterpolating(FALSE), mInterpStartTime(), mInterpEndTime() { mInterpBeginWL = new LLWLParamSet(); diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index 94effa557e9d1bf4750aab773488154dc1e1b398..86f6589b689a57c3d9ffbad710a5ff39d4bbe023 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -67,8 +67,8 @@ LLWLParamManager::LLWLParamManager() : /// Sun Delta Terrain tweak variables. mSunDeltaYaw(180.0f), - mSceneLightStrength(2.0f), mWLGamma(1.0f, "gamma"), + mSceneLightStrength(2.0f), mBlueHorizon(0.25f, 0.25f, 1.0f, 1.0f, "blue_horizon", "WLBlueHorizon"), mHazeDensity(1.0f, "haze_density"), diff --git a/indra/newview/llwlparammanager.h b/indra/newview/llwlparammanager.h index 8566be0d63460368910363024cb9f1aea81ede2d..d9e48d3b2b02d574e56b93cb168380802eee329a 100644 --- a/indra/newview/llwlparammanager.h +++ b/indra/newview/llwlparammanager.h @@ -383,7 +383,7 @@ private: static std::string getSysDir(); static std::string getUserDir(); - /*virtual*/ void initSingleton(); + /*virtual*/ void initSingleton() override; // list of all the parameters, listed by name std::map<LLWLParamKey, LLWLParamSet> mParamList; diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index c4f0c7477daf3c33c205d12708b45e6b85775326..73ac6fceb8409fb38b777b021dd4d0e473fb5487 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -89,16 +89,16 @@ F32 LLWorld::mWidthInMeters = mWidth * mScale; // allocate the stack LLWorld::LLWorld() : + mRefreshLimits(true), mLandFarClip(DEFAULT_FAR_PLANE), mLastPacketsIn(0), mLastPacketsOut(0), mLastPacketsLost(0), - mSpaceTimeUSec(0), - mRefreshLimits(true) + mSpaceTimeUSec(0) { for (S32 i = 0; i < 8; i++) { - mEdgeWaterObjects[i] = NULL; + mEdgeWaterObjects[i] = nullptr; } LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,4); @@ -128,10 +128,10 @@ void LLWorld::destroyClass() LLViewerPartSim::getInstance()->destroyClass(); - mDefaultWaterTexturep = NULL ; + mDefaultWaterTexturep = nullptr ; for (S32 i = 0; i < 8; i++) { - mEdgeWaterObjects[i] = NULL; + mEdgeWaterObjects[i] = nullptr; } //make all visible drawbles invisible. @@ -251,7 +251,7 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) } else // Unconventional region size { - LLViewerRegion* last_neighborp = NULL; + LLViewerRegion* last_neighborp = nullptr; if(gDirAxes[dir][0] < 0) adj_x = region_x - WORLD_PATCH_SIZE; if(gDirAxes[dir][1] < 0) adj_y = region_y - WORLD_PATCH_SIZE; @@ -356,7 +356,7 @@ LLViewerRegion* LLWorld::getRegion(const LLHost &host) return regionp; } } - return NULL; + return nullptr; } LLViewerRegion* LLWorld::getRegionFromPosAgent(const LLVector3 &pos) @@ -375,7 +375,7 @@ LLViewerRegion* LLWorld::getRegionFromPosGlobal(const LLVector3d &pos) return regionp; } } - return NULL; + return nullptr; } @@ -467,7 +467,7 @@ LLViewerRegion* LLWorld::getRegionFromHandle(const U64 &handle) return regionp; } } - return NULL; + return nullptr; } LLViewerRegion* LLWorld::getRegionFromID(const LLUUID& region_id) @@ -481,7 +481,7 @@ LLViewerRegion* LLWorld::getRegionFromID(const LLUUID& region_id) return regionp; } } - return NULL; + return nullptr; } void LLWorld::updateAgentOffset(const LLVector3d &offset_global) @@ -532,7 +532,7 @@ LLViewerRegion* LLWorld::resolveRegionGlobal(LLVector3 &pos_region, const LLVect return regionp; } - return NULL; + return nullptr; } @@ -547,7 +547,7 @@ LLViewerRegion* LLWorld::resolveRegionAgent(LLVector3 &pos_region, const LLVecto return regionp; } - return NULL; + return nullptr; } @@ -583,7 +583,7 @@ F32 LLWorld::resolveStepHeightGlobal(const LLVOAvatar* avatarp, const LLVector3d // initialize return value to null if (viewerObjectPtr) { - *viewerObjectPtr = NULL; + *viewerObjectPtr = nullptr; } LLViewerRegion *regionp = getRegionFromPosGlobal(point_a); @@ -646,7 +646,7 @@ LLSurfacePatch * LLWorld::resolveLandPatchGlobal(const LLVector3d &pos_global) LLViewerRegion *regionp = getRegionFromPosGlobal(pos_global); if (!regionp) { - return NULL; + return nullptr; } return regionp->getLand().resolvePatchGlobal(pos_global); @@ -890,7 +890,7 @@ void LLWorld::printPacketsLost() LL_INFOS() << "Simulators:" << LL_ENDL; LL_INFOS() << "----------" << LL_ENDL; - LLCircuitData *cdp = NULL; + LLCircuitData *cdp = nullptr; for (region_list_t::iterator iter = mActiveRegionList.begin(); iter != mActiveRegionList.end(); ++iter) { @@ -1219,8 +1219,8 @@ class LLEstablishAgentCommunication : public LLHTTPNode { LOG_CLASS(LLEstablishAgentCommunication); public: - virtual void describe(Description& desc) const - { + void describe(Description& desc) const override + { desc.shortInfo("seed capability info for a region"); desc.postAPI(); desc.input( @@ -1228,7 +1228,7 @@ public: desc.source(__FILE__, __LINE__); } - virtual void post(ResponsePtr response, const LLSD& context, const LLSD& input) const + void post(ResponsePtr response, const LLSD& context, const LLSD& input) const override { if (!input["body"].has("agent-id") || !input["body"].has("sim-ip-and-port") || @@ -1393,11 +1393,11 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi { F32 radius_squared = radius * radius; - if(avatar_ids != NULL) + if(avatar_ids != nullptr) { avatar_ids->clear(); } - if(positions != NULL) + if(positions != nullptr) { positions->clear(); } @@ -1416,11 +1416,11 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi if (!uuid.isNull() && dist_vec_squared(pos_global, relative_to) <= radius_squared) { - if(positions != NULL) + if(positions != nullptr) { positions->push_back(pos_global); } - if(avatar_ids !=NULL) + if(avatar_ids != nullptr) { avatar_ids->push_back(uuid); } @@ -1441,9 +1441,9 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi { LLUUID uuid = regionp->mMapAvatarIDs.at(i); // if this avatar doesn't already exist in the list, add it - if(uuid.notNull() && avatar_ids != NULL && std::find(avatar_ids->begin(), avatar_ids->end(), uuid) == avatar_ids->end()) + if(uuid.notNull() && avatar_ids != nullptr && std::find(avatar_ids->begin(), avatar_ids->end(), uuid) == avatar_ids->end()) { - if (positions != NULL) + if (positions != nullptr) { positions->push_back(pos_global); } diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index c9fe85e47193499d4e24651bb2dbe5dadb596d89..4b604ef8a85a206c4c6297e289d00577db5774ca 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -116,7 +116,7 @@ public: // but it may eventually become more general. F32 resolveStepHeightGlobal(const LLVOAvatar* avatarp, const LLVector3d &point_a, const LLVector3d &point_b, LLVector3d &intersection, LLVector3 &intersection_normal, - LLViewerObject** viewerObjectPtr=NULL); + LLViewerObject** viewerObjectPtr= nullptr); LLSurfacePatch * resolveLandPatchGlobal(const LLVector3d &position); LLVector3 resolveLandNormalGlobal(const LLVector3d &position); // absolute frame @@ -184,19 +184,19 @@ public: // All arguments are optional. Given containers will be emptied and then filled. // Not supplying origin or radius input returns data on all avatars in the known regions. void getAvatars( - uuid_vec_t* avatar_ids = NULL, - std::vector<LLVector3d>* positions = NULL, + uuid_vec_t* avatar_ids = nullptr, + std::vector<LLVector3d>* positions = nullptr, const LLVector3d& relative_to = LLVector3d(), F32 radius = FLT_MAX) const; typedef boost::unordered_map<LLUUID, LLVector3d> pos_map_t; - void getAvatars(pos_map_t* map = NULL, + void getAvatars(pos_map_t* map = nullptr, const LLVector3d& relative_to = LLVector3d(), F32 radius = FLT_MAX) const; // Returns list of avatar ids with region pointer and global position typedef std::pair<LLViewerRegion*, LLVector3d > regionp_gpos_pair_t; typedef boost::unordered_map<LLUUID, regionp_gpos_pair_t > region_gpos_map_t; - void getAvatars(region_gpos_map_t* map = NULL, + void getAvatars(region_gpos_map_t* map = nullptr, const LLVector3d& relative_to = LLVector3d(), F32 radius = FLT_MAX) const; diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 33ad066e6e9ba5b72129e4648e03afd15264c698..b80f331aa87844fe667d011369f41292e0c9ff17 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -65,13 +65,13 @@ LLItemInfo::LLItemInfo(F32 global_x, F32 global_y, LLSimInfo::LLSimInfo(U64 handle) : mHandle(handle), + mSizeX(REGION_WIDTH_UNITS), + mSizeY(REGION_WIDTH_UNITS), mName(), mAgentsUpdateTime(0), - mAccess(0x0), - mRegionFlags(0x0), mFirstAgentRequest(true), - mSizeX(REGION_WIDTH_UNITS), - mSizeY(REGION_WIDTH_UNITS) + mAccess(0x0), + mRegionFlags(0x0) // mWaterHeight(0.f) { } @@ -88,7 +88,7 @@ void LLSimInfo::setLandForSaleImage (LLUUID image_id) } else { - mOverlayImage = NULL; + mOverlayImage = nullptr; } } @@ -132,7 +132,7 @@ void LLSimInfo::clearImage() if (!mOverlayImage.isNull()) { mOverlayImage->setBoostLevel(0); - mOverlayImage = NULL; + mOverlayImage = nullptr; } } @@ -264,7 +264,7 @@ bool LLWorldMap::clearItems(bool force) { mRequestTimer.reset(); - LLSimInfo* sim_info = NULL; + LLSimInfo* sim_info = nullptr; for (sim_info_map_t::iterator it = mSimInfoMap.begin(); it != mSimInfoMap.end(); ++it) { sim_info = it->second; @@ -286,7 +286,7 @@ void LLWorldMap::clearImageRefs() mWorldMipmap.reset(); // Images hold by the region map - LLSimInfo* sim_info = NULL; + LLSimInfo* sim_info = nullptr; for (sim_info_map_t::iterator it = mSimInfoMap.begin(); it != mSimInfoMap.end(); ++it) { sim_info = it->second; @@ -343,13 +343,13 @@ LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 handle) return info; } } - return NULL; + return nullptr; } LLSimInfo* LLWorldMap::simInfoFromName(const std::string& sim_name) { - LLSimInfo* sim_info = NULL; + LLSimInfo* sim_info = nullptr; if (!sim_name.empty()) { // Iterate through the entire sim info map and compare the name @@ -365,7 +365,7 @@ LLSimInfo* LLWorldMap::simInfoFromName(const std::string& sim_name) } // If we got to the end, we haven't found the sim. Reset the ouput value to NULL. if (it == mSimInfoMap.end()) - sim_info = NULL; + sim_info = nullptr; } return sim_info; } @@ -383,7 +383,7 @@ bool LLWorldMap::simNameFromPosGlobal(const LLVector3d& pos_global, std::string outSimName = "(unknown region)"; } - return (sim_info != NULL); + return (sim_info != nullptr); } void LLWorldMap::reloadItems(bool force) @@ -424,7 +424,7 @@ bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, U16 x_size, U16 y_size, // Insert the region in the region map of the world map // Loading the LLSimInfo object with what we got and insert it in the map LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromHandle(handle); - if (siminfo == NULL) + if (siminfo == nullptr) { siminfo = LLWorldMap::getInstance()->createSimInfoFromHandle(handle); } @@ -468,7 +468,7 @@ bool LLWorldMap::insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& // Get the region record for that handle or NULL if we haven't browsed it yet LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromHandle(handle); - if (siminfo == NULL) + if (siminfo == nullptr) { siminfo = LLWorldMap::getInstance()->createSimInfoFromHandle(handle); } diff --git a/indra/newview/llworldmapview.h b/indra/newview/llworldmapview.h index 5df240e79be05f1d6a4c802221c2451d1c89ca07..4c376bbbc288e7bdb21944919da02e0319383d0e 100644 --- a/indra/newview/llworldmapview.h +++ b/indra/newview/llworldmapview.h @@ -52,17 +52,17 @@ public: LLWorldMapView(); virtual ~LLWorldMapView(); - - virtual BOOL postBuild(); - - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE ); - virtual void setVisible(BOOL visible); - - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); - virtual BOOL handleHover( S32 x, S32 y, MASK mask ); - virtual BOOL handleToolTip( S32 x, S32 y, MASK mask); + + BOOL postBuild() override; + + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE ) override; + void setVisible(BOOL visible) override; + + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override; + BOOL handleDoubleClick( S32 x, S32 y, MASK mask ) override; + BOOL handleHover( S32 x, S32 y, MASK mask ) override; + BOOL handleToolTip( S32 x, S32 y, MASK mask) override; bool checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track); void handleClick(S32 x, S32 y, MASK mask, S32* hit_type, LLUUID* id); @@ -77,7 +77,7 @@ public: LLVector3 globalPosToView(const LLVector3d& global_pos); LLVector3d viewPosToGlobal(S32 x,S32 y); - virtual void draw(); + void draw() override; void drawGenericItems(const LLSimInfo::item_info_list_t& items, LLUIImagePtr image); void drawGenericItem(const LLItemInfo& item, LLUIImagePtr image); void drawImage(const LLVector3d& global_pos, LLUIImagePtr image, const LLColor4& color = LLColor4::white); diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index 1e86bccfcc4b34c625ea711df538ceda5e6aa95c..22576c63c917bf0437a8722785e7e83fb086a7c1 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -268,7 +268,7 @@ public: XMLRPC_REQUEST request = XMLRPC_RequestNew(); XMLRPC_RequestSetMethodName(request, mMethod.c_str()); XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); - XMLRPC_VALUE xparams = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); + XMLRPC_VALUE xparams = XMLRPC_CreateVector(nullptr, xmlrpc_vector_struct); LLSD params(command["params"]); if (params.isMap()) { @@ -310,7 +310,7 @@ public: XMLRPC_RequestSetData(request, xparams); mTransaction.reset(new LLXMLRPCTransaction(mUri, request)); - mPreviousStatus = mTransaction->status(NULL); + mPreviousStatus = mTransaction->status(nullptr); // Free the XMLRPC_REQUEST object and the attached data values. XMLRPC_RequestFree(request, 1); diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index de96c9b9e781602521df75fc39dd15273d9750a5..4459a6c6c1da6107e19001efffba5fdebc8dc105 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -84,17 +84,17 @@ LLXMLRPCValue LLXMLRPCValue::next() bool LLXMLRPCValue::isValid() const { - return mV != NULL; + return mV != nullptr; } LLXMLRPCValue LLXMLRPCValue::createArray() { - return LLXMLRPCValue(XMLRPC_CreateVector(NULL, xmlrpc_vector_array)); + return LLXMLRPCValue(XMLRPC_CreateVector(nullptr, xmlrpc_vector_array)); } LLXMLRPCValue LLXMLRPCValue::createStruct() { - return LLXMLRPCValue(XMLRPC_CreateVector(NULL, xmlrpc_vector_struct)); + return LLXMLRPCValue(XMLRPC_CreateVector(nullptr, xmlrpc_vector_struct)); } @@ -105,22 +105,22 @@ void LLXMLRPCValue::append(LLXMLRPCValue& v) void LLXMLRPCValue::appendString(const std::string& v) { - XMLRPC_AddValueToVector(mV, XMLRPC_CreateValueString(NULL, v.c_str(), 0)); + XMLRPC_AddValueToVector(mV, XMLRPC_CreateValueString(nullptr, v.c_str(), 0)); } void LLXMLRPCValue::appendInt(int v) { - XMLRPC_AddValueToVector(mV, XMLRPC_CreateValueInt(NULL, v)); + XMLRPC_AddValueToVector(mV, XMLRPC_CreateValueInt(nullptr, v)); } void LLXMLRPCValue::appendBool(bool v) { - XMLRPC_AddValueToVector(mV, XMLRPC_CreateValueBoolean(NULL, v)); + XMLRPC_AddValueToVector(mV, XMLRPC_CreateValueBoolean(nullptr, v)); } void LLXMLRPCValue::appendDouble(double v) { - XMLRPC_AddValueToVector(mV, XMLRPC_CreateValueDouble(NULL, v)); + XMLRPC_AddValueToVector(mV, XMLRPC_CreateValueDouble(nullptr, v)); } @@ -153,7 +153,7 @@ void LLXMLRPCValue::appendDouble(const char* id, double v) void LLXMLRPCValue::cleanup() { XMLRPC_CleanupValue(mV); - mV = NULL; + mV = nullptr; } XMLRPC_VALUE LLXMLRPCValue::getValue() const @@ -168,7 +168,7 @@ public: Handler(LLCore::HttpRequest::ptr_t &request, LLXMLRPCTransaction::Impl *impl); virtual ~Handler(); - virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) override; typedef boost::shared_ptr<LLXMLRPCTransaction::Handler> ptr_t; @@ -247,7 +247,7 @@ void LLXMLRPCTransaction::Handler::onCompleted(LLCore::HttpHandle handle, if (errordata) { mImpl->mErrorCert = LLPointer<LLCertificate>(errordata); - status.setErrorData(NULL); + status.setErrorData(nullptr); errordata->unref(); } @@ -270,7 +270,7 @@ void LLXMLRPCTransaction::Handler::onCompleted(LLCore::HttpHandle handle, body->read(0, bodydata, body->size()); - mImpl->mResponse = XMLRPC_REQUEST_FromXML(bodydata, body->size(), 0); + mImpl->mResponse = XMLRPC_REQUEST_FromXML(bodydata, body->size(), nullptr); delete[] bodydata; @@ -314,7 +314,7 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri, : mHttpRequest(), mStatus(LLXMLRPCTransaction::StatusNotStarted), mURI(uri), - mResponse(0) + mResponse(nullptr) { init(request, useGzip); } @@ -325,7 +325,7 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri, : mHttpRequest(), mStatus(LLXMLRPCTransaction::StatusNotStarted), mURI(uri), - mResponse(0) + mResponse(nullptr) { XMLRPC_REQUEST request = XMLRPC_RequestNew(); XMLRPC_RequestSetMethodName(request, method.c_str()); @@ -348,11 +348,11 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) if (!mHttpRequest) { - mHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest); + mHttpRequest = boost::make_shared<LLCore::HttpRequest>(); } // LLRefCounted starts with a 1 ref, so don't add a ref in the smart pointer - httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); + httpOpts = boost::make_shared<LLCore::HttpOptions>(); httpOpts->setTimeout(40L); @@ -363,7 +363,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) httpOpts->setSSLVerifyHost(vefifySSLCert); // LLRefCounted starts with a 1 ref, so don't add a ref in the smart pointer - httpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); + httpHeaders = boost::make_shared<LLCore::HttpHeaders>(); httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML); @@ -382,7 +382,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) XMLRPC_Free(requestText); - mHandler = LLXMLRPCTransaction::Handler::ptr_t(new Handler( mHttpRequest, this )); + mHandler = boost::make_shared<Handler>(mHttpRequest, this); mPostH = mHttpRequest->requestPost(LLCore::HttpRequest::DEFAULT_POLICY_ID, 0, mURI, body.get(), httpOpts, httpHeaders, mHandler); diff --git a/indra/newview/llxmlrpctransaction.h b/indra/newview/llxmlrpctransaction.h index 9a4d916bd58f6a685fc2b5a5c96418e523da9eea..5dd9d22fd2583483542f89059ece9b7a9cb5519f 100644 --- a/indra/newview/llxmlrpctransaction.h +++ b/indra/newview/llxmlrpctransaction.h @@ -36,7 +36,7 @@ class LLXMLRPCValue // a c++ wrapper around XMLRPC_VALUE { public: - LLXMLRPCValue() : mV(NULL) { } + LLXMLRPCValue() : mV(nullptr) { } LLXMLRPCValue(XMLRPC_VALUE value) : mV(value) { } bool isValid() const; diff --git a/indra/newview/noise.h b/indra/newview/noise.h index b3efad73c5622063e5334c3ba75e2129f90e6461..784163fd9536b6e8e65fbe5e1837c070a6fa7f80 100644 --- a/indra/newview/noise.h +++ b/indra/newview/noise.h @@ -344,7 +344,7 @@ static void init(void) } // reintroduce entropy - srand(time(NULL)); // Flawfinder: ignore + srand(time(nullptr)); // Flawfinder: ignore } #undef B diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 4b5117288451e33bc6f614133678c2285ad17c9f..5090164cdda07763f68435f1f32e7ea0b1a11c28 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -234,7 +234,7 @@ BOOL gAvatarBacklight = FALSE; BOOL gDebugPipeline = FALSE; LLPipeline gPipeline; -const LLMatrix4* gGLLastMatrix = NULL; +const LLMatrix4* gGLLastMatrix = nullptr; LLTrace::BlockTimerStatHandle FTM_RENDER_GEOMETRY("Render Geometry"); LLTrace::BlockTimerStatHandle FTM_RENDER_GRASS("Grass"); @@ -390,7 +390,7 @@ BOOL LLPipeline::sRenderingHUDs = FALSE; // EventHost API LLPipeline listener. static LLPipelineListener sPipelineListener; -static LLCullResult* sCull = NULL; +static LLCullResult* sCull = nullptr; void validate_framebuffer_object(); @@ -408,6 +408,8 @@ LLPipeline::LLPipeline() : mNumVisibleNodes(0), mNumVisibleFaces(0), + mScreenWidth(0), + mScreenHeight(0), mInitialized(FALSE), mVertexShadersEnabled(FALSE), mVertexShadersLoaded(0), @@ -415,29 +417,27 @@ LLPipeline::LLPipeline() : mRenderDebugMask(0), mOldRenderDebugMask(0), mMeshDirtyQueryObject(0), - mGroupQ1Locked(false), mGroupQ2Locked(false), + mGroupQ1Locked(false), mResetVertexBuffers(false), - mLastRebuildPool(NULL), - mAlphaPool(NULL), - mSkyPool(NULL), - mTerrainPool(NULL), - mWaterPool(NULL), - mGroundPool(NULL), - mSimplePool(NULL), - mGrassPool(NULL), - mAlphaMaskPool(NULL), - mFullbrightAlphaMaskPool(NULL), - mFullbrightPool(NULL), - mGlowPool(NULL), - mBumpPool(NULL), - mMaterialsPool(NULL), - mWLSkyPool(NULL), + mLastRebuildPool(nullptr), + mAlphaPool(nullptr), + mSkyPool(nullptr), + mTerrainPool(nullptr), + mWaterPool(nullptr), + mGroundPool(nullptr), + mSimplePool(nullptr), + mGrassPool(nullptr), + mAlphaMaskPool(nullptr), + mFullbrightAlphaMaskPool(nullptr), + mFullbrightPool(nullptr), + mGlowPool(nullptr), + mBumpPool(nullptr), + mMaterialsPool(nullptr), + mWLSkyPool(nullptr), mLightMask(0), mLightMovingMask(0), - mLightingDetail(0), - mScreenWidth(0), - mScreenHeight(0) + mLightingDetail(0) { mNoiseMap = 0; mLightFunc = 0; @@ -680,37 +680,37 @@ void LLPipeline::cleanup() } delete mAlphaPool; - mAlphaPool = NULL; + mAlphaPool = nullptr; delete mSkyPool; - mSkyPool = NULL; + mSkyPool = nullptr; delete mTerrainPool; - mTerrainPool = NULL; + mTerrainPool = nullptr; delete mWaterPool; - mWaterPool = NULL; + mWaterPool = nullptr; delete mGroundPool; - mGroundPool = NULL; + mGroundPool = nullptr; delete mSimplePool; - mSimplePool = NULL; + mSimplePool = nullptr; delete mFullbrightPool; - mFullbrightPool = NULL; + mFullbrightPool = nullptr; delete mGlowPool; - mGlowPool = NULL; + mGlowPool = nullptr; delete mBumpPool; - mBumpPool = NULL; + mBumpPool = nullptr; // don't delete wl sky pool it was handled above in the for loop //delete mWLSkyPool; - mWLSkyPool = NULL; + mWLSkyPool = nullptr; releaseGLBuffers(); - mFaceSelectImagep = NULL; + mFaceSelectImagep = nullptr; mMovedBridge.clear(); mInitialized = FALSE; - mAuxScreenRectVB = NULL; - mCubeVB = NULL; + mAuxScreenRectVB = nullptr; + mCubeVB = nullptr; } //============================================================================ @@ -890,7 +890,7 @@ LLPipeline::eFBOStatus LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY) bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) { - mAuxScreenRectVB = NULL; + mAuxScreenRectVB = nullptr; refreshCachedSettings(); @@ -1472,7 +1472,7 @@ public: LLOctreeDirtyTexture(const std::set<LLViewerFetchedTexture*>& textures) : mTextures(textures) { } - virtual void visit(const OctreeNode* node) + void visit(const OctreeNode* node) override { LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); @@ -1537,7 +1537,7 @@ LLDrawPool *LLPipeline::findPool(const U32 type, LLViewerTexture *tex0) { assertInitialized(); - LLDrawPool *poolp = NULL; + LLDrawPool *poolp = nullptr; switch( type ) { case LLDrawPool::POOL_SIMPLE: @@ -1565,11 +1565,11 @@ LLDrawPool *LLPipeline::findPool(const U32 type, LLViewerTexture *tex0) break; case LLDrawPool::POOL_TREE: - poolp = get_if_there(mTreePools, (uintptr_t)tex0, (LLDrawPool*)0 ); + poolp = get_if_there(mTreePools, (uintptr_t)tex0, (LLDrawPool*)nullptr ); break; case LLDrawPool::POOL_TERRAIN: - poolp = get_if_there(mTerrainPools, (uintptr_t)tex0, (LLDrawPool*)0 ); + poolp = get_if_there(mTerrainPools, (uintptr_t)tex0, (LLDrawPool*)nullptr ); break; case LLDrawPool::POOL_BUMP: @@ -1817,7 +1817,7 @@ void LLPipeline::unlinkDrawable(LLDrawable *drawable) if (mHighlightObject == drawablep) { - mHighlightObject = NULL; + mHighlightObject = nullptr; } } @@ -1825,12 +1825,12 @@ void LLPipeline::unlinkDrawable(LLDrawable *drawable) { if (mShadowSpotLight[i] == drawablep) { - mShadowSpotLight[i] = NULL; + mShadowSpotLight[i] = nullptr; } if (mTargetShadowSpotLight[i] == drawablep) { - mTargetShadowSpotLight[i] = NULL; + mTargetShadowSpotLight[i] = nullptr; } } @@ -1912,7 +1912,7 @@ void LLPipeline::createObject(LLViewerObject* vobj) } else { - vobj->setDrawableParent(NULL); // LLPipeline::addObject 2 + vobj->setDrawableParent(nullptr); // LLPipeline::addObject 2 } markRebuild(drawablep, LLDrawable::REBUILD_ALL, TRUE); @@ -2158,7 +2158,7 @@ void LLPipeline::grabReferences(LLCullResult& result) void LLPipeline::clearReferences() { - sCull = NULL; + sCull = nullptr; mGroupSaveQ1.clear(); } @@ -2438,7 +2438,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl gGL.loadMatrix(gGLLastProjection); gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLLastModelView); LLGLDisable blend(GL_BLEND); @@ -2980,8 +2980,8 @@ void LLPipeline::updateGeom(F32 max_dtime) S32 count = 0; max_dtime = llmax(update_timer.getElapsedTimeF32()+0.001f, F32SecondsImplicit(max_dtime)); - LLSpatialGroup* last_group = NULL; - LLSpatialBridge* last_bridge = NULL; + LLSpatialGroup* last_group = nullptr; + LLSpatialBridge* last_bridge = nullptr; for (LLDrawable::drawable_list_t::iterator iter = mBuildQ2.begin(); iter != mBuildQ2.end(); ) @@ -3347,14 +3347,14 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD) { - LLSpatialGroup* last_group = NULL; + LLSpatialGroup* last_group = nullptr; for (LLCullResult::bridge_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i) { LLCullResult::bridge_iterator cur_iter = i; LLSpatialBridge* bridge = *cur_iter; LLSpatialGroup* group = bridge->getSpatialGroup(); - if (last_group == NULL) + if (last_group == nullptr) { last_group = group; } @@ -3462,7 +3462,7 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) if (drawablep->isAvatar()) { //don't draw avatars beyond render distance or if we don't have a spatial group. - if ((drawablep->getSpatialGroup() == NULL) || + if ((drawablep->getSpatialGroup() == nullptr) || (drawablep->getSpatialGroup()->mDistance > LLVOAvatar::sRenderDistance)) { return; @@ -3481,7 +3481,7 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) { if (!drawablep->isState(LLDrawable::INVISIBLE|LLDrawable::FORCE_INVISIBLE)) { - drawablep->setVisible(camera, NULL, FALSE); + drawablep->setVisible(camera, nullptr, FALSE); } } @@ -3913,7 +3913,7 @@ void LLPipeline::postSort(LLCamera& camera) { struct f : public LLSelectedTEFunctor { - virtual bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->mDrawable) { @@ -4309,7 +4309,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD)) { calcNearbyLights(camera); - setupHWLights(NULL); + setupHWLights(nullptr); } BOOL occlude = sUseOcclusion > 1; @@ -4328,7 +4328,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) if (occlude && cur_type >= LLDrawPool::POOL_GRASS) { occlude = FALSE; - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); doOcclusion(camera); @@ -4339,7 +4339,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) { LL_RECORD_BLOCK_TIME(FTM_POOLRENDER); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); for( S32 i = 0; i < poolp->getNumPasses(); i++ ) @@ -4387,13 +4387,13 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) LLVertexBuffer::unbind(); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); if (occlude) { occlude = FALSE; - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); doOcclusion(camera); @@ -4509,7 +4509,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) { LL_RECORD_BLOCK_TIME(FTM_DEFERRED_POOLRENDER); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); for( S32 i = 0; i < poolp->getNumDeferredPasses(); i++ ) @@ -4551,7 +4551,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) stop_glerror(); } - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); gGL.setColorMask(true, false); @@ -4567,7 +4567,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera, bool do_occlusion) LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); calcNearbyLights(camera); - setupHWLights(NULL); + setupHWLights(nullptr); gGL.setColorMask(true, false); @@ -4583,7 +4583,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera, bool do_occlusion) if (occlude && cur_type >= LLDrawPool::POOL_GRASS) { occlude = FALSE; - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); doOcclusion(camera); @@ -4595,7 +4595,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera, bool do_occlusion) { LL_RECORD_BLOCK_TIME(FTM_POST_DEFERRED_POOLRENDER); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); for( S32 i = 0; i < poolp->getNumPostDeferredPasses(); i++ ) @@ -4637,17 +4637,17 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera, bool do_occlusion) stop_glerror(); } - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); if (occlude) { occlude = FALSE; - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); doOcclusion(camera); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); } } @@ -4673,7 +4673,7 @@ void LLPipeline::renderGeomShadow(LLCamera& camera) { poolp->prerender() ; - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); for( S32 i = 0; i < poolp->getNumShadowPasses(); i++ ) @@ -4715,7 +4715,7 @@ void LLPipeline::renderGeomShadow(LLCamera& camera) stop_glerror(); } - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); } @@ -4803,7 +4803,7 @@ void LLPipeline::renderDebug() gGL.color4f(1,1,1,1); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); gGL.setColorMask(true, false); @@ -5134,7 +5134,7 @@ void LLPipeline::renderDebug() gGL.pushMatrix(); gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin(); iter != mGroupQ2.end(); ++iter) { @@ -5208,7 +5208,7 @@ void LLPipeline::rebuildPools() removeFromQuickLookup( poolp ); if (poolp == mLastRebuildPool) { - mLastRebuildPool = NULL; + mLastRebuildPool = nullptr; } delete poolp; } @@ -5416,37 +5416,37 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp ) { case LLDrawPool::POOL_SIMPLE: llassert(mSimplePool == poolp); - mSimplePool = NULL; + mSimplePool = nullptr; break; case LLDrawPool::POOL_ALPHA_MASK: llassert(mAlphaMaskPool == poolp); - mAlphaMaskPool = NULL; + mAlphaMaskPool = nullptr; break; case LLDrawPool::POOL_FULLBRIGHT_ALPHA_MASK: llassert(mFullbrightAlphaMaskPool == poolp); - mFullbrightAlphaMaskPool = NULL; + mFullbrightAlphaMaskPool = nullptr; break; case LLDrawPool::POOL_GRASS: llassert(mGrassPool == poolp); - mGrassPool = NULL; + mGrassPool = nullptr; break; case LLDrawPool::POOL_FULLBRIGHT: llassert(mFullbrightPool == poolp); - mFullbrightPool = NULL; + mFullbrightPool = nullptr; break; case LLDrawPool::POOL_WL_SKY: llassert(mWLSkyPool == poolp); - mWLSkyPool = NULL; + mWLSkyPool = nullptr; break; case LLDrawPool::POOL_GLOW: llassert(mGlowPool == poolp); - mGlowPool = NULL; + mGlowPool = nullptr; break; case LLDrawPool::POOL_TREE: @@ -5473,17 +5473,17 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp ) case LLDrawPool::POOL_BUMP: llassert( poolp == mBumpPool ); - mBumpPool = NULL; + mBumpPool = nullptr; break; case LLDrawPool::POOL_MATERIALS: llassert(poolp == mMaterialsPool); - mMaterialsPool = NULL; + mMaterialsPool = nullptr; break; case LLDrawPool::POOL_ALPHA: llassert( poolp == mAlphaPool ); - mAlphaPool = NULL; + mAlphaPool = nullptr; break; case LLDrawPool::POOL_AVATAR: @@ -5491,17 +5491,17 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp ) case LLDrawPool::POOL_SKY: llassert( poolp == mSkyPool ); - mSkyPool = NULL; + mSkyPool = nullptr; break; case LLDrawPool::POOL_WATER: llassert( poolp == mWaterPool ); - mWaterPool = NULL; + mWaterPool = nullptr; break; case LLDrawPool::POOL_GROUND: llassert( poolp == mGroundPool ); - mGroundPool = NULL; + mGroundPool = nullptr; break; default: @@ -6613,7 +6613,7 @@ LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector4a& start, LLVector4a position; - LLDrawable* drawable = NULL; + LLDrawable* drawable = nullptr; for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) @@ -6623,7 +6623,7 @@ LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector4a& start, LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_PARTICLE); if (part && hasRenderType(part->mDrawableType)) { - LLDrawable* hit = part->lineSegmentIntersect(start, local_end, TRUE, FALSE, face_hit, &position, NULL, NULL, NULL); + LLDrawable* hit = part->lineSegmentIntersect(start, local_end, TRUE, FALSE, face_hit, &position, nullptr, nullptr, nullptr); if (hit) { drawable = hit; @@ -6632,7 +6632,7 @@ LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector4a& start, } } - LLVOPartGroup* ret = NULL; + LLVOPartGroup* ret = nullptr; if (drawable) { //make sure we're returning an LLVOPartGroup @@ -6658,7 +6658,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, LLVector4a* tangent // return the surface tangent at the intersection point ) { - LLDrawable* drawable = NULL; + LLDrawable* drawable = nullptr; LLVector4a local_end = end; @@ -6810,7 +6810,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInHUD(const LLVector4a& start, c LLVector4a* tangent // return the surface tangent at the intersection point ) { - LLDrawable* drawable = NULL; + LLDrawable* drawable = nullptr; for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) @@ -6852,7 +6852,7 @@ LLSpatialPartition* LLPipeline::getSpatialPartition(LLViewerObject* vobj) return region->getSpatialPartition(vobj->getPartitionType()); } } - return NULL; + return nullptr; } void LLPipeline::resetVertexBuffers(LLDrawable* drawable) @@ -6903,8 +6903,8 @@ void LLPipeline::doResetVertexBuffers(bool forced) LL_RECORD_BLOCK_TIME(FTM_RESET_VB); mResetVertexBuffers = false; - mCubeVB = NULL; - mAuxScreenRectVB = NULL; + mCubeVB = nullptr; + mAuxScreenRectVB = nullptr; for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) @@ -6969,20 +6969,20 @@ void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture, BOOL batch_text { assertInitialized(); gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; mSimplePool->pushBatches(type, mask, texture, batch_texture); gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; } void LLPipeline::renderMaskedObjects(U32 type, U32 mask, BOOL texture, BOOL batch_texture) { assertInitialized(); gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; mAlphaMaskPool->pushMaskBatches(type, mask, texture, batch_texture); gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; } @@ -7233,8 +7233,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) LLVector4a result; result.clear(); - gViewerWindow->cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE, FALSE, - NULL, + gViewerWindow->cursorIntersect(-1, -1, 512.f, nullptr, -1, FALSE, FALSE, + nullptr, &result); focus_point.set(result.getF32ptr()); @@ -7850,7 +7850,7 @@ void LLPipeline::renderDeferredLighting() const glm::mat4 mat = glm_get_current_modelview(); { - setupHWLights(NULL); //to set mSunDir; + setupHWLights(nullptr); //to set mSunDir; glm::vec4 tc(mSunDir[0], mSunDir[1], mSunDir[2], 0.f); tc = mat * tc; mTransformedSunDir.set(glm::value_ptr(tc)); @@ -8047,7 +8047,7 @@ void LLPipeline::renderDeferredLighting() for (U32 i = 0; i < 2; i++) { - mTargetShadowSpotLight[i] = NULL; + mTargetShadowSpotLight[i] = nullptr; } std::list<LLVector4> light_colors; @@ -8436,7 +8436,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) const glm::mat4 mat = glm_get_current_modelview(); { - setupHWLights(NULL); //to set mSunDir; + setupHWLights(nullptr); //to set mSunDir; glm::vec4 tc(mSunDir[0], mSunDir[1], mSunDir[2], 0.f); tc = mat * tc; mTransformedSunDir.set(glm::value_ptr(tc)); @@ -8595,7 +8595,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) for (U32 i = 0; i < 2; i++) { - mTargetShadowSpotLight[i] = NULL; + mTargetShadowSpotLight[i] = nullptr; } std::list<LLVector4> light_colors; @@ -9054,7 +9054,7 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep) LLViewerTexture* img = volume->getLightTexture(); - if (img == NULL) + if (img == nullptr) { img = LLViewerFetchedTexture::sWhiteImagep; } @@ -9535,7 +9535,7 @@ void LLPipeline::renderShadow(const glm::mat4& view, const glm::mat4& proj, LLCa gGL.loadMatrix(gGLModelView); stop_glerror(); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -9617,7 +9617,7 @@ void LLPipeline::renderShadow(const glm::mat4& view, const glm::mat4& proj, LLCa //glCullFace(GL_BACK); gDeferredShadowCubeProgram.bind(); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); doOcclusion(shadow_cam); @@ -9633,7 +9633,7 @@ void LLPipeline::renderShadow(const glm::mat4& view, const glm::mat4& proj, LLCa gGL.popMatrix(); gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; LLPipeline::sUseOcclusion = occlude; LLPipeline::sShadowRender = FALSE; @@ -10531,7 +10531,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) if (!volume) { - mShadowSpotLight[i] = NULL; + mShadowSpotLight[i] = nullptr; continue; } @@ -10616,7 +10616,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) } else { //no spotlight shadows - mShadowSpotLight[0] = mShadowSpotLight[1] = NULL; + mShadowSpotLight[0] = mShadowSpotLight[1] = nullptr; } @@ -11203,7 +11203,7 @@ void LLPipeline::restorePermanentObjects( const std::vector<U32>& restoreList ) while ( itCurrent != itEnd ) { U32 index = *itCurrent; - LLViewerObject* pObject = NULL; + LLViewerObject* pObject = nullptr; if ( index < objCnt ) { pObject = gObjectList.getObject( index ); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index c960399de44422db5bf27a6e69686bef0fb67e05..8abf477412ac3183b3cf02ae8bb0e23f94bb3861 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -139,11 +139,11 @@ public: /// @brief Get a draw pool from pool type (POOL_SIMPLE, POOL_MEDIA) and texture. /// @return Draw pool, or NULL if not found. - LLDrawPool *findPool(const U32 pool_type, LLViewerTexture *tex0 = NULL); + LLDrawPool *findPool(const U32 pool_type, LLViewerTexture *tex0 = nullptr); /// @brief Get a draw pool for faces of the appropriate type and texture. Create if necessary. /// @return Always returns a draw pool. - LLDrawPool *getPool(const U32 pool_type, LLViewerTexture *tex0 = NULL); + LLDrawPool *getPool(const U32 pool_type, LLViewerTexture *tex0 = nullptr); /// @brief Figures out draw pool type from texture entry. Creates pool if necessary. static LLDrawPool* getPoolFromTE(const LLTextureEntry* te, LLViewerTexture* te_image); @@ -178,10 +178,10 @@ public: BOOL pick_transparent, BOOL pick_rigged, S32* face_hit, // return the face hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point + LLVector4a* intersection = nullptr, // return the intersection point + LLVector2* tex_coord = nullptr, // return the texture coordinates of the intersection point + LLVector4a* normal = nullptr, // return the surface normal at the intersection point + LLVector4a* tangent = nullptr // return the surface tangent at the intersection point ); //get the closest particle to start between start and end, returns the LLVOPartGroup and particle index @@ -192,10 +192,10 @@ public: LLViewerObject* lineSegmentIntersectInHUD(const LLVector4a& start, const LLVector4a& end, BOOL pick_transparent, S32* face_hit, // return the face hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point + LLVector4a* intersection = nullptr, // return the intersection point + LLVector2* tex_coord = nullptr, // return the texture coordinates of the intersection point + LLVector4a* normal = nullptr, // return the surface normal at the intersection point + LLVector4a* tangent = nullptr // return the surface tangent at the intersection point ); // Something about these textures has changed. Dirty them. @@ -230,7 +230,7 @@ public: BOOL visibleObjectsInFrustum(LLCamera& camera); BOOL getVisibleExtents(LLCamera& camera, LLVector3 &min, LLVector3& max); BOOL getVisiblePointCloud(LLCamera& camera, LLVector3 &min, LLVector3& max, std::vector<LLVector3>& fp, LLVector3 light_dir = LLVector3(0,0,0)); - void updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip = 0, LLPlane* plane = NULL); //if water_clip is 0, ignore water plane, 1, cull to above plane, -1, cull to below plane + void updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip = 0, LLPlane* plane = nullptr); //if water_clip is 0, ignore water plane, 1, cull to above plane, -1, cull to below plane void createObjects(F32 max_dtime); void createObject(LLViewerObject* vobj); void processPartitionQ(); @@ -271,10 +271,10 @@ public: void renderGeomDeferred(LLCamera& camera); void renderGeomPostDeferred(LLCamera& camera, bool do_occlusion=true); void renderGeomShadow(LLCamera& camera); - void bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* diffuse_source = NULL, LLRenderTarget* light_source = NULL); + void bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* diffuse_source = nullptr, LLRenderTarget* light_source = nullptr); void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep); - void unbindDeferredShader(LLGLSLShader& shader, LLRenderTarget* diffuse_source = NULL, LLRenderTarget* light_source = NULL); + void unbindDeferredShader(LLGLSLShader& shader, LLRenderTarget* diffuse_source = nullptr, LLRenderTarget* light_source = nullptr); void renderDeferredLighting(); void renderDeferredLightingToRT(LLRenderTarget* target); diff --git a/indra/newview/qtoolalign.h b/indra/newview/qtoolalign.h index eaa8cddf88fb3128716b35d4fb3c74752a2f5558..7db46cc14daa9c162936987ab6614c3950e3c384 100644 --- a/indra/newview/qtoolalign.h +++ b/indra/newview/qtoolalign.h @@ -21,11 +21,11 @@ class QToolAlign ~QToolAlign() {} public: - virtual void handleSelect(); - virtual void handleDeselect(); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual void render(); + void handleSelect() override; + void handleDeselect() override; + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + void render() override; static void pickCallback(const LLPickInfo& pick_info); diff --git a/indra/viewer_components/updater/llupdatechecker.cpp b/indra/viewer_components/updater/llupdatechecker.cpp index 0dd0402156ea58ac59df475a7b799ca7630c2c98..7ca5689e368d99d970676f92c4a6e96d312ee8bb 100644 --- a/indra/viewer_components/updater/llupdatechecker.cpp +++ b/indra/viewer_components/updater/llupdatechecker.cpp @@ -79,8 +79,8 @@ const char * LLUpdateChecker::Implementation::sProtocolVersion = "v1.1"; LLUpdateChecker::Implementation::Implementation(LLUpdateChecker::Client & client): - mClient(client), - mProtocol(sProtocolVersion), + mProtocol(sProtocolVersion), + mClient(client), mInProgress(false), mWillingToTest(false) { diff --git a/indra/viewer_components/updater/llupdatedownloader.cpp b/indra/viewer_components/updater/llupdatedownloader.cpp index e96ca0cb6cb34cd30d76d4f390b512810c4f8764..65d23d0432d49953bb0dd028e3715da1281218bf 100644 --- a/indra/viewer_components/updater/llupdatedownloader.cpp +++ b/indra/viewer_components/updater/llupdatedownloader.cpp @@ -75,7 +75,7 @@ private: void initializeCurlGet(std::string const & url, bool processHeader); void resumeDownloading(size_t startByte); - void run(void); + void run(void) override; void startDownloading(LLURI const & uri, std::string const & hash); void throwOnCurlError(CURLcode code); bool validateDownload(const std::string& filePath); @@ -195,7 +195,7 @@ LLUpdateDownloader::Implementation::Implementation(LLUpdateDownloader::Client & mClient(client), mCurl(), mDownloadPercent(0), - mHeaderList(0) + mHeaderList(nullptr) { CURLcode code = curl_global_init(CURL_GLOBAL_ALL); // Just in case. llverify(code == CURLE_OK); // TODO: real error handling here. @@ -377,7 +377,7 @@ size_t LLUpdateDownloader::Implementation::onHeader(void * buffer, size_t size) size_t LLUpdateDownloader::Implementation::onBody(void * buffer, size_t size) { if(mCancelled) return 0; // Forces a write error which will halt curl thread. - if((size == 0) || (buffer == 0)) return 0; + if((size == 0) || (buffer == nullptr)) return 0; mDownloadStream.write(static_cast<const char *>(buffer), size); if(mDownloadStream.bad()) { @@ -451,7 +451,7 @@ void LLUpdateDownloader::Implementation::run(void) if(mHeaderList) { curl_slist_free_all(mHeaderList); - mHeaderList = 0; + mHeaderList = nullptr; } } @@ -508,7 +508,7 @@ void LLUpdateDownloader::Implementation::resumeDownloading(size_t startByte) boost::format rangeHeaderFormat("Range: bytes=%u-"); rangeHeaderFormat % startByte; mHeaderList = curl_slist_append(mHeaderList, rangeHeaderFormat.str().c_str()); - if(mHeaderList == 0) + if(mHeaderList == nullptr) { LLTHROW(DownloadError("cannot add Range header")); } @@ -548,7 +548,7 @@ void LLUpdateDownloader::Implementation::throwOnCurlError(CURLcode code) { if(code != CURLE_OK) { const char * errorString = curl_easy_strerror(code); - if(errorString != 0) { + if(errorString != nullptr) { LLTHROW(DownloadError(curl_easy_strerror(code))); } else { LLTHROW(DownloadError("unknown curl error")); diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index c029c2fe814bb290c7f19f0ebbbc1ebeb1799bb4..c1d8ad55ab0127ec70e6098424e7bc97a7e43b21 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -145,14 +145,14 @@ public: bool checkForResume(); // Test for resumeable d/l. // LLUpdateChecker::Client: - virtual void error(std::string const & message); + void error(std::string const & message) override; // A successful response was received from the viewer version manager - virtual void response(LLSD const & content); + void response(LLSD const & content) override; // LLUpdateDownloader::Client - void downloadComplete(LLSD const & data); - void downloadError(std::string const & message); + void downloadComplete(LLSD const & data) override; + void downloadError(std::string const & message) override; bool onMainLoop(LLSD const & event); @@ -170,9 +170,9 @@ const std::string LLUpdaterServiceImpl::sListenerName = "LLUpdaterServiceImpl"; LLUpdaterServiceImpl::LLUpdaterServiceImpl() : mWillingToTest(false), + mCheckPeriod(0), mIsChecking(false), mIsDownloading(false), - mCheckPeriod(0), mUpdateChecker(*this), mUpdateDownloader(*this), mState(LLUpdaterService::INITIAL) @@ -679,8 +679,8 @@ LLUpdaterService::LLUpdaterService() { if(gUpdater.expired()) { - mImpl = - std::shared_ptr<LLUpdaterServiceImpl>(new LLUpdaterServiceImpl()); + mImpl = + std::make_shared<LLUpdaterServiceImpl>(); gUpdater = mImpl; } else diff --git a/indra/win_crash_logger/llcrashloggerwindows.cpp b/indra/win_crash_logger/llcrashloggerwindows.cpp index f7fb6543f1ffad4426e529e9ec85dcd1550c3f6d..1cab5d4fbe71084ba76ae1676a065533b323bd5f 100644 --- a/indra/win_crash_logger/llcrashloggerwindows.cpp +++ b/indra/win_crash_logger/llcrashloggerwindows.cpp @@ -65,31 +65,31 @@ const S32 SETTINGS_FILE_VERSION = 101; // Windows Message Handlers // Global Variables: -HINSTANCE hInst= NULL; // current instance +HINSTANCE hInst= nullptr; // current instance TCHAR szTitle[MAX_LOADSTRING]; /* Flawfinder: ignore */ // The title bar text TCHAR szWindowClass[MAX_LOADSTRING]; /* Flawfinder: ignore */ // The title bar text std::string gProductName; -HWND gHwndReport = NULL; // Send/Don't Send dialog -HWND gHwndProgress = NULL; // Progress window -HCURSOR gCursorArrow = NULL; -HCURSOR gCursorWait = NULL; +HWND gHwndReport = nullptr; // Send/Don't Send dialog +HWND gHwndProgress = nullptr; // Progress window +HCURSOR gCursorArrow = nullptr; +HCURSOR gCursorWait = nullptr; BOOL gFirstDialog = TRUE; // Are we currently handling the Send/Don't Send dialog? std::stringstream gDXInfo; bool gSendLogs = false; -LLCrashLoggerWindows* LLCrashLoggerWindows::sInstance = NULL; +LLCrashLoggerWindows* LLCrashLoggerWindows::sInstance = nullptr; //Conversion from char* to wchar* //Replacement for ATL macros, doesn't allocate memory //For more info see: http://www.codeguru.com/forum/showthread.php?t=337247 void ConvertLPCSTRToLPWSTR (const char* pCstring, WCHAR* outStr) { - if (pCstring != NULL) + if (pCstring != nullptr) { int nInputStrLen = strlen (pCstring); // Double NULL Termination - int nOutputStrLen = MultiByteToWideChar(CP_ACP, 0, pCstring, nInputStrLen, NULL, 0) + 2; + int nOutputStrLen = MultiByteToWideChar(CP_ACP, 0, pCstring, nInputStrLen, nullptr, 0) + 2; if (outStr) { memset (outStr, 0x00, sizeof (WCHAR)*nOutputStrLen); @@ -124,7 +124,7 @@ void show_progress(const std::string& message) void update_messages() { MSG msg; - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) { @@ -239,7 +239,7 @@ LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam LLCrashLoggerWindows::LLCrashLoggerWindows(void) { - if (LLCrashLoggerWindows::sInstance==NULL) + if (LLCrashLoggerWindows::sInstance== nullptr) { sInstance = this; } @@ -247,18 +247,18 @@ LLCrashLoggerWindows::LLCrashLoggerWindows(void) LLCrashLoggerWindows::~LLCrashLoggerWindows(void) { - sInstance = NULL; + sInstance = nullptr; } bool LLCrashLoggerWindows::getMessageWithTimeout(MSG *msg, UINT to) { bool res; - UINT_PTR timerID = SetTimer(NULL, NULL, to, NULL); - res = GetMessage(msg, NULL, 0, 0); - KillTimer(NULL, timerID); + UINT_PTR timerID = SetTimer(nullptr, NULL, to, nullptr); + res = GetMessage(msg, nullptr, 0, 0); + KillTimer(nullptr, timerID); if (!res) return false; - if (msg->message == WM_TIMER && msg->hwnd == NULL && msg->wParam == 1) + if (msg->message == WM_TIMER && msg->hwnd == nullptr && msg->wParam == 1) return false; //TIMEOUT! You could call SetLastError() or something... return true; } @@ -391,11 +391,11 @@ bool LLCrashLoggerWindows::initCrashServer() try { mCrashHandler = new CrashGenerationServer(wpipe_name, - NULL, + nullptr, &LLCrashLoggerWindows::OnClientConnected, this, /*NULL, NULL, */ &LLCrashLoggerWindows::OnClientDumpRequest, this, &LLCrashLoggerWindows::OnClientExited, this, - NULL, NULL, + nullptr, nullptr, true, &wdump_path); } catch (const std::bad_alloc& e) @@ -434,8 +434,8 @@ bool LLCrashLoggerWindows::init(void) LoadString(mhInst, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(mhInst, IDC_WIN_CRASH_LOGGER, szWindowClass, MAX_LOADSTRING); - gCursorArrow = LoadCursor(NULL, IDC_ARROW); - gCursorWait = LoadCursor(NULL, IDC_WAIT); + gCursorArrow = LoadCursor(nullptr, IDC_ARROW); + gCursorWait = LoadCursor(nullptr, IDC_WAIT); // Register a window class that will be used by our dialogs WNDCLASS wndclass; @@ -447,7 +447,7 @@ bool LLCrashLoggerWindows::init(void) wndclass.hIcon = LoadIcon(hInst, MAKEINTRESOURCE( IDI_WIN_CRASH_LOGGER ) ); wndclass.hCursor = gCursorArrow; wndclass.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1); - wndclass.lpszMenuName = NULL; + wndclass.lpszMenuName = nullptr; wndclass.lpszClassName = szWindowClass; RegisterClass( &wndclass ); @@ -473,7 +473,7 @@ bool LLCrashLoggerWindows::frame() // win_crash_logger.rc has been edited by hand. // Dialogs defined with CLASS "WIN_CRASH_LOGGER" (must be same as szWindowClass) gProductName = mProductName; - gHwndProgress = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PROGRESS), 0, NULL); + gHwndProgress = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PROGRESS), nullptr, NULL); ProcessCaption(gHwndProgress); ShowWindow(gHwndProgress, SW_HIDE ); @@ -485,7 +485,7 @@ bool LLCrashLoggerWindows::frame() } else if (mCrashBehavior == CRASH_BEHAVIOR_ASK) { - gHwndReport = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PREVREPORTBOX), 0, NULL); + gHwndReport = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PREVREPORTBOX), nullptr, NULL); // Ignore result (void) SendDlgItemMessage(gHwndReport, IDC_CHECK_AUTO, BM_SETCHECK, 0, 0); // Include the product name in the caption and various dialog items. @@ -509,7 +509,7 @@ bool LLCrashLoggerWindows::frame() MSG msg; memset(&msg, 0, sizeof(msg)); - while (!LLApp::isQuitting() && GetMessage(&msg, NULL, 0, 0)) + while (!LLApp::isQuitting() && GetMessage(&msg, nullptr, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); diff --git a/indra/win_crash_logger/llcrashloggerwindows.h b/indra/win_crash_logger/llcrashloggerwindows.h index f89b8708dc9386567547b875c518a0ef07522e36..9dc048cc2f773cc8c894e0dbe03e81feeaceeaee 100644 --- a/indra/win_crash_logger/llcrashloggerwindows.h +++ b/indra/win_crash_logger/llcrashloggerwindows.h @@ -43,13 +43,13 @@ class LLCrashLoggerWindows : public LLCrashLogger public: LLCrashLoggerWindows(void); ~LLCrashLoggerWindows(void); - static LLCrashLoggerWindows* sInstance; + static LLCrashLoggerWindows* sInstance; - virtual bool init(); - virtual bool frame(); - virtual void updateApplication(const std::string& message = LLStringUtil::null); - virtual bool cleanup(); - virtual void gatherPlatformSpecificFiles(); + bool init() override; + bool frame() override; + void updateApplication(const std::string& message = LLStringUtil::null) override; + bool cleanup() override; + void gatherPlatformSpecificFiles() override; void setHandle(HINSTANCE hInst) { mhInst = hInst; } int clients_connected() const { return mClientsConnected;