diff --git a/indra/newview/gltf/primitive.h b/indra/newview/gltf/primitive.h index 304eb26432..9a370e5f45 100644 --- a/indra/newview/gltf/primitive.h +++ b/indra/newview/gltf/primitive.h @@ -98,10 +98,10 @@ namespace LL //closest to start. Moves end to the point of intersection. Returns nullptr if no intersection. //Line segment must be in the same coordinate frame as this Primitive const LLVolumeTriangle* lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, - 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 ); void serialize(boost::json::object& obj) const; diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp index ac452b38a0..f8580c177d 100644 --- a/indra/newview/gltfscenemanager.cpp +++ b/indra/newview/gltfscenemanager.cpp @@ -865,22 +865,22 @@ bool GLTFSceneManager::lineSegmentIntersect(LLVOVolume* obj, Asset* asset, const LLVector2 tc; LLVector4a tn; - if (intersection != NULL) + if (intersection != nullptr) { p = *intersection; } - if (tex_coord != NULL) + if (tex_coord != nullptr) { tc = *tex_coord; } - if (normal != NULL) + if (normal != nullptr) { n = *normal; } - if (tangent != NULL) + if (tangent != nullptr) { tn = *tangent; } @@ -890,24 +890,24 @@ bool GLTFSceneManager::lineSegmentIntersect(LLVOVolume* obj, Asset* asset, const if (hit_node_index >= 0) { local_end = p; - if (node_hit != NULL) + if (node_hit != nullptr) { *node_hit = hit_node_index; } - if (intersection != NULL) + if (intersection != nullptr) { asset_to_agent.affineTransform(p, *intersection); } - if (normal != NULL) + if (normal != nullptr) { LLVector3 v_n(n.getF32ptr()); normal->load3(obj->volumeDirectionToAgent(v_n).mV); (*normal).normalize3fast(); } - if (tangent != NULL) + if (tangent != nullptr) { LLVector3 v_tn(tn.getF32ptr()); @@ -922,7 +922,7 @@ bool GLTFSceneManager::lineSegmentIntersect(LLVOVolume* obj, Asset* asset, const (*tangent).normalize3fast(); } - if (tex_coord != NULL) + if (tex_coord != nullptr) { *tex_coord = tc; } diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp index b30fe16c58..2c6b8449ac 100644 --- a/indra/newview/llaccountingcostmanager.cpp +++ b/indra/newview/llaccountingcostmanager.cpp @@ -111,7 +111,7 @@ void LLAccountingCostManager::accountingCostCoro(std::string url, return; } - LLAccountingCostObserver* observer = NULL; + LLAccountingCostObserver* observer = nullptr; // do/while(false) allows error conditions to break out of following // block while normal flow goes forward once. diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 0d7ad0a124..c5c501c593 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -302,7 +302,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()) { @@ -404,7 +404,7 @@ LLAgent::LLAgent() : mLastKnownResponseMaturity(SIM_ACCESS_MIN), mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mTeleportState(TELEPORT_NONE), - mRegionp(NULL), + mRegionp(nullptr), mInterestListMode(IL_MODE_DEFAULT), mAgentOriginGlobal(), @@ -519,9 +519,9 @@ void LLAgent::init() //----------------------------------------------------------------------------- void LLAgent::cleanup() { - mRegionp = NULL; - mTeleportRequest = NULL; - mTeleportCanceled = NULL; + mRegionp = nullptr; + mTeleportRequest = nullptr; + mTeleportCanceled = nullptr; if (mTeleportFinishedSlot.connected()) { mTeleportFinishedSlot.disconnect(); @@ -540,16 +540,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 @@ -1644,7 +1644,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) { @@ -1720,7 +1720,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); // Note: this might malfunction for sitting agent, since pelvis stays same, but agent's position becomes lower // But for autopilot to work we assume that agent is standing and ready to go. F64 target_height = llmax((F64)gAgentAvatarp->getPelvisToFoot(), target_global.mdV[VZ] - targetOnGround.mdV[VZ]); @@ -1748,9 +1748,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); @@ -1779,7 +1779,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; @@ -2372,7 +2372,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); @@ -2894,7 +2894,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; @@ -3259,7 +3259,7 @@ void LLAgent::sendAnimationRequests(const std::vector &anim_ids, EAnimRe } msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList); - msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0); + msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0); if (num_valid_anims) { sendReliableMessage(); @@ -3284,7 +3284,7 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request) msg->addBOOLFast(_PREHASH_StartAnim, request == ANIM_REQUEST_START); msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList); - msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0); + msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0); sendReliableMessage(); } @@ -3308,7 +3308,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(); } @@ -4027,7 +4027,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()); } @@ -4065,7 +4065,7 @@ void LLAgent::sheduleTeleportIM() bool LLAgent::hasPendingTeleportRequest() { - return ((mTeleportRequest != NULL) && + return ((mTeleportRequest != nullptr) && ((mTeleportRequest->getStatus() == LLTeleportRequest::kPending) || (mTeleportRequest->getStatus() == LLTeleportRequest::kRestartPending))); } @@ -4290,7 +4290,7 @@ void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) } bool is_local(false); - if (LLLandmark* landmark = gLandmarkList.getAsset(landmark_asset_id, NULL)) + if (LLLandmark* landmark = gLandmarkList.getAsset(landmark_asset_id, nullptr)) { LLVector3d pos_global; landmark->getGlobalPos(pos_global); @@ -4380,7 +4380,7 @@ void LLAgent::teleportCancel() void LLAgent::restoreCanceledTeleportRequest() { - if (mTeleportCanceled != NULL) + if (mTeleportCanceled != nullptr) { LL_INFOS() << "Restoring canceled teleport request, setting state to TELEPORT_REQUESTED" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED ); @@ -4870,12 +4870,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 *teleport_msg_map = NULL; + std::map *teleport_msg_map = nullptr; std::string message_set_name; if ( message_set->getAttributeString("name", message_set_name) ) @@ -4896,7 +4896,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") && diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 3352890d99..2fb2d8c39f 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -501,7 +501,7 @@ class LLAgent : public LLOldEvents::LLObservable void sendRevokePermissions(const LLUUID & target, U32 permissions); void endAnimationUpdateUI(); - void unpauseAnimation() { mPauseRequest = NULL; } + void unpauseAnimation() { mPauseRequest = nullptr; } bool getCustomAnim() const { return mCustomAnim; } void setCustomAnim(bool anim) { mCustomAnim = anim; } @@ -572,8 +572,8 @@ class LLAgent : public LLOldEvents::LLObservable void startAutoPilotGlobal(const LLVector3d &pos_global, const std::string& behavior_name = std::string(), - const LLQuaternion *target_rotation = NULL, - void (*finish_callback)(bool, void *) = NULL, void *callback_data = NULL, + const LLQuaternion *target_rotation = nullptr, + void (*finish_callback)(bool, void *) = nullptr, void *callback_data = nullptr, F32 stop_distance = 0.f, F32 rotation_threshold = 0.03f, bool allow_flying = true); void startFollowPilot(const LLUUID &leader_id, bool allow_flying = true, F32 stop_distance = 0.5f); @@ -645,7 +645,7 @@ class LLAgent : public LLOldEvents::LLObservable void teleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation void teleportCancel(); // May or may not be allowed by server void restoreCanceledTeleportRequest(); - bool canRestoreCanceledTeleport() { return mTeleportCanceled != NULL; } + bool canRestoreCanceledTeleport() { return mTeleportCanceled != nullptr; } bool getTeleportKeepsLookAt() { return mbTeleportKeepsLookAt; } // Whether look-at reset after teleport protected: bool teleportCore(bool is_local = false); // Stuff for all teleports; returns true if the teleport can proceed diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index b2c66b1bac..57e31a0d17 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -117,8 +117,8 @@ LLAgentCamera::LLAgentCamera() : mDrawDistance( DEFAULT_FAR_PLANE ), - mLookAt(NULL), - mPointAt(NULL), + mLookAt(nullptr), + mPointAt(nullptr), mHUDTargetZoom(1.f), mHUDCurZoom(1.f), @@ -157,7 +157,7 @@ LLAgentCamera::LLAgentCamera() : mAllowChangeToFollow(false), mFocusGlobal(), mFocusTargetGlobal(), - mFocusObject(NULL), + mFocusObject(nullptr), mFocusObjectDist(0.f), mFocusObjectOffset(), mTrackFocusObject(true), @@ -233,14 +233,14 @@ void LLAgentCamera::cleanup() if(mLookAt) { mLookAt->markDead() ; - mLookAt = NULL; + mLookAt = nullptr; } if(mPointAt) { mPointAt->markDead() ; - mPointAt = NULL; + mPointAt = nullptr; } - setFocusObject(NULL); + setFocusObject(nullptr); } void LLAgentCamera::setAvatarObject(LLVOAvatarSelf* avatar) @@ -303,7 +303,7 @@ void LLAgentCamera::resetView(bool reset_camera, bool change_camera) LLSelectMgr::getInstance()->deselectAll(); } - if (gMenuHolder != NULL) + if (gMenuHolder != nullptr) { // Hide all popup menus gMenuHolder->hideMenus(); @@ -361,7 +361,7 @@ void LLAgentCamera::resetView(bool reset_camera, bool change_camera) // resetting camera also resets position overrides in debug mode 'AllowSelectAvatar' LLObjectSelectionHandle selected_handle = LLSelectMgr::getInstance()->getSelection(); if (selected_handle->getObjectCount() == 1 - && selected_handle->getFirstObject() != NULL + && selected_handle->getFirstObject() != nullptr && selected_handle->getFirstObject()->isAvatar()) { LLSelectMgr::getInstance()->resetObjectOverrides(selected_handle); @@ -1475,7 +1475,7 @@ void LLAgentCamera::updateCamera() // follow camera when in customize mode if (cameraCustomizeAvatar()) { - setLookAt(LOOKAT_TARGET_FOCUS, NULL, position_agent); + setLookAt(LOOKAT_TARGET_FOCUS, nullptr, position_agent); } // update the travel distance stat @@ -2187,7 +2187,7 @@ void LLAgentCamera::changeCameraToMouselook(bool animate) if (mCameraMode != CAMERA_MODE_MOUSELOOK) { - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); updateLastCamera(); mCameraMode = CAMERA_MODE_MOUSELOOK; @@ -2389,8 +2389,8 @@ void LLAgentCamera::changeCameraToCustomizeAvatar() mCameraMode = CAMERA_MODE_CUSTOMIZE_AVATAR; gAgent.clearControlFlags(AGENT_CONTROL_MOUSELOOK); - gFocusMgr.setKeyboardFocus( NULL ); - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setKeyboardFocus( nullptr ); + gFocusMgr.setMouseCapture( nullptr ); if( gMorphView ) { gMorphView->setVisible( true ); @@ -2493,7 +2493,7 @@ void LLAgentCamera::clearFocusObject() { startCameraAnimation(); - setFocusObject(NULL); + setFocusObject(nullptr); mFocusObjectOffset.clearVec(); } } @@ -2573,7 +2573,7 @@ void LLAgentCamera::setFocusGlobal(const LLVector3d& focus, const LLUUID &object } else { - setLookAt(LOOKAT_TARGET_FOCUS, NULL, gAgent.getPosAgentFromGlobal(mFocusTargetGlobal)); + setLookAt(LOOKAT_TARGET_FOCUS, nullptr, gAgent.getPosAgentFromGlobal(mFocusTargetGlobal)); } } } @@ -2643,7 +2643,7 @@ void LLAgentCamera::setCameraPosAndFocusGlobal(const LLVector3d& camera_pos, con } else { - setLookAt(LOOKAT_TARGET_FOCUS, NULL, gAgent.getPosAgentFromGlobal(mFocusTargetGlobal)); + setLookAt(LOOKAT_TARGET_FOCUS, nullptr, gAgent.getPosAgentFromGlobal(mFocusTargetGlobal)); } if (mCameraAnimating) @@ -2682,7 +2682,7 @@ void LLAgentCamera::setSitCamera(const LLUUID &object_id, const LLVector3 &camer { mSitCameraPos.clearVec(); mSitCameraFocus.clearVec(); - mSitCameraReferenceObject = NULL; + mSitCameraReferenceObject = nullptr; mSitCameraEnabled = false; } } diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index d277fd6158..1fae675705 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -140,7 +140,7 @@ class LLAgentCamera 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(); // Minimum height off ground for this mode, meters void setCameraCollidePlane(const LLVector4 &plane) { mCameraCollidePlane = plane; } bool calcCameraMinDistance(F32 &obj_min_distance); @@ -239,11 +239,11 @@ class LLAgentCamera //-------------------------------------------------------------------- public: void updateLookAt(const S32 mouse_x, const S32 mouse_y); - bool setLookAt(ELookAtType target_type, LLViewerObject *object = NULL, LLVector3 position = LLVector3::zero); + bool setLookAt(ELookAtType target_type, LLViewerObject *object = nullptr, LLVector3 position = LLVector3::zero); ELookAtType getLookAtType(); void lookAtLastChat(); void slamLookAt(const LLVector3 &look_at); // Set the physics data - bool setPointAt(EPointAtType target_type, LLViewerObject *object = NULL, LLVector3 position = LLVector3::zero); + bool setPointAt(EPointAtType target_type, LLViewerObject *object = nullptr, LLVector3 position = LLVector3::zero); EPointAtType getPointAtType(); public: LLPointer mLookAt; diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index 5ddb87558a..e80b93a71c 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -212,7 +212,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(), LLGridManager::getInstance()->getGrid(), NULL, LLCommandHandler::NAV_TYPE_CLICKED, true); + LLCommandDispatcher::dispatch("teleport", params, LLSD(), LLGridManager::getInstance()->getGrid(), nullptr, LLCommandHandler::NAV_TYPE_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? } @@ -222,7 +222,7 @@ void LLAgentListener::requestTeleport(LLSD const & event_data) const LLVector3((F32)event_data["x"].asReal(), (F32)event_data["y"].asReal(), (F32)event_data["z"].asReal())).getSLURLString(); - LLURLDispatcher::dispatch(url, LLCommandHandler::NAV_TYPE_CLICKED, NULL, false); + LLURLDispatcher::dispatch(url, LLCommandHandler::NAV_TYPE_CLICKED, nullptr, false); } } @@ -232,7 +232,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. Response response(LLSD(), event_data); - LLViewerObject *object = NULL; + LLViewerObject *object = nullptr; if (event_data.has("obj_uuid")) { object = gObjectList.findObject(event_data["obj_uuid"]); @@ -275,7 +275,7 @@ void LLAgentListener::requestStand(LLSD const & event_data) const LLViewerObject * LLAgentListener::findObjectClosestTo(const LLVector3 & position, bool sit_target) const { - LLViewerObject *object = NULL; + LLViewerObject *object = nullptr; // Find the object closest to that position F32 min_distance = 10000.0f; // Start big @@ -307,7 +307,7 @@ LLViewerObject * LLAgentListener::findObjectClosestTo(const LLVector3 & position void LLAgentListener::requestTouch(LLSD const & event_data) const { - LLViewerObject *object = NULL; + LLViewerObject *object = nullptr; if (event_data.has("obj_uuid")) { @@ -390,7 +390,7 @@ void LLAgentListener::getPosition(const LLSD& event_data) const void LLAgentListener::startAutoPilot(LLSD const & event_data) { - LLQuaternion* target_rotation = NULL; + LLQuaternion* target_rotation = nullptr; if (event_data.has("target_rotation")) { LLQuaternion target_rotation_value = ll_quaternion_from_sd(event_data["target_rotation"]); @@ -433,7 +433,7 @@ void LLAgentListener::startAutoPilot(LLSD const & event_data) mAgent.startAutoPilotGlobal(ll_vector3d_from_sd(event_data["target_global"]), behavior_name, target_rotation, - finish_cb, NULL, + finish_cb, nullptr, stop_distance, rotation_threshold, allow_flying); @@ -552,7 +552,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"]); @@ -668,7 +668,7 @@ LLViewerInventoryItem* get_anim_item(LLEventAPI::Response &response, const LLSD if (!item || (item->getInventoryType() != LLInventoryType::IT_ANIMATION)) { response.error(stringize("Animation item ", std::quoted(event_data["item_id"].asString()), " was not found")); - return NULL; + return nullptr; } return item; } diff --git a/indra/newview/llagentpicksinfo.cpp b/indra/newview/llagentpicksinfo.cpp index 4a5c037f1f..1651d37d86 100644 --- a/indra/newview/llagentpicksinfo.cpp +++ b/indra/newview/llagentpicksinfo.cpp @@ -85,7 +85,7 @@ class LLAgentPicksInfo::LLAgentPicksObserver : public LLAvatarPropertiesObserver ////////////////////////////////////////////////////////////////////////// LLAgentPicksInfo::LLAgentPicksInfo() - : mAgentPicksObserver(NULL) + : mAgentPicksObserver(nullptr) // Disable Pick creation until we get number of Picks from server - in case // avatar has maximum number of Picks. , mNumberOfPicks(S32_MAX) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index a075b6f004..5880c7c62b 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -159,9 +159,9 @@ void LLAgentWearables::dump() for (U32 j=0; jgetName() << " description " << wearable->getDescription() << LL_ENDL; @@ -356,7 +356,7 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 U32 todo = AddWearableToAgentInventoryCallback::CALL_NONE; LLPointer cb = new AddWearableToAgentInventoryCallback( - LLPointer(NULL), + LLPointer(nullptr), type, index, new_wearable, @@ -401,7 +401,7 @@ void LLAgentWearables::saveWearableAs(const LLWearableType::EType type, LLPointer cb = new AddWearableToAgentInventoryCallback( - LLPointer(NULL), + LLPointer(nullptr), type, index, new_wearable, @@ -530,7 +530,7 @@ bool LLAgentWearables::isWearableCopyable(LLWearableType::EType type, U32 index) LLInventoryItem* LLAgentWearables::getWearableInventoryItem(LLWearableType::EType type, U32 index) { LLUUID item_id = getWearableItemID(type,index); - LLInventoryItem* item = NULL; + LLInventoryItem* item = nullptr; if (item_id.notNull()) { item = gInventory.getItem(item_id); @@ -573,7 +573,7 @@ const LLViewerWearable* LLAgentWearables::getWearableFromItemID(const LLUUID& it } } } - return NULL; + return nullptr; } LLViewerWearable* LLAgentWearables::getWearableFromItemID(const LLUUID& item_id) @@ -590,7 +590,7 @@ LLViewerWearable* LLAgentWearables::getWearableFromItemID(const LLUUID& item_id) } } } - return NULL; + return nullptr; } LLViewerWearable* LLAgentWearables::getWearableFromAssetID(const LLUUID& asset_id) @@ -606,7 +606,7 @@ LLViewerWearable* LLAgentWearables::getWearableFromAssetID(const LLUUID& asset } } } - return NULL; + return nullptr; } LLViewerWearable* LLAgentWearables::getViewerWearable(const LLWearableType::EType type, U32 index /*= 0*/) @@ -699,7 +699,7 @@ class OnWearableItemCreatedCB: public LLInventoryCallback { public: OnWearableItemCreatedCB(): - mWearablesAwaitingItems(LLWearableType::WT_COUNT,NULL) + mWearablesAwaitingItems(LLWearableType::WT_COUNT, nullptr) { LL_INFOS() << "created callback" << LL_ENDL; } @@ -1551,7 +1551,7 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con { cb = new LLBoostFuncInventoryCallback(wear_cb); } - if (created_cb != NULL) + if (created_cb != nullptr) { cb->addOnFireFunc(created_cb); } diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 1da1647fe8..ee7486b19c 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -800,7 +800,7 @@ void AISAPI::EnqueueAISCommand(const std::string &procName, LLCoprocedureManager if (sPostponedQuery.empty()) { sPostponedQuery.push_back(ais_query_item_t(procFullName, proc)); - gIdleCallbacks.addFunction(onIdle, NULL); + gIdleCallbacks.addFunction(onIdle, nullptr); } else { @@ -828,7 +828,7 @@ void AISAPI::onIdle(void *userdata) if (sPostponedQuery.empty()) { // Nothing to do anymore - gIdleCallbacks.deleteFunction(onIdle, NULL); + gIdleCallbacks.deleteFunction(onIdle, nullptr); } } diff --git a/indra/newview/llappcorehttp.cpp b/indra/newview/llappcorehttp.cpp index f3265afebd..19c4054fc7 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; } @@ -164,7 +164,7 @@ void LLAppCoreHttp::init() LL_DEBUGS("Init") << "Setting CA File to " << ca_file << LL_ENDL; status = LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_CA_FILE, LLCore::HttpRequest::GLOBAL_POLICY_ID, - ca_file, NULL); + ca_file, nullptr); } else { @@ -181,7 +181,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() @@ -191,7 +191,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; @@ -226,7 +226,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 @@ -376,7 +376,7 @@ void LLAppCoreHttp::cleanup() mPipelinedSignal.disconnect(); delete mRequest; - mRequest = NULL; + mRequest = nullptr; LLCore::HttpStatus status = LLCore::HttpRequest::destroyService(); if (! status) @@ -406,7 +406,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/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index f65aaccddc..be7fca7f17 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -482,7 +482,7 @@ class LLWearCategoryAfterCopy: public LLInventoryCallback class LLTrackPhaseWrapper : public LLInventoryCallback { public: - LLTrackPhaseWrapper(const std::string& phase_name, LLPointer cb = NULL): + LLTrackPhaseWrapper(const std::string& phase_name, LLPointer cb = nullptr): mTrackingPhase(phase_name), mCB(cb) { @@ -664,7 +664,7 @@ struct LLFoundData LLFoundData() : mAssetType(LLAssetType::AT_NONE), mWearableType(LLWearableType::WT_INVALID), - mWearable(NULL) {} + mWearable(nullptr) {} LLFoundData(const LLUUID& item_id, const LLUUID& asset_id, @@ -679,7 +679,7 @@ struct LLFoundData mAssetType(asset_type), mWearableType(wearable_type), mIsReplacement(is_replacement), - mWearable( NULL ) {} + mWearable( nullptr ) {} LLUUID mItemID; LLUUID mAssetID; @@ -1035,7 +1035,7 @@ void recovered_item_link_cb(const LLUUID& item_id, LLWearableType::EType type, L holder->eraseTypeToLink(type); // Add wearable to FoundData for actual wearing LLViewerInventoryItem *item = gInventory.getItem(item_id); - LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL; + LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : nullptr; if (linked_item) { @@ -1446,14 +1446,14 @@ const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink() const LLUUID parent_id = cat->getParentUUID(); LLViewerInventoryCategory* parent_cat = gInventory.getCategory(parent_id); // if base outfit moved to trash it means that we don't have base outfit - if (parent_cat != NULL && parent_cat->getPreferredType() == LLFolderType::FT_TRASH) + if (parent_cat != nullptr && parent_cat->getPreferredType() == LLFolderType::FT_TRASH) { - return NULL; + return nullptr; } return item; } } - return NULL; + return nullptr; } bool LLAppearanceMgr::getBaseOutfitName(std::string& name) @@ -1632,7 +1632,7 @@ void LLAppearanceMgr::wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear, // Unfortunately we have no way to determine attachment point from inventory item. // We might want to forbid wearing multiple objects with replace option in future. bool replace_item = needs_to_replace(item_to_wear, first_for_object, first_for_type, replace); - rez_attachment(item_to_wear, NULL, replace_item); + rez_attachment(item_to_wear, nullptr, replace_item); } break; @@ -1684,7 +1684,7 @@ void LLAppearanceMgr::removeOutfitPhoto(const LLUUID& outfit_id) for (LLViewerInventoryItem* outfit_item : outfit_item_array) { LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); - if (linked_item != NULL) + if (linked_item != nullptr) { if (linked_item->getActualType() == LLAssetType::AT_TEXTURE) { @@ -1829,7 +1829,7 @@ void LLAppearanceMgr::slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_ gInventory.getDirectDescendentsOf(src_id, cats, items); if (!cats || !items) { - // NULL means the call failed -- cats/items map doesn't exist (note: this does NOT mean + // nullptr means the call failed -- cats/items map doesn't exist (note: this does NOT mean // that the cat just doesn't have any items or subfolders). LLViewerInventoryCategory* category = gInventory.getCategory(src_id); if (category) @@ -1840,7 +1840,7 @@ void LLAppearanceMgr::slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_ { LL_WARNS() << "Category could not be retrieved, linking content failed." << LL_ENDL; } - llassert(cats != NULL && items != NULL); + llassert(cats != nullptr && items != nullptr); return; } @@ -2498,7 +2498,7 @@ void get_sorted_base_and_cof_items(LLInventoryModel::item_array_t& cof_item_arra for (U32 i = 0; i < outfit_item_array.size(); ++i) { LLViewerInventoryItem* linked_item = outfit_item_array.at(i)->getLinkedItem(); - if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE) + if (linked_item != nullptr && linked_item->getActualType() == LLAssetType::AT_TEXTURE) { outfit_item_array.erase(outfit_item_array.begin() + i); break; @@ -2672,7 +2672,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, for(S32 i = 0; i < wear_items.size(); ++i) { LLViewerInventoryItem *item = wear_items.at(i); - LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL; + LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : nullptr; // Fault injection: use debug setting to test asset // fetch failures (should be replaced by new defaults in @@ -2862,7 +2862,7 @@ void LLAppearanceMgr::wearCategoryFinal(const LLUUID& cat_id, bool copy_items, b { name = cat->getName(); } - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; LLInventoryModel::item_array_t::const_iterator it = items->begin(); LLInventoryModel::item_array_t::const_iterator end = items->end(); LLUUID pid; @@ -2958,7 +2958,7 @@ void LLAppearanceMgr::wearOutfitByName(const std::string& name) LLInventoryModel::EXCLUDE_TRASH, has_name); bool copy_items = false; - LLInventoryCategory* cat = NULL; + LLInventoryCategory* cat = nullptr; if (cat_array.size() > 0) { // Just wear the first one that matches @@ -3190,7 +3190,7 @@ void LLAppearanceMgr::removeAllAttachmentsFromAvatar() class LLUpdateOnCOFLinkRemove : public LLInventoryCallback { public: - LLUpdateOnCOFLinkRemove(const LLUUID& remove_item_id, LLPointer cb = NULL): + LLUpdateOnCOFLinkRemove(const LLUUID& remove_item_id, LLPointer cb = nullptr): mItemID(remove_item_id), mCB(cb) { @@ -3266,7 +3266,7 @@ void LLAppearanceMgr::updateIsDirty() // find base outfit link const LLViewerInventoryItem* base_outfit_item = getBaseOutfitLink(); - LLViewerInventoryCategory* catp = NULL; + LLViewerInventoryCategory* catp = nullptr; if (base_outfit_item && base_outfit_item->getIsLinkType()) { catp = base_outfit_item->getLinkedCategory(); @@ -3297,7 +3297,7 @@ void LLAppearanceMgr::updateIsDirty() for (U32 i = 0; i < outfit_items.size(); ++i) { LLViewerInventoryItem* linked_item = outfit_items.at(i)->getLinkedItem(); - if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE) + if (linked_item != nullptr && linked_item->getActualType() == LLAssetType::AT_TEXTURE) { outfit_items.erase(outfit_items.begin() + i); break; @@ -3386,7 +3386,7 @@ void LLAppearanceMgr::copyLibraryGestures() { std::string& folder_name = *it; - LLPointer cb(NULL); + LLPointer cb(nullptr); // After copying gestures, activate Common, Other, plus // Male and/or Female, depending upon the initial outfit gender. @@ -3455,7 +3455,7 @@ void appearance_mgr_update_dirty_state() LLUUID image_id = app_mgr.getOutfitImage(); if(image_id.notNull()) { - LLPointer cb = NULL; + LLPointer cb = nullptr; link_inventory_object(app_mgr.getBaseOutfitUUID(), image_id, cb); } @@ -3478,7 +3478,7 @@ void update_base_outfit_after_ordering() for (LLViewerInventoryItem* outfit_item : outfit_item_array) { LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); - if (linked_item != NULL) + if (linked_item != nullptr) { if (linked_item->getActualType() == LLAssetType::AT_TEXTURE) { @@ -3521,7 +3521,7 @@ void update_base_outfit_after_ordering() for (U32 i = 0; i < outfit_item_array.size(); ++i) { LLViewerInventoryItem* linked_item = outfit_item_array.at(i)->getLinkedItem(); - if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE) + if (linked_item != nullptr && linked_item->getActualType() == LLAssetType::AT_TEXTURE) { outfit_item_array.erase(outfit_item_array.begin() + i); break; @@ -3761,7 +3761,7 @@ LLSD LLAppearanceMgr::dumpCOF() const if (LLAssetType::AT_LINK == inv_item->getActualType()) { const LLViewerInventoryItem* linked_item = inv_item->getLinkedItem(); - if (NULL == linked_item) + if (nullptr == linked_item) { LL_WARNS() << "Broken link for item '" << inv_item->getName() << "' (" << inv_item->getUUID() @@ -4353,7 +4353,7 @@ void LLAppearanceMgr::dumpItemArray(const LLInventoryModel::item_array_t& items, for (S32 i=0; igetLinkedItem() : NULL; + LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : nullptr; LLUUID asset_id; if (linked_item) { @@ -4382,8 +4382,8 @@ LLAppearanceMgr::LLAppearanceMgr(): mUnlockOutfitTimer = std::make_unique((F32)gSavedSettings.getS32( "OutfitOperationsTimeout")); - gIdleCallbacks.addFunction(&LLAttachmentsMgr::onIdle, NULL); - gIdleCallbacks.addFunction(&LLAppearanceMgr::onIdle, NULL); //sheduling appearance update requests + gIdleCallbacks.addFunction(&LLAttachmentsMgr::onIdle, nullptr); + gIdleCallbacks.addFunction(&LLAppearanceMgr::onIdle, nullptr); //sheduling appearance update requests } LLAppearanceMgr::~LLAppearanceMgr() @@ -4764,7 +4764,7 @@ void wear_multiple(const uuid_vec_t& ids, bool replace) S32 other_count = 0; add_wearable_type_counts(ids, clothing_count, bodypart_count, object_count, other_count); - LLPointer cb = NULL; + LLPointer cb = nullptr; if (clothing_count > 0 || bodypart_count > 0) { cb = new LLUpdateAppearanceOnDestroy; @@ -4838,7 +4838,7 @@ class LLWearFolderHandler : public LLCommandHandler } // release avatar picker keyboard focus - gFocusMgr.setKeyboardFocus( NULL ); + gFocusMgr.setKeyboardFocus( nullptr ); return true; } diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 131b6817ed..71f5068245 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -128,16 +128,16 @@ class LLAppearanceMgr: public LLSingleton void wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear, bool do_update, bool replace, - LLPointer cb = NULL); + LLPointer cb = nullptr); // Wear/attach an item (from a user's inventory) on the agent void wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update, bool replace = false, - LLPointer cb = NULL); + LLPointer cb = nullptr); // Update the displayed outfit name in UI. void updatePanelOutfitName(const std::string& name); - void purgeBaseOutfitLink(const LLUUID& category, LLPointer cb = NULL); + void purgeBaseOutfitLink(const LLUUID& category, LLPointer cb = nullptr); void createBaseOutfitLink(const LLUUID& category, LLPointer link_waiter); void updateAgentWearables(LLWearableHoldingPattern* holder); @@ -154,16 +154,16 @@ class LLAppearanceMgr: public LLSingleton void setAttachmentInvLinkEnable(bool val); // Add COF link to individual item. - void addCOFItemLink(const LLUUID& item_id, LLPointer cb = NULL, const std::string description = ""); - void addCOFItemLink(const LLInventoryItem *item, LLPointer cb = NULL, const std::string description = ""); + void addCOFItemLink(const LLUUID& item_id, LLPointer cb = nullptr, const std::string description = ""); + void addCOFItemLink(const LLInventoryItem *item, LLPointer cb = nullptr, const std::string description = ""); // Find COF entries referencing the given item. LLInventoryModel::item_array_t findCOFItemLinks(const LLUUID& item_id); bool isLinkedInCOF(const LLUUID& item_id); // Remove COF entries - void removeCOFItemLinks(const LLUUID& item_id, LLPointer cb = NULL); - void removeCOFLinksOfType(LLWearableType::EType type, LLPointer cb = NULL); + void removeCOFItemLinks(const LLUUID& item_id, LLPointer cb = nullptr); + void removeCOFLinksOfType(LLWearableType::EType type, LLPointer cb = nullptr); void removeAllClothesFromAvatar(); void removeAllAttachmentsFromAvatar(); @@ -223,7 +223,7 @@ class LLAppearanceMgr: public LLSingleton bool validateClothingOrderingInfo(LLUUID cat_id = LLUUID::null); void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null, - LLPointer cb = NULL); + LLPointer cb = nullptr); bool isOutfitLocked() { return mOutfitLocked; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ea380896ca..6104afd9eb 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -321,7 +321,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; @@ -635,11 +635,11 @@ 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; -LLPurgeDiskCacheThread* LLAppViewer::sPurgeDiskCacheThread = NULL; +LLAppViewer* LLAppViewer::sInstance = nullptr; +LLTextureCache* LLAppViewer::sTextureCache = nullptr; +LLImageDecodeThread* LLAppViewer::sImageDecodeThread = nullptr; +LLTextureFetch* LLAppViewer::sTextureFetch = nullptr; +LLPurgeDiskCacheThread* LLAppViewer::sPurgeDiskCacheThread = nullptr; std::string getRuntime() { @@ -662,15 +662,15 @@ LLAppViewer::LLAppViewer() mQuitRequested(false), mClosingFloaters(false), mLogoutRequestSent(false), - mMainloopTimeout(NULL), + mMainloopTimeout(nullptr), mAgentRegionLastAlive(false), mRandomizeFramerate(LLCachedControl(gSavedSettings,"Randomize Framerate", false)), mPeriodicSlowFrame(LLCachedControl(gSavedSettings,"Periodic Slow Frame", false)), - mFastTimerLogThread(NULL), - mSettingsLocationList(NULL), + mFastTimerLogThread(nullptr), + mSettingsLocationList(nullptr), 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; } @@ -1650,7 +1650,7 @@ bool LLAppViewer::doFrame() } delete gServicePump; - gServicePump = NULL; + gServicePump = nullptr; destroyMainloopTimeout(); @@ -1701,7 +1701,7 @@ void LLAppViewer::flushLFSIO() bool LLAppViewer::cleanup() { //ditch LLVOAvatarSelf instance - gAgentAvatarp = NULL; + gAgentAvatarp = nullptr; LLNotifications::instance().clear(); @@ -1760,7 +1760,7 @@ bool LLAppViewer::cleanup() release_start_screen(); // just in case - LLError::logToFixedBuffer(NULL); // stop the fixed buffer recorder + LLError::logToFixedBuffer(nullptr); // stop the fixed buffer recorder LL_INFOS() << "Cleaning Up" << LL_ENDL; @@ -1796,7 +1796,7 @@ bool LLAppViewer::cleanup() } delete gAssetStorage; - gAssetStorage = NULL; + gAssetStorage = nullptr; LLPolyMesh::freeAllMeshes(); @@ -1822,13 +1822,13 @@ bool LLAppViewer::cleanup() // shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem. LLStreamingAudioInterface *sai = gAudiop->getStreamingAudioImpl(); delete sai; - gAudiop->setStreamingAudioImpl(NULL); + gAudiop->setStreamingAudioImpl(nullptr); // shut down the audio subsystem gAudiop->shutdown(); delete gAudiop; - gAudiop = NULL; + gAudiop = nullptr; } // Note: this is where LLFeatureManager::getInstance()-> used to be deleted. @@ -2040,7 +2040,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; } @@ -2051,7 +2051,7 @@ bool LLAppViewer::cleanup() // viewer UI relies on keyboard so keep it aound until viewer UI isa gone delete gKeyboard; - gKeyboard = NULL; + gKeyboard = nullptr; if (LLViewerJoystick::instanceExists()) { @@ -2070,22 +2070,22 @@ bool LLAppViewer::cleanup() //MUST happen AFTER SUBSYSTEM_CLEANUP(LLCurl) delete sTextureCache; - sTextureCache = NULL; + sTextureCache = nullptr; if (sTextureFetch) { sTextureFetch->shutdown(); sTextureFetch->waitOnPending(); delete sTextureFetch; - sTextureFetch = NULL; + sTextureFetch = nullptr; } delete sImageDecodeThread; - sImageDecodeThread = NULL; + sImageDecodeThread = nullptr; delete mFastTimerLogThread; - mFastTimerLogThread = NULL; + mFastTimerLogThread = nullptr; delete sPurgeDiskCacheThread; - sPurgeDiskCacheThread = NULL; + sPurgeDiskCacheThread = nullptr; delete mGeneralThreadPool; - mGeneralThreadPool = NULL; + mGeneralThreadPool = nullptr; if (LLFastTimerView::sAnalyzePerformance) { @@ -2130,7 +2130,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. @@ -2267,7 +2267,7 @@ void errorCallback(LLError::ELevel level, const std::string &error_string) LLAppViewer::instance()->writeDebugInfo(); 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 marker doesn't exist, create a marker with llerror code for next launch // otherwise don't override existing file @@ -2526,7 +2526,7 @@ bool tempSetControl(const std::string& name, const std::string& value) { 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('.'); @@ -2557,7 +2557,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_WARNS() << "Cannot load default configuration file " << settings_file_list << LL_ENDL; @@ -3552,7 +3552,7 @@ std::string LLAppViewer::getViewerInfoString(bool default_string) 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, default_string); return support.str(); @@ -3575,7 +3575,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) @@ -3891,7 +3891,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) @@ -3983,7 +3983,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)) { @@ -3999,7 +3999,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)) { S32 marker_code = getMarkerErrorCode(error_marker_file); if (marker_code >= 0) @@ -5430,7 +5430,7 @@ void LLAppViewer::createErrorMarker(eLastExecEvent error_code) const bool LLAppViewer::errorMarkerExists() const { std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); - return LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB); + return LLAPRFile::isExist(error_marker_file, nullptr, LL_APR_RB); } void LLAppViewer::outOfMemorySoftQuit() @@ -5699,7 +5699,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; } @@ -5739,7 +5739,7 @@ void LLAppViewer::forceErrorOSSpecificException() void LLAppViewer::forceErrorDriverCrash() { LL_WARNS() << "Forcing a deliberate driver crash" << LL_ENDL; - glDeleteTextures(1, NULL); + glDeleteTextures(1, nullptr); } void LLAppViewer::forceErrorCoroutineCrash() @@ -5755,7 +5755,7 @@ void LLAppViewer::forceErrorCoroprocedureCrash() [](LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t&, const LLUUID&) { LL_WARNS() << "Forcing a deliberate bad memory access from LLCoprocedureManager" << LL_ENDL; - S32* crash = NULL; + S32* crash = nullptr; *crash = 0xDEADBEEF; }); } diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index c924771816..3af9de59a0 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -74,9 +74,9 @@ typedef struct namespace { int gArgC = 0; - char **gArgV = NULL; - LLAppViewerLinux* gViewerAppPtr = NULL; - void (*gOldTerminateHandler)() = NULL; + char **gArgV = nullptr; + LLAppViewerLinux* gViewerAppPtr = nullptr; + void (*gOldTerminateHandler)() = nullptr; } void check_vm_bloat() @@ -320,7 +320,7 @@ static void dispatchSLURL(gchar const *slurl) LL_INFOS() << "Was asked to go to slurl: " << slurl << LL_ENDL; std::string url = slurl; - LLMediaCtrl* web = NULL; + LLMediaCtrl* web = nullptr; const bool trusted_browser = false; LLURLDispatcher::dispatch(url, "", web, trusted_browser); } @@ -352,9 +352,9 @@ static void busAcquired(GDBusConnection *connection, const gchar *name, gpointer VIEWERAPI_PATH, gBusNodeInfo->interfaces[0], &interface_vtable, - NULL, /* user_data */ - NULL, /* user_data_free_func */ - NULL); /* GError** */ + nullptr, /* user_data */ + nullptr, /* user_data_free_func */ + nullptr); /* GError** */ g_assert (id > 0); } @@ -368,8 +368,8 @@ static void nameLost(GDBusConnection *connection, const gchar *name, gpointer us } void viewerappapi_init(ViewerAppAPI *server) { - gBusNodeInfo = g_dbus_node_info_new_for_xml (DBUS_SERVER, NULL); - g_assert (gBusNodeInfo != NULL); + gBusNodeInfo = g_dbus_node_info_new_for_xml (DBUS_SERVER, nullptr); + g_assert (gBusNodeInfo != nullptr); g_bus_own_name(G_BUS_TYPE_SESSION, VIEWERAPI_SERVICE, @@ -377,8 +377,8 @@ void viewerappapi_init(ViewerAppAPI *server) busAcquired, nameAcquired, nameLost, - NULL, - NULL); + nullptr, + nullptr); } @@ -388,7 +388,7 @@ void viewerappapi_init(ViewerAppAPI *server) bool LLAppViewerLinux::initSLURLHandler() { //ViewerAppAPI *api_server = (ViewerAppAPI*) - g_object_new(viewerappapi_get_type(), NULL); + g_object_new(viewerappapi_get_type(), nullptr); return true; } @@ -396,7 +396,7 @@ bool LLAppViewerLinux::initSLURLHandler() //virtual bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url) { - auto *pBus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, nullptr); + auto *pBus = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, nullptr); if( !pBus ) { @@ -474,7 +474,7 @@ bool LLAppViewerLinux::beingDebugged() { char *base = strrchr(buf, '/'); buf[n + 1] = '\0'; - if (base == NULL) + if (base == nullptr) { base = buf; } else { @@ -501,7 +501,7 @@ bool LLAppViewerLinux::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) { diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index b074c40c17..f6e7bd8d04 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -68,7 +68,7 @@ namespace // They are not used immediately by the app. int gArgC; char** gArgV; - LLAppViewerMacOSX* gViewerAppPtr = NULL; + LLAppViewerMacOSX* gViewerAppPtr = nullptr; std::string gHandleSLURL; } @@ -113,7 +113,7 @@ void handleQuit() bool pumpMainLoop() { bool ret = LLApp::isQuitting(); - if (!ret && gViewerAppPtr != NULL) + if (!ret && gViewerAppPtr != nullptr) { ret = gViewerAppPtr->frame(); } else { @@ -132,7 +132,7 @@ void cleanupViewer() } delete gViewerAppPtr; - gViewerAppPtr = NULL; + gViewerAppPtr = nullptr; } void clearDumpLogsDir() @@ -233,7 +233,7 @@ CrashMetadataSingleton::CrashMetadataSingleton() attributesPathname = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "CrashContext.xml"); LLFILE* fp = LLFile::fopen(attributesPathname, "w"); - if (fp != NULL) + if (fp != nullptr) { LLXMLNode::writeHeaderToFile(fp); out_node->writeToFile(fp); @@ -308,7 +308,7 @@ std::pair parse_psn(const std::string& s) bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp) { // The next two lines add the support for parsing the mac -psn_XXX arg. - clp.addOptionDesc("psn", NULL, 1, "MacOSX process serial number"); + clp.addOptionDesc("psn", nullptr, 1, "MacOSX process serial number"); clp.setCustomParser(parse_psn); // parse the user's command line @@ -325,7 +325,7 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp) // create a new localization for the language you're adding // set the contents of the new localization of the file to the string corresponding to our localization // (i.e. "en", "ja", etc. Use the existing ones as a guide.) - CFURLRef url = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("language"), CFSTR("txt"), NULL); + CFURLRef url = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("language"), CFSTR("txt"), nullptr); char path[MAX_PATH]; if(CFURLGetFileSystemRepresentation(url, false, (UInt8 *)path, sizeof(path))) { @@ -408,7 +408,7 @@ std::string LLAppViewerMacOSX::generateSerialNumber() serial_md5[0] = 0; // JC: Sample code from http://developer.apple.com/technotes/tn/tn1103.html - CFStringRef serialNumber = NULL; + CFStringRef serialNumber = nullptr; io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); if (platformExpert) @@ -459,7 +459,7 @@ void dispatchUrl(std::string url) url.replace(0, prefix.length(), "secondlife:///app/"); } - LLMediaCtrl* web = NULL; + LLMediaCtrl* web = nullptr; const bool trusted_browser = false; LLURLDispatcher::dispatch(url, "", web, trusted_browser); } diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index d6ea462b89..5af02427a3 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -199,7 +199,7 @@ namespace namespace { - void (*gOldTerminateHandler)() = NULL; + void (*gOldTerminateHandler)() = nullptr; } static void exceptionTerminateHandler() @@ -251,7 +251,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; @@ -562,7 +562,7 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, } delete viewer_app_ptr; - viewer_app_ptr = NULL; + viewer_app_ptr = nullptr; // (NVAPI) (6) We clean up. This is analogous to doing a free() if (hSession) @@ -673,7 +673,7 @@ void set_stream(const char* desc, FILE* fp, DWORD handle_id, const char* name, c if (freopen_s(&ignore, name, mode, fp) == 0) { // use unbuffered I/O - setvbuf( fp, NULL, _IONBF, 0 ); + setvbuf( fp, nullptr, _IONBF, 0 ); } } } @@ -844,7 +844,7 @@ bool LLAppViewerWin32::initWindow() DEVMODE dev_mode; ::ZeroMemory(&dev_mode, sizeof(DEVMODE)); dev_mode.dmSize = sizeof(DEVMODE); - if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode)) + if (EnumDisplaySettings(nullptr, ENUM_CURRENT_SETTINGS, &dev_mode)) { gSavedSettings.setU32("WindowWidth", dev_mode.dmPelsWidth); gSavedSettings.setU32("WindowHeight", dev_mode.dmPelsHeight); @@ -900,7 +900,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) { @@ -938,9 +938,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; @@ -967,12 +967,12 @@ std::string LLAppViewerWin32::generateSerialNumber() DWORD flags = 0; BOOL success = GetVolumeInformation( L"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/llaudiosourcevo.cpp b/indra/newview/llaudiosourcevo.cpp index 13a91e9713..53ac226918 100644 --- a/indra/newview/llaudiosourcevo.cpp +++ b/indra/newview/llaudiosourcevo.cpp @@ -49,7 +49,7 @@ LLAudioSourceVO::~LLAudioSourceVO() { mObjectp->clearAttachedSound(); } - mObjectp = NULL; + mObjectp = nullptr; } void LLAudioSourceVO::setGain(const F32 gain) @@ -208,7 +208,7 @@ void LLAudioSourceVO::updateMute() // Muted sounds keep there data at all times, because // it's the place where the audio UUID is stored. // However, it's possible that mCurrentDatap is - // NULL when this source did only preload sounds. + // nullptr when this source did only preload sounds. if (mCurrentDatap) { // Restart the sound. @@ -229,7 +229,7 @@ void LLAudioSourceVO::update() if (mObjectp->isDead()) { - mObjectp = NULL; + mObjectp = nullptr; return; } diff --git a/indra/newview/llautoreplace.cpp b/indra/newview/llautoreplace.cpp index 1ea2899ba4..355e195657 100644 --- a/indra/newview/llautoreplace.cpp +++ b/indra/newview/llautoreplace.cpp @@ -311,9 +311,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++ ) { @@ -443,9 +443,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/llavataractions.cpp b/indra/newview/llavataractions.cpp index 6f6b89ea81..7ce1844348 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -297,7 +297,7 @@ bool LLAvatarActions::isCalling(const LLUUID &id) } LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, id); - return (LLIMModel::getInstance()->findIMSession(session_id) != NULL); + return (LLIMModel::getInstance()->findIMSession(session_id) != nullptr); }*/ //static @@ -702,14 +702,14 @@ namespace action_give_inventory static LLInventoryPanel* get_outfit_editor_inventory_panel() { LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast(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("folder_view"); return inventory_panel; } /** - * @return active inventory panel, or NULL if there's no such panel + * @return active inventory panel, or nullptr if there's no such panel */ static LLInventoryPanel* get_active_inventory_panel() { @@ -758,7 +758,7 @@ namespace action_give_inventory return acceptable; } - static bool is_give_inventory_acceptable(LLInventoryPanel* panel = NULL) + static bool is_give_inventory_acceptable(LLInventoryPanel* panel = nullptr) { // check selection in the panel std::set inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel); @@ -785,13 +785,13 @@ namespace action_give_inventory for (std::set::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()); } @@ -925,7 +925,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++; } @@ -943,7 +943,7 @@ namespace action_give_inventory LLNotificationsUtil::add(notification, substitutions, LLSD(), boost::bind(&give_inventory_cb, _1, _2, inventory_selected_uuids)); } - static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector avatar_names, LLInventoryPanel* panel = NULL) + static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector avatar_names, LLInventoryPanel* panel = nullptr) { llassert(avatar_names.size() == avatar_uuids.size()); std::set inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);; @@ -1091,7 +1091,7 @@ void LLAvatarActions::shareWithAvatars(const uuid_set_t inventory_selected_uuids } // static -bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NULL*/) +bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = nullptr*/) { using namespace action_give_inventory; @@ -1492,7 +1492,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 diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 1f5a42ed22..bdf5a9212f 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -228,11 +228,11 @@ class LLAvatarActions /** * Checks whether all items selected in the given inventory panel can be shared * - * @param inv_panel Inventory panel to get selection from. If NULL, the active inventory panel is used. + * @param inv_panel Inventory panel to get selection from. If nullptr, the active inventory panel is used. * * @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); /** * Builds a string of residents' display names separated by "words_separator" string. @@ -255,7 +255,7 @@ class LLAvatarActions */ static void viewChatHistory(const LLUUID& id); - static std::set getInventorySelectedUUIDs(LLInventoryPanel* active_panel = NULL); + static std::set getInventorySelectedUUIDs(LLInventoryPanel* active_panel = nullptr); private: static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index f206474e71..8040c0e8ae 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -131,10 +131,10 @@ LLAvatarList::LLAvatarList(const Params& p) : LLFlatListViewEx(p) , mIgnoreOnlineStatus(p.ignore_online_status) , mShowLastInteractionTime(p.show_last_interaction_time) -, mContextMenu(NULL) +, mContextMenu(nullptr) , mDirty(true) // to force initial update , mNeedUpdateNames(false) -, mLITUpdateTimer(NULL) +, mLITUpdateTimer(nullptr) , mShowIcons(true) , mShowInfoBtn(p.show_info_btn) , mShowProfileBtn(p.show_profile_btn) @@ -472,7 +472,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/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 80c7f8beca..de267ec031 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -63,16 +63,16 @@ LLAvatarListItem::Params::Params() LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) : LLPanel(), LLFriendObserver(), - mAvatarIcon(NULL), - mAvatarName(NULL), - mLastInteractionTime(NULL), - mIconPermissionOnline(NULL), - mIconPermissionMap(NULL), - mIconPermissionEditMine(NULL), - mIconPermissionEditTheirs(NULL), - mSpeakingIndicator(NULL), - mInfoBtn(NULL), - mProfileBtn(NULL), + mAvatarIcon(nullptr), + mAvatarName(nullptr), + mLastInteractionTime(nullptr), + mIconPermissionOnline(nullptr), + mIconPermissionMap(nullptr), + mIconPermissionEditMine(nullptr), + mIconPermissionEditTheirs(nullptr), + mSpeakingIndicator(nullptr), + mInfoBtn(nullptr), + mProfileBtn(nullptr), mOnlineStatus(E_UNKNOWN), mShowInfoBtn(true), mShowProfileBtn(true), @@ -651,7 +651,7 @@ bool LLAvatarListItem::showPermissions(bool visible) mIconPermissionEditTheirs->setVisible(false); } - return NULL != relation; + return nullptr != relation; } LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_index) diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 309bed6f8b..9f0d3e5788 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -127,7 +127,7 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoGetCoro(std::string url, U64 { LLUUID target_agent_id = LLUUID(agent_iter->first); LLViewerObject* vobjp = gObjectList.findObject(target_agent_id); - LLVOAvatar *avatarp = NULL; + LLVOAvatar *avatarp = nullptr; if (vobjp) { avatarp = vobjp->asAvatar(); @@ -260,8 +260,8 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro(std::string url, U LLSD report = LLSD::emptyMap(); report[KEY_AGENTS] = agents; - regionp = NULL; - world_inst = NULL; + regionp = nullptr; + world_inst = nullptr; LLSD result = httpAdapter->postAndSuspend(httpRequest, url, report, httpOpts); world_inst = LLWorld::getInstance(); diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index b40bcadabf..0d4766af70 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -135,7 +135,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 @@ -158,7 +158,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) @@ -398,7 +398,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/llblocklist.cpp b/indra/newview/llblocklist.cpp index 89516a8a84..d72abd36a1 100644 --- a/indra/newview/llblocklist.cpp +++ b/indra/newview/llblocklist.cpp @@ -305,7 +305,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/llcallbacklist.cpp b/indra/newview/llcallbacklist.cpp index c474f2885b..29aae70d5a 100644 --- a/indra/newview/llcallbacklist.cpp +++ b/indra/newview/llcallbacklist.cpp @@ -254,7 +254,7 @@ LLCallbackList::test() LL_INFOS() << "Testing LLCallbackList" << LL_ENDL; - if (!list->deleteFunction(NULL)) + if (!list->deleteFunction(nullptr)) { LL_INFOS() << "passed 1" << LL_ENDL; } @@ -264,7 +264,7 @@ LLCallbackList::test() } // LL_INFOS() << "This should crash" << LL_ENDL; - // list->addFunction(NULL); + // list->addFunction(nullptr); list->addFunction(&test1, &a); list->addFunction(&test1, &a); diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 76e308a966..fd7efe51fa 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -92,7 +92,7 @@ static void on_avatar_name_cache_notify(const LLUUID& agent_id, ///---------------------------------------------------------------------------- LLAvatarTracker::LLAvatarTracker() : - mTrackingData(NULL), + mTrackingData(nullptr), mTrackedAgentValid(false), mModifyMask(0x0), mIsNotifyObservers(false) @@ -328,14 +328,14 @@ void LLAvatarTracker::terminateBuddy(const LLUUID& id) // get all buddy info const LLRelationship* LLAvatarTracker::getBuddyInfo(const LLUUID& id) const { - if(id.isNull()) return NULL; + if(id.isNull()) return nullptr; return get_ptr_in_map(mBuddyInfo, id); } bool LLAvatarTracker::isBuddy(const LLUUID& id) const { LLRelationship* info = get_ptr_in_map(mBuddyInfo, id); - return (info != NULL); + return (info != nullptr); } // online status @@ -427,7 +427,7 @@ void LLAvatarTracker::empowerList(const buddy_map_t& list, bool grant) buddy_list_t::const_iterator end = list.end(); for(; it != end; ++it) { - if(NULL == get_ptr_in_map(mBuddyInfo, (*it))) continue; + if(nullptr == get_ptr_in_map(mBuddyInfo, (*it))) continue; setBuddyEmpowered((*it), grant); if(start_new_message) { @@ -457,7 +457,7 @@ void LLAvatarTracker::deleteTrackingData() { //make sure mTrackingData never points to freed memory LLTrackingData* tmp = mTrackingData; - mTrackingData = NULL; + mTrackingData = nullptr; delete tmp; } @@ -705,7 +705,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/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 454991ab83..969e4bac33 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -47,7 +47,7 @@ LLChannelManager::LLChannelManager() { LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLChannelManager::onLoginCompleted, this)); mChannelList.clear(); - mStartUpChannel = NULL; + mStartUpChannel = nullptr; if(!gViewerWindow) { @@ -164,7 +164,7 @@ void LLChannelManager::onStartUpToastClose() mStartUpChannel->setVisible(false); mStartUpChannel->closeStartUpToast(); removeChannelByID(STARTUP_CHANNEL_UUID); - mStartUpChannel = NULL; + mStartUpChannel = nullptr; } // set StartUp Toast Flag to allow all other channels to show incoming toasts @@ -215,7 +215,7 @@ LLScreenChannelBase* LLChannelManager::findChannelByID(const LLUUID& id) return (*it).channel.get(); } - return NULL; + return nullptr; } //-------------------------------------------------------------------------- @@ -246,7 +246,7 @@ void LLChannelManager::killToastsFromChannel(const LLUUID& channel_id, const LLS LLScreenChannel * screen_channel = dynamic_cast (findChannelByID(channel_id)); - if (screen_channel != NULL) + if (screen_channel != nullptr) { screen_channel->killMatchedToasts(matcher); } @@ -259,7 +259,7 @@ LLNotificationsUI::LLScreenChannel* LLChannelManager::getNotificationScreenChann (LLNotificationsUI::LLChannelManager::getInstance()-> findChannelByID(NOTIFICATION_CHANNEL_UUID)); - 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 4f90db17c0..4581ed37a2 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -65,7 +65,7 @@ // constexpr F32 AGENT_TYPING_TIMEOUT = 5.f; // seconds -LLChatBar *gChatBar = NULL; +LLChatBar *gChatBar = nullptr; class LLChatBarGestureObserver : public LLGestureManagerObserver { @@ -86,12 +86,12 @@ extern void send_chat_from_viewer(const std::string& utf8_out_text, EChatType ty LLChatBar::LLChatBar() : LLPanel(), - mInputEditor(NULL), + mInputEditor(nullptr), mGestureLabelTimer(), mLastSpecialChatChannel(0), mIsBuilt(false), - mGestureCombo(NULL), - mObserver(NULL) + mGestureCombo(nullptr), + mObserver(nullptr) { //setIsChrome(true); } @@ -101,7 +101,7 @@ LLChatBar::~LLChatBar() { LLGestureMgr::instance().removeObserver(mObserver); delete mObserver; - mObserver = NULL; + mObserver = nullptr; // LLView destructor cleans up children } @@ -173,7 +173,7 @@ void LLChatBar::refresh() const F32 SHOW_GESTURE_NAME_TIME = 2.f; if (mGestureLabelTimer.getStarted() && mGestureLabelTimer.getElapsedTimeF32() > SHOW_GESTURE_NAME_TIME) { - LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL; + LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : nullptr; if (gestures) gestures->selectFirstItem(); mGestureLabelTimer.stop(); } @@ -337,7 +337,7 @@ LLWString LLChatBar::stripChannelNumber(const LLWString &mesg, S32* channel) pos++; } - mLastSpecialChatChannel = strtol(wstring_to_utf8str(channel_string).c_str(), NULL, 10); + mLastSpecialChatChannel = strtol(wstring_to_utf8str(channel_string).c_str(), nullptr, 10); *channel = mLastSpecialChatChannel; return mesg.substr(pos, mesg.length() - pos); } @@ -621,7 +621,7 @@ void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, bool void LLChatBar::onCommitGesture(LLUICtrl* ctrl) { - LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL; + LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : nullptr; if (gestures) { S32 index = gestures->getFirstSelectedIndex(); @@ -645,7 +645,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 c1af09ebc7..fa82d3fd55 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -112,7 +112,7 @@ class LLChatHistoryHeader: public LLPanel public: LLChatHistoryHeader() : LLPanel(), - mInfoCtrl(NULL), + mInfoCtrl(nullptr), mPopupMenuHandleAvatar(), mPopupMenuHandleObject(), mAvatarID(), @@ -121,9 +121,9 @@ class LLChatHistoryHeader: public LLPanel mSessionID(), mCreationTime(time_corrected()), mMinUserNameWidth(0), - mUserNameFont(NULL), - mUserNameTextBox(NULL), - mTimeBoxTextBox(NULL), + mUserNameFont(nullptr), + mUserNameTextBox(nullptr), + mTimeBoxTextBox(nullptr), mNeedsTimeBox(true), mAvatarNameCacheConnection() {} @@ -532,7 +532,7 @@ class LLChatHistoryHeader: public LLPanel if(speaker_mgr) { const LLSpeaker * speakerp = speaker_mgr->findSpeaker(getAvatarId()); - if (NULL != speakerp) + if (nullptr != speakerp) { return !speakerp->mModeratorMutedText; } @@ -1203,7 +1203,7 @@ void LLChatHistory::initFromParams(const LLChatHistory::Params& p) LLView* LLChatHistory::getSeparator() { - LLPanel* separator = LLUICtrlFactory::getInstance()->createFromFile(mMessageSeparatorFilename, NULL, LLPanel::child_registry_t::instance()); + LLPanel* separator = LLUICtrlFactory::getInstance()->createFromFile(mMessageSeparatorFilename, nullptr, LLPanel::child_registry_t::instance()); return separator; } @@ -1405,7 +1405,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; @@ -1469,7 +1469,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (chat.mNotifId.notNull()) { LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId); - if (notification != NULL) + if (notification != nullptr) { bool create_toast = true; if (notification->getName() == "OfferFriendship") diff --git a/indra/newview/llchatmsgbox.cpp b/indra/newview/llchatmsgbox.cpp index eacbb4366d..0aab200b20 100644 --- a/indra/newview/llchatmsgbox.cpp +++ b/indra/newview/llchatmsgbox.cpp @@ -38,7 +38,7 @@ class ChatSeparator : public LLTextSegment public: ChatSeparator(S32 start, S32 end) : LLTextSegment(start, end), - mEditor(NULL) + mEditor(nullptr) {} /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const @@ -58,7 +58,7 @@ class ChatSeparator : public LLTextSegment /*virtual*/ void unlinkFromDocument(class LLTextBase* editor) { - mEditor = NULL; + mEditor = nullptr; } /*virtual*/ S32 getWidth(S32 first_char, S32 num_chars) const diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 0cad51137c..2bfb654603 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -62,11 +62,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) { LLButton::Params button_params = p.button; mButton = LLUICtrlFactory::create(button_params); @@ -218,7 +218,7 @@ void LLNotificationChiclet::createMenu() enable_registrar.add("NotificationWellChicletMenu.EnableItem", boost::bind(&LLNotificationChiclet::enableMenuItem, this, _2)); - llassert(LLMenuGL::sMenuContainer != NULL); + llassert(LLMenuGL::sMenuContainer != nullptr); LLContextMenu* menu = LLUICtrlFactory::getInstance()->createFromFile ("menu_notification_well_button.xml", LLMenuGL::sMenuContainer, @@ -324,8 +324,8 @@ LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) : LLChiclet(p) , mShowSpeaker(false) , mDefaultWidth(p.rect().getWidth()) -, mNewMessagesIcon(NULL) -, mChicletButton(NULL) +, mNewMessagesIcon(nullptr) +, mChicletButton(nullptr) { } @@ -445,9 +445,9 @@ LLChicletPanel::Params::Params() LLChicletPanel::LLChicletPanel(const Params&p) : LLPanel(p) -, mScrollArea(NULL) -, mLeftScrollButton(NULL) -, mRightScrollButton(NULL) +, mScrollArea(nullptr) +, mLeftScrollButton(nullptr) +, mRightScrollButton(nullptr) , mChicletPadding(p.chiclet_padding) , mScrollingOffset(p.scrolling_offset) , mScrollButtonHPad(p.scroll_button_hpad) @@ -497,7 +497,7 @@ void LLChicletPanel::objectChicletCallback(const LLSD& data) for (iter = chiclets.begin(); iter != chiclets.end(); iter++) { LLIMChiclet* chiclet = dynamic_cast(*iter); - if (chiclet != NULL) + if (chiclet != nullptr) { chiclet->setShowNewMessagesIcon(new_message); } @@ -1021,7 +1021,7 @@ bool LLChicletPanel::isAnyIMFloaterDoked() { LLFloaterIMSession* im_floater = LLFloaterReg::findTypedInstance( "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; @@ -1083,7 +1083,7 @@ LLScriptChiclet::Params::Params() LLScriptChiclet::LLScriptChiclet(const Params&p) : LLIMChiclet(p) - , mChicletIconCtrl(NULL) + , mChicletIconCtrl(nullptr) { LLButton::Params button_params = p.chiclet_button; mChicletButton = LLUICtrlFactory::create(button_params); @@ -1160,7 +1160,7 @@ LLInvOfferChiclet::Params::Params() LLInvOfferChiclet::LLInvOfferChiclet(const Params&p) : LLIMChiclet(p) - , mChicletIconCtrl(NULL) + , mChicletIconCtrl(nullptr) { LLButton::Params button_params = p.chiclet_button; mChicletButton = LLUICtrlFactory::create(button_params); diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index c19f7dc1c1..19c21950d9 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -346,7 +346,7 @@ class LLIMChiclet : public LLChiclet Container operator()(InputIterator first, InputIterator last) const { Container c = Container(); for (InputIterator iter = first; iter != last; iter++) { - if (*iter != NULL) { + if (*iter != nullptr) { c.push_back(*iter); } } @@ -834,13 +834,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()) @@ -864,7 +864,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(); @@ -885,14 +885,14 @@ T* LLChicletPanel::findChiclet(const LLUUID& im_session_id) return result; } } - return NULL; + return nullptr; } template 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 bef96d0f11..fb390d2119 100644 --- a/indra/newview/llchicletbar.cpp +++ b/indra/newview/llchicletbar.cpp @@ -39,8 +39,8 @@ namespace } LLChicletBar::LLChicletBar() -: mChicletPanel(NULL), - mToolbarStack(NULL) +: mChicletPanel(nullptr), + mToolbarStack(nullptr) { buildFromFile("panel_chiclet_bar.xml"); } @@ -68,7 +68,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("ChicletBarRects") << descr << ": " << "panel: " << panel->getName() diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 47803edc73..18cf781da7 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -183,7 +183,7 @@ class CofClothingContextMenu : public CofContextMenu LLPanelOutfitEdit * panel_outfit_edit = dynamic_cast (LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); - if (panel_outfit_edit != NULL) + if (panel_outfit_edit != nullptr) { panel_outfit_edit->onReplaceMenuItemClicked(item_id); } @@ -283,15 +283,15 @@ class CofBodyPartContextMenu : public CofContextMenu ////////////////////////////////////////////////////////////////////////// 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); @@ -504,7 +504,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); @@ -542,15 +542,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); @@ -576,15 +576,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); @@ -600,10 +600,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 @@ -675,7 +675,7 @@ bool LLCOFWearables::getSelectedUUIDs(uuid_vec_t& selected_ids) LLPanel* LLCOFWearables::getSelectedItem() { - if (!mLastSelectedList) return NULL; + if (!mLastSelectedList) return nullptr; return mLastSelectedList->getSelectedItem(); } @@ -701,7 +701,7 @@ LLAssetType::EType LLCOFWearables::getExpandedAccordionAssetType() static type_map_t type_map; - if (mAccordionCtrl != NULL) + if (mAccordionCtrl != nullptr) { const LLAccordionCtrlTab* expanded_tab = mAccordionCtrl->getExpandedTab(); @@ -713,7 +713,7 @@ LLAssetType::EType LLCOFWearables::getExpandedAccordionAssetType() LLAssetType::EType LLCOFWearables::getSelectedAccordionAssetType() { - if (mAccordionCtrl != NULL) + if (mAccordionCtrl != nullptr) { const LLAccordionCtrlTab* selected_tab = mAccordionCtrl->getSelectedTab(); @@ -725,7 +725,7 @@ LLAssetType::EType LLCOFWearables::getSelectedAccordionAssetType() void LLCOFWearables::expandDefaultAccordionTab() { - if (mAccordionCtrl != NULL) + if (mAccordionCtrl != nullptr) { mAccordionCtrl->expandDefaultTab(); } diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index 97d2345778..f4a18d764c 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -174,7 +174,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) ) @@ -330,7 +330,7 @@ void LLColorSwatchCtrl::closeFloaterColorPicker() LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get(); if (pickerp) { - pickerp->setSwatch(NULL); + pickerp->setSwatch(nullptr); pickerp->closeFloater(); } diff --git a/indra/newview/llcommanddispatcherlistener.cpp b/indra/newview/llcommanddispatcherlistener.cpp index 4b8d0f870f..d4ea7659a9 100644 --- a/indra/newview/llcommanddispatcherlistener.cpp +++ b/indra/newview/llcommanddispatcherlistener.cpp @@ -68,7 +68,7 @@ void LLCommandDispatcherListener::dispatch(const LLSD& params) const params["params"], params["query"], "", - NULL, + nullptr, LLCommandHandler::NAV_TYPE_CLICKED, trusted_browser); } diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index 0734b12531..29057ab9e6 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -531,7 +531,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/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index e0236ca618..6a2917ff53 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -748,7 +748,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/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 660fb1b41a..9d9b7c8d1b 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -46,8 +46,8 @@ LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewer mPlaying(false), mGlobalScale(1.0f), mMarkedForDeath(false), - mRootVolp(NULL), - mControlAVBridge(NULL), + mRootVolp(nullptr), + mControlAVBridge(nullptr), mScaleConstraintFixup(1.0), mRegionChanged(false) { @@ -85,7 +85,7 @@ const LLVOAvatar *LLControlAvatar::getAttachedAvatar() const { return mRootVolp->getAvatarAncestor(); } - return NULL; + return nullptr; } LLVOAvatar *LLControlAvatar::getAttachedAvatar() @@ -94,7 +94,7 @@ LLVOAvatar *LLControlAvatar::getAttachedAvatar() { return mRootVolp->getAvatarAncestor(); } - return NULL; + return nullptr; } void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_scale_fixup) const @@ -353,7 +353,7 @@ void LLControlAvatar::markForDeath() mMarkedForDeath = true; // object unlinked cav and might be dead already // might need to clean mControlAVBridge here as well - mRootVolp = NULL; + mRootVolp = nullptr; } void LLControlAvatar::idleUpdate(LLAgent &agent, const F64 &time) @@ -371,9 +371,9 @@ void LLControlAvatar::idleUpdate(LLAgent &agent, const F64 &time) void LLControlAvatar::markDead() { - mRootVolp = NULL; + mRootVolp = nullptr; super::markDead(); - mControlAVBridge = NULL; + mControlAVBridge = nullptr; } bool LLControlAvatar::computeNeedsUpdate() @@ -620,10 +620,10 @@ LLViewerObject* LLControlAvatar::lineSegmentIntersectRiggedAttachments(const LLV { if (!mRootVolp) { - return NULL; + return nullptr; } - LLViewerObject* hit = NULL; + LLViewerObject* hit = nullptr; if (lineSegmentBoundingBox(start, end)) { diff --git a/indra/newview/llcontrolavatar.h b/indra/newview/llcontrolavatar.h index 0d94fe08ee..eddc1a4e70 100644 --- a/indra/newview/llcontrolavatar.h +++ b/indra/newview/llcontrolavatar.h @@ -72,11 +72,11 @@ class LLControlAvatar: bool pick_transparent = false, bool pick_rigged = false, bool pick_unselectable = true, - 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 void updateDebugText(); diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 4a4985d8ac..e00d03d877 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -341,7 +341,7 @@ LLConversation* LLConversationLog::findConversation(const LLIMModel::LLIMSession } } - return NULL; + return nullptr; } void LLConversationLog::removeConversation(const LLConversation& conversation) @@ -370,7 +370,7 @@ const LLConversation* LLConversationLog::getConversation(const LLUUID& session_i } } - return NULL; + return nullptr; } void LLConversationLog::addObserver(LLConversationLogObserver* observer) diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index 65863f0a5e..6fffa24980 100644 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -218,7 +218,7 @@ void LLConversationLogList::rebuildList() } // try to restore selection of item - if (NULL != selected_conversationp) + if (nullptr != selected_conversationp) { selectItemByUUID(selected_conversationp->getSessionID()); } @@ -247,7 +247,7 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata) { const LLConversation * selected_conversationp = getSelectedConversation(); - if (NULL == selected_conversationp) + if (nullptr == selected_conversationp) { return; } @@ -357,7 +357,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; } @@ -412,7 +412,7 @@ bool LLConversationLogList::isActionChecked(const LLSD& userdata) { const LLConversation * selected_conversationp = getSelectedConversation(); - if (NULL == selected_conversationp) + if (nullptr == selected_conversationp) { return false; } @@ -467,7 +467,7 @@ const LLConversation* LLConversationLogList::getSelectedConversation() return panel->getConversation(); } - return NULL; + return nullptr; } LLConversationLogListItem* LLConversationLogList::getConversationLogListItem(const LLUUID& session_id) @@ -485,7 +485,7 @@ LLConversationLogListItem* LLConversationLogList::getConversationLogListItem(con } } - return NULL; + return nullptr; } LLConversationLogList::ESortOrder LLConversationLogList::getSortOrder() diff --git a/indra/newview/llconversationloglistitem.cpp b/indra/newview/llconversationloglistitem.cpp index e21a772f67..652b7d711a 100644 --- a/indra/newview/llconversationloglistitem.cpp +++ b/indra/newview/llconversationloglistitem.cpp @@ -42,8 +42,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/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index bb1daf4ec1..ff85ddea83 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -160,7 +160,7 @@ void LLConversationItem::buildParticipantMenuOptions(menuentry_vec_t& items, U32 } else { - LLVoiceChannel* voice_channel = LLIMModel::getInstance() ? LLIMModel::getInstance()->getVoiceChannel(this->getUUID()) : NULL; + LLVoiceChannel* voice_channel = LLIMModel::getInstance() ? LLIMModel::getInstance()->getVoiceChannel(this->getUUID()) : nullptr; if(voice_channel != LLVoiceChannel::getCurrentVoiceChannel()) { items.push_back(std::string("voice_call")); @@ -323,7 +323,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); } } @@ -365,7 +365,7 @@ void LLConversationItemSession::clearAndDeparentModels() // and have a different parent if (child->getParent() == this) { - child->setParent(NULL); + child->setParent(nullptr); } it = mChildren.erase(it); } @@ -375,7 +375,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++) { @@ -385,7 +385,7 @@ LLConversationItemParticipant* LLConversationItemSession::findParticipant(const break; } } - return (iter == mChildren.end() ? NULL : participant); + return (iter == mChildren.end() ? nullptr : participant); } void LLConversationItemSession::setParticipantIsMuted(const LLUUID& participant_id, bool is_muted) @@ -468,7 +468,7 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) void LLConversationItemSession::addVoiceOptions(menuentry_vec_t& items) { - LLVoiceChannel* voice_channel = LLIMModel::getInstance() ? LLIMModel::getInstance()->getVoiceChannel(this->getUUID()) : NULL; + LLVoiceChannel* voice_channel = LLIMModel::getInstance() ? LLIMModel::getInstance()->getVoiceChannel(this->getUUID()) : nullptr; if(voice_channel != LLVoiceChannel::getCurrentVoiceChannel()) { @@ -485,7 +485,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++) { @@ -531,7 +531,7 @@ void LLConversationItemSession::onAvatarNameCache(const LLAvatarName& av_name) } renameItem(av_name.getDisplayName()); - postEvent("update_session", this, NULL); + postEvent("update_session", this, nullptr); } // @@ -593,10 +593,10 @@ void LLConversationItemParticipant::updateName(const LLAvatarName& av_name) } renameItem(mDisplayName); - if (mParent != NULL) + if (mParent != nullptr) { LLConversationItemSession* parent_session = dynamic_cast(mParent); - if (parent_session != NULL) + if (parent_session != nullptr) { parent_session->requestSort(); parent_session->updateName(this); @@ -617,7 +617,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(mParent); diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index d5486b9f4a..b1d507f550 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -75,7 +75,7 @@ class LLConversationItem : public LLFolderViewModelItemCommon virtual std::string getSearchableUUIDString() const {return LLStringUtil::null;} virtual const LLUUID& getUUID() const { return mUUID; } virtual time_t getCreationDate() const { return 0; } - virtual LLPointer getIcon() const { return NULL; } + virtual LLPointer getIcon() const { return nullptr; } virtual LLPointer getOpenIcon() const { return getIcon(); } virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } virtual std::string getLabelSuffix() const { return LLStringUtil::null; } diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 99d770b6e2..9b163044bc 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -77,11 +77,11 @@ LLConversationViewSession::Params::Params() : LLConversationViewSession::LLConversationViewSession(const LLConversationViewSession::Params& p): LLFolderViewFolder(p), mContainer(p.container), - mItemPanel(NULL), - mCallIconLayoutPanel(NULL), - mSessionTitle(NULL), - mSpeakingIndicator(NULL), - mVoiceClientObserver(NULL), + mItemPanel(nullptr), + mCallIconLayoutPanel(nullptr), + mSessionTitle(nullptr), + mSpeakingIndicator(nullptr), + mVoiceClientObserver(nullptr), mCollapsedMode(false), mHasArrow(true), mIsInActiveVoiceChannel(false), @@ -209,7 +209,7 @@ bool LLConversationViewSession::postBuild() { LLFolderViewItem::postBuild(); - mItemPanel = LLUICtrlFactory::getInstance()->createFromFile("panel_conversation_list_item.xml", NULL, LLPanel::child_registry_t::instance()); + mItemPanel = LLUICtrlFactory::getInstance()->createFromFile("panel_conversation_list_item.xml", nullptr, LLPanel::child_registry_t::instance()); addChild(mItemPanel); mCallIconLayoutPanel = mItemPanel->getChild("call_icon_panel"); @@ -468,7 +468,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++) { @@ -478,7 +478,7 @@ LLConversationViewParticipant* LLConversationViewSession::findParticipant(const break; } } - return (iter == getItemsEnd() ? NULL : participant); + return (iter == getItemsEnd() ? nullptr : participant); } void LLConversationViewSession::showVoiceIndicator(bool visible) @@ -516,7 +516,7 @@ void LLConversationViewSession::refresh() mSpeakingIndicator->setShowParticipantsSpeaking(mIsInActiveVoiceChannel); } - LLConversationViewParticipant* participant = NULL; + LLConversationViewParticipant* participant = nullptr; items_t::const_iterator iter; for (iter = getItemsBegin(); iter != getItemsEnd(); iter++) { @@ -585,9 +585,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) { } @@ -773,7 +773,7 @@ bool LLConversationViewParticipant::handleMouseDown( S32 x, S32 y, MASK mask ) { if(getRoot()->getCurSelectedItem() == this) { - LLConversationItem* vmi = getParentFolder() ? dynamic_cast(getParentFolder()->getViewModelItem()) : NULL; + LLConversationItem* vmi = getParentFolder() ? dynamic_cast(getParentFolder()->getViewModelItem()) : nullptr; LLUUID session_id = vmi? vmi->getUUID() : LLUUID(); LLFloaterIMContainer *im_container = LLFloaterReg::getTypedInstance("im_container"); @@ -857,7 +857,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/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index 8a4ab091a3..fddc44ef42 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -341,7 +341,7 @@ bool LLCurrencyUIManager::Impl::checkTransaction() return false; } - if (mTransaction->status(NULL) != LLXMLRPCTransaction::StatusComplete) + if (mTransaction->status(nullptr) != LLXMLRPCTransaction::StatusComplete) { setError(mTransaction->statusMessage(), mTransaction->statusURI()); } @@ -360,7 +360,7 @@ bool LLCurrencyUIManager::Impl::checkTransaction() } delete mTransaction; - mTransaction = NULL; + mTransaction = nullptr; mTransactionType = TransactionNone; return true; diff --git a/indra/newview/lldebugmessagebox.cpp b/indra/newview/lldebugmessagebox.cpp index 91ea36706e..389fc6e4f2 100644 --- a/indra/newview/lldebugmessagebox.cpp +++ b/indra/newview/lldebugmessagebox.cpp @@ -56,9 +56,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/lldebugview.cpp b/indra/newview/lldebugview.cpp index 53da9826ed..66858ef600 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -44,7 +44,7 @@ // Globals // -LLDebugView* gDebugView = NULL; +LLDebugView* gDebugView = nullptr; // // Methods @@ -53,18 +53,18 @@ static LLDefaultChildRegistry::Register 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() @@ -117,7 +117,7 @@ void LLDebugView::init() void LLDebugView::draw() { - if (mFloaterSnapRegion == NULL) + if (mFloaterSnapRegion == nullptr) { mFloaterSnapRegion = gViewerWindow->getFloaterSnapRegion(); } diff --git a/indra/newview/lldelayedgestureerror.cpp b/indra/newview/lldelayedgestureerror.cpp index 710e1a33db..f8e19398f7 100644 --- a/indra/newview/lldelayedgestureerror.cpp +++ b/indra/newview/lldelayedgestureerror.cpp @@ -65,7 +65,7 @@ void LLDelayedGestureError::enqueue(const LLErrorEntry &ent) { if ( sQueue.empty() ) { - gIdleCallbacks.addFunction(onIdle, NULL); + gIdleCallbacks.addFunction(onIdle, nullptr); } sQueue.push_back(ent); @@ -87,7 +87,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 2dba778e24..90b0d08a6d 100644 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -62,7 +62,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; } @@ -72,7 +72,7 @@ bool LLDirPicker::check_local_file_access_enabled() #if LL_SDL_WINDOW LLDirPicker::LLDirPicker() : - mFileName(NULL), + mFileName(nullptr), mLocked(false) { reset(); @@ -168,9 +168,9 @@ bool LLDirPicker::getDirModeless(std::string* filename, #elif LL_WINDOWS LLDirPicker::LLDirPicker() : - mFileName(NULL), + mFileName(nullptr), mLocked(false), - pDialog(NULL) + pDialog(nullptr) { } @@ -185,7 +185,7 @@ void LLDirPicker::reset() { IFileDialog* p_file_dialog = (IFileDialog*)pDialog; p_file_dialog->Close(S_FALSE); - pDialog = NULL; + pDialog = nullptr; } } @@ -224,10 +224,10 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking) }); } - ::OleInitialize(NULL); + ::OleInitialize(nullptr); IFileDialog* p_file_dialog; - if (SUCCEEDED(CoCreateInstance(CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&p_file_dialog)))) + if (SUCCEEDED(CoCreateInstance(CLSID_FileOpenDialog, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&p_file_dialog)))) { DWORD dwOptions; if (SUCCEEDED(p_file_dialog->GetOptions(&dwOptions))) @@ -241,7 +241,7 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking) IShellItem* psi; if (SUCCEEDED(p_file_dialog->GetResult(&psi))) { - wchar_t* pwstr = NULL; + wchar_t* pwstr = nullptr; if (SUCCEEDED(psi->GetDisplayName(SIGDN_FILESYSPATH, &pwstr))) { mDir = ll_convert_wide_to_string(pwstr); @@ -251,7 +251,7 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking) psi->Release(); } } - pDialog = NULL; + pDialog = nullptr; p_file_dialog->Release(); } @@ -283,7 +283,7 @@ std::string LLDirPicker::getDirName() #elif LL_DARWIN LLDirPicker::LLDirPicker() : -mFileName(NULL), +mFileName(nullptr), mLocked(false) { mFilePicker = new LLFilePicker(); @@ -324,7 +324,7 @@ std::string LLDirPicker::getDirName() #elif LL_LINUX LLDirPicker::LLDirPicker() : - mFileName(NULL), + mFileName(nullptr), mLocked(false) { mFilePicker = new LLFilePicker(); @@ -408,7 +408,7 @@ std::string LLDirPicker::getDirName() #endif -LLMutex* LLDirPickerThread::sMutex = NULL; +LLMutex* LLDirPickerThread::sMutex = nullptr; std::queue LLDirPickerThread::sDeadQ; void LLDirPickerThread::getFile() @@ -483,7 +483,7 @@ void LLDirPickerThread::cleanupClass() clearDead(); delete sMutex; - sMutex = NULL; + sMutex = nullptr; } //static @@ -504,7 +504,7 @@ void LLDirPickerThread::clearDead() LLDirPickerThread::LLDirPickerThread(const dir_picked_signal_t::slot_type& cb, const std::string &proposed_name) : LLThread("dir picker"), - mFilePickedSignal(NULL) + mFilePickedSignal(nullptr) { mFilePickedSignal = new dir_picked_signal_t(); mFilePickedSignal->connect(cb); diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index b4ced668d0..df375c897f 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -107,7 +107,7 @@ void LLDoNotDisturbNotificationStorage::saveNotifications() LLNotificationChannelPtr channelPtr = getCommunicationChannel(); const LLCommunicationChannel *commChannel = dynamic_cast(channelPtr.get()); - llassert(commChannel != NULL); + llassert(commChannel != nullptr); LLSD output = LLSD::emptyMap(); LLSD& data = output["data"]; @@ -198,7 +198,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; @@ -236,7 +236,7 @@ void LLDoNotDisturbNotificationStorage::updateNotifications() LLNotificationChannelPtr channelPtr = getCommunicationChannel(); LLCommunicationChannel *commChannel = dynamic_cast(channelPtr.get()); - llassert(commChannel != NULL); + llassert(commChannel != nullptr); LLNotifications& instance = LLNotifications::instance(); bool imToastExists = false; diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 322ee90541..52cfdd8383 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -102,7 +102,7 @@ void LLDrawable::init(bool new_entry) LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; // mXform - mParent = NULL; + mParent = nullptr; mRenderType = 0; mCurrentScale = LLVector3(1,1,1); mDistanceWRTCamera = 0.0f; @@ -111,11 +111,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) @@ -135,7 +135,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. @@ -205,7 +205,7 @@ void LLDrawable::markDead() if (mSpatialBridge) { mSpatialBridge->markDead(); - mSpatialBridge = NULL; + mSpatialBridge = nullptr; } sNumZombieDrawables++; @@ -224,7 +224,7 @@ LLVOVolume* LLDrawable::getVOVolume() const } else { - return NULL; + return nullptr; } } @@ -266,8 +266,8 @@ void LLDrawable::cleanupReferences() removeFromOctree(); // Cleanup references to other objects - mVObjp = NULL; - mParent = NULL; + mVObjp = nullptr; + mParent = nullptr; } void LLDrawable::removeFromOctree() @@ -282,7 +282,7 @@ void LLDrawable::removeFromOctree() { getRegion()->removeActiveCacheEntry((LLVOCacheEntry*)mEntry->getVOCacheEntry(), this); } - mEntry = NULL; + mEntry = nullptr; } void LLDrawable::cleanupDeadDrawables() @@ -598,7 +598,7 @@ void LLDrawable::makeStatic(bool warning_enabled) if (mSpatialBridge) { mSpatialBridge->markDead(); - setSpatialBridge(NULL); + setSpatialBridge(nullptr); } updatePartition(); } @@ -1161,7 +1161,7 @@ void LLDrawable::setGroup(LLViewerOctreeGroup *groupp) if (cur_groupp != groupp && getVOVolume()) { //NULL out vertex buffer references for volumes on spatial group change to maintain - //requirement that every face vertex buffer is either NULL or points to a vertex buffer + //requirement that every face vertex buffer is either nullptr or points to a vertex buffer //contained by its drawable's spatial group for (S32 i = 0; i < getNumFaces(); ++i) { @@ -1172,9 +1172,9 @@ void LLDrawable::setGroup(LLViewerOctreeGroup *groupp) } } - //postcondition: if next group is NULL, previous group must be dead OR NULL OR binIndex must be -1 - //postcondition: if next group is NOT NULL, binIndex must not be -1 - //llassert(groupp == NULL ? (cur_groupp == NULL || cur_groupp->isDead()) || (!getEntry() || getEntry()->getBinIndex() == -1) : + //postcondition: if next group is nullptr, previous group must be dead OR nullptr OR binIndex must be -1 + //postcondition: if next group is NOT nullptr, binIndex must not be -1 + //llassert(groupp == nullptr ? (cur_groupp == nullptr || cur_groupp->isDead()) || (!getEntry() || getEntry()->getBinIndex() == -1) : // (getEntry() && getEntry()->getBinIndex() != -1)); LLViewerOctreeEntryData::setGroup(groupp); @@ -1188,7 +1188,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; - LLSpatialPartition* retval = NULL; + LLSpatialPartition* retval = nullptr; if (!mVObjp || !getVOVolume() || @@ -1203,28 +1203,28 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() { U32 partition_type = mSpatialBridge->asPartition()->mPartitionType; bool is_hud = mVObjp->isHUDAttachment(); - bool is_animesh = mVObjp->isAnimatedObject() && mVObjp->getControlAvatar() != NULL; + bool is_animesh = mVObjp->isAnimatedObject() && mVObjp->getControlAvatar() != nullptr; bool is_attachment = mVObjp->isAttachment() && !is_hud && !is_animesh; if ((partition_type == LLViewerRegion::PARTITION_HUD) != is_hud) { // Was/became HUD // remove obsolete bridge mSpatialBridge->markDead(); - setSpatialBridge(NULL); + setSpatialBridge(nullptr); } else if ((partition_type == LLViewerRegion::PARTITION_CONTROL_AV) != is_animesh) { // Was/became part of animesh // remove obsolete bridge mSpatialBridge->markDead(); - setSpatialBridge(NULL); + setSpatialBridge(nullptr); } else if ((partition_type == LLViewerRegion::PARTITION_AVATAR) != is_attachment) { // Was/became part of avatar // remove obsolete bridge mSpatialBridge->markDead(); - setSpatialBridge(NULL); + setSpatialBridge(nullptr); } } //must be an active volume @@ -1262,7 +1262,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() if (retval && mSpatialBridge.notNull()) { mSpatialBridge->markDead(); - setSpatialBridge(NULL); + setSpatialBridge(nullptr); } return retval; @@ -1317,7 +1317,7 @@ LLSpatialBridge::~LLSpatialBridge() void LLSpatialBridge::destroyTree() { delete mOctree; - mOctree = NULL; + mOctree = nullptr; } void LLSpatialBridge::updateSpatialExtents() @@ -1596,7 +1596,7 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; - if (mDrawable == NULL) + if (mDrawable == nullptr) { markDead(); return; @@ -1675,7 +1675,7 @@ void LLSpatialBridge::cleanupReferences() LLDrawable::cleanupReferences(); if (mDrawable) { - mDrawable->setGroup(NULL); + mDrawable->setGroup(nullptr); if (mDrawable->getVObj()) { @@ -1687,14 +1687,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 8af044990f..e590996d97 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -80,7 +80,7 @@ class alignas(16) LLDrawable bool isLight() const; - virtual void setVisible(LLCamera& camera_in, std::vector* results = NULL, bool for_select = false); + virtual void setVisible(LLCamera& camera_in, std::vector* results = nullptr, bool for_select = false); LLSpatialGroup* getSpatialGroup()const {return (LLSpatialGroup*)getGroup();} LLViewerRegion* getRegion() const { return mVObjp->getRegion(); } @@ -115,7 +115,7 @@ class alignas(16) LLDrawable LLDrawable* getRoot(); 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:: () @@ -315,13 +315,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 3eca6059ed..b3655f0a2e 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -61,7 +61,7 @@ S32 LLDrawPool::sNumDrawPools = 0; //============================= LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerTexture *tex0) { - LLDrawPool *poolp = NULL; + LLDrawPool *poolp = nullptr; switch (type) { case POOL_SIMPLE: @@ -125,7 +125,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); @@ -148,7 +148,7 @@ LLDrawPool::~LLDrawPool() LLViewerTexture *LLDrawPool::getDebugTexture() { - return NULL; + return nullptr; } //virtual @@ -297,7 +297,7 @@ void LLFacePool::resetDrawOrders() LLViewerTexture *LLFacePool::getTexture() { - return NULL; + return nullptr; } void LLFacePool::removeFaceReference(LLFace *facep) diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 46696fc4a4..80a6094165 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -116,7 +116,7 @@ class LLDrawPool virtual bool verify() const { return true; } // Verify that all data in the draw pool is correct! virtual S32 getShaderLevel() const { return mShaderLevel; } - static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = NULL); + static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = nullptr); virtual LLViewerTexture* getTexture() = 0; virtual bool isFacePool() { return false; } virtual void resetDrawOrders() = 0; @@ -345,8 +345,8 @@ class LLRenderPass : public LLDrawPool LLRenderPass(const U32 type); virtual ~LLRenderPass(); - /*virtual*/ LLViewerTexture* getDebugTexture() { return NULL; } - LLViewerTexture* getTexture() { return NULL; } + /*virtual*/ LLViewerTexture* getDebugTexture() { return nullptr; } + LLViewerTexture* getTexture() { return nullptr; } bool isDead() { return false; } void resetDrawOrders() { } diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index bc45734e66..48880019bb 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -66,7 +66,7 @@ static const F32 MINIMUM_ALPHA = 0.004f; // ~ 1/255 static const F32 MINIMUM_IMPOSTOR_ALPHA = 0.1f; LLDrawPoolAlpha::LLDrawPoolAlpha(U32 type) : - LLRenderPass(type), target_shader(NULL), + LLRenderPass(type), target_shader(nullptr), mColorSFactor(LLRender::BF_UNDEF), mColorDFactor(LLRender::BF_UNDEF), mAlphaSFactor(LLRender::BF_UNDEF), mAlphaDFactor(LLRender::BF_UNDEF) { @@ -658,7 +658,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged) LLRenderPass::applyModelMatrix(params); - LLMaterial* mat = NULL; + LLMaterial* mat = nullptr; LLGLTFMaterial *gltf_mat = params.mGLTFMaterial; LLGLDisable cull_face(gltf_mat && gltf_mat->mDoubleSided ? GL_CULL_FACE : 0); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index f0f589e7f4..1253f1387c 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -55,7 +55,7 @@ static U32 sShaderLevel = 0; -LLGLSLShader* LLDrawPoolAvatar::sVertexProgram = NULL; +LLGLSLShader* LLDrawPoolAvatar::sVertexProgram = nullptr; bool LLDrawPoolAvatar::sSkipOpaque = false; bool LLDrawPoolAvatar::sSkipTransparent = false; S32 LLDrawPoolAvatar::sShadowPass = -1; @@ -342,7 +342,7 @@ void LLDrawPoolAvatar::endShadowPass(S32 pass) { sVertexProgram->unbind(); } - sVertexProgram = NULL; + sVertexProgram = nullptr; sRenderingSkinned = false; LLDrawPoolAvatar::sShadowPass = -1; } @@ -425,11 +425,11 @@ void LLDrawPoolAvatar::render(S32 pass) LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; if (LLPipeline::sImpostorRender) { - renderAvatars(NULL, ++pass); + renderAvatars(nullptr, ++pass); return; } - renderAvatars(NULL, pass); // render all avatars + renderAvatars(nullptr, pass); // render all avatars } void LLDrawPoolAvatar::beginRenderPass(S32 pass) @@ -517,7 +517,7 @@ void LLDrawPoolAvatar::beginRigid() { sVertexProgram = &gObjectAlphaMaskNoColorProgram; - if (sVertexProgram != NULL) + if (sVertexProgram != nullptr) { //eyeballs render with the specular shader sVertexProgram->bind(); sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha); @@ -525,7 +525,7 @@ void LLDrawPoolAvatar::beginRigid() } else { - sVertexProgram = NULL; + sVertexProgram = nullptr; } } @@ -534,7 +534,7 @@ void LLDrawPoolAvatar::endRigid() LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; sShaderLevel = mShaderLevel; - if (sVertexProgram != NULL) + if (sVertexProgram != nullptr) { sVertexProgram->unbind(); } @@ -566,7 +566,7 @@ void LLDrawPoolAvatar::endDeferredImpostor() sVertexProgram->disableTexture(LLViewerShaderMgr::SPECULAR_MAP); sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); gPipeline.unbindDeferredShader(*sVertexProgram); - sVertexProgram = NULL; + sVertexProgram = nullptr; sDiffuseChannel = 0; } @@ -682,7 +682,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } - LLVOAvatar *avatarp = NULL; + LLVOAvatar *avatarp = nullptr; if (single_avatar) { @@ -836,12 +836,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(); diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 6c151351ff..bf16889811 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -71,7 +71,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; @@ -158,7 +158,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++; } @@ -173,7 +173,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; } @@ -210,7 +210,7 @@ S32 LLDrawPoolBump::numBumpPasses() //static void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel) { - LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL; + LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : nullptr; if( cube_map && !LLPipeline::sReflectionProbesEnabled ) { if (shader ) @@ -257,7 +257,7 @@ void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& di //static void LLDrawPoolBump::unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel) { - LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL; + LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : nullptr; if( cube_map && !LLPipeline::sReflectionProbesEnabled) { if (shader_level > 1) @@ -305,7 +305,7 @@ void LLDrawPoolBump::beginFullbrightShiny() gGL.getTexUnit(channel)->bind(&gPipeline.mExposureMap); } - LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL; + LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : nullptr; if (cube_map && !LLPipeline::sReflectionProbesEnabled) { @@ -386,7 +386,7 @@ void LLDrawPoolBump::endFullbrightShiny() { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_SHINY); - LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL; + LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : nullptr; if( cube_map && !LLPipeline::sReflectionProbesEnabled ) { cube_map->disable(); @@ -451,7 +451,7 @@ bool LLDrawPoolBump::bindBumpMap(U8 bump_code, LLViewerTexture* texture, S32 cha return false; } - LLViewerTexture* bump = NULL; + LLViewerTexture* bump = nullptr; switch( bump_code ) { diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 1e83426714..b80c02e398 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -32,8 +32,8 @@ LLDrawPoolSky::LLDrawPoolSky() : LLFacePool(POOL_SKY), - mSkyTex(NULL), - mShader(NULL) + mSkyTex(nullptr), + mShader(nullptr) { } diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index d75b8d0ac6..1cf56f58a4 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -57,7 +57,7 @@ int DebugDetailMap = 0; S32 LLDrawPoolTerrain::sPBRDetailMode = 0; F32 LLDrawPoolTerrain::sDetailScale = DETAIL_SCALE; F32 LLDrawPoolTerrain::sPBRDetailScale = DETAIL_SCALE; -static LLGLSLShader* sShader = NULL; +static LLGLSLShader* sShader = nullptr; static LLTrace::BlockTimerStatHandle FTM_SHADOW_TERRAIN("Terrain Shadow"); @@ -86,7 +86,7 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) : LLDrawPoolTerrain::~LLDrawPoolTerrain() { - llassert( gPipeline.findPool( getType(), getTexture() ) == NULL ); + llassert( gPipeline.findPool( getType(), getTexture() ) == nullptr ); } U32 LLDrawPoolTerrain::getVertexDataMask() diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 26ef190fbb..4137520edd 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -41,7 +41,7 @@ #include "llenvironment.h" S32 LLDrawPoolTree::sDiffTex = 0; -static LLGLSLShader* shader = NULL; +static LLGLSLShader* shader = nullptr; LLDrawPoolTree::LLDrawPoolTree(LLViewerTexture *texturep) : LLFacePool(POOL_TREE), diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index e6d0b036e0..63aafd6019 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -50,10 +50,10 @@ extern bool gCubeSnapshot; static LLStaticHashedString sCamPosLocal("camPosLocal"); static LLStaticHashedString sCustomAlpha("custom_alpha"); -static LLGLSLShader* cloud_shader = NULL; -static LLGLSLShader* sky_shader = NULL; -static LLGLSLShader* sun_shader = NULL; -static LLGLSLShader* moon_shader = NULL; +static LLGLSLShader* cloud_shader = nullptr; +static LLGLSLShader* sky_shader = nullptr; +static LLGLSLShader* sun_shader = nullptr; +static LLGLSLShader* moon_shader = nullptr; static float sStarTime; @@ -68,7 +68,7 @@ LLDrawPoolWLSky::~LLDrawPoolWLSky() LLViewerTexture *LLDrawPoolWLSky::getDebugTexture() { - return NULL; + return nullptr; } void LLDrawPoolWLSky::beginDeferredPass(S32 pass) @@ -94,7 +94,7 @@ void LLDrawPoolWLSky::endDeferredPass(S32 pass) void LLDrawPoolWLSky::renderDome(const LLVector3& camPosLocal, F32 camHeightLocal, LLGLSLShader * shader) const { - llassert_always(NULL != shader); + llassert_always(nullptr != shader); gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); @@ -503,7 +503,7 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) LLViewerTexture* LLDrawPoolWLSky::getTexture() { - return NULL; + return nullptr; } void LLDrawPoolWLSky::resetDrawOrders() diff --git a/indra/newview/lldrawpoolwlsky.h b/indra/newview/lldrawpoolwlsky.h index 3c4b94b467..464fd27c8e 100644 --- a/indra/newview/lldrawpoolwlsky.h +++ b/indra/newview/lldrawpoolwlsky.h @@ -55,7 +55,7 @@ class LLDrawPoolWLSky : public LLDrawPool { /*virtual*/ bool verify() const { return true; } // Verify that all data in the draw pool is correct! /*virtual*/ S32 getShaderLevel() const { return mShaderLevel; } - //static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = NULL); + //static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = nullptr); /*virtual*/ LLViewerTexture* getTexture(); /*virtual*/ bool isFacePool() { return false; } diff --git a/indra/newview/llemote.cpp b/indra/newview/llemote.cpp index e952a29c54..b68d0a56c9 100644 --- a/indra/newview/llemote.cpp +++ b/indra/newview/llemote.cpp @@ -44,7 +44,7 @@ //----------------------------------------------------------------------------- LLEmote::LLEmote(const LLUUID &id) : LLMotion(id) { - mCharacter = NULL; + mCharacter = 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/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp index 54be045c3d..679132cfce 100644 --- a/indra/newview/llestateinfomodel.cpp +++ b/indra/newview/llestateinfomodel.cpp @@ -93,9 +93,9 @@ void LLEstateInfoModel::update(const strings_t& strings) // it draws with a weird character at the end of the string. mName = strings[0].c_str(); 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("WindlightSync") << "Received estate info: " << "is_sun_fixed = " << getUseFixedSun() diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 37802fa175..8a68299328 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -129,7 +129,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(); @@ -145,7 +145,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; @@ -156,8 +156,8 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp) mReferenceIndex = -1; - mTextureMatrix = NULL; - mDrawInfo = NULL; + mTextureMatrix = nullptr; + mDrawInfo = nullptr; mFaceColor = LLColor4(1,0,0,1); @@ -182,7 +182,7 @@ void LLFace::destroy() if(mTexture[i].notNull()) { mTexture[i]->removeFace(i, this) ; - mTexture[i] = NULL; + mTexture[i] = nullptr; } } @@ -194,13 +194,13 @@ void LLFace::destroy() if (mDrawPoolp) { mDrawPoolp->removeFace(this); - mDrawPoolp = NULL; + mDrawPoolp = nullptr; } if (mTextureMatrix) { delete mTextureMatrix; - mTextureMatrix = NULL; + mTextureMatrix = nullptr; if (mDrawablep) { @@ -213,10 +213,10 @@ void LLFace::destroy() } } - setDrawInfo(NULL); + setDrawInfo(nullptr); - mDrawablep = NULL; - mVObjp = NULL; + mDrawablep = nullptr; + mVObjp = nullptr; } void LLFace::setWorldMatrix(const LLMatrix4 &mat) @@ -397,7 +397,7 @@ void LLFace::setSize(S32 num_vertices, S32 num_indices, bool align) { mGeomCount = num_vertices; mIndicesCount = num_indices; - mVertexBuffer = NULL; + mVertexBuffer = nullptr; } llassert(verify()); @@ -408,7 +408,7 @@ void LLFace::setGeomIndex(U16 idx) if (mGeomIndex != idx) { mGeomIndex = idx; - mVertexBuffer = NULL; + mVertexBuffer = nullptr; } } @@ -437,7 +437,7 @@ void LLFace::setIndicesIndex(S32 idx) if (mIndicesIndex != idx) { mIndicesIndex = idx; - mVertexBuffer = NULL; + mVertexBuffer = nullptr; } } @@ -499,7 +499,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) { LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE; - if (mDrawablep == NULL || mDrawablep->getSpatialGroup() == NULL) + if (mDrawablep == nullptr || mDrawablep->getSpatialGroup() == nullptr) { return; } @@ -590,7 +590,7 @@ void renderFace(LLDrawable* drawable, LLFace *face) LLVOVolume* vobj = drawable->getVOVolume(); if (vobj) { - LLVolume* volume = NULL; + LLVolume* volume = nullptr; if (drawable->isState(LLDrawable::RIGGED)) { @@ -604,7 +604,7 @@ void renderFace(LLDrawable* drawable, LLFace *face) if (volume) { const LLVolumeFace& vol_face = volume->getVolumeFace(face->getTEOffset()); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mPositions, NULL, vol_face.mNumIndices, vol_face.mIndices); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mPositions, nullptr, vol_face.mNumIndices, vol_face.mIndices); } } } @@ -875,7 +875,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; @@ -2581,7 +2581,7 @@ void LLFace::clearVertexBuffer() LLSculptIDSize::instance().dec(mDrawablep); } - mVertexBuffer = NULL; + mVertexBuffer = nullptr; } S32 LLFace::getRiggedIndex(U32 type) const diff --git a/indra/newview/llface.h b/indra/newview/llface.h index df31e9ea90..4957657522 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -193,7 +193,7 @@ class alignas(16) LLFace 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/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index cce6eeb19d..e10ad012b3 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -84,11 +84,11 @@ S32 get_depth(const BlockTimerStatHandle* blockp) LLFastTimerView::LLFastTimerView(const LLSD& key) : LLFloater(key), - mHoverTimer(NULL), + mHoverTimer(nullptr), mDisplayMode(0), mDisplayType(DISPLAY_TIME), mScrollIndex(0), - mHoverID(NULL), + mHoverID(nullptr), mHoverBarIndex(-1), mStatsIndex(-1), mPauseHistory(false), @@ -169,7 +169,7 @@ BlockTimerStatHandle* LLFastTimerView::getLegendID(S32 y) return ft_display_idx[idx]; } - return NULL; + return nullptr; } bool LLFastTimerView::handleDoubleClick(S32 x, S32 y, MASK mask) @@ -211,7 +211,7 @@ bool LLFastTimerView::handleMouseUp(S32 x, S32 y, MASK mask) { if (hasMouseCapture()) { - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); } return LLFloater::handleMouseUp(x, y, mask);; } @@ -225,8 +225,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)) { @@ -247,7 +247,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 (size_t bar_index = 0, end_index = LLTrace::BlockTimerStatHandle::instance_tracker_t::instanceCount(); bar_index < end_index; @@ -420,7 +420,7 @@ void LLFastTimerView::draw() LLView::draw(); mAllTimeMax = llmax(mAllTimeMax, mRecording.getLastRecording().getSum(FTM_FRAME)); - mHoverID = NULL; + mHoverID = nullptr; mHoverBarIndex = -1; } @@ -434,7 +434,7 @@ void LLFastTimerView::onOpen(const LLSD& key) ++it) { delete []it->mBars; - it->mBars = NULL; + it->mBars = nullptr; } } @@ -1066,7 +1066,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) @@ -1146,7 +1146,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; @@ -1557,7 +1557,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 e0ef52f166..6e85b9bc5e 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -108,7 +108,7 @@ class LLFastTimerView : public LLFloater TimerBarRow() : mBottom(0), mTop(0), - mBars(NULL) + mBars(nullptr) {} S32 mBottom, mTop; diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 377710c170..16356dd517 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -417,8 +417,8 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) mContextMenuHandle(), mImageDragIndication(p.image_drag_indication), mShowDragMarker(false), - mLandingTab(NULL), - mLastTab(NULL), + mLandingTab(nullptr), + mLastTab(nullptr), mItemsListDirty(false), mUpdateDropDownItems(true), mRestoreOverflowMenu(false), @@ -521,15 +521,15 @@ bool LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, if (mLastTab && (x >= mLastTab->getRect().mRight)) { /* - * the condition dest == NULL can be satisfied not only in the case + * the condition dest == nullptr can be satisfied not only in the case * of dragging to the right from the last tab of the favbar. there is a * small gap between each tab. if the user drags something exactly there - * then mLandingTab will be set to NULL and the dragged item will be pushed + * then mLandingTab will be set to nullptr and the dragged item will be pushed * to the end of the favorites bar. this is incorrect behavior. that's why * we need an additional check which excludes the case described previously * making sure that the mouse pointer is beyond the last tab. */ - setLandingTab(NULL); + setLandingTab(nullptr); } } } @@ -579,8 +579,8 @@ bool LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, { if (mItems.empty()) { - setLandingTab(NULL); - mLastTab = NULL; + setLandingTab(nullptr); + mLastTab = nullptr; } handleNewFavoriteDragAndDrop(item, favorites_id, x, y); } @@ -935,7 +935,7 @@ void LLFavoritesBarCtrl::updateButtons(bool force_update) if(mItems.empty()) { mBarLabel->setVisible(true); - mLastTab = NULL; + mLastTab = nullptr; } else { @@ -984,7 +984,7 @@ void LLFavoritesBarCtrl::updateButtons(bool force_update) { if (mLastTab == button) { - mLastTab = NULL; + mLastTab = nullptr; } removeChild(button); delete button; @@ -1012,7 +1012,7 @@ void LLFavoritesBarCtrl::updateButtons(bool force_update) } } //last_right_edge is saving coordinates - LLButton* last_new_button = NULL; + LLButton* last_new_button = nullptr; int j = first_changed_item_index; for (; j < mItems.size(); j++) { @@ -1082,19 +1082,19 @@ LLButton* LLFavoritesBarCtrl::createButton(const LLPointergetWidth(item->getName()) + 20; int width = required_width > def_button_width? def_button_width : required_width; - LLFavoriteLandmarkButton* fav_btn = NULL; + LLFavoriteLandmarkButton* fav_btn = nullptr; // do we have a place for next button + double buttonHGap + mMoreTextBox ? if(curr_x + width + 2*button_x_delta + mMoreTextBox->getRect().getWidth() > getRect().mRight ) { - return NULL; + return nullptr; } LLButton::Params fav_btn_params(button_params); fav_btn = LLUICtrlFactory::create(fav_btn_params); - if (NULL == fav_btn) + if (nullptr == fav_btn) { LL_WARNS("FavoritesBar") << "Unable to create LLFavoriteLandmarkButton widget: " << item->getName() << LL_ENDL; - return NULL; + return nullptr; } addChild(fav_btn); @@ -1356,7 +1356,7 @@ void LLFavoritesBarCtrl::onButtonRightClick( LLUUID item_id,LLView* fav_button,S // Release mouse capture so hover events go to the popup menu // because this is happening during a mouse down. - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); menu->updateParent(LLMenuGL::sMenuContainer); LLMenuGL::showPopup(fav_button, menu, x, y); @@ -1364,7 +1364,7 @@ void LLFavoritesBarCtrl::onButtonRightClick( LLUUID item_id,LLView* fav_button,S bool LLFavoritesBarCtrl::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); @@ -1548,7 +1548,7 @@ void LLFavoritesBarCtrl::pasteFromClipboard() const LLInventoryModel* model = &gInventory; if(model && isClipboardPasteable()) { - LLInventoryItem* item = NULL; + LLInventoryItem* item = nullptr; std::vector objects; LLClipboard::instance().pasteFromClipboard(objects); auto count = objects.size(); @@ -1564,7 +1564,7 @@ void LLFavoritesBarCtrl::pasteFromClipboard() const item->getUUID(), parent_id, std::string(), - LLPointer(NULL)); + LLPointer(nullptr)); } } } @@ -1631,7 +1631,7 @@ bool LLFavoritesBarCtrl::handleHover(S32 x, S32 y, MASK mask) LLUICtrl* LLFavoritesBarCtrl::findChildByLocalCoords(S32 x, S32 y) { - LLUICtrl* ctrl = NULL; + LLUICtrl* ctrl = nullptr; const child_list_t* list = getChildList(); for (child_list_const_iter_t i = list->begin(); i != list->end(); ++i) diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 5ff8938a47..ba6a3ac10b 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) @@ -307,7 +307,7 @@ bool LLFeatureManager::parseFeatureTable(std::string filename) mTableVersion = version; LL_INFOS("RenderInit") << "Found feature table version " << version << LL_ENDL; - LLFeatureList *flp = NULL; + LLFeatureList *flp = nullptr; bool parse_ok = true; while (parse_ok && file >> name ) { @@ -601,7 +601,7 @@ void LLFeatureManager::applyFeatures(bool skipFeatures) // get the control setting LLControlVariable* ctrl = gSavedSettings.getControl(mIt->first); - if(ctrl == NULL) + if(ctrl == nullptr) { LL_WARNS("RenderInit") << "AHHH! Control setting " << mIt->first << " does not exist!" << LL_ENDL; continue; @@ -655,7 +655,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; @@ -818,7 +818,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("RenderInit") << "AHHH! Control setting " << mIt->first << " does not exist!" << LL_ENDL; continue; diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 2c5c6900d3..7369a98f27 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -84,23 +84,23 @@ LLFilePicker::LLFilePicker() #if LL_WINDOWS && !LL_SDL_WINDOW 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'; #elif LL_DARWIN && !LL_SDL_WINDOW mPickOptions = 0; @@ -869,7 +869,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/llfilepicker.h b/indra/newview/llfilepicker.h index 5a4da61cca..c184e90441 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -36,6 +36,7 @@ #include "stdtypes.h" #include +#include #if LL_DARWIN #include @@ -44,11 +45,10 @@ #undef verify #undef check #undef require +#endif #include "llstring.h" -#endif - // Need commdlg.h for OPENFILENAMEA #ifdef LL_WINDOWS #include "llwin32headers.h" @@ -119,7 +119,7 @@ class LLFilePicker const std::string getFirstFile(); // getNextFile() increments the internal representation and - // returns the next file specified by the user. Returns NULL when + // returns the next file specified by the user. Returns nullptr when // no more files are left. Further calls to getNextFile() are // undefined. const std::string getNextFile(); diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index 8897ad55e0..3e029c83f4 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -252,7 +252,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 958bf9029c..58512e7823 100644 --- a/indra/newview/llflexibleobject.h +++ b/indra/newview/llflexibleobject.h @@ -141,7 +141,7 @@ class LLVolumeImplFlexible : public LLVolumeInterface //-------------------------------------- // 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/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index a87ddfd76e..4c4f7b586e 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -137,7 +137,7 @@ void LLFloaterAuction::initialize() } mImageID.setNull(); - mImage = NULL; + mImage = nullptr; } void LLFloaterAuction::draw() @@ -273,7 +273,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/llfloaterautoreplacesettings.cpp b/indra/newview/llfloaterautoreplacesettings.cpp index d93bd624f5..754c0ba8ea 100644 --- a/indra/newview/llfloaterautoreplacesettings.cpp +++ b/indra/newview/llfloaterautoreplacesettings.cpp @@ -69,11 +69,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/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index c7851013c7..3633bdf28c 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; @@ -117,7 +117,7 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key) bool LLFloaterAvatarPicker::postBuild() { - getChild("Edit")->setKeystrokeCallback( boost::bind(&LLFloaterAvatarPicker::editKeystroke, this, _1, _2),NULL); + getChild("Edit")->setKeystrokeCallback( boost::bind(&LLFloaterAvatarPicker::editKeystroke, this, _1, _2), nullptr); childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this)); getChildView("Find")->setEnabled(false); @@ -222,7 +222,7 @@ void LLFloaterAvatarPicker::onBtnSelect() if(mSelectionCallback) { std::string acvtive_panel_name; - LLScrollListCtrl* list = NULL; + LLScrollListCtrl* list = nullptr; LLPanel* active_panel = getChild("ResidentChooserTabs")->getCurrentPanel(); if(active_panel) { @@ -289,7 +289,7 @@ void LLFloaterAvatarPicker::populateNearMe() near_me_scroller->deleteAllItems(); uuid_vec_t avatar_ids; - LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); + LLWorld::getInstance()->getAvatars(&avatar_ids, nullptr, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); for(U32 i=0; i("ResidentChooserTabs")->getCurrentPanel(); if(active_panel) { @@ -656,9 +656,9 @@ bool LLFloaterAvatarPicker::handleDragAndDrop(S32 x, S32 y, MASK mask, void LLFloaterAvatarPicker::openFriendsTab() { LLTabContainer* tab_container = getChild("ResidentChooserTabs"); - if (tab_container == NULL) + if (tab_container == nullptr) { - llassert(tab_container != NULL); + llassert(tab_container != nullptr); return; } @@ -683,7 +683,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* LLFloaterAvatarPicker* floater = LLFloaterReg::findTypedInstance("avatar_picker"); // floater is closed or these are not results from our last request - if (NULL == floater || query_id != floater->mQueryID) + if (nullptr == floater || query_id != floater->mQueryID) { return; } @@ -851,7 +851,7 @@ bool LLFloaterAvatarPicker::isSelectBtnEnabled() if ( ret_val && !isMinimized()) { std::string acvtive_panel_name; - LLScrollListCtrl* list = NULL; + LLScrollListCtrl* list = nullptr; LLPanel* active_panel = getChild("ResidentChooserTabs")->getCurrentPanel(); if(active_panel) diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 1761497f83..46e73d01be 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -50,7 +50,7 @@ class LLFloaterAvatarPicker :public LLFloater bool closeOnSelect = false, bool skip_agent = false, const std::string& name = "", - LLView * frustumOrigin = NULL); + LLView * frustumOrigin = nullptr); LLFloaterAvatarPicker(const LLSD& key); virtual ~LLFloaterAvatarPicker(); diff --git a/indra/newview/llfloateravatarrendersettings.cpp b/indra/newview/llfloateravatarrendersettings.cpp index 9101e6eb29..b56c7ed65f 100644 --- a/indra/newview/llfloateravatarrendersettings.cpp +++ b/indra/newview/llfloateravatarrendersettings.cpp @@ -70,7 +70,7 @@ static LLAvatarRenderMuteListObserver sAvatarRenderMuteListObserver; LLFloaterAvatarRenderSettings::LLFloaterAvatarRenderSettings(const LLSD& key) : LLFloater(key), - mAvatarSettingsList(NULL), + mAvatarSettingsList(nullptr), mNeedsUpdate(false) { mContextMenu = new LLSettingsContextMenu(this); @@ -153,7 +153,7 @@ static LLVOAvatar* find_avatar(const LLUUID& id) } else { - return NULL; + return nullptr; } } diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp index b85e3cb267..5a21f3860d 100644 --- a/indra/newview/llfloateravatartextures.cpp +++ b/indra/newview/llfloateravatartextures.cpp @@ -125,7 +125,7 @@ static LLVOAvatar* find_avatar(const LLUUID& id) } else { - return NULL; + return nullptr; } } diff --git a/indra/newview/llfloaterbanduration.cpp b/indra/newview/llfloaterbanduration.cpp index eb32e50901..dab4940dca 100644 --- a/indra/newview/llfloaterbanduration.cpp +++ b/indra/newview/llfloaterbanduration.cpp @@ -53,7 +53,7 @@ LLFloaterBanDuration* LLFloaterBanDuration::show(select_callback_t callback, uui if (!floater) { LL_WARNS() << "Cannot instantiate ban duration floater" << LL_ENDL; - return NULL; + return nullptr; } floater->mSelectionCallback = callback; diff --git a/indra/newview/llfloaterbigpreview.cpp b/indra/newview/llfloaterbigpreview.cpp index ba682494bb..0320433b5f 100644 --- a/indra/newview/llfloaterbigpreview.cpp +++ b/indra/newview/llfloaterbigpreview.cpp @@ -35,8 +35,8 @@ /////////////////////// LLFloaterBigPreview::LLFloaterBigPreview(const LLSD& key) : LLFloater(key), - mPreviewPlaceholder(NULL), - mFloaterOwner(NULL) + mPreviewPlaceholder(nullptr), + mFloaterOwner(nullptr) { } diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index 7d2d836689..8b2d2cee00 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -186,7 +186,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(); if (!floater->mSelectionUpdateSlot.connected()) diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index ae4dfb8d42..3318ef2248 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/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index e41f893c43..d22176da35 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -291,7 +291,7 @@ void LLFloaterBuyCurrencyUI::onClickCancel() LLStatusBar::sendMoneyBalanceRequest(); } -LLFetchAvatarPaymentInfo* LLFloaterBuyCurrency::sPropertiesRequest = NULL; +LLFetchAvatarPaymentInfo* LLFloaterBuyCurrency::sPropertiesRequest = nullptr; // static void LLFloaterBuyCurrency::buyCurrency() @@ -311,7 +311,7 @@ void LLFloaterBuyCurrency::buyCurrency(const std::string& name, S32 price) void LLFloaterBuyCurrency::handleBuyCurrency(bool has_piof, bool has_target, const std::string name, S32 price) { delete sPropertiesRequest; - sPropertiesRequest = NULL; + sPropertiesRequest = nullptr; if (has_piof) { diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index a38cc94328..008e56a1b8 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -836,7 +836,7 @@ void LLFloaterBuyLandUI::updateGroupName(const LLUUID& id, void LLFloaterBuyLandUI::startTransaction(TransactionType type, const LLSD& params) { delete mTransaction; - mTransaction = NULL; + mTransaction = nullptr; mTransactionType = type; @@ -876,7 +876,7 @@ bool LLFloaterBuyLandUI::checkTransaction() return false; } - if (mTransaction->status(NULL) != LLXMLRPCTransaction::StatusComplete) + if (mTransaction->status(nullptr) != LLXMLRPCTransaction::StatusComplete) { tellUserError(mTransaction->statusMessage(), mTransaction->statusURI()); } @@ -890,7 +890,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 3acf28044c..36cfb2d62c 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -190,8 +190,8 @@ std::map> LLFloaterBvhPreview::getJointAli //----------------------------------------------------------------------------- bool LLFloaterBvhPreview::postBuild() { - LLKeyframeMotion* motionp = NULL; - LLBVHLoader* loaderp = NULL; + LLKeyframeMotion* motionp = nullptr; + LLBVHLoader* loaderp = nullptr; if (!LLFloaterNameDesc::postBuild()) { @@ -233,7 +233,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()) { @@ -344,7 +344,7 @@ bool LLFloaterBvhPreview::postBuild() } else { - mAnimPreview = NULL; + mAnimPreview = nullptr; mMotionID.setNull(); getChild("bad_animation_text")->setValue(getString("failed_to_initialize")); } @@ -370,7 +370,7 @@ bool LLFloaterBvhPreview::postBuild() //setEnabled(false); mMotionID.setNull(); - mAnimPreview = NULL; + mAnimPreview = nullptr; } refresh(); @@ -385,7 +385,7 @@ bool LLFloaterBvhPreview::postBuild() //----------------------------------------------------------------------------- LLFloaterBvhPreview::~LLFloaterBvhPreview() { - mAnimPreview = NULL; + mAnimPreview = nullptr; setEnabled(false); } @@ -474,7 +474,7 @@ void LLFloaterBvhPreview::resetMotion() } else { - mPauseRequest = NULL; + mPauseRequest = nullptr; } } @@ -598,11 +598,11 @@ void LLFloaterBvhPreview::onBtnPlay() if (!avatarp->isMotionActive(mMotionID)) { resetMotion(); - mPauseRequest = NULL; + mPauseRequest = nullptr; } else if (avatarp->areAnimationsPaused()) { - mPauseRequest = NULL; + mPauseRequest = nullptr; } } } @@ -694,7 +694,7 @@ void LLFloaterBvhPreview::onCommitBaseAnim() if (!paused) { - mPauseRequest = NULL; + mPauseRequest = nullptr; } } } diff --git a/indra/newview/llfloaterchangeitemthumbnail.cpp b/indra/newview/llfloaterchangeitemthumbnail.cpp index fb31361fd9..4417d386ae 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.cpp +++ b/indra/newview/llfloaterchangeitemthumbnail.cpp @@ -300,11 +300,11 @@ LLInventoryObject* LLFloaterChangeItemThumbnail::getInventoryObject() { if (mItemList.size() == 0) { - return NULL; + return nullptr; } const LLUUID item_id = *mItemList.begin(); - LLInventoryObject* obj = NULL; + LLInventoryObject* obj = nullptr; if (mTaskId.isNull()) { // it is in agent inventory @@ -323,7 +323,7 @@ LLInventoryObject* LLFloaterChangeItemThumbnail::getInventoryObject() { if (!mObserverInitialized) { - registerVOInventoryListener(object, NULL); + registerVOInventoryListener(object, nullptr); mObserverInitialized = false; } @@ -693,7 +693,7 @@ void LLFloaterChangeItemThumbnail::assignAndValidateAsset(const LLUUID &asset_id false, false, (void*)data, - NULL, + nullptr, false); } else @@ -867,7 +867,7 @@ void LLFloaterChangeItemThumbnail::showTexturePicker(const LLUUID &thumbnail_id) PERM_NONE, PERM_NONE, false, - NULL, + nullptr, PICK_TEXTURE); mPickerHandle = floaterp->getHandle(); @@ -984,7 +984,7 @@ void LLFloaterChangeItemThumbnail::onTexturePickerCommit() true, false, (void*)data, - NULL, + nullptr, false); texturep->forceToSaveRawImage(0); } @@ -1084,12 +1084,12 @@ void LLFloaterChangeItemThumbnail::setThumbnailId(const LLUUID& new_thumbnail_id LLViewerInventoryCategory* view_folder = dynamic_cast(obj); if (view_folder) { - update_inventory_category(inv_obj_id, updates, NULL); + update_inventory_category(inv_obj_id, updates, nullptr); } LLViewerInventoryItem* view_item = dynamic_cast(obj); if (view_item) { - update_inventory_item(inv_obj_id, updates, NULL); + update_inventory_item(inv_obj_id, updates, nullptr); } } } diff --git a/indra/newview/llfloaterchatmentionpicker.cpp b/indra/newview/llfloaterchatmentionpicker.cpp index a3eb286375..6719d570a4 100644 --- a/indra/newview/llfloaterchatmentionpicker.cpp +++ b/indra/newview/llfloaterchatmentionpicker.cpp @@ -35,7 +35,7 @@ LLUUID LLFloaterChatMentionPicker::sSessionID(LLUUID::null); LLFloaterChatMentionPicker::LLFloaterChatMentionPicker(const LLSD& key) -: LLFloater(key), mAvatarList(NULL) +: LLFloater(key), mAvatarList(nullptr) { // This floater should hover on top of our dependent (with the dependent having the focus) setFocusStealsFrontmost(false); diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index cd45093856..77a6fd85f7 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -89,7 +89,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 ), @@ -276,7 +276,7 @@ void LLFloaterColorPicker::destroyUI () { this->removeChild ( mSwatchView ); mSwatchView->die();; - mSwatchView = NULL; + mSwatchView = nullptr; } } @@ -1011,7 +1011,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/llfloaterconversationlog.cpp b/indra/newview/llfloaterconversationlog.cpp index 97399c9cf7..11f0c9f03f 100644 --- a/indra/newview/llfloaterconversationlog.cpp +++ b/indra/newview/llfloaterconversationlog.cpp @@ -33,7 +33,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)); @@ -69,7 +69,7 @@ bool LLFloaterConversationLog::postBuild() void LLFloaterConversationLog::draw() { - mConversationsGearBtn->setEnabled(mConversationLogList->getSelectedItem() != NULL); + mConversationsGearBtn->setEnabled(mConversationLogList->getSelectedItem() != nullptr); LLFloater::draw(); } diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 6f5d81eda3..b4f89167e5 100644 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -41,7 +41,7 @@ const S32 CONVERSATION_HISTORY_PAGE_SIZE = 100; LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_id) : LLFloater(session_id), - mChatHistory(NULL), + mChatHistory(nullptr), mSessionID(session_id.asUUID()), mCurrentPage(0), mPageSize(CONVERSATION_HISTORY_PAGE_SIZE), @@ -49,7 +49,7 @@ LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_i mCompleteName(session_id[LL_FCP_COMPLETE_NAME]), mMutex(), mShowHistory(false), - mMessages(NULL), + mMessages(nullptr), mHistoryThreadsBusy(false), mIsGroup(false), mOpened(false) @@ -204,7 +204,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/llfloatercreatelandmark.cpp b/indra/newview/llfloatercreatelandmark.cpp index de84ce0e00..f7b76808a6 100644 --- a/indra/newview/llfloatercreatelandmark.cpp +++ b/indra/newview/llfloatercreatelandmark.cpp @@ -107,7 +107,7 @@ class LLLandmarksInventoryObserver : public LLInventoryObserver LLFloaterCreateLandmark::LLFloaterCreateLandmark(const LLSD& key) : LLFloater("add_landmark"), - mItem(NULL) + mItem(nullptr) { mInventoryObserver = new LLLandmarksInventoryObserver(this); } @@ -148,7 +148,7 @@ void LLFloaterCreateLandmark::onOpen(const LLSD& key) { dest_folder = key["dest_folder"].asUUID(); } - mItem = NULL; + mItem = nullptr; gInventory.addObserver(mInventoryObserver); setLandmarkInfo(dest_folder); populateFoldersList(dest_folder); @@ -363,7 +363,7 @@ void LLFloaterCreateLandmark::onCancelClicked() if (!mItem.isNull()) { LLUUID item_id = mItem->getUUID(); - remove_inventory_item(item_id, NULL); + remove_inventory_item(item_id, nullptr); } closeFloater(); } diff --git a/indra/newview/llfloatereditenvironmentbase.cpp b/indra/newview/llfloatereditenvironmentbase.cpp index a42c94f049..48134031fa 100644 --- a/indra/newview/llfloatereditenvironmentbase.cpp +++ b/indra/newview/llfloatereditenvironmentbase.cpp @@ -144,7 +144,7 @@ void LLFloaterEditEnvironmentBase::loadInventoryItem(const LLUUID &inventoryId, if (mInventoryItem->getAssetUUID().isNull()) { - LL_WARNS("ENVIRONMENT") << "Asset ID in inventory item is NULL (" << mInventoryId << ")" << LL_ENDL; + LL_WARNS("ENVIRONMENT") << "Asset ID in inventory item is nullptr (" << mInventoryId << ")" << LL_ENDL; LLNotificationsUtil::add("UnableEditItem"); closeFloater(); diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index 0a8b8d321d..93e9c48afc 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -221,7 +221,7 @@ bool LLFloaterEditExtDayCycle::postBuild() mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BTN_SAVE, BTN_FLYOUT, XML_FLYOUTMENU_FILE, false); mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD&) { onButtonApply(ctrl); }); - mNameEditor->setKeystrokeCallback([this](LLLineEditor*, void*) { onNameKeystroke(); }, NULL); + mNameEditor->setKeystrokeCallback([this](LLLineEditor*, void*) { onNameKeystroke(); }, nullptr); mCancelButton->setCommitCallback([this](LLUICtrl*, const LLSD&) { onClickCloseBtn(); }); mTimeSlider->setCommitCallback([this](LLUICtrl*, const LLSD&) { onTimeSliderCallback(); }); mAddFrameButton->setCommitCallback([this](LLUICtrl*, const LLSD&) { onAddFrame(); }); @@ -1111,12 +1111,12 @@ void LLFloaterEditExtDayCycle::clearTabs() // Note: If this doesn't look good, init panels with default settings. It might be better looking if (mCurrentTrack == LLSettingsDay::TRACK_WATER) { - const LLSettingsWaterPtr_t p_water = LLSettingsWaterPtr_t(NULL); + const LLSettingsWaterPtr_t p_water = LLSettingsWaterPtr_t(nullptr); updateWaterTabs(p_water); } else { - const LLSettingsSkyPtr_t p_sky = LLSettingsSkyPtr_t(NULL); + const LLSettingsSkyPtr_t p_sky = LLSettingsSkyPtr_t(nullptr); updateSkyTabs(p_sky); } updateButtons(); diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp index 85d3b27f22..3988e71645 100644 --- a/indra/newview/llfloaterevent.cpp +++ b/indra/newview/llfloaterevent.cpp @@ -60,7 +60,7 @@ LLFloaterEvent::LLFloaterEvent(const LLSD& key) : LLFloater(key), LLViewerMediaObserver(), - mBrowser(NULL), + mBrowser(nullptr), mEventID(0) { } diff --git a/indra/newview/llfloaterexperiencepicker.cpp b/indra/newview/llfloaterexperiencepicker.cpp index 721ffd30a0..a4d8cc88bf 100644 --- a/indra/newview/llfloaterexperiencepicker.cpp +++ b/indra/newview/llfloaterexperiencepicker.cpp @@ -51,7 +51,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) @@ -86,7 +86,7 @@ void LLFloaterExperiencePicker::draw() LLFloaterExperiencePicker::LLFloaterExperiencePicker( const LLSD& key ) :LLFloater(key) - ,mSearchPanel(NULL) + ,mSearchPanel(nullptr) ,mContextConeOpacity(0.f) ,mContextConeInAlpha(CONTEXT_CONE_IN_ALPHA) ,mContextConeOutAlpha(CONTEXT_CONE_OUT_ALPHA) diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp index eb4976fc9e..c5a2489140 100644 --- a/indra/newview/llfloaterexperienceprofile.cpp +++ b/indra/newview/llfloaterexperienceprofile.cpp @@ -170,13 +170,13 @@ bool LLFloaterExperienceProfile::postBuild() getChild(EDIT TF_DESC)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this)); getChild(EDIT TF_MATURITY)->setCommitCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this)); - getChild(EDIT TF_MRKT)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), NULL); - getChild(EDIT TF_NAME)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), NULL); + getChild(EDIT TF_MRKT)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), nullptr); + getChild(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(EDIT TF_DESC)->setCommitOnFocusLost(true); diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 21ae98d380..5a33fae4f2 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -102,7 +102,7 @@ class GestureCopiedCallback : public LLInventoryCallback { if(mFloater) { - mFloater->addGesture(inv_item,NULL,mFloater->getChild("gesture_list")); + mFloater->addGesture(inv_item, nullptr, mFloater->getChild("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) @@ -183,7 +183,7 @@ LLFloaterGesture::~LLFloaterGesture() { LLGestureMgr::instance().removeObserver(mObserver); delete mObserver; - mObserver = NULL; + mObserver = nullptr; gInventory.removeObserver(this); } @@ -288,7 +288,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); } } } @@ -578,7 +578,7 @@ void LLFloaterGesture::onGestureRename(const LLSD& notification, const LLSD& res { LLSD updates; updates["name"] = new_name; - update_inventory_item(item_id, updates, NULL); + update_inventory_item(item_id, updates, nullptr); } } } diff --git a/indra/newview/llfloatergesture.h b/indra/newview/llfloatergesture.h index 8116246f31..85a20d4a56 100644 --- a/indra/newview/llfloatergesture.h +++ b/indra/newview/llfloatergesture.h @@ -62,7 +62,7 @@ class LLFloaterGesture /** * @brief Add new scrolllistitem into gesture_list. * @param item_id inventory id of gesture - * @param gesture can be NULL , if item was not loaded yet + * @param gesture can be nullptr , if item was not loaded yet */ void addGesture(const LLUUID& item_id, LLMultiGesture* gesture, LLCtrlListInterface * list); diff --git a/indra/newview/llfloatergltfasseteditor.cpp b/indra/newview/llfloatergltfasseteditor.cpp index a127f5d43e..b6303b4eeb 100644 --- a/indra/newview/llfloatergltfasseteditor.cpp +++ b/indra/newview/llfloatergltfasseteditor.cpp @@ -56,7 +56,7 @@ LLFloaterGLTFAssetEditor::~LLFloaterGLTFAssetEditor() { mItemListPanel->removeChild(mScroller); delete mScroller; - mScroller = NULL; + mScroller = nullptr; } } @@ -129,7 +129,7 @@ void LLFloaterGLTFAssetEditor::initFolderRoot() p.tool_tip = p.name; p.listener = base_item; p.view_model = &mGLTFViewModel; - p.root = NULL; + p.root = nullptr; p.use_ellipses = true; p.options_menu = "menu_gltf.xml"; // *TODO : create this or fix to be optional mFolderRoot = LLUICtrlFactory::create(p); @@ -272,7 +272,7 @@ void LLFloaterGLTFAssetEditor::loadFromSelection() return; } - LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(NULL); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(nullptr); LLViewerObject* objectp = node->getObject(); if (!objectp) { @@ -357,7 +357,7 @@ void LLFloaterGLTFAssetEditor::dirty() return; } - LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(NULL); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(nullptr); if (!node) { // not yet updated? diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 6c1d5b5cca..108b48e4ec 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -552,7 +552,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(); } } @@ -1168,7 +1168,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; @@ -1346,7 +1346,7 @@ void LLPanelRequestTools::sendRequest(const LLHost& host) host, false, terrain_download_done, - NULL); + nullptr); } else { diff --git a/indra/newview/llfloatergotoline.cpp b/indra/newview/llfloatergotoline.cpp index 09ca0ab530..1ccdff2508 100644 --- a/indra/newview/llfloatergotoline.cpp +++ b/indra/newview/llfloatergotoline.cpp @@ -33,11 +33,11 @@ #include "llscripteditor.h" #include "llviewerwindow.h" -LLFloaterGotoLine* LLFloaterGotoLine::sInstance = NULL; +LLFloaterGotoLine* LLFloaterGotoLine::sInstance = nullptr; LLFloaterGotoLine::LLFloaterGotoLine(LLScriptEdCore* editor_core) : LLFloater(LLSD()), - mGotoBox(NULL), + mGotoBox(nullptr), mEditorCore(editor_core) { buildFromFile("floater_goto_line.xml"); @@ -90,7 +90,7 @@ void LLFloaterGotoLine::show(LLScriptEdCore* editor_core) LLFloaterGotoLine::~LLFloaterGotoLine() { - sInstance = NULL; + sInstance = nullptr; } // static diff --git a/indra/newview/llfloatergroupbulkban.cpp b/indra/newview/llfloatergroupbulkban.cpp index f0d91fc89b..a1800aa55f 100644 --- a/indra/newview/llfloatergroupbulkban.cpp +++ b/indra/newview/llfloatergroupbulkban.cpp @@ -35,7 +35,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); @@ -108,7 +108,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); @@ -123,7 +123,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 2a2cced03b..df074aeb19 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 78a5b4376f..5b5cc8bfda 100644 --- a/indra/newview/llfloatergroupinvite.cpp +++ b/indra/newview/llfloatergroupinvite.cpp @@ -55,7 +55,7 @@ std::map LLFloaterGroupInvite::impl::sInstances; LLFloaterGroupInvite::impl::impl(const LLUUID& group_id) : mGroupID(group_id), - mInvitePanelp(NULL) + mInvitePanelp(nullptr) { } @@ -124,7 +124,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); if (request_update) { @@ -148,7 +148,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 f898816881..141b19a476 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, bool request_update = true); + static void showForGroup(const LLUUID &group_id, uuid_vec_t *agent_ids = nullptr, bool request_update = true); protected: LLFloaterGroupInvite(const LLUUID& group_id = LLUUID::null); diff --git a/indra/newview/llfloaterhandler.cpp b/indra/newview/llfloaterhandler.cpp index 5823ad3e41..3a0defe206 100644 --- a/indra/newview/llfloaterhandler.cpp +++ b/indra/newview/llfloaterhandler.cpp @@ -34,7 +34,7 @@ LLFloaterHandler gFloaterHandler; LLFloater* get_parent_floater(LLView* view) { - LLFloater* floater = NULL; + LLFloater* floater = nullptr; LLView* parent = view->getParent(); while (parent) { @@ -52,7 +52,7 @@ LLFloater* get_parent_floater(LLView* view) bool LLFloaterHandler::handle(const LLSD ¶ms, const LLSD &query_map, const std::string& grid, LLMediaCtrl *web) { if (params.size() < 1) return false; - LLFloater* floater = NULL; + LLFloater* floater = nullptr; // *TODO: implement floater lookup by name if (params[0].asString() == "destinations") diff --git a/indra/newview/llfloaterhoverheight.cpp b/indra/newview/llfloaterhoverheight.cpp index ef3e306da9..3901160f56 100644 --- a/indra/newview/llfloaterhoverheight.cpp +++ b/indra/newview/llfloaterhoverheight.cpp @@ -63,7 +63,7 @@ bool LLFloaterHoverHeight::postBuild() sldrCtrl->setMaxValue(MAX_HOVER_Z); sldrCtrl->setSliderMouseUpCallback(boost::bind(&LLFloaterHoverHeight::onFinalCommit,this)); sldrCtrl->setSliderEditorCommitCallback(boost::bind(&LLFloaterHoverHeight::onFinalCommit,this)); - childSetCommitCallback("HoverHeightSlider", &LLFloaterHoverHeight::onSliderMoved, NULL); + childSetCommitCallback("HoverHeightSlider", &LLFloaterHoverHeight::onSliderMoved, nullptr); // Initialize slider from pref setting. syncFromPreferenceSetting(this); diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index bbff3e4c86..d722cafceb 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -81,11 +81,11 @@ const S32 PREVIEW_TEXTURE_HEIGHT = 320; LLFloaterImagePreview::LLFloaterImagePreview(const LLSD& args) : LLFloaterNameDesc(args), - mAvatarPreview(NULL), - mSculptedPreview(NULL), + mAvatarPreview(nullptr), + mSculptedPreview(nullptr), mLastMouseX(0), mLastMouseY(0), - mImagep(NULL) + mImagep(nullptr) { loadImage(mFilenameAndPath); } @@ -115,7 +115,7 @@ bool LLFloaterImagePreview::postBuild() getChildView("bad_image_text")->setVisible(false); - if (mRawImagep.notNull() && gAgent.getRegion() != NULL) + if (mRawImagep.notNull() && gAgent.getRegion() != nullptr) { mAvatarPreview = new LLImagePreviewAvatar(256, 256); mAvatarPreview->setPreviewTarget("mPelvis", "mUpperBodyMesh0", mRawImagep, 2.f, false); @@ -134,8 +134,8 @@ bool LLFloaterImagePreview::postBuild() } else { - mAvatarPreview = NULL; - mSculptedPreview = NULL; + mAvatarPreview = nullptr; + mSculptedPreview = nullptr; getChildView("bad_image_text")->setVisible(true); getChildView("clothing_type_combo")->setEnabled(false); getChildView("ok_btn")->setEnabled(false); @@ -167,8 +167,8 @@ LLFloaterImagePreview::~LLFloaterImagePreview() { clearAllPreviewTextures(); - mRawImagep = NULL; - mImagep = NULL ; + mRawImagep = nullptr; + mImagep = nullptr ; } //static @@ -702,8 +702,8 @@ void LLFloaterImagePreview::onMouseCaptureLostImagePreview(LLMouseHandler* handl LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, false) { mNeedsUpdate = true; - mTargetJoint = NULL; - mTargetMesh = NULL; + mTargetJoint = nullptr; + mTargetMesh = nullptr; mCameraDistance = 0.f; mCameraYaw = 0.f; mCameraPitch = 0.f; diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index a0f2dbe197..541701d576 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -68,8 +68,8 @@ const F32 EVENTS_PER_IDLE_LOOP_MIN_PERCENTAGE = 0.01f; // process a minimum of 1 // LLFloaterIMContainer::LLFloaterIMContainer(const LLSD& seed, const Params& params /*= getDefaultParams()*/) : LLMultiFloater(seed, params), - mExpandCollapseBtn(NULL), - mConversationsRoot(NULL), + mExpandCollapseBtn(nullptr), + mConversationsRoot(nullptr), mConversationsEventStream("ConversationsEvents"), mInitialized(false), mIsFirstLaunch(true), @@ -172,7 +172,7 @@ LLConversationItem* LLFloaterIMContainer::getSessionModel(const LLUUID& session_ conversations_items_map::iterator iter = mConversationsItems.find(session_id); if (iter == mConversationsItems.end()) { - return NULL; + return nullptr; } else { @@ -231,7 +231,7 @@ bool LLFloaterIMContainer::postBuild() p.tool_tip = p.name; p.listener = base_item; p.view_model = &mConversationViewModel; - p.root = NULL; + p.root = nullptr; p.use_ellipses = true; p.options_menu = "menu_conversation.xml"; mConversationsRoot = LLUICtrlFactory::create(p); @@ -646,7 +646,7 @@ void LLFloaterIMContainer::handleConversationModelEvent(const LLSD& event) { LLConversationItem* item = getSessionModel(session_id); LLConversationItemSession* session_model = dynamic_cast(item); - LLConversationItemParticipant* participant_model = (session_model ? session_model->findParticipant(participant_id) : NULL); + LLConversationItemParticipant* participant_model = (session_model ? session_model->findParticipant(participant_id) : nullptr); LLIMModel::LLIMSession * im_sessionp = LLIMModel::getInstance()->findIMSession(session_id); if (!participant_view && session_model && participant_model) { @@ -705,7 +705,7 @@ void LLFloaterIMContainer::tabClose() void LLFloaterIMContainer::showStub(bool stub_is_visible) { S32 tabCount = 0; - LLPanel * tabPanel = NULL; + LLPanel * tabPanel = nullptr; if(stub_is_visible) { @@ -768,14 +768,14 @@ void LLFloaterIMContainer::setVisible(bool visible) { // Make sure we have the Nearby Chat present when showing the conversation container nearby_chat = LLFloaterReg::findTypedInstance("nearby_chat"); - if ((nearby_chat == NULL) || mIsFirstOpen) + if ((nearby_chat == nullptr) || mIsFirstOpen) { mIsFirstOpen = false; // If not found, force the creation of the nearby chat conversation panel // *TODO: find a way to move this to XML as a default panel or something like that LLSD name("nearby_chat"); LLFloaterReg::toggleInstanceOrBringToFront(name); - selectConversationPair(LLUUID(NULL), false, false); + selectConversationPair(LLUUID(nullptr), false, false); } flashConversationItemWidget(mSelectedSession,false); @@ -1190,7 +1190,7 @@ void LLFloaterIMContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids, bool par const LLConversationItem * LLFloaterIMContainer::getCurSelectedViewModelItem() { - LLConversationItem * conversation_item = NULL; + LLConversationItem * conversation_item = nullptr; if(mConversationsRoot && mConversationsRoot->getCurSelectedItem() && @@ -1215,7 +1215,7 @@ void LLFloaterIMContainer::getParticipantUUIDs(uuid_vec_t& selected_uuids) //Find the conversation floater associated with the selected id const LLConversationItem * conversation_item = getCurSelectedViewModelItem(); - if (NULL == conversation_item) + if (nullptr == conversation_item) { return; } @@ -1412,7 +1412,7 @@ void LLFloaterIMContainer::doToSelected(const LLSD& userdata) const LLConversationItem * conversationItem = getCurSelectedViewModelItem(); uuid_vec_t selected_uuids; - if(conversationItem != NULL) + if(conversationItem != nullptr) { getParticipantUUIDs(selected_uuids); @@ -1657,7 +1657,7 @@ bool LLFloaterIMContainer::checkContextMenuItem(const std::string& item, uuid_ve { const LLSpeaker * speakerp = getSpeakerOfSelectedParticipant(getSpeakerMgrForSelectedParticipant()); - if (NULL != speakerp) + if (nullptr != speakerp) { return !speakerp->mModeratorMutedText; } @@ -1756,7 +1756,7 @@ bool LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool /* floater processing */ - if (NULL != session_floater && !session_floater->isDead()) + if (nullptr != session_floater && !session_floater->isDead()) { if (session_id != getSelectedSession()) { @@ -1849,7 +1849,7 @@ LLConversationItem* LLFloaterIMContainer::addConversationListItem(const LLUUID& } // Create a conversation session model - LLConversationItemSession* item = NULL; + LLConversationItemSession* item = nullptr; LLSpeakerMgr* speaker_manager = (is_nearby_chat ? (LLSpeakerMgr*)(LLLocalSpeakerMgr::getInstance()) : LLIMModel::getInstance()->getSpeakerManager(uuid)); if (speaker_manager) { @@ -1858,10 +1858,10 @@ LLConversationItem* LLFloaterIMContainer::addConversationListItem(const LLUUID& if (!item) { LL_WARNS() << "Couldn't create conversation session item : " << display_name << LL_ENDL; - return NULL; + return nullptr; } item->renameItem(display_name); - item->updateName(NULL); + item->updateName(nullptr); mConversationsItems[uuid] = item; @@ -1923,7 +1923,7 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c // Note : since the mConversationsItems is also the listener to the widget, deleting // the widget will also delete its listener bool is_widget_selected = false; - LLFolderViewItem* new_selection = NULL; + LLFolderViewItem* new_selection = nullptr; LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,uuid); if (widget) { @@ -1956,7 +1956,7 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c if (mConversationsWidgets.size() == 1) { // If only one widget is left, it has to be the Nearby Chat. Select it directly. - selectConversationPair(LLUUID(NULL), true); + selectConversationPair(LLUUID(nullptr), true); } else { @@ -2021,7 +2021,7 @@ bool LLFloaterIMContainer::enableModerateContextMenuItem(const std::string& user } LLSpeaker * speakerp = getSpeakerOfSelectedParticipant(getSpeakerMgrForSelectedParticipant()); - if (NULL == speakerp) + if (nullptr == speakerp) { return false; } @@ -2048,7 +2048,7 @@ bool LLFloaterIMContainer::enableModerateContextMenuItem(const std::string& user bool LLFloaterIMContainer::isGroupModerator() { LLSpeakerMgr * speaker_manager = getSpeakerMgrForSelectedParticipant(); - if (NULL == speaker_manager) + if (nullptr == speaker_manager) { LL_WARNS() << "Speaker manager is missing" << LL_ENDL; return false; @@ -2069,7 +2069,7 @@ bool LLFloaterIMContainer::isGroupModerator() bool LLFloaterIMContainer::haveAbilityToBan() { LLSpeakerMgr * speaker_manager = getSpeakerMgrForSelectedParticipant(); - if (NULL == speaker_manager) + if (nullptr == speaker_manager) { LL_WARNS() << "Speaker manager is missing" << LL_ENDL; return false; @@ -2082,7 +2082,7 @@ bool LLFloaterIMContainer::haveAbilityToBan() bool LLFloaterIMContainer::canBanSelectedMember(const LLUUID& participant_uuid) { LLSpeakerMgr * speaker_manager = getSpeakerMgrForSelectedParticipant(); - if (NULL == speaker_manager) + if (nullptr == speaker_manager) { LL_WARNS() << "Speaker manager is missing" << LL_ENDL; return false; @@ -2129,7 +2129,7 @@ bool LLFloaterIMContainer::canBanSelectedMember(const LLUUID& participant_uuid) void LLFloaterIMContainer::banSelectedMember(const LLUUID& participant_uuid) { LLSpeakerMgr * speaker_manager = getSpeakerMgrForSelectedParticipant(); - if (NULL == speaker_manager) + if (nullptr == speaker_manager) { LL_WARNS() << "Speaker manager is missing" << LL_ENDL; return; @@ -2164,14 +2164,14 @@ void LLFloaterIMContainer::moderateVoice(const std::string& command, const LLUUI bool LLFloaterIMContainer::isMuted(const LLUUID& avatar_id) { const LLSpeaker * speakerp = getSpeakerOfSelectedParticipant(getSpeakerMgrForSelectedParticipant()); - return NULL == speakerp ? true : speakerp->mStatus == LLSpeaker::STATUS_MUTED; + return nullptr == speakerp ? true : speakerp->mStatus == LLSpeaker::STATUS_MUTED; } void LLFloaterIMContainer::moderateVoiceAllParticipants(bool unmute) { LLIMSpeakerMgr * speaker_managerp = dynamic_cast(getSpeakerMgrForSelectedParticipant()); - if (NULL != speaker_managerp) + if (nullptr != speaker_managerp) { if (!unmute) { @@ -2212,7 +2212,7 @@ void LLFloaterIMContainer::moderateVoiceParticipant(const LLUUID& avatar_id, boo { LLIMSpeakerMgr * speaker_managerp = dynamic_cast(getSpeakerMgrForSelectedParticipant()); - if (NULL != speaker_managerp) + if (nullptr != speaker_managerp) { speaker_managerp->moderateVoiceParticipant(avatar_id, unmute); } @@ -2221,15 +2221,15 @@ void LLFloaterIMContainer::moderateVoiceParticipant(const LLUUID& avatar_id, boo LLSpeakerMgr * LLFloaterIMContainer::getSpeakerMgrForSelectedParticipant() { LLFolderViewItem *selectedItem = mConversationsRoot->getCurSelectedItem(); - if (NULL == selectedItem) + if (nullptr == selectedItem) { LL_WARNS() << "Current selected item is null" << LL_ENDL; - return NULL; + return nullptr; } conversations_widgets_map::const_iterator iter = mConversationsWidgets.begin(); conversations_widgets_map::const_iterator end = mConversationsWidgets.end(); - const LLUUID * conversation_uuidp = NULL; + const LLUUID * conversation_uuidp = nullptr; while(iter != end) { if (iter->second == selectedItem || iter->second == selectedItem->getParentFolder()) @@ -2239,10 +2239,10 @@ LLSpeakerMgr * LLFloaterIMContainer::getSpeakerMgrForSelectedParticipant() } ++iter; } - if (NULL == conversation_uuidp) + if (nullptr == conversation_uuidp) { LL_WARNS() << "Cannot find conversation item widget" << LL_ENDL; - return NULL; + return nullptr; } return conversation_uuidp->isNull() ? (LLSpeakerMgr *)LLLocalSpeakerMgr::getInstance() @@ -2251,17 +2251,17 @@ LLSpeakerMgr * LLFloaterIMContainer::getSpeakerMgrForSelectedParticipant() LLSpeaker * LLFloaterIMContainer::getSpeakerOfSelectedParticipant(LLSpeakerMgr * speaker_managerp) { - if (NULL == speaker_managerp) + if (nullptr == speaker_managerp) { LL_WARNS() << "Speaker manager is missing" << LL_ENDL; - return NULL; + return nullptr; } const LLConversationItem * participant_itemp = getCurSelectedViewModelItem(); - if (NULL == participant_itemp) + if (nullptr == participant_itemp) { LL_WARNS() << "Cannot evaluate current selected view model item" << LL_ENDL; - return NULL; + return nullptr; } return speaker_managerp->findSpeaker(participant_itemp->getUUID()); @@ -2270,7 +2270,7 @@ LLSpeaker * LLFloaterIMContainer::getSpeakerOfSelectedParticipant(LLSpeakerMgr * void LLFloaterIMContainer::toggleAllowTextChat(const LLUUID& participant_uuid) { LLIMSpeakerMgr * speaker_managerp = dynamic_cast(getSpeakerMgrForSelectedParticipant()); - if (NULL != speaker_managerp) + if (nullptr != speaker_managerp) { speaker_managerp->toggleAllowTextChat(participant_uuid); } @@ -2335,10 +2335,10 @@ void LLFloaterIMContainer::highlightConversationItemWidget(const LLUUID& session bool LLFloaterIMContainer::isScrolledOutOfSight(LLConversationViewSession* conversation_item_widget) { - llassert(conversation_item_widget != NULL); + llassert(conversation_item_widget != nullptr); // make sure the widget is actually in the right spot first - mConversationsRoot->arrange(NULL, NULL); + mConversationsRoot->arrange(nullptr, nullptr); // check whether the widget is in the visible portion of the scroll container LLRect widget_rect; @@ -2388,7 +2388,7 @@ bool LLFloaterIMContainer::selectNextorPreviousConversation(bool select_next, bo { if (mConversationsWidgets.size() > 1) { - LLFolderViewItem* new_selection = NULL; + LLFolderViewItem* new_selection = nullptr; LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,getSelectedSession()); if (widget) { diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index f0d696361a..f5201629d6 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -98,8 +98,8 @@ bool cb_do_nothing() LLFloaterIMNearbyChat::LLFloaterIMNearbyChat(const LLSD& llsd) : LLFloaterIMSessionTab(LLSD(LLUUID::null)), - //mOutputMonitor(NULL), - mSpeakerMgr(NULL), + //mOutputMonitor(nullptr), + mSpeakerMgr(nullptr), mExpandedHeight(COLLAPSED_HEIGHT + EXPANDED_HEIGHT) { mIsP2PChat = false; @@ -361,8 +361,8 @@ bool LLFloaterIMNearbyChat::isChatVisible() const bool isVisible = false; LLFloaterIMContainer* im_box = LLFloaterIMContainer::getInstance(); // Is the IM floater container ever null? - llassert(im_box != NULL); - if (im_box != NULL) + llassert(im_box != nullptr); + if (im_box != nullptr) { isVisible = isChatMultiTab() && gSavedPerAccountSettings.getBOOL("NearbyChatIsNotTornOff")? @@ -376,7 +376,7 @@ bool LLFloaterIMNearbyChat::isChatVisible() const void LLFloaterIMNearbyChat::showHistory() { openFloater(); - LLFloaterIMContainer::getInstance()->selectConversation(LLUUID(NULL)); + LLFloaterIMContainer::getInstance()->selectConversation(LLUUID(nullptr)); if(!isMessagePaneExpanded()) { @@ -781,7 +781,7 @@ void LLFloaterIMNearbyChat::startChat(const char* line) { if(!nearby_chat->isTornOff()) { - LLFloaterIMContainer::getInstance()->selectConversation(LLUUID(NULL)); + LLFloaterIMContainer::getInstance()->selectConversation(LLUUID(nullptr)); } if(nearby_chat->isMinimized()) { @@ -851,7 +851,7 @@ LLWString LLFloaterIMNearbyChat::stripChannelNumber(const LLWString &mesg, S32* 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); } diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index ec9458ea9b..a6a89e4712 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -284,7 +284,7 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat) if (mStopProcessing) return; - if (mFloaterSnapRegion == NULL) + if (mFloaterSnapRegion == nullptr) { mFloaterSnapRegion = gViewerWindow->getFloaterSnapRegion(); } @@ -374,7 +374,7 @@ void LLFloaterIMNearbyChatScreenChannel::arrangeToasts() if(mStopProcessing || isHovering()) return; - if (mFloaterSnapRegion == NULL) + if (mFloaterSnapRegion == nullptr) { mFloaterSnapRegion = gViewerWindow->getFloaterSnapRegion(); } diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index 84a9fad708..54d86a53b3 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -148,14 +148,14 @@ void LLFloaterIMSession::onClickCloseBtn(bool app_qutting) 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; @@ -482,7 +482,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; @@ -581,7 +581,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); @@ -589,7 +589,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(); @@ -701,10 +701,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(mSessionID); - if(NULL != chicletp) + if(nullptr != chicletp) { chicletp->setToggleState(false); } @@ -860,7 +860,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 @@ -889,7 +889,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) { @@ -910,7 +910,7 @@ void LLFloaterIMSession::reloadMessages(bool clean_messages/* = false*/) { LLIMModel::LLIMSession * sessionp = LLIMModel::instance().findIMSession(mSessionID); - if (NULL != sessionp) + if (nullptr != sessionp) { sessionp->loadHistory(); } @@ -1184,7 +1184,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) { @@ -1300,7 +1300,7 @@ void LLFloaterIMSession::closeHiddenIMToasts() LLNotificationsUI::LLScreenChannel* channel = LLNotificationsUI::LLChannelManager::getNotificationScreenChannel(); - if (channel != NULL) + if (channel != nullptr) { channel->closeHiddenToasts(IMToastMatcher()); } @@ -1313,7 +1313,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/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 65c13797ac..503a09a25f 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -61,23 +61,23 @@ void cb_group_do_nothing() } LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) -: super(NULL, false, session_id), +: super(nullptr, false, session_id), mIsP2PChat(false), - mExpandCollapseBtn(NULL), - mTearOffBtn(NULL), - mCloseBtn(NULL), + mExpandCollapseBtn(nullptr), + mTearOffBtn(nullptr), + mCloseBtn(nullptr), mSessionID(session_id.asUUID()), - mConversationsRoot(NULL), - mScroller(NULL), - mChatHistory(NULL), - mInputEditor(NULL), + mConversationsRoot(nullptr), + mScroller(nullptr), + mChatHistory(nullptr), + mInputEditor(nullptr), mInputEditorPad(0), mRefreshTimer(new LLTimer()), mIsHostAttached(false), mHasVisibleBeenInitialized(false), mIsParticipantListExpanded(true), - mChatLayoutPanel(NULL), - mInputPanels(NULL), + mChatLayoutPanel(nullptr), + mInputPanels(nullptr), mChatLayoutPanelHeight(0) { setAutoFocus(false); @@ -212,10 +212,10 @@ void LLFloaterIMSessionTab::addToHost(const LLUUID& session_id) else { // setting of the "potential" host for Nearby Chat: this sequence sets - // LLFloater::mHostHandle = NULL (a current host), but + // LLFloater::mHostHandle = nullptr (a current host), but // LLFloater::mLastHostHandle = floater_container (a "future" host) conversp->setHost(floater_container); - conversp->setHost(NULL); + conversp->setHost(nullptr); conversp->forceReshape(); } @@ -347,7 +347,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"; @@ -613,7 +613,7 @@ void LLFloaterIMSessionTab::closeFloater(bool app_quitting) void LLFloaterIMSessionTab::deleteAllChildren() { super::deleteAllChildren(); - mVoiceButton = NULL; + mVoiceButton = nullptr; } std::string LLFloaterIMSessionTab::appendTime() @@ -846,7 +846,7 @@ void LLFloaterIMSessionTab::refreshConversation() } mConversationViewModel.requestSortAll(); - if(mConversationsRoot != NULL) + if(mConversationsRoot != nullptr) { mConversationsRoot->arrangeAll(); mConversationsRoot->update(); @@ -1358,7 +1358,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/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index c0fe7ad896..6e1d0ebce4 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -43,7 +43,7 @@ #include "llviewerobject.h" #include "lluictrlfactory.h" -//LLFloaterInspect* LLFloaterInspect::sInstance = NULL; +//LLFloaterInspect* LLFloaterInspect::sInstance = nullptr; LLFloaterInspect::LLFloaterInspect(const LLSD& key) : LLFloater(key), @@ -61,7 +61,7 @@ bool LLFloaterInspect::postBuild() mObjectList = getChild("object_list"); // childSetAction("button owner",onClickOwnerProfile, this); // childSetAction("button creator",onClickCreatorProfile, this); -// childSetCommitCallback("object_list", onSelectObject, NULL); +// childSetCommitCallback("object_list", onSelectObject, nullptr); refresh(); diff --git a/indra/newview/llfloaterinspect.h b/indra/newview/llfloaterinspect.h index 961c6c8dc3..c6a7402418 100644 --- a/indra/newview/llfloaterinspect.h +++ b/indra/newview/llfloaterinspect.h @@ -42,7 +42,7 @@ class LLFloaterInspect : public LLFloater friend class LLFloaterReg; public: -// static void show(void* ignored = NULL); +// static void show(void* ignored = nullptr); void onOpen(const LLSD& key); virtual bool postBuild(); void dirty(); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index ebc91255d9..439c5b0bc1 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -95,10 +95,10 @@ static std::string MATURITY = "[MATURITY]"; // constants used in callbacks below - syntactic sugar. static const bool BUY_GROUP_LAND = true; static const bool BUY_PERSONAL_LAND = false; -LLPointer LLPanelLandGeneral::sSelectionForBuyPass = NULL; +LLPointer LLPanelLandGeneral::sSelectionForBuyPass = nullptr; // Statics -LLParcelSelectionObserver* LLFloaterLand::sObserver = NULL; +LLParcelSelectionObserver* LLFloaterLand::sObserver = nullptr; S32 LLFloaterLand::sLastTab = 0; // Local classes @@ -171,7 +171,7 @@ void insert_maturity_into_textbox(LLTextBox* target_textbox, LLFloater* names_fl //--------------------------------------------------------------------------- void send_parcel_select_objects(S32 parcel_local_id, U32 return_type, - uuid_list_t* return_ids = NULL) + uuid_list_t* return_ids = nullptr) { LLMessageSystem *msg = gMessageSystem; @@ -228,7 +228,7 @@ LLPanelLandObjects* LLFloaterLand::getCurrentPanelLandObjects() } else { - return NULL; + return nullptr; } } @@ -242,7 +242,7 @@ LLPanelLandCovenant* LLFloaterLand::getCurrentPanelLandCovenant() } else { - return NULL; + return nullptr; } } @@ -328,7 +328,7 @@ LLFloaterLand::~LLFloaterLand() { LLViewerParcelMgr::getInstance()->removeObserver( sObserver ); delete sObserver; - sObserver = NULL; + sObserver = nullptr; } // public @@ -520,10 +520,10 @@ bool LLPanelLandGeneral::postBuild() mBtnBuyPass->setClickedCallback(onClickBuyPass, this); mBtnReleaseLand = getChild("Abandon Land..."); - mBtnReleaseLand->setClickedCallback(onClickRelease, NULL); + mBtnReleaseLand->setClickedCallback(onClickRelease, nullptr); mBtnReclaimLand = getChild("Reclaim Land..."); - mBtnReclaimLand->setClickedCallback(onClickReclaim, NULL); + mBtnReclaimLand->setClickedCallback(onClickReclaim, nullptr); mBtnStartAuction = getChild("Linden Sale..."); mBtnStartAuction->setClickedCallback(onClickStartAuction, this); @@ -994,7 +994,7 @@ void LLPanelLandGeneral::onClickScriptLimits(void* data) { LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; LLParcel* parcel = panelp->mParcel->getParcel(); - if(parcel != NULL) + if(parcel != nullptr) { LLFloaterReg::showInstance("script_limits"); } @@ -1027,8 +1027,8 @@ void LLPanelLandGeneral::onClickReclaim(void*) bool LLPanelLandGeneral::enableBuyPass(void* data) { LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; - LLParcel* parcel = panelp != NULL ? panelp->mParcel->getParcel() : LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); - return (parcel != NULL) && (parcel->getParcelFlag(PF_USE_PASS_LIST) && !LLViewerParcelMgr::getInstance()->isCollisionBanned()); + LLParcel* parcel = panelp != nullptr ? panelp->mParcel->getParcel() : LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); + return (parcel != nullptr) && (parcel->getParcelFlag(PF_USE_PASS_LIST) && !LLViewerParcelMgr::getInstance()->isCollisionBanned()); } @@ -1036,7 +1036,7 @@ bool LLPanelLandGeneral::enableBuyPass(void* data) void LLPanelLandGeneral::onClickBuyPass(void* data) { LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; - LLParcel* parcel = panelp != NULL ? panelp->mParcel->getParcel() : LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); + LLParcel* parcel = panelp != nullptr ? panelp->mParcel->getParcel() : LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); if (!parcel) return; @@ -1087,7 +1087,7 @@ bool LLPanelLandGeneral::cbBuyPass(const LLSD& notification, const LLSD& respons LLViewerParcelMgr::getInstance()->buyPass(); } // we are done with buying pass, additional selection is no longer needed - sSelectionForBuyPass = NULL; + sSelectionForBuyPass = nullptr; return false; } @@ -1153,25 +1153,25 @@ LLPanelLandObjects::LLPanelLandObjects(LLParcelSelectionHandle& parcel) : LLPanel(), mParcel(parcel), - mParcelObjectBonus(NULL), - mSWTotalObjects(NULL), - mObjectContribution(NULL), - mTotalObjects(NULL), - mOwnerObjects(NULL), - mBtnShowOwnerObjects(NULL), - mBtnReturnOwnerObjects(NULL), - mGroupObjects(NULL), - mBtnShowGroupObjects(NULL), - mBtnReturnGroupObjects(NULL), - mOtherObjects(NULL), - mBtnShowOtherObjects(NULL), - mBtnReturnOtherObjects(NULL), - mSelectedObjects(NULL), - mCleanOtherObjectsTime(NULL), + mParcelObjectBonus(nullptr), + mSWTotalObjects(nullptr), + mObjectContribution(nullptr), + mTotalObjects(nullptr), + mOwnerObjects(nullptr), + mBtnShowOwnerObjects(nullptr), + mBtnReturnOwnerObjects(nullptr), + mGroupObjects(nullptr), + mBtnShowGroupObjects(nullptr), + mBtnReturnGroupObjects(nullptr), + mOtherObjects(nullptr), + mBtnShowOtherObjects(nullptr), + mBtnReturnOtherObjects(nullptr), + mSelectedObjects(nullptr), + mCleanOtherObjectsTime(nullptr), mOtherTime(0), - mBtnRefresh(NULL), - mBtnReturnOwnerList(NULL), - mOwnerList(NULL), + mBtnRefresh(nullptr), + mBtnReturnOwnerList(nullptr), + mOwnerList(nullptr), mFirstReply(true), mSelectedCount(0), mSelectedIsGroup(false) @@ -1411,7 +1411,7 @@ void send_other_clean_time_message(S32 parcel_local_id, S32 other_clean_time) } void send_return_objects_message(S32 parcel_local_id, S32 return_type, - uuid_list_t* owner_ids = NULL) + uuid_list_t* owner_ids = nullptr) { LLMessageSystem *msg = gMessageSystem; @@ -1899,25 +1899,25 @@ void LLPanelLandObjects::onCommitClean(LLUICtrl *caller, void* user_data) LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) : LLPanel(), - mCheckEditObjects(NULL), - mCheckEditGroupObjects(NULL), - mCheckAllObjectEntry(NULL), - mCheckGroupObjectEntry(NULL), - mCheckSafe(NULL), - mCheckFly(NULL), - mCheckGroupScripts(NULL), - mCheckOtherScripts(NULL), - mCheckShowDirectory(NULL), - mCategoryCombo(NULL), - mLandingTypeCombo(NULL), - mSnapshotCtrl(NULL), - mLocationText(NULL), - mSeeAvatarsText(NULL), - mSetBtn(NULL), - mClearBtn(NULL), - mMatureCtrl(NULL), - mPushRestrictionCtrl(NULL), - mSeeAvatarsCtrl(NULL), + mCheckEditObjects(nullptr), + mCheckEditGroupObjects(nullptr), + mCheckAllObjectEntry(nullptr), + mCheckGroupObjectEntry(nullptr), + mCheckSafe(nullptr), + mCheckFly(nullptr), + mCheckGroupScripts(nullptr), + mCheckOtherScripts(nullptr), + mCheckShowDirectory(nullptr), + mCategoryCombo(nullptr), + mLandingTypeCombo(nullptr), + mSnapshotCtrl(nullptr), + mLocationText(nullptr), + mSeeAvatarsText(nullptr), + mSetBtn(nullptr), + mClearBtn(nullptr), + mMatureCtrl(nullptr), + mPushRestrictionCtrl(nullptr), + mSeeAvatarsCtrl(nullptr), mParcel(parcel) { } @@ -1996,7 +1996,7 @@ bool LLPanelLandOptions::postBuild() } else { - LL_WARNS() << "LLUICtrlFactory::getTexturePickerByName() returned NULL for 'snapshot_ctrl'" << LL_ENDL; + LL_WARNS() << "LLUICtrlFactory::getTexturePickerByName() returned nullptr for 'snapshot_ctrl'" << LL_ENDL; } @@ -2415,7 +2415,7 @@ void LLPanelLandOptions::toggleSeeAvatars(void* userdata) { self->getChild("SeeAvatarsCheck")->toggle(); self->getChild("SeeAvatarsCheck")->setBtnFocus(); - self->onCommitAny(NULL, userdata); + self->onCommitAny(nullptr, userdata); } } //--------------------------------------------------------------------------- @@ -2530,7 +2530,7 @@ void LLPanelLandAccess::refresh() if (entry.mTime != 0) { LLStringUtil::format_map_t args; - S32 now = (S32)time(NULL); + S32 now = (S32)time(nullptr); S32 seconds = entry.mTime - now; if (seconds < 0) seconds = 0; prefix.assign(" ("); @@ -2579,7 +2579,7 @@ void LLPanelLandAccess::refresh() if (entry.mTime != 0) { LLStringUtil::format_map_t args; - S32 now = (S32)time(NULL); + S32 now = (S32)time(nullptr); seconds = entry.mTime - now; if (seconds < 0) seconds = 0; @@ -3280,7 +3280,7 @@ void LLPanelLandExperiences::refreshPanel(LLPanelExperienceListEditor* panel, U3 LLParcel *parcel = mParcel->getParcel(); // Display options - if (panel == NULL) + if (panel == nullptr) { return; } diff --git a/indra/newview/llfloaterlinkreplace.cpp b/indra/newview/llfloaterlinkreplace.cpp index c961070787..71fc2df488 100644 --- a/indra/newview/llfloaterlinkreplace.cpp +++ b/indra/newview/llfloaterlinkreplace.cpp @@ -255,7 +255,7 @@ void LLFloaterLinkReplace::linkCreatedCallback(LLHandle fl LLSD updates; updates["desc"] = ""; - update_inventory_item(item->getUUID(), updates, LLPointer(NULL)); + update_inventory_item(item->getUUID(), updates, LLPointer(nullptr)); } } } diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 83abbb0357..1943f1f81c 100755 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -59,15 +59,15 @@ const F32 MAP_MINOR_DIR_THRESHOLD = 0.035f; 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) { } @@ -189,7 +189,7 @@ void LLFloaterMap::setDirectionPos(LLTextBox *text_box, F32 rotation) void LLFloaterMap::updateMinorDirections() { - if (mTextBoxNorthEast == NULL) + if (mTextBoxNorthEast == nullptr) { return; } diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index f20fea01c5..6839daa573 100644 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -54,7 +54,7 @@ static LLPanelInjector t_panel_status("llpanelmarketplacelistings"); LLPanelMarketplaceListings::LLPanelMarketplaceListings() -: mRootFolder(NULL) +: mRootFolder(nullptr) , mSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME) , mFilterListingFoldersOnly(false) { @@ -83,7 +83,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")) { @@ -133,7 +133,7 @@ LLInventoryPanel* LLPanelMarketplaceListings::buildInventoryPanel(const std::str { LLTabContainer* tabs_panel = getChild("marketplace_filter_tabs"); LLInventoryPanel* panel = LLUICtrlFactory::createFromFile(filename, tabs_panel, LLInventoryPanel::child_registry_t::instance()); - llassert(panel != NULL); + llassert(panel != nullptr); // Set sort order and callbacks panel = getChild(childname); @@ -366,15 +366,15 @@ class LLMarketplaceListingsAddedObserver : public LLInventoryCategoryAddedObserv LLFloaterMarketplaceListings::LLFloaterMarketplaceListings(const LLSD& key) : LLFloater(key) -, mCategoriesObserver(NULL) -, mCategoryAddedObserver(NULL) +, mCategoriesObserver(nullptr) +, mCategoryAddedObserver(nullptr) , mRootFolderId(LLUUID::null) -, mInventoryStatus(NULL) -, mInventoryInitializationInProgress(NULL) -, mInventoryPlaceholder(NULL) -, mInventoryText(NULL) -, mInventoryTitle(NULL) -, mPanelListings(NULL) +, mInventoryStatus(nullptr) +, mInventoryInitializationInProgress(nullptr) +, mInventoryPlaceholder(nullptr) +, mInventoryText(nullptr) +, mInventoryTitle(nullptr) +, mPanelListings(nullptr) , mPanelListingsSet(false) , mRootFolderCreating(false) { @@ -520,7 +520,7 @@ void LLFloaterMarketplaceListings::setRootFolder() { gInventory.removeObserver(mCategoryAddedObserver); delete mCategoryAddedObserver; - mCategoryAddedObserver = NULL; + mCategoryAddedObserver = nullptr; } llassert(!mCategoryAddedObserver); @@ -720,7 +720,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 @@ -872,7 +872,7 @@ void LLFloaterAssociateListing::cancel() LLFloaterMarketplaceValidation::LLFloaterMarketplaceValidation(const LLSD& key) : LLFloater(key), -mEditor(NULL) +mEditor(nullptr) { } @@ -917,7 +917,7 @@ void LLFloaterMarketplaceValidation::onOpen(const LLSD& key) { LLMarketplaceValidator::getInstance()->validateMarketplaceListings( cat_id, - NULL, + nullptr, boost::bind(&LLFloaterMarketplaceValidation::appendMessage, this, _1, _2, _3), false); } diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp index 81eab52e6c..8dd0565f6e 100644 --- a/indra/newview/llfloatermediasettings.cpp +++ b/indra/newview/llfloatermediasettings.cpp @@ -37,16 +37,16 @@ #include "llselectmgr.h" #include "llsdutil.h" -LLFloaterMediaSettings* LLFloaterMediaSettings::sInstance = NULL; +LLFloaterMediaSettings* LLFloaterMediaSettings::sInstance = nullptr; //////////////////////////////////////////////////////////////////////////////// // LLFloaterMediaSettings::LLFloaterMediaSettings(const LLSD& key) : LLFloater(key), - mTabContainer(NULL), - mPanelMediaSettingsGeneral(NULL), - mPanelMediaSettingsSecurity(NULL), - mPanelMediaSettingsPermissions(NULL), + mTabContainer(nullptr), + mPanelMediaSettingsGeneral(nullptr), + mPanelMediaSettingsSecurity(nullptr), + mPanelMediaSettingsPermissions(nullptr), mIdenticalHasMediaInfo( true ), mMultipleMedia(false), mMultipleValidMedia(false) @@ -60,22 +60,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; } //////////////////////////////////////////////////////////////////////////////// @@ -297,7 +297,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/llfloatermemleak.cpp b/indra/newview/llfloatermemleak.cpp index b4bb45c864..b2973e55ba 100644 --- a/indra/newview/llfloatermemleak.cpp +++ b/indra/newview/llfloatermemleak.cpp @@ -130,7 +130,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/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index ef29be8200..d698730c0c 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -69,7 +69,7 @@ //static S32 LLFloaterModelPreview::sUploadAmount = 10; -LLFloaterModelPreview* LLFloaterModelPreview::sInstance = NULL; +LLFloaterModelPreview* LLFloaterModelPreview::sInstance = nullptr; // "Retain%" decomp parameter has values from 0.0 to 1.0 by 0.01 // But according to the UI spec for upload model floater, this parameter @@ -127,17 +127,17 @@ void LLMeshFilePicker::notify(const std::vector& filenames) //----------------------------------------------------------------------------- LLFloaterModelPreview::LLFloaterModelPreview(const LLSD& key) : LLFloaterModelUploadBase(key), -mUploadBtn(NULL), -mCalculateBtn(NULL), -mUploadLogText(NULL), -mTabContainer(NULL), +mUploadBtn(nullptr), +mCalculateBtn(nullptr), +mUploadLogText(nullptr), +mTabContainer(nullptr), mAvatarTabIndex(0) { sInstance = this; mLastMouseX = 0; mLastMouseY = 0; mStatusLock = new LLMutex(); - mModelPreview = NULL; + mModelPreview = nullptr; mLODMode[LLModel::LOD_HIGH] = LLModelPreview::LOD_FROM_FILE; for (U32 i = 0; i < LLModel::LOD_HIGH; i++) @@ -175,10 +175,10 @@ bool LLFloaterModelPreview::postBuild() } // Upload/avatar options, they need to refresh errors/notifications - childSetCommitCallback("upload_skin", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL); - childSetCommitCallback("upload_joints", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL); - childSetCommitCallback("lock_scale_if_joint_position", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL); - childSetCommitCallback("upload_textures", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL); + childSetCommitCallback("upload_skin", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), nullptr); + childSetCommitCallback("upload_joints", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), nullptr); + childSetCommitCallback("lock_scale_if_joint_position", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), nullptr); + childSetCommitCallback("upload_textures", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), nullptr); childSetTextArg("status", "[STATUS]", getString("status_idle")); @@ -192,7 +192,7 @@ bool LLFloaterModelPreview::postBuild() childSetCommitCallback("import_scale", onImportScaleCommit, this); childSetCommitCallback("pelvis_offset", onPelvisOffsetCommit, this); - getChild("description_form")->setKeystrokeCallback(boost::bind(&LLFloaterModelPreview::onDescriptionKeystroke, this, _1), NULL); + getChild("description_form")->setKeystrokeCallback(boost::bind(&LLFloaterModelPreview::onDescriptionKeystroke, this, _1), nullptr); getChild("show_edges")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1)); getChild("show_physics")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1)); @@ -273,7 +273,7 @@ bool LLFloaterModelPreview::postBuild() mAvatarTabIndex = mTabContainer->getIndexForPanel(panel); panel->getChild("joints_list")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onJointListSelection, this)); - if (LLConvexDecomposition::getInstance() != NULL) + if (LLConvexDecomposition::getInstance() != nullptr) { mCalculateBtn->setClickedCallback(boost::bind(&LLFloaterModelPreview::onClickCalculateBtn, this)); @@ -310,7 +310,7 @@ void LLFloaterModelPreview::reshape(S32 width, S32 height, bool called_from_pare //----------------------------------------------------------------------------- LLFloaterModelPreview::~LLFloaterModelPreview() { - sInstance = NULL; + sInstance = nullptr; if ( mModelPreview ) { @@ -318,7 +318,7 @@ LLFloaterModelPreview::~LLFloaterModelPreview() } delete mStatusLock; - mStatusLock = NULL; + mStatusLock = nullptr; } void LLFloaterModelPreview::initModelPreview() @@ -971,7 +971,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; @@ -1140,24 +1140,24 @@ void LLFloaterModelPreview::initDecompControls() { LLSD key; - childSetCommitCallback("simplify_cancel", onPhysicsStageCancel, NULL); - childSetCommitCallback("decompose_cancel", onPhysicsStageCancel, NULL); - childSetCommitCallback("analyze_cancel", onPhysicsStageCancel, NULL); + childSetCommitCallback("simplify_cancel", onPhysicsStageCancel, nullptr); + childSetCommitCallback("decompose_cancel", onPhysicsStageCancel, nullptr); + childSetCommitCallback("analyze_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); } diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp index c0405c106e..8f16d40758 100644 --- a/indra/newview/llfloatermyenvironment.cpp +++ b/indra/newview/llfloatermyenvironment.cpp @@ -277,7 +277,7 @@ void LLFloaterMyEnvironment::onDeleteSelected() void LLFloaterMyEnvironment::onDoCreate(const LLSD &data) { - menu_create_inventory_item(mInventoryList, NULL, data); + menu_create_inventory_item(mInventoryList, nullptr, data); } void LLFloaterMyEnvironment::onDoApply(const std::string &context) diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index 569b41cfa9..f67ab1c4a5 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -201,7 +201,7 @@ void LLFloaterNameDesc::onBtnOK( ) S32 expected_upload_cost = getExpectedUploadCost(); if (can_afford_transaction(expected_upload_cost)) { - void *nruserdata = NULL; + void *nruserdata = nullptr; std::string display_name = LLStringUtil::null; LLResourceUploadInfo::ptr_t uploadInfo(std::make_shared( diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index a819b30e30..b51c18c597 100644 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -68,7 +68,7 @@ LLNotificationChannelPanel::~LLNotificationChannelPanel() LLScrollListItem* item = *data_itor; LLNotification* notification = (LLNotification*)item->getUserdata(); delete notification; - notification = NULL; + notification = nullptr; } } diff --git a/indra/newview/llfloaternotificationstabbed.cpp b/indra/newview/llfloaternotificationstabbed.cpp index 8eeba095b2..648cf77269 100644 --- a/indra/newview/llfloaternotificationstabbed.cpp +++ b/indra/newview/llfloaternotificationstabbed.cpp @@ -38,14 +38,14 @@ #include "lltoastnotifypanel.h" //--------------------------------------------------------------------------------- -LLFloaterNotificationsTabbed::LLFloaterNotificationsTabbed(const LLSD& key) : LLTransientDockableFloater(NULL, true, key), - mChannel(NULL), - mSysWellChiclet(NULL), - mGroupInviteMessageList(NULL), - mGroupNoticeMessageList(NULL), - mTransactionMessageList(NULL), - mSystemMessageList(NULL), - mNotificationsTabContainer(NULL), +LLFloaterNotificationsTabbed::LLFloaterNotificationsTabbed(const LLSD& key) : LLTransientDockableFloater(nullptr, true, key), + mChannel(nullptr), + mSysWellChiclet(nullptr), + mGroupInviteMessageList(nullptr), + mGroupNoticeMessageList(nullptr), + mTransactionMessageList(nullptr), + mSystemMessageList(nullptr), + mNotificationsTabContainer(nullptr), NOTIFICATION_TABBED_ANCHOR_NAME("notification_well_panel"), IM_WELL_ANCHOR_NAME("im_well_panel"), mIsReshapedByUser(false) @@ -107,7 +107,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()); } @@ -124,7 +124,7 @@ void LLFloaterNotificationsTabbed::removeItemByID(const LLUUID& id, std::string { if(mNotificationsSeparator->removeItemByID(type, id)) { - if (NULL != mSysWellChiclet) + if (nullptr != mSysWellChiclet) { mSysWellChiclet->updateWidget(isWindowEmpty()); } @@ -156,7 +156,7 @@ void LLFloaterNotificationsTabbed::initChannel() LLNotificationsUI::LLScreenChannelBase* channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID( LLNotificationsUI::NOTIFICATION_CHANNEL_UUID); mChannel = dynamic_cast(channel); - if(NULL == mChannel) + if(nullptr == mChannel) { LL_WARNS() << "LLSysWellWindow::initChannel() - could not get a requested screen channel" << LL_ENDL; } @@ -177,7 +177,7 @@ void LLFloaterNotificationsTabbed::setVisible(bool visible) } if (visible) { - if (NULL == getDockControl() && getDockTongue().notNull()) + if (nullptr == getDockControl() && getDockTongue().notNull()) { setDockControl(new LLDockControl( LLChicletBar::getInstance()->getChild(getAnchorViewName()), this, @@ -186,7 +186,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); @@ -271,7 +271,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; } @@ -482,7 +482,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); } @@ -497,7 +497,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); } @@ -513,7 +513,7 @@ U32 LLNotificationSeparator::size() const { size = size + (*it)->size(); } - if (mUnTaggedList != NULL) + if (mUnTaggedList != nullptr) { size = size + mUnTaggedList->size(); } @@ -528,12 +528,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 @@ -560,7 +560,7 @@ void LLNotificationSeparator::getItems(std::vector& ite { getItemsFromList(items, *lists_it); } - if (mUnTaggedList != NULL) + if (mUnTaggedList != nullptr) { getItemsFromList(items, mUnTaggedList); } @@ -568,7 +568,7 @@ void LLNotificationSeparator::getItems(std::vector& ite //--------------------------------------------------------------------------------- LLNotificationSeparator::LLNotificationSeparator() - : mUnTaggedList(NULL) + : mUnTaggedList(nullptr) {} //--------------------------------------------------------------------------------- diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp index fa491a4b27..6c3b21b5e1 100644 --- a/indra/newview/llfloaterobjectweights.cpp +++ b/indra/newview/llfloaterobjectweights.cpp @@ -74,16 +74,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), mLodLevel(nullptr), mTrianglesShown(nullptr), mPixelArea(nullptr) diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index b06e35f65d..1d7f0e9998 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.MoveToInventory", boost::bind(&LLFloaterOpenObject::onClickMoveToInventory, this)); @@ -61,7 +61,7 @@ LLFloaterOpenObject::LLFloaterOpenObject(const LLSD& key) LLFloaterOpenObject::~LLFloaterOpenObject() { -// sInstance = NULL; +// sInstance = nullptr; } // virtual @@ -195,7 +195,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/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index 848672b1fc..95044b99e0 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -72,7 +72,7 @@ bool LLFloaterPathfindingCharacters::isShowPhysicsCapsule() const void LLFloaterPathfindingCharacters::setShowPhysicsCapsule(bool pIsShowPhysicsCapsule) { - mShowPhysicsCapsuleCheckBox->set(pIsShowPhysicsCapsule && (LLPathingLib::getInstance() != NULL)); + mShowPhysicsCapsuleCheckBox->set(pIsShowPhysicsCapsule && (LLPathingLib::getInstance() != nullptr)); } bool LLFloaterPathfindingCharacters::isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos, LLQuaternion& rot) const @@ -94,7 +94,7 @@ LLHandle LLFloaterPathfindingCharacters::getInst if ( sInstanceHandle.isDead() ) { LLFloaterPathfindingCharacters *floaterInstance = LLFloaterReg::findTypedInstance("pathfinding_characters"); - if (floaterInstance != NULL) + if (floaterInstance != nullptr) { sInstanceHandle = floaterInstance->mSelfHandle; } @@ -105,7 +105,7 @@ LLHandle LLFloaterPathfindingCharacters::getInst LLFloaterPathfindingCharacters::LLFloaterPathfindingCharacters(const LLSD& pSeed) : LLFloaterPathfindingObjects(pSeed), - mShowPhysicsCapsuleCheckBox(NULL), + mShowPhysicsCapsuleCheckBox(nullptr), mSelectedCharacterId(), mBeaconColor(), mSelfHandle() @@ -122,9 +122,9 @@ bool LLFloaterPathfindingCharacters::postBuild() mBeaconColor = LLUIColorTable::getInstance()->getColor("PathfindingCharacterBeaconColor"); mShowPhysicsCapsuleCheckBox = findChild("show_physics_capsule"); - llassert(mShowPhysicsCapsuleCheckBox != NULL); + llassert(mShowPhysicsCapsuleCheckBox != nullptr); mShowPhysicsCapsuleCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingCharacters::onShowPhysicsCapsuleClicked, this)); - mShowPhysicsCapsuleCheckBox->setEnabled(LLPathingLib::getInstance() != NULL); + mShowPhysicsCapsuleCheckBox->setEnabled(LLPathingLib::getInstance() != nullptr); return LLFloaterPathfindingObjects::postBuild(); } @@ -136,14 +136,14 @@ void LLFloaterPathfindingCharacters::requestGetObjects() void LLFloaterPathfindingCharacters::buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr) { - llassert(pObjectListPtr != NULL); + llassert(pObjectListPtr != nullptr); llassert(!pObjectListPtr->isEmpty()); for (LLPathfindingObjectList::const_iterator objectIter = pObjectListPtr->begin(); objectIter != pObjectListPtr->end(); ++objectIter) { const LLPathfindingObjectPtr objectPtr = objectIter->second; const LLPathfindingCharacter *characterPtr = dynamic_cast(objectPtr.get()); - llassert(characterPtr != NULL); + llassert(characterPtr != nullptr); LLSD scrollListItemData = buildCharacterScrollListItemData(characterPtr); addObjectToScrollList(objectPtr, scrollListItemData); @@ -191,7 +191,7 @@ LLPathfindingObjectListPtr LLFloaterPathfindingCharacters::getEmptyObjectList() void LLFloaterPathfindingCharacters::onShowPhysicsCapsuleClicked() { - if (LLPathingLib::getInstance() == NULL) + if (LLPathingLib::getInstance() == nullptr) { if (isShowPhysicsCapsule()) { @@ -241,7 +241,7 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListItemData(const LLPa void LLFloaterPathfindingCharacters::updateStateOnDisplayControls() { int numSelectedItems = getNumSelectedObjects();; - bool isEditEnabled = ((numSelectedItems == 1) && (LLPathingLib::getInstance() != NULL)); + bool isEditEnabled = ((numSelectedItems == 1) && (LLPathingLib::getInstance() != nullptr)); mShowPhysicsCapsuleCheckBox->setEnabled(isEditEnabled); if (!isEditEnabled) @@ -276,12 +276,12 @@ void LLFloaterPathfindingCharacters::showCapsule() const if (mSelectedCharacterId.notNull() && isShowPhysicsCapsule()) { LLPathfindingObjectPtr objectPtr = getFirstSelectedObject(); - llassert(objectPtr != NULL); - if (objectPtr != NULL) + llassert(objectPtr != nullptr); + if (objectPtr != nullptr) { const LLPathfindingCharacter *character = dynamic_cast(objectPtr.get()); llassert(mSelectedCharacterId == character->getUUID()); - if (LLPathingLib::getInstance() != NULL) + if (LLPathingLib::getInstance() != nullptr) { LLPathingLib::getInstance()->createPhysicsCapsuleRep(character->getLength(), character->getRadius(), (BOOL)character->isHorizontal(), character->getUUID()); @@ -298,7 +298,7 @@ void LLFloaterPathfindingCharacters::hideCapsule() const { gPipeline.restoreHiddenObject(mSelectedCharacterId); } - if (LLPathingLib::getInstance() != NULL) + if (LLPathingLib::getInstance() != nullptr) { LLPathingLib::getInstance()->cleanupPhysicsCapsuleRepResiduals(); } @@ -314,7 +314,7 @@ bool LLFloaterPathfindingCharacters::getCapsuleRenderData(LLVector3& pPosition, if (mSelectedCharacterId.notNull()) { LLViewerObject *viewerObject = gObjectList.findObject(mSelectedCharacterId); - if ( viewerObject != NULL ) + if ( viewerObject != nullptr ) { rot = viewerObject->getRotation() ; pPosition = viewerObject->getRenderPosition(); diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 994a5c0c02..c1c8fce24f 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -93,95 +93,95 @@ LLHandle LLFloaterPathfindingConsole::sInstanceHand bool LLFloaterPathfindingConsole::postBuild() { mViewTestTabContainer = findChild("view_test_tab_container"); - llassert(mViewTestTabContainer != NULL); + llassert(mViewTestTabContainer != nullptr); mViewTestTabContainer->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onTabSwitch, this)); mViewTab = findChild("view_panel"); - llassert(mViewTab != NULL); + llassert(mViewTab != nullptr); mShowLabel = findChild("show_label"); - llassert(mShowLabel != NULL); + llassert(mShowLabel != nullptr); mShowWorldCheckBox = findChild("show_world"); - llassert(mShowWorldCheckBox != NULL); + llassert(mShowWorldCheckBox != nullptr); mShowWorldCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWorldSet, this)); mShowWorldMovablesOnlyCheckBox = findChild("show_world_movables_only"); - llassert(mShowWorldMovablesOnlyCheckBox != NULL); + llassert(mShowWorldMovablesOnlyCheckBox != nullptr); mShowWorldMovablesOnlyCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWorldMovablesOnlySet, this)); mShowNavMeshCheckBox = findChild("show_navmesh"); - llassert(mShowNavMeshCheckBox != NULL); + llassert(mShowNavMeshCheckBox != nullptr); mShowNavMeshCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowNavMeshSet, this)); mShowNavMeshWalkabilityLabel = findChild("show_walkability_label"); - llassert(mShowNavMeshWalkabilityLabel != NULL); + llassert(mShowNavMeshWalkabilityLabel != nullptr); mShowNavMeshWalkabilityComboBox = findChild("show_heatmap_mode"); - llassert(mShowNavMeshWalkabilityComboBox != NULL); + llassert(mShowNavMeshWalkabilityComboBox != nullptr); mShowNavMeshWalkabilityComboBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWalkabilitySet, this)); mShowWalkablesCheckBox = findChild("show_walkables"); - llassert(mShowWalkablesCheckBox != NULL); + llassert(mShowWalkablesCheckBox != nullptr); mShowStaticObstaclesCheckBox = findChild("show_static_obstacles"); - llassert(mShowStaticObstaclesCheckBox != NULL); + llassert(mShowStaticObstaclesCheckBox != nullptr); mShowMaterialVolumesCheckBox = findChild("show_material_volumes"); - llassert(mShowMaterialVolumesCheckBox != NULL); + llassert(mShowMaterialVolumesCheckBox != nullptr); mShowExclusionVolumesCheckBox = findChild("show_exclusion_volumes"); - llassert(mShowExclusionVolumesCheckBox != NULL); + llassert(mShowExclusionVolumesCheckBox != nullptr); mShowRenderWaterPlaneCheckBox = findChild("show_water_plane"); - llassert(mShowRenderWaterPlaneCheckBox != NULL); + llassert(mShowRenderWaterPlaneCheckBox != nullptr); mShowXRayCheckBox = findChild("show_xray"); - llassert(mShowXRayCheckBox != NULL); + llassert(mShowXRayCheckBox != nullptr); mTestTab = findChild("test_panel"); - llassert(mTestTab != NULL); + llassert(mTestTab != nullptr); mPathfindingViewerStatus = findChild("pathfinding_viewer_status"); - llassert(mPathfindingViewerStatus != NULL); + llassert(mPathfindingViewerStatus != nullptr); mPathfindingSimulatorStatus = findChild("pathfinding_simulator_status"); - llassert(mPathfindingSimulatorStatus != NULL); + llassert(mPathfindingSimulatorStatus != nullptr); mCtrlClickLabel = findChild("ctrl_click_label"); - llassert(mCtrlClickLabel != NULL); + llassert(mCtrlClickLabel != nullptr); mShiftClickLabel = findChild("shift_click_label"); - llassert(mShiftClickLabel != NULL); + llassert(mShiftClickLabel != nullptr); mCharacterWidthLabel = findChild("character_width_label"); - llassert(mCharacterWidthLabel != NULL); + llassert(mCharacterWidthLabel != nullptr); mCharacterWidthSlider = findChild("character_width"); - llassert(mCharacterWidthSlider != NULL); + llassert(mCharacterWidthSlider != nullptr); mCharacterWidthSlider->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterWidthSet, this)); mCharacterWidthUnitLabel = findChild("character_width_unit_label"); - llassert(mCharacterWidthUnitLabel != NULL); + llassert(mCharacterWidthUnitLabel != nullptr); mCharacterTypeLabel = findChild("character_type_label"); - llassert(mCharacterTypeLabel != NULL); + llassert(mCharacterTypeLabel != nullptr); mCharacterTypeComboBox = findChild("path_character_type"); - llassert(mCharacterTypeComboBox != NULL); + llassert(mCharacterTypeComboBox != nullptr); mCharacterTypeComboBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterTypeSwitch, this)); mPathTestingStatus = findChild("path_test_status"); - llassert(mPathTestingStatus != NULL); + llassert(mPathTestingStatus != nullptr); mClearPathButton = findChild("clear_path"); - llassert(mClearPathButton != NULL); + llassert(mClearPathButton != nullptr); mClearPathButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onClearPathClicked, this)); mErrorColor = LLUIColorTable::instance().getColor("PathfindingErrorColor"); mWarningColor = LLUIColorTable::instance().getColor("PathfindingWarningColor"); - if (LLPathingLib::getInstance() != NULL) + if (LLPathingLib::getInstance() != nullptr) { mPathfindingToolset = new LLToolset(); mPathfindingToolset->addTool(LLPathfindingPathTool::getInstance()); @@ -199,7 +199,7 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey) { LLFloater::onOpen(pKey); //make sure we have a pathing system - if ( LLPathingLib::getInstance() == NULL ) + if ( LLPathingLib::getInstance() == nullptr ) { setConsoleState(kConsoleStateLibraryNotImplemented); LL_WARNS() <<"Errror: cannot find pathing library implementation."< LLFloaterPathfindingConsole::getInstanceHa if (sInstanceHandle.isDead()) { LLFloaterPathfindingConsole *floaterInstance = LLFloaterReg::findTypedInstance("pathfinding_console"); - if (floaterInstance != NULL) + if (floaterInstance != nullptr) { sInstanceHandle = floaterInstance->mSelfHandle; } @@ -447,32 +447,32 @@ void LLFloaterPathfindingConsole::setRenderHeatmapType(LLPathingLib::LLPLCharact LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) : LLFloater(pSeed), mSelfHandle(), - mViewTestTabContainer(NULL), - mViewTab(NULL), - mShowLabel(NULL), - mShowWorldCheckBox(NULL), - mShowWorldMovablesOnlyCheckBox(NULL), - mShowNavMeshCheckBox(NULL), - mShowNavMeshWalkabilityLabel(NULL), - mShowNavMeshWalkabilityComboBox(NULL), - mShowWalkablesCheckBox(NULL), - mShowStaticObstaclesCheckBox(NULL), - mShowMaterialVolumesCheckBox(NULL), - mShowExclusionVolumesCheckBox(NULL), - mShowRenderWaterPlaneCheckBox(NULL), - mShowXRayCheckBox(NULL), - mPathfindingViewerStatus(NULL), - mPathfindingSimulatorStatus(NULL), - mTestTab(NULL), + mViewTestTabContainer(nullptr), + mViewTab(nullptr), + mShowLabel(nullptr), + mShowWorldCheckBox(nullptr), + mShowWorldMovablesOnlyCheckBox(nullptr), + mShowNavMeshCheckBox(nullptr), + mShowNavMeshWalkabilityLabel(nullptr), + mShowNavMeshWalkabilityComboBox(nullptr), + mShowWalkablesCheckBox(nullptr), + mShowStaticObstaclesCheckBox(nullptr), + mShowMaterialVolumesCheckBox(nullptr), + mShowExclusionVolumesCheckBox(nullptr), + mShowRenderWaterPlaneCheckBox(nullptr), + mShowXRayCheckBox(nullptr), + mPathfindingViewerStatus(nullptr), + mPathfindingSimulatorStatus(nullptr), + mTestTab(nullptr), mCtrlClickLabel(), mShiftClickLabel(), mCharacterWidthLabel(), mCharacterWidthUnitLabel(), - mCharacterWidthSlider(NULL), + mCharacterWidthSlider(nullptr), mCharacterTypeLabel(), - mCharacterTypeComboBox(NULL), - mPathTestingStatus(NULL), - mClearPathButton(NULL), + mCharacterTypeComboBox(nullptr), + mPathTestingStatus(nullptr), + mClearPathButton(nullptr), mErrorColor(), mWarningColor(), mNavMeshZoneSlot(), @@ -481,8 +481,8 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mRegionBoundarySlot(), mTeleportFailedSlot(), mPathEventSlot(), - mPathfindingToolset(NULL), - mSavedToolset(NULL), + mPathfindingToolset(nullptr), + mSavedToolset(nullptr), mSavedSettingRetrieveNeighborSlot(), mSavedSettingWalkableSlot(), mSavedSettingStaticObstacleSlot(), @@ -537,7 +537,7 @@ void LLFloaterPathfindingConsole::onShowNavMeshSet() void LLFloaterPathfindingConsole::onShowWalkabilitySet() { - if (LLPathingLib::getInstance() != NULL) + if (LLPathingLib::getInstance() != nullptr) { LLPathingLib::getInstance()->setNavMeshMaterialType(getRenderHeatmapType()); } @@ -942,9 +942,9 @@ void LLFloaterPathfindingConsole::cleanupRenderableRestoreItems() void LLFloaterPathfindingConsole::switchIntoTestPathMode() { - if (LLPathingLib::getInstance() != NULL) + if (LLPathingLib::getInstance() != nullptr) { - llassert(mPathfindingToolset != NULL); + llassert(mPathfindingToolset != nullptr); LLToolMgr *toolMgrInstance = LLToolMgr::getInstance(); if (toolMgrInstance->getCurrentToolset() != mPathfindingToolset) { @@ -956,14 +956,14 @@ void LLFloaterPathfindingConsole::switchIntoTestPathMode() void LLFloaterPathfindingConsole::switchOutOfTestPathMode() { - if (LLPathingLib::getInstance() != NULL) + if (LLPathingLib::getInstance() != nullptr) { - llassert(mPathfindingToolset != NULL); + llassert(mPathfindingToolset != nullptr); LLToolMgr *toolMgrInstance = LLToolMgr::getInstance(); if (toolMgrInstance->getCurrentToolset() == mPathfindingToolset) { toolMgrInstance->setCurrentToolset(mSavedToolset); - mSavedToolset = NULL; + mSavedToolset = nullptr; } } } @@ -1222,7 +1222,7 @@ void LLFloaterPathfindingConsole::handleNavMeshColorChange(LLControlVariable *pC void LLFloaterPathfindingConsole::fillInColorsForNavMeshVisualization() { - if (LLPathingLib::getInstance() != NULL) + if (LLPathingLib::getInstance() != nullptr) { LLPathingLib::NavMeshColors navMeshColors; diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 7ed64383f0..9fc45c468e 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -75,30 +75,30 @@ void LLFloaterPathfindingLinksets::openLinksetsWithSelectedObjects() LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed) : LLFloaterPathfindingObjects(pSeed), - mFilterByName(NULL), - mFilterByDescription(NULL), - mFilterByLinksetUse(NULL), - mEditLinksetUse(NULL), - 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), + mFilterByName(nullptr), + mFilterByDescription(nullptr), + mFilterByLinksetUse(nullptr), + mEditLinksetUse(nullptr), + 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), @@ -124,88 +124,88 @@ bool LLFloaterPathfindingLinksets::postBuild() mFilterByDescription->setCommitOnFocusLost(true); mFilterByLinksetUse = findChild("filter_by_linkset_use"); - llassert(mFilterByLinksetUse != NULL); + llassert(mFilterByLinksetUse != nullptr); mFilterByLinksetUse->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyAllFilters, this)); childSetAction("apply_filters", boost::bind(&LLFloaterPathfindingLinksets::onApplyAllFilters, this)); childSetAction("clear_filters", boost::bind(&LLFloaterPathfindingLinksets::onClearFiltersClicked, this)); mEditLinksetUse = findChild("edit_linkset_use"); - llassert(mEditLinksetUse != NULL); + llassert(mEditLinksetUse != nullptr); mEditLinksetUse->clearRows(); mEditLinksetUseUnset = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getString("linkset_choose_use"), XUI_LINKSET_USE_NONE)); - llassert(mEditLinksetUseUnset != NULL); + llassert(mEditLinksetUseUnset != nullptr); mEditLinksetUseWalkable = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getLinksetUseString(LLPathfindingLinkset::kWalkable), XUI_LINKSET_USE_WALKABLE)); - llassert(mEditLinksetUseWalkable != NULL); + llassert(mEditLinksetUseWalkable != nullptr); mEditLinksetUseStaticObstacle = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getLinksetUseString(LLPathfindingLinkset::kStaticObstacle), XUI_LINKSET_USE_STATIC_OBSTACLE)); - llassert(mEditLinksetUseStaticObstacle != NULL); + llassert(mEditLinksetUseStaticObstacle != nullptr); mEditLinksetUseDynamicObstacle = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getLinksetUseString(LLPathfindingLinkset::kDynamicObstacle), XUI_LINKSET_USE_DYNAMIC_OBSTACLE)); - llassert(mEditLinksetUseDynamicObstacle != NULL); + llassert(mEditLinksetUseDynamicObstacle != nullptr); mEditLinksetUseMaterialVolume = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getLinksetUseString(LLPathfindingLinkset::kMaterialVolume), XUI_LINKSET_USE_MATERIAL_VOLUME)); - llassert(mEditLinksetUseMaterialVolume != NULL); + llassert(mEditLinksetUseMaterialVolume != nullptr); mEditLinksetUseExclusionVolume = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getLinksetUseString(LLPathfindingLinkset::kExclusionVolume), XUI_LINKSET_USE_EXCLUSION_VOLUME)); - llassert(mEditLinksetUseExclusionVolume != NULL); + llassert(mEditLinksetUseExclusionVolume != nullptr); mEditLinksetUseDynamicPhantom = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getLinksetUseString(LLPathfindingLinkset::kDynamicPhantom), XUI_LINKSET_USE_DYNAMIC_PHANTOM)); - llassert(mEditLinksetUseDynamicPhantom != NULL); + llassert(mEditLinksetUseDynamicPhantom != nullptr); mEditLinksetUse->selectFirstItem(); mLabelWalkabilityCoefficients = findChild("walkability_coefficients_label"); - llassert(mLabelWalkabilityCoefficients != NULL); + llassert(mLabelWalkabilityCoefficients != nullptr); mLabelEditA = findChild("edit_a_label"); - llassert(mLabelEditA != NULL); + llassert(mLabelEditA != nullptr); mLabelSuggestedUseA = findChild("suggested_use_a_label"); - llassert(mLabelSuggestedUseA != NULL); + llassert(mLabelSuggestedUseA != nullptr); mEditA = findChild("edit_a_value"); - llassert(mEditA != NULL); + llassert(mEditA != nullptr); mEditA->setPrevalidate(LLTextValidate::validateNonNegativeS32); mEditA->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1, mPreviousValueA)); mLabelEditB = findChild("edit_b_label"); - llassert(mLabelEditB != NULL); + llassert(mLabelEditB != nullptr); mLabelSuggestedUseB = findChild("suggested_use_b_label"); - llassert(mLabelSuggestedUseB != NULL); + llassert(mLabelSuggestedUseB != nullptr); mEditB = findChild("edit_b_value"); - llassert(mEditB != NULL); + llassert(mEditB != nullptr); mEditB->setPrevalidate(LLTextValidate::validateNonNegativeS32); mEditB->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1, mPreviousValueB)); mLabelEditC = findChild("edit_c_label"); - llassert(mLabelEditC != NULL); + llassert(mLabelEditC != nullptr); mLabelSuggestedUseC = findChild("suggested_use_c_label"); - llassert(mLabelSuggestedUseC != NULL); + llassert(mLabelSuggestedUseC != nullptr); mEditC = findChild("edit_c_value"); - llassert(mEditC != NULL); + llassert(mEditC != nullptr); mEditC->setPrevalidate(LLTextValidate::validateNonNegativeS32); mEditC->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1, mPreviousValueC)); mLabelEditD = findChild("edit_d_label"); - llassert(mLabelEditD != NULL); + llassert(mLabelEditD != nullptr); mLabelSuggestedUseD = findChild("suggested_use_d_label"); - llassert(mLabelSuggestedUseD != NULL); + llassert(mLabelSuggestedUseD != nullptr); mEditD = findChild("edit_d_value"); - llassert(mEditD != NULL); + llassert(mEditD != nullptr); mEditD->setPrevalidate(LLTextValidate::validateNonNegativeS32); mEditD->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1, mPreviousValueD)); mApplyEditsButton = findChild("apply_edit_values"); - llassert(mApplyEditsButton != NULL); + llassert(mApplyEditsButton != nullptr); mApplyEditsButton->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyChangesClicked, this)); return LLFloaterPathfindingObjects::postBuild(); @@ -218,7 +218,7 @@ void LLFloaterPathfindingLinksets::requestGetObjects() void LLFloaterPathfindingLinksets::buildObjectsScrollList(const LLPathfindingObjectListPtr pObjectListPtr) { - llassert(pObjectListPtr != NULL); + llassert(pObjectListPtr != nullptr); llassert(!pObjectListPtr->isEmpty()); std::string nameFilter = mFilterByName->getText(); @@ -238,7 +238,7 @@ void LLFloaterPathfindingLinksets::buildObjectsScrollList(const LLPathfindingObj { const LLPathfindingObjectPtr objectPtr = objectIter->second; const LLPathfindingLinkset *linksetPtr = dynamic_cast(objectPtr.get()); - llassert(linksetPtr != NULL); + llassert(linksetPtr != nullptr); std::string linksetName = (linksetPtr->isTerrain() ? getString("linkset_terrain_name") : linksetPtr->getName()); std::string linksetDescription = linksetPtr->getDescription(); @@ -260,7 +260,7 @@ void LLFloaterPathfindingLinksets::buildObjectsScrollList(const LLPathfindingObj { const LLPathfindingObjectPtr objectPtr = objectIter->second; const LLPathfindingLinkset *linksetPtr = dynamic_cast(objectPtr.get()); - llassert(linksetPtr != NULL); + llassert(linksetPtr != nullptr); LLSD scrollListItemData = buildLinksetScrollListItemData(linksetPtr, avatarPosition); addObjectToScrollList(objectPtr, scrollListItemData); @@ -327,7 +327,7 @@ void LLFloaterPathfindingLinksets::onClearFiltersClicked() void LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl, LLSD &pPreviousValue) { LLLineEditor *pLineEditor = static_cast(pUICtrl); - llassert(pLineEditor != NULL); + llassert(pLineEditor != nullptr); const std::string &valueString = pLineEditor->getText(); @@ -384,7 +384,7 @@ void LLFloaterPathfindingLinksets::updateEditFieldValues() else { LLPathfindingObjectPtr firstSelectedObjectPtr = getFirstSelectedObject(); - llassert(firstSelectedObjectPtr != NULL); + llassert(firstSelectedObjectPtr != nullptr); const LLPathfindingLinkset *linkset = dynamic_cast(firstSelectedObjectPtr.get()); @@ -402,7 +402,7 @@ void LLFloaterPathfindingLinksets::updateEditFieldValues() LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListItemData(const LLPathfindingLinkset *pLinksetPtr, const LLVector3 &pAvatarPosition) const { - llassert(pLinksetPtr != NULL); + llassert(pLinksetPtr != nullptr); LLSD columns = LLSD::emptyArray(); if (pLinksetPtr->isTerrain()) @@ -507,7 +507,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(selectedObjects.get()); isShowWarning = linksetList->isShowUnmodifiablePhantomWarning(pLinksetUse); @@ -524,7 +524,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(selectedObjects.get()); isShowWarning = linksetList->isShowPhantomToggleWarning(pLinksetUse); @@ -541,7 +541,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(selectedObjects.get()); isShowWarning = linksetList->isShowCannotBeVolumeWarning(pLinksetUse); @@ -585,7 +585,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(selectedObjects.get()); linksetList->determinePossibleStates(useWalkable, useStaticObstacle, useDynamicObstacle, useMaterialVolume, useExclusionVolume, useDynamicPhantom); @@ -657,7 +657,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(); const std::string &aString = mEditA->getText(); diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index 402da273c8..d1f5bf1b9d 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -150,7 +150,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); @@ -162,17 +162,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(), @@ -202,46 +202,46 @@ bool LLFloaterPathfindingObjects::postBuild() mWarningTextColor = LLUIColorTable::getInstance()->getColor("PathfindingWarningColor"); mObjectsScrollList = findChild("objects_scroll_list"); - llassert(mObjectsScrollList != NULL); + llassert(mObjectsScrollList != nullptr); mObjectsScrollList->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onScrollListSelectionChanged, this)); mObjectsScrollList->sortByColumnIndex(static_cast(getNameColumnIndex()), true); mMessagingStatus = findChild("messaging_status"); - llassert(mMessagingStatus != NULL); + llassert(mMessagingStatus != nullptr); mRefreshListButton = findChild("refresh_objects_list"); - llassert(mRefreshListButton != NULL); + llassert(mRefreshListButton != nullptr); mRefreshListButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onRefreshObjectsClicked, this)); mSelectAllButton = findChild("select_all_objects"); - llassert(mSelectAllButton != NULL); + llassert(mSelectAllButton != nullptr); mSelectAllButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onSelectAllObjectsClicked, this)); mSelectNoneButton = findChild("select_none_objects"); - llassert(mSelectNoneButton != NULL); + llassert(mSelectNoneButton != nullptr); mSelectNoneButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onSelectNoneObjectsClicked, this)); mShowBeaconCheckBox = findChild("show_beacon"); - llassert(mShowBeaconCheckBox != NULL); + llassert(mShowBeaconCheckBox != nullptr); mTakeButton = findChild("take_objects"); - llassert(mTakeButton != NULL); + llassert(mTakeButton != nullptr); mTakeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onTakeClicked, this)); mTakeCopyButton = findChild("take_copy_objects"); - llassert(mTakeCopyButton != NULL); + llassert(mTakeCopyButton != nullptr); mTakeCopyButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onTakeCopyClicked, this)); mReturnButton = findChild("return_objects"); - llassert(mReturnButton != NULL); + llassert(mReturnButton != nullptr); mReturnButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onReturnClicked, this)); mDeleteButton = findChild("delete_objects"); - llassert(mDeleteButton != NULL); + llassert(mDeleteButton != nullptr); mDeleteButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onDeleteClicked, this)); mTeleportButton = findChild("teleport_me_to_object"); - llassert(mTeleportButton != NULL); + llassert(mTeleportButton != nullptr); mTeleportButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onTeleportClicked, this)); return LLFloater::postBuild(); @@ -301,7 +301,7 @@ void LLFloaterPathfindingObjects::handleUpdateObjectList(LLPathfindingManager::r setMessagingState(kMessagingSetRequestSent); break; case LLPathfindingManager::kRequestCompleted : - if (mObjectList == NULL) + if (mObjectList == nullptr) { mObjectList = pObjectList; } @@ -351,7 +351,7 @@ void LLFloaterPathfindingObjects::rebuildObjectsScrollList(bool update_if_needed mObjectsScrollList->deleteAllItems(); mMissingNameObjectsScrollListItems.clear(); - if ((mObjectList != NULL) && !mObjectList->isEmpty()) + if ((mObjectList != nullptr) && !mObjectList->isEmpty()) { buildObjectsScrollList(mObjectList); @@ -532,10 +532,10 @@ void LLFloaterPathfindingObjects::teleportToSelectedObject() { std::vector::const_reference selectedItemRef = selectedItems.front(); const LLScrollListItem *selectedItem = selectedItemRef; - llassert(mObjectList != NULL); + llassert(mObjectList != nullptr); 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()); @@ -573,7 +573,7 @@ LLPathfindingObjectListPtr LLFloaterPathfindingObjects::getSelectedObjects() con itemIter != selectedItems.end(); ++itemIter) { LLPathfindingObjectPtr objectPtr = findObject(*itemIter); - if (objectPtr != NULL) + if (objectPtr != nullptr) { selectedObjects->update(objectPtr); } @@ -700,13 +700,13 @@ void LLFloaterPathfindingObjects::onGodLevelChange(U8 pGodLevel) void LLFloaterPathfindingObjects::handleObjectNameResponse(const LLPathfindingObject *pObject) { - llassert(pObject != NULL); + llassert(pObject != nullptr); const std::string uuid = pObject->getUUID().asString(); scroll_list_item_map::iterator scrollListItemIter = mMissingNameObjectsScrollListItems.find(uuid); if (scrollListItemIter != mMissingNameObjectsScrollListItems.end()) { LLScrollListItem *scrollListItem = scrollListItemIter->second; - llassert(scrollListItem != NULL); + llassert(scrollListItem != nullptr); LLScrollListCell *scrollListCell = scrollListItem->getColumn(getOwnerNameColumnIndex()); LLSD ownerName = getOwnerName(pObject); @@ -846,7 +846,7 @@ void LLFloaterPathfindingObjects::selectScrollListItemsInWorld() const LLScrollListItem *selectedItem = *selectedItemIter; LLViewerObject *viewerObject = gObjectList.findObject(selectedItem->getUUID()); - if (viewerObject != NULL) + if (viewerObject != nullptr) { viewerObjects.push_back(viewerObject); } @@ -883,7 +883,7 @@ LLPathfindingObjectPtr LLFloaterPathfindingObjects::findObject(const LLScrollLis LLUUID uuid = pListItem->getUUID(); const std::string &uuidString = uuid.asString(); - llassert(mObjectList != NULL); + llassert(mObjectList != nullptr); objectPtr = mObjectList->find(uuidString); return objectPtr; diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index d5e45c09e3..3d12cf959e 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -141,7 +141,7 @@ LLFloaterPay::~LLFloaterPay() std::vector::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 @@ -218,7 +218,7 @@ bool LLFloaterPay::postBuild() void LLFloaterPay::onClose(bool app_quitting) { // Deselect the objects - mObjectSelection = NULL; + mObjectSelection = nullptr; } // static @@ -350,7 +350,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 @@ -405,7 +405,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); @@ -570,7 +570,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/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index 3eb0c849d3..b33dc63cb6 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -596,7 +596,7 @@ static LLVOAvatar* find_avatar(const LLUUID& id) } else { - return NULL; + return nullptr; } } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 425e9e2269..983cc571c2 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -566,10 +566,10 @@ LLFloaterPreference::~LLFloaterPreference() void LLFloaterPreference::draw() { - bool has_first_selected = (mDisabledPopups->getFirstSelected()!=NULL); + bool has_first_selected = (mDisabledPopups->getFirstSelected()!=nullptr); mEnablePopupBtn->setEnabled(has_first_selected); - has_first_selected = (mEnabledPopups->getFirstSelected()!=NULL); + has_first_selected = (mEnabledPopups->getFirstSelected()!=nullptr); mDisablePopupBtn->setEnabled(has_first_selected); LLFloater::draw(); @@ -1235,7 +1235,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) @@ -1688,7 +1688,7 @@ bool LLFloaterPreference::loadFromFilename(const std::string& filename, std::map { LLXMLNodePtr root; - if (!LLXMLNode::parseFile(filename, root, NULL)) + if (!LLXMLNode::parseFile(filename, root, nullptr)) { LL_WARNS("Preferences") << "Unable to parse file " << filename << LL_ENDL; return false; @@ -2011,7 +2011,7 @@ void LLFloaterPreference::selectPanel(const LLSD& name) { LLTabContainer * tab_containerp = getChild("pref core"); LLPanel * panel = tab_containerp->getPanelByName(name.asStringRef()); - if (NULL != panel) + if (nullptr != panel) { tab_containerp->selectTabPanel(panel); } @@ -2104,7 +2104,7 @@ class LLPanelPreference::Updater : public LLEventTimer static LLPanelInjector 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)); @@ -2840,7 +2840,7 @@ void LLPanelPreferenceControls::updateTable() std::string control = list[i]->getValue(); if (!control.empty()) { - LLScrollListCell* cell = NULL; + LLScrollListCell* cell = nullptr; S32 num_columns = pControlsTable->getNumColumns(); for (S32 col = 1; col < num_columns; col++) @@ -2908,7 +2908,7 @@ void LLPanelPreferenceControls::resetDirtyChilds() void LLPanelPreferenceControls::onListCommit() { LLScrollListItem* item = pControlsTable->getFirstSelected(); - if (item == NULL) + if (item == nullptr) { return; } diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp index 96c2e1e1e4..8ca8984ee2 100644 --- a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp @@ -206,7 +206,7 @@ void LLFloaterPreferenceGraphicsAdvanced::updateObjectMeshDetailText() 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 diff --git a/indra/newview/llfloaterprofiletexture.cpp b/indra/newview/llfloaterprofiletexture.cpp index 8cb941cb12..97452b0555 100644 --- a/indra/newview/llfloaterprofiletexture.cpp +++ b/indra/newview/llfloaterprofiletexture.cpp @@ -45,10 +45,10 @@ static LLDefaultChildRegistry::Register r("profile_image"); LLProfileImageCtrl::LLProfileImageCtrl(const LLProfileImageCtrl::Params& p) : LLIconCtrl(p) - , mImage(NULL) + , mImage(nullptr) , mImageOldBoostLevel(LLGLTexture::BOOST_NONE) , mWasNoDelete(false) - , mImageLoadedSignal(NULL) + , mImageLoadedSignal(nullptr) { } @@ -70,7 +70,7 @@ void LLProfileImageCtrl::releaseTexture() // In most cases setBoostLevel marks images as NO_DELETE mImage->forceActive(); } - mImage = NULL; + mImage = nullptr; } } @@ -185,8 +185,8 @@ LLFloaterProfileTexture::LLFloaterProfileTexture(LLView* owner) , mLastWidth(0) , mOwnerHandle(owner->getHandle()) , mContextConeOpacity(0.f) - , mCloseButton(NULL) - , mProfileIcon(NULL) + , mCloseButton(nullptr) + , mProfileIcon(nullptr) { buildFromFile("floater_profile_texture.xml"); } diff --git a/indra/newview/llfloaterregiondebugconsole.cpp b/indra/newview/llfloaterregiondebugconsole.cpp index 26647333dc..eff67df99d 100644 --- a/indra/newview/llfloaterregiondebugconsole.cpp +++ b/indra/newview/llfloaterregiondebugconsole.cpp @@ -92,7 +92,7 @@ boost::signals2::connection LLFloaterRegionDebugConsole::setConsoleReplyCallback } LLFloaterRegionDebugConsole::LLFloaterRegionDebugConsole(LLSD const & key) -: LLFloater(key), mOutput(NULL) +: LLFloater(key), mOutput(nullptr) { mReplySignalConnection = sConsoleReplySignal.connect( boost::bind( @@ -160,7 +160,7 @@ void LLFloaterRegionDebugConsole::onInput(LLUICtrl* ctrl, const LLSD& param) { LLSD postData = LLSD(input->getText()); LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, postData, - NULL, + nullptr, boost::bind(&LLFloaterRegionDebugConsole::onAsyncConsoleError, this, _1)); } diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 4cb6e7be96..925e8b3c63 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -230,7 +230,7 @@ LLUUID LLFloaterRegionInfo::sRequestInvoice; LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) : LLFloater(seed), - mEnvironmentPanel(NULL), + mEnvironmentPanel(nullptr), mRegionChangedCallback() {} @@ -584,7 +584,7 @@ void LLFloaterRegionInfo::sRefreshFromRegion(LLViewerRegion* region) LLPanelEstateInfo* LLFloaterRegionInfo::getPanelEstate() { LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance("region_info"); - if (!floater) return NULL; + if (!floater) return nullptr; LLTabContainer* tab = floater->getChild("region_panels"); LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild("Estate"); return panel; @@ -594,7 +594,7 @@ LLPanelEstateInfo* LLFloaterRegionInfo::getPanelEstate() LLPanelEstateAccess* LLFloaterRegionInfo::getPanelAccess() { LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance("region_info"); - if (!floater) return NULL; + if (!floater) return nullptr; LLTabContainer* tab = floater->getChild("region_panels"); LLPanelEstateAccess* panel = (LLPanelEstateAccess*)tab->getChild("Access"); return panel; @@ -604,7 +604,7 @@ LLPanelEstateAccess* LLFloaterRegionInfo::getPanelAccess() LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant() { LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance("region_info"); - if (!floater) return NULL; + if (!floater) return nullptr; LLTabContainer* tab = floater->getChild("region_panels"); LLPanelEstateCovenant* panel = (LLPanelEstateCovenant*)tab->getChild("Covenant"); return panel; @@ -614,7 +614,7 @@ LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant() LLPanelRegionGeneralInfo* LLFloaterRegionInfo::getPanelGeneral() { LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance("region_info"); - if (!floater) return NULL; + if (!floater) return nullptr; LLTabContainer* tab = floater->getChild("region_panels"); LLPanelRegionGeneralInfo* panel = (LLPanelRegionGeneralInfo*)tab->getChild("General"); return panel; @@ -624,7 +624,7 @@ LLPanelRegionGeneralInfo* LLFloaterRegionInfo::getPanelGeneral() LLPanelRegionEnvironment* LLFloaterRegionInfo::getPanelEnvironment() { LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance("region_info"); - if (!floater) return NULL; + if (!floater) return nullptr; LLTabContainer* tab = floater->getChild("region_panels"); LLPanelRegionEnvironment* panel = (LLPanelRegionEnvironment*)tab->getChild("panel_env_info"); return panel; @@ -647,7 +647,7 @@ LLPanelRegionTerrainInfo* LLFloaterRegionInfo::getPanelRegionTerrain() if (!floater) { llassert(floater); - return NULL; + return nullptr; } LLTabContainer* tab_container = floater->getChild("region_panels"); @@ -660,7 +660,7 @@ LLPanelRegionTerrainInfo* LLFloaterRegionInfo::getPanelRegionTerrain() LLPanelRegionExperiences* LLFloaterRegionInfo::getPanelExperiences() { LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance("region_info"); - if (!floater) return NULL; + if (!floater) return nullptr; LLTabContainer* tab = floater->getChild("region_panels"); return (LLPanelRegionExperiences*)tab->getChild("Experiences"); } @@ -820,7 +820,7 @@ void LLPanelRegionInfo::sendEstateOwnerMessage( if(strings.empty()) { msg->nextBlock("ParamList"); - msg->addString("Parameter", NULL); + msg->addString("Parameter", nullptr); } else { @@ -2628,7 +2628,7 @@ bool LLPanelEstateCovenant::postBuild() mEditor = getChild("covenant_editor"); LLButton* reset_button = getChild("reset_covenant"); reset_button->setEnabled(gAgent.canManageEstate()); - reset_button->setClickedCallback(LLPanelEstateCovenant::resetCovenantID, NULL); + reset_button->setClickedCallback(LLPanelEstateCovenant::resetCovenantID, nullptr); return LLPanelRegionInfo::postBuild(); } @@ -2709,7 +2709,7 @@ bool LLPanelEstateCovenant::confirmResetCovenantCallback(const LLSD& notificatio switch(option) { case 0: - self->loadInvItem(NULL); + self->loadInvItem(nullptr); break; default: break; @@ -2991,14 +2991,14 @@ bool LLDispatchSetEstateExperience::operator()( // Skip 2 parameters sparam_t::const_iterator it = strings.begin(); - ++it; // U32 estate_id = strtol((*it).c_str(), NULL, 10); - ++it; // U32 send_to_agent_only = strtoul((*(++it)).c_str(), NULL, 10); + ++it; // U32 estate_id = strtol((*it).c_str(), nullptr, 10); + ++it; // U32 send_to_agent_only = strtoul((*(++it)).c_str(), nullptr, 10); // Read 3 parameters 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)) @@ -3585,12 +3585,12 @@ bool LLPanelEstateAccess::accessAddCore2(const LLSD& notification, const LLSD& r LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]); //Get parent floater name LLPanelEstateAccess* panel = LLFloaterRegionInfo::getPanelAccess(); - LLFloater* parent_floater = panel ? gFloaterView->getParentFloater(panel) : NULL; + LLFloater* parent_floater = panel ? gFloaterView->getParentFloater(panel) : nullptr; const std::string& parent_floater_name = parent_floater ? parent_floater->getName() : ""; //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: @@ -3628,7 +3628,7 @@ void LLPanelEstateAccess::accessAddCore3(const uuid_vec_t& ids, std::vector("preset_combo"); mNameEditor = getChild("preset_txt_editor"); - mNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterSaveCameraPreset::onPresetNameEdited, this), NULL); + mNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterSaveCameraPreset::onPresetNameEdited, this), nullptr); mSaveButton = getChild("save"); mSaveButton->setCommitCallback(boost::bind(&LLFloaterSaveCameraPreset::onBtnSave, this)); diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp index 49cb5d34ff..fb51208984 100644 --- a/indra/newview/llfloaterscriptdebug.cpp +++ b/indra/newview/llfloaterscriptdebug.cpp @@ -86,7 +86,7 @@ void LLFloaterScriptDebug::setVisible(bool visible) if(visible) { LLFloaterScriptDebugOutput* floater_output = LLFloaterReg::findTypedInstance("script_debug_output", LLUUID::null); - if (floater_output == NULL) + if (floater_output == nullptr) { floater_output = dynamic_cast(LLFloaterReg::showInstance("script_debug_output", LLUUID::null, false)); if (floater_output) @@ -115,12 +115,12 @@ LLFloater* LLFloaterScriptDebug::addOutputWindow(const LLUUID &object_id) { LLMultiFloater* host = LLFloaterReg::showTypedInstance("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/llfloaterscriptedprefs.cpp b/indra/newview/llfloaterscriptedprefs.cpp index fa31cd72c1..2fd9611889 100644 --- a/indra/newview/llfloaterscriptedprefs.cpp +++ b/indra/newview/llfloaterscriptedprefs.cpp @@ -34,7 +34,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/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 58d624a7d0..302c5ffcc6 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -911,7 +911,7 @@ void LLPanelScriptLimitsRegionMemory::returnObjects() } } - onClickRefresh(NULL); + onClickRefresh(nullptr); } diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index 691458d80a..72b67bb9e0 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 }; @@ -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/llfloatersettingscolor.cpp b/indra/newview/llfloatersettingscolor.cpp index d9c382a1dc..3740ea3273 100644 --- a/indra/newview/llfloatersettingscolor.cpp +++ b/indra/newview/llfloatersettingscolor.cpp @@ -41,7 +41,7 @@ LLFloaterSettingsColor::LLFloaterSettingsColor(const LLSD& key) : LLFloater(key), - mSettingList(NULL) + mSettingList(nullptr) { mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterSettingsColor::onCommitSettings, this)); mCommitCallbackRegistrar.add("ClickDefault", boost::bind(&LLFloaterSettingsColor::onClickDefault, this)); diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index 01108b5cfa..245c1b3016 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -38,7 +38,7 @@ LLFloaterSettingsDebug::LLFloaterSettingsDebug(const LLSD& key) : LLFloater(key), - mSettingList(NULL) + mSettingList(nullptr) { mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterSettingsDebug::onCommitSettings, this)); mCommitCallbackRegistrar.add("ClickDefault", boost::bind(&LLFloaterSettingsDebug::onClickDefault, this)); diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 78550b6520..6eafe75384 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -140,7 +140,7 @@ void LLFloaterSidePanelContainer::onCloseMsgCallback(const LLSD& notification, c LLFloater* LLFloaterSidePanelContainer::getTopmostInventoryFloater() { - LLFloater* topmost_floater = NULL; + LLFloater* topmost_floater = nullptr; S32 z_min = S32_MAX; LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); @@ -165,7 +165,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(std::string_view panel_name { LLView* view = findChildView(panel_name, true); if (!view) - return NULL; + return nullptr; if (!getVisible()) { @@ -176,7 +176,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(std::string_view panel_name setFocus(true); } - LLPanel* panel = NULL; + LLPanel* panel = nullptr; LLSideTrayPanelContainer* container = dynamic_cast(view->getParent()); if (container) @@ -184,7 +184,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(std::string_view panel_name container->openPanel(panel_name, params); panel = container->getCurrentPanel(); } - else if ((panel = dynamic_cast(view)) != NULL) + else if ((panel = dynamic_cast(view)) != nullptr) { panel->onOpen(params); } @@ -225,7 +225,7 @@ LLPanel* LLFloaterSidePanelContainer::getPanel(std::string_view floater_name, st } } - return NULL; + return nullptr; } LLPanel* LLFloaterSidePanelContainer::findPanel(std::string_view floater_name, std::string_view panel_name) @@ -243,5 +243,5 @@ LLPanel* LLFloaterSidePanelContainer::findPanel(std::string_view floater_name, s } } - return NULL; + return nullptr; } diff --git a/indra/newview/llfloatersimplesnapshot.cpp b/indra/newview/llfloatersimplesnapshot.cpp index 55b39d9193..dbc8df6c93 100644 --- a/indra/newview/llfloatersimplesnapshot.cpp +++ b/indra/newview/llfloatersimplesnapshot.cpp @@ -41,7 +41,7 @@ -LLSimpleSnapshotFloaterView* gSimpleSnapshotFloaterView = NULL; +LLSimpleSnapshotFloaterView* gSimpleSnapshotFloaterView = nullptr; const S32 LLFloaterSimpleSnapshot::THUMBNAIL_SNAPSHOT_DIM_MAX = 256; const S32 LLFloaterSimpleSnapshot::THUMBNAIL_SNAPSHOT_DIM_MIN = 64; @@ -258,7 +258,7 @@ void LLFloaterSimpleSnapshot::Impl::setStatus(EStatus status, bool ok, const std LLFloaterSimpleSnapshot::LLFloaterSimpleSnapshot(const LLSD& key) : LLFloaterSnapshotBase(key) - , mOwner(NULL) + , mOwner(nullptr) , mContextConeOpacity(0.f) { impl = new Impl(this); @@ -501,7 +501,7 @@ void LLFloaterSimpleSnapshot::saveTexture() LLSnapshotLivePreview* previewp = getPreviewView(); if (!previewp) { - llassert(previewp != NULL); + llassert(previewp != nullptr); return; } diff --git a/indra/newview/llfloatersimplesnapshot.h b/indra/newview/llfloatersimplesnapshot.h index 5620a15d87..2f25056b1a 100644 --- a/indra/newview/llfloatersimplesnapshot.h +++ b/indra/newview/llfloatersimplesnapshot.h @@ -115,7 +115,7 @@ class LLFloaterSimpleSnapshot::Impl : public LLFloaterSnapshotBase::ImplBase static void onSnapshotUploadFinished(LLFloaterSnapshotBase* floater, bool status); - LLPanelSnapshot* getActivePanel(LLFloaterSnapshotBase* floater, bool ok_if_not_found = true) { return NULL; } + LLPanelSnapshot* getActivePanel(LLFloaterSnapshotBase* floater, bool ok_if_not_found = true) { return nullptr; } LLSnapshotModel::ESnapshotFormat getImageFormat(LLFloaterSnapshotBase* floater); std::string getSnapshotPanelPrefix(); diff --git a/indra/newview/llfloaterslapptest.cpp b/indra/newview/llfloaterslapptest.cpp index 0075379529..6186d412eb 100644 --- a/indra/newview/llfloaterslapptest.cpp +++ b/indra/newview/llfloaterslapptest.cpp @@ -45,7 +45,7 @@ bool LLFloaterSLappTest::postBuild() { std::string slapp(getString("remove_folder_slapp")); getChild("remove_folder_txt")->setValue(slapp + editor->getValue().asString()); - }, NULL); + }, nullptr); return true; } diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index faf7ed0d8c..46a204ea97 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -67,7 +67,7 @@ LLPanelSnapshot* LLFloaterSnapshot::Impl::getActivePanel(LLFloaterSnapshotBase* { LL_WARNS() << "No snapshot active panel, current panel index: " << panel_container->getCurrentPanelIndex() << LL_ENDL; } - llassert_always(active_panel != NULL); + llassert_always(active_panel != nullptr); } return active_panel; } @@ -936,10 +936,10 @@ void LLFloaterSnapshot::Impl::onSendingPostcardFinished(LLFloaterSnapshotBase* f // Default constructor LLFloaterSnapshotBase::LLFloaterSnapshotBase(const LLSD& key) : LLFloater(key), - mRefreshBtn(NULL), - mRefreshLabel(NULL), - mSucceessLblPanel(NULL), - mFailureLblPanel(NULL) + mRefreshBtn(nullptr), + mRefreshLabel(nullptr), + mSucceessLblPanel(nullptr), + mFailureLblPanel(nullptr) { } @@ -1289,7 +1289,7 @@ void LLFloaterSnapshotBase::ImplBase::updateLivePreview() void LLFloaterSnapshot::update() { LLFloaterSnapshot* inst = findInstance(); - if (inst != NULL) + if (inst != nullptr) { inst->impl->updateLivePreview(); } @@ -1319,7 +1319,7 @@ void LLFloaterSnapshot::saveTexture() LLSnapshotLivePreview* previewp = getPreviewView(); if (!previewp) { - llassert(previewp != NULL); + llassert(previewp != nullptr); return; } @@ -1330,7 +1330,7 @@ void LLFloaterSnapshot::saveLocal(const snapshot_saved_signal_t::slot_type& succ { LL_DEBUGS() << "saveLocal" << LL_ENDL; LLSnapshotLivePreview* previewp = getPreviewView(); - llassert(previewp != NULL); + llassert(previewp != nullptr); if (previewp) { previewp->saveLocal(success_cb, failure_cb); @@ -1365,15 +1365,15 @@ LLPointer LLFloaterSnapshotBase::getImageData() LLSnapshotLivePreview* previewp = getPreviewView(); if (!previewp) { - llassert(previewp != NULL); - return NULL; + llassert(previewp != nullptr); + return nullptr; } LLPointer img = previewp->getFormattedImage(); if (!img.get()) { LL_WARNS() << "Empty snapshot image data" << LL_ENDL; - llassert(img.get() != NULL); + llassert(img.get() != nullptr); } return img; @@ -1384,7 +1384,7 @@ const LLVector3d& LLFloaterSnapshotBase::getPosTakenGlobal() LLSnapshotLivePreview* previewp = getPreviewView(); if (!previewp) { - llassert(previewp != NULL); + llassert(previewp != nullptr); return LLVector3d::zero; } @@ -1446,7 +1446,7 @@ bool LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask) return LLFloaterView::handleMouseDown(x, y, mask); } // give floater a change to handle mouse, else camera tool - if (childrenHandleMouseDown(x, y, mask) == NULL) + if (childrenHandleMouseDown(x, y, mask) == nullptr) { LLToolMgr::getInstance()->getCurrentTool()->handleMouseDown( x, y, mask ); } @@ -1462,7 +1462,7 @@ bool LLSnapshotFloaterView::handleMouseUp(S32 x, S32 y, MASK mask) return LLFloaterView::handleMouseUp(x, y, mask); } // give floater a change to handle mouse, else camera tool - if (childrenHandleMouseUp(x, y, mask) == NULL) + if (childrenHandleMouseUp(x, y, mask) == nullptr) { LLToolMgr::getInstance()->getCurrentTool()->handleMouseUp( x, y, mask ); } @@ -1478,7 +1478,7 @@ bool LLSnapshotFloaterView::handleHover(S32 x, S32 y, MASK mask) return LLFloaterView::handleHover(x, y, mask); } // give floater a change to handle mouse, else camera tool - if (childrenHandleHover(x, y, mask) == NULL) + if (childrenHandleHover(x, y, mask) == nullptr) { LLToolMgr::getInstance()->getCurrentTool()->handleHover( x, y, mask ); } diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index 186d9c41cf..40a1d7236d 100644 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -86,7 +86,7 @@ class LLFloaterSnapshotBase::ImplBase } EStatus; ImplBase(LLFloaterSnapshotBase* floater) : mAvatarPauseHandles(), - mLastToolset(NULL), + mLastToolset(nullptr), mAspectRatioCheckOff(false), mNeedRefresh(false), mSkipReshaping(false), diff --git a/indra/newview/llfloatersounddevices.cpp b/indra/newview/llfloatersounddevices.cpp index f11c5c0ad8..1551befd13 100644 --- a/indra/newview/llfloatersounddevices.cpp +++ b/indra/newview/llfloatersounddevices.cpp @@ -37,7 +37,7 @@ // protected LLFloaterSoundDevices::LLFloaterSoundDevices(const LLSD& key) -: LLTransientDockableFloater(NULL, false, key) +: LLTransientDockableFloater(nullptr, false, key) { LLTransientFloaterMgr::getInstance()->addControlView(this); diff --git a/indra/newview/llfloaterspellchecksettings.cpp b/indra/newview/llfloaterspellchecksettings.cpp index e58e819345..fe90cb51cb 100644 --- a/indra/newview/llfloaterspellchecksettings.cpp +++ b/indra/newview/llfloaterspellchecksettings.cpp @@ -399,7 +399,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/llfloatertelehub.cpp b/indra/newview/llfloatertelehub.cpp index e49b5045e3..8a97f38117 100644 --- a/indra/newview/llfloatertelehub.cpp +++ b/indra/newview/llfloatertelehub.cpp @@ -85,7 +85,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() @@ -103,7 +103,7 @@ void LLFloaterTelehub::refresh() constexpr 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); @@ -116,7 +116,7 @@ void LLFloaterTelehub::refresh() LLScrollListCtrl* list = getChild("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/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index f6d8fcab36..22a1454450 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -89,7 +89,7 @@ #include "llmeshrepository.h" // Globals -LLFloaterTools *gFloaterTools = NULL; +LLFloaterTools *gFloaterTools = nullptr; bool LLFloaterTools::sShowObjectCost = true; bool LLFloaterTools::sPreviousFocusOnAvatar = false; @@ -321,58 +321,58 @@ bool LLFloaterTools::postBuild() // during LLViewerWindow's per-frame hover processing. LLFloaterTools::LLFloaterTools(const LLSD& key) : LLFloater(key), - mBtnFocus(NULL), - mBtnMove(NULL), - mBtnEdit(NULL), - mBtnCreate(NULL), - mBtnLand(NULL), - mTextStatus(NULL), - - mRadioGroupFocus(NULL), - mRadioGroupMove(NULL), - mRadioGroupEdit(NULL), - - mCheckSelectIndividual(NULL), - - mCheckSnapToGrid(NULL), - mBtnGridOptions(NULL), - mComboGridMode(NULL), - mCheckStretchUniform(NULL), - mCheckStretchTexture(NULL), - mCheckStretchUniformLabel(NULL), - - mBtnRotateLeft(NULL), - mBtnRotateReset(NULL), - mBtnRotateRight(NULL), - - mBtnLink(NULL), - mBtnUnlink(NULL), - - mBtnDelete(NULL), - mBtnDuplicate(NULL), - mBtnDuplicateInPlace(NULL), - - mCheckSticky(NULL), - mCheckCopySelection(NULL), - mCheckCopyCenters(NULL), - mCheckCopyRotates(NULL), - mRadioGroupLand(NULL), - mSliderDozerSize(NULL), - mSliderDozerForce(NULL), - mBtnApplyToSelection(NULL), - - mTab(NULL), - mPanelPermissions(NULL), - mPanelObject(NULL), - mPanelVolume(NULL), - mPanelContents(NULL), - mPanelFace(NULL), - mPanelLandInfo(NULL), - - mCostTextBorder(NULL), - mTabLand(NULL), - - mLandImpactsObserver(NULL), + mBtnFocus(nullptr), + mBtnMove(nullptr), + mBtnEdit(nullptr), + mBtnCreate(nullptr), + mBtnLand(nullptr), + mTextStatus(nullptr), + + mRadioGroupFocus(nullptr), + mRadioGroupMove(nullptr), + mRadioGroupEdit(nullptr), + + mCheckSelectIndividual(nullptr), + + mCheckSnapToGrid(nullptr), + mBtnGridOptions(nullptr), + mComboGridMode(nullptr), + mCheckStretchUniform(nullptr), + mCheckStretchTexture(nullptr), + mCheckStretchUniformLabel(nullptr), + + mBtnRotateLeft(nullptr), + mBtnRotateReset(nullptr), + mBtnRotateRight(nullptr), + + mBtnLink(nullptr), + mBtnUnlink(nullptr), + + mBtnDelete(nullptr), + mBtnDuplicate(nullptr), + mBtnDuplicateInPlace(nullptr), + + mCheckSticky(nullptr), + mCheckCopySelection(nullptr), + mCheckCopyCenters(nullptr), + mCheckCopyRotates(nullptr), + mRadioGroupLand(nullptr), + mSliderDozerSize(nullptr), + mSliderDozerForce(nullptr), + mBtnApplyToSelection(nullptr), + + mTab(nullptr), + mPanelPermissions(nullptr), + mPanelObject(nullptr), + mPanelVolume(nullptr), + mPanelContents(nullptr), + mPanelFace(nullptr), + mPanelLandInfo(nullptr), + + mCostTextBorder(nullptr), + mTabLand(nullptr), + + mLandImpactsObserver(nullptr), mDirty(true), mHasSelection(true) @@ -410,7 +410,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) LLFloaterTools::~LLFloaterTools() { // children automatically deleted - gFloaterTools = NULL; + gFloaterTools = nullptr; LLViewerParcelMgr::getInstance()->removeObserver(mLandImpactsObserver); delete mLandImpactsObserver; @@ -915,8 +915,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); @@ -1076,7 +1076,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(); @@ -1098,7 +1098,7 @@ void LLFloaterTools::setObjectType( LLPCode pcode ) { LLToolPlacer::setObjectType( pcode ); gSavedSettings.setBOOL("CreateToolCopySelection", false); - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); } void commit_grid_mode(LLUICtrl *ctrl) diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index 9bc8c63fa0..944f44a5f5 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -53,7 +53,7 @@ #include "llviewerwindow.h" #include "llfloaterregioninfo.h" -//LLFloaterTopObjects* LLFloaterTopObjects::sInstance = NULL; +//LLFloaterTopObjects* LLFloaterTopObjects::sInstance = nullptr; // Globals // const U32 TIME_STR_LENGTH = 30; @@ -523,7 +523,7 @@ void LLFloaterTopObjects::teleportToSelectedObject() LLVector3d teleport_location; LLViewerObject *viewer_object = gObjectList.findObject(first_selected->getUUID()); - if (viewer_object == NULL) + if (viewer_object == nullptr) { // If we cannot find the object in the viewer list, teleport to the last reported position std::string pos_string = first_selected->getColumn(3)->getValue().asString(); diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp index 5e3ec366d5..d45310b6ef 100644 --- a/indra/newview/llfloatertoybox.cpp +++ b/indra/newview/llfloatertoybox.cpp @@ -39,7 +39,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)); @@ -99,7 +99,7 @@ bool LLFloaterToybox::postBuild() void LLFloaterToybox::draw() { - llassert(gToolBarView != NULL); + llassert(gToolBarView != nullptr); const command_id_list_t& command_list = mToolBar->getCommandsList(); diff --git a/indra/newview/llfloatertranslationsettings.cpp b/indra/newview/llfloatertranslationsettings.cpp index 71fd7fbb41..a09a0bc327 100644 --- a/indra/newview/llfloatertranslationsettings.cpp +++ b/indra/newview/llfloatertranslationsettings.cpp @@ -44,7 +44,7 @@ LLFloaterTranslationSettings::LLFloaterTranslationSettings(const LLSD& key) : LLFloater(key) -, mMachineTranslationCB(NULL) +, mMachineTranslationCB(nullptr) , mAzureKeyVerified(false) , mGoogleKeyVerified(false) , mDeepLKeyVerified(false) @@ -77,9 +77,9 @@ bool LLFloaterTranslationSettings::postBuild() mDeepLVerifyBtn->setClickedCallback(boost::bind(&LLFloaterTranslationSettings::onBtnDeepLVerify, this)); mAzureAPIKeyEditor->setFocusReceivedCallback(boost::bind(&LLFloaterTranslationSettings::onEditorFocused, this, _1)); - mAzureAPIKeyEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onAzureKeyEdited, this), NULL); + mAzureAPIKeyEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onAzureKeyEdited, this), nullptr); mAzureAPIRegionEditor->setFocusReceivedCallback(boost::bind(&LLFloaterTranslationSettings::onEditorFocused, this, _1)); - mAzureAPIRegionEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onAzureKeyEdited, this), NULL); + mAzureAPIRegionEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onAzureKeyEdited, this), nullptr); mAzureAPIEndpointEditor->setFocusLostCallback([this](LLFocusableElement*) { @@ -91,10 +91,10 @@ bool LLFloaterTranslationSettings::postBuild() }); mGoogleAPIKeyEditor->setFocusReceivedCallback(boost::bind(&LLFloaterTranslationSettings::onEditorFocused, this, _1)); - mGoogleAPIKeyEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onGoogleKeyEdited, this), NULL); + mGoogleAPIKeyEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onGoogleKeyEdited, this), nullptr); mDeepLAPIKeyEditor->setFocusReceivedCallback(boost::bind(&LLFloaterTranslationSettings::onEditorFocused, this, _1)); - mDeepLAPIKeyEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onDeepLKeyEdited, this), NULL); + mDeepLAPIKeyEditor->setKeystrokeCallback(boost::bind(&LLFloaterTranslationSettings::onDeepLKeyEdited, this), nullptr); mDeepLAPIDomainCombo->setFocusLostCallback([this](LLFocusableElement*) { diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index c3bc24c6b9..a8875289a5 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -112,8 +112,8 @@ class LLOverlapPanel : public LLPanel }; LLOverlapPanel(Params p = Params()) : LLPanel(p), mSpacing(10), - // mClickedElement(NULL), - mLastClickedElement(NULL) + // mClickedElement(nullptr), + mLastClickedElement(nullptr) { mOriginalWidth = getRect().getWidth(); mOriginalHeight = getRect().getHeight(); @@ -311,16 +311,16 @@ LLGUIPreviewLiveFile::LLGUIPreviewLiveFile(std::string path, std::string name, L : mFileName(name), mParent(parent), mFirstFade(true), - mFadeTimer(NULL), + mFadeTimer(nullptr), LLLiveFile(path, 1.0) {} LLGUIPreviewLiveFile::~LLGUIPreviewLiveFile() { - mParent->mLiveFile = NULL; + mParent->mLiveFile = nullptr; if(mFadeTimer) { - mFadeTimer->mParent = NULL; + mFadeTimer->mParent = nullptr; // deletes itself; see lltimer.cpp } } @@ -337,7 +337,7 @@ bool LLGUIPreviewLiveFile::loadFile() { if(mFadeTimer) { - mFadeTimer->mParent = NULL; + mFadeTimer->mParent = nullptr; } mFadeTimer = new LLFadeEventTimer(0.05f,this); } @@ -362,7 +362,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; } @@ -393,9 +393,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), // sHighlightingDiffs(false), mHighlightingOverlaps(false), mLastDisplayedX(0), @@ -417,7 +417,7 @@ LLFloaterUIPreview::~LLFloaterUIPreview() if(mLiveFile) { delete mLiveFile; - mLiveFile = NULL; + mLiveFile = nullptr; } } @@ -598,9 +598,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; } } @@ -744,7 +744,7 @@ void LLFloaterUIPreview::addFloaterEntry(const std::string& path) if(mLiveFile) { delete mLiveFile; - mLiveFile = NULL; + mLiveFile = nullptr; } return; } @@ -804,21 +804,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; } } @@ -910,7 +910,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(); @@ -930,8 +930,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 @@ -1035,10 +1035,10 @@ void LLFloaterUIPreview::getExecutablePath(const std::vector& filen CFStringRef path_cfstr = CFStringCreateWithCString(kCFAllocatorDefault, chosen_path.c_str(), kCFStringEncodingMacRoman); // get path as a CFStringRef CFURLRef path_url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, path_cfstr, kCFURLPOSIXPathStyle, true); // turn it into a CFURLRef CFBundleRef chosen_bundle = CFBundleCreate(kCFAllocatorDefault, path_url); // get a handle for the bundle - if(NULL != chosen_bundle) + if(nullptr != chosen_bundle) { CFDictionaryRef bundleInfoDict = CFBundleGetInfoDictionary(chosen_bundle); // get the bundle's dictionary - if(NULL != bundleInfoDict) + if(nullptr != bundleInfoDict) { CFStringRef executable_cfstr = (CFStringRef)CFDictionaryGetValue(bundleInfoDict, CFSTR("CFBundleExecutable")); // get the name of the actual executable (e.g. TextEdit or firefox-bin) int max_file_length = 256; // (max file name length is 255 in OSX) @@ -1143,7 +1143,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)) @@ -1211,7 +1211,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)) { @@ -1234,7 +1234,7 @@ void LLFloaterUIPreview::scanDiffFile(LLXmlTreeNode* file_node) void LLFloaterUIPreview::highlightChangedElements() { - if(NULL == mLiveFile) + if(nullptr == mLiveFile) { return; } @@ -1266,7 +1266,7 @@ void LLFloaterUIPreview::highlightChangedElements() element = element->findChild(*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; @@ -1324,13 +1324,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()) @@ -1339,14 +1339,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; } } @@ -1469,7 +1469,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) @@ -1567,16 +1567,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(viewp) || - NULL != dynamic_cast(viewp) || - NULL != dynamic_cast(viewp); + return nullptr != dynamic_cast(viewp) || + nullptr != dynamic_cast(viewp) || + nullptr != dynamic_cast(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(viewp) || NULL != dynamic_cast(viewp); + return nullptr != dynamic_cast(viewp) || nullptr != dynamic_cast(viewp); } // Check if two llview's rectangles overlap, with some tolerance @@ -1630,12 +1630,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; } diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 9696c3d3f8..b2fb609ea1 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -40,7 +40,7 @@ #include "llviewerwindow.h" #include "llcorehttputil.h" -static LLFloaterURLEntry* sInstance = NULL; +static LLFloaterURLEntry* sInstance = nullptr; //----------------------------------------------------------------------------- // LLFloaterURLEntry() @@ -57,7 +57,7 @@ LLFloaterURLEntry::LLFloaterURLEntry(LLHandle parent) //----------------------------------------------------------------------------- LLFloaterURLEntry::~LLFloaterURLEntry() { - sInstance = NULL; + sInstance = nullptr; } bool LLFloaterURLEntry::postBuild() diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 3ff84ac9b7..eae2ce7957 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -59,15 +59,15 @@ LLFloaterWebContent::_Params::_Params() LLFloaterWebContent::LLFloaterWebContent( const Params& params ) : LLFloater( params ), LLInstanceTracker(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/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 03979edbc1..4d659db643 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -270,7 +270,7 @@ class LLMapTrackAvatarHandler : public LLCommandHandler }; LLMapTrackAvatarHandler gMapTrackAvatar; -LLFloaterWorldMap* gFloaterWorldMap = NULL; +LLFloaterWorldMap* gFloaterWorldMap = nullptr; class LLMapInventoryObserver : public LLInventoryObserver { @@ -469,16 +469,16 @@ LLFloaterWorldMap::~LLFloaterWorldMap() } // All cleaned up by LLView destructor - mMapView = NULL; + mMapView = 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; - gFloaterWorldMap = NULL; + gFloaterWorldMap = nullptr; mTeleportFinishConnection.disconnect(); } @@ -1029,8 +1029,8 @@ void LLFloaterWorldMap::observeInventory(LLInventoryModel* model) { mInventory->removeObserver(mInventoryObserver); delete mInventoryObserver; - mInventory = NULL; - mInventoryObserver = NULL; + mInventory = nullptr; + mInventoryObserver = nullptr; } if(model) { @@ -1597,7 +1597,7 @@ void LLFloaterWorldMap::teleport() gMessageSystem, gAgent.getRegionHost(), region_id, - NULL); + nullptr); } } } @@ -1674,7 +1674,7 @@ void LLFloaterWorldMap::teleportToLandmark() gMessageSystem, gAgent.getRegionHost(), region_id, - NULL); + nullptr); } } } @@ -1862,7 +1862,7 @@ void LLFloaterWorldMap::onFocusLost() } LLPanelHideBeacon::LLPanelHideBeacon() : - mHideButton(NULL) + mHideButton(nullptr) { } @@ -1887,7 +1887,7 @@ bool LLPanelHideBeacon::postBuild() //virtual void LLPanelHideBeacon::draw() { - if (!LLTracker::isTracking(NULL)) + if (!LLTracker::isTracking(nullptr)) { mHideButton->setVisible(false); return; @@ -1949,7 +1949,7 @@ void LLPanelHideBeacon::updatePosition() left_tb_width = toolbar_left->getRect().getWidth(); } - 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 + HIDE_BEACON_PAD, 0); diff --git a/indra/newview/llfollowcam.cpp b/indra/newview/llfollowcam.cpp index 89f77414a1..ec8c11e3b7 100644 --- a/indra/newview/llfollowcam.cpp +++ b/indra/newview/llfollowcam.cpp @@ -796,7 +796,7 @@ void LLFollowCamMgr::setFocusLocked( const LLUUID& source, bool locked ) LLFollowCamParams* LLFollowCamMgr::getParamsForID(const LLUUID& source) { - LLFollowCamParams* params = NULL; + LLFollowCamParams* params = nullptr; param_map_t::iterator found_it = mParamMap.find(source); if (found_it == mParamMap.end()) // didn't find it? @@ -816,7 +816,7 @@ LLFollowCamParams* LLFollowCamMgr::getActiveFollowCamParams() { if (mParamStack.empty()) { - return NULL; + return nullptr; } return mParamStack.back(); diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index b9f19b5247..eefd9412bf 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -243,7 +243,7 @@ bool LLFriendCardsManager::isObjDirectDescendentOfCategory(const LLInventoryObje if ( item ) { LLUUID creator_id = item->getCreatorUUID(); - LLViewerInventoryItem* cur_item = NULL; + LLViewerInventoryItem* cur_item = nullptr; for (S32 i = static_cast(items->size()) - 1; i >= 0; --i) { cur_item = items->at(i); @@ -260,7 +260,7 @@ bool LLFriendCardsManager::isObjDirectDescendentOfCategory(const LLInventoryObje // Else check that items have same type and name. // Note: UUID's of compared items also may be not equal. std::string obj_name = obj->getName(); - LLViewerInventoryItem* cur_item = NULL; + LLViewerInventoryItem* cur_item = nullptr; for (S32 i = static_cast(items->size()) - 1; i >= 0; --i) { cur_item = items->at(i); @@ -280,7 +280,7 @@ bool LLFriendCardsManager::isObjDirectDescendentOfCategory(const LLInventoryObje // If target obj and descendent category have same type and name // then return true. Note: UUID's of compared items also may be not equal. std::string obj_name = obj->getName(); - LLViewerInventoryCategory* cur_cat = NULL; + LLViewerInventoryCategory* cur_cat = nullptr; for (S32 i = static_cast(cats->size()) - 1; i >= 0; --i) { cur_cat = cats->at(i); @@ -301,7 +301,7 @@ bool LLFriendCardsManager::isObjDirectDescendentOfCategory(const LLInventoryObje bool LLFriendCardsManager::isCategoryInFriendFolder(const LLViewerInventoryCategory* cat) const { - if (NULL == cat) + if (nullptr == cat) return false; return true == gInventory.isObjectDescendentOf(cat->getUUID(), findFriendFolderUUIDImpl()); } @@ -417,7 +417,7 @@ void LLFriendCardsManager::findMatchedFriendCards(const LLUUID& avatarID, LLInve LLViewerInventoryCategory* friendFolder = gInventory.getCategory(friendFolderUUID); - if (NULL == friendFolder) + if (nullptr == friendFolder) return; LLParticularBuddyCollector matchFunctor(avatarID); diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 550af7af53..cd7a904c18 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -84,7 +84,7 @@ LLGestureMgr::~LLGestureMgr() LLMultiGesture* gesture = (*it).second; delete gesture; - gesture = NULL; + gesture = nullptr; } gInventory.removeObserver(this); } @@ -272,9 +272,9 @@ void LLGestureMgr::activateGestureWithAsset(const LLUUID& item_id, // return; // } - // For now, put NULL into the item map. We'll build a gesture + // For now, put nullptr 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()) @@ -323,7 +323,7 @@ void LLGestureMgr::deactivateGesture(const LLUUID& item_id) stopGesture(gesture); delete gesture; - gesture = NULL; + gesture = nullptr; } mActive.erase(it); @@ -377,7 +377,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); @@ -491,7 +491,7 @@ void LLGestureMgr::replaceGesture(const LLUUID& item_id, LLMultiGesture* new_ges if (old_gesture != new_gesture) { delete old_gesture; - old_gesture = NULL; + old_gesture = nullptr; } if (asset_id.notNull()) @@ -585,7 +585,7 @@ void LLGestureMgr::playGesture(LLMultiGesture* gesture, bool fromKeyPress) gAssetStorage->getAssetData(sound_id, LLAssetType::AT_SOUND, onAssetLoadComplete, - NULL, + nullptr, true); } break; @@ -643,7 +643,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 ) @@ -663,7 +663,7 @@ bool LLGestureMgr::triggerAndReviseString(const std::string &utf8str, std::strin matching.push_back(gesture); } - gesture = NULL; + gesture = nullptr; } @@ -715,7 +715,7 @@ bool LLGestureMgr::triggerAndReviseString(const std::string &utf8str, std::strin } first_token = false; - gesture = NULL; + gesture = nullptr; } return found_gestures; } @@ -825,7 +825,7 @@ void LLGestureMgr::update() // callback might have deleted gesture, can't // rely on this pointer any more - gesture = NULL; + gesture = nullptr; } } @@ -895,11 +895,11 @@ 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]; - llassert(step != NULL); + llassert(step != nullptr); } else { @@ -1119,7 +1119,7 @@ void LLGestureMgr::onLoadComplete(const LLUUID& asset_uuid, bool deactivate_similar = info->mDeactivateSimilar; delete info; - info = NULL; + info = nullptr; LLGestureMgr& self = LLGestureMgr::instance(); self.mLoadingCount--; @@ -1191,7 +1191,7 @@ void LLGestureMgr::onLoadComplete(const LLUUID& asset_uuid, self.mActive.erase(item_id); delete old_gesture; - old_gesture = NULL; + old_gesture = nullptr; } } @@ -1242,13 +1242,13 @@ void LLGestureMgr::onLoadComplete(const LLUUID& asset_uuid, self.stopGesture(old_gesture); delete old_gesture; - old_gesture = NULL; + old_gesture = nullptr; } self.mActive.erase(item_id); } delete gesture; - gesture = NULL; + gesture = nullptr; } } else @@ -1276,7 +1276,7 @@ void LLGestureMgr::onLoadComplete(const LLUUID& asset_uuid, self.stopGesture(old_gesture); delete old_gesture; - old_gesture = NULL; + old_gesture = nullptr; } self.mActive.erase(item_id); } @@ -1408,7 +1408,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 e10bc8bbb4..1afbe55ec4 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -130,7 +130,7 @@ class LLGestureMgr : public LLSingleton, public LLInventoryFetchIt bool triggerGestureRelease(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); diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 57dd203f2f..2d4548c55d 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -337,7 +337,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) { @@ -432,7 +432,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/llgltffolderitem.h b/indra/newview/llgltffolderitem.h index 40a4c6fef1..0542179ccf 100644 --- a/indra/newview/llgltffolderitem.h +++ b/indra/newview/llgltffolderitem.h @@ -60,7 +60,7 @@ class LLGLTFFolderItem : public LLFolderViewModelItemCommon LLPointer getIcon() const override { return pIcon; } LLPointer getIconOpen() const override { return getIcon(); } - LLPointer getIconOverlay() const override { return NULL; } + LLPointer getIconOverlay() const override { return nullptr; } LLFontGL::StyleFlags getLabelStyle() const override { return LLFontGL::NORMAL; } std::string getLabelSuffix() const override { return std::string(); } diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index 446742f316..1ecc30e212 100644 --- a/indra/newview/llgltfmaterialpreviewmgr.cpp +++ b/indra/newview/llgltfmaterialpreviewmgr.cpp @@ -113,7 +113,7 @@ namespace if (obj) { LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(id); - img = viewerTexture ? dynamic_cast(viewerTexture) : NULL; + img = viewerTexture ? dynamic_cast(viewerTexture) : nullptr; } } else diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 34d96aa024..f44fca4c76 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -182,7 +182,7 @@ class LLFetchGroupMemberData : public LLGroupMgrObserver LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupId); if (!gdatap) { - LL_WARNS() << "LLGroupMgr::getInstance()->getGroupData() was NULL" << LL_ENDL; + LL_WARNS() << "LLGroupMgr::getInstance()->getGroupData() was nullptr" << LL_ENDL; } else if (!gdatap->isMemberDataComplete()) { @@ -217,7 +217,7 @@ class LLFetchLeaveGroupData: public LLFetchGroupMemberData LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupId); if (!gdatap) { - LL_WARNS() << "GroupData was NULL" << LL_ENDL; + LL_WARNS() << "GroupData was nullptr" << LL_ENDL; } else { @@ -228,7 +228,7 @@ class LLFetchLeaveGroupData: public LLFetchGroupMemberData } }; -LLFetchLeaveGroupData* gFetchLeaveGroupData = NULL; +LLFetchLeaveGroupData* gFetchLeaveGroupData = nullptr; // static void LLGroupActions::search() @@ -298,7 +298,7 @@ void LLGroupActions::join(const LLUUID& group_id) else { LL_WARNS() << "LLGroupMgr::getInstance()->getGroupData(" << group_id - << ") was NULL" << LL_ENDL; + << ") was nullptr" << LL_ENDL; } } @@ -332,10 +332,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); } diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 7659e5f082..68ee7deb71 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -400,13 +400,13 @@ bool LLGroupList::onContextMenuItemEnable(const LLSD& userdata) LLGroupListItem::LLGroupListItem(bool for_agent, bool show_icons) : LLPanel(), -mGroupIcon(NULL), -mGroupNameBox(NULL), -mInfoBtn(NULL), -mProfileBtn(NULL), -mNoticesBtn(NULL), -mVisibilityHideBtn(NULL), -mVisibilityShowBtn(NULL), +mGroupIcon(nullptr), +mGroupNameBox(nullptr), +mInfoBtn(nullptr), +mProfileBtn(nullptr), +mNoticesBtn(nullptr), +mVisibilityHideBtn(nullptr), +mVisibilityShowBtn(nullptr), mGroupID(LLUUID::null), mForAgent(for_agent) { diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index e0da762279..1f1cfce7bc 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -63,7 +63,7 @@ const U32 MAX_CACHED_GROUPS = 20; // LLRoleActionSet // LLRoleActionSet::LLRoleActionSet() -: mActionSetData(NULL) +: mActionSetData(nullptr) { } LLRoleActionSet::~LLRoleActionSet() @@ -910,7 +910,7 @@ LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id) { return gi->second; } - return NULL; + return nullptr; } // Helper function for LLGroupMgr::processGroupMembersReply @@ -1245,8 +1245,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; @@ -1261,14 +1261,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()) { @@ -1473,7 +1473,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()) @@ -2281,7 +2281,7 @@ void LLGroupMgr::processCapGroupMembersResponse(const LLSD& response, const std: // Compute this once, rather than every time. std::string default_title = titles.size() ? titles[0].asString() : LLStringUtil::null; - U64 default_powers = llstrtou64(defaults["default_powers"].asString().c_str(), NULL, 16); + U64 default_powers = llstrtou64(defaults["default_powers"].asString().c_str(), nullptr, 16); auto members_end = members.endMap(); for (auto it = members.beginMap(); it != members_end; ++it) @@ -2316,7 +2316,7 @@ void LLGroupMgr::processCapGroupMembersResponse(const LLSD& response, const std: 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")) diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp index 3e55030610..2fcd6378f1 100644 --- a/indra/newview/llhttpretrypolicy.cpp +++ b/indra/newview/llhttpretrypolicy.cpp @@ -177,7 +177,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 = (F32)((F64)date - LLTimer::getTotalSeconds()); diff --git a/indra/newview/llhudeffectbeam.cpp b/indra/newview/llhudeffectbeam.cpp index 74d0e0af0b..c0051c6a2b 100644 --- a/indra/newview/llhudeffectbeam.cpp +++ b/indra/newview/llhudeffectbeam.cpp @@ -173,7 +173,7 @@ void LLHUDEffectBeam::setSourceObject(LLViewerObject *objp) if (objp->isDead()) { LL_WARNS() << "HUDEffectBeam: Source object is dead!" << LL_ENDL; - mSourceObject = NULL; + mSourceObject = nullptr; return; } @@ -219,7 +219,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/llhudeffectblob.cpp b/indra/newview/llhudeffectblob.cpp index bdb21fd96e..a8e6dca780 100644 --- a/indra/newview/llhudeffectblob.cpp +++ b/indra/newview/llhudeffectblob.cpp @@ -46,7 +46,7 @@ LLHUDEffectBlob::~LLHUDEffectBlob() void LLHUDEffectBlob::markDead() { - mImage = NULL; + mImage = nullptr; LLHUDEffect::markDead(); } diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 776d2dd31e..6a72f9704f 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -383,7 +383,7 @@ void LLHUDEffectLookAt::setTargetObjectAndOffset(LLViewerObject *objp, LLVector3 //----------------------------------------------------------------------------- void LLHUDEffectLookAt::setTargetPosGlobal(const LLVector3d &target_pos_global) { - mTargetObject = NULL; + mTargetObject = nullptr; mTargetOffsetGlobal = target_pos_global; } @@ -433,7 +433,7 @@ bool LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec if (object) { position += object->getRenderPosition(); - object = NULL; + object = nullptr; } LLVector3 agentHeadPosition = gAgentAvatarp->mHeadp->getWorldPosition(); @@ -493,7 +493,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()) @@ -512,7 +512,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 c600010f6b..a3d3276762 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; } @@ -300,7 +300,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/llhudeffecttrail.cpp b/indra/newview/llhudeffecttrail.cpp index 48abd730c9..1e324c0259 100644 --- a/indra/newview/llhudeffecttrail.cpp +++ b/indra/newview/llhudeffecttrail.cpp @@ -69,7 +69,7 @@ void LLHUDEffectSpiral::markDead() if (mPartSourcep) { mPartSourcep->setDead(); - mPartSourcep = NULL; + mPartSourcep = nullptr; } LLHUDEffect::markDead(); } @@ -120,11 +120,11 @@ void LLHUDEffectSpiral::unpackData(LLMessageSystem *mesgsys, S32 blocknum) htolememcpy(target_object_id.mData, packed_data + 16, MVT_LLUUID, 16); htolememcpy(mPositionGlobal.mdV, packed_data + 32, MVT_LLVector3d, 24); - LLViewerObject *objp = NULL; + LLViewerObject *objp = nullptr; if (object_id.isNull()) { - setSourceObject(NULL); + setSourceObject(nullptr); } else { @@ -143,7 +143,7 @@ void LLHUDEffectSpiral::unpackData(LLMessageSystem *mesgsys, S32 blocknum) if (target_object_id.isNull()) { - setTargetObject(NULL); + setTargetObject(nullptr); } else { @@ -195,7 +195,7 @@ void LLHUDEffectSpiral::triggerLocal() { LLPointer 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/llhudicon.cpp b/indra/newview/llhudicon.cpp index 1a4af470bd..c22265749e 100644 --- a/indra/newview/llhudicon.cpp +++ b/indra/newview/llhudicon.cpp @@ -63,7 +63,7 @@ LLHUDIcon::icon_instance_t LLHUDIcon::sIconInstances; LLHUDIcon::LLHUDIcon(const U8 type) : LLHUDObject(type), - mImagep(NULL), + mImagep(nullptr), mScale(0.1f), mHidden(false) { @@ -72,7 +72,7 @@ LLHUDIcon::LLHUDIcon(const U8 type) : LLHUDIcon::~LLHUDIcon() { - mImagep = NULL; + mImagep = nullptr; } void LLHUDIcon::render() @@ -291,7 +291,7 @@ LLHUDIcon* LLHUDIcon::lineSegmentIntersectAll(const LLVector4a& start, const LLV LLVector4a local_end = end; LLVector4a position; - LLHUDIcon* ret = NULL; + LLHUDIcon* ret = nullptr; for(icon_it = sIconInstances.begin(); icon_it != sIconInstances.end(); ++icon_it) { LLHUDIcon* icon = *icon_it; diff --git a/indra/newview/llhudmanager.cpp b/indra/newview/llhudmanager.cpp index fd8efe6816..11c8defc04 100644 --- a/indra/newview/llhudmanager.cpp +++ b/indra/newview/llhudmanager.cpp @@ -131,7 +131,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; @@ -148,7 +148,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); @@ -156,7 +156,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.h b/indra/newview/llhudnametag.h index ee66187345..a44ba71a98 100644 --- a/indra/newview/llhudnametag.h +++ b/indra/newview/llhudnametag.h @@ -100,7 +100,7 @@ class LLHUDNameTag : public LLHUDObject const std::string &text_utf8, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, - const LLFontGL* font = NULL, + const LLFontGL* font = nullptr, const bool use_ellipses = false, F32 max_pixels = HUD_TEXT_MAX_WIDTH); diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp index 04e9e2dff2..2ace0e35bc 100644 --- a/indra/newview/llhudobject.cpp +++ b/indra/newview/llhudobject.cpp @@ -59,8 +59,8 @@ bool hud_object_further_away::operator()(const LLPointer& lhs, cons LLHUDObject::LLHUDObject(const U8 type) : mPositionGlobal(), - mSourceObject(NULL), - mTargetObject(NULL) + mSourceObject(nullptr), + mTargetObject(nullptr) { mVisible = true; mType = type; @@ -75,8 +75,8 @@ void LLHUDObject::markDead() { mVisible = false; mDead = true; - mSourceObject = NULL; - mTargetObject = NULL; + mSourceObject = nullptr; + mTargetObject = nullptr; } F32 LLHUDObject::getDistance() const @@ -133,7 +133,7 @@ void LLHUDObject::cleanupHUDObjects() // static LLHUDObject *LLHUDObject::addHUDObject(const U8 type) { - LLHUDObject *hud_objectp = NULL; + LLHUDObject *hud_objectp = nullptr; switch (type) { @@ -158,7 +158,7 @@ LLHUDObject *LLHUDObject::addHUDObject(const U8 type) LLHUDEffect *LLHUDObject::addHUDEffect(const U8 type) { - LLHUDEffect *hud_objectp = NULL; + LLHUDEffect *hud_objectp = nullptr; switch (type) { diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index 3bc33f1478..d082002313 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -93,7 +93,7 @@ class LLHUDText : public LLHUDObject 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); diff --git a/indra/newview/llhudview.cpp b/indra/newview/llhudview.cpp index 23fdf4b0fd..e68fe16207 100644 --- a/indra/newview/llhudview.cpp +++ b/indra/newview/llhudview.cpp @@ -42,7 +42,7 @@ #include "llui.h" #include "lluictrlfactory.h" -LLHUDView *gHUDView = NULL; +LLHUDView *gHUDView = nullptr; LLHUDView::LLHUDView(const LLRect& r) { diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 779ed725ac..93a3680693 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -225,7 +225,7 @@ void inventory_offer_handler(LLOfferInfo* info) LLSD payload; - // must protect against a NULL return from lookupHumanReadable() + // must protect against a nullptr return from lookupHumanReadable() std::string typestr = ll_safe_string(LLAssetType::lookupHumanReadable(info->mType)); if (!typestr.empty()) { @@ -235,7 +235,7 @@ void inventory_offer_handler(LLOfferInfo* info) } else { - LL_WARNS("Messaging") << "LLAssetType::lookupHumanReadable() returned NULL - probably bad asset type: " << info->mType << LL_ENDL; + LL_WARNS("Messaging") << "LLAssetType::lookupHumanReadable() returned nullptr - probably bad asset type: " << info->mType << LL_ENDL; args["OBJECTTYPE"] = ""; // This seems safest, rather than propagating bogosity @@ -457,7 +457,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, // 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; + bool is_friend = LLAvatarTracker::instance().getBuddyInfo(from_id) != nullptr; bool accept_im_from_only_friend = gSavedPerAccountSettings.getBOOL("VoiceCallsFriendsOnly"); bool is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT && LLMuteList::isLinden(name); @@ -756,7 +756,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, } // If there is inventory, give the user the inventory offer. - LLOfferInfo* info = NULL; + LLOfferInfo* info = nullptr; if (has_inventory) { @@ -1210,7 +1210,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, { return; } - else if (gSavedPerAccountSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL)) + else if (gSavedPerAccountSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(from_id) == nullptr)) { return; } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ad01e11d48..6d3288f291 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -113,7 +113,7 @@ const LLUUID LLOutgoingCallDialog::OCD_KEY = LLUUID("7CF78E11-0CFE-498D-ADB9-141 // // Globals // -LLIMMgr* gIMMgr = NULL; +LLIMMgr* gIMMgr = nullptr; bool LLSessionTimeoutTimer::tick() @@ -310,7 +310,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); } @@ -741,9 +741,9 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, mNumUnread(0), mOtherParticipantID(other_participant_id), mInitialTargetIDs(ids), - mVoiceChannel(NULL), + mVoiceChannel(nullptr), mP2PAsAdhocCall(false), - mSpeakers(NULL), + mSpeakers(nullptr), mSessionInitialized(false), mCallBackEnabled(true), mTextIMPossible(true), @@ -757,7 +757,7 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, if (IM_NOTHING_SPECIAL == mType || IM_SESSION_P2P_INVITE == mType) { - mP2PAsAdhocCall = (LLVoiceClient::getInstance()->getOutgoingCallInterface(voice_channel_info) == NULL); + mP2PAsAdhocCall = (LLVoiceClient::getInstance()->getOutgoingCallInterface(voice_channel_info) == nullptr); } else { @@ -822,7 +822,7 @@ void LLIMModel::LLIMSession::initVoiceChannel(const LLSD& voiceChannelInfo) mVoiceChannel->deactivate(); delete mVoiceChannel; - mVoiceChannel = NULL; + mVoiceChannel = nullptr; } mP2PAsAdhocCall = false; if (IM_NOTHING_SPECIAL == mType || IM_SESSION_P2P_INVITE == mType) @@ -992,7 +992,7 @@ LLIMModel::LLIMSession::~LLIMSession() } delete mSpeakers; - mSpeakers = NULL; + mSpeakers = nullptr; mVoiceChannelStateChangeConnection.disconnect(); @@ -1000,7 +1000,7 @@ LLIMModel::LLIMSession::~LLIMSession() mVoiceChannel->deactivate(); delete mVoiceChannel; - mVoiceChannel = NULL; + mVoiceChannel = nullptr; } void LLIMModel::LLIMSession::sessionInitReplyReceived(const LLUUID& new_session_id) @@ -1371,16 +1371,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) { auto num = ids.size(); - if (!num) return NULL; + if (!num) return nullptr; - if (mId2SessionMap.empty()) return NULL; + if (mId2SessionMap.empty()) return nullptr; std::map::const_iterator it = mId2SessionMap.begin(); for (; it != mId2SessionMap.end(); ++it) @@ -1410,7 +1410,7 @@ LLIMModel::LLIMSession* LLIMModel::findAdHocIMSession(const uuid_vec_t& ids) } } - return NULL; + return nullptr; } bool LLIMModel::LLIMSession::isOutgoingAdHoc() const @@ -1772,7 +1772,7 @@ LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id, if (!session) { - return NULL; + return nullptr; } // replace interactive system message marker with correct from string value @@ -1857,7 +1857,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; @@ -1869,7 +1869,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; @@ -1939,7 +1939,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; @@ -2029,7 +2029,7 @@ 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) { @@ -2065,7 +2065,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); } @@ -2349,7 +2349,7 @@ LLIMMgr::onConfirmForceCloseError( LLCallDialogManager::LLCallDialogManager(): mPreviousSessionlName(""), mCurrentSessionlName(""), -mSession(NULL), +mSession(nullptr), mOldState(LLVoiceChannel::STATE_READY) { } @@ -2425,7 +2425,7 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat void LLCallDialogManager::onVoiceChannelStateChangedInt(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(mOldState == new_state) { @@ -2486,7 +2486,7 @@ void LLCallDialogManager::onVoiceChannelStateChangedInt(const LLVoiceChannel::ES // Class LLCallDialog //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LLCallDialog::LLCallDialog(const LLSD& payload) - : LLDockableFloater(NULL, false, payload), + : LLDockableFloater(nullptr, false, payload), mPayload(payload), mLifetime(DEFAULT_LIFETIME) @@ -2563,7 +2563,7 @@ void LLCallDialog::draw() onLifetimeExpired(); } - if (getDockControl() != NULL) + if (getDockControl() != nullptr) { LLDockableFloater::draw(); } @@ -3190,7 +3190,7 @@ void LLIMMgr::addMessage( if (gSavedPerAccountSettings.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 } @@ -3437,7 +3437,7 @@ LLUUID LLIMMgr::addSession( } LLIMModel::LLIMSession *session = LLIMModel::getInstance()->findIMSession(session_id); - bool new_session = (session == NULL); + bool new_session = (session == nullptr); //works only for outgoing ad-hoc sessions if (new_session && @@ -3599,7 +3599,7 @@ void LLIMMgr::inviteToSession( if (voice_invite) { bool isRejectGroupCall = (gSavedSettings.getBOOL("VoiceCallsRejectGroup") && (notify_box_type == "VoiceInviteGroup")); - bool isRejectNonFriendCall = (gSavedPerAccountSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL)); + bool isRejectNonFriendCall = (gSavedPerAccountSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(caller_id) == nullptr)); if (isRejectGroupCall || isRejectNonFriendCall || gAgent.isDoNotDisturb()) { if (gAgent.isDoNotDisturb() && !isRejectGroupCall && !isRejectNonFriendCall) @@ -3678,7 +3678,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) @@ -3978,7 +3978,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) diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 23f90ca795..66d60934ba 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -179,13 +179,13 @@ class LLIMModel : public LLSingleton /** * Find an IM Session corresponding to session_id - * Returns NULL if the session does not exist + * Returns nullptr if the session does not exist */ LLIMSession* findIMSession(const LLUUID& session_id) const; /** * Find an Ad-Hoc IM Session with specified participants - * @return first found Ad-Hoc session or NULL if the session does not exist + * @return first found Ad-Hoc session or nullptr if the session does not exist */ LLIMSession* findAdHocIMSession(const uuid_vec_t& ids); @@ -285,13 +285,13 @@ class LLIMModel : public LLSingleton /** * Get voice channel for the session specified by session_id - * Returns NULL if the session does not exist + * Returns nullptr if the session does not exist */ LLVoiceChannel* getVoiceChannel(const LLUUID& session_id) const; /** * Get im speaker manager for the session specified by session_id - * Returns NULL if the session does not exist + * Returns nullptr if the session does not exist */ LLIMSpeakerMgr* getSpeakerManager(const LLUUID& session_id) const; diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index b03b7beed6..c3f194dc7b 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -154,7 +154,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 @@ -173,7 +173,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); } @@ -284,7 +284,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/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index eb2cdb8632..04bb696193 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -121,11 +121,11 @@ class LLInspectObject : public LLInspect LLInspectObject::LLInspectObject(const LLSD& sd) : LLInspect( LLSD() ), // single_instance, doesn't really need key - mObjectID(NULL), // set in onOpen() + mObjectID(nullptr), // set in onOpen() mObjectFace(0), - mObjectSelection(NULL), - mMediaImpl(NULL), - mMediaEntry(NULL) + mObjectSelection(nullptr), + mMediaImpl(nullptr), + mMediaEntry(nullptr) { // can't make the properties request until the widgets are constructed // as it might return immediately, so do it in postBuild. @@ -236,7 +236,7 @@ void LLInspectObject::onOpen(const LLSD& data) if (!tep) return; - mMediaEntry = tep->hasMedia() ? tep->getMediaData() : NULL; + mMediaEntry = tep->hasMedia() ? tep->getMediaData() : nullptr; if(!mMediaEntry) return; @@ -248,7 +248,7 @@ void LLInspectObject::onOpen(const LLSD& data) void LLInspectObject::onClose(bool app_quitting) { // Release selection to deselect - mObjectSelection = NULL; + mObjectSelection = nullptr; mPreviousObjectID = mObjectID; getChild("gear_btn")->hideMenu(); @@ -295,7 +295,7 @@ void LLInspectObject::update() if (!tep) return; - mMediaEntry = tep->hasMedia() ? tep->getMediaData() : NULL; + mMediaEntry = tep->hasMedia() ? tep->getMediaData() : nullptr; if(!mMediaEntry) return; @@ -442,7 +442,7 @@ void LLInspectObject::updateMediaCurrentURL() if(mMediaImpl.notNull() && mMediaImpl->hasMedia()) { - LLPluginClassMedia* media_plugin = NULL; + LLPluginClassMedia* media_plugin = nullptr; media_plugin = mMediaImpl->getMediaPlugin(); if(media_plugin) { @@ -547,7 +547,7 @@ void LLInspectObject::updateSecureBrowsing() if(mMediaImpl.notNull() && mMediaImpl->hasMedia()) { - LLPluginClassMedia* media_plugin = NULL; + LLPluginClassMedia* media_plugin = nullptr; std::string current_url = ""; media_plugin = mMediaImpl->getMediaPlugin(); if(media_plugin) diff --git a/indra/newview/llinspectremoteobject.cpp b/indra/newview/llinspectremoteobject.cpp index 0060fe544d..652df53c18 100644 --- a/indra/newview/llinspectremoteobject.cpp +++ b/indra/newview/llinspectremoteobject.cpp @@ -71,8 +71,8 @@ class LLInspectRemoteObject : public LLInspect LLInspectRemoteObject::LLInspectRemoteObject(const LLSD& sd) : LLInspect(LLSD()), - mObjectID(NULL), - mOwnerID(NULL), + mObjectID(nullptr), + mOwnerID(nullptr), mSLurl(""), mName(""), mGroupOwned(false) diff --git a/indra/newview/llinspecttexture.cpp b/indra/newview/llinspecttexture.cpp index 9f0d236826..09a64d571d 100644 --- a/indra/newview/llinspecttexture.cpp +++ b/indra/newview/llinspecttexture.cpp @@ -86,7 +86,7 @@ LLToolTip* LLInspectTextureUtil::createInventoryToolTip(LLToolTip::Params p) } if ((!p.message.isProvided() || p.message().empty())) { - return NULL; + return nullptr; } // No or more than one texture found => show default tooltip return LLUICtrlFactory::create(p); diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp index e3bf960c6d..53c1c892ad 100644 --- a/indra/newview/llinspecttoast.cpp +++ b/indra/newview/llinspecttoast.cpp @@ -58,12 +58,12 @@ class LLInspectToast: public LLInspect }; LLInspectToast::LLInspectToast(const LLSD& notification_id) : - LLInspect(LLSD()), mPanel(NULL) + LLInspect(LLSD()), mPanel(nullptr) { LLScreenChannelBase* channel = LLChannelManager::getInstance()->findChannelByID( LLNotificationsUI::NOTIFICATION_CHANNEL_UUID); mScreenChannel = dynamic_cast(channel); - if(NULL == mScreenChannel) + if(nullptr == mScreenChannel) { LL_WARNS() << "Could not get requested screen channel." << LL_ENDL; return; @@ -83,7 +83,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; @@ -91,14 +91,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); } @@ -125,7 +125,7 @@ bool LLInspectToast::handleToolTip(S32 x, S32 y, MASK mask) void LLInspectToast::deleteAllChildren() { - mPanel = NULL; + mPanel = nullptr; LLInspect::deleteAllChildren(); } @@ -134,7 +134,7 @@ void LLInspectToast::removeChild(LLView* child) { if (mPanel == child) { - mPanel = NULL; + mPanel = nullptr; } LLInspect::removeChild(child); } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 848f28f933..b6955c1581 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -447,8 +447,8 @@ void LLInvFVBridge::removeBatch(std::vector& batch) // Deactivate gestures when moving them into Trash LLInvFVBridge* bridge; LLInventoryModel* model = getInventoryModel(); - LLViewerInventoryItem* item = NULL; - LLViewerInventoryCategory* cat = NULL; + LLViewerInventoryItem* item = nullptr; + LLViewerInventoryCategory* cat = nullptr; LLInventoryModel::cat_array_t descendent_categories; LLInventoryModel::item_array_t descendent_items; size_t count = batch.size(); @@ -499,7 +499,7 @@ void LLInvFVBridge::removeBatchNoCheck(std::vector& ba if(!model) return; LLMessageSystem* msg = gMessageSystem; const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; uuid_vec_t move_ids; LLInventoryModel::update_map_t update; bool start_new_message = true; @@ -544,7 +544,7 @@ void LLInvFVBridge::removeBatchNoCheck(std::vector& ba msg->nextBlockFast(_PREHASH_InventoryData); msg->addUUIDFast(_PREHASH_ItemID, item->getUUID()); msg->addUUIDFast(_PREHASH_FolderID, trash_id); - msg->addString("NewName", NULL); + msg->addString("NewName", nullptr); if(msg->isSendFullFast(_PREHASH_InventoryData)) { start_new_message = true; @@ -776,7 +776,7 @@ void hide_context_entries(LLMenuGL& menu, // between two separators). if (found) { - const bool is_entry_separator = (dynamic_cast(menu_item) != NULL); + const bool is_entry_separator = (dynamic_cast(menu_item) != nullptr); found = !(is_entry_separator && is_previous_entry_separator); is_previous_entry_separator = is_entry_separator; } @@ -828,7 +828,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, menuentry_vec_t &disabled_items, U32 flags) { const LLInventoryObject *obj = getInventoryObject(); - bool single_folder_root = (mRoot == NULL); + bool single_folder_root = (mRoot == nullptr); bool is_cof = isCOFFolder(); bool is_inbox = isInboxFolder(); @@ -1275,7 +1275,7 @@ bool LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const LLInventoryObject* LLInvFVBridge::getInventoryObject() const { - LLInventoryObject* obj = NULL; + LLInventoryObject* obj = nullptr; LLInventoryModel* model = getInventoryModel(); if(model) { @@ -1287,13 +1287,13 @@ LLInventoryObject* LLInvFVBridge::getInventoryObject() const LLInventoryModel* LLInvFVBridge::getInventoryModel() const { LLInventoryPanel* panel = mInventoryPanel.get(); - return panel ? panel->getModel() : NULL; + return panel ? panel->getModel() : nullptr; } LLInventoryFilter* LLInvFVBridge::getInventoryFilter() const { LLInventoryPanel* panel = mInventoryPanel.get(); - return panel ? &(panel->getFilter()) : NULL; + return panel ? &(panel->getFilter()) : nullptr; } bool LLInvFVBridge::isItemInTrash() const @@ -1420,7 +1420,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, const LLUUID& uuid, U32 flags) { - LLInvFVBridge* new_listener = NULL; + LLInvFVBridge* new_listener = nullptr; switch(asset_type) { case LLAssetType::AT_TEXTURE: @@ -1575,7 +1575,7 @@ void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid) LLInventoryObject* obj = model->getObject(uuid); if (obj) { - remove_inventory_object(uuid, NULL); + remove_inventory_object(uuid, nullptr); } } @@ -1615,7 +1615,7 @@ bool LLInvFVBridge::canShare() const else { // Categories can be given. - can_share = (model->getCategory(mUUID) != NULL); + can_share = (model->getCategory(mUUID) != nullptr); } const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); @@ -1666,7 +1666,7 @@ bool LLInvFVBridge::canListOnMarketplaceNow() const bool can_list = true; const LLInventoryObject* obj = getInventoryObject(); - can_list &= (obj != NULL); + can_list &= (obj != nullptr); if (can_list) { @@ -1675,7 +1675,7 @@ bool LLInvFVBridge::canListOnMarketplaceNow() const if (can_list) { - LLFolderViewFolder * object_folderp = mInventoryPanel.get() ? mInventoryPanel.get()->getFolderByID(object_id) : NULL; + LLFolderViewFolder * object_folderp = mInventoryPanel.get() ? mInventoryPanel.get()->getFolderByID(object_id) : nullptr; if (object_folderp) { can_list = !static_cast(object_folderp->getViewModelItem())->isLoading(); @@ -2008,7 +2008,7 @@ LLUIImagePtr LLItemBridge::getIconOverlay() const return LLUI::getUIImage("Inv_Link"); } - return NULL; + return nullptr; } // virtual @@ -2169,7 +2169,7 @@ bool LLItemBridge::renameItem(const std::string& new_name) { LLSD updates; updates["name"] = new_name; - update_inventory_item(item->getUUID(),updates, NULL); + update_inventory_item(item->getUUID(),updates, nullptr); } // return false because we either notified observers @@ -2288,7 +2288,7 @@ LLViewerInventoryItem* LLItemBridge::getItem() const return model->getItem(mUUID); } - return NULL; + return nullptr; } // virtual @@ -2307,7 +2307,7 @@ const LLUUID& LLItemBridge::getThumbnailUUID() const bool LLItemBridge::isFavorite() const { - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; LLInventoryModel* model = getInventoryModel(); if (model) { @@ -2687,7 +2687,7 @@ bool LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // check to make sure source is agent inventory, and is represented there. LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); - const bool is_agent_inventory = (model->getCategory(cat_id) != NULL) + const bool is_agent_inventory = (model->getCategory(cat_id) != nullptr) && (LLToolDragAndDrop::SOURCE_AGENT == source); bool accept = false; @@ -2907,7 +2907,7 @@ bool LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, if (is_movable && !move_is_into_landmarks) { LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(false); - is_movable = active_panel != NULL; + is_movable = active_panel != nullptr; // For a folder to pass the filter all its descendants are required to pass. // We make this exception to allow reordering folders within an inventory panel, @@ -2921,12 +2921,12 @@ bool LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else { - LLFolderView* active_folder_view = NULL; + LLFolderView* active_folder_view = nullptr; if (is_movable) { active_folder_view = active_panel->getRootFolder(); - is_movable = active_folder_view != NULL; + is_movable = active_folder_view != nullptr; } if (is_movable && use_filter) @@ -3168,7 +3168,7 @@ bool LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } }; - accept = move_inv_category_world_to_agent(cat_id, mUUID, drop, callback, NULL, filter); + accept = move_inv_category_world_to_agent(cat_id, mUUID, drop, callback, nullptr, filter); } } else if (LLToolDragAndDrop::SOURCE_LIBRARY == source) @@ -3195,7 +3195,7 @@ bool LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, void warn_move_inventory(LLViewerObject* object, std::shared_ptr move_inv) { - const char* dialog = NULL; + const char* dialog = nullptr; if (object->flagScripted()) { dialog = "MoveInventoryFromScriptedObject"; @@ -3211,9 +3211,9 @@ void warn_move_inventory(LLViewerObject* object, std::shared_ptr move // Notification blocks user from interacting with inventories so everything that comes after first message // is part of this message - don'r show it again // Note: workaround for MAINT-5495 untill proper refactoring and warning system for Drag&Drop can be made. - if (notification_ptr == NULL + if (notification_ptr == nullptr || !notification_ptr->isActive() - || LLNotificationsUtil::find(notification_ptr->getID()) == NULL + || LLNotificationsUtil::find(notification_ptr->getID()) == nullptr || inv_ptr->mCategoryID != move_inv->mCategoryID || inv_ptr->mObjectID != move_inv->mObjectID) { @@ -3394,8 +3394,8 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer) } uuid_vec_t ids; - LLRightClickInventoryFetchObserver* outfit = NULL; - LLRightClickInventoryFetchDescendentsObserver* categories = NULL; + LLRightClickInventoryFetchObserver* outfit = nullptr; + LLRightClickInventoryFetchDescendentsObserver* categories = nullptr; // Fetch the items if (item_count) @@ -3501,7 +3501,7 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask) if (mFolderAdded) { LLViewerInventoryCategory* category = gInventory.getCategory(mCatID); - if (NULL == category) + if (nullptr == category) { LL_WARNS() << "gInventory.getCategory(" << mCatID << ") was NULL" << LL_ENDL; @@ -3810,7 +3810,7 @@ void LLFolderBridge::copyOutfitToClipboard() LLViewerInventoryItem* item = gInventory.getItem(uuid); i++; - if (item != NULL) + if (item != nullptr) { // Append a newline to all but the last line text += i != item_count ? item->getName() + "\n" : item->getName(); @@ -3926,7 +3926,7 @@ LLUIImagePtr LLFolderBridge::getIconOverlay() const { return LLUI::getUIImage("Inv_Link"); } - return NULL; + return nullptr; } bool LLFolderBridge::renameItem(const std::string& new_name) @@ -4089,7 +4089,7 @@ void LLFolderBridge::perform_pasteFromClipboard() std::vector objects; LLClipboard::instance().pasteFromClipboard(objects); - LLPointer cb = NULL; + LLPointer cb = nullptr; LLInventoryPanel* panel = mInventoryPanel.get(); if (panel->getRootFolder()->isSingleFolderMode() && panel->getRootFolderID() == mUUID) { @@ -4416,7 +4416,7 @@ void LLFolderBridge::pasteLinkFromClipboard() } - LLPointer cb = NULL; + LLPointer cb = nullptr; LLInventoryPanel* panel = mInventoryPanel.get(); if (panel->getRootFolder()->isSingleFolderMode()) { @@ -4466,7 +4466,7 @@ bool LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInv void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items, menuentry_vec_t& disabled_items) { LLInventoryModel* model = getInventoryModel(); - llassert(model != NULL); + llassert(model != nullptr); const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); const LLUUID &lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); @@ -4795,7 +4795,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& const bool is_agent_inventory = isAgentInventory(); // Only enable calling-card related options for non-system folders. - if (!is_system_folder && is_agent_inventory && (mRoot != NULL)) + if (!is_system_folder && is_agent_inventory && (mRoot != nullptr)) { LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) @@ -4820,7 +4820,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& } //skip the rest options in single-folder mode - if (mRoot == NULL) + if (mRoot == nullptr) { return; } @@ -4946,7 +4946,7 @@ bool LLFolderBridge::dragOrDrop(MASK mask, bool drop, { LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data; - static LLPointer drop_cb = NULL; + static LLPointer drop_cb = nullptr; LLInventoryPanel* panel = mInventoryPanel.get(); LLToolDragAndDrop* drop_tool = LLToolDragAndDrop::getInstance(); if (drop @@ -5015,14 +5015,14 @@ bool LLFolderBridge::dragOrDrop(MASK mask, bool drop, if (!drop || drop_tool->getCargoIndex() + 1 == drop_tool->getCargoCount()) { - drop_cb = NULL; + drop_cb = nullptr; } return accept; } LLViewerInventoryCategory* LLFolderBridge::getCategory() const { - LLViewerInventoryCategory* cat = NULL; + LLViewerInventoryCategory* cat = nullptr; LLInventoryModel* model = getInventoryModel(); if(model) { @@ -5541,8 +5541,8 @@ void LLFolderBridge::dropToFavorites(LLInventoryItem* inv_item, LLPointer cb_fav = new AddFavoriteLandmarkCallback(); LLInventoryPanel* panel = mInventoryPanel.get(); - LLFolderViewItem* drag_over_item = panel ? panel->getRootFolder()->getDraggingOverItem() : NULL; - LLFolderViewModelItemInventory* view_model = drag_over_item ? static_cast(drag_over_item->getViewModelItem()) : NULL; + LLFolderViewItem* drag_over_item = panel ? panel->getRootFolder()->getDraggingOverItem() : nullptr; + LLFolderViewModelItemInventory* view_model = drag_over_item ? static_cast(drag_over_item->getViewModelItem()) : nullptr; if (view_model) { cb_fav.get()->setTargetLandmarkId(view_model->getUUID()); @@ -5583,7 +5583,7 @@ void LLFolderBridge::dropToOutfit(LLInventoryItem* inv_item, bool move_is_into_c } else { - LLPointer cb = NULL; + LLPointer cb = nullptr; link_inventory_object(mUUID, LLConstPointer(inv_item), cb); } } @@ -5726,7 +5726,7 @@ bool LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // We shouldn't allow to drop non recent items into recent tab (or some similar transactions) // while we are allowing to interact with regular filtered inventory bool use_filter = filter_types && (filter_types&LLInventoryFilter::FILTERTYPE_DATE || (filter_types&LLInventoryFilter::FILTERTYPE_OBJECT)==0); - LLViewerObject* object = NULL; + LLViewerObject* object = nullptr; if(LLToolDragAndDrop::SOURCE_AGENT == source) { const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); @@ -5998,7 +5998,7 @@ bool LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, move_inv->mCallback = [item_id, cb](S32, void*, const LLMoveInv* move_inv) mutable { cb->fire(item_id); }; } - move_inv->mUserData = NULL; + move_inv->mUserData = nullptr; if(is_move) { warn_move_inventory(object, move_inv); @@ -6518,7 +6518,7 @@ class LLCallingCardObserver : public LLFriendObserver { public: LLCallingCardObserver(LLCallingCardBridge* bridge) : mBridgep(bridge) {} - virtual ~LLCallingCardObserver() { mBridgep = NULL; } + virtual ~LLCallingCardObserver() { mBridgep = nullptr; } virtual void changed(U32 mask) { if (mask & LLFriendObserver::ONLINE) @@ -6555,7 +6555,7 @@ LLCallingCardBridge::~LLCallingCardBridge() void LLCallingCardBridge::refreshFolderViewItem() { LLInventoryPanel* panel = mInventoryPanel.get(); - LLFolderViewItem* itemp = panel ? panel->getItemByID(mUUID) : NULL; + LLFolderViewItem* itemp = panel ? panel->getItemByID(mUUID) : nullptr; if (itemp) { itemp->refresh(); @@ -7145,7 +7145,7 @@ LLUIImagePtr LLObjectBridge::getIcon() const LLInventoryObject* LLObjectBridge::getObject() const { - LLInventoryObject* object = NULL; + LLInventoryObject* object = nullptr; LLInventoryModel* model = getInventoryModel(); if(model) { @@ -7161,7 +7161,7 @@ LLViewerInventoryItem* LLObjectBridge::getItem() const { return model->getItem(mUUID); } - return NULL; + return nullptr; } LLViewerInventoryCategory* LLObjectBridge::getCategory() const @@ -7171,7 +7171,7 @@ LLViewerInventoryCategory* LLObjectBridge::getCategory() const { return model->getCategory(mUUID); } - return NULL; + return nullptr; } // virtual @@ -7185,7 +7185,7 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) if(item && gInventory.isObjectDescendentOf(object_id, gInventory.getRootFolderID())) { static LLCachedControl replace_item(gSavedSettings, "InventoryAddAttachmentBehavior", false); - rez_attachment(item, NULL, ("attach" == action) ? replace_item() : true); // Replace if "Wear"ing. + rez_attachment(item, nullptr, ("attach" == action) ? replace_item() : true); // Replace if "Wear"ing. } else if(item && item->isFinished()) { @@ -7199,7 +7199,7 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) std::string(), cb); } - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } else if ("wear_add" == action) { @@ -7715,7 +7715,7 @@ void LLWearableBridge::onWearOnAvatarArrived( LLViewerWearable* wearable, void* LLUUID* item_id = (LLUUID*) userdata; if(wearable) { - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); if(item) { @@ -7741,7 +7741,7 @@ void LLWearableBridge::onWearAddOnAvatarArrived( LLViewerWearable* wearable, voi LLUUID* item_id = (LLUUID*) userdata; if(wearable) { - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); if(item) { @@ -8037,7 +8037,7 @@ LLUIImagePtr LLLinkFolderBridge::getIcon() const const LLInventoryObject *obj = getInventoryObject(); if (obj) { - LLViewerInventoryCategory* cat = NULL; + LLViewerInventoryCategory* cat = nullptr; LLInventoryModel* model = getInventoryModel(); if(model) { @@ -8172,7 +8172,7 @@ LLViewerInventoryItem* LLInvFVBridgeAction::getItem() const { if (mModel) return (LLViewerInventoryItem*)mModel->getItem(mUUID); - return NULL; + return nullptr; } class LLTextureBridgeAction: public LLInvFVBridgeAction @@ -8466,7 +8466,7 @@ LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_ const LLUUID& uuid, LLInventoryModel* model) { - LLInvFVBridgeAction* action = NULL; + LLInvFVBridgeAction* action = nullptr; switch(asset_type) { case LLAssetType::AT_TEXTURE: @@ -8540,7 +8540,7 @@ LLInvFVBridge* LLRecentInventoryBridgeBuilder::createBridge( const LLUUID& uuid, U32 flags /*= 0x00*/ ) const { - LLInvFVBridge* new_listener = NULL; + LLInvFVBridge* new_listener = nullptr; if (asset_type == LLAssetType::AT_CATEGORY && actual_asset_type != LLAssetType::AT_LINK_FOLDER) { @@ -8585,7 +8585,7 @@ LLInvFVBridge* LLFavoritesInventoryBridgeBuilder::createBridge( const LLUUID& uuid, U32 flags /*= 0x00*/) const { - LLInvFVBridge* new_listener = NULL; + LLInvFVBridge* new_listener = nullptr; if (asset_type == LLAssetType::AT_CATEGORY && actual_asset_type != LLAssetType::AT_LINK_FOLDER) { diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index decb2c0528..66e80a8152 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -282,8 +282,8 @@ class LLFolderBridge : public LLInvFVBridge ~LLFolderBridge(); - bool dragItemIntoFolder(LLInventoryItem* inv_item, bool drop, std::string& tooltip_msg, bool user_confirm = true, LLPointer cb = NULL); - bool dragCategoryIntoFolder(LLInventoryCategory* inv_category, bool drop, std::string& tooltip_msg, bool is_link = false, bool user_confirm = true, LLPointer cb = NULL); + bool dragItemIntoFolder(LLInventoryItem* inv_item, bool drop, std::string& tooltip_msg, bool user_confirm = true, LLPointer cb = nullptr); + bool dragCategoryIntoFolder(LLInventoryCategory* inv_category, bool drop, std::string& tooltip_msg, bool is_link = false, bool user_confirm = true, LLPointer cb = nullptr); void callback_dropItemIntoFolder(const LLSD& notification, const LLSD& response, LLInventoryItem* inv_item); void callback_dropCategoryIntoFolder(const LLSD& notification, const LLSD& response, LLInventoryCategory* inv_category); @@ -371,10 +371,10 @@ class LLFolderBridge : public LLInvFVBridge void copyOutfitToClipboard(); void determineFolderType(); - void dropToFavorites(LLInventoryItem* inv_item, LLPointer cb = NULL); - void dropToOutfit(LLInventoryItem* inv_item, bool move_is_into_current_outfit, LLPointer cb = NULL); - void dropToMyOutfits(LLInventoryCategory* inv_cat, LLPointer cb = NULL); - void dropToMyOutfitsSubfolder(LLInventoryCategory* inv_cat, const LLUUID& dest, LLPointer cb = NULL); + void dropToFavorites(LLInventoryItem* inv_item, LLPointer cb = nullptr); + void dropToOutfit(LLInventoryItem* inv_item, bool move_is_into_current_outfit, LLPointer cb = nullptr); + void dropToMyOutfits(LLInventoryCategory* inv_cat, LLPointer cb = nullptr); + void dropToMyOutfitsSubfolder(LLInventoryCategory* inv_cat, const LLUUID& dest, LLPointer cb = nullptr); //-------------------------------------------------------------------- // Messy hacks for handling folder options @@ -834,8 +834,8 @@ bool move_inv_category_world_to_agent(const LLUUID& object_id, const LLUUID& category_id, bool drop, std::function callback = nullptr, - void* user_data = NULL, - LLInventoryFilter* filter = NULL); + 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 diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 99c2d6e410..23f3dbe70a 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -467,8 +467,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); size_t descendents_actual = 0; if(cat_array && item_array) @@ -599,7 +599,7 @@ bool LLInventoryFilter::checkAgainstPermissions(const LLInventoryItem* item) con LLPointer 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/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 3cc57e851f..e384a49dd2 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -301,7 +301,7 @@ void update_marketplace_category(const LLUUID& cur_uuid, bool perform_consistenc // We also take care of degenerated cases so we don't update all folders in the inventory by mistake. if (cur_uuid.isNull() - || gInventory.getCategory(cur_uuid) == NULL + || gInventory.getCategory(cur_uuid) == nullptr || gInventory.getCategory(cur_uuid)->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) { return; @@ -314,7 +314,7 @@ void update_marketplace_category(const LLUUID& cur_uuid, bool perform_consistenc // Retrieve the listing uuid this object is in LLUUID listing_uuid = nested_parent_id(cur_uuid, depth); LLViewerInventoryCategory* listing_cat = gInventory.getCategory(listing_uuid); - bool listing_cat_loaded = listing_cat != NULL && listing_cat->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN; + bool listing_cat_loaded = listing_cat != nullptr && listing_cat->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN; // Verify marketplace data consistency for this listing if (perform_consistency_enforcement @@ -419,7 +419,7 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s if (!model || !get_is_category_renameable(model, cat_id) || - (cat = model->getCategory(cat_id)) == NULL || + (cat = model->getCategory(cat_id)) == nullptr || cat->getName() == new_name) { return; @@ -427,7 +427,7 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s LLSD updates; updates["name"] = new_name; - update_inventory_category(cat_id, updates, NULL); + update_inventory_category(cat_id, updates, nullptr); } void copy_inventory_category(LLInventoryModel* model, @@ -1207,13 +1207,13 @@ bool can_move_to_marketplace(LLInventoryItem* inv_item, std::string& tooltip_msg } // A category is always considered as passing... - if (linked_category != NULL) + if (linked_category != nullptr) { return true; } // Take the linked item if necessary - if (linked_item != NULL) + if (linked_item != nullptr) { inv_item = linked_item; } @@ -1363,7 +1363,7 @@ bool can_move_item_to_marketplace(const LLInventoryCategory* root_folder, LLInve unsigned int existing_folder_count = 0; // Get the version folder: that's where the counts start from - const LLViewerInventoryCategory * version_folder = ((root_folder && (root_folder != dest_folder)) ? gInventory.getFirstDescendantOf(root_folder->getUUID(), dest_folder->getUUID()) : NULL); + const LLViewerInventoryCategory * version_folder = ((root_folder && (root_folder != dest_folder)) ? gInventory.getFirstDescendantOf(root_folder->getUUID(), dest_folder->getUUID()) : nullptr); if (version_folder) { @@ -1433,7 +1433,7 @@ bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLIn int insertion_point_folder_depth = (root_folder ? get_folder_path_length(root_folder->getUUID(), dest_folder->getUUID()) + 1 : 1); // Get the version folder: that's where the folders and items counts start from - const LLViewerInventoryCategory * version_folder = (insertion_point_folder_depth >= 2 ? gInventory.getFirstDescendantOf(root_folder->getUUID(), dest_folder->getUUID()) : NULL); + const LLViewerInventoryCategory * version_folder = (insertion_point_folder_depth >= 2 ? gInventory.getFirstDescendantOf(root_folder->getUUID(), dest_folder->getUUID()) : nullptr); // Compare the whole with the nested folders depth limit // Note: substract 2 as we leave root and version folder out of the count threshold @@ -1543,7 +1543,7 @@ bool move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_fol LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; LLViewerInventoryCategory * linked_category = viewer_inv_item->getLinkedCategory(); - if (linked_category != NULL) + if (linked_category != nullptr) { // Move the linked folder directly return move_folder_to_marketplacelistings(linked_category, dest_folder, copy); @@ -1552,7 +1552,7 @@ bool move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_fol { // Grab the linked item if any LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem(); - viewer_inv_item = (linked_item != NULL ? linked_item : viewer_inv_item); + viewer_inv_item = (linked_item != nullptr ? linked_item : viewer_inv_item); // If we want to copy but the item is no copy, fail silently (this is a common case that doesn't warrant notification) if (copy && !viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) @@ -2680,7 +2680,7 @@ bool can_share_item(const LLUUID& item_id) } else { - can_share = (gInventory.getCategory(item_id) != NULL); + can_share = (gInventory.getCategory(item_id) != nullptr); } const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); @@ -3352,7 +3352,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root if (user_confirm && (("delete" == action) || ("cut" == action) || ("rename" == action) || ("properties" == action) || ("task_properties" == action) || ("open" == action))) { std::set::iterator set_iter = selected_items.begin(); - LLFolderViewModelItemInventory * viewModel = NULL; + LLFolderViewModelItemInventory * viewModel = nullptr; for (; set_iter != selected_items.end(); ++set_iter) { viewModel = dynamic_cast((*set_iter)->getViewModelItem()); @@ -3554,7 +3554,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root } - LLMultiPreview* multi_previewp = NULL; + LLMultiPreview* multi_previewp = nullptr; LLMultiItemProperties* multi_itempropertiesp = nullptr; if (("task_open" == action || "open" == action) && selected_items.size() > 1) @@ -3773,7 +3773,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root // Update the marketplace listings that have been affected by the operation updateMarketplaceFolders(); - LLFloater::setFloaterHost(NULL); + LLFloater::setFloaterHost(nullptr); if (multi_previewp) { multi_previewp->openFloater(LLSD()); @@ -3812,7 +3812,7 @@ void LLInventoryAction::saveMultipleTextures(const std::vector& fil bridge->performAction(model, "save_selected_as"); } - LLFloater::setFloaterHost(NULL); + LLFloater::setFloaterHost(nullptr); if (multi_previewp) { multi_previewp->openFloater(LLSD()); @@ -3825,7 +3825,7 @@ void LLInventoryAction::removeItemFromDND(LLFolderView* root) { //Get selected items LLFolderView::selected_items_t selectedItems = root->getSelectedItems(); - LLFolderViewModelItemInventory * viewModel = NULL; + LLFolderViewModelItemInventory * viewModel = nullptr; //If user is in DND and deletes item, make sure the notification is not displayed by removing the notification //from DND history and .xml file. Once this is done, upon exit of DND mode the item deleted will not show a notification. @@ -4019,7 +4019,7 @@ void LLInventoryAction::buildMarketplaceFolders(LLFolderView* root) std::set selected_items = root->getSelectionList(); std::set::iterator set_iter = selected_items.begin(); - LLFolderViewModelItemInventory * viewModel = NULL; + LLFolderViewModelItemInventory * viewModel = nullptr; for (; set_iter != selected_items.end(); ++set_iter) { viewModel = dynamic_cast((*set_iter)->getViewModelItem()); diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index f77088e0b1..e4e2da07d3 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -92,9 +92,9 @@ class LLGalleryPanel: public LLPanel LLInventoryGallery::LLInventoryGallery(const LLInventoryGallery::Params& p) : LLPanel(), - mScrollPanel(NULL), - mGalleryPanel(NULL), - mLastRowPanel(NULL), + mScrollPanel(nullptr), + mGalleryPanel(nullptr), + mLastRowPanel(nullptr), mGalleryCreated(false), mRowCount(0), mItemsAddedCount(0), @@ -160,7 +160,7 @@ LLInventoryGallery::~LLInventoryGallery() { if (gEditMenuHandler == this) { - gEditMenuHandler = NULL; + gEditMenuHandler = nullptr; } delete mInventoryGalleryMenu; @@ -515,7 +515,7 @@ void LLInventoryGallery::removeLastRow() } else { - mLastRowPanel = NULL; + mLastRowPanel = nullptr; } } @@ -691,7 +691,7 @@ void LLInventoryGallery::reshapeGalleryPanel(int row_count) LLPanel* LLInventoryGallery::buildItemPanel(int left) { int top = 0; - LLPanel* lpanel = NULL; + LLPanel* lpanel = nullptr; if(mUnusedItemPanels.empty()) { LLPanel::Params lpparams; @@ -716,7 +716,7 @@ LLPanel* LLInventoryGallery::buildItemPanel(int left) LLPanel* LLInventoryGallery::buildRowPanel(int left, int bottom) { - LLPanel* stack = NULL; + LLPanel* stack = nullptr; if(mUnusedRowPanels.empty()) { LLPanel::Params sparams; @@ -895,7 +895,7 @@ void LLInventoryGallery::getCurrentCategories(uuid_vec_t& vcur) iter != mItemMap.end(); iter++) { - if ((*iter).second != NULL) + if ((*iter).second != nullptr) { vcur.push_back((*iter).first); } @@ -979,7 +979,7 @@ void LLInventoryGallery::updateRemovedItem(LLUUID item_id) removeFromGalleryMiddle(item); // kill removed item - if (item != NULL) + if (item != nullptr) { // Todo: instead of deleting, store somewhere to reuse later item->die(); @@ -1367,7 +1367,7 @@ void LLInventoryGallery::moveRight(MASK mask) void LLInventoryGallery::toggleSelectionRange(S32 start_idx, S32 end_idx) { - LLInventoryGalleryItem* item = NULL; + LLInventoryGalleryItem* item = nullptr; if (end_idx > start_idx) { for (S32 i = start_idx; i <= end_idx; i++) @@ -1431,7 +1431,7 @@ void LLInventoryGallery::onFocusLost() // inventory no longer handles cut/copy/paste/delete if (gEditMenuHandler == this) { - gEditMenuHandler = NULL; + gEditMenuHandler = nullptr; } LLPanel::onFocusLost(); @@ -1454,7 +1454,7 @@ void LLInventoryGallery::onFocusReceived() // Tab support, when tabbing into this view, select first item if (mSelectedItemIDs.size() > 0) { - LLInventoryGalleryItem* focus_item = NULL; + LLInventoryGalleryItem* focus_item = nullptr; for (const LLUUID& id : mSelectedItemIDs) { LLInventoryGalleryItem* item = getItem(id); @@ -1640,7 +1640,7 @@ LLInventoryGalleryItem* LLInventoryGallery::getFirstSelectedItem() selection_deque::iterator iter = mSelectedItemIDs.begin(); return getItem(*iter); } - return NULL; + return nullptr; } void LLInventoryGallery::copy() @@ -1987,11 +1987,11 @@ void LLInventoryGallery::onDelete(const LLSD& notification, const LLSD& response { for (const LLUUID& id : item_deletion_list) { - remove_inventory_item(id, NULL); + remove_inventory_item(id, nullptr); } for (const LLUUID& id : cat_deletion_list) { - remove_inventory_category(id, NULL); + remove_inventory_category(id, nullptr); } }); } @@ -2190,7 +2190,7 @@ void LLInventoryGallery::pasteAsLink(const LLUUID& dest, return; } - LLPointer cb = NULL; + LLPointer cb = nullptr; if (dest == mFolderID) { LLHandle handle = getHandle(); @@ -2225,7 +2225,7 @@ void LLInventoryGallery::doCreate(const LLUUID& dest, const LLSD& userdata) LLViewerInventoryCategory* cat = gInventory.getCategory(dest); if (cat && mFolderID != dest) { - menu_create_inventory_item(NULL, dest, userdata, LLUUID::null); + menu_create_inventory_item(nullptr, dest, userdata, LLUUID::null); } else { @@ -2248,7 +2248,7 @@ void LLInventoryGallery::doCreate(const LLUUID& dest, const LLSD& userdata) } }; - menu_create_inventory_item(NULL, mFolderID, userdata, LLUUID::null, callback_cat_created); + menu_create_inventory_item(nullptr, mFolderID, userdata, LLUUID::null, callback_cat_created); } } @@ -2261,7 +2261,7 @@ void LLInventoryGallery::resetEditHandler() { if (gEditMenuHandler == this) { - gEditMenuHandler = NULL; + gEditMenuHandler = nullptr; } } @@ -2800,7 +2800,7 @@ LLInventoryGalleryItem::LLInventoryGalleryItem(const Params& p) mIsFolder(true), mIsLink(false), mHidden(false), - mGallery(NULL), + mGallery(nullptr), mType(LLAssetType::AT_NONE), mSortGroup(SG_ITEM), mCutGeneration(0), @@ -3009,7 +3009,7 @@ bool LLInventoryGalleryItem::handleMouseUp(S32 x, S32 y, MASK mask) { if (hasMouseCapture()) { - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); return true; } return LLPanel::handleMouseUp(x, y, mask); @@ -3346,7 +3346,7 @@ bool dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, bool drop, LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); bool accept = false; - LLViewerObject* object = NULL; + LLViewerObject* object = nullptr; if (LLToolDragAndDrop::SOURCE_AGENT == source) { const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); @@ -3471,7 +3471,7 @@ bool dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, bool drop, inv_item->getUUID(), folder_id, std::string(), - LLPointer(NULL)); + LLPointer(nullptr)); } // CURRENT OUTFIT or OUTFIT folder // (link the item) @@ -3483,7 +3483,7 @@ bool dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, bool drop, } else { - LLPointer cb = NULL; + LLPointer cb = nullptr; link_inventory_object(folder_id, LLConstPointer(inv_item), cb); } } @@ -3665,7 +3665,7 @@ bool dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, bool drop, inv_item->getUUID(), folder_id, std::string(), - LLPointer(NULL)); + LLPointer(nullptr)); } // CURRENT OUTFIT or OUTFIT folder // (link the item) @@ -3677,7 +3677,7 @@ bool dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, bool drop, } else { - LLPointer cb = NULL; + LLPointer cb = nullptr; link_inventory_object(folder_id, LLConstPointer(inv_item), cb); } } @@ -3689,7 +3689,7 @@ bool dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, bool drop, inv_item->getUUID(), folder_id, std::string(), - LLPointer(NULL)); + LLPointer(nullptr)); } } } @@ -3735,7 +3735,7 @@ bool dragCategoryIntoFolder(LLUUID dest_id, LLInventoryCategory* inv_cat, // check to make sure source is agent inventory, and is represented there. LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); - const bool is_agent_inventory = (model->getCategory(cat_id) != NULL) + const bool is_agent_inventory = (model->getCategory(cat_id) != nullptr) && (LLToolDragAndDrop::SOURCE_AGENT == source); bool accept = false; @@ -4179,7 +4179,7 @@ void outfitFolderCreatedCallback(LLUUID cat_source_id, LLUUID cat_dest_id) if (!link_array.empty()) { - LLPointer cb = NULL; + LLPointer cb = nullptr; link_inventory_array(cat_dest_id, link_array, cb); } } diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index 2c3909cc79..a4091b5d27 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -190,7 +190,7 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata) { for (LLUUID& selected_id : mUUIDs) { - remove_inventory_object(selected_id, NULL); + remove_inventory_object(selected_id, nullptr); } } else if ("goto" == action) @@ -470,7 +470,7 @@ void LLInventoryGalleryContextMenu::onRename(const LLSD& notification, const LLS { LLSD updates; updates["name"] = new_name; - update_inventory_category(cat->getUUID(),updates, NULL); + update_inventory_category(cat->getUUID(),updates, nullptr); return; } @@ -479,7 +479,7 @@ void LLInventoryGalleryContextMenu::onRename(const LLSD& notification, const LLS { LLSD updates; updates["name"] = new_name; - update_inventory_item(item->getUUID(),updates, NULL); + update_inventory_item(item->getUUID(),updates, nullptr); } } } @@ -525,7 +525,7 @@ bool is_inbox_folder(LLUUID item_id) bool can_list_on_marketplace(const LLUUID &id) { const LLInventoryObject* obj = gInventory.getObject(id); - bool can_list = (obj != NULL); + bool can_list = (obj != nullptr); if (can_list) { diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index 15735ebde3..a4f0aa3ae7 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -291,7 +291,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) { new_visible_items |= updateItemVisibility(item_pair->first, action); } @@ -386,8 +386,8 @@ LLPanel* LLInventoryItemsList::createNewItem(LLViewerInventoryItem* item) if (!item) { LL_WARNS() << "No inventory item. Couldn't create flat list item." << LL_ENDL; - llassert(item != NULL); - return NULL; + llassert(item != nullptr); + return nullptr; } return LLPanelInventoryListItemBase::create(item); } diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp index a435a4f7c7..c810bb1845 100644 --- a/indra/newview/llinventorylistitem.cpp +++ b/indra/newview/llinventorylistitem.cpp @@ -70,7 +70,7 @@ LLPanelInventoryListItemBase::Params::Params() LLPanelInventoryListItemBase* LLPanelInventoryListItemBase::create(LLViewerInventoryItem* item) { LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; - LLPanelInventoryListItemBase* list_item = NULL; + LLPanelInventoryListItemBase* list_item = nullptr; if (item) { const LLPanelInventoryListItemBase::Params& params = LLUICtrlFactory::getDefaultParams(); @@ -228,7 +228,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; } @@ -238,7 +238,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; } @@ -248,7 +248,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; } @@ -258,7 +258,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; } @@ -268,7 +268,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; } @@ -312,8 +312,8 @@ 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), + mIconCtrl(nullptr), + mTitleCtrl(nullptr), mWidgetSpacing(WIDGET_SPACING), mLeftWidgetsWidth(0), mRightWidgetsWidth(0), diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 043fd7003d..c2ffaefc74 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -440,14 +440,14 @@ LLInventoryModel::LLInventoryModel() mItemMap(), mParentChildCategoryTree(), mParentChildItemTree(), - mLastItem(NULL), + mLastItem(nullptr), mIsNotifyObservers(false), mModifyMask(LLInventoryObserver::ALL), mChangedItemIDs(), mBulkFecthCallbackSlot(), mObservers(), - mHttpRequestFG(NULL), - mHttpRequestBG(NULL), + mHttpRequestFG(nullptr), + mHttpRequestBG(nullptr), mHttpOptions(), mHttpHeaders(), mHttpPolicyClass(LLCore::HttpRequest::DEFAULT_POLICY_ID), @@ -486,9 +486,9 @@ void LLInventoryModel::cleanupInventory() mHttpOptions.reset(); delete mHttpRequestFG; - mHttpRequestFG = NULL; + mHttpRequestFG = nullptr; delete mHttpRequestBG; - mHttpRequestBG = NULL; + mHttpRequestBG = nullptr; } // This is a convenience function to check if one object has a parent @@ -523,7 +523,7 @@ const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(cons if(!obj) { LL_WARNS(LOG_INV) << "Non-existent object [ id: " << obj_id << " ] " << LL_ENDL; - return NULL; + return nullptr; } // Search up the parent chain until we get to root or an acceptable folder. // This assumes there are no cycles in the tree else we'll get a hang. @@ -541,7 +541,7 @@ const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(cons } parent_id = cat->getParentUUID(); } - return NULL; + return nullptr; } // @@ -551,17 +551,17 @@ const LLViewerInventoryCategory* LLInventoryModel::getFirstDescendantOf(const LL { if (master_parent_id == obj_id) { - return NULL; + return nullptr; } const LLViewerInventoryCategory* current_cat = getCategory(obj_id); - if (current_cat == NULL) + if (current_cat == nullptr) { current_cat = getCategory(getObject(obj_id)->getParentUUID()); } - while (current_cat != NULL) + while (current_cat != nullptr) { const LLUUID& current_parent_id = current_cat->getParentUUID(); @@ -573,7 +573,7 @@ const LLViewerInventoryCategory* LLInventoryModel::getFirstDescendantOf(const LL current_cat = getCategory(current_parent_id); } - return NULL; + return nullptr; } LLInventoryModel::EAncestorResult LLInventoryModel::getObjectTopmostAncestor(const LLUUID& object_id, LLUUID& result) const @@ -607,7 +607,7 @@ LLInventoryModel::EAncestorResult LLInventoryModel::getObjectTopmostAncestor(con return ANCESTOR_OK; } -// Get the object by id. Returns NULL if not found. +// Get the object by id. Returns nullptr if not found. LLInventoryObject* LLInventoryModel::getObject(const LLUUID& id) const { LLViewerInventoryCategory* cat = getCategory(id); @@ -620,13 +620,13 @@ LLInventoryObject* LLInventoryModel::getObject(const LLUUID& id) const { return item; } - return NULL; + return nullptr; } -// Get the item by id. Returns NULL if not found. +// Get the item by id. Returns nullptr if not found. LLViewerInventoryItem* LLInventoryModel::getItem(const LLUUID& id) const { - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; if(mLastItem.notNull() && mLastItem->getUUID() == id) { item = mLastItem; @@ -643,10 +643,10 @@ LLViewerInventoryItem* LLInventoryModel::getItem(const LLUUID& id) const return item; } -// Get the category by id. Returns NULL if not found +// Get the category by id. Returns nullptr if not found LLViewerInventoryCategory* LLInventoryModel::getCategory(const LLUUID& id) const { - LLViewerInventoryCategory* category = NULL; + LLViewerInventoryCategory* category = nullptr; cat_map_t::const_iterator iter = mCategoryMap.find(id); if (iter != mCategoryMap.end()) { @@ -808,7 +808,7 @@ void LLInventoryModel::consolidateForType(const LLUUID& main_id, LLFolderType::E changeCategoryParent(cat, trash_id, true); } } - remove_inventory_category(folder_id, NULL); + remove_inventory_category(folder_id, nullptr); } } @@ -1218,7 +1218,7 @@ bool LLInventoryModel::hasMatchingDirectDescendent(const LLUUID& cat_id, for (LLInventoryModel::cat_array_t::const_iterator it = cats->begin(); it != cats->end(); ++it) { - if (filter(*it,NULL)) + if (filter(*it, nullptr)) { return true; } @@ -1229,7 +1229,7 @@ bool LLInventoryModel::hasMatchingDirectDescendent(const LLUUID& cat_id, for (LLInventoryModel::item_array_t::const_iterator it = items->begin(); it != items->end(); ++it) { - if (filter(NULL,*it)) + if (filter(nullptr, *it)) { return true; } @@ -1287,7 +1287,7 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, { break; } - if(add(cat,NULL)) + if(add(cat, nullptr)) { cats.push_back(cat); } @@ -1306,7 +1306,7 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, { break; } - if(add(NULL, item)) + if(add(nullptr, item)) { items.push_back(item); } @@ -1329,7 +1329,7 @@ bool LLInventoryModel::hasMatchingDescendents(const LLUUID& id, { for (auto& cat : *cat_array) { - if (matches(cat, NULL)) + if (matches(cat, nullptr)) { return true; } @@ -1346,7 +1346,7 @@ bool LLInventoryModel::hasMatchingDescendents(const LLUUID& id, { for (auto& item : *item_array) { - if (matches(NULL, item)) + if (matches(nullptr, item)) { return true; } @@ -1386,7 +1386,7 @@ const LLUUID& LLInventoryModel::getLinkedItemID(const LLUUID& object_id) const LLViewerInventoryItem* LLInventoryModel::getLinkedItem(const LLUUID& object_id) const { - return object_id.notNull() ? getItem(getLinkedItemID(object_id)) : NULL; + return object_id.notNull() ? getItem(getLinkedItemID(object_id)) : nullptr; } LLInventoryModel::item_array_t LLInventoryModel::collectLinksTo(const LLUUID& id) @@ -2048,7 +2048,7 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, boo LLInventoryModel::item_array_t links = collectLinksTo(id); LL_DEBUGS(LOG_INV) << "Deleting inventory object " << id << LL_ENDL; - mLastItem = NULL; + mLastItem = nullptr; LLUUID parent_id = obj->getParentUUID(); mCategoryMap.erase(id); mItemMap.erase(id); @@ -2367,7 +2367,7 @@ void LLInventoryModel::cache( item_array_t items; LLCanCache can_cache(this); - can_cache(root_cat, NULL); + can_cache(root_cat, nullptr); collectDescendentsIf( parent_folder_id, categories, @@ -2561,7 +2561,7 @@ void LLInventoryModel::empty() mBacklinkMMap.clear(); // forget all backlink information. mCategoryMap.clear(); // remove all references (should delete entries) mItemMap.clear(); // remove all references (should delete entries) - mLastItem = NULL; + mLastItem = nullptr; //mInventory.clear(); } @@ -2761,7 +2761,7 @@ bool LLInventoryModel::loadSkeleton( if(fp) { fclose(fp); - fp = NULL; + fp = nullptr; if(gunzip_file(gzip_filename, inventory_filename)) { // we only want to remove the inventory file if it was @@ -3175,8 +3175,8 @@ void LLInventoryModel::buildParentChildMap() msg->nextBlockFast(_PREHASH_InventoryData); msg->addUUIDFast(_PREHASH_ItemID, (*it)); msg->addUUIDFast(_PREHASH_FolderID, lnf); - msg->addString("NewName", NULL); - if(msg->isSendFull(NULL)) + msg->addString("NewName", nullptr); + if(msg->isSendFull(nullptr)) { start_new_message = true; gAgent.sendReliableMessage(); @@ -3568,28 +3568,28 @@ void LLInventoryModel::registerCallbacks(LLMessageSystem* msg) { //msg->setHandlerFuncFast(_PREHASH_InventoryUpdate, // processInventoryUpdate, - // NULL); + // nullptr); //msg->setHandlerFuncFast(_PREHASH_UseCachedInventory, // processUseCachedInventory, - // NULL); + // nullptr); msg->setHandlerFuncFast(_PREHASH_UpdateCreateInventoryItem, processUpdateCreateInventoryItem, - NULL); + nullptr); msg->setHandlerFuncFast(_PREHASH_RemoveInventoryItem, processRemoveInventoryItem, - NULL); + nullptr); msg->setHandlerFuncFast(_PREHASH_RemoveInventoryFolder, processRemoveInventoryFolder, - NULL); + nullptr); msg->setHandlerFuncFast(_PREHASH_RemoveInventoryObjects, processRemoveInventoryObjects, - NULL); + nullptr); msg->setHandlerFuncFast(_PREHASH_SaveAssetIntoInventory, processSaveAssetIntoInventory, - NULL); + nullptr); msg->setHandlerFuncFast(_PREHASH_BulkUpdateInventory, processBulkUpdateInventory, - NULL); + nullptr); msg->setHandlerFunc("MoveInventoryItem", processMoveInventoryItem); } @@ -4085,7 +4085,7 @@ bool LLInventoryModel::callbackEmptyFolderType(const LLSD& notification, const L if (option == 0) // YES { const LLUUID folder_id = findCategoryUUIDForType(preferred_type); - purge_descendents_of(folder_id, NULL); + purge_descendents_of(folder_id, nullptr); } return false; } @@ -4110,7 +4110,7 @@ void LLInventoryModel::emptyFolderType(const std::string notification, LLFolderT else { const LLUUID folder_id = findCategoryUUIDForType(preferred_type); - purge_descendents_of(folder_id, NULL); + purge_descendents_of(folder_id, nullptr); } } @@ -4876,7 +4876,7 @@ std::string LLInventoryModel::getFullPath(const LLInventoryObject *obj) const { std::vector path_elts; std::map visited; - while (obj != NULL && !visited[obj->getUUID()]) + while (obj != nullptr && !visited[obj->getUUID()]) { path_elts.push_back(obj->getName()); // avoid infinite loop in the unlikely event of a cycle @@ -4899,9 +4899,9 @@ std::string LLInventoryModel::getFullPath(const LLInventoryObject *obj) const bool decompress_file(const char* src_filename, const char* dst_filename) { bool rv = false; - gzFile src = NULL; - U8* buffer = NULL; - LLFILE* dst = NULL; + gzFile src = nullptr; + U8* buffer = nullptr; + LLFILE* dst = nullptr; S32 bytes = 0; const S32 DECOMPRESS_BUFFER_SIZE = 32000; @@ -4929,9 +4929,9 @@ bool decompress_file(const char* src_filename, const char* dst_filename) rv = true; err_decompress: - if(src != NULL) gzclose(src); - if(buffer != NULL) delete[] buffer; - if(dst != NULL) fclose(dst); + if(src != nullptr) gzclose(src); + if(buffer != nullptr) delete[] buffer; + if(dst != nullptr) fclose(dst); return rv; } #endif @@ -4963,7 +4963,7 @@ void LLInventoryModel::FetchItemHttpHandler::onCompleted(LLCore::HttpHandle hand } LLCore::BufferArray * body(response->getBody()); - // body = NULL; // Dev tool to force error handling + // body = nullptr; // Dev tool to force error handling if (! body || ! body->size()) { LL_WARNS(LOG_INV) << "Missing data in inventory item query." << LL_ENDL; diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 2859923df9..99716166f3 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -335,17 +335,17 @@ class LLInventoryModel // Get first descendant of the child object under the specified parent const LLViewerInventoryCategory *getFirstDescendantOf(const LLUUID& master_parent_id, const LLUUID& obj_id) const; - // Get the object by id. Returns NULL if not found. + // Get the object by id. Returns nullptr if not found. // NOTE: Use the pointer returned for read operations - do // not modify the object values in place or you will break stuff. LLInventoryObject* getObject(const LLUUID& id) const; - // Get the item by id. Returns NULL if not found. + // Get the item by id. Returns nullptr if not found. // NOTE: Use the pointer for read operations - use the // updateItem() method to actually modify values. LLViewerInventoryItem* getItem(const LLUUID& id) const; - // Get the category by id. Returns NULL if not found. + // Get the category by id. Returns nullptr if not found. // NOTE: Use the pointer for read operations - use the // updateCategory() method to actually modify values. LLViewerInventoryCategory* getCategory(const LLUUID& id) const; @@ -484,7 +484,7 @@ class LLInventoryModel //-------------------------------------------------------------------- public: // Returns the UUID of the new category. If you want to use the default - // name based on type, pass in a NULL to the 'name' parameter. + // name based on type, pass in a nullptr to the 'name' parameter. void createNewCategory(const LLUUID& parent_id, LLFolderType::EType preferred_type, const std::string& name, diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 1e5f771ba7..3733381b91 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -608,8 +608,8 @@ void LLInventoryModelBackgroundFetch::onAISContentCalback( else { // push descendant back to verify they are fetched fully (ex: didn't encounter depth limit) - 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(*folder_iter, categories, items); if (categories) { @@ -705,8 +705,8 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID& request_i if (request_descendants) { - 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(request_id, categories, items); if (categories) { @@ -874,8 +874,8 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc { // fetch content only, ignore cat itself uuid_vec_t children; - 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_id, categories, items); LLViewerInventoryCategory::EFetchType target_state = LLViewerInventoryCategory::FETCH_RECURSIVE; @@ -1000,8 +1000,8 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc if (fetch_info.mFetchType == FT_RECURSIVE || fetch_info.mFetchType == FT_FOLDER_AND_CONTENT) { - 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_id, categories, items); if (categories) { @@ -1153,8 +1153,8 @@ void LLInventoryModelBackgroundFetch::bulkFetch() // May already have this folder, but append child folders to list. if (fetch_info.mFetchType >= FT_CONTENT_RECURSIVE) { - 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_id, categories, items); for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); it != categories->end(); @@ -1313,7 +1313,7 @@ void BGFolderHttpHandler::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRes // Response body should be present. LLCore::BufferArray* body(response->getBody()); - // body = NULL; // Dev tool to force error handling + // body = nullptr; // Dev tool to force error handling if (! body || ! body->size()) { LL_WARNS(LOG_INV) << "Missing data in inventory folder query." << LL_ENDL; diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index a50d6b579e..5209ba96cf 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -471,7 +471,7 @@ bool LLInventoryFetchDescendentsObserver::isCategoryComplete(const LLViewerInven if (!cats || !items) { LL_WARNS() << "Category '" << cat->getName() << "' descendents corrupted, fetch failed." << LL_ENDL; - // NULL means the call failed -- cats/items map doesn't exist (note: this does NOT mean + // nullptr means the call failed -- cats/items map doesn't exist (note: this does NOT mean // that the cat just doesn't have any items or subfolders). // Unrecoverable, so just return done so that this observer can be cleared // from memory. @@ -706,11 +706,11 @@ void LLInventoryCategoriesObserver::changed(U32 mask) if (!cats || !items) { LL_WARNS() << "Category '" << category->getName() << "' descendents corrupted, fetch failed." << LL_ENDL; - // NULL means the call failed -- cats/items map doesn't exist (note: this does NOT mean + // nullptr means the call failed -- cats/items map doesn't exist (note: this does NOT mean // that the cat just doesn't have any items or subfolders). // Unrecoverable, so just skip this category. - llassert(cats != NULL && items != NULL); + llassert(cats != nullptr && items != nullptr); continue; } @@ -795,12 +795,12 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t if (!cats || !items) { LL_WARNS() << "Category '" << category->getName() << "' descendents corrupted, fetch failed." << LL_ENDL; - // NULL means the call failed -- cats/items map doesn't exist (note: this does NOT mean + // nullptr means the call failed -- cats/items map doesn't exist (note: this does NOT mean // that the cat just doesn't have any items or subfolders). // Unrecoverable, so just return "false" meaning that the category can't be observed. can_be_added = false; - llassert(cats != NULL && items != NULL); + llassert(cats != nullptr && items != nullptr); } else { diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index cde87ede9b..561d570931 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -146,9 +146,9 @@ void LLInvPanelComplObserver::done() LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : LLPanel(p), - mInventoryObserver(NULL), - mCompletionObserver(NULL), - mScroller(NULL), + mInventoryObserver(nullptr), + mCompletionObserver(nullptr), + mScroller(nullptr), mSortOrderSetting(p.sort_order_setting), mInventory(p.inventory), //inventory("", &gInventory) mAcceptsDragAndDrop(p.accepts_drag_and_drop), @@ -160,7 +160,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mSuppressOpenItemAction(false), mBuildViewsOnInit(p.preinitialize_views), mViewsInitialized(VIEWS_UNINITIALIZED), - mInvFVBridgeBuilder(NULL), + mInvFVBridgeBuilder(nullptr), mInventoryViewModel(p.name), mGroupedItemBridge(new LLFolderViewGroupedItemBridge), mFocusSelection(false), @@ -204,7 +204,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; @@ -214,7 +214,7 @@ LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) p.show_empty_message = mShowEmptyMessage; p.suppress_folder_menu = mSuppressFolderMenu; 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"; @@ -234,20 +234,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; } } @@ -404,7 +404,7 @@ void LLInventoryPanel::onVisibilityChange(bool new_visibility) if (new_visibility && mViewsInitialized == VIEWS_UNINITIALIZED) { // first call can be from tab initialization - if (gFloaterView->getParentFloater(this) != NULL) + if (gFloaterView->getParentFloater(this) != nullptr) { initializeViewBuilding(); } @@ -544,11 +544,11 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve { LLFolderViewItem* view_item = getItemByID(item_id); LLFolderViewModelItemInventory* viewmodel_item = - static_cast(view_item ? view_item->getViewModelItem() : NULL); + static_cast(view_item ? view_item->getViewModelItem() : nullptr); // 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. @@ -609,16 +609,16 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve LLInventoryObject const* objectp = mInventory->getObject(item_id); if (objectp) { - // providing NULL directly avoids unnessesary getItemByID calls - view_item = buildNewViews(item_id, objectp, NULL, BUILD_ONE_FOLDER); + // providing nullptr directly avoids unnessesary getItemByID calls + view_item = buildNewViews(item_id, objectp, nullptr, BUILD_ONE_FOLDER); } else { - view_item = NULL; + view_item = nullptr; } viewmodel_item = - static_cast(view_item ? view_item->getViewModelItem() : NULL); + static_cast(view_item ? view_item->getViewModelItem() : nullptr); view_folder = dynamic_cast(view_item); } @@ -675,8 +675,8 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve LLInventoryObject const* objectp = mInventory->getObject(item_id); if (objectp) { - // providing NULL directly avoids unnessesary getItemByID calls - buildNewViews(item_id, objectp, NULL, BUILD_ONE_FOLDER); + // providing nullptr directly avoids unnessesary getItemByID calls + buildNewViews(item_id, objectp, nullptr, BUILD_ONE_FOLDER); } // Select any newly created object that has the auto rename at top of folder root set. @@ -711,10 +711,10 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve LLFolderViewFolder* new_parent = getFolderByID(model_item->getParentUUID()); if (old_parent != new_parent // Item has been moved. - && (new_parent != NULL || !isInRootContent(item_id, view_item)) // item is not or shouldn't be in root content + && (new_parent != nullptr || !isInRootContent(item_id, view_item)) // item is not or shouldn't be in root content ) { - 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); @@ -1102,12 +1102,12 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id, LLInventoryO { if (!objectp) { - return NULL; + return nullptr; } if (!typedViewsFilter(id, objectp)) { // if certain types are not allowed permanently, no reason to create views - return NULL; + return nullptr; } const LLUUID &parent_id = objectp->getParentUUID(); @@ -1124,12 +1124,12 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id, { if (!objectp) { - return NULL; + return nullptr; } if (!typedViewsFilter(id, objectp)) { // if certain types are not allowed permanently, no reason to create views - return NULL; + return nullptr; } const LLUUID &parent_id = objectp->getParentUUID(); @@ -1158,7 +1158,7 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(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(folder_view_item); - folder_view_item = NULL; + folder_view_item = nullptr; allow_drop = mParams.allow_drop_on_root; create_root = true; } @@ -1171,7 +1171,7 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id, LL_WARNS() << "LLInventoryPanel::buildViewsTree 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_COUNT) @@ -1236,7 +1236,7 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id, if (folder_view_item) { - llassert(parent_folder != NULL); + llassert(parent_folder != nullptr); folder_view_item->addToFolder(parent_folder); addItemID(id, folder_view_item); // In the case of the root folder been shown, open that folder by default once the widget is created @@ -1345,7 +1345,7 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id, } else { - buildViewsTree(cat->getUUID(), id, cat, NULL, parentp, (mode == BUILD_ONE_FOLDER ? BUILD_NO_CHILDREN : mode), depth); + buildViewsTree(cat->getUUID(), id, cat, nullptr, parentp, (mode == BUILD_ONE_FOLDER ? BUILD_NO_CHILDREN : mode), depth); } } @@ -1450,7 +1450,7 @@ void LLInventoryPanel::openSelected() void LLInventoryPanel::unSelectAll() { - mFolderRoot.get()->setSelection(NULL, false, false); + mFolderRoot.get()->setSelection(nullptr, false, false); } @@ -1540,7 +1540,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(); @@ -1879,7 +1879,7 @@ void LLInventoryPanel::callbackPurgeSelectedItems(const LLSD& notification, cons for (auto it : inventory_selected) { - remove_inventory_object(it, NULL); + remove_inventory_object(it, nullptr); } } } @@ -1899,7 +1899,7 @@ bool LLInventoryPanel::attachObject(const LLSD& userdata) // Attach selected items. LLViewerAttachMenu::attachObjects(items, userdata.asString()); - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); return true; } @@ -1928,8 +1928,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) @@ -2126,7 +2126,7 @@ LLFolderViewItem* LLInventoryPanel::getItemByID(const LLUUID& id) return map_it->second; } - return NULL; + return nullptr; } LLFolderViewFolder* LLInventoryPanel::getFolderByID(const LLUUID& id) @@ -2544,7 +2544,7 @@ void LLInventoryFavoritesItemsPanel::itemChanged(const LLUUID& id, U32 mask, con const LLUUID& parent_id = model_item->getParentUUID(); mRootContentIDs.emplace(id); - buildViewsTree(id, parent_id, model_item, NULL, mFolderRoot.get(), BUILD_ONE_FOLDER); + buildViewsTree(id, parent_id, model_item, nullptr, mFolderRoot.get(), BUILD_ONE_FOLDER); } } handled = true; @@ -2753,7 +2753,7 @@ void LLInventorySingleFolderPanel::updateSingleFolderRoot() { removeChild(mScroller); delete mScroller; - mScroller = NULL; + mScroller = nullptr; } mScroller = LLUICtrlFactory::create(scroller_params); addChild(mScroller); diff --git a/indra/newview/llkeyconflict.cpp b/indra/newview/llkeyconflict.cpp index 666ab4f5d0..9d5f0c9a49 100644 --- a/indra/newview/llkeyconflict.cpp +++ b/indra/newview/llkeyconflict.cpp @@ -576,7 +576,7 @@ void LLKeyConflictHandler::saveToSettings(bool temporary) if (!output_node->isNull()) { LLFILE *fp = LLFile::fopen(filename, "w"); - if (fp != NULL) + if (fp != nullptr) { LLXMLNode::writeHeaderToFile(fp); output_node->writeToFile(fp); diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index 73425e9f4c..c3879622fa 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -191,7 +191,7 @@ LLInventoryModel::item_array_t LLLandmarkActions::fetchLandmarksByName(std::stri bool LLLandmarkActions::landmarkAlreadyExists() { // Determine whether there are landmarks pointing to the current global agent position. - return findLandmarkForAgentPos() != NULL; + return findLandmarkForAgentPos() != nullptr; } //static @@ -217,7 +217,7 @@ LLViewerInventoryItem* LLLandmarkActions::findLandmarkForGlobalPos(const LLVecto if(items.empty()) { - return NULL; + return nullptr; } return items[0]; @@ -251,7 +251,7 @@ void LLLandmarkActions::createLandmarkHere( LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, NO_INV_SUBTYPE, PERM_ALL, - NULL); + nullptr); } void LLLandmarkActions::createLandmarkHere() @@ -349,13 +349,13 @@ void LLLandmarkActions::onRegionResponseNameAndCoords(region_name_and_coords_cal bool LLLandmarkActions::getLandmarkGlobalPos(const LLUUID& landmarkInventoryItemID, LLVector3d& posGlobal) { LLViewerInventoryItem* item = gInventory.getItem(landmarkInventoryItemID); - if (NULL == item) + if (nullptr == item) return false; const LLUUID& asset_id = item->getAssetUUID(); - LLLandmark* landmark = gLandmarkList.getAsset(asset_id, NULL); - if (NULL == landmark) + LLLandmark* landmark = gLandmarkList.getAsset(asset_id, nullptr); + if (nullptr == landmark) return false; return landmark->getGlobalPos(posGlobal); @@ -364,8 +364,8 @@ bool LLLandmarkActions::getLandmarkGlobalPos(const LLUUID& landmarkInventoryItem LLLandmark* LLLandmarkActions::getLandmark(const LLUUID& landmarkInventoryItemID, LLLandmarkList::loaded_callback_t cb) { LLViewerInventoryItem* item = gInventory.getItem(landmarkInventoryItemID); - if (NULL == item) - return NULL; + if (nullptr == item) + return nullptr; const LLUUID& asset_id = item->getAssetUUID(); @@ -375,7 +375,7 @@ LLLandmark* LLLandmarkActions::getLandmark(const LLUUID& landmarkInventoryItemID return landmark; } - return NULL; + return nullptr; } void LLLandmarkActions::copySLURLtoClipboard(const LLUUID& landmarkInventoryItemID) diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h index 0996dfed29..972281019a 100644 --- a/indra/newview/lllandmarkactions.h +++ b/indra/newview/lllandmarkactions.h @@ -105,7 +105,7 @@ class LLLandmarkActions * @brief Retrieve a landmark from gLandmarkList by inventory item's id * If a landmark is not currently in the gLandmarkList a callback "cb" is called when it is loaded. * - * @return pointer to loaded landmark from gLandmarkList or NULL if landmark does not exist or wasn't loaded. + * @return pointer to loaded landmark from gLandmarkList or nullptr if landmark does not exist or wasn't loaded. */ static LLLandmark* getLandmark(const LLUUID& landmarkInventoryItemID, LLLandmarkList::loaded_callback_t cb = nullptr); diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index 3fa0ab99f3..523073bddb 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -66,7 +66,7 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t { if ( mBadList.find(asset_uuid) != mBadList.end() ) { - return NULL; + return nullptr; } if (cb) @@ -84,7 +84,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; } } @@ -94,9 +94,9 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t gAssetStorage->getAssetData(asset_uuid, LLAssetType::AT_LANDMARK, LLLandmarkList::processGetAssetReply, - NULL); + nullptr); } - return NULL; + return nullptr; } // static diff --git a/indra/newview/lllistcontextmenu.cpp b/indra/newview/lllistcontextmenu.cpp index cf29fd0483..ec2b0d985b 100644 --- a/indra/newview/lllistcontextmenu.cpp +++ b/indra/newview/lllistcontextmenu.cpp @@ -106,7 +106,7 @@ void LLListContextMenu::handleMultiple(functor_t functor, const uuid_vec_t& ids) // static LLContextMenu* LLListContextMenu::createFromFile(const std::string& filename) { - llassert(LLMenuGL::sMenuContainer != NULL); + llassert(LLMenuGL::sMenuContainer != nullptr); return LLUICtrlFactory::getInstance()->createFromFile( filename, LLContextMenu::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); } diff --git a/indra/newview/lllistview.cpp b/indra/newview/lllistview.cpp index 8e923f6eb7..29cadf3ad4 100644 --- a/indra/newview/lllistview.cpp +++ b/indra/newview/lllistview.cpp @@ -43,7 +43,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 6e56aac270..eaf588c952 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -234,7 +234,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(); @@ -1096,7 +1096,7 @@ LLUUID LLLocalBitmapMgr::addUnit(const std::string& filename) LLNotificationsUtil::add("LocalBitmapsVerifyFail", notif_args); delete unit; - unit = NULL; + unit = nullptr; } return LLUUID::null; @@ -1162,7 +1162,7 @@ void LLLocalBitmapMgr::delUnit(LLUUID tracking_id) LLLocalBitmap* unit = *del_iter; mBitmapList.remove(unit); delete unit; - unit = NULL; + unit = nullptr; } } } diff --git a/indra/newview/lllocalgltfmaterials.cpp b/indra/newview/lllocalgltfmaterials.cpp index d6facad23d..96ccf62ece 100644 --- a/indra/newview/lllocalgltfmaterials.cpp +++ b/indra/newview/lllocalgltfmaterials.cpp @@ -375,7 +375,7 @@ S32 LLLocalGLTFMaterialMgr::addUnit(const std::string& filename) notif_args["FNAME"] = filename; LLNotificationsUtil::add("LocalGLTFVerifyFail", notif_args); - unit = NULL; + unit = nullptr; } } @@ -402,7 +402,7 @@ void LLLocalGLTFMaterialMgr::delUnit(LLUUID tracking_id) LLLocalGLTFMaterial* unit = *del_iter; mMaterialList.remove(unit); - unit = NULL; + unit = nullptr; } } } diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 54dd5792a0..666da860d7 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -210,18 +210,18 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) : LLComboBox(p), mIconHPad(p.icon_hpad), mAddLandmarkHPad(p.add_landmark_hpad), - mLocationContextMenu(NULL), - mAddLandmarkBtn(NULL), - mForSaleBtn(NULL), - mInfoBtn(NULL), + mLocationContextMenu(nullptr), + mAddLandmarkBtn(nullptr), + mForSaleBtn(nullptr), + mInfoBtn(nullptr), mRegionCrossingSlot(), mNavMeshSlot(), mIsNavMeshDirty(false), - mLandmarkImageOn(NULL), - mLandmarkImageOff(NULL), - mIconMaturityGeneral(NULL), - mIconMaturityAdult(NULL), - mIconMaturityModerate(NULL), + mLandmarkImageOn(nullptr), + mLandmarkImageOff(nullptr), + mIconMaturityGeneral(nullptr), + mIconMaturityAdult(nullptr), + mIconMaturityModerate(nullptr), mMaturityHelpTopic(p.maturity_help_topic) { // Lets replace default LLLineEditor with LLLocationLineEditor @@ -927,7 +927,7 @@ void LLLocationInputCtrl::refreshMaturityButton() return; bool button_visible = true; - LLPointer rating_image = NULL; + LLPointer rating_image = nullptr; std::string rating_tooltip; U8 sim_access = region->getSimAccess(); @@ -999,7 +999,7 @@ void LLLocationInputCtrl::addLocationHistoryEntry(const std::string& title, cons void LLLocationInputCtrl::rebuildLocationHistory(const std::string& filter) { LLLocationHistory::location_list_t filtered_items; - const LLLocationHistory::location_list_t* itemsp = NULL; + const LLLocationHistory::location_list_t* itemsp = nullptr; LLLocationHistory* lh = LLLocationHistory::getInstance(); if (filter.empty()) @@ -1206,7 +1206,7 @@ void LLLocationInputCtrl::callbackRebakeRegion(const LLSD& notification, const L S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) // OK { - if (LLPathfindingManager::getInstance() != NULL) + if (LLPathfindingManager::getInstance() != nullptr) { LLMenuOptionPathfindingRebakeNavmesh::getInstance()->sendRequestRebakeNavmesh(); } @@ -1230,7 +1230,7 @@ void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon) LLNotificationsUtil::add("NoBuild"); break; case PATHFINDING_DIRTY_ICON: - if (LLPathfindingManager::getInstance() != NULL) + if (LLPathfindingManager::getInstance() != nullptr) { LLMenuOptionPathfindingRebakeNavmesh *rebakeInstance = LLMenuOptionPathfindingRebakeNavmesh::getInstance(); if (rebakeInstance && rebakeInstance->canRebakeRegion() && (rebakeInstance->getMode() == LLMenuOptionPathfindingRebakeNavmesh::kRebakeNavMesh_Available)) @@ -1282,7 +1282,7 @@ void LLLocationInputCtrl::createNavMeshStatusListenerForCurrentRegion() } LLViewerRegion *currentRegion = gAgent.getRegion(); - if (currentRegion != NULL) + if (currentRegion != nullptr) { mNavMeshSlot = LLPathfindingManager::getInstance()->registerNavMeshListenerForRegion(currentRegion, boost::bind(&LLLocationInputCtrl::onNavMeshStatusChange, this, _2)); LLPathfindingManager::getInstance()->requestGetNavMeshForRegion(currentRegion, true); diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 30ea255e24..a296dc8cfc 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -142,7 +142,7 @@ class LLLogChatTimeScanner: public LLSingleton { typedef boost::date_time::local_adjustor pst; typedef boost::date_time::local_adjustor 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)); @@ -208,7 +208,7 @@ LLLogChatTimeScanner::LLLogChatTimeScanner() } LLLogChat::LLLogChat() -: mSaveHistorySignal(NULL) // only needed in preferences +: mSaveHistorySignal(nullptr) // only needed in preferences { mHistoryThreadsMutex = new LLMutex(); } @@ -216,13 +216,13 @@ LLLogChat::LLLogChat() LLLogChat::~LLLogChat() { delete mHistoryThreadsMutex; - mHistoryThreadsMutex = NULL; + mHistoryThreadsMutex = nullptr; if (mSaveHistorySignal) { mSaveHistorySignal->disconnect_all_slots(); delete mSaveHistorySignal; - mSaveHistorySignal = NULL; + mSaveHistorySignal = nullptr; } } @@ -560,7 +560,7 @@ LLLoadHistoryThread* LLLogChat::getLoadHistoryThread(LLUUID session_id) { return it->second; } - return NULL; + return nullptr; } LLDeleteHistoryThread* LLLogChat::getDeleteHistoryThread(LLUUID session_id) @@ -571,7 +571,7 @@ LLDeleteHistoryThread* LLLogChat::getDeleteHistoryThread(LLUUID session_id) { return it->second; } - return NULL; + return nullptr; } bool LLLogChat::addLoadHistoryThread(LLUUID& session_id, LLLoadHistoryThread* lthread) @@ -627,7 +627,7 @@ LLMutex* LLLogChat::historyThreadsMutex() void LLLogChat::triggerHistorySignal() { - if (NULL != mSaveHistorySignal) + if (nullptr != mSaveHistorySignal) { (*mSaveHistorySignal)(); } @@ -731,7 +731,7 @@ void LLLogChat::getListOfTranscriptBackupFiles(std::vector& list_of boost::signals2::connection LLLogChat::setSaveHistorySignal(const save_history_signal_t::slot_type& cb) { - if (NULL == mSaveHistorySignal) + if (nullptr == mSaveHistorySignal) { mSaveHistorySignal = new save_history_signal_t(); } @@ -891,7 +891,7 @@ bool LLLogChat::isTranscriptFileFound(std::string fullname) { bool result = false; LLFILE * filep = LLFile::fopen(fullname, "rb"); - if (NULL != filep) + if (nullptr != filep) { if (makeLogFileName("chat") == fullname) { @@ -910,7 +910,7 @@ bool LLLogChat::isTranscriptFileFound(std::string fullname) 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 matches; @@ -1103,15 +1103,15 @@ 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(); } @@ -1155,7 +1155,7 @@ LLLoadHistoryThread::LLLoadHistoryThread(const std::string& file_name, std::list mFileName(file_name), mLoadParams(load_params), mNewLoad(true), - mLoadEndSignal(NULL) + mLoadEndSignal(nullptr) { } @@ -1274,7 +1274,7 @@ void LLLoadHistoryThread::loadHistory(const std::string& file_name, std::listdisconnect_all_slots(); delete mLoadEndSignal; } - mLoadEndSignal = NULL; + mLoadEndSignal = nullptr; } diff --git a/indra/newview/llloginhandler.cpp b/indra/newview/llloginhandler.cpp index 323b6c9fa7..dac7a465ab 100644 --- a/indra/newview/llloginhandler.cpp +++ b/indra/newview/llloginhandler.cpp @@ -136,7 +136,7 @@ bool LLLoginHandler::handle(const LLSD& tokens, // login handler LLPointer LLLoginHandler::initializeLoginInfo() { - LLPointer result = NULL; + LLPointer result = nullptr; // so try to load it from the UserLoginInfo result = loadSavedUserLoginInfo(); if (result.isNull()) @@ -175,5 +175,5 @@ LLPointer LLLoginHandler::loadSavedUserLoginInfo() return gSecAPIHandler->createCredential(LLGridManager::getInstance()->getGrid(), identifier, authenticator); } - return NULL; + return nullptr; } diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index e9d68723d3..c0fb52a5f5 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -81,7 +81,7 @@ std::string construct_start_string(); LLLoginInstance::LLLoginInstance() : mLoginModule(std::make_unique()), - mNotifications(NULL), + mNotifications(nullptr), mLoginState("offline"), mSaveMFA(true), mAttemptComplete(false), diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp index 51c38aba3a..e7b944f468 100644 --- a/indra/newview/llmachineid.cpp +++ b/indra/newview/llmachineid.cpp @@ -47,8 +47,8 @@ class LLWMIMethods { public: LLWMIMethods() - : pLoc(NULL), - pSvc(NULL) + : pLoc(nullptr), + pSvc(nullptr) { initCOMObjects(); } @@ -100,15 +100,15 @@ void LLWMIMethods::initCOMObjects() // parameter of CoInitializeSecurity ------------------------ mHR = 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 ); if (FAILED(mHR)) @@ -142,10 +142,10 @@ void LLWMIMethods::initCOMObjects() // to make IWbemServices calls. mHR = 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 - NULL, // Security flags. + nullptr, // User name. nullptr = current user + nullptr, // User password. nullptr = current + 0, // Locale. nullptr indicates current + 0, // Security flags. 0, // Authority (e.g. Kerberos) 0, // Context object &pSvc // pointer to IWbemServices proxy @@ -168,10 +168,10 @@ void LLWMIMethods::initCOMObjects() 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 ); @@ -236,12 +236,12 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var // 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"), select, WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, - NULL, + nullptr, &pEnumerator); if (FAILED(hres)) @@ -253,7 +253,7 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var // Step 7: ------------------------------------------------- // Get the data from the query in step 6 ------------------- - IWbemClassObject *pclsObj = NULL; + IWbemClassObject *pclsObj = nullptr; ULONG uReturn = 0; bool found = false; @@ -275,7 +275,7 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var { LL_WARNS() << "Failed to get SerialNumber. Error code = 0x" << std::hex << hres << LL_ENDL; pclsObj->Release(); - pclsObj = NULL; + pclsObj = nullptr; continue; } @@ -286,7 +286,7 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var { VariantClear(&vtProp); pclsObj->Release(); - pclsObj = NULL; + pclsObj = nullptr; continue; } @@ -299,7 +299,7 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var { VariantClear(&vtProp); pclsObj->Release(); - pclsObj = NULL; + pclsObj = nullptr; continue; } @@ -311,7 +311,7 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var // Not unique id VariantClear(&vtProp); pclsObj->Release(); - pclsObj = NULL; + pclsObj = nullptr; continue; } } @@ -333,7 +333,7 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var VariantClear(&vtProp); pclsObj->Release(); - pclsObj = NULL; + pclsObj = nullptr; found = true; break; } @@ -349,7 +349,7 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var #elif LL_DARWIN bool getSerialNumber(unsigned char *unique_id, size_t len) { - CFStringRef serial_cf_str = NULL; + CFStringRef serial_cf_str = nullptr; io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); if (platformExpert) diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 0d617753c8..3cf9f81517 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -207,7 +207,7 @@ void LLManip::handleDeselect() { mHighlightedPart = LL_NO_PART; mManipPart = LL_NO_PART; - mObjectSelection = NULL; + mObjectSelection = nullptr; } LLObjectSelectionHandle LLManip::getSelection() diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 4bf1b134ef..a5d6fec275 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -470,11 +470,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) ? nullptr : object->getRootEdit(); // have permission to move and object is root of selection or individually selected if (object->permMove() && !object->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && (object->isRootEdit() || selectNode->mIndividualSelection)) { object->mUnselectedChildrenPositions.clear() ; @@ -562,11 +562,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) ? nullptr : object->getRootEdit(); // have permission to move and object is root of selection or individually selected if (object->permMove() && !object->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && (object->isRootEdit() || selectNode->mIndividualSelection)) { @@ -653,12 +653,12 @@ 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) ? nullptr : 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); @@ -747,10 +747,10 @@ 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) ? nullptr : cur->getRootEdit(); if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && (!cur->isAvatar() || LLSelectMgr::getInstance()->mAllowSelectAvatar)) { selectNode->mLastRotation = cur->getRotation(); @@ -1961,9 +1961,9 @@ bool LLManipRotate::canAffectSelection() { virtual bool apply(LLViewerObject* objectp) { - LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit(); + LLViewerObject *root_object = (objectp == nullptr) ? nullptr : 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/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 66420d1cad..6ebb61e83f 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -796,9 +796,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) ? nullptr : 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(); @@ -915,9 +915,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) ? nullptr : 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; @@ -940,9 +940,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) ? nullptr : 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; @@ -991,9 +991,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) ? nullptr : 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; @@ -1192,9 +1192,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) ? nullptr : 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(); @@ -2066,9 +2066,9 @@ bool LLManipScale::canAffectSelection() { virtual bool apply(LLViewerObject* objectp) { - LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit(); + LLViewerObject *root_object = (objectp == nullptr) ? nullptr : 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 8a615cb7e4..1aa84d544c 100644 --- a/indra/newview/llmanipscale.h +++ b/indra/newview/llmanipscale.h @@ -103,7 +103,7 @@ class LLManipScale : public LLManip 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.cpp b/indra/newview/llmaniptranslate.cpp index 9bcfd9e2c0..2389d35cb8 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -74,7 +74,7 @@ const F32 PLANE_TICK_SIZE = 0.4f; const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f; const F32 SNAP_ARROW_SCALE = 0.7f; -static LLPointer sGridTex = NULL ; +static LLPointer sGridTex = nullptr ; const LLManip::EManipPart MANIPULATOR_IDS[9] = { @@ -150,7 +150,7 @@ void LLManipTranslate::destroyGL() { if (sGridTex) { - sGridTex = NULL ; + sGridTex = nullptr ; } } @@ -165,7 +165,7 @@ void LLManipTranslate::restoreGL() sGridTex = LLViewerTextureManager::getLocalTexture() ; if(!sGridTex->createGLTexture()) { - sGridTex = NULL ; + sGridTex = nullptr ; return ; } @@ -688,9 +688,9 @@ bool LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) } } - LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit(); + LLViewerObject* root_object = (object == nullptr) ? nullptr : object->getRootEdit(); if (object->permMove() && !object->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced())) + ((root_object == nullptr) || !root_object->isPermanentEnforced())) { // handle attachments in local space if (object->isAttachment() && object->mDrawable.notNull()) @@ -2297,9 +2297,9 @@ bool LLManipTranslate::canAffectSelection() { virtual bool apply(LLViewerObject* objectp) { - LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit(); + LLViewerObject *root_object = (objectp == nullptr) ? nullptr : 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/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index d1d4641df3..43d0f84468 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -628,7 +628,7 @@ void LLMarketplaceInventoryObserver::changed(U32 mask) if (!sProcessingQueue && !sStructureQueue.empty()) { - gIdleCallbacks.addFunction(onIdleProcessQueue, NULL); + gIdleCallbacks.addFunction(onIdleProcessQueue, nullptr); // can do without sProcessingQueue, but it's usufull for simplicity and reliability sProcessingQueue = true; } @@ -676,7 +676,7 @@ void LLMarketplaceInventoryObserver::onIdleProcessQueue(void *userdata) if (LLApp::isExiting() || sStructureQueue.empty()) { // Nothing to do anymore - gIdleCallbacks.deleteFunction(onIdleProcessQueue, NULL); + gIdleCallbacks.deleteFunction(onIdleProcessQueue, nullptr); sProcessingQueue = false; } } @@ -835,7 +835,7 @@ void LLMarketplaceData::getMerchantStatusCoro() void LLMarketplaceData::setDataFetchedSignal(const status_updated_signal_t::slot_type& cb) { - if (mDataFetchedSignal == NULL) + if (mDataFetchedSignal == nullptr) { mDataFetchedSignal = std::make_unique(); } diff --git a/indra/newview/llmarketplacenotifications.cpp b/indra/newview/llmarketplacenotifications.cpp index 04996af8a0..7ad4fffdc3 100644 --- a/indra/newview/llmarketplacenotifications.cpp +++ b/indra/newview/llmarketplacenotifications.cpp @@ -40,7 +40,7 @@ namespace LLMarketplaceInventoryNotifications { typedef boost::signals2::signal 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 no_copy_payloads; @@ -51,7 +51,7 @@ namespace LLMarketplaceInventoryNotifications if (option == 0) { llassert(!no_copy_payloads.empty()); - llassert(no_copy_cb_action != NULL); + llassert(no_copy_cb_action != nullptr); for (const LLSD& payload : no_copy_payloads) { @@ -60,7 +60,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(); @@ -78,7 +78,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/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 4e14f416e9..24be3e5a1b 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -207,7 +207,7 @@ class LLMaterialEditorCopiedCallback : public LLInventoryCallback { LLSD updates; updates["name"] = mNewName; - update_inventory_item(inv_item_id, updates, NULL); + update_inventory_item(inv_item_id, updates, nullptr); } } LLMaterialEditor::finishSaveAs(mOldKey, inv_item_id, mBuffer, mHasUnsavedChanges); @@ -1311,7 +1311,7 @@ const std::string LLMaterialEditor::buildMaterialDescription() // add the texture names for each just so long as the material // we loaded has an entry for it (i think testing the texture - // control UUI for NULL is a valid metric for if it was loaded + // control UUID for NULL is a valid metric for if it was loaded // or not but I suspect this code will change a lot so may need // to revisit if (!mBaseColorTextureCtrl->getValue().asUUID().isNull()) @@ -1546,7 +1546,7 @@ class LLObjectsMaterialItemCallback : public LLInventoryCallback { updates["permissions"] = ll_create_sd_from_permissions(mPermissions); } - update_inventory_item(inv_item_id, updates, NULL); + update_inventory_item(inv_item_id, updates, nullptr); } // from reference in LLSettingsVOBase::createInventoryItem()/updateInventoryItem() @@ -1563,7 +1563,7 @@ class LLObjectsMaterialItemCallback : public LLInventoryCallback // *HACK: Sometimes permissions do not stick in the UI. They are correct on the server-side, though. if (changed) { - update_inventory_item(new_item_id, updates, NULL); + update_inventory_item(new_item_id, updates, nullptr); } }, nullptr // failure callback, floater already closed @@ -3442,7 +3442,7 @@ void LLMaterialEditor::loadAsset() { // It's a material in object's inventory and we failed to get it because inventory is not up to date. // Subscribe for callback and retry at inventoryChanged() - registerVOInventoryListener(objectp, NULL); //removes previous listener + registerVOInventoryListener(objectp, nullptr); //removes previous listener if (objectp->isInventoryDirty()) { diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index 4dc3f958aa..c706be03bf 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -142,14 +142,14 @@ LLMaterialMgr::LLMaterialMgr(): mHttpOptions = std::make_shared(); mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_MATERIALS); - mMaterials.insert(std::pair(LLMaterialID::null, LLMaterialPtr(NULL))); - gIdleCallbacks.addFunction(&LLMaterialMgr::onIdle, NULL); + mMaterials.insert(std::pair(LLMaterialID::null, LLMaterialPtr(nullptr))); + gIdleCallbacks.addFunction(&LLMaterialMgr::onIdle, nullptr); LLWorld::instance().setRegionRemovedCallback(boost::bind(&LLMaterialMgr::onRegionRemoved, this, _1)); } LLMaterialMgr::~LLMaterialMgr() { - gIdleCallbacks.deleteFunction(&LLMaterialMgr::onIdle, NULL); + gIdleCallbacks.deleteFunction(&LLMaterialMgr::onIdle, nullptr); } bool LLMaterialMgr::isGetPending(const LLUUID& region_id, const LLMaterialID& material_id) const @@ -821,7 +821,7 @@ void LLMaterialMgr::processGetAllQueue() void LLMaterialMgr::processGetAllQueueCoro(LLUUID regionId) { LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(regionId); - if (regionp == NULL) + if (regionp == nullptr) { LL_WARNS("Materials") << "Unknown region with id " << regionId.asString() << LL_ENDL; clearGetQueues(regionId); // Invalidates region_id diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 809628cf6c..843547af04 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -86,7 +86,7 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : LLPanel( p ), LLInstanceTracker(LLUUID::generateNewID()), mTextureDepthBytes( 4 ), - mBorder(NULL), + mBorder(nullptr), mFrequentUpdates( true ), mForceUpdate( false ), mHomePageUrl( "" ), @@ -104,7 +104,7 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mHomePageMimeType(p.initial_mime_type), mErrorPageURL(p.error_page_url), mTrusted(p.trusted_content), - mWindowShade(NULL), + mWindowShade(nullptr), mHoverTextChanged(false), mAllowFileDownload(false) { @@ -160,7 +160,7 @@ LLMediaCtrl::~LLMediaCtrl() if (mMediaSource) { mMediaSource->remObserver( this ); - mMediaSource = NULL; + mMediaSource = nullptr; } } @@ -273,7 +273,7 @@ bool LLMediaCtrl::handleMouseUp( S32 x, S32 y, MASK mask ) mMediaSource->mouseUp(x, y, mask); } - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture( nullptr ); return true; } @@ -318,7 +318,7 @@ bool LLMediaCtrl::handleRightMouseUp( S32 x, S32 y, MASK mask ) } } - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture( nullptr ); return true; } @@ -351,8 +351,8 @@ bool LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask ) // stinson 05/05/2014 : use this as the parent of the context menu if the static menu // container has yet to be created - LLPanel* menuParent = (LLMenuGL::sMenuContainer != NULL) ? dynamic_cast(LLMenuGL::sMenuContainer) : dynamic_cast(this); - llassert(menuParent != NULL); + LLPanel* menuParent = (LLMenuGL::sMenuContainer != nullptr) ? dynamic_cast(LLMenuGL::sMenuContainer) : dynamic_cast(this); + llassert(menuParent != nullptr); menu = LLUICtrlFactory::getInstance()->createFromFile( "menu_media_ctrl.xml", menuParent, LLViewerMenuHolderGL::child_registry_t::instance()); if (menu) @@ -422,7 +422,7 @@ void LLMediaCtrl::onFocusLost() if( LLEditMenuHandler::gEditMenuHandler == mMediaSource ) { // Clear focus for edit menu items - LLEditMenuHandler::gEditMenuHandler = NULL; + LLEditMenuHandler::gEditMenuHandler = nullptr; } } @@ -771,14 +771,14 @@ bool LLMediaCtrl::ensureMediaSourceExists() // void LLMediaCtrl::unloadMediaSource() { - mMediaSource = NULL; + mMediaSource = nullptr; } //////////////////////////////////////////////////////////////////////////////// // LLPluginClassMedia* LLMediaCtrl::getMediaPlugin() { - return mMediaSource.isNull() ? NULL : mMediaSource->getMediaPlugin(); + return mMediaSource.isNull() ? nullptr : mMediaSource->getMediaPlugin(); } //////////////////////////////////////////////////////////////////////////////// @@ -809,8 +809,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()) { @@ -1070,7 +1070,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, uuid); } diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 50236587ac..f6f2d27f80 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -425,7 +425,7 @@ bool LLMediaDataClient::QueueTimer::tick() { // This timer won't fire again. mMDC->setIsRunning(false); - mMDC = NULL; + mMDC = nullptr; } } @@ -566,12 +566,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() diff --git a/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp b/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp index 54c1b0610e..3421e17901 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 0ed1e01ff8..71f1bed2c6 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -608,7 +608,7 @@ void PendingRequestBase::updateScore() LLViewerFetchedTexture* LLMeshUploadThread::FindViewerTexture(const LLImportMaterial& material) { LLPointer< LLViewerFetchedTexture > * ppTex = static_cast< LLPointer< LLViewerFetchedTexture > * >(material.mOpaqueData); - return ppTex ? (*ppTex).get() : NULL; + return ppTex ? (*ppTex).get() : nullptr; } std::atomic LLMeshRepoThread::sActiveHeaderRequests = 0; @@ -919,7 +919,7 @@ void write_preamble(LLFileSystem &file, S32 header_bytes, S32 flags) LLMeshRepoThread::LLMeshRepoThread() : LLThread("mesh repo"), - mHttpRequest(NULL), + mHttpRequest(nullptr), mHttpOptions(), mHttpLargeOptions(), mHttpHeaders(), @@ -1385,7 +1385,7 @@ U8* LLMeshRepoThread::getDiskCacheBuffer(S32 size) catch (std::bad_alloc&) { LL_WARNS(LOG_MESH) << "Failed to allocate memory for mesh thread's buffer, size: " << size << LL_ENDL; - mDiskCacheBuffer = NULL; + mDiskCacheBuffer = nullptr; // Not sure what size is reasonable // but if 30MB allocation failed, we definitely have issues @@ -1872,7 +1872,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 @@ -2373,7 +2373,7 @@ EMeshProcessingResult LLMeshRepoThread::headerReceived(const LLVolumeParams& mes EMeshProcessingResult 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 MESH_NO_DATA; } @@ -2416,9 +2416,9 @@ EMeshProcessingResult LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_p // LLPointer is not thread safe, since we added this pointer into // threaded list, make sure counter gets decreased inside mutex lock // and won't affect mLoadedQ processing - volume = NULL; + volume = nullptr; // might be good idea to turn mesh into pointer to avoid making a copy - mesh.mVolume = NULL; + mesh.mVolume = nullptr; } { // make sure skin info is not removed from list while we are decreasing reference count @@ -2530,7 +2530,7 @@ EMeshProcessingResult LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_ 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(); } @@ -2616,9 +2616,9 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list_t& data LLMeshUploadThread::~LLMeshUploadThread() { delete mHttpRequest; - mHttpRequest = NULL; + mHttpRequest = nullptr; delete mMutex; - mMutex = NULL; + mMutex = nullptr; } LLMeshUploadThread::DecompRequest::DecompRequest(LLModel* mdl, LLModel* base_model, LLMeshUploadThread* thread) @@ -2812,21 +2812,21 @@ void LLMeshUploadThread::packModelIntance( 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()) { @@ -2842,7 +2842,7 @@ void LLMeshUploadThread::packModelIntance( } } - if (texture != NULL && + if (texture != nullptr && mUploadTextures && texture_index.find(texture) == texture_index.end()) { @@ -2855,7 +2855,7 @@ void LLMeshUploadThread::packModelIntance( } // Subset of TextureEntry fields. - if (texture != NULL && mUploadTextures) + if (texture != nullptr && mUploadTextures) { face_entry["image"] = texture_index[texture]; face_entry["scales"] = 1.0; @@ -3025,7 +3025,7 @@ void LLMeshUploadThread::generateHulls() } //queue up models for hull generation - LLModel* physics = NULL; + LLModel* physics = nullptr; if (data.mModel[LLModel::LOD_PHYSICS].notNull()) { @@ -3044,7 +3044,7 @@ void LLMeshUploadThread::generateHulls() physics = data.mModel[LLModel::LOD_HIGH]; } - llassert(physics != NULL); + llassert(physics != nullptr); DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this); if(request->isValid()) @@ -3521,7 +3521,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()); @@ -3546,7 +3546,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); auto data_size(body ? body->size() : 0); if (data_size > 0) @@ -3668,7 +3668,7 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b LL_PROFILE_ZONE_SCOPED; LLUUID mesh_id = mMeshParams.getSculptID(); bool success = (!MESH_HEADER_PROCESS_FAILED) - && ((data != NULL) == (data_size > 0)); // if we have data but no size or have size but no data, something is wrong; + && ((data != nullptr) == (data_size > 0)); // if we have data but no size or have size but no data, something is wrong; llassert(success); EMeshProcessingResult res = MESH_UNKNOWN; if (success) @@ -3860,7 +3860,7 @@ void LLMeshLODHandler::processData(LLCore::BufferArray * /* body */, S32 /* body { LL_PROFILE_ZONE_SCOPED; if ((!MESH_LOD_PROCESS_FAILED) - && ((data != NULL) == (data_size > 0))) // if we have data but no size or have size but no data, something is wrong + && ((data != nullptr) == (data_size > 0))) // if we have data but no size or have size but no data, something is wrong { LLMeshHandlerBase::ptr_t shrd_handler = shared_from_this(); bool posted = gMeshRepo.mThread->mMeshThreadPool->getQueue().post( @@ -3978,7 +3978,7 @@ void LLMeshSkinInfoHandler::processData(LLCore::BufferArray * /* body */, S32 /* { LL_PROFILE_ZONE_SCOPED; if ((!MESH_SKIN_INFO_PROCESS_FAILED) - && ((data != NULL) == (data_size > 0))) // if we have data but no size or have size but no data, something is wrong + && ((data != nullptr) == (data_size > 0))) // if we have data but no size or have size but no data, something is wrong { LLMeshHandlerBase::ptr_t shrd_handler = shared_from_this(); bool posted = gMeshRepo.mThread->mMeshThreadPool->getQueue().post( @@ -4040,7 +4040,7 @@ void LLMeshDecompositionHandler::processData(LLCore::BufferArray * /* body */, S { LL_PROFILE_ZONE_SCOPED; if ((!MESH_DECOMP_PROCESS_FAILED) - && ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong + && ((data != nullptr) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong && gMeshRepo.mThread->decompositionReceived(mMeshID, data, data_size)) { // good fetch from sim, write to cache @@ -4113,7 +4113,7 @@ void LLMeshPhysicsShapeHandler::processData(LLCore::BufferArray * /* body */, S3 { LL_PROFILE_ZONE_SCOPED; if ((!MESH_PHYS_SHAPE_PROCESS_FAILED) - && ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong + && ((data != nullptr) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong && gMeshRepo.mThread->physicsShapeReceived(mMeshID, data, data_size) == MESH_OK) { // good fetch from sim, write to cache for caching @@ -4165,10 +4165,10 @@ void LLMeshPhysicsShapeHandler::processData(LLCore::BufferArray * /* body */, S3 } LLMeshRepository::LLMeshRepository() -: mMeshMutex(NULL), - mDecompThread(NULL), +: mMeshMutex(nullptr), + mDecompThread(nullptr), mMeshThreadCount(0), - mThread(NULL) + mThread(nullptr) { mSkinInfoCullTimer.resetWithExpiry(10.f); } @@ -4201,8 +4201,8 @@ void LLMeshRepository::init() void LLMeshRepository::shutdown() { LL_INFOS(LOG_MESH) << "Shutting down mesh repository." << LL_ENDL; - llassert(mThread != NULL); - llassert(mThread->mSignal != NULL); + llassert(mThread != nullptr); + llassert(mThread->mSignal != nullptr); metrics_teleport_started_signal.disconnect(); @@ -4219,7 +4219,7 @@ void LLMeshRepository::shutdown() apr_sleep(10); } delete mThread; - mThread = NULL; + mThread = nullptr; for (U32 i = 0; i < mUploads.size(); ++i) { @@ -4234,7 +4234,7 @@ void LLMeshRepository::shutdown() mUploads.clear(); delete mMeshMutex; - mMeshMutex = NULL; + mMeshMutex = nullptr; LL_INFOS(LOG_MESH) << "Shutting down decomposition system." << LL_ENDL; @@ -4242,7 +4242,7 @@ void LLMeshRepository::shutdown() { mDecompThread->shutdown(); delete mDecompThread; - mDecompThread = NULL; + mDecompThread = nullptr; } LLConvexDecomposition::quitSystem(); @@ -4827,7 +4827,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()) { @@ -4853,7 +4853,7 @@ LLModel::Decomposition* LLMeshRepository::getDecomposition(const LLUUID& mesh_id { LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; //LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH); - LLModel::Decomposition* ret = NULL; + LLModel::Decomposition* ret = nullptr; if (mesh_id.notNull()) { @@ -5475,9 +5475,9 @@ LLPhysicsDecomp::~LLPhysicsDecomp() shutdown(); delete mSignal; - mSignal = NULL; + mSignal = nullptr; delete mMutex; - mMutex = NULL; + mMutex = nullptr; } void LLPhysicsDecomp::shutdown() @@ -5531,7 +5531,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); } @@ -5548,7 +5548,7 @@ void LLPhysicsDecomp::doDecomposition() LLCDMeshData mesh; S32 stage = mStageID[mCurRequest->mStage]; - if (LLConvexDecomposition::getInstance() == NULL) + if (LLConvexDecomposition::getInstance() == nullptr) { // stub library. do nothing. return; @@ -5563,7 +5563,7 @@ void LLPhysicsDecomp::doDecomposition() //build parameter map std::map param_map; - static const LLCDParam* params = NULL; + static const LLCDParam* params = nullptr; static S32 param_count = 0; if (!params) { @@ -5584,7 +5584,7 @@ void LLPhysicsDecomp::doDecomposition() const LLCDParam* param = param_map[name]; - if (param == NULL) + if (param == nullptr) { //couldn't find valid parameter continue; } @@ -5607,7 +5607,7 @@ void LLPhysicsDecomp::doDecomposition() mCurRequest->setStatusMessage("Executing."); - if (LLConvexDecomposition::getInstance() != NULL) + if (LLConvexDecomposition::getInstance() != nullptr) { ret = LLConvexDecomposition::getInstance()->executeStage(stage); } @@ -5630,7 +5630,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); } @@ -5684,7 +5684,7 @@ void LLPhysicsDecomp::completeCurrent() { LLMutexLock lock(mMutex); mCompletedQ.push(mCurRequest); - mCurRequest = NULL; + mCurRequest = nullptr; } void LLPhysicsDecomp::notifyCompleted() @@ -5733,7 +5733,7 @@ void LLPhysicsDecomp::doDecompositionSingleHull() { LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance(); - if (decomp == NULL) + if (decomp == nullptr) { //stub. do nothing. return; @@ -5789,7 +5789,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. @@ -5800,7 +5800,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) @@ -5943,7 +5943,7 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp) LLCDMeshData mesh; LLCDResult res = LLCD_OK; - if (LLConvexDecomposition::getInstance() != NULL) + if (LLConvexDecomposition::getInstance() != nullptr) { res = LLConvexDecomposition::getInstance()->getMeshFromHull(&hull, &mesh); } @@ -5962,7 +5962,7 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp) LLCDMeshData mesh; LLCDResult res = LLCD_OK; - 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 01b51e753e..bf9f1bced8 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -854,8 +854,8 @@ class LLMeshRepository // Estimated triangle count of the largest LOD F32 getEstTrianglesMax(LLUUID mesh_id); F32 getEstTrianglesStreamingCost(LLUUID mesh_id); - F32 getStreamingCostLegacy(LLUUID mesh_id, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); - static F32 getStreamingCostLegacy(LLMeshHeader& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); + F32 getStreamingCostLegacy(LLUUID mesh_id, F32 radius, S32* bytes = nullptr, S32* visible_bytes = nullptr, S32 detail = -1, F32 *unscaled_value = nullptr); + static F32 getStreamingCostLegacy(LLMeshHeader& header, F32 radius, S32* bytes = nullptr, S32* visible_bytes = nullptr, S32 detail = -1, F32 *unscaled_value = nullptr); bool getCostData(LLUUID mesh_id, LLMeshCostData& data); bool getCostData(LLMeshHeader& header, LLMeshCostData& data); diff --git a/indra/newview/llmimetypes.cpp b/indra/newview/llmimetypes.cpp index ee10b38a9d..6d2fe9597e 100644 --- a/indra/newview/llmimetypes.cpp +++ b/indra/newview/llmimetypes.cpp @@ -61,7 +61,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")) @@ -82,7 +82,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")) @@ -106,7 +106,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/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index ed5ab35439..9736775995 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -107,7 +107,7 @@ LLViewerFetchedTexture* bindMaterialDiffuseTexture(const LLImportMaterial& mater } } - return NULL; + return nullptr; } std::string stripSuffix(std::string name) @@ -213,14 +213,14 @@ LLModelPreview::~LLModelPreview() if (mModelLoader) { mModelLoader->shutdown(); - mModelLoader = NULL; + mModelLoader = nullptr; mLoading = false; } if (mPreviewAvatar) { mPreviewAvatar->markDead(); - mPreviewAvatar = NULL; + mPreviewAvatar = nullptr; } mUploadData.clear(); @@ -285,7 +285,7 @@ void LLModelPreview::rebuildUploadData() { assert_main_thread(); - mDefaultPhysicsShapeP = NULL; + mDefaultPhysicsShapeP = nullptr; mUploadData.clear(); mTextureSet.clear(); @@ -335,7 +335,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 @@ -980,7 +980,7 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) if (getLoadState() >= LLModelLoader::ERROR_PARSING) { mLoading = false; - mModelLoader = NULL; + mModelLoader = nullptr; mLodsWithParsingError.push_back(loaded_lod); return; } @@ -1184,7 +1184,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; if (FindModel(mBaseScene, loaded_name, found_model, transform)) { // don't rename correctly named models (even if they are placed in a wrong order) @@ -1276,7 +1276,7 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) mModelLoadedSignal(); - mModelLoader = NULL; + mModelLoader = nullptr; } void LLModelPreview::resetPreviewTarget() @@ -1460,7 +1460,7 @@ F32 LLModelPreview::genMeshOptimizerPerModel(LLModel *base_model, LLModel *targe // II. Generate a shadow buffer if nessesary. // Welds together vertices if possible - U32* shadow_indices = NULL; + U32* shadow_indices = nullptr; // if MESH_OPTIMIZER_FULL, just leave as is, since generateShadowIndexBufferU32 // won't do anything new, model was remaped on a per face basis. // Similar for MESH_OPTIMIZER_NO_TOPOLOGY, it's pointless @@ -1470,16 +1470,16 @@ F32 LLModelPreview::genMeshOptimizerPerModel(LLModel *base_model, LLModel *targe { // strip normals, reflections should restore relatively correctly shadow_indices = (U32*)ll_aligned_malloc_32(size_indices * sizeof(U32)); - LLMeshOptimizer::generateShadowIndexBufferU32(shadow_indices, combined_indices, size_indices, combined_positions, NULL, combined_tex_coords, size_vertices); + LLMeshOptimizer::generateShadowIndexBufferU32(shadow_indices, combined_indices, size_indices, combined_positions, nullptr, combined_tex_coords, size_vertices); } if (simplification_mode == MESH_OPTIMIZER_NO_UVS) { // strip uvs, can heavily affect textures shadow_indices = (U32*)ll_aligned_malloc_32(size_indices * sizeof(U32)); - LLMeshOptimizer::generateShadowIndexBufferU32(shadow_indices, combined_indices, size_indices, combined_positions, NULL, NULL, size_vertices); + LLMeshOptimizer::generateShadowIndexBufferU32(shadow_indices, combined_indices, size_indices, combined_positions, nullptr, nullptr, size_vertices); } - U32* source_indices = NULL; + U32* source_indices = nullptr; if (shadow_indices) { source_indices = shadow_indices; @@ -1526,8 +1526,8 @@ F32 LLModelPreview::genMeshOptimizerPerModel(LLModel *base_model, LLModel *targe // free unused buffers ll_aligned_free_32(combined_indices); ll_aligned_free_32(shadow_indices); - combined_indices = NULL; - shadow_indices = NULL; + combined_indices = nullptr; + shadow_indices = nullptr; if (size_new_indices < 3) { @@ -1704,7 +1704,7 @@ F32 LLModelPreview::genMeshOptimizerPerFace(LLModel *base_model, LLModel *target S32 size = (size_indices * sizeof(U16) + 0xF) & ~0xF; U16* output_indices = (U16*)ll_aligned_malloc_16(size); - U16* shadow_indices = NULL; + U16* shadow_indices = nullptr; // if MESH_OPTIMIZER_FULL, just leave as is, since generateShadowIndexBufferU32 // won't do anything new, model was remaped on a per face basis. // Similar for MESH_OPTIMIZER_NO_TOPOLOGY, it's pointless @@ -1712,16 +1712,16 @@ F32 LLModelPreview::genMeshOptimizerPerFace(LLModel *base_model, LLModel *target if (simplification_mode == MESH_OPTIMIZER_NO_NORMALS) { U16* shadow_indices = (U16*)ll_aligned_malloc_16(size); - LLMeshOptimizer::generateShadowIndexBufferU16(shadow_indices, face.mIndices, size_indices, face.mPositions, NULL, face.mTexCoords, face.mNumVertices); + LLMeshOptimizer::generateShadowIndexBufferU16(shadow_indices, face.mIndices, size_indices, face.mPositions, nullptr, face.mTexCoords, face.mNumVertices); } if (simplification_mode == MESH_OPTIMIZER_NO_UVS) { U16* shadow_indices = (U16*)ll_aligned_malloc_16(size); - LLMeshOptimizer::generateShadowIndexBufferU16(shadow_indices, face.mIndices, size_indices, face.mPositions, NULL, NULL, face.mNumVertices); + LLMeshOptimizer::generateShadowIndexBufferU16(shadow_indices, face.mIndices, size_indices, face.mPositions, nullptr, nullptr, face.mNumVertices); } // Don't run ShadowIndexBuffer for MESH_OPTIMIZER_NO_TOPOLOGY, it's pointless - U16* source_indices = NULL; + U16* source_indices = nullptr; if (shadow_indices) { source_indices = shadow_indices; @@ -2854,7 +2854,7 @@ void LLModelPreview::clearBuffers() void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) { - LLModelLoader::model_list* model = NULL; + LLModelLoader::model_list* model = nullptr; if (lod < 0 || lod >= LLModel::NUM_LODS) { @@ -2907,7 +2907,7 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) continue; } - LLVertexBuffer* vb = NULL; + LLVertexBuffer* vb = nullptr; @@ -3212,7 +3212,7 @@ LLJoint* LLModelPreview::lookupJointByName(const std::string& str, void* opaque) { return pPreview->getPreviewAvatar()->getJoint(str); } - return NULL; + return nullptr; } U32 LLModelPreview::loadTextures(LLImportMaterial& material, LLHandle handle) @@ -3236,7 +3236,7 @@ U32 LLModelPreview::loadTextures(LLImportMaterial& material, LLHandlereparent(NULL); + LLPanelStandStopFlying::getInstance()->reparent(nullptr); } LLFloater::setVisible(visible); @@ -198,7 +198,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); @@ -511,8 +511,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 @@ -624,11 +624,11 @@ void LLPanelStandStopFlying::reparent(LLFloaterMove* move_view) LLPanel* parent = dynamic_cast(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 @@ -716,7 +716,7 @@ void LLPanelStandStopFlying::updatePosition() left_tb_width = toolbar_left->getRect().getWidth(); } - 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 3690245e1d..70bfaa4d6f 100644 --- a/indra/newview/llmoveview.h +++ b/indra/newview/llmoveview.h @@ -131,7 +131,7 @@ class LLPanelStandStopFlying : public LLPanel * Called when the floater gets opened/closed, user sits, stands up or starts/stops flying. * * @param move_view The floater to attach to (not always accessible via floater registry). - * If NULL is passed, the panel gets reparented to its original container. + * If nullptr is passed, the panel gets reparented to its original container. * * @see mAttached * @see mOriginalParent diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 9157e34833..e2fb1380dd 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -166,10 +166,10 @@ LLMuteList::LLMuteList() : // that last NULL. gMessageSystem.callWhenReady(boost::bind(&LLMessageSystem::setHandlerFuncFast, _1, _PREHASH_MuteListUpdate, processMuteListUpdate, - static_cast(NULL))); + static_cast(nullptr))); gMessageSystem.callWhenReady(boost::bind(&LLMessageSystem::setHandlerFuncFast, _1, _PREHASH_UseCachedMuteList, processUseCachedMuteList, - static_cast(NULL))); + static_cast(nullptr))); // make sure mute list's instance gets initialized before we start any name requests LLAvatarNameCache::getInstance()->setAccountNameChangedCallback([this](const LLUUID& id, const LLAvatarName& av_name) @@ -241,7 +241,7 @@ static LLVOAvatar* find_avatar(const LLUUID& id) } else { - return NULL; + return nullptr; } } @@ -766,7 +766,7 @@ void LLMuteList::requestFromServer(const LLUUID& agent_id) mRequestStartTime = LLTimer::getElapsedSeconds(); // Double amount of retries due to this request happening during busy stage // Ideally this should be turned into a capability - gMessageSystem->sendReliable(gAgent.getRegionHost(), LL_DEFAULT_RELIABLE_RETRIES * 2, true, LL_PING_BASED_TIMEOUT_DUMMY, NULL, NULL); + gMessageSystem->sendReliable(gAgent.getRegionHost(), LL_DEFAULT_RELIABLE_RETRIES * 2, true, LL_PING_BASED_TIMEOUT_DUMMY, nullptr, nullptr); } //----------------------------------------------------------------------------- diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index b65fd61fcc..3a4a08bc4c 100644 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -137,7 +137,7 @@ class LLMuteList : public LLSingleton void updateAdd(const LLMute& mute); void updateRemove(const LLMute& mute); - // TODO: NULL out mute_id in database + // TODO: nullptr out mute_id in database static void processMuteListUpdate(LLMessageSystem* msg, void**); static void processUseCachedMuteList(LLMessageSystem* msg, void**); diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index d7ffcb6e25..98750b52cc 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -343,7 +343,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); @@ -481,7 +481,7 @@ LLScrollListItem* LLNameListCtrl::getNameItemByAgentId(const LLUUID& agent_id) return item; } } - return NULL; + return nullptr; } void LLNameListCtrl::selectItemBySpecialId(const LLUUID& special_id) diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index ffff21c95c..66658343cf 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -147,7 +147,7 @@ class LLNameListCtrl bool enabled = true, const std::string& suffix = LLStringUtil::null, const std::string& prefix = 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); LLScrollListItem* addNameItemRow(const NameItem& value, EAddPosition pos = ADD_BOTTOM, const std::string& suffix = LLStringUtil::null, const std::string& prefix = LLStringUtil::null); diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index dfead5ee8a..e1066b8b7d 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -123,7 +123,7 @@ static LLDefaultChildRegistry::Register 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) @@ -264,14 +264,14 @@ void LLPullButton::setDirectionFromName(const std::string& name) */ LLNavigationBar::LLNavigationBar() -: mTeleportHistoryMenu(NULL), - mBtnBack(NULL), - mBtnForward(NULL), - mBtnHome(NULL), - mCmbLocation(NULL), +: mTeleportHistoryMenu(nullptr), + mBtnBack(nullptr), + mBtnForward(nullptr), + mBtnHome(nullptr), + mCmbLocation(nullptr), mSaveToLocationHistory(false), - mNavigationPanel(NULL), - mFavoritePanel(NULL), + mNavigationPanel(nullptr), + mFavoritePanel(nullptr), mNavPanWidth(0) { 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); @@ -651,7 +651,7 @@ void LLNavigationBar::showTeleportHistoryMenu(LLUICtrl* btn_ctrl) rebuildTeleportHistoryMenu(); - if (mTeleportHistoryMenu == NULL) + if (mTeleportHistoryMenu == nullptr) return; mTeleportHistoryMenu->updateParent(LLMenuGL::sMenuContainer); @@ -687,7 +687,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/llnetmap.cpp b/indra/newview/llnetmap.cpp index af472c4259..657955498e 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -406,7 +406,7 @@ void LLNetMap::draw() pos_map = globalPosToView(positions[i]); - bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL); + bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != nullptr); LLColor4 color = show_as_friend ? map_avatar_friend_color : map_avatar_color; @@ -1040,7 +1040,7 @@ bool LLNetMap::handleMouseUp(S32 x, S32 y, MASK mask) mMouseDown.set(0, 0); } gViewerWindow->showCursor(); - gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setMouseCapture(nullptr); return true; } @@ -1081,7 +1081,7 @@ bool LLNetMap::handleDoubleClick(S32 x, S32 y, MASK mask) if (double_click_teleport || double_click_show_world_map) { // If we're not tracking a beacon already, double-click will set one - if (!LLTracker::isTracking(NULL)) + if (!LLTracker::isTracking(nullptr)) { LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance(); if (world_map) @@ -1193,7 +1193,7 @@ void LLNetMap::handleStopTracking (const LLSD& userdata) if (menu) { menu->setItemEnabled ("Stop Tracking", false); - LLTracker::stopTracking (LLTracker::isTracking(NULL)); + LLTracker::stopTracking (LLTracker::isTracking(nullptr)); } } diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index cdf7f05ada..dac71e465c 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -84,7 +84,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) @@ -216,7 +216,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); } @@ -276,7 +276,7 @@ void LLHandlerUtil::addNotifPanelToIM(const LLNotificationPtr& notification) // add offer to session LLIMModel::LLIMSession * session = LLIMModel::getInstance()->findIMSession( session_id); - llassert_always(session != NULL); + llassert_always(session != nullptr); LLSD offer; offer["notification_id"] = notification->getID(); @@ -298,7 +298,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 9a33bcb1b9..80abaa442a 100644 --- a/indra/newview/llnotificationlistitem.cpp +++ b/indra/newview/llnotificationlistitem.cpp @@ -43,12 +43,12 @@ LLNotificationListItem::LLNotificationListItem(const Params& p) : LLPanel(p), mParams(p), - mTitleBox(NULL), - mExpandBtn(NULL), - mCondenseBtn(NULL), - mCloseBtn(NULL), - mCondensedViewPanel(NULL), - mExpandedViewPanel(NULL), + mTitleBox(nullptr), + mExpandBtn(nullptr), + mCondenseBtn(nullptr), + mCloseBtn(nullptr), + mCondensedViewPanel(nullptr), + mExpandedViewPanel(nullptr), mCondensedHeight(0), mExpandedHeight(0), mExpandedHeightResize(0), @@ -281,7 +281,7 @@ std::set LLTransactionNotificationListItem::getTypes() LLGroupNotificationListItem::LLGroupNotificationListItem(const Params& p) : LLNotificationListItem(p), - mSenderOrFeeBox(NULL) + mSenderOrFeeBox(nullptr) { } @@ -357,11 +357,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()) { @@ -401,7 +401,7 @@ bool LLGroupNoticeNotificationListItem::postBuild() } setSender(mParams.sender); - if (mInventoryOffer != NULL) + if (mInventoryOffer != nullptr) { mAttachmentTextBox->setValue(mInventoryOffer->mDesc); mAttachmentTextBox->setVisible(true); @@ -524,16 +524,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); @@ -544,7 +544,7 @@ void LLGroupNoticeNotificationListItem::onClickAttachment() LLNotifications::instance().add("AttachmentSaved", LLSD(), LLSD()); } mInventoryOffer->forceResponse(IOR_ACCEPT); - mInventoryOffer = NULL; + mInventoryOffer = nullptr; } } @@ -567,7 +567,7 @@ bool LLGroupNoticeNotificationListItem::isAttachmentOpenable(LLAssetType::EType LLTransactionNotificationListItem::LLTransactionNotificationListItem(const Params& p) : LLNotificationListItem(p), - mAvatarIcon(NULL) + mAvatarIcon(nullptr) { buildFromFile("panel_notification_list_item.xml"); } @@ -604,7 +604,7 @@ bool LLTransactionNotificationListItem::postBuild() LLSystemNotificationListItem::LLSystemNotificationListItem(const Params& p) : LLNotificationListItem(p), - mSystemNotificationIcon(NULL), + mSystemNotificationIcon(nullptr), mIsCaution(false) { buildFromFile("panel_notification_list_item.xml"); diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp index 5cec35fc88..16802b5cf2 100644 --- a/indra/newview/llnotificationstorage.cpp +++ b/indra/newview/llnotificationstorage.cpp @@ -68,7 +68,7 @@ LLNotificationResponderInterface * LLResponderRegistry::createResponder(const st return (*factoryFunc)(pParams); } - return NULL; + return nullptr; } LLResponderRegistry::StaticRegistrar sRegisterObjectGiveItem("ObjectGiveItem", &LLResponderRegistry::create); diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 8a070babcd..8e72c8400d 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -69,15 +69,15 @@ const S32 GALLERY_ITEMS_PER_ROW_MIN = 2; LLOutfitGallery::LLOutfitGallery(const LLOutfitGallery::Params& p) : LLOutfitListBase(), - mScrollPanel(NULL), - mGalleryPanel(NULL), - mLastRowPanel(NULL), + mScrollPanel(nullptr), + mGalleryPanel(nullptr), + mLastRowPanel(nullptr), mGalleryCreated(false), mRowCount(0), mItemsAddedCount(0), - mOutfitLinkPending(NULL), - mOutfitRenamePending(NULL), - mSnapshotFolderID(NULL), + mOutfitLinkPending(nullptr), + mOutfitRenamePending(nullptr), + mSnapshotFolderID(nullptr), mRowPanelHeight(p.row_panel_height), mVerticalGap(p.vertical_gap), mHorizontalGap(p.horizontal_gap), @@ -87,7 +87,7 @@ LLOutfitGallery::LLOutfitGallery(const LLOutfitGallery::Params& p) mItemsInRow(p.items_in_row), mRowPanWidthFactor(p.row_panel_width_factor), mGalleryWidthFactor(p.gallery_width_factor), - mTextureSelected(NULL), + mTextureSelected(nullptr), mSortMenu(nullptr) { updateGalleryWidth(); @@ -548,7 +548,7 @@ void LLOutfitGallery::removeLastRow() } else { - mLastRowPanel = NULL; + mLastRowPanel = nullptr; } } @@ -714,7 +714,7 @@ LLPanel* LLOutfitGallery::buildItemPanel(int left) { LLPanel::Params lpparams; int top = 0; - LLPanel* lpanel = NULL; + LLPanel* lpanel = nullptr; if(mUnusedItemPanels.empty()) { lpanel = LLUICtrlFactory::create(lpparams); @@ -736,7 +736,7 @@ LLPanel* LLOutfitGallery::buildItemPanel(int left) LLPanel* LLOutfitGallery::buildRowPanel(int left, int bottom) { LLPanel::Params sparams; - LLPanel* stack = NULL; + LLPanel* stack = nullptr; if(mUnusedRowPanels.empty()) { stack = LLUICtrlFactory::create(sparams); @@ -809,7 +809,7 @@ void LLOutfitGallery::getCurrentCategories(uuid_vec_t& vcur) iter != mOutfitMap.end(); iter++) { - if ((*iter).second != NULL) + if ((*iter).second != nullptr) { vcur.push_back((*iter).first); } @@ -837,7 +837,7 @@ void LLOutfitGallery::updateAddedCategory(LLUUID cat_id) mOutfitMap.insert(LLOutfitGallery::outfit_map_value_t(cat_id, item)); item->setRightMouseDownCallback(boost::bind(&LLOutfitListBase::outfitRightClickCallBack, this, _1, _2, _3, cat_id)); - LLWearableItemsList* list = NULL; + LLWearableItemsList* list = nullptr; item->setFocusReceivedCallback(boost::bind(&LLOutfitListBase::ChangeOutfitSelection, this, list, cat_id)); if (mGalleryCreated) { @@ -878,7 +878,7 @@ void LLOutfitGallery::updateRemovedCategory(LLUUID cat_id) removeFromGalleryMiddle(item); // kill removed item - if (item != NULL) + if (item != nullptr) { item->die(); } @@ -1177,7 +1177,7 @@ bool LLOutfitGalleryItem::openOutfitsContent() { LLAccordionCtrl* accordion = panel->getChild("outfits_accordion"); LLOutfitsList* outfit_list = dynamic_cast(panel); - if (accordion != NULL && outfit_list != NULL) + if (accordion != nullptr && outfit_list != nullptr) { outfit_list->setSelectedOutfitByUUID(mUUID); LLAccordionCtrlTab* tab = accordion->getSelectedTab(); @@ -1218,7 +1218,7 @@ LLUUID LLOutfitGalleryItem::getImageAssetId() void LLOutfitGalleryItem::setDefaultImage() { - mTexturep = NULL; + mTexturep = nullptr; mImageAssetId.setNull(); mPreviewIcon->setVisible(true); mDefaultImage = true; @@ -1323,7 +1323,7 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); LLUUID asset_id, inv_id; std::string item_name; - if (linked_item != NULL) + if (linked_item != nullptr) { if (linked_item->getActualType() == LLAssetType::AT_TEXTURE) { @@ -1362,7 +1362,7 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) std::string new_name = getString("outfit_photo_string", photo_string_args); LLSD updates; updates["name"] = new_name; - update_inventory_item(inv_id, updates, NULL); + update_inventory_item(inv_id, updates, nullptr); mOutfitRenamePending.setNull(); LLFloater* appearance_floater = LLFloaterReg::getInstance("appearance"); if (appearance_floater) diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 32831fcd9b..72b612bf6a 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -117,8 +117,8 @@ static LLPanelInjector t_outfits_list("outfits_list"); LLOutfitsList::LLOutfitsList() : LLOutfitListBase() - , mAccordion(NULL) - , mListCommands(NULL) + , mAccordion(nullptr) + , mListCommands(nullptr) , mItemSelected(false) , mSortMenu(nullptr) { @@ -313,7 +313,7 @@ void LLOutfitsList::updateRemovedCategory(LLUUID cat_id) mAccordion->removeCollapsibleCtrl(tab); // kill removed tab - if (tab != NULL) + if (tab != nullptr) { tab->die(); } @@ -544,7 +544,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)); } @@ -1383,7 +1383,7 @@ void LLOutfitContextMenu::onSave(const LLUUID &outfit_cat_id) LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist) : mOutfitList(olist), - mMenu(NULL) + mMenu(nullptr) { llassert_always(mOutfitList); @@ -1442,7 +1442,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/llpanelappearancetab.cpp b/indra/newview/llpanelappearancetab.cpp index ef04d7f13f..15397b8ae1 100644 --- a/indra/newview/llpanelappearancetab.cpp +++ b/indra/newview/llpanelappearancetab.cpp @@ -71,7 +71,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/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index 69f51b03b6..570e90273f 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -144,7 +144,7 @@ void LLPanelBlockedList::showPanelAndSelect(const LLUUID& idToSelect) ////////////////////////////////////////////////////////////////////////// void LLPanelBlockedList::updateButtons() { - bool hasSelected = NULL != mBlockedList->getSelectedItem(); + bool hasSelected = nullptr != mBlockedList->getSelectedItem(); mUnblockBtn->setEnabled(hasSelected); mBlockedGearBtn->setEnabled(hasSelected); diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index aefda39fb9..2980a0c0ee 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -85,8 +85,8 @@ static LLDispatchClassifiedClickThrough sClassifiedClickThrough; LLPanelClassifiedInfo::LLPanelClassifiedInfo() : LLPanel() , mInfoLoaded(false) - , mScrollingPanel(NULL) - , mScrollContainer(NULL) + , mScrollingPanel(nullptr) + , mScrollContainer(nullptr) , mScrollingPanelMinHeight(0) , mScrollingPanelWidth(0) , mSnapshotStreched(false) @@ -96,7 +96,7 @@ LLPanelClassifiedInfo::LLPanelClassifiedInfo() , mTeleportClicksNew(0) , mMapClicksNew(0) , mProfileClicksNew(0) - , mSnapshotCtrl(NULL) + , mSnapshotCtrl(nullptr) { sAllPanels.push_back(this); } diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index 7910bcb41d..1d68e4f57d 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -97,7 +97,7 @@ bool LLPanelContents::postBuild() LLPanelContents::LLPanelContents() : LLPanel(), - mPanelInventoryObject(NULL) + mPanelInventoryObject(nullptr) { } diff --git a/indra/newview/llpaneldirbrowser.cpp b/indra/newview/llpaneldirbrowser.cpp index 8c981cad55..f6d49cadf3 100644 --- a/indra/newview/llpaneldirbrowser.cpp +++ b/indra/newview/llpaneldirbrowser.cpp @@ -124,7 +124,7 @@ void LLPanelDirBrowser::draw() childSetFocus("results", true); } // Request specific data from the server - onCommitList(NULL, this); + onCommitList(nullptr, this); } } mDidAutoSelect = true; @@ -247,7 +247,7 @@ void LLPanelDirBrowser::selectByUUID(const LLUUID& id) // Don't bother looking for this in the draw loop. mWantSelectID.setNull(); // Make sure UI updates. - onCommitList(NULL, this); + onCommitList(nullptr, this); } else { @@ -396,7 +396,7 @@ void LLPanelDirBrowser::processDirPeopleReply(LLMessageSystem *msg, void**) msg->getUUIDFast(_PREHASH_QueryData,_PREHASH_QueryID, query_id); - LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)NULL); + LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)nullptr); if (!self) { // data from an old query @@ -490,7 +490,7 @@ void LLPanelDirBrowser::processDirPlacesReply(LLMessageSystem* msg, void**) } } - LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)NULL); + LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)nullptr); if (!self) { // data from an old query @@ -566,7 +566,7 @@ void LLPanelDirBrowser::processDirEventsReply(LLMessageSystem* msg, void**) msg->getUUID("AgentData", "AgentID", agent_id); msg->getUUID("QueryData", "QueryID", query_id ); - LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)NULL); + LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)nullptr); if (!self) { return; @@ -709,7 +709,7 @@ void LLPanelDirBrowser::processDirGroupsReply(LLMessageSystem* msg, void**) msg->getUUIDFast(_PREHASH_QueryData,_PREHASH_QueryID, query_id ); - LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)NULL); + LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)nullptr); if (!self) { return; @@ -796,7 +796,7 @@ void LLPanelDirBrowser::processDirClassifiedReply(LLMessageSystem* msg, void**) } msg->getUUID("QueryData", "QueryID", query_id); - LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)NULL); + LLPanelDirBrowser* self = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)nullptr); if (!self) { return; @@ -874,7 +874,7 @@ void LLPanelDirBrowser::processDirLandReply(LLMessageSystem *msg, void**) msg->getUUID("AgentData", "AgentID", agent_id); msg->getUUID("QueryData", "QueryID", query_id ); - LLPanelDirBrowser* browser = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)NULL); + LLPanelDirBrowser* browser = get_if_there(gDirBrowserInstances, query_id, (LLPanelDirBrowser*)nullptr); if (!browser) { // data from an old query @@ -1140,7 +1140,7 @@ void LLPanelDirBrowser::onVisibilityChange(bool new_visibility) { if (new_visibility) { - onCommitList(NULL, this); + onCommitList(nullptr, this); } LLPanel::onVisibilityChange(new_visibility); } diff --git a/indra/newview/llpaneldirevents.cpp b/indra/newview/llpaneldirevents.cpp index 227ed877cd..230bdd03eb 100644 --- a/indra/newview/llpaneldirevents.cpp +++ b/indra/newview/llpaneldirevents.cpp @@ -69,7 +69,7 @@ bool LLPanelDirEvents::postBuild() childSetAction("Search", LLPanelDirBrowser::onClickSearchCore, this); setDefaultBtn("Search"); - onDateModeCallback(NULL, this); + onDateModeCallback(nullptr, this); mCurrentSortColumn = "time"; diff --git a/indra/newview/llpaneldirgroups.cpp b/indra/newview/llpaneldirgroups.cpp index 992d92091c..37c8dd04a8 100644 --- a/indra/newview/llpaneldirgroups.cpp +++ b/indra/newview/llpaneldirgroups.cpp @@ -46,7 +46,7 @@ bool LLPanelDirGroups::postBuild() { LLPanelDirBrowser::postBuild(); - //getChild("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName, _1, _2), NULL); + //getChild("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName, _1, _2), nullptr); childSetAction("Search", &LLPanelDirBrowser::onClickSearchCore, this); setDefaultBtn( "Search" ); diff --git a/indra/newview/llpaneldirpeople.cpp b/indra/newview/llpaneldirpeople.cpp index 6a55e3bc7c..9173781491 100644 --- a/indra/newview/llpaneldirpeople.cpp +++ b/indra/newview/llpaneldirpeople.cpp @@ -46,7 +46,7 @@ bool LLPanelDirPeople::postBuild() { LLPanelDirBrowser::postBuild(); - //getChild("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName, _1, _2), NULL); + //getChild("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName, _1, _2), nullptr); childSetAction("Search", &LLPanelDirBrowser::onClickSearchCore, this); setDefaultBtn( "Search" ); diff --git a/indra/newview/llpaneldirplaces.cpp b/indra/newview/llpaneldirplaces.cpp index 2d54566038..f37404ddb2 100644 --- a/indra/newview/llpaneldirplaces.cpp +++ b/indra/newview/llpaneldirplaces.cpp @@ -57,7 +57,7 @@ bool LLPanelDirPlaces::postBuild() { LLPanelDirBrowser::postBuild(); - //getChild("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName, _1, _2), NULL); + //getChild("name")->setKeystrokeCallback(boost::bind(&LLPanelDirBrowser::onKeystrokeName, _1, _2), nullptr); childSetAction("Search", &LLPanelDirBrowser::onClickSearchCore, this); setDefaultBtn("Search"); diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 8bcb6e9ec3..9a13882ad1 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -436,7 +436,7 @@ get_pickers_indexes(const LLEditWearableDictionary::WearableEntry *wearable_entr // Specializations of this template function return picker control entry for particular control type. template const LLEditWearableDictionary::PickerControlEntry* -get_picker_entry (const ETextureIndex index) { return NULL; } +get_picker_entry (const ETextureIndex index) { return nullptr; } typedef std::function function_t; @@ -502,7 +502,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(wearable_entry); for (texture_vec_t::const_iterator @@ -523,7 +523,7 @@ find_picker_ctrl_entry_if(LLWearableType::EType type, const Predicate pred) return entry; } } - return NULL; + return nullptr; } template @@ -639,8 +639,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)); @@ -682,7 +682,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(); } @@ -690,11 +690,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("wearable_accordion"); - if (accordion_ctrl != NULL) + if (accordion_ctrl != nullptr) { bodypart_panel->setVisibleCallback( boost::bind(&LLPanelEditWearable::onWearablePanelVisibilityChange, this, _2, accordion_ctrl)); @@ -769,7 +769,7 @@ bool LLPanelEditWearable::postBuild() mTxtAvatarHeight = mPanelShape->getChild("avatar_height"); - mWearablePtr = NULL; + mWearablePtr = nullptr; configureAlphaCheckbox(LLAvatarAppearanceDefines::TEX_LOWER_ALPHA, "lower alpha texture invisible"); configureAlphaCheckbox(LLAvatarAppearanceDefines::TEX_UPPER_ALPHA, "upper alpha texture invisible"); @@ -1102,7 +1102,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()); @@ -1172,7 +1172,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; @@ -1395,7 +1395,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; } @@ -1492,7 +1492,7 @@ LLPanel* LLPanelEditWearable::getPanel(LLWearableType::EType type) return mPanelPhysics; default: - return NULL; + return nullptr; } } @@ -1537,14 +1537,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 ); } diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index 443b52b8fc..72a3ec9ef1 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -120,7 +120,7 @@ class LLPanelEditWearable : public LLPanel // *HACK Remove this when serverside texture baking is available on all regions. void incrementCofVersionLegacy(); - // the pointer to the wearable we're editing. NULL means we're not editing a wearable. + // the pointer to the wearable we're editing. nullptr means we're not editing a wearable. LLViewerWearable *mWearablePtr; LLViewerInventoryItem* mWearableItem; diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index 831ad7827a..0414d4d0bd 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -620,7 +620,7 @@ void LLPanelEnvironmentInfo::readjustAltLabels() // Very simple "adjust after the fact" method // Note: labels can be in any order - LLView* view_midle = NULL; + LLView* view_midle = nullptr; U32 midle_ind = 0; S32 shift_up = 0; S32 shift_down = 0; @@ -1173,7 +1173,7 @@ void LLPanelEnvironmentInfo::onEnvironmentReceived(LLHandle that_h, S32 LLSettingsDropTarget::LLSettingsDropTarget(const LLSettingsDropTarget::Params& p) : LLView(p) - , mEnvironmentInfoPanel(NULL) + , mEnvironmentInfoPanel(nullptr) , mDndEnabled(false) { } diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp index 01c8e88370..668414d75b 100644 --- a/indra/newview/llpanelexperiencelisteditor.cpp +++ b/indra/newview/llpanelexperiencelisteditor.cpp @@ -46,9 +46,9 @@ static LLPanelInjector t_panel_experience_list_edit LLPanelExperienceListEditor::LLPanelExperienceListEditor() - :mItems(NULL) - ,mProfile(NULL) - ,mRemove(NULL) + :mItems(nullptr) + ,mProfile(nullptr) + ,mRemove(nullptr) ,mReadonly(false) ,mMaxExperienceIDs(0) { @@ -131,7 +131,7 @@ void LLPanelExperienceListEditor::onRemove() std::vector::iterator it = items.begin(); for(/**/; it != items.end(); ++it) { - if((*it) != NULL) + if((*it) != nullptr) { //mExperienceIds.erase((*it)->getValue()); mRemovedCallback((*it)->getValue()); @@ -163,7 +163,7 @@ void LLPanelExperienceListEditor::checkButtonsEnabled() std::vector::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/llpanelexperiencelog.cpp b/indra/newview/llpanelexperiencelog.cpp index 5380565ace..5c7dbdb658 100644 --- a/indra/newview/llpanelexperiencelog.cpp +++ b/indra/newview/llpanelexperiencelog.cpp @@ -47,7 +47,7 @@ static LLPanelInjector register_experiences_panel("experie LLPanelExperienceLog::LLPanelExperienceLog( ) - : mEventList(NULL) + : mEventList(nullptr) , mPageSize(25) , mCurrentPage(0) { diff --git a/indra/newview/llpanelexperiencepicker.cpp b/indra/newview/llpanelexperiencepicker.cpp index 5a176b8b92..4603658e48 100644 --- a/indra/newview/llpanelexperiencepicker.cpp +++ b/indra/newview/llpanelexperiencepicker.cpp @@ -72,7 +72,7 @@ LLPanelExperiencePicker::~LLPanelExperiencePicker() bool LLPanelExperiencePicker::postBuild() { - getChild(TEXT_EDIT)->setKeystrokeCallback( boost::bind(&LLPanelExperiencePicker::editKeystroke, this, _1, _2),NULL); + getChild(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/llpanelexperiences.cpp b/indra/newview/llpanelexperiences.cpp index 6cdeefdbad..c43f02725c 100644 --- a/indra/newview/llpanelexperiences.cpp +++ b/indra/newview/llpanelexperiences.cpp @@ -46,7 +46,7 @@ static LLPanelInjector register_experiences_panel("experienc static const LLExperienceItemComparator NAME_COMPARATOR; LLPanelExperiences::LLPanelExperiences( ) - : mExperiencesList(NULL) + : mExperiencesList(nullptr) { buildFromFile("panel_experiences.xml"); } @@ -72,7 +72,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(selected_item); } @@ -174,7 +174,7 @@ void LLPanelExperiences::enableButton( bool enable ) LLExperienceItem::LLExperienceItem() - : mName(NULL) + : mName(nullptr) { buildFromFile("panel_experience_list_item.xml"); } diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index de8ab95dee..2572296896 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -526,9 +526,9 @@ bool LLPanelFace::postBuild() LLPanelFace::LLPanelFace() : LLPanel(), mIsAlpha(false), - mComboMatMedia(NULL), - mTitleMedia(NULL), - mTitleMediaText(NULL), + mComboMatMedia(nullptr), + mTitleMedia(nullptr), + mTitleMediaText(nullptr), mNeedMediaTitle(true) { USE_TEXTURE = LLTrans::getString("use_texture"); @@ -1000,7 +1000,7 @@ void LLPanelFace::sendTextureInfo() { if (mPlanarAlign->getValue().asBoolean()) { - LLFace* last_face = NULL; + LLFace* last_face = nullptr; bool identical_face =false; LLSelectedTE::getFace(last_face, identical_face); LLPanelFaceSetAlignedTEFunctor setfunc(this, last_face); @@ -1018,7 +1018,7 @@ void LLPanelFace::sendTextureInfo() void LLPanelFace::alignTextureLayer() { - LLFace* last_face = NULL; + LLFace* last_face = nullptr; bool identical_face = false; LLSelectedTE::getFace(last_face, identical_face); @@ -1034,7 +1034,7 @@ void LLPanelFace::getState() void LLPanelFace::updateUI(bool force_set_values /*false*/) { //set state of UI to match state of texture entry(ies) (calls setEnabled, setValue, etc, but NOT setVisible) LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(); - LLViewerObject* objectp = node ? node->getObject() : NULL; + LLViewerObject* objectp = node ? node->getObject() : nullptr; if (objectp && objectp->getPCode() == LL_PCODE_VOLUME @@ -1406,7 +1406,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) if (align_planar && enabled) { - LLFace* last_face = NULL; + LLFace* last_face = nullptr; bool identical_face = false; LLSelectedTE::getFace(last_face, identical_face); @@ -2169,7 +2169,7 @@ void LLPanelFace::refreshMedia() { LLSelectNode* node = *iter; LLVOVolume* object = dynamic_cast(node->getObject()); - if (NULL != object) + if (nullptr != object) { if (!object->permModify()) { @@ -3608,7 +3608,7 @@ void LLPanelFace::onCommitMaterialBumpyRot() { if (mPlanarAlign->getValue().asBoolean()) { - LLFace* last_face = NULL; + LLFace* last_face = nullptr; bool identical_face = false; LLSelectedTE::getFace(last_face, identical_face); LLPanelFaceSetAlignedTEFunctor setfunc(this, last_face); @@ -3632,7 +3632,7 @@ void LLPanelFace::onCommitMaterialShinyRot() { if (mPlanarAlign->getValue().asBoolean()) { - LLFace* last_face = NULL; + LLFace* last_face = nullptr; bool identical_face = false; LLSelectedTE::getFace(last_face, identical_face); LLPanelFaceSetAlignedTEFunctor setfunc(this, last_face); @@ -3807,7 +3807,7 @@ struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor viewer_media_t pMediaImpl; const LLTextureEntry* tep = object->getTE(te); - if (const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL) + if (const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : nullptr) { pMediaImpl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID()); } @@ -4525,7 +4525,7 @@ void get_item_and_permissions(const LLUUID &id, LLViewerInventoryItem*& itemp, b { full_perm = get_full_permission(data, prefix); from_library = data.has(prefix + "fromlibrary") && data.get(prefix + "fromlibrary").asBoolean(); - LLViewerInventoryItem* itemp_res = NULL; + LLViewerInventoryItem* itemp_res = nullptr; if (data.has(prefix + "itemid")) { @@ -4614,7 +4614,7 @@ void LLPanelFace::onPasteTexture(LLViewerObject* objectp, S32 te) bool img_full_perm = false; bool img_from_library = false; const LLUUID& imageid = te_data["te"]["imageid"].asUUID(); //texture or asset id - LLViewerInventoryItem* img_itemp_res = NULL; + LLViewerInventoryItem* img_itemp_res = nullptr; get_item_and_permissions(imageid, img_itemp_res, img_full_perm, img_from_library, te_data["te"], "img"); @@ -4671,7 +4671,7 @@ void LLPanelFace::onPasteTexture(LLViewerObject* objectp, S32 te) const LLUUID pbr_id = te_data["te"]["pbr"].asUUID(); bool pbr_full_perm = false; bool pbr_from_library = false; - LLViewerInventoryItem* pbr_itemp_res = NULL; + LLViewerInventoryItem* pbr_itemp_res = nullptr; get_item_and_permissions(pbr_id, pbr_itemp_res, pbr_full_perm, pbr_from_library, te_data["te"], "pbr"); @@ -4689,7 +4689,7 @@ void LLPanelFace::onPasteTexture(LLViewerObject* objectp, S32 te) bool full_perm = false; bool from_library = false; - LLViewerInventoryItem* itemp_res = NULL; + LLViewerInventoryItem* itemp_res = nullptr; get_item_and_permissions(tex_id, itemp_res, full_perm, from_library, te_data["te"], prefix); allow = full_perm; if (!allow) break; @@ -5247,7 +5247,7 @@ void LLPanelFace::LLSelectedTE::getFace(LLFace*& face_to_return, bool& identical { LLFace* get(LLViewerObject* object, S32 te) { - return (object->mDrawable) ? object->mDrawable->getFace(te): NULL; + return (object->mDrawable) ? object->mDrawable->getFace(te): nullptr; } } get_te_face_func; identical_face = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&get_te_face_func, face_to_return, false, (LLFace*)nullptr); @@ -5334,7 +5334,7 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical) { if (te) { - LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_STANDARD) : NULL; + LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_STANDARD) : nullptr; if(!tex) { tex = LLViewerFetchedTexture::sDefaultImagep; diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 63fee6bab8..89f9357459 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -462,7 +462,7 @@ class LLPanelFace : public LLPanel { LL_DEBUGS("Materials") << "Removing material from object " << object->getID() << " face " << face << LL_ENDL; LLMaterialMgr::getInstance()->remove(object->getID(),face); - new_material = NULL; + new_material = nullptr; } else { @@ -473,7 +473,7 @@ class LLPanelFace : public LLPanel object->setTEMaterialParams(face, new_material); return new_material; } - return NULL; + return nullptr; } LLMaterialEditFunctor< DataType, SetValueType, MaterialEditFunc >* _edit; LLPanelFace *_panel; @@ -498,7 +498,7 @@ class LLPanelFace : public LLPanel { DataType ret = _default; LLMaterialPtr material_ptr; - LLTextureEntry* tep = object ? object->getTE(face) : NULL; + LLTextureEntry* tep = object ? object->getTE(face) : nullptr; if (tep) { material_ptr = tep->getMaterialParams(); @@ -528,7 +528,7 @@ class LLPanelFace : public LLPanel virtual ~GetTEVal() {} DataType get(LLViewerObject* object, S32 face) { - LLTextureEntry* tep = object ? object->getTE(face) : NULL; + LLTextureEntry* tep = object ? object->getTE(face) : nullptr; return tep ? ((tep->*(TEGetFunc))()) : _default; } DataType _default; diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index ecb66f9cea..596ecc65eb 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -87,7 +87,7 @@ LLPanelGroup::LLPanelGroup() : LLPanel(), LLGroupMgrObserver( LLUUID() ), mSkipRefresh(false), - mButtonJoin(NULL) + mButtonJoin(nullptr) { // Set up the factory callbacks. // Roles sub tabs @@ -166,7 +166,7 @@ bool LLPanelGroup::postBuild() mGroupNameCtrl = getChild("group_name"); - childSetCommitCallback("back",boost::bind(&LLPanelGroup::onBackBtnClick,this),NULL); + childSetCommitCallback("back", boost::bind(&LLPanelGroup::onBackBtnClick, this), nullptr); LLPanelGroupTab* panel_general = findChild("group_general_tab_panel"); LLPanelGroupTab* panel_roles = findChild("group_roles_tab_panel"); diff --git a/indra/newview/llpanelgroupcreate.cpp b/indra/newview/llpanelgroupcreate.cpp index bc7b5caddf..de1299e061 100644 --- a/indra/newview/llpanelgroupcreate.cpp +++ b/indra/newview/llpanelgroupcreate.cpp @@ -68,7 +68,7 @@ LLPanelGroupCreate::~LLPanelGroupCreate() bool LLPanelGroupCreate::postBuild() { - childSetCommitCallback("back", boost::bind(&LLPanelGroupCreate::onBackBtnClick, this), NULL); + childSetCommitCallback("back", boost::bind(&LLPanelGroupCreate::onBackBtnClick, this), nullptr); mComboMature = getChild("group_mature_check", true); mCtrlOpenEnrollment = getChild("open_enrollement", true); diff --git a/indra/newview/llpanelgroupexperiences.cpp b/indra/newview/llpanelgroupexperiences.cpp index 99c40984a5..63bde661bd 100644 --- a/indra/newview/llpanelgroupexperiences.cpp +++ b/indra/newview/llpanelgroupexperiences.cpp @@ -42,7 +42,7 @@ static LLPanelInjector t_panel_group_experiences("panel LLPanelGroupExperiences::LLPanelGroupExperiences() -: LLPanelGroupTab(), mExperiencesList(NULL) +: LLPanelGroupTab(), mExperiencesList(nullptr) { } diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 270ca29403..bc50fe6c1d 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -66,19 +66,19 @@ LLPanelGroupGeneral::LLPanelGroupGeneral() : LLPanelGroupTab(), mChanged(false), mFirstUse(true), - mGroupNameEditor(NULL), - mFounderName(NULL), - mInsignia(NULL), - mEditCharter(NULL), - mCtrlShowInGroupList(NULL), - mComboMature(NULL), - mCtrlOpenEnrollment(NULL), - mCtrlEnrollmentFee(NULL), - mSpinEnrollmentFee(NULL), - mCtrlReceiveNotices(NULL), - mCtrlListGroup(NULL), - mActiveTitleLabel(NULL), - mComboActiveTitle(NULL) + mGroupNameEditor(nullptr), + mFounderName(nullptr), + mInsignia(nullptr), + mEditCharter(nullptr), + mCtrlShowInGroupList(nullptr), + mComboMature(nullptr), + mCtrlOpenEnrollment(nullptr), + mCtrlEnrollmentFee(nullptr), + mSpinEnrollmentFee(nullptr), + mCtrlReceiveNotices(nullptr), + mCtrlListGroup(nullptr), + mActiveTitleLabel(nullptr), + mComboActiveTitle(nullptr) { } diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 8a6876f8fc..551be4a2ef 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -98,14 +98,14 @@ class LLPanelGroupInvite::impl 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() { } @@ -258,7 +258,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/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 987782836b..2ae5fd6101 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -246,15 +246,15 @@ LLPanelGroupLandMoney::impl::impl(LLPanelGroupLandMoney& panel) mNeedsSendGroupLandRequest = true; mNeedsApply = false; - mYourContributionEditorp = NULL; - mMapButtonp = NULL; - mGroupParcelsp = NULL; - mGroupOverLimitTextp = NULL; - mGroupOverLimitIconp = NULL; - - mMoneySalesTabEHp = NULL; - mMoneyPlanningTabEHp = NULL; - mMoneyDetailsTabEHp = NULL; + mYourContributionEditorp = nullptr; + mMapButtonp = nullptr; + mGroupParcelsp = nullptr; + mGroupOverLimitTextp = nullptr; + mGroupOverLimitIconp = nullptr; + + mMoneySalesTabEHp = nullptr; + mMoneyPlanningTabEHp = nullptr; + mMoneyDetailsTabEHp = nullptr; } LLPanelGroupLandMoney::impl::~impl() @@ -636,7 +636,7 @@ void LLPanelGroupLandMoney::update(LLGroupChange gc) { eh = get_if_there(LLGroupMoneyTabEventHandler::sTabsToHandlers, panelp, - (LLGroupMoneyTabEventHandler*)NULL); + (LLGroupMoneyTabEventHandler*)nullptr); if ( eh ) eh->onClickTab(); } } @@ -1340,8 +1340,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, @@ -1640,7 +1640,7 @@ void LLPanelGroupLandMoney::setGroupID(const LLUUID& id) earlierp = getChild("earlier_sales_button", true); laterp = getChild("later_sales_button", true); panelp = getChild("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/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 483c6876ed..5810a73876 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -209,8 +209,8 @@ std::string build_notice_date(const U32& the_time) LLPanelGroupNotices::LLPanelGroupNotices() : LLPanelGroupTab(), - mInventoryItem(NULL), - mInventoryOffer(NULL) + mInventoryItem(nullptr), + mInventoryOffer(nullptr) { @@ -225,7 +225,7 @@ LLPanelGroupNotices::~LLPanelGroupNotices() // Cancel the inventory offer. mInventoryOffer->forceResponse(IOR_DECLINE); - mInventoryOffer = NULL; + mInventoryOffer = nullptr; } } @@ -353,7 +353,7 @@ void LLPanelGroupNotices::setItem(LLPointer inv_item) void LLPanelGroupNotices::onClickRemoveAttachment(void* data) { LLPanelGroupNotices* self = (LLPanelGroupNotices*)data; - self->mInventoryItem = NULL; + self->mInventoryItem = nullptr; self->mCreateInventoryName->clear(); self->mCreateInventoryIcon->setVisible(false); self->mBtnRemoveAttachment->setEnabled(false); @@ -365,7 +365,7 @@ void LLPanelGroupNotices::onClickOpenAttachment(void* data) LLPanelGroupNotices* self = (LLPanelGroupNotices*)data; self->mInventoryOffer->forceResponse(IOR_ACCEPT); - self->mInventoryOffer = NULL; + self->mInventoryOffer = nullptr; self->mBtnOpenAttachment->setEnabled(false); } @@ -430,7 +430,7 @@ void LLPanelGroupNotices::onClickNewMessage(void* data) if (self->mInventoryOffer) { self->mInventoryOffer->forceResponse(IOR_DECLINE); - self->mInventoryOffer = NULL; + self->mInventoryOffer = nullptr; } self->mCreateSubject->clear(); @@ -617,7 +617,7 @@ void LLPanelGroupNotices::showNotice(const std::string& subject, { // Cancel the inventory offer for the previously viewed notice mInventoryOffer->forceResponse(IOR_DECLINE); - mInventoryOffer = NULL; + mInventoryOffer = nullptr; } if (inventory_offer) diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index e1f2d7588c..783d419cd4 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -116,9 +116,9 @@ bool agentCanAddToRole(const LLUUID& group_id, // static LLPanelGroupRoles::LLPanelGroupRoles() : LLPanelGroupTab(), - mCurrentTab(NULL), - mRequestedTab( NULL ), - mSubTabContainer( NULL ), + mCurrentTab(nullptr), + mRequestedTab( nullptr ), + mSubTabContainer( nullptr ), mFirstUse( true ) { } @@ -200,7 +200,7 @@ bool LLPanelGroupRoles::handleSubTabSwitch(const LLSD& data) { std::string panel_name = data.asString(); - if(mRequestedTab != NULL)//we already have tab change request + if(mRequestedTab != nullptr)//we already have tab change request { return false; } @@ -287,7 +287,7 @@ bool LLPanelGroupRoles::handleNotifyCallback(const LLSD& notification, const LLS break; case 2: // "Cancel" default: - mRequestedTab = NULL; + mRequestedTab = nullptr; // Do nothing. The user is canceling the action. break; } @@ -427,11 +427,11 @@ void LLPanelGroupRoles::setGroupID(const LLUUID& id) // LLPanelGroupSubTab //////////////////////////////////////////////////// LLPanelGroupSubTab::LLPanelGroupSubTab() : LLPanelGroupTab(), - mHeader(NULL), - mFooter(NULL), + mHeader(nullptr), + mFooter(nullptr), mActivated(false), mHasGroupBanPower(false), - mSearchEditor(NULL) + mSearchEditor(nullptr) { } @@ -782,9 +782,9 @@ static LLPanelInjector t_panel_group_members_subtab(" LLPanelGroupMembersSubTab::LLPanelGroupMembersSubTab() : LLPanelGroupSubTab(), - mMembersList(NULL), - mAssignedRolesList(NULL), - mAllowedActionsList(NULL), + mMembersList(nullptr), + mAssignedRolesList(nullptr), + mAllowedActionsList(nullptr), mChanged(false), mPendingMemberUpdate(false), mHasMatch(false), @@ -922,7 +922,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() buildActionsList(mAllowedActionsList, allowed_by_some, allowed_by_all, - NULL, + nullptr, false, false, false); @@ -1140,7 +1140,7 @@ void LLPanelGroupMembersSubTab::onInviteMember(void *userdata) void LLPanelGroupMembersSubTab::handleInviteMember() { - LLFloaterGroupInvite::showForGroup(mGroupID, NULL, false); + LLFloaterGroupInvite::showForGroup(mGroupID, nullptr, false); } void LLPanelGroupMembersSubTab::onEjectMembers(void *userdata) @@ -1284,7 +1284,7 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, //the current member now has no role changes //so erase the role change and erase the member's entry delete role_change_datap; - role_change_datap = NULL; + role_change_datap = nullptr; mMemberRoleChangeData.erase(member_id); } @@ -1315,7 +1315,7 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, buildActionsList(mAllowedActionsList, powers_some_have, powers_all_have, - NULL, + nullptr, false, false, false); @@ -1549,7 +1549,7 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag } // See if there are unsaved role changes for this agent - role_change_data_map_t* role_change_datap = NULL; + role_change_data_map_t* role_change_datap = nullptr; member_role_changes_map_t::iterator member = mMemberRoleChangeData.find(agent_id); if (member != mMemberRoleChangeData.end()) { @@ -1935,16 +1935,16 @@ static LLPanelInjector t_panel_group_roles_subtab("pane LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab() : LLPanelGroupSubTab(), - mRolesList(NULL), - mAssignedMembersList(NULL), - mAllowedActionsList(NULL), - mRoleName(NULL), - mRoleTitle(NULL), - mRoleDescription(NULL), - mMemberVisibleCheck(NULL), - mDeleteRoleButton(NULL), - mCopyRoleButton(NULL), - mCreateRoleButton(NULL), + mRolesList(nullptr), + mAssignedMembersList(nullptr), + mAllowedActionsList(nullptr), + mRoleName(nullptr), + mRoleTitle(nullptr), + mRoleDescription(nullptr), + mMemberVisibleCheck(nullptr), + mDeleteRoleButton(nullptr), + mCopyRoleButton(nullptr), + mCreateRoleButton(nullptr), mFirstOpen(true), mHasRoleChange(false) { @@ -2142,7 +2142,7 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) } mRolesList->deleteAllItems(); - LLScrollListItem* item = NULL; + LLScrollListItem* item = nullptr; LLGroupMgrGroupData::role_list_t::iterator rit = gdatap->mRoles.begin(); LLGroupMgrGroupData::role_list_t::iterator end = gdatap->mRoles.end(); @@ -2843,7 +2843,7 @@ void LLPanelGroupActionsSubTab::activate() buildActionsList(mActionList, GP_ALL_POWERS, GP_ALL_POWERS, - NULL, + nullptr, false, true, false); @@ -2896,7 +2896,7 @@ void LLPanelGroupActionsSubTab::onFilterChanged() buildActionsList(mActionList, GP_ALL_POWERS, GP_ALL_POWERS, - NULL, + nullptr, false, true, false); @@ -2996,9 +2996,9 @@ static LLPanelInjector t_panel_group_ban_subtab("pane LLPanelGroupBanListSubTab::LLPanelGroupBanListSubTab() : LLPanelGroupSubTab(), - mBanList(NULL), - mCreateBanButton(NULL), - mDeleteBanButton(NULL) + mBanList(nullptr), + mCreateBanButton(nullptr), + mDeleteBanButton(nullptr) {} bool LLPanelGroupBanListSubTab::postBuildSubTab(LLView* root) diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index e320efa1c7..3f5296cf7b 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -62,7 +62,7 @@ class LLPanelGroupRoles : public LLPanelGroupTab // Checks if the current tab needs to be applied, and tries to switch to the requested tab. bool attemptTransition(); - // Switches to the requested tab (will close() if requested is NULL) + // Switches to the requested tab (will close() if requested is nullptr) void transitionToTab(); // Used by attemptTransition to query the user's response to a tab that needs to apply. @@ -132,7 +132,7 @@ class LLPanelGroupSubTab : public LLPanelGroupTab bool is_owner_role); protected: - LLPanel* mHeader; // Might not be present in xui of derived class (NULL) + LLPanel* mHeader; // Might not be present in xui of derived class (nullptr) LLPanel* mFooter; LLFilterEditor* mSearchEditor; diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp index a17d101539..ec4edb6a94 100644 --- a/indra/newview/llpanelhome.cpp +++ b/indra/newview/llpanelhome.cpp @@ -36,7 +36,7 @@ static LLPanelInjector t_home("panel_sidetray_home"); LLPanelHome::LLPanelHome() : LLPanel(), LLViewerMediaObserver(), - mBrowser(NULL), + mBrowser(nullptr), mFirstView(true) { } diff --git a/indra/newview/llpanelland.cpp b/indra/newview/llpanelland.cpp index 07f4a710db..e4db8ce58e 100644 --- a/indra/newview/llpanelland.cpp +++ b/indra/newview/llpanelland.cpp @@ -44,8 +44,8 @@ #include "lluictrlfactory.h" -LLPanelLandSelectObserver* LLPanelLandInfo::sObserver = NULL; -LLPanelLandInfo* LLPanelLandInfo::sInstance = NULL; +LLPanelLandSelectObserver* LLPanelLandInfo::sObserver = nullptr; +LLPanelLandInfo* LLPanelLandInfo::sInstance = nullptr; class LLPanelLandSelectObserver : public LLParcelObserver { @@ -86,7 +86,7 @@ bool LLPanelLandInfo::postBuild() // LLPanelLandInfo::LLPanelLandInfo() : LLPanel(), - mCheckShowOwners(NULL) + mCheckShowOwners(nullptr) { if (!sInstance) { @@ -106,9 +106,9 @@ LLPanelLandInfo::~LLPanelLandInfo() { LLViewerParcelMgr::getInstance()->removeObserver( sObserver ); delete sObserver; - sObserver = NULL; + sObserver = nullptr; - sInstance = NULL; + sInstance = nullptr; } diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index fb7ccbfe4c..942a36e569 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -144,12 +144,12 @@ void LLOpenFolderByID::doFolder(LLFolderViewFolder* folder) LLLandmarksPanel::LLLandmarksPanel() : LLPanelPlacesTab() - , mLandmarksInventoryPanel(NULL) - , mCurrentSelectedList(NULL) - , mGearFolderMenu(NULL) - , mGearLandmarkMenu(NULL) - , mSortingMenu(NULL) - , mAddMenu(NULL) + , mLandmarksInventoryPanel(nullptr) + , mCurrentSelectedList(nullptr) + , mGearFolderMenu(nullptr) + , mGearLandmarkMenu(nullptr) + , mSortingMenu(nullptr) + , mAddMenu(nullptr) , isLandmarksPanel(true) { buildFromFile("panel_landmarks.xml"); @@ -157,12 +157,12 @@ LLLandmarksPanel::LLLandmarksPanel() LLLandmarksPanel::LLLandmarksPanel(bool is_landmark_panel) : LLPanelPlacesTab() - , mLandmarksInventoryPanel(NULL) - , mCurrentSelectedList(NULL) - , mGearFolderMenu(NULL) - , mGearLandmarkMenu(NULL) - , mSortingMenu(NULL) - , mAddMenu(NULL) + , mLandmarksInventoryPanel(nullptr) + , mCurrentSelectedList(nullptr) + , mGearFolderMenu(nullptr) + , mGearLandmarkMenu(nullptr) + , mSortingMenu(nullptr) + , mAddMenu(nullptr) , isLandmarksPanel(is_landmark_panel) { if (is_landmark_panel) @@ -199,7 +199,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; @@ -240,7 +240,7 @@ bool LLLandmarksPanel::isSingleItemSelected() { bool result = false; - if (mCurrentSelectedList != NULL) + if (mCurrentSelectedList != nullptr) { LLFolderView* root_view = mCurrentSelectedList->getRootFolder(); @@ -336,7 +336,7 @@ void LLLandmarksPanel::doActionOnCurSelectedLandmark(LLLandmarkList::loaded_call LLFolderViewItem* LLLandmarksPanel::getCurSelectedItem() const { - return mCurrentSelectedList ? mCurrentSelectedList->getRootFolder()->getCurSelectedItem() : NULL; + return mCurrentSelectedList ? mCurrentSelectedList->getRootFolder()->getCurSelectedItem() : nullptr; } LLFolderViewModelItemInventory* LLLandmarksPanel::getCurSelectedViewModelItem() const @@ -346,7 +346,7 @@ LLFolderViewModelItemInventory* LLLandmarksPanel::getCurSelectedViewModelItem() { return static_cast(cur_item->getViewModelItem()); } - return NULL; + return nullptr; } @@ -534,7 +534,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) @@ -557,14 +557,14 @@ 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)); } } else if ("category_root" == command_name) { //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)); } } @@ -641,7 +641,7 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const LLFolderView* root_folder_view = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() - : NULL; + : nullptr; bool is_single_selection = root_folder_view && root_folder_view->getSelectedCount() == 1; @@ -866,7 +866,7 @@ void LLLandmarksPanel::onCustomAction(const LLSD& userdata) } else if (command_name == "move_to_landmarks" || command_name == "move_to_favorites") { - LLFolderView* root_folder_view = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() : NULL; + LLFolderView* root_folder_view = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() : nullptr; if (root_folder_view) { LLFolderType::EType folder_type = command_name == "move_to_landmarks" ? LLFolderType::FT_LANDMARK : LLFolderType::FT_FAVORITE; @@ -898,7 +898,7 @@ void LLLandmarksPanel::onMenuVisibilityChange(LLUICtrl* ctrl, const LLSD& param) bool are_any_items_in_trash = false; bool are_all_items_in_trash = true; - LLFolderView* root_folder_view = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() : NULL; + LLFolderView* root_folder_view = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() : nullptr; if(root_folder_view) { const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); @@ -1036,7 +1036,7 @@ bool LLLandmarksPanel::handleDragAndDropToTrash(bool drop, EDragAndDropType carg { LLFolderViewItem* fv_item = mCurrentSelectedList ? mCurrentSelectedList->getItemByID(item->getUUID()) - : NULL; + : nullptr; if (fv_item) { diff --git a/indra/newview/llpanellandmedia.cpp b/indra/newview/llpanellandmedia.cpp index 294bd4021d..efc1234fa4 100644 --- a/indra/newview/llpanellandmedia.cpp +++ b/indra/newview/llpanellandmedia.cpp @@ -59,16 +59,16 @@ 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) { } diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index fe9145bf71..636ac712b9 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -73,7 +73,7 @@ #include "llsdserialize.h" -LLPanelLogin *LLPanelLogin::sInstance = NULL; +LLPanelLogin *LLPanelLogin::sInstance = nullptr; bool LLPanelLogin::sCapslockDidNotification = false; bool LLPanelLogin::sCredentialSet = false; @@ -305,10 +305,10 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLVersionInfo::instance().getBuild(), ')'); LLTextBox* forgot_password_text = getChild("forgot_password_text"); - forgot_password_text->setClickedCallback(onClickForgotPassword, NULL); + forgot_password_text->setClickedCallback(onClickForgotPassword, nullptr); LLTextBox* sign_up_text = getChild("sign_up_text"); - sign_up_text->setClickedCallback(onClickSignUp, NULL); + sign_up_text->setClickedCallback(onClickSignUp, nullptr); // get the web browser control LLMediaCtrl* web_browser = getChild("login_html"); @@ -443,11 +443,11 @@ void LLPanelLogin::addFavoritesToStartLocation() LLPanelLogin::~LLPanelLogin() { - 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 @@ -478,8 +478,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 @@ -829,7 +829,7 @@ void LLPanelLogin::autologinToLocation(const LLSLURL& slurl) LL_DEBUGS("AppInit")<<"automatically logging into Location "<onClickConnect(unused_parameter); @@ -848,7 +848,7 @@ void LLPanelLogin::closePanel() } delete sInstance; - sInstance = NULL; + sInstance = nullptr; } } diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index ad7aa57842..451a6bd78d 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -128,15 +128,15 @@ class LLFloaterInventoryFinder : public LLFloater LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) : LLPanel(p), - mActivePanel(NULL), - mWornItemsPanel(NULL), - mSavedFolderState(NULL), + mActivePanel(nullptr), + mWornItemsPanel(nullptr), + mSavedFolderState(nullptr), mFilterText(""), - mMenuGearDefault(NULL), - mMenuVisibility(NULL), + mMenuGearDefault(nullptr), + mMenuVisibility(nullptr), mMenuAddHandle(), mNeedUploadCost(true), - mMenuViewDefault(NULL), + mMenuViewDefault(nullptr), mSingleFolderMode(false), mForceShowInvLayout(false), mViewMode(MODE_COMBINATION), @@ -416,7 +416,7 @@ void LLPanelMainInventory::startSearch() bool LLPanelMainInventory::handleKeyHere(KEY key, MASK mask) { - LLFolderView* root_folder = mActivePanel ? mActivePanel->getRootFolder() : NULL; + LLFolderView* root_folder = mActivePanel ? mActivePanel->getRootFolder() : nullptr; if (root_folder) { // first check for user accepting current search results @@ -478,7 +478,7 @@ LLFloaterSidePanelContainer* LLPanelMainInventory::newWindow() sidepanel_inventory->initInventoryViews(); return floater; } - return NULL; + return nullptr; } //static @@ -566,7 +566,7 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) LL_DEBUGS("Inventory") << "Done creating inventory: " << new_id << LL_ENDL; } }; - menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_created); + menu_create_inventory_item(nullptr, getCurrentSFVRoot(), userdata, LLUUID::null, callback_created); } } else @@ -585,13 +585,13 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) } } }; - menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_created); + menu_create_inventory_item(nullptr, getCurrentSFVRoot(), userdata, LLUUID::null, callback_created); } } else { selectAllItemsPanel(); - menu_create_inventory_item(mAllItemsPanel, NULL, userdata); + menu_create_inventory_item(mAllItemsPanel, nullptr, userdata); } } @@ -759,7 +759,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() @@ -851,7 +851,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) @@ -1669,7 +1669,7 @@ void LLPanelMainInventory::onViewModeClick() if (current_item) { const LLUUID& id = static_cast(current_item->getViewModelItem())->getUUID(); - if(gInventory.getCategory(id) != NULL) + if(gInventory.getCategory(id) != nullptr) { new_root_folder = id; } @@ -2077,7 +2077,7 @@ void LLPanelMainInventory::onVisibilityChange( bool new_visibility ) bool LLPanelMainInventory::isSaveTextureEnabled(const LLSD& userdata) { - LLViewerInventoryItem *inv_item = NULL; + LLViewerInventoryItem *inv_item = nullptr; if(mSingleFolderMode && isGalleryViewMode()) { inv_item = gInventory.getItem(mCombinationGalleryPanel->getFirstSelectedItemID()); @@ -2577,7 +2577,7 @@ LLSidepanelInventory* LLPanelMainInventory::getParentSidepanelInventory() { return dynamic_cast(inventory_container->findChild("main_panel", true)); } - return NULL; + return nullptr; } void LLPanelMainInventory::setViewMode(EViewModeType mode) diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index d10e12d3a8..a693024a4d 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -48,10 +48,10 @@ const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams // protected LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p) : LLPanel(p) - , mFreshCountCtrl(NULL) - , mInboxButton(NULL) - , mInventoryPanel(NULL) - , mSavedFolderState(NULL) + , mFreshCountCtrl(nullptr) + , mInboxButton(nullptr) + , mInventoryPanel(nullptr) + , mSavedFolderState(nullptr) , mLastItemCount(-1) , mLastFreshItemCount(-1) { @@ -253,7 +253,7 @@ void LLPanelMarketplaceInbox::draw() { U32 item_count = getTotalItemCount(); - llassert(mFreshCountCtrl != NULL); + llassert(mFreshCountCtrl != nullptr); if (mLastItemCount != item_count) { diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index 380c2827ac..217792468b 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -62,16 +62,16 @@ 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 ), + mAutoLoop( nullptr ), + mFirstClick( nullptr ), + mAutoZoom( nullptr ), + mAutoPlay( nullptr ), + mAutoScale( nullptr ), + mWidthPixels( nullptr ), + mHeightPixels( nullptr ), + mHomeURL( nullptr ), + mCurrentURL( nullptr ), + mParent( nullptr ), mMediaEditable(false) { // build dialog from XML @@ -277,7 +277,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 ) diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp index 868d492083..6699886c8b 100644 --- a/indra/newview/llpanelmediasettingspermissions.cpp +++ b/indra/newview/llpanelmediasettingspermissions.cpp @@ -49,7 +49,7 @@ //////////////////////////////////////////////////////////////////////////////// // LLPanelMediaSettingsPermissions::LLPanelMediaSettingsPermissions() : - mControls( NULL ), + mControls( nullptr ), mPermsOwnerInteract( 0 ), mPermsOwnerControl( 0 ), mPermsGroupName( 0 ), @@ -165,7 +165,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/llpanelmediasettingssecurity.cpp b/indra/newview/llpanelmediasettingssecurity.cpp index 68e2808a83..0cda4da856 100644 --- a/indra/newview/llpanelmediasettingssecurity.cpp +++ b/indra/newview/llpanelmediasettingssecurity.cpp @@ -47,7 +47,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)); @@ -101,7 +101,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/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 2dd4866da3..90cc914aaa 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -76,12 +76,12 @@ static const LLUUID PARCEL_AUDIO_LIST_ITEM_UUID = LLUUID("DF4B020D-8A24-4B95-AB5 LLPanelNearByMedia::LLPanelNearByMedia() -: mMediaList(NULL), - mEnableAllCtrl(NULL), +: mMediaList(nullptr), + mEnableAllCtrl(nullptr), mDebugInfoVisible(false), - mParcelMediaItem(NULL), - mParcelAudioItem(NULL), - mMoreLessBtn(NULL) + mParcelMediaItem(nullptr), + mParcelAudioItem(nullptr), + mMoreLessBtn(nullptr) { // This is just an initial value, mParcelAudioAutoStart does not affect ParcelMediaAutoPlayEnable mParcelAudioAutoStart = gSavedSettings.getS32("ParcelMediaAutoPlayEnable") != 0 @@ -298,7 +298,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(). @@ -330,7 +330,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(new_item->getColumn(CHECKBOX_COLUMN)); if (scroll_list_check) @@ -379,7 +379,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()); @@ -541,7 +541,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)); mMediaList->updateLayout(); @@ -567,22 +567,22 @@ void LLPanelNearByMedia::refreshParcelItems() if (gSavedSettings.getBOOL("AudioStreamingMedia") && should_include && media_inst->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::getInstance()->getParcelMedia(), name, url, ""); @@ -599,9 +599,9 @@ void LLPanelNearByMedia::refreshParcelItems() mParcelMediaName, tooltip, -2, // Proximity closer than anything else, before Parcel Audio - impl == NULL || impl->isMediaDisabled(), - impl != NULL && !LLViewerParcelMedia::getInstance()->getURL().empty(), - impl != NULL && impl->isMediaTimeBased() && impl->isMediaPlaying(), + impl == nullptr || impl->isMediaDisabled(), + impl != nullptr && !LLViewerParcelMedia::getInstance()->getURL().empty(), + impl != nullptr && impl->isMediaTimeBased() && impl->isMediaPlaying(), MEDIA_CLASS_ALL, "parcel media"); } @@ -610,22 +610,22 @@ void LLPanelNearByMedia::refreshParcelItems() if (should_include && media_inst->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 = media_inst->isParcelAudioPlaying(); @@ -662,8 +662,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(); @@ -1023,7 +1023,7 @@ void LLPanelNearByMedia::updateControls() } else { LLViewerMediaImpl* impl = LLViewerParcelMedia::getInstance()->getParcelMedia(); - if (NULL == impl) + if (nullptr == impl) { // Just means it hasn't started yet showBasicControls(false, false, false, false, 0); @@ -1049,7 +1049,7 @@ void LLPanelNearByMedia::updateControls() else { LLViewerMediaImpl* impl = media_inst->getMediaImplFromTextureID(selected_media_id); - if (NULL == impl || !gSavedSettings.getBOOL("AudioStreamingMedia")) + if (nullptr == impl || !gSavedSettings.getBOOL("AudioStreamingMedia")) { showDisabledControls(); } @@ -1134,7 +1134,7 @@ void LLPanelNearByMedia::onClickSelectedMediaPlay() { LLViewerMediaImpl *impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ? ((LLViewerMediaImpl*)LLViewerParcelMedia::getInstance()->getParcelMedia()) : LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id); - if (NULL != impl) + if (nullptr != impl) { if (impl->isMediaTimeBased() && impl->isMediaPaused()) { @@ -1163,7 +1163,7 @@ void LLPanelNearByMedia::onClickSelectedMediaPause() } else { LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id); - if (NULL != impl && impl->isMediaTimeBased() && impl->isMediaPlaying()) + if (nullptr != impl && impl->isMediaTimeBased() && impl->isMediaPlaying()) { impl->pause(); } @@ -1180,7 +1180,7 @@ void LLPanelNearByMedia::onClickSelectedMediaMute() else { LLViewerMediaImpl* impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ? ((LLViewerMediaImpl*)LLViewerParcelMedia::getInstance()->getParcelMedia()) : LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id); - if (NULL != impl) + if (nullptr != impl) { F32 volume = impl->getVolume(); if(volume > 0.0) @@ -1211,7 +1211,7 @@ void LLPanelNearByMedia::onCommitSelectedMediaVolume() else { LLViewerMediaImpl* impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ? ((LLViewerMediaImpl*)LLViewerParcelMedia::getInstance()->getParcelMedia()) : LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id); - if (NULL != impl) + if (nullptr != impl) { impl->setVolume(mVolumeSlider->getValueF32()); } @@ -1282,7 +1282,7 @@ bool LLPanelNearByMedia::onMenuVisible(const LLSD& userdata) // 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 @@ -1319,7 +1319,7 @@ std::string LLPanelNearByMedia::getSelectedUrl() else { LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id); - if (NULL != impl) + if (nullptr != impl) { std::string name; getNameAndUrlHelper(impl, name, url, mEmptyNameString); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 23e6a9fbcf..cb9340f533 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -331,7 +331,7 @@ void LLPanelObject::getState( ) LLCalc* calcp = LLCalc::getInstance(); - LLVOVolume *volobjp = NULL; + LLVOVolume *volobjp = nullptr; if ( objectp && (objectp->getPCode() == LL_PCODE_VOLUME)) { volobjp = (LLVOVolume *)objectp; @@ -342,7 +342,7 @@ void LLPanelObject::getState( ) //forfeit focus if (gFocusMgr.childHasKeyboardFocus(this)) { - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } // Disable all text input fields @@ -1808,12 +1808,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/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index a31a54bb67..665bee1828 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -189,7 +189,7 @@ LLInventoryObject* LLTaskInvFVBridge::findInvObject() const return object->getInventoryObject(mUUID); } - return NULL; + return nullptr; } LLInventoryItem* LLTaskInvFVBridge::findItem() const @@ -934,7 +934,7 @@ void LLTaskLSLBridge::openItem() LLLiveLSLEditor* preview = LLFloaterReg::showTypedInstance("preview_scriptedit", floater_key, TAKE_FOCUS_YES); if (preview) { - LLSelectNode *node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(NULL, true); + LLSelectNode *node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(nullptr, true); if (node && node->mValid) { preview->setObjectName(node->mName); @@ -1208,9 +1208,9 @@ bool LLTaskMaterialBridge::removeItem() LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory* panel, LLInventoryObject* object) { - LLTaskInvFVBridge* new_bridge = NULL; + LLTaskInvFVBridge* new_bridge = nullptr; const LLInventoryItem* item = dynamic_cast(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(); @@ -1315,8 +1315,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), @@ -1391,8 +1391,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; } } @@ -1412,10 +1412,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(p); @@ -1652,7 +1652,7 @@ void LLPanelObjectInventory::refresh() bool has_inventory = false; const bool non_root_ok = true; LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); - LLSelectNode* node = selection->getFirstRootNode(NULL, non_root_ok); + LLSelectNode* node = selection->getFirstRootNode(nullptr, non_root_ok); if (node && node->mValid) { LLViewerObject* object = node->getObject(); @@ -1675,7 +1675,7 @@ void LLPanelObjectInventory::refresh() clearContents(); // Register for updates from this object, - registerVOInventoryListener(object,NULL); + registerVOInventoryListener(object, nullptr); } else if (mAttachmentUUID != object->getAttachmentItemID()) { @@ -1770,14 +1770,14 @@ void LLPanelObjectInventory::draw() void LLPanelObjectInventory::deleteAllChildren() { - mScroller = NULL; - mFolders = NULL; + mScroller = nullptr; + mFolders = nullptr; LLView::deleteAllChildren(); } bool LLPanelObjectInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) { - LLFolderViewItem* folderp = mFolders ? mFolders->getNextFromChild(NULL) : NULL; + LLFolderViewItem* folderp = mFolders ? mFolders->getNextFromChild(nullptr) : nullptr; if (!folderp) return false; @@ -1814,7 +1814,7 @@ void LLPanelObjectInventory::onFocusLost() // inventory no longer handles cut/copy/paste/delete if (LLEditMenuHandler::gEditMenuHandler == mFolders) { - LLEditMenuHandler::gEditMenuHandler = NULL; + LLEditMenuHandler::gEditMenuHandler = nullptr; } LLPanel::onFocusLost(); @@ -1836,7 +1836,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/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 2ddc09736f..024ddca55a 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -159,7 +159,7 @@ class LLPanelOutfitEditGearMenu registrar.add("Wearable.Create", boost::bind(onCreate, _2)); - llassert(LLMenuGL::sMenuContainer != NULL); + llassert(LLMenuGL::sMenuContainer != nullptr); LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile( "menu_cof_gear.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); llassert(menu); @@ -230,7 +230,7 @@ class LLAddWearablesGearMenu : public LLInitClass enable_registrar.add("AddWearable.Gear.Check", boost::bind(onCheck, flat_list_handle, inventory_panel_handle, _2)); enable_registrar.add("AddWearable.Gear.Visible", boost::bind(onVisible, inventory_panel_handle, _2)); - llassert(LLMenuGL::sMenuContainer != NULL); + llassert(LLMenuGL::sMenuContainer != nullptr); LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile( "menu_add_wearable_gear.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); @@ -366,7 +366,7 @@ class LLCOFDragAndDropObserver : public LLInventoryAddItemByAssetObserver inline LLCOFDragAndDropObserver::LLCOFDragAndDropObserver(LLInventoryModel* model): mModel(model) { - if (model != NULL) + if (model != nullptr) { model->addObserver(this); } @@ -374,7 +374,7 @@ inline LLCOFDragAndDropObserver::LLCOFDragAndDropObserver(LLInventoryModel* mode inline LLCOFDragAndDropObserver::~LLCOFDragAndDropObserver() { - if (mModel != NULL && mModel->containsObserver(this)) + if (mModel != nullptr && mModel->containsObserver(this)) { mModel->removeObserver(this); } @@ -391,22 +391,22 @@ void LLCOFDragAndDropObserver::done() LLPanelOutfitEdit::LLPanelOutfitEdit() : LLPanel(), - mSearchFilter(NULL), - mCOFWearables(NULL), - mInventoryItemsPanel(NULL), - mGearMenu(NULL), - mAddWearablesGearMenu(NULL), - mCOFDragAndDropObserver(NULL), + mSearchFilter(nullptr), + mCOFWearables(nullptr), + mInventoryItemsPanel(nullptr), + mGearMenu(nullptr), + mAddWearablesGearMenu(nullptr), + mCOFDragAndDropObserver(nullptr), mInitialized(false), - mAddWearablesPanel(NULL), - mFolderViewFilterCmbBox(NULL), - mListViewFilterCmbBox(NULL), - mWearableListManager(NULL), - mPlusBtn(NULL), - mWearablesGearMenuBtn(NULL), - mGearMenuBtn(NULL), - mStatus(NULL), - mCurrentOutfitName(NULL) + mAddWearablesPanel(nullptr), + mFolderViewFilterCmbBox(nullptr), + mListViewFilterCmbBox(nullptr), + mWearableListManager(nullptr), + mPlusBtn(nullptr), + mWearablesGearMenuBtn(nullptr), + mGearMenuBtn(nullptr), + mStatus(nullptr), + mCurrentOutfitName(nullptr) { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(false); @@ -484,12 +484,12 @@ bool LLPanelOutfitEdit::postBuild() mFilterBtn = getChild("filter_button"); mFilterBtn->setCommitCallback(boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this)); - childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesFolderView, this), NULL); - childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL); - childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, this), NULL); - childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL); - childSetCommitCallback("shop_btn_1", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); - childSetCommitCallback("shop_btn_2", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); + childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesFolderView, this), nullptr); + childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), nullptr); + childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, this), nullptr); + childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), nullptr); + 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)); @@ -915,9 +915,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 selected_items = mInventoryItemsPanel->getRootFolder()->getSelectionList(); @@ -928,7 +928,7 @@ LLPanelOutfitEdit::selection_info_t LLPanelOutfitEdit::getAddMorePanelSelectionT result.first = getWearableTypeByItemUUID(static_cast((*selected_items.begin())->getViewModelItem())->getUUID()); } } - else if (mWearableItemsList != NULL && mWearableItemsList->getVisible()) + else if (mWearableItemsList != nullptr && mWearableItemsList->getVisible()) { std::vector selected_uuids; mWearableItemsList->getSelectedUUIDs(selected_uuids); @@ -948,7 +948,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) @@ -1187,7 +1187,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; @@ -1287,7 +1287,7 @@ bool LLPanelOutfitEdit::switchPanels(LLPanel* switch_from_panel, LLPanel* switch void LLPanelOutfitEdit::resetAccordionState() { - if (mCOFWearables != NULL) + if (mCOFWearables != nullptr) { mCOFWearables->expandDefaultAccordionTab(); } diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index a989d93d9e..f6ca2e0a4b 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -112,7 +112,7 @@ class LLPanelOutfitEdit : public LLPanel 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; } diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 64e0a8c429..728702e8ff 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -461,7 +461,7 @@ class LLFriendListUpdater : public LLAvatarListUpdater, public LLFriendObserver bool isDescendentOfInventoryFriends(const LLUUID& invItemID) { LLViewerInventoryItem * item = gInventory.getItem(invItemID); - if (NULL == item) + if (nullptr == item) return false; return LLFriendCardsManager::instance().isItemInAnyFriendsList(item); @@ -530,13 +530,13 @@ class LLRecentListUpdater : public LLAvatarListUpdater, public boost::signals2:: LLPanelPeople::LLPanelPeople() : LLPanel(), - mTabContainer(NULL), - mOnlineFriendList(NULL), - mAllFriendList(NULL), - mNearbyList(NULL), - mRecentList(NULL), - mGroupList(NULL), - mMiniMap(NULL) + mTabContainer(nullptr), + mOnlineFriendList(nullptr), + mAllFriendList(nullptr), + mNearbyList(nullptr), + mRecentList(nullptr), + mGroupList(nullptr), + mMiniMap(nullptr) { mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList, this)); mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList, this)); @@ -898,7 +898,7 @@ 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; } diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 62e726d21d..315bd31dc0 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -283,7 +283,7 @@ bool PeopleContextMenu::enableFreezeEject(const LLSD& userdata) const LLUUID& id = mUUIDs.front(); // Use avatar_id if available, otherwise default to right-click avatar - LLVOAvatar* avatar = NULL; + LLVOAvatar* avatar = nullptr; if (id.notNull()) { LLViewerObject* object = gObjectList.findObject(id); @@ -291,7 +291,7 @@ bool PeopleContextMenu::enableFreezeEject(const LLSD& userdata) { if( !object->isAvatar() ) { - object = NULL; + object = nullptr; } avatar = (LLVOAvatar*) object; } @@ -341,7 +341,7 @@ void PeopleContextMenu::eject() const LLUUID& id = mUUIDs.front(); // Use avatar_id if available, otherwise default to right-click avatar - LLVOAvatar* avatar = NULL; + LLVOAvatar* avatar = nullptr; if (id.notNull()) { LLViewerObject* object = gObjectList.findObject(id); @@ -349,7 +349,7 @@ void PeopleContextMenu::eject() { if( !object->isAvatar() ) { - object = NULL; + object = nullptr; } avatar = (LLVOAvatar*) object; } diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index cbf5819fda..e7e898326c 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -318,7 +318,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) { @@ -1360,5 +1360,5 @@ LLViewerInventoryItem* LLPanelPermissions::findItem(LLUUID &object_id) { return gInventory.getItem(object_id); } - return NULL; + return nullptr; } diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index efce55907e..3081265f52 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) + mScrollingPanel(nullptr), + mScrollContainer(nullptr), + mDescEditor(nullptr) {} //virtual diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 87f05f2028..f2a70247ac 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -79,10 +79,10 @@ static std::string icon_see_avs_off; LLPanelPlaceProfile::LLPanelPlaceProfile() : LLPanelPlaceInfo(), mNextCovenantUpdateTime(0), - mForSalePanel(NULL), - mYouAreHerePanel(NULL), + mForSalePanel(nullptr), + mYouAreHerePanel(nullptr), mSelectedParcelID(-1), - mAccordionCtrl(NULL) + mAccordionCtrl(nullptr) {} // virtual @@ -279,7 +279,7 @@ void LLPanelPlaceProfile::setInfoType(EInfoType type) break; } - if (mAccordionCtrl != NULL) + if (mAccordionCtrl != nullptr) { mAccordionCtrl->expandDefaultTab(); } diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 5435a79e16..8295128f72 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -235,13 +235,13 @@ static LLPanelInjector t_places("panel_places"); LLPanelPlaces::LLPanelPlaces() : LLPanel(), - mActivePanel(NULL), - mFilterEditor(NULL), - mPlaceProfile(NULL), - mLandmarkInfo(NULL), - mItem(NULL), - mPlaceMenu(NULL), - mLandmarkMenu(NULL), + mActivePanel(nullptr), + mFilterEditor(nullptr), + mPlaceProfile(nullptr), + mLandmarkInfo(nullptr), + mItem(nullptr), + mPlaceMenu(nullptr), + mLandmarkMenu(nullptr), mPosGlobal(), isLandmarkEditModeOn(false), mTabsCreated(false) @@ -368,7 +368,7 @@ bool LLPanelPlaces::postBuild() mLandmarkInfo->getChild("back_btn")->setClickedCallback(boost::bind(&LLPanelPlaces::onBackButtonClicked, this)); LLLineEditor* title_editor = mLandmarkInfo->getChild("title_editor"); - title_editor->setKeystrokeCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this), NULL); + title_editor->setKeystrokeCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this), nullptr); LLTextEditor* notes_editor = mLandmarkInfo->getChild("notes_editor"); notes_editor->setKeystrokeCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this)); @@ -433,7 +433,7 @@ void LLPanelPlaces::onOpen(const LLSD& key) mPlaceInfoType = key_type; mPosGlobal.setZero(); - mItem = NULL; + mItem = nullptr; mRegionId.setNull(); togglePlaceInfoPanel(true); @@ -659,7 +659,7 @@ void LLPanelPlaces::onTabSelected() // History panel does not support deletion nor creation // Hide menus - bool supports_create = mActivePanel->getCreateMenu() != NULL; + bool supports_create = mActivePanel->getCreateMenu() != nullptr; childSetVisible("add_btn_panel", supports_create); // favorites and inventory can remove items, history can clear history @@ -869,7 +869,7 @@ void LLPanelPlaces::onOverflowButtonClicked() if ((is_agent_place_info_visible || mPlaceInfoType == REMOTE_PLACE_INFO_TYPE || - mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE) && mPlaceMenu != NULL) + mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE) && mPlaceMenu != nullptr) { menu = mPlaceMenu; @@ -894,7 +894,7 @@ void LLPanelPlaces::onOverflowButtonClicked() menu->setItemVisible("landmark", mPlaceInfoType != TELEPORT_HISTORY_INFO_TYPE); menu->arrangeAndClear(); } - else if (mPlaceInfoType == LANDMARK_INFO_TYPE && mLandmarkMenu != NULL) + else if (mPlaceInfoType == LANDMARK_INFO_TYPE && mLandmarkMenu != nullptr) { menu = mLandmarkMenu; @@ -969,7 +969,7 @@ void LLPanelPlaces::onOverflowMenuItemClicked(const LLSD& param) mItem->getUUID(), favorites_id, std::string(), - LLPointer(NULL)); + LLPointer(nullptr)); LL_INFOS() << "Copied inventory item #" << mItem->getUUID() << " to favorites." << LL_ENDL; } } @@ -1209,7 +1209,7 @@ void LLPanelPlaces::createTabs() // History panel does not support deletion nor creation // Hide menus - bool supports_create = mActivePanel->getCreateMenu() != NULL; + bool supports_create = mActivePanel->getCreateMenu() != nullptr; childSetVisible("add_btn_panel", supports_create); // favorites and inventory can remove items, history can clear history @@ -1332,7 +1332,7 @@ LLPanelPlaceInfo* LLPanelPlaces::getCurrentInfoPanel() return mLandmarkInfo; } - return NULL; + return nullptr; } void LLPanelPlaces::hideBackBtn() diff --git a/indra/newview/llpanelplacestab.cpp b/indra/newview/llpanelplacestab.cpp index 3916e34e31..0f502a677d 100644 --- a/indra/newview/llpanelplacestab.cpp +++ b/indra/newview/llpanelplacestab.cpp @@ -38,7 +38,7 @@ #include "llworldmap.h" std::string LLPanelPlacesTab::sFilterSubString = LLStringUtil::null; -LLButton* LLPanelPlacesTab::sRemoveBtn = NULL; +LLButton* LLPanelPlacesTab::sRemoveBtn = nullptr; bool LLPanelPlacesTab::isTabVisible() { diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 86071e38e1..b2bafd5fbc 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -96,7 +96,7 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() : mZoomObjectFace(0), mVolumeSliderVisible(0), mZoomedCameraPos(), - mWindowShade(NULL), + mWindowShade(nullptr), mHideImmediately(false), mSecureURL(false), mMediaPlaySliderCtrlMouseDownValue(0.0) @@ -286,7 +286,7 @@ LLPluginClassMedia* LLPanelPrimMediaControls::getTargetMediaPlugin() return impl->getMediaPlugin(); } - return NULL; + return nullptr; } void LLPanelPrimMediaControls::updateShape() @@ -300,7 +300,7 @@ void LLPanelPrimMediaControls::updateShape() return; } - LLPluginClassMedia* media_plugin = NULL; + LLPluginClassMedia* media_plugin = nullptr; if(media_impl->hasMedia()) { media_plugin = media_impl->getMediaPlugin(); @@ -323,7 +323,7 @@ void LLPanelPrimMediaControls::updateShape() bool hasPermsControl = true; bool mini_controls = false; LLMediaEntry *media_data = objectp->getTE(mTargetObjectFace)->getMediaData(); - if (media_data && NULL != dynamic_cast(objectp)) + if (media_data && nullptr != dynamic_cast(objectp)) { // Don't show the media controls if we do not have permissions enabled = dynamic_cast(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL); @@ -357,11 +357,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); diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 34d2d4d6a5..624f8d2a83 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -419,7 +419,7 @@ class LLAgentHandler : public LLCommandHandler // reportAbuse is here due to convoluted avatar handling // in LLScrollListCtrl and LLTextBase - if (verb == "reportAbuse" && web == NULL) + if (verb == "reportAbuse" && web == nullptr) { LLAvatarName av_name; if (LLAvatarNameCache::get(avatar_id, &av_name)) @@ -909,12 +909,12 @@ void LLPanelProfileSecondLife::processProperties(void* data, EAvatarProcessorTyp void LLPanelProfileSecondLife::processProfileProperties(const LLAvatarData* avatar_data) { const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); - if ((relationship != NULL || gAgent.isGodlike()) && !getSelfProfile()) + if ((relationship != nullptr || gAgent.isGodlike()) && !getSelfProfile()) { // Relies onto friend observer to get information about online status updates. // Once SL-17506 gets implemented, condition might need to become: // (gAgent.isGodlike() || isRightGrantedFrom || flags & AVATAR_ONLINE) - processOnlineStatus(relationship != NULL, + processOnlineStatus(relationship != nullptr, gAgent.isGodlike() || relationship->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS), (avatar_data->flags & AVATAR_ONLINE)); } @@ -1737,7 +1737,7 @@ void LLPanelProfileSecondLife::onShowTexturePicker() PERM_NONE, PERM_NONE, false, - NULL, + nullptr, PICK_TEXTURE); mFloaterTexturePickerHandle = texture_floaterp->getHandle(); @@ -2059,7 +2059,7 @@ void LLPanelProfileFirstLife::onChangePhoto() PERM_NONE, PERM_NONE, false, - NULL, + nullptr, PICK_TEXTURE); mFloaterTexturePickerHandle = texture_floaterp->getHandle(); diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp index 62829b0745..4ffd22633e 100644 --- a/indra/newview/llpanelprofileclassifieds.cpp +++ b/indra/newview/llpanelprofileclassifieds.cpp @@ -580,8 +580,8 @@ LLPanelProfileClassified::LLPanelProfileClassified() , mMapClicksNew(0) , mProfileClicksNew(0) , mPriceForListing(0) - , mSnapshotCtrl(NULL) - , mPublishFloater(NULL) + , mSnapshotCtrl(nullptr) + , mPublishFloater(nullptr) , mIsNew(false) , mIsNewWithErrors(false) , mCanClose(false) @@ -594,7 +594,7 @@ LLPanelProfileClassified::LLPanelProfileClassified() LLPanelProfileClassified::~LLPanelProfileClassified() { sAllPanels.remove(this); - gGenericDispatcher.addHandler("classifiedclickthrough", NULL); // deregister our handler + gGenericDispatcher.addHandler("classifiedclickthrough", nullptr); // deregister our handler } //static @@ -669,7 +669,7 @@ bool LLPanelProfileClassified::postBuild() mCategoryCombo->add(LLTrans::getString(iter->second)); } - mClassifiedNameEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onTitleChange, this), NULL); + mClassifiedNameEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onTitleChange, this), nullptr); mClassifiedDescEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); mCategoryCombo->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); mContentTypeCombo->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index c9626bf9ea..67cfea7dcb 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -517,7 +517,7 @@ bool LLPanelProfilePicks::canDeletePick() LLPanelProfilePick::LLPanelProfilePick() : LLPanelProfilePropertiesProcessorTab() , LLRemoteParcelInfoObserver() - , mSnapshotCtrl(NULL) + , mSnapshotCtrl(nullptr) , mPickId(LLUUID::null) , mParcelId(LLUUID::null) , mRequestedId(LLUUID::null) @@ -640,7 +640,7 @@ bool LLPanelProfilePick::postBuild() mCancelButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickCancel, this)); mSetCurrentLocationButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSetLocation, this)); - mPickName->setKeystrokeCallback(boost::bind(&LLPanelProfilePick::onPickChanged, this, _1), NULL); + mPickName->setKeystrokeCallback(boost::bind(&LLPanelProfilePick::onPickChanged, this, _1), nullptr); mPickName->setEnabled(false); mPickDescription->setKeystrokeCallback(boost::bind(&LLPanelProfilePick::onPickChanged, this, _1)); diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp index 56c0294dbe..37920bdf7b 100644 --- a/indra/newview/llpanelsnapshot.cpp +++ b/indra/newview/llpanelsnapshot.cpp @@ -56,7 +56,7 @@ S32 power_of_two(S32 sz, S32 upper) } LLPanelSnapshot::LLPanelSnapshot() - : mSnapshotFloater(NULL) + : mSnapshotFloater(nullptr) {} // virtual @@ -159,7 +159,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/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index bfdfa68e01..b4579f525d 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -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; @@ -318,11 +318,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); @@ -335,7 +335,7 @@ LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem ( else { // Item already added to parent - item = NULL; + item = nullptr; } } @@ -374,7 +374,7 @@ void LLTeleportHistoryFlatItemStorage::purge() it != it_end; ++it ) { LLHandle 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(); } @@ -394,13 +394,13 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel() : LLPanelPlacesTab(), mDirty(true), mCurrentItem(0), - mTeleportHistory(NULL), - mHistoryAccordion(NULL), - mAccordionTabMenu(NULL), - mLastSelectedFlatlList(NULL), + mTeleportHistory(nullptr), + mHistoryAccordion(nullptr), + mAccordionTabMenu(nullptr), + mLastSelectedFlatlList(nullptr), mLastSelectedItemIndex(-1), - mGearItemMenu(NULL), - mSortingMenu(NULL) + mGearItemMenu(nullptr), + mSortingMenu(nullptr) { buildFromFile( "panel_teleport_history.xml"); } @@ -602,7 +602,7 @@ LLToggleableMenu* LLTeleportHistoryPanel::getSortingMenu() // virtual LLToggleableMenu* LLTeleportHistoryPanel::getCreateMenu() { - return NULL; + return nullptr; } void LLTeleportHistoryPanel::getNextTab(const LLDate& item_date, S32& tab_idx, LLDate& tab_date) @@ -677,7 +677,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); @@ -790,7 +790,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) { @@ -956,7 +956,7 @@ void LLTeleportHistoryPanel::onAccordionTabRightClick(LLView *view, S32 x, S32 y registrar.add("TeleportHistory.TabClose", boost::bind(&LLTeleportHistoryPanel::onAccordionTabClose, this, tab)); // create the context menu from the XUI - llassert(LLMenuGL::sMenuContainer != NULL); + llassert(LLMenuGL::sMenuContainer != nullptr); mAccordionTabMenu = LLUICtrlFactory::getInstance()->createFromFile( "menu_teleport_history_tab.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); @@ -1007,7 +1007,7 @@ LLFlatListView* LLTeleportHistoryPanel::getFlatListViewFromTab(LLAccordionCtrlTa } } - return NULL; + return nullptr; } void LLTeleportHistoryPanel::gotSLURLCallback(const std::string& slurl) @@ -1146,7 +1146,7 @@ bool LLTeleportHistoryPanel::isActionEnabled(const LLSD& userdata) const return false; } LLTeleportHistoryFlatItem* itemp = dynamic_cast (mLastSelectedFlatlList->getSelectedItem()); - return itemp != NULL; + return itemp != nullptr; } return false; diff --git a/indra/newview/llpaneltiptoast.cpp b/indra/newview/llpaneltiptoast.cpp index afed140075..84bd377a2f 100644 --- a/indra/newview/llpaneltiptoast.cpp +++ b/indra/newview/llpaneltiptoast.cpp @@ -32,7 +32,7 @@ bool LLPanelTipToast::postBuild() { mMessageText= findChild("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/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index e7ac11d570..51e1bfc215 100644 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -455,7 +455,7 @@ void LLPanelTopInfoBar::onContextMenuItemClicked(const LLSD::String& item) { LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); - if(landmark == NULL) + if(landmark == nullptr) { LLFloaterReg::showInstance("add_landmark"); } diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp index d8d6bcf5fd..155e39923c 100644 --- a/indra/newview/llpanelvoicedevicesettings.cpp +++ b/indra/newview/llpanelvoicedevicesettings.cpp @@ -47,8 +47,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/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp index a0129b2cb1..fd6b2af730 100644 --- a/indra/newview/llpanelvoiceeffect.cpp +++ b/indra/newview/llpanelvoiceeffect.cpp @@ -40,7 +40,7 @@ static LLPanelInjector 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/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 5916163f60..472ad2fcb5 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -94,8 +94,8 @@ bool LLPanelVolume::postBuild() { // Flexible Objects Parameters { - childSetCommitCallback("Animated Mesh Checkbox Ctrl", boost::bind(&LLPanelVolume::onCommitAnimatedMeshCheckbox, this, _1, _2), NULL); - childSetCommitCallback("Flexible1D Checkbox Ctrl", boost::bind(&LLPanelVolume::onCommitIsFlexible, this, _1, _2), NULL); + childSetCommitCallback("Animated Mesh Checkbox Ctrl", boost::bind(&LLPanelVolume::onCommitAnimatedMeshCheckbox, this, _1, _2), nullptr); + childSetCommitCallback("Flexible1D Checkbox Ctrl", boost::bind(&LLPanelVolume::onCommitIsFlexible, this, _1, _2), nullptr); childSetCommitCallback("FlexNumSections",onCommitFlexible,this); getChild("FlexNumSections")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexGravity",onCommitFlexible,this); @@ -256,12 +256,12 @@ void LLPanelVolume::getState( ) } } - LLVOVolume *volobjp = NULL; + LLVOVolume *volobjp = nullptr; if ( objectp && (objectp->getPCode() == LL_PCODE_VOLUME)) { volobjp = (LLVOVolume *)objectp; } - LLVOVolume *root_volobjp = NULL; + LLVOVolume *root_volobjp = nullptr; if (root_objectp && (root_objectp->getPCode() == LL_PCODE_VOLUME)) { root_volobjp = (LLVOVolume *)root_objectp; @@ -272,7 +272,7 @@ void LLPanelVolume::getState( ) //forfeit focus if (gFocusMgr.childHasKeyboardFocus(this)) { - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } // Disable all text input fields @@ -670,7 +670,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; @@ -692,12 +692,12 @@ void LLPanelVolume::refresh() getState(); if (mObject.notNull() && mObject->isDead()) { - mObject = NULL; + mObject = nullptr; } if (mRootObject.notNull() && mRootObject->isDead()) { - mRootObject = NULL; + mRootObject = nullptr; } bool enable_mesh = false; @@ -1034,7 +1034,7 @@ void LLPanelVolume::onCopyFeatures() LLSD clipboard; - LLVOVolume *volobjp = NULL; + LLVOVolume *volobjp = nullptr; if (objectp && (objectp->getPCode() == LL_PCODE_VOLUME)) { volobjp = (LLVOVolume *)objectp; @@ -1095,7 +1095,7 @@ void LLPanelVolume::onPasteFeatures() LLSD &clipboard = mClipboardParams["features"]; - LLVOVolume *volobjp = NULL; + LLVOVolume *volobjp = nullptr; if (objectp && (objectp->getPCode() == LL_PCODE_VOLUME)) { volobjp = (LLVOVolume *)objectp; @@ -1186,7 +1186,7 @@ void LLPanelVolume::onCopyLight() LLSD clipboard; - LLVOVolume *volobjp = NULL; + LLVOVolume *volobjp = nullptr; if (objectp && (objectp->getPCode() == LL_PCODE_VOLUME)) { volobjp = (LLVOVolume *)objectp; @@ -1240,7 +1240,7 @@ void LLPanelVolume::onPasteLight() LLSD &clipboard = mClipboardParams["light"]; - LLVOVolume *volobjp = NULL; + LLVOVolume *volobjp = nullptr; if (objectp && (objectp->getPCode() == LL_PCODE_VOLUME)) { volobjp = (LLVOVolume *)objectp; diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 4fcce50df1..314e6f7154 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -60,7 +60,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; @@ -223,7 +223,7 @@ static LLPanelInjector t_panel_wearing("panel_wearing"); LLPanelWearing::LLPanelWearing() : LLPanelAppearanceTab() - , mCOFItemsList(NULL) + , mCOFItemsList(nullptr) , mIsInitialized(false) , mAttachmentsChangedConnection() { @@ -540,7 +540,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 @@ -577,7 +577,7 @@ LLToggleableMenu* LLPanelWearing::getGearMenu() LLToggleableMenu* LLPanelWearing::getSortMenu() { - return NULL; + return nullptr; } void LLPanelWearing::onRemoveItem() @@ -607,7 +607,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/llparcelselection.cpp b/indra/newview/llparcelselection.cpp index 3bfa886bfe..6d8d70b397 100644 --- a/indra/newview/llparcelselection.cpp +++ b/indra/newview/llparcelselection.cpp @@ -35,7 +35,7 @@ // LLParcelSelection // LLParcelSelection::LLParcelSelection() : - mParcel(NULL), + mParcel(nullptr), mSelectedMultipleOwners(false), mWholeParcelSelected(false), mSelectedSelfCount(0), diff --git a/indra/newview/llparcelselection.h b/indra/newview/llparcelselection.h index f1b20572fc..191f0c411a 100644 --- a/indra/newview/llparcelselection.h +++ b/indra/newview/llparcelselection.h @@ -44,7 +44,7 @@ class LLParcelSelection : public LLRefCount LLParcelSelection(LLParcel* parcel); LLParcelSelection(); - // this can return NULL at any time, as parcel selection + // this can return nullptr at any time, as parcel selection // might have been invalidated. LLParcel* getParcel() { return mParcel; } diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index c6a88dbada..34d9730239 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -202,7 +202,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/llpatchvertexarray.cpp b/indra/newview/llpatchvertexarray.cpp index 846f3167fd..3d6cdfd1e8 100644 --- a/indra/newview/llpatchvertexarray.cpp +++ b/indra/newview/llpatchvertexarray.cpp @@ -35,14 +35,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); } @@ -122,7 +122,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 412e25a7b1..09873a0c87 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -156,7 +156,7 @@ LLPathfindingManager::~LLPathfindingManager() void LLPathfindingManager::initSystem() { - if (LLPathingLib::getInstance() == NULL) + if (LLPathingLib::getInstance() == nullptr) { LLPathingLib::initSystem(); } @@ -164,7 +164,7 @@ void LLPathfindingManager::initSystem() void LLPathfindingManager::quitSystem() { - if (LLPathingLib::getInstance() != NULL) + if (LLPathingLib::getInstance() != nullptr) { LLPathingLib::quitSystem(); } @@ -172,7 +172,7 @@ void LLPathfindingManager::quitSystem() bool LLPathfindingManager::isPathfindingViewEnabled() const { - return (LLPathingLib::getInstance() != NULL); + return (LLPathingLib::getInstance() != nullptr); } bool LLPathfindingManager::isPathfindingEnabledForCurrentRegion() const @@ -189,7 +189,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) @@ -202,7 +202,7 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion, b { LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion); - if (pRegion == NULL) + if (pRegion == nullptr) { navMeshPtr->handleNavMeshNotEnabled(); } @@ -232,7 +232,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); } @@ -278,7 +278,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); } @@ -324,7 +324,7 @@ void LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, object_ LLViewerRegion *currentRegion = getCurrentRegion(); - if (currentRegion == NULL) + if (currentRegion == nullptr) { pCharactersCallback(pRequestId, kRequestNotEnabled, emptyCharacterListPtr); } @@ -359,7 +359,7 @@ void LLPathfindingManager::requestGetAgentState() { LLViewerRegion *currentRegion = getCurrentRegion(); - if (currentRegion == NULL) + if (currentRegion == nullptr) { mAgentStateSignal(false); } @@ -388,7 +388,7 @@ void LLPathfindingManager::requestRebakeNavMesh(rebake_navmesh_callback_t pRebak { LLViewerRegion *currentRegion = getCurrentRegion(); - if (currentRegion == NULL) + if (currentRegion == nullptr) { pRebakeNavMeshCallback(false); } @@ -410,7 +410,7 @@ void LLPathfindingManager::handleDeferredGetAgentStateForRegion(const LLUUID &pR { LLViewerRegion *currentRegion = getCurrentRegion(); - if ((currentRegion != NULL) && (currentRegion->getRegionID() == pRegionUUID)) + if ((currentRegion != nullptr) && (currentRegion->getRegionID() == pRegionUUID)) { requestGetAgentState(); } @@ -420,7 +420,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); } @@ -430,7 +430,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); } @@ -440,7 +440,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); } @@ -461,7 +461,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); @@ -731,7 +731,7 @@ LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(const LLUUID & LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion *pRegion) { LLUUID regionUUID; - if (pRegion != NULL) + if (pRegion != nullptr) { regionUUID = pRegion->getRegionID(); } @@ -788,7 +788,7 @@ std::string LLPathfindingManager::getCapabilityURLForRegion(LLViewerRegion *pReg { std::string capabilityURL(""); - if (pRegion != NULL) + if (pRegion != nullptr) { capabilityURL = pRegion->getCapability(pCapabilityName); } @@ -796,7 +796,7 @@ std::string LLPathfindingManager::getCapabilityURLForRegion(LLViewerRegion *pReg if (capabilityURL.empty()) { LL_WARNS() << "cannot find capability '" << pCapabilityName << "' for current region '" - << ((pRegion != NULL) ? pRegion->getName() : "") << "'" << LL_ENDL; + << ((pRegion != nullptr) ? pRegion->getName() : "") << "'" << LL_ENDL; } return capabilityURL; diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp index e9ef170176..48683e8e50 100644 --- a/indra/newview/llpathfindingnavmeshzone.cpp +++ b/indra/newview/llpathfindingnavmeshzone.cpp @@ -95,7 +95,7 @@ void LLPathfindingNavMeshZone::disable() void LLPathfindingNavMeshZone::refresh() { - if (LLPathingLib::getInstance() != NULL) + if (LLPathingLib::getInstance() != nullptr) { LLPathingLib::getInstance()->cleanupResidual(); } @@ -268,8 +268,8 @@ void LLPathfindingNavMeshZone::updateStatus() if ((mNavMeshZoneRequestStatus != kNavMeshZoneRequestCompleted) && (zoneRequestStatus == kNavMeshZoneRequestCompleted)) { - llassert(LLPathingLib::getInstance() != NULL); - if (LLPathingLib::getInstance() != NULL) + llassert(LLPathingLib::getInstance() != nullptr); + if (LLPathingLib::getInstance() != nullptr) { LLPathingLib::getInstance()->processNavMeshData(); } @@ -304,7 +304,7 @@ void LLPathfindingNavMeshZone::NavMeshLocation::enable() clear(); LLViewerRegion *region = getRegion(); - if (region == NULL) + if (region == nullptr) { mRegionUUID.setNull(); } @@ -319,7 +319,7 @@ void LLPathfindingNavMeshZone::NavMeshLocation::refresh() { LLViewerRegion *region = getRegion(); - if (region == NULL) + if (region == nullptr) { llassert(mRegionUUID.isNull()); LLPathfindingNavMeshStatus newNavMeshStatus(mRegionUUID); @@ -358,8 +358,8 @@ void LLPathfindingNavMeshZone::NavMeshLocation::handleNavMesh(LLPathfindingNavMe llassert(!pNavMeshData.empty()); mHasNavMesh = true; mNavMeshVersion = pNavMeshStatus.getVersion(); - llassert(LLPathingLib::getInstance() != NULL); - if (LLPathingLib::getInstance() != NULL) + llassert(LLPathingLib::getInstance() != nullptr); + if (LLPathingLib::getInstance() != nullptr) { LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD(pNavMeshData, mDirection); } @@ -383,10 +383,10 @@ void LLPathfindingNavMeshZone::NavMeshLocation::clear() LLViewerRegion *LLPathfindingNavMeshZone::NavMeshLocation::getRegion() const { - LLViewerRegion *region = NULL; + LLViewerRegion *region = nullptr; LLViewerRegion *currentRegion = gAgent.getRegion(); - if (currentRegion != NULL) + if (currentRegion != nullptr) { if (mDirection == CENTER_REGION) { diff --git a/indra/newview/llpathfindingobjectlist.cpp b/indra/newview/llpathfindingobjectlist.cpp index 0ea782649c..a1ffafaca9 100644 --- a/indra/newview/llpathfindingobjectlist.cpp +++ b/indra/newview/llpathfindingobjectlist.cpp @@ -64,7 +64,7 @@ void LLPathfindingObjectList::clear() void LLPathfindingObjectList::update(LLPathfindingObjectPtr pUpdateObjectPtr) { - if (pUpdateObjectPtr != NULL) + if (pUpdateObjectPtr != nullptr) { std::string updateObjectId = pUpdateObjectPtr->getUUID().asString(); @@ -82,7 +82,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/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index 57f4aefadf..76e4036042 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -187,11 +187,11 @@ LLPathfindingPathTool::EPathStatus LLPathfindingPathTool::getPathStatus() const { EPathStatus status = kPathStatusUnknown; - if (LLPathingLib::getInstance() == NULL) + if (LLPathingLib::getInstance() == nullptr) { status = kPathStatusNotImplemented; } - else if ((gAgent.getRegion() != NULL) && !gAgent.getRegion()->capabilitiesReceived()) + else if ((gAgent.getRegion() != nullptr) && !gAgent.getRegion()->capabilitiesReceived()) { status = kPathStatusUnknown; } @@ -444,7 +444,7 @@ void LLPathfindingPathTool::clearTemp() void LLPathfindingPathTool::computeFinalPath() { mPathResult = LLPathingLib::LLPL_NO_PATH; - if (LLPathingLib::getInstance() != NULL) + if (LLPathingLib::getInstance() != nullptr) { mPathResult = LLPathingLib::getInstance()->generatePath(mFinalPathData); } @@ -454,7 +454,7 @@ void LLPathfindingPathTool::computeFinalPath() void LLPathfindingPathTool::computeTempPath() { mPathResult = LLPathingLib::LLPL_NO_PATH; - if (LLPathingLib::getInstance() != NULL) + if (LLPathingLib::getInstance() != nullptr) { mPathResult = LLPathingLib::getInstance()->generatePath(mTempPathData); } diff --git a/indra/newview/llperfstats.h b/indra/newview/llperfstats.h index 1a2098ec7e..1c069efae0 100644 --- a/indra/newview/llperfstats.h +++ b/indra/newview/llperfstats.h @@ -240,7 +240,7 @@ namespace LLPerfStats { LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS; // LL_INFOS("perfstats") << "processing update:" << LL_ENDL; - // Note: nullptr is used as the key for global stats + // Note: NULL is used as the key for global stats if (upd.statType == StatType_t::RENDER_DONE && upd.objType == ObjType_t::OT_GENERAL && upd.time == 0) { diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index e5c84728fe..84e86fd06f 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -104,7 +104,7 @@ class LLPhysicsMotion mParamDriverName(param_driver_name), mJointName(joint_name), mMotionDirectionVec(motion_direction_vec), - mParamDriver(NULL), + mParamDriver(nullptr), mParamControllers(controllers), mCharacter(character), mLastTime(0), @@ -116,7 +116,7 @@ class LLPhysicsMotion 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"; } @@ -700,7 +700,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.0f-lod_factor); const F32 pixel_area = sqrtf(mCharacter->getPixelArea()); - const bool is_self = (dynamic_cast(mCharacter) != NULL); + const bool is_self = (dynamic_cast(mCharacter) != nullptr); if ((pixel_area > area_for_this_setting) || is_self) { const F32 position_diff_local = llabs(mPositionLastUpdate_local-position_new_local_clamped); @@ -727,7 +727,7 @@ bool LLPhysicsMotion::onUpdate(F32 time) /* // Write out debugging info into a spreadsheet. - if (mFileWrite != NULL && is_self) + if (mFileWrite != nullptr && is_self) { fprintf(mFileWrite,"%f\t%f\t%f \t\t%f \t\t%f\t%f\t%f\t \t\t%f\t%f\t%f\t%f\t%f \t\t%f\t%f\t%f\n", position_new_local, diff --git a/indra/newview/llphysicsshapebuilderutil.cpp b/indra/newview/llphysicsshapebuilderutil.cpp index eb0df1194e..31d23266f3 100644 --- a/indra/newview/llphysicsshapebuilderutil.cpp +++ b/indra/newview/llphysicsshapebuilderutil.cpp @@ -45,7 +45,7 @@ bool LLPhysicsVolumeParams::hasDecomposition() const LLModel::Decomposition* decomp = gMeshRepo.getDecomposition(mesh_id); - return decomp != NULL; + return decomp != nullptr; } /* static */ diff --git a/indra/newview/llplacesinventorybridge.cpp b/indra/newview/llplacesinventorybridge.cpp index 2d207a9eee..47677227c5 100644 --- a/indra/newview/llplacesinventorybridge.cpp +++ b/indra/newview/llplacesinventorybridge.cpp @@ -38,7 +38,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; } @@ -92,7 +92,7 @@ void LLPlacesFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (inv_panel) { LLFolderViewFolder* folder = dynamic_cast(inv_panel->getItemByID(mUUID)); - is_open = (NULL != folder) && folder->isOpen(); + is_open = (nullptr != folder) && folder->isOpen(); } // collect all items' names @@ -134,7 +134,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) { @@ -155,7 +155,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/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp index 03be8a4b2c..eb6996cb27 100644 --- a/indra/newview/llplacesinventorypanel.cpp +++ b/indra/newview/llplacesinventorypanel.cpp @@ -44,7 +44,7 @@ static const LLPlacesInventoryBridgeBuilder PLACES_INVENTORY_BUILDER; LLPlacesInventoryPanel::LLPlacesInventoryPanel(const Params& p) : LLAssetFilteredInventoryPanel(p), - mSavedFolderState(NULL) + mSavedFolderState(nullptr) { mInvFVBridgeBuilder = &PLACES_INVENTORY_BUILDER; mSavedFolderState = new LLSaveFolderState(); @@ -72,7 +72,7 @@ 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; @@ -80,7 +80,7 @@ LLFolderView * LLPlacesInventoryPanel::createFolderRoot(LLUUID root_id ) p.allow_drag = mAllowDrag; 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/llpreview.cpp b/indra/newview/llpreview.cpp index 3f3e1766b4..d70dcfafd4 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -57,7 +57,7 @@ LLPreview::LLPreview(const LLSD& key) : LLFloater(key), mItemUUID(key.has("itemid") ? key.get("itemid").asUUID() : key.asUUID()), mObjectUUID(), // set later by setObjectID() - mCopyToInvBtn( NULL ), + mCopyToInvBtn( nullptr ), mForceClose(false), mUserResized(false), mCloseAfterSave(false), @@ -108,7 +108,7 @@ void LLPreview::setItem( LLInventoryItem* item ) const LLInventoryItem *LLPreview::getItem() const { - const LLInventoryItem *item = NULL; + const LLInventoryItem *item = nullptr; if (mItem.notNull()) { item = mItem; @@ -327,7 +327,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); @@ -414,7 +414,7 @@ void LLPreview::onBtnCopyToInv(void* userdata) } else { - LLPointer cb = NULL; + LLPointer cb = nullptr; copy_inventory_item( gAgent.getID(), item->getPermissions().getOwner(), @@ -542,7 +542,7 @@ void LLMultiPreview::tabOpen(LLFloater* opened_floater, bool from_click) void LLPreview::setAssetId(const LLUUID& asset_id) { const LLViewerInventoryItem* item = dynamic_cast(getItem()); - if(NULL == item) + if(nullptr == item) { return; } @@ -559,7 +559,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/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index 7d11c09738..c1c1cf9f6e 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -214,7 +214,7 @@ void LLPreviewAnim::showAdvanced() LLRect rect = getRect(); reshape(rect.getWidth(), rect.getHeight() + pAdvancedStatsTextBox->getRect().getHeight() + ADVANCED_VPAD, false); - LLMotion *motion = NULL; + LLMotion *motion = nullptr; const LLInventoryItem* item = getItem(); if (item) { diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 66dcd2f7ba..703f6881a0 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -99,7 +99,7 @@ LLPreviewGesture* LLPreviewGesture::show(const LLUUID& item_id, const LLUUID& ob LLPreviewGesture* preview = LLFloaterReg::showTypedInstance("preview_gesture", LLSD(item_id), TAKE_FOCUS_YES); if (!preview) { - return NULL; + return nullptr; } preview->setObjectID(object_id); @@ -183,7 +183,7 @@ bool LLPreviewGesture::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, } else if (drop) { - LLScrollListItem* line = NULL; + LLScrollListItem* line = nullptr; if (cargo_type == DAD_ANIMATION) { line = addStep( STEP_ANIMATION ); @@ -296,23 +296,23 @@ bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const L LLPreviewGesture::LLPreviewGesture(const LLSD& key) : LLPreview(key), - mTriggerEditor(NULL), - mModifierCombo(NULL), - mKeyCombo(NULL), - mLibraryList(NULL), - mAddBtn(NULL), - mUpBtn(NULL), - mDownBtn(NULL), - mDeleteBtn(NULL), - mStepList(NULL), - mOptionsText(NULL), - mAnimationRadio(NULL), - mAnimationCombo(NULL), - mSoundCombo(NULL), - mChatEditor(NULL), - mSaveBtn(NULL), - mPreviewBtn(NULL), - mPreviewGesture(NULL), + mTriggerEditor(nullptr), + mModifierCombo(nullptr), + mKeyCombo(nullptr), + mLibraryList(nullptr), + mAddBtn(nullptr), + mUpBtn(nullptr), + mDownBtn(nullptr), + mDeleteBtn(nullptr), + mStepList(nullptr), + mOptionsText(nullptr), + mAnimationRadio(nullptr), + mAnimationCombo(nullptr), + mSoundCombo(nullptr), + mChatEditor(nullptr), + mSaveBtn(nullptr), + mPreviewBtn(nullptr), + mPreviewGesture(nullptr), mDirty(false) { NONE_LABEL = LLTrans::getString("---"); @@ -331,7 +331,7 @@ LLPreviewGesture::~LLPreviewGesture() LLScrollListItem* item = *data_itor; LLGestureStep* step = (LLGestureStep*)item->getUserdata(); delete step; - step = NULL; + step = nullptr; } } @@ -677,12 +677,12 @@ void LLPreviewGesture::refresh() bool have_replace = !replace.empty(); LLScrollListItem* library_item = mLibraryList->getFirstSelected(); - bool have_library = (library_item != NULL); + bool have_library = (library_item != nullptr); LLScrollListItem* step_item = mStepList->getFirstSelected(); S32 step_index = mStepList->getFirstSelectedIndex(); S32 step_count = mStepList->getItemCount(); - bool have_step = (step_item != NULL); + bool have_step = (step_item != nullptr); mReplaceText->setEnabled(have_trigger || have_replace); mReplaceEditor->setEnabled(have_trigger || have_replace); @@ -883,7 +883,7 @@ void LLPreviewGesture::onLoadComplete(const LLUUID& asset_uuid, } delete gesture; - gesture = NULL; + gesture = nullptr; self->mAssetStatus = PREVIEW_ASSET_LOADED; } @@ -904,7 +904,7 @@ void LLPreviewGesture::onLoadComplete(const LLUUID& asset_uuid, } } delete item_idp; - item_idp = NULL; + item_idp = nullptr; } @@ -955,7 +955,7 @@ void LLPreviewGesture::loadUIFromGesture(LLMultiGesture* gesture) { LLGestureStep* step = gesture->mSteps[i]; - LLGestureStep* new_step = NULL; + LLGestureStep* new_step = nullptr; switch(step->getType()) { @@ -1074,14 +1074,14 @@ void LLPreviewGesture::saveIfNeeded() LLNotificationsUtil::add("GestureSaveFailedTooManySteps"); delete gesture; - gesture = NULL; + gesture = nullptr; return; } else if (!ok) { LLNotificationsUtil::add("GestureSaveFailedTryAgain"); delete gesture; - gesture = NULL; + gesture = nullptr; return; } @@ -1171,7 +1171,7 @@ void LLPreviewGesture::saveIfNeeded() { // we're done with this gesture delete gesture; - gesture = NULL; + gesture = nullptr; } mDirty = false; @@ -1218,7 +1218,7 @@ void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data, { // Saving into in-world object inventory LLViewerObject* object = gObjectList.findObject(info->mObjectUUID); - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; if(object) { item = (LLViewerInventoryItem*)object->getInventoryObject(info->mItemUUID); @@ -1252,7 +1252,7 @@ void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data, LLNotificationsUtil::add("GestureSaveFailedReason", args); } delete info; - info = NULL; + info = nullptr; } @@ -1602,7 +1602,7 @@ LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type ) { // Order of enum EStepType MUST match the library_list element in floater_preview_gesture.xml - LLGestureStep* step = NULL; + LLGestureStep* step = nullptr; switch( step_type) { case STEP_ANIMATION: @@ -1620,7 +1620,7 @@ LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type ) break; default: LL_ERRS() << "Unknown step type: " << (S32)step_type << LL_ENDL; - return NULL; + return nullptr; } @@ -1728,7 +1728,7 @@ void LLPreviewGesture::onClickDelete(void* data) { LLGestureStep* step = (LLGestureStep*)item->getUserdata(); delete step; - step = NULL; + step = nullptr; self->mStepList->deleteSingleItem(selected_index); @@ -1808,7 +1808,7 @@ void LLPreviewGesture::onDonePreview(LLMultiGesture* gesture, void* data) self->mPreviewBtn->setLabel(self->getString("preview_txt")); delete self->mPreviewGesture; - self->mPreviewGesture = NULL; + self->mPreviewGesture = nullptr; self->refresh(); } diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 9a991727b2..1bda089493 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -321,7 +321,7 @@ void LLPreviewNotecard::loadAsset() { // It's a notecard in object's inventory and we failed to get it because inventory is not up to date. // Subscribe for callback and retry at inventoryChanged() - registerVOInventoryListener(objectp, NULL); //removes previous listener + registerVOInventoryListener(objectp, nullptr); //removes previous listener if (objectp->isInventoryDirty()) { @@ -627,7 +627,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); @@ -712,7 +712,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); @@ -725,7 +725,7 @@ bool LLPreviewNotecard::handleConfirmDeleteDialog(const LLSD& notification, cons if(object) { LLViewerInventoryItem* item = dynamic_cast(object->getInventoryObject(mItemUUID)); - if (item != NULL) + if (item != nullptr) { object->removeInventory(mItemUUID); } @@ -790,7 +790,7 @@ bool LLPreviewNotecard::onExternalChange(const std::string& filename) } // Disable sync to avoid recursive load->save->load calls. - saveIfNeeded(NULL, false); + saveIfNeeded(nullptr, false); return true; } diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index be3c804f9b..36cdc92ace 100644 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -86,7 +86,7 @@ class LLPreviewNotecard : public LLPreview, public LLVOInventoryListener void updateTitleButtons() override; void loadAsset() override; - bool saveIfNeeded(LLInventoryItem* copyitem = NULL, bool sync = true); + bool saveIfNeeded(LLInventoryItem* copyitem = nullptr, bool sync = true); void deleteNotecard(); diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index c2aa4925bd..a32e954940 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -184,12 +184,12 @@ class LLFloaterScriptSearch : public LLFloater void onSearchBoxCommit(); }; -LLFloaterScriptSearch* LLFloaterScriptSearch::sInstance = NULL; +LLFloaterScriptSearch* LLFloaterScriptSearch::sInstance = nullptr; LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core) : LLFloater(LLSD()), - mSearchBox(NULL), - mReplaceBox(NULL), + mSearchBox(nullptr), + mReplaceBox(nullptr), mEditorCore(editor_core) { buildFromFile("floater_script_search.xml"); @@ -251,7 +251,7 @@ void LLFloaterScriptSearch::show(LLScriptEdCore* editor_core) LLFloaterScriptSearch::~LLFloaterScriptSearch() { - sInstance = NULL; + sInstance = nullptr; } // static @@ -382,16 +382,16 @@ LLScriptEdCore::LLScriptEdCore( : LLPanel(), mSampleText(sample), - mEditor( NULL ), + mEditor( nullptr ), mLoadCallback( load_callback ), mSaveCallback( save_callback ), mSearchReplaceCallback( search_replace_callback ), mUserdata( userdata ), mForceClose( false ), - mLastHelpToken(NULL), + mLastHelpToken(nullptr), mLiveHelpHistorySize(0), mEnableSave(false), - mLiveFile(NULL), + mLiveFile(nullptr), mLive(live), mContainer(container), mHasScriptData(false), @@ -402,7 +402,7 @@ LLScriptEdCore::LLScriptEdCore( setBorderVisible(false); setXMLFilename("panel_script_ed.xml"); - llassert_always(mContainer != NULL); + llassert_always(mContainer != nullptr); } LLScriptEdCore::~LLScriptEdCore() @@ -755,7 +755,7 @@ void LLScriptEdCore::updateDynamicHelp(bool immediate) return; } - LLTextSegmentPtr segment = NULL; + LLTextSegmentPtr segment = nullptr; std::vector selected_segments; mEditor->getSelectedSegments(selected_segments); LLKeywordToken* token; @@ -973,7 +973,7 @@ void LLScriptEdCore::onBtnDynamicHelp() help_combo->sortByName(); // re-initialize help variables - mLastHelpToken = NULL; + mLastHelpToken = nullptr; mLiveHelpHandle = live_help_floater->getHandle(); mLiveHelpHistorySize = 0; } @@ -1024,7 +1024,7 @@ void LLScriptEdCore::onCheckLock(LLUICtrl* ctrl, void* userdata) // clear out token any time we lock the frame, so we will refresh web page immediately when unlocked gSavedSettings.setBOOL("ScriptHelpFollowsCursor", ctrl->getValue().asBoolean()); - corep->mLastHelpToken = NULL; + corep->mLastHelpToken = nullptr; } // static @@ -1218,7 +1218,7 @@ void LLScriptEdCore::deleteBridges() { eandc = mBridges.at(i); delete eandc; - mBridges[i] = NULL; + mBridges[i] = nullptr; } mBridges.clear(); } @@ -1503,7 +1503,7 @@ void LLLiveLSLEditor::receiveExperienceIds(LLSD result, LLHandlesetBoostLevel(mImageOldBoostLevel); - mImage = NULL; + mImage = nullptr; } } diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 2c09943b83..e56bc6adbd 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -53,7 +53,7 @@ #include "lluictrlfactory.h" #include "llpanellogin.h" -LLProgressView* LLProgressView::sInstance = NULL; +LLProgressView* LLProgressView::sInstance = nullptr; S32 gStartImageWidth = 1; S32 gStartImageHeight = 1; @@ -65,7 +65,7 @@ static LLPanelInjector r("progress_view"); LLProgressView::LLProgressView() : LLPanel(), mPercentDone( 0.f ), - mMediaCtrl( NULL ), + mMediaCtrl( nullptr ), mMouseDownInActiveArea( false ), mUpdateEvents("LLProgressView"), mFadeToWorldTimer(), @@ -93,7 +93,7 @@ bool LLProgressView::postBuild() LLViewerMedia::getInstance()->setOnlyAudibleMediaTextureID(mMediaCtrl->getTextureID()); mCancelBtn = getChild("cancel_btn"); - mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL ); + mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, nullptr ); mLayoutPanel4 = getChild("panel4"); mLayoutPanel4RectInitial = mLayoutPanel4->getRect(); @@ -122,12 +122,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); } @@ -334,7 +334,7 @@ void LLProgressView::initStartTexture(S32 location_id, bool is_in_production) { if (gStartTexture.notNull()) { - gStartTexture = NULL; + gStartTexture = nullptr; LL_INFOS("AppInit") << "re-initializing start screen" << LL_ENDL; } @@ -376,7 +376,7 @@ void LLProgressView::initStartTexture(S32 location_id, bool is_in_production) else if (!start_image_frmted->load(temp_str)) { LL_WARNS("AppInit") << "Bitmap load failed" << LL_ENDL; - gStartTexture = NULL; + gStartTexture = nullptr; } else { @@ -387,7 +387,7 @@ void LLProgressView::initStartTexture(S32 location_id, bool is_in_production) if (!start_image_frmted->decode(raw, 0.0f)) { LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL; - gStartTexture = NULL; + gStartTexture = nullptr; } else { @@ -412,7 +412,7 @@ void LLProgressView::initTextures(S32 location_id, bool is_in_production) void LLProgressView::releaseTextures() { - gStartTexture = NULL; + gStartTexture = nullptr; } void LLProgressView::setCancelButtonVisible(bool b, const std::string& label) @@ -446,7 +446,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/llrecentpeople.cpp b/indra/newview/llrecentpeople.cpp index c698139c6d..8c4fbf5da5 100644 --- a/indra/newview/llrecentpeople.cpp +++ b/indra/newview/llrecentpeople.cpp @@ -38,7 +38,7 @@ bool LLRecentPeople::add(const LLUUID& id, const 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/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index c6fa64753c..fa8493c957 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -64,7 +64,7 @@ void load_exr(const std::string& filename) float* out; // width * height * RGBA int width; int height; - const char* err = NULL; // or nullptr in C++11 + const char* err = nullptr; int ret = LoadEXRWithLayer(&out, &width, &height, filename.c_str(), /* layername */ nullptr, &err); if (ret == TINYEXR_SUCCESS) diff --git a/indra/newview/llregioninfomodel.cpp b/indra/newview/llregioninfomodel.cpp index c15a5559aa..95ec4639ab 100644 --- a/indra/newview/llregioninfomodel.cpp +++ b/indra/newview/llregioninfomodel.cpp @@ -236,7 +236,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 ea774a0e55..55c4960820 100644 --- a/indra/newview/llregionposition.cpp +++ b/indra/newview/llregionposition.cpp @@ -34,7 +34,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 d46870c062..b58fc83737 100644 --- a/indra/newview/llregionposition.h +++ b/indra/newview/llregionposition.h @@ -54,7 +54,7 @@ class LLRegionPosition 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/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index 7498c2d524..6a0a48f8bd 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -42,7 +42,7 @@ #include "llviewerparcelmgr.h" #include "llviewerpartsim.h" -LLSceneMonitorView* gSceneMonitorView = NULL; +LLSceneMonitorView* gSceneMonitorView = nullptr; // //The procedures of monitoring when the scene finishes loading visually, @@ -58,7 +58,7 @@ LLSceneMonitorView* gSceneMonitorView = NULL; LLSceneMonitor::LLSceneMonitor() : mEnabled(false), - mDiff(NULL), + mDiff(nullptr), mDiffResult(0.f), mDiffTolerance(0.1f), mDiffState(WAITING_FOR_NEXT_DIFF), @@ -66,8 +66,8 @@ LLSceneMonitor::LLSceneMonitor() : mQueryObject(0), mDiffPixelRatio(0.5f) { - mFrames[0] = NULL; - mFrames[1] = NULL; + mFrames[0] = nullptr; + mFrames[1] = nullptr; } LLSceneMonitor::~LLSceneMonitor() @@ -75,7 +75,7 @@ LLSceneMonitor::~LLSceneMonitor() mDiffState = VIEWER_QUITTING; reset(); - mDitheringTexture = NULL; + mDitheringTexture = nullptr; } void LLSceneMonitor::reset() @@ -84,9 +84,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(); @@ -169,7 +169,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(); @@ -436,7 +436,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(); @@ -457,7 +457,7 @@ void LLSceneMonitor::calcDiffAggregate() gOneTextureFilterProgram.unbind(); - if(cur_shader != NULL) + if(cur_shader != nullptr) { cur_shader->bind(); } diff --git a/indra/newview/llsceneview.cpp b/indra/newview/llsceneview.cpp index a61474636a..2ccb8e5f37 100644 --- a/indra/newview/llsceneview.cpp +++ b/indra/newview/llsceneview.cpp @@ -35,7 +35,7 @@ #include "llvolumemgr.h" #include "llmeshrepository.h" -LLSceneView* gSceneView = NULL; +LLSceneView* gSceneView = nullptr; //borrow this helper function from llfasttimerview.cpp template diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 44c2a8fdaf..f3dfdcab48 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -53,12 +53,12 @@ LLRect LLScreenChannelBase::getChannelRect() { LL_PROFILE_ZONE_SCOPED; - if (mFloaterSnapRegion == NULL) + if (mFloaterSnapRegion == nullptr) { mFloaterSnapRegion = gViewerWindow->getFloaterSnapRegion(); } - if (mChicletRegion == NULL) + if (mChicletRegion == nullptr) { mChicletRegion = gViewerWindow->getChicletContainer(); } @@ -84,14 +84,14 @@ LLScreenChannelBase::LLScreenChannelBase(const Params& p) mToastAlignment(p.toast_align), mCanStoreToasts(true), mHiddenToastsNum(0), - mHoveredToast(NULL), + mHoveredToast(nullptr), mControlHovering(false), mShowToasts(true), mID(p.id), mDisplayToastsAlways(p.display_toasts_always), mChannelAlignment(p.channel_align), - mFloaterSnapRegion(NULL), - mChicletRegion(NULL) + mFloaterSnapRegion(nullptr), + mChicletRegion(nullptr) { mID = p.id; @@ -101,12 +101,12 @@ LLScreenChannelBase::LLScreenChannelBase(const Params& p) bool LLScreenChannelBase::postBuild() { - if (mFloaterSnapRegion == NULL) + if (mFloaterSnapRegion == nullptr) { mFloaterSnapRegion = gViewerWindow->getFloaterSnapRegion(); } - if (mChicletRegion == NULL) + if (mChicletRegion == nullptr) { mChicletRegion = gViewerWindow->getChicletContainer(); } @@ -185,7 +185,7 @@ void LLScreenChannelBase::updateRect() //-------------------------------------------------------------------------- LLScreenChannel::LLScreenChannel(const Params& p) : LLScreenChannelBase(p), - mStartUpToastPanel(NULL) + mStartUpToastPanel(nullptr) { } @@ -290,7 +290,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(); } @@ -347,7 +347,7 @@ void LLScreenChannel::onToastDestroyed(LLToast* toast) // if destroyed toast is hovered - reset hovered if (mHoveredToast == toast) { - mHoveredToast = NULL; + mHoveredToast = nullptr; } } @@ -390,7 +390,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; } } @@ -941,10 +941,10 @@ void LLScreenChannel::onStartUpToastHide() //-------------------------------------------------------------------------- void LLScreenChannel::closeStartUpToast() { - if(mStartUpToastPanel != NULL) + if(mStartUpToastPanel != nullptr) { mStartUpToastPanel->setVisible(false); - mStartUpToastPanel = NULL; + mStartUpToastPanel = nullptr; } } @@ -1012,7 +1012,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); @@ -1097,11 +1097,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; } } @@ -1130,7 +1130,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/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 2fdec14f6d..b3742281cc 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); } @@ -150,7 +150,7 @@ void LLScriptFloater::createForm(const LLUUID& notification_id) } LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); - if(NULL == notification) + if(nullptr == notification) { return; } @@ -216,10 +216,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(getNotificationId()); - if(NULL != chicletp) + if(nullptr != chicletp) { chicletp->setToggleState(false); } @@ -232,11 +232,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(getNotificationId()); // Remove new message icon - if (NULL == chicletp) + if (nullptr == chicletp) { LL_ERRS() << "Dock chiclet for LLScriptFloater doesn't exist" << LL_ENDL; } @@ -280,7 +280,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); } @@ -293,7 +293,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); } @@ -302,13 +302,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(getNotificationId()); - if (NULL == chicletp) + if (nullptr == chicletp) { LL_WARNS() << "Dock chiclet for LLScriptFloater doesn't exist" << LL_ENDL; return; @@ -464,10 +464,10 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) { LLUUID old_id = it->first; // copy LLUUID to prevent use after free when it is erased below LLChicletPanel * chiclet_panelp = LLChicletBar::getInstance()->getChicletPanel(); - if (NULL != chiclet_panelp) + if (nullptr != chiclet_panelp) { LLIMChiclet * chicletp = chiclet_panelp->findChiclet(old_id); - if (NULL != chicletp) + if (nullptr != chicletp) { // Pass the new_message icon state further. set_new_message = chicletp->getShowNewMessagesIcon(); @@ -489,7 +489,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 ) @@ -516,7 +516,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); } @@ -536,7 +536,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); } @@ -739,7 +739,7 @@ void LLScriptFloaterManager::clearScriptNotifications() object_type_map::const_iterator map_it = TYPE_MAP.find(notification->getName()); if (map_it != TYPE_MAP.end() && map_it->second == OBJ_SCRIPT) { - if (notification != NULL && !notification->isCancelled()) + if (notification != nullptr && !notification->isCancelled()) { LLNotificationsUtil::cancel(notification); } diff --git a/indra/newview/llsearchcombobox.cpp b/indra/newview/llsearchcombobox.cpp index 10d9ef81eb..42211e7bd7 100644 --- a/indra/newview/llsearchcombobox.cpp +++ b/indra/newview/llsearchcombobox.cpp @@ -75,7 +75,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 filtered_items; - 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/llsecapi.cpp b/indra/newview/llsecapi.cpp index 85c7451d8a..76627d3e37 100644 --- a/indra/newview/llsecapi.cpp +++ b/indra/newview/llsecapi.cpp @@ -78,7 +78,7 @@ void initializeSecHandler() void clearSecHandler() { - gSecAPIHandler = NULL; + gSecAPIHandler = nullptr; gHandlerMap.clear(); } // start using a given security api handler. If the string is empty @@ -91,7 +91,7 @@ LLPointer getSecHandler(const std::string& handler_type) } else { - return LLPointer(NULL); + return LLPointer(nullptr); } } // register a handler diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h index 14dda20225..0b9bc5c9e1 100644 --- a/indra/newview/llsecapi.h +++ b/indra/newview/llsecapi.h @@ -187,7 +187,7 @@ class LLCertificateVector : public LLThreadSafeRefCount { public: iterator(LLPointer impl) : mImpl(impl) {} - iterator() : mImpl(NULL) {} + iterator() : mImpl(nullptr) {} iterator(const iterator& _iter) {mImpl = _iter.mImpl->clone(); } ~iterator() {} iterator& operator++() { if(mImpl.notNull()) mImpl->seek(true); return *this;} diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index 1e50135e89..962027e438 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -76,13 +76,13 @@ LLBasicCertificate::LLBasicCertificate(const std::string& pem_cert, // BIO_new_mem_buf returns a read only bio, but takes a void* which isn't const // so we need to cast it. BIO * pem_bio = BIO_new_mem_buf((void*)pem_cert.c_str(), static_cast(pem_cert.length())); - if(pem_bio == NULL) + if(pem_bio == nullptr) { LL_WARNS("SECAPI") << "Could not allocate an openssl memory BIO." << LL_ENDL; LLTHROW(LLAllocationCertException(LLSD::emptyMap())); } - mCert = NULL; - PEM_read_bio_X509(pem_bio, &mCert, 0, NULL); + mCert = nullptr; + PEM_read_bio_X509(pem_bio, &mCert, 0, nullptr); BIO_free(pem_bio); if (!mCert) { @@ -109,7 +109,7 @@ LLBasicCertificate::~LLBasicCertificate() if(mCert) { X509_free(mCert); - mCert = NULL; + mCert = nullptr; } } @@ -117,7 +117,7 @@ LLBasicCertificate::~LLBasicCertificate() // retrieve the pem using the openssl functionality std::string LLBasicCertificate::getPem() const { - char * pem_bio_chars = NULL; + char * pem_bio_chars = nullptr; // a BIO is the equivalent of a 'std::stream', and // can be a file, mem stream, whatever. Grab a memory based // BIO for the result @@ -138,7 +138,7 @@ std::string LLBasicCertificate::getPem() const // DER is a binary encoding format for certs... std::vector LLBasicCertificate::getBinary() const { - U8 * der_bio_data = NULL; + U8 * der_bio_data = nullptr; // get a memory bio BIO *der_bio = BIO_new(BIO_s_mem()); if (!der_bio) @@ -175,7 +175,7 @@ LLSD& LLBasicCertificate::_initLLSD() mLLSDInfo[CERT_SUBJECT_NAME_STRING] = cert_string_name_from_X509_NAME(X509_get_subject_name(mCert)); mLLSDInfo[CERT_ISSUER_NAME_STRING] = cert_string_name_from_X509_NAME(X509_get_issuer_name(mCert)); ASN1_INTEGER *sn = X509_get_serialNumber(mCert); - if (sn != NULL) + if (sn != nullptr) { mLLSDInfo[CERT_SERIAL_NUMBER] = cert_string_from_asn1_integer(sn); } @@ -195,7 +195,7 @@ LLSD& LLBasicCertificate::_initLLSD() LLSD _basic_constraints_ext(X509* cert) { LLSD result; - BASIC_CONSTRAINTS *bs = (BASIC_CONSTRAINTS *)X509_get_ext_d2i(cert, NID_basic_constraints, NULL, NULL); + BASIC_CONSTRAINTS *bs = (BASIC_CONSTRAINTS *)X509_get_ext_d2i(cert, NID_basic_constraints, nullptr, nullptr); if(bs) { result = LLSD::emptyMap(); @@ -227,7 +227,7 @@ LLSD _basic_constraints_ext(X509* cert) LLSD _key_usage_ext(X509* cert) { LLSD result; - ASN1_STRING *usage_str = (ASN1_STRING *)X509_get_ext_d2i(cert, NID_key_usage, NULL, NULL); + ASN1_STRING *usage_str = (ASN1_STRING *)X509_get_ext_d2i(cert, NID_key_usage, nullptr, nullptr); if(usage_str) { result = LLSD::emptyArray(); @@ -261,7 +261,7 @@ LLSD _key_usage_ext(X509* cert) LLSD _ext_key_usage_ext(X509* cert) { LLSD result; - EXTENDED_KEY_USAGE *eku = (EXTENDED_KEY_USAGE *)X509_get_ext_d2i(cert, NID_ext_key_usage, NULL, NULL); + EXTENDED_KEY_USAGE *eku = (EXTENDED_KEY_USAGE *)X509_get_ext_d2i(cert, NID_ext_key_usage, nullptr, nullptr); if(eku) { result = LLSD::emptyArray(); @@ -289,7 +289,7 @@ LLSD _ext_key_usage_ext(X509* cert) std::string _subject_key_identifier(X509 *cert) { std::string result; - ASN1_OCTET_STRING *skeyid = (ASN1_OCTET_STRING *)X509_get_ext_d2i(cert, NID_subject_key_identifier, NULL, NULL); + ASN1_OCTET_STRING *skeyid = (ASN1_OCTET_STRING *)X509_get_ext_d2i(cert, NID_subject_key_identifier, nullptr, nullptr); if(skeyid) { result = cert_string_from_octet_string(skeyid); @@ -302,7 +302,7 @@ std::string _subject_key_identifier(X509 *cert) LLSD _authority_key_identifier(X509* cert) { LLSD result; - AUTHORITY_KEYID *akeyid = (AUTHORITY_KEYID *)X509_get_ext_d2i(cert, NID_authority_key_identifier, NULL, NULL); + AUTHORITY_KEYID *akeyid = (AUTHORITY_KEYID *)X509_get_ext_d2i(cert, NID_authority_key_identifier, nullptr, nullptr); if(akeyid) { result = LLSD::emptyMap(); @@ -333,7 +333,7 @@ X509* LLBasicCertificate::getOpenSSLX509() const // name of the cert. std::string cert_string_name_from_X509_NAME(X509_NAME* name) { - char * name_bio_chars = NULL; + char * name_bio_chars = nullptr; // get a memory bio BIO *name_bio = BIO_new(BIO_s_mem()); // stream the name into the bio. The name will be in the 'short name' format @@ -375,7 +375,7 @@ LLSD cert_name_from_X509_NAME(X509_NAME* name) std::string cert_string_from_asn1_integer(ASN1_INTEGER* value) { std::string result; - BIGNUM *bn = ASN1_INTEGER_to_BN(value, NULL); + BIGNUM *bn = ASN1_INTEGER_to_BN(value, nullptr); if(bn) { char * ascii_bn = BN_bn2hex(bn); @@ -416,7 +416,7 @@ std::string cert_string_from_octet_string(ASN1_OCTET_STRING* value) std::string cert_string_from_asn1_string(ASN1_STRING* value) { - char * string_bio_chars = NULL; + char * string_bio_chars = nullptr; std::string result; // get a memory bio BIO *string_bio = BIO_new(BIO_s_mem()); @@ -558,7 +558,7 @@ LLPointer LLBasicCertificateVector::erase(iterator _iter) mCerts.erase(basic_iter->mIter); return result; } - return NULL; + return nullptr; } @@ -585,9 +585,9 @@ void LLBasicCertificateStore::load_from_file(const std::string& filename) { if (BIO_read_filename(file_bio, filename.c_str()) > 0) { - X509 *cert_x509 = NULL; - while((PEM_read_bio_X509(file_bio, &cert_x509, 0, NULL)) && - (cert_x509 != NULL)) + X509 *cert_x509 = nullptr; + while((PEM_read_bio_X509(file_bio, &cert_x509, 0, nullptr)) && + (cert_x509 != nullptr)) { try { @@ -617,7 +617,7 @@ void LLBasicCertificateStore::load_from_file(const std::string& filename) rejected++; } X509_free(cert_x509); - cert_x509 = NULL; + cert_x509 = nullptr; } BIO_free(file_bio); } @@ -688,7 +688,7 @@ LLBasicCertificateChain::LLBasicCertificateChain(X509_STORE_CTX* store) // we're passed in a context, which contains a cert, and a blob of untrusted // certificates which compose the chain. - if((store == NULL) || X509_STORE_CTX_get0_cert(store) == NULL) + if((store == nullptr) || X509_STORE_CTX_get0_cert(store) == nullptr) { LL_WARNS("SECAPI") << "An invalid store context was passed in when trying to create a certificate chain" << LL_ENDL; return; @@ -697,7 +697,7 @@ LLBasicCertificateChain::LLBasicCertificateChain(X509_STORE_CTX* store) LLPointer current = new LLBasicCertificate(X509_STORE_CTX_get0_cert(store)); add(current); - if(X509_STORE_CTX_get0_untrusted(store) != NULL) + if(X509_STORE_CTX_get0_untrusted(store) != nullptr) { // if there are other certs in the chain, we build up a vector // of untrusted certs so we can search for the parents of each @@ -901,7 +901,7 @@ void _validateCert(int validation_policy, if (validation_policy & VALIDATION_POLICY_TIME) { - LLDate validation_date((double)time(NULL)); + LLDate validation_date((double)time(nullptr)); if(validation_params.has(CERT_VALIDATION_DATE)) { validation_date = validation_params[CERT_VALIDATION_DATE]; @@ -981,7 +981,7 @@ bool _verify_signature(LLPointer parent, child->getLLSD(cert2); X509 *signing_cert = parent->getOpenSSLX509(); X509 *child_cert = child->getOpenSSLX509(); - if((signing_cert != NULL) && (child_cert != NULL)) + if((signing_cert != nullptr) && (child_cert != nullptr)) { EVP_PKEY *pkey = X509_get_pubkey(signing_cert); @@ -1092,7 +1092,7 @@ void LLBasicCertificateStore::validate(int validation_policy, << LL_ENDL; X509_free( cert_x509 ); - cert_x509 = NULL; + cert_x509 = nullptr; if (skeyid.empty()) { LLTHROW(LLCertException(current_cert_info, "No Subject Key Id")); @@ -1111,7 +1111,7 @@ void LLBasicCertificateStore::validate(int validation_policy, } else { - validation_date = LLDate((double)time(NULL)); // current time + validation_date = LLDate((double)time(nullptr)); // current time } if((validation_date < cache_entry->second.first) || @@ -1349,7 +1349,7 @@ void LLSecAPIBasicHandler::_readProtectedData(unsigned char *unique_id, U32 id_l EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); // todo: ctx error handling - EVP_DecryptInit(ctx, EVP_rc4(), salt, NULL); + EVP_DecryptInit(ctx, EVP_rc4(), salt, nullptr); // allocate memory: std::string decrypted_data; @@ -1424,14 +1424,14 @@ void LLSecAPIBasicHandler::_writeProtectedData() llofstream protected_data_stream(tmp_filename.c_str(), std::ios_base::binary); - EVP_CIPHER_CTX *ctx = NULL; + EVP_CIPHER_CTX *ctx = nullptr; try { ctx = EVP_CIPHER_CTX_new(); // todo: ctx error handling - EVP_EncryptInit(ctx, EVP_rc4(), salt, NULL); + EVP_EncryptInit(ctx, EVP_rc4(), salt, nullptr); unsigned char unique_id[MAC_ADDRESS_BYTES]; LLMachineID::getUniqueID(unique_id, sizeof(unique_id)); LLXORCipher cipher(unique_id, sizeof(unique_id)); diff --git a/indra/newview/llsechandler_basic.h b/indra/newview/llsechandler_basic.h index 2dffe84775..50ec89afaa 100644 --- a/indra/newview/llsechandler_basic.h +++ b/indra/newview/llsechandler_basic.h @@ -53,8 +53,8 @@ class LLBasicCertificate : public LLCertificate LOG_CLASS(LLBasicCertificate); // The optional validation_params allow us to make the unit test time-invariant - LLBasicCertificate(const std::string& pem_cert, const LLSD* validation_params = NULL); - LLBasicCertificate(X509* openSSLX509, const LLSD* validation_params = NULL); + LLBasicCertificate(const std::string& pem_cert, const LLSD* validation_params = nullptr); + LLBasicCertificate(X509* openSSLX509, const LLSD* validation_params = nullptr); virtual ~LLBasicCertificate(); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index a624682e11..f2eb5648db 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -467,13 +467,13 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectOnly(LLViewerObject* object, S3 nodep->selectGLTFNode(gltf_node, gltf_primitive, true); } gEditMenuHandler = this; - return NULL; + return nullptr; } if (!canSelectObject(object)) { //make_ui_sound("UISndInvalidOp"); - return NULL; + return nullptr; } // LL_INFOS() << "Adding object to selected object list" << LL_ENDL; @@ -532,13 +532,13 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, // make sure pointat position is updated updatePointAt(); gEditMenuHandler = this; - return NULL; + return nullptr; } if (!canSelectObject(obj,ignore_select_owned)) { //make_ui_sound("UISndInvalidOp"); - return NULL; + return nullptr; } // Since we're selecting a family, start at the root, but @@ -605,11 +605,11 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(const std::vector objects; //clear primary object (no primary object) - mSelectedObjects->mPrimaryObject = NULL; + mSelectedObjects->mPrimaryObject = nullptr; if (object_list.size() < 1) { - return NULL; + return nullptr; } // NOTE -- we add the objects in REVERSE ORDER @@ -672,7 +672,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(const std::vectorgetCurrentTool(); @@ -832,9 +832,9 @@ bool LLSelectMgr::enableLinkObjects() { virtual bool apply(LLViewerObject* object) { - LLViewerObject *root_object = (object == NULL) ? NULL : object->getRootEdit(); + LLViewerObject *root_object = (object == nullptr) ? nullptr : object->getRootEdit(); return object->permModify() && !object->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()); + ((root_object == nullptr) || !root_object->isPermanentEnforced()); } } func; const bool firstonly = true; @@ -851,12 +851,12 @@ bool LLSelectMgr::enableLinkObjects() bool LLSelectMgr::enableUnlinkObjects() { LLViewerObject* first_editable_object = LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject(); - LLViewerObject *root_object = (first_editable_object == NULL) ? NULL : first_editable_object->getRootEdit(); + LLViewerObject *root_object = (first_editable_object == nullptr) ? nullptr : first_editable_object->getRootEdit(); bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() && first_editable_object && !first_editable_object->isAttachment() && !first_editable_object->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()); + ((root_object == nullptr) || !root_object->isPermanentEnforced()); return new_value; } @@ -927,7 +927,7 @@ void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, bool send_to_s objects[i]->setAngularVelocity( 0,0,0 ); objects[i]->setVelocity( 0,0,0 ); - if(msg->isSendFull(NULL) || select_count >= MAX_OBJECTS_PER_PACKET) + if(msg->isSendFull(nullptr) || select_count >= MAX_OBJECTS_PER_PACKET) { msg->sendReliable(regionp->getHost() ); select_count = 0; @@ -1097,21 +1097,21 @@ LLObjectSelectionHandle LLSelectMgr::setHoverObject(LLViewerObject *objectp, S32 if (!objectp) { mHoverObjects->deleteAllNodes(); - return NULL; + return nullptr; } // Can't select yourself if (objectp->mID == gAgentID) { mHoverObjects->deleteAllNodes(); - return NULL; + return nullptr; } // Can't select land if (objectp->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH) { mHoverObjects->deleteAllNodes(); - return NULL; + return nullptr; } mHoverObjects->mPrimaryObject = objectp; @@ -1272,11 +1272,11 @@ LLObjectSelectionHandle LLSelectMgr::selectHighlightedObjects() { if (!mHighlightedObjects->getNumNodes()) { - return NULL; + return nullptr; } //clear primary object - mSelectedObjects->mPrimaryObject = NULL; + mSelectedObjects->mPrimaryObject = nullptr; for (LLObjectSelection::iterator iter = getHighlightedObjects()->begin(); iter != getHighlightedObjects()->end(); ) @@ -1499,7 +1499,7 @@ void LLSelectMgr::remove(std::vector& objects) { objectp->setSelected(false); mSelectedObjects->removeNode(nodep); - nodep = NULL; + nodep = nullptr; } } updateSelectionCenter(); @@ -1524,7 +1524,7 @@ void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, bool undoable) { // Remove all faces (or the object doesn't have faces) so remove the node mSelectedObjects->removeNode(nodep); - nodep = NULL; + nodep = nullptr; objectp->setSelected( false ); } else if (0 <= te && te < SELECT_MAX_TES) @@ -1552,7 +1552,7 @@ void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, bool undoable) if (!found) { mSelectedObjects->removeNode(nodep); - nodep = NULL; + nodep = nullptr; objectp->setSelected( false ); // *FIXME: Doesn't update simulator that object is no longer selected } @@ -1709,7 +1709,7 @@ void LLSelectMgr::dump() //----------------------------------------------------------------------------- void LLSelectMgr::cleanup() { - mSilhouetteImagep = NULL; + mSilhouetteImagep = nullptr; } @@ -2556,7 +2556,7 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data) llassert(mMediaData.isMap()); const LLTextureEntry *texture_entry = object->getTE(te); if (!mMediaData.isMap() || - ((NULL != texture_entry) && !texture_entry->hasMedia() && !mMediaData.has(LLMediaEntry::HOME_URL_KEY))) + ((nullptr != texture_entry) && !texture_entry->hasMedia() && !mMediaData.has(LLMediaEntry::HOME_URL_KEY))) { // skip adding/updating media } @@ -2565,8 +2565,8 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data) object->clearTEWaterExclusion(te); object->setTEMediaFlags(te, mMediaFlags); LLVOVolume *vo = dynamic_cast(object); - llassert(NULL != vo); - if (NULL != vo) + llassert(nullptr != vo); + if (nullptr != vo) { vo->syncMediaData(te, mMediaData, true/*merge*/, true/*ignore_agent*/); } @@ -2591,11 +2591,11 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data) { object->sendTEUpdate(); LLVOVolume *vo = dynamic_cast(object); - llassert(NULL != vo); + llassert(nullptr != vo); // It's okay to skip this object if hasMedia() is false... // the sendTEUpdate() above would remove all media data if it were // there. - if (NULL != vo && vo->hasMedia()) + if (nullptr != vo && vo->hasMedia()) { // Send updated media data FOR THE ENTIRE OBJECT vo->sendMediaDataUpdate(); @@ -2692,7 +2692,7 @@ void LLSelectMgr::selectionRemoveMaterial() { LL_DEBUGS("Materials") << "Removing material from object " << object->getID() << " face " << face << LL_ENDL; LLMaterialMgr::getInstance()->remove(object->getID(),face); - object->setTEMaterialParams(face, NULL); + object->setTEMaterialParams(face, nullptr); } return true; } @@ -2729,7 +2729,7 @@ LLPermissions* LLSelectMgr::findObjectPermissions(const LLViewerObject* object) } } - return NULL; + return nullptr; } @@ -2921,7 +2921,7 @@ bool LLSelectMgr::selectionGetIncludeInSearch(bool* include_in_search_out) void LLSelectMgr::selectionSetIncludeInSearch(bool include_in_search) { - LLViewerObject* object = NULL; + LLViewerObject* object = nullptr; for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++) { @@ -4328,7 +4328,7 @@ bool LLSelectMgr::selectGetEditMoveLinksetPermissions(bool &move, bool &modify) LLViewerObject *root_object = object->getRootEdit(); bool this_object_movable = false; if (object->permMove() && !object->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + ((root_object == nullptr) || !root_object->isPermanentEnforced()) && (object->permModify() || selecting_linked_set)) { this_object_movable = true; @@ -4514,7 +4514,7 @@ void LLSelectMgr::selectDuplicate(const LLVector3& offset, bool select_copy) } if (!canDuplicate()) { - LLSelectNode* node = getSelection()->getFirstRootNode(NULL, true); + LLSelectNode* node = getSelection()->getFirstRootNode(nullptr, true); if (node) { LLSD args; @@ -4912,7 +4912,7 @@ void LLSelectMgr::deselectAll() packAgentAndSessionID, packObjectLocalID, logNoOp, - NULL, + nullptr, SEND_INDIVIDUALS); removeAll(); @@ -4943,7 +4943,7 @@ void LLSelectMgr::deselectAllForStandingUp() packAgentAndSessionID, packObjectLocalID, logNoOp, - NULL, + nullptr, SEND_INDIVIDUALS); removeAll(); @@ -5113,7 +5113,7 @@ void LLSelectMgr::sendAttach(LLObjectSelectionHandle selection_handle, U8 attach bool build_mode = LLToolMgr::getInstance()->inEdit(); // Special case: Attach to default location for this object. if (0 == attachment_point || - get_if_there(gAgentAvatarp->mAttachmentPoints, (S32)attachment_point, (LLViewerJointAttachment*)NULL)) + get_if_there(gAgentAvatarp->mAttachmentPoints, (S32)attachment_point, (LLViewerJointAttachment*)nullptr)) { if (!replace || attachment_point != 0) { @@ -5153,7 +5153,7 @@ void LLSelectMgr::sendDetach() packAgentAndSessionID, packObjectLocalID, logDetachRequest, - NULL, + nullptr, SEND_ONLY_ROOTS ); } @@ -5170,7 +5170,7 @@ void LLSelectMgr::sendDropAttachment() packAgentAndSessionID, packObjectLocalID, logDetachRequest, - NULL, + nullptr, SEND_ONLY_ROOTS); } @@ -5190,7 +5190,7 @@ void LLSelectMgr::sendLink() packAgentAndSessionID, packObjectLocalID, logNoOp, - NULL, + nullptr, SEND_ONLY_ROOTS); } @@ -5228,7 +5228,7 @@ void LLSelectMgr::sendDelink() packAgentAndSessionID, packObjectLocalID, logNoOp, - NULL, + nullptr, SEND_INDIVIDUALS); } @@ -5265,7 +5265,7 @@ void LLSelectMgr::sendDehinge() "ObjectDehinge", packAgentAndSessionID, packObjectLocalID, - NULL, + nullptr, SEND_ONLY_ROOTS); }*/ @@ -5281,7 +5281,7 @@ void LLSelectMgr::sendSelect() packAgentAndSessionID, packObjectLocalID, logNoOp, - NULL, + nullptr, SEND_INDIVIDUALS); } @@ -5405,7 +5405,7 @@ void LLSelectMgr::saveSelectedObjectTransform(EActionType action_type) else { LLViewerObject* attachment_root = (LLViewerObject*)object->getParent(); - LLXform* parent_xform = attachment_root ? attachment_root->mDrawable->getXform()->getParent() : NULL; + LLXform* parent_xform = attachment_root ? attachment_root->mDrawable->getXform()->getParent() : nullptr; if (parent_xform) { LLVector3 root_pos = (attachment_root->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); @@ -5703,7 +5703,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle, ESendType send_type) { LLSelectNode* node; - LLSelectNode* linkset_root = NULL; + LLSelectNode* linkset_root = nullptr; LLViewerRegion* last_region; LLViewerRegion* current_region; S32 objects_in_this_packet = 0; @@ -5713,7 +5713,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle, if (mAllowSelectAvatar) { if (selected_handle->getObjectCount() == 1 - && selected_handle->getFirstObject() != NULL + && selected_handle->getFirstObject() != nullptr && selected_handle->getFirstObject()->isAvatar()) { // Server doesn't move avatars at the moment, it is a local debug feature, @@ -5816,7 +5816,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle, (*pack_header)(user_data); // For each object - while (node != NULL) + while (node != nullptr) { // remember the last region, look up the current one last_region = current_region; @@ -5824,10 +5824,10 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle, // if to same simulator and message not too big if ((current_region == last_region) - && (! gMessageSystem->isSendFull(NULL)) + && (! gMessageSystem->isSendFull(nullptr)) && (objects_in_this_packet < MAX_OBJECTS_PER_PACKET)) { - if (link_operation && linkset_root == NULL) + if (link_operation && linkset_root == nullptr) { // linksets over 254 will be split into multiple messages, // but we need to provide same root for all messages or we will get separate linksets @@ -5842,7 +5842,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle, // and on to the next object if(nodes_to_send.empty()) { - node = NULL; + node = nullptr; } else { @@ -5859,12 +5859,12 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle, gMessageSystem->newMessage(message_name.c_str()); (*pack_header)(user_data); - if (linkset_root != NULL) + if (linkset_root != nullptr) { if (current_region != last_region) { // root should be in one region with the child, reset it - linkset_root = NULL; + linkset_root = nullptr; } else { @@ -6862,7 +6862,7 @@ LLSelectNode::~LLSelectNode() } delete mPermissions; - mPermissions = NULL; + mPermissions = nullptr; } void LLSelectNode::selectAllTEs(bool b) @@ -6922,11 +6922,11 @@ LLViewerObject* LLSelectNode::getObject() { if (!mObject) { - return NULL; + return nullptr; } else if (mObject->isDead()) { - mObject = NULL; + mObject = nullptr; } return mObject; } @@ -7422,7 +7422,7 @@ S32 get_family_count(LLViewerObject *parent) if (!child) { - LL_WARNS() << "Family object has NULL child! Show Doug." << LL_ENDL; + LL_WARNS() << "Family object has nullptr child! Show Doug." << LL_ENDL; } else if (child->isDead()) { @@ -7545,7 +7545,7 @@ void LLSelectMgr::updateSelectionCenter() // give up edit menu if no objects selected if (gEditMenuHandler == this && mSelectedObjects->getObjectCount() == 0) { - gEditMenuHandler = NULL; + gEditMenuHandler = nullptr; } pauseAssociatedAvatars(); @@ -7572,7 +7572,7 @@ void LLSelectMgr::pauseAssociatedAvatars() mSelectedObjects->mSelectType = getSelectTypeForObject(object); - LLVOAvatar* parent_av = NULL; + LLVOAvatar* parent_av = nullptr; if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT) { // Selection can be obsolete, confirm that this is an attachment @@ -7649,7 +7649,7 @@ LLBBox LLSelectMgr::getBBoxOfSelection() const bool LLSelectMgr::canUndo() const { // Can edit or can move - return const_cast(this)->mSelectedObjects->getFirstUndoEnabledObject() != NULL; // HACK: casting away constness - MG; + return const_cast(this)->mSelectedObjects->getFirstUndoEnabledObject() != nullptr; // HACK: casting away constness - MG; } //----------------------------------------------------------------------------- @@ -7667,7 +7667,7 @@ void LLSelectMgr::undo() //----------------------------------------------------------------------------- bool LLSelectMgr::canRedo() const { - return const_cast(this)->mSelectedObjects->getFirstEditableObject() != NULL; // HACK: casting away constness - MG + return const_cast(this)->mSelectedObjects->getFirstEditableObject() != nullptr; // HACK: casting away constness - MG } //----------------------------------------------------------------------------- @@ -7691,7 +7691,7 @@ bool LLSelectMgr::canDoDelete() const LLSelectMgr* self = const_cast(this); LLViewerObject* obj = self->mSelectedObjects->getFirstDeleteableObject(); // Note: Can only delete root objects (see getFirstDeleteableObject() for more info) - if (obj!= NULL) + if (obj!= nullptr) { // all the faces needs to be selected if(self->mSelectedObjects->contains(obj,SELECT_ALL_TES )) @@ -7731,7 +7731,7 @@ void LLSelectMgr::deselect() //----------------------------------------------------------------------------- bool LLSelectMgr::canDuplicate() const { - return const_cast(this)->mSelectedObjects->getFirstCopyableObject() != NULL; // HACK: casting away constness - MG + return const_cast(this)->mSelectedObjects->getFirstCopyableObject() != nullptr; // HACK: casting away constness - MG } //----------------------------------------------------------------------------- // duplicate() @@ -7857,19 +7857,19 @@ void LLSelectMgr::clearWaterExclusion() bool LLObjectSelection::is_root::operator()(LLSelectNode *node) { LLViewerObject* object = node->getObject(); - return (object != NULL) && !node->mIndividualSelection && (object->isRootEdit()); + return (object != nullptr) && !node->mIndividualSelection && (object->isRootEdit()); } bool LLObjectSelection::is_valid_root::operator()(LLSelectNode *node) { LLViewerObject* object = node->getObject(); - return (object != NULL) && node->mValid && !node->mIndividualSelection && (object->isRootEdit()); + return (object != nullptr) && node->mValid && !node->mIndividualSelection && (object->isRootEdit()); } bool LLObjectSelection::is_root_object::operator()(LLSelectNode *node) { LLViewerObject* object = node->getObject(); - return (object != NULL) && (object->isRootEdit()); + return (object != nullptr) && (object->isRootEdit()); } LLObjectSelection::LLObjectSelection() : @@ -7889,7 +7889,7 @@ void LLObjectSelection::cleanupNodes() { list_t::iterator curiter = iter++; LLSelectNode* node = *curiter; - if (node->getObject() == NULL || node->getObject()->isDead()) + if (node->getObject() == nullptr || node->getObject()->isDead()) { mList.erase(curiter); delete node; @@ -7931,9 +7931,9 @@ void LLObjectSelection::removeNode(LLSelectNode *nodep) mSelectNodeMap.erase(nodep->getObject()); if (nodep->getObject() == mPrimaryObject) { - mPrimaryObject = NULL; + mPrimaryObject = nullptr; } - nodep->setObject(NULL); // Will get erased in cleanupNodes() + nodep->setObject(nullptr); // Will get erased in cleanupNodes() mList.remove(nodep); } @@ -7942,7 +7942,7 @@ void LLObjectSelection::deleteAllNodes() std::for_each(mList.begin(), mList.end(), DeletePointer()); mList.clear(); mSelectNodeMap.clear(); - mPrimaryObject = NULL; + mPrimaryObject = nullptr; } LLSelectNode* LLObjectSelection::findNode(LLViewerObject* objectp) @@ -7952,7 +7952,7 @@ LLSelectNode* LLObjectSelection::findNode(LLViewerObject* objectp) { return found_it->second; } - return NULL; + return nullptr; } //----------------------------------------------------------------------------- @@ -8373,7 +8373,7 @@ bool LLObjectSelection::isMultipleTESelected() //----------------------------------------------------------------------------- bool LLObjectSelection::contains(LLViewerObject* object) { - return findNode(object) != NULL; + return findNode(object) != nullptr; } @@ -8456,12 +8456,12 @@ LLSelectNode* LLObjectSelection::getFirstNode(LLSelectedNodeFunctor* func) for (iterator iter = begin(); iter != end(); ++iter) { LLSelectNode* node = *iter; - if (func == NULL || func->apply(node)) + if (func == nullptr || func->apply(node)) { return node; } } - return NULL; + return nullptr; } LLSelectNode* LLObjectSelection::getFirstRootNode(LLSelectedNodeFunctor* func, bool non_root_ok) @@ -8469,7 +8469,7 @@ LLSelectNode* LLObjectSelection::getFirstRootNode(LLSelectedNodeFunctor* func, b for (root_iterator iter = root_begin(); iter != root_end(); ++iter) { LLSelectNode* node = *iter; - if (func == NULL || func->apply(node)) + if (func == nullptr || func->apply(node)) { return node; } @@ -8479,7 +8479,7 @@ LLSelectNode* LLObjectSelection::getFirstRootNode(LLSelectedNodeFunctor* func, b // Get non root return getFirstNode(func); } - return NULL; + return nullptr; } @@ -8497,7 +8497,7 @@ LLViewerObject* LLObjectSelection::getFirstSelectedObject(LLSelectedNodeFunctor* { return res->getObject(); } - return NULL; + return nullptr; } //----------------------------------------------------------------------------- @@ -8505,8 +8505,8 @@ LLViewerObject* LLObjectSelection::getFirstSelectedObject(LLSelectedNodeFunctor* //----------------------------------------------------------------------------- LLViewerObject* LLObjectSelection::getFirstObject() { - LLSelectNode* res = getFirstNode(NULL); - return res ? res->getObject() : NULL; + LLSelectNode* res = getFirstNode(nullptr); + return res ? res->getObject() : nullptr; } //----------------------------------------------------------------------------- @@ -8514,8 +8514,8 @@ LLViewerObject* LLObjectSelection::getFirstObject() //----------------------------------------------------------------------------- LLViewerObject* LLObjectSelection::getFirstRootObject(bool non_root_ok) { - LLSelectNode* res = getFirstRootNode(NULL, non_root_ok); - return res ? res->getObject() : NULL; + LLSelectNode* res = getFirstRootNode(nullptr, non_root_ok); + return res ? res->getObject() : nullptr; } //----------------------------------------------------------------------------- @@ -8580,7 +8580,7 @@ LLViewerObject* LLObjectSelection::getFirstDeleteableObject() } } func; LLSelectNode* node = getFirstNode(&func); - return node ? node->getObject() : NULL; + return node ? node->getObject() : nullptr; } //----------------------------------------------------------------------------- @@ -8767,7 +8767,7 @@ bool LLSelectMgr::selectionMove(const LLVector3& displ, void LLSelectMgr::sendSelectionMove() { LLSelectNode *node = mSelectedObjects->getFirstRootNode(); - if (node == NULL) + if (node == nullptr) { return; } @@ -8789,7 +8789,7 @@ void LLSelectMgr::sendSelectionMove() gMessageSystem->newMessage("MultipleObjectUpdate"); packAgentAndSessionID(&update_type); - LLViewerObject *obj = NULL; + LLViewerObject *obj = nullptr; for (LLObjectSelection::root_iterator it = getSelection()->root_begin(); it != getSelection()->root_end(); ++it) { @@ -8801,7 +8801,7 @@ void LLSelectMgr::sendSelectionMove() // if not simulator or message too big if (curr_region != last_region - || gMessageSystem->isSendFull(NULL) + || gMessageSystem->isSendFull(nullptr) || objects_in_this_packet >= MAX_OBJECTS_PER_PACKET) { // send sim the current message and start new one diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 11aad3b806..6f7569216b 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -274,7 +274,7 @@ class LLObjectSelection : public LLRefCount { bool operator()(LLSelectNode* node) { - return (node->getObject() != NULL); + return (node->getObject() != nullptr); } }; typedef boost::filter_iterator iterator; @@ -285,7 +285,7 @@ class LLObjectSelection : public LLRefCount { bool operator()(LLSelectNode* node) { - return (node->getObject() != NULL) && node->mValid; + return (node->getObject() != nullptr) && node->mValid; } }; typedef boost::filter_iterator valid_iterator; @@ -323,8 +323,8 @@ class LLObjectSelection : public LLRefCount 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); @@ -355,8 +355,8 @@ class LLObjectSelection : public LLRefCount 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(); diff --git a/indra/newview/llsetkeybinddialog.cpp b/indra/newview/llsetkeybinddialog.cpp index 2790705fd8..bb84a5e4e5 100644 --- a/indra/newview/llsetkeybinddialog.cpp +++ b/indra/newview/llsetkeybinddialog.cpp @@ -69,9 +69,9 @@ bool LLSetKeyBindDialog::sRecordKeys = false; LLSetKeyBindDialog::LLSetKeyBindDialog(const LLSD& key) : LLModalDialog(key), - pParent(NULL), + pParent(nullptr), mKeyFilterMask(DEFAULT_KEY_FILTER), - pUpdater(NULL), + pUpdater(nullptr), mLastMaskKey(0), mContextConeOpacity(0.f), mContextConeInAlpha(CONTEXT_CONE_IN_ALPHA), @@ -114,13 +114,13 @@ void LLSetKeyBindDialog::onClose(bool app_quiting) if (pParent) { pParent->onCancelKeyBind(); - pParent = NULL; + pParent = nullptr; } if (pUpdater) { // Doubleclick timer has't fired, delete it delete pUpdater; - pUpdater = NULL; + pUpdater = nullptr; } LLModalDialog::onClose(app_quiting); } @@ -349,7 +349,7 @@ void LLSetKeyBindDialog::onDefault(void* user_data) if (self->pParent) { self->pParent->onDefaultKeyBind(self->pCheckBox->getValue().asBoolean()); - self->pParent = NULL; + self->pParent = nullptr; } self->closeFloater(); } @@ -360,7 +360,7 @@ void LLSetKeyBindDialog::onClickTimeout(void* user_data, MASK mask) LLSetKeyBindDialog* self = (LLSetKeyBindDialog*)user_data; // timer will delete itself after timeout - self->pUpdater = NULL; + self->pUpdater = nullptr; self->setKeyBind(CLICK_LEFT, KEY_NONE, mask, self->pCheckBox->getValue().asBoolean()); self->closeFloater(); @@ -371,7 +371,7 @@ void LLSetKeyBindDialog::setKeyBind(EMouseClickType click, KEY key, MASK mask, b if (pParent) { pParent->onSetKeyBind(click, key, mask, all_modes); - pParent = NULL; + pParent = nullptr; } } diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 8329ed86da..1e53440be4 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -99,9 +99,9 @@ namespace //========================================================================= void LLSettingsVOBase::createNewInventoryItem(LLSettingsType::type_e stype, const LLUUID& parent_id, std::function created_cb) { - inventory_result_fn cb = NULL; + inventory_result_fn cb = nullptr; - if (created_cb != NULL) + if (created_cb != nullptr) { cb = [created_cb](LLUUID asset_id, LLUUID inventory_id, LLUUID object_id, LLSD results) { diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 1d1b31d2a6..0319c4e4b1 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -75,9 +75,9 @@ class LLCurrentlyWornFetchObserver : public LLInventoryFetchItemsObserver LLSidepanelAppearance::LLSidepanelAppearance() : LLPanel(), mFilterSubString(LLStringUtil::null), - mFilterEditor(NULL), - mOutfitEdit(NULL), - mCurrOutfitPanel(NULL), + mFilterEditor(nullptr), + mOutfitEdit(nullptr), + mCurrOutfitPanel(nullptr), mOpened(false) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); @@ -212,7 +212,7 @@ void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility) if (is_outfit_edit_visible || is_wearable_edit_visible) { - const LLViewerWearable *wearable_ptr = mEditWearable ? mEditWearable->getWearable() : NULL; + const LLViewerWearable *wearable_ptr = mEditWearable ? mEditWearable->getWearable() : nullptr; if (!wearable_ptr) { LL_WARNS() << "Visibility change to invalid wearable" << LL_ENDL; @@ -320,8 +320,8 @@ void LLSidepanelAppearance::showOutfitEditPanel() // Accordion's state must be reset in all cases except the one when user // 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) + // BEFORE it is changed by the call to the toggleWearableEditPanel(false, nullptr, true). + if (mEditWearable != nullptr && !mEditWearable->getVisible() && mOutfitEdit != nullptr) { mOutfitEdit->resetAccordionState(); } @@ -329,18 +329,18 @@ 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); } -void LLSidepanelAppearance::showWearableEditPanel(LLViewerWearable *wearable /* = NULL*/, bool disable_camera_switch) +void LLSidepanelAppearance::showWearableEditPanel(LLViewerWearable *wearable /* = nullptr*/, bool disable_camera_switch) { toggleMyOutfitsPanel(false, ""); toggleOutfitEditPanel(false, true); // don't switch out of edit appearance mode @@ -447,7 +447,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 1c1de99795..534bdbe12f 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -60,7 +60,7 @@ class LLSidepanelAppearance : public LLPanel void showOutfitsInventoryPanel(); // last selected void showOutfitsInventoryPanel(const std::string& tab_name); 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(); diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index b48417bd71..49699f6784 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -117,11 +117,11 @@ class LLInboxAddedObserver : public LLInventoryCategoryAddedObserver LLSidepanelInventory::LLSidepanelInventory() : LLPanel() - , mPanelMainInventory(NULL) + , mPanelMainInventory(nullptr) , mInboxEnabled(false) - , mCategoriesObserver(NULL) - , mInboxAddedObserver(NULL) - , mInboxLayoutPanel(NULL) + , mCategoriesObserver(nullptr) + , mInboxAddedObserver(nullptr) + , mInboxLayoutPanel(nullptr) { //buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() } @@ -262,7 +262,7 @@ void LLSidepanelInventory::observeInboxCreation() // Set up observer to track inbox folder creation // - if (mInboxAddedObserver == NULL) + if (mInboxAddedObserver == nullptr) { mInboxAddedObserver = new LLInboxAddedObserver(this); @@ -277,7 +277,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; } @@ -292,7 +292,7 @@ void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID) return; } - if (mCategoriesObserver == NULL) + if (mCategoriesObserver == nullptr) { mCategoriesObserver = new LLInventoryCategoriesObserver(); gInventory.addObserver(mCategoriesObserver); @@ -484,7 +484,7 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem() LLFolderView* root = mPanelMainInventory->getActivePanel()->getRootFolder(); if (!root) { - return NULL; + return nullptr; } LLFolderViewItem* current_item = root->getCurSelectedItem(); @@ -497,7 +497,7 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem() if (!current_item) { - return NULL; + return nullptr; } } const LLUUID &item_id = static_cast(current_item->getViewModelItem())->getUUID(); @@ -526,13 +526,13 @@ LLInventoryPanel *LLSidepanelInventory::getActivePanel() { if (!getVisible()) { - return NULL; + return nullptr; } if (mInventoryPanel->getVisible()) { return mPanelMainInventory->getActivePanel(); } - return NULL; + return nullptr; } void LLSidepanelInventory::selectAllItemsPanel() diff --git a/indra/newview/llsidepanelinventorysubpanel.cpp b/indra/newview/llsidepanelinventorysubpanel.cpp index 820ceed296..d545e59ee2 100644 --- a/indra/newview/llsidepanelinventorysubpanel.cpp +++ b/indra/newview/llsidepanelinventorysubpanel.cpp @@ -50,7 +50,7 @@ LLSidepanelInventorySubpanel::LLSidepanelInventorySubpanel(const LLPanel::Params : LLPanel(p), mIsDirty(true), mIsEditing(false), - mCancelBtn(NULL) + mCancelBtn(nullptr) { } diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 6d50f216f5..d16ddd8678 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -93,7 +93,7 @@ class LLObjectInventoryObserver : public LLVOInventoryListener LLObjectInventoryObserver(LLSidepanelItemInfo* floater, LLViewerObject* object) : mFloater(floater) { - registerVOInventoryListener(object, NULL); + registerVOInventoryListener(object, nullptr); } virtual ~LLObjectInventoryObserver() { @@ -126,11 +126,11 @@ static LLPanelInjector t_item_info("sidepanel_item_info"); LLSidepanelItemInfo::LLSidepanelItemInfo(const LLPanel::Params& p) : LLPanel(p) , mItemID(LLUUID::null) - , mObjectInventoryObserver(NULL) + , mObjectInventoryObserver(nullptr) , mUpdatePendingId(-1) , mIsDirty(false) /*Not ready*/ - , mParentFloater(NULL) - , mLabelItemDesc(NULL) + , mParentFloater(nullptr) + , mLabelItemDesc(nullptr) { gInventory.addObserver(this); gIdleCallbacks.addFunction(&LLSidepanelItemInfo::onIdle, (void*)this); @@ -312,7 +312,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) @@ -836,7 +836,7 @@ void LLSidepanelItemInfo::startObjectInventoryObserver() stopObjectInventoryObserver(); // Previous object observer should be removed before starting to observe a new object. - llassert(mObjectInventoryObserver == NULL); + llassert(mObjectInventoryObserver == nullptr); } if (mObjectID.isNull()) @@ -853,7 +853,7 @@ void LLSidepanelItemInfo::startObjectInventoryObserver() void LLSidepanelItemInfo::stopObjectInventoryObserver() { delete mObjectInventoryObserver; - mObjectInventoryObserver = NULL; + mObjectInventoryObserver = nullptr; } void LLSidepanelItemInfo::setPropertiesFieldsEnabled(bool enabled) @@ -1182,7 +1182,7 @@ void LLSidepanelItemInfo::onCommitChanges(LLPointer item) LLViewerInventoryItem* LLSidepanelItemInfo::findItem() const { - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; if(mObjectID.isNull()) { // it is in agent inventory diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index c619b63ef5..03a6e2504a 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -70,7 +70,7 @@ /// Class llsidepaneltaskinfo ///---------------------------------------------------------------------------- -LLSidepanelTaskInfo* LLSidepanelTaskInfo::sActivePanel = NULL; +LLSidepanelTaskInfo* LLSidepanelTaskInfo::sActivePanel = nullptr; static LLPanelInjector t_task_info("sidepanel_task_info"); @@ -112,7 +112,7 @@ LLSidepanelTaskInfo::LLSidepanelTaskInfo() LLSidepanelTaskInfo::~LLSidepanelTaskInfo() { if (sActivePanel == this) - sActivePanel = NULL; + sActivePanel = nullptr; gIdleCallbacks.deleteFunction(&LLSidepanelTaskInfo::onIdle, (void*)this); if (mSelectionUpdateSlot.connected()) @@ -197,9 +197,9 @@ bool LLSidepanelTaskInfo::postBuild() } else { - sActivePanel = NULL; + sActivePanel = nullptr; // drop selection reference - mObjectSelection = NULL; + mObjectSelection = nullptr; } } @@ -323,7 +323,7 @@ void LLSidepanelTaskInfo::refresh() root_selected = false; } - LLViewerObject* objectp = NULL; + LLViewerObject* objectp = nullptr; if (nodep) { objectp = nodep->getObject(); @@ -1283,8 +1283,8 @@ void LLSidepanelTaskInfo::save() onCommitNextOwnerTransfer(getChild("checkbox next owner can transfer"), this); onCommitName(getChild("Object Name"), this); onCommitDesc(getChild("Object Description"), this); - onCommitSaleInfo(NULL, this); - onCommitSaleType(NULL, this); + onCommitSaleInfo(nullptr, this); + onCommitSaleType(nullptr, this); onCommitIncludeInSearch(getChild("search_check"), this); } @@ -1294,7 +1294,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(); @@ -1340,7 +1340,7 @@ LLViewerObject* LLSidepanelTaskInfo::getObject() { if (!mObject->isDead()) return mObject; - return NULL; + return nullptr; } LLViewerObject* LLSidepanelTaskInfo::getFirstSelectedObject() @@ -1350,7 +1350,7 @@ LLViewerObject* LLSidepanelTaskInfo::getFirstSelectedObject() { return node->getObject(); } - return NULL; + return nullptr; } const LLUUID& LLSidepanelTaskInfo::getSelectedUUID() diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index 223fc2a8f5..67d81506af 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -289,7 +289,7 @@ void LLSkinningUtil::initJointNums(LLMeshSkinInfo* skin, LLVOAvatar *avatar) for (U32 j = 0; j < skin->mJointNames.size(); ++j) { #if DEBUG_SKINNING - 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 82caa14433..0903d06895 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -83,8 +83,8 @@ LLSky::~LLSky() void LLSky::cleanup() { - mVOSkyp = NULL; - mVOWLSkyp = NULL; + mVOSkyp = nullptr; + mVOWLSkyp = nullptr; } void LLSky::destroyGL() @@ -197,11 +197,11 @@ void LLSky::setMoonDirectionCFR(const LLVector3 &moon_direction) void LLSky::init() { - mVOWLSkyp = static_cast(gObjectList.createObjectViewer(LLViewerObject::LL_VO_WL_SKY, NULL)); + mVOWLSkyp = static_cast(gObjectList.createObjectViewer(LLViewerObject::LL_VO_WL_SKY, nullptr)); mVOWLSkyp->init(); gPipeline.createObject(mVOWLSkyp.get()); - mVOSkyp = (LLVOSky *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_SKY, NULL); + mVOSkyp = (LLVOSky *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_SKY, nullptr); mVOSkyp->init(); gPipeline.createObject(mVOSkyp.get()); diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 3a894996e4..1bf9bf3e0f 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -74,14 +74,14 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Param : LLView(p), mColor(1.f, 0.f, 0.f, 0.5f), mCurImageIndex(0), - mPreviewImage(NULL), - mThumbnailImage(NULL) , - mBigThumbnailImage(NULL) , + mPreviewImage(nullptr), + mThumbnailImage(nullptr) , + mBigThumbnailImage(nullptr) , mThumbnailWidth(0), mThumbnailHeight(0), mThumbnailSubsampled(false), - mPreviewImageEncoded(NULL), - mFormattedImage(NULL), + mPreviewImageEncoded(nullptr), + mFormattedImage(nullptr), mShineCountdown(0), mFlashAlpha(0.f), mNeedsFlash(true), @@ -97,7 +97,7 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Param mFilterName(""), mAllowRenderUI(true), mAllowFullScreenPreview(true), - mViewContainer(NULL) + mViewContainer(nullptr) { setSnapshotQuality(gSavedSettings.getS32("SnapshotQuality")); mSnapshotDelayTimer.setTimerExpirySec(0.0f); @@ -124,13 +124,13 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Param LLSnapshotLivePreview::~LLSnapshotLivePreview() { // delete images - mPreviewImage = NULL; - mPreviewImageEncoded = NULL; - mFormattedImage = NULL; + mPreviewImage = nullptr; + mPreviewImageEncoded = nullptr; + mFormattedImage = nullptr; // gIdleCallbacks.deleteFunction( &LLSnapshotLivePreview::onIdle, (void*)this ); sList.erase(this); - sSaveLocalImage = NULL; + sSaveLocalImage = nullptr; } void LLSnapshotLivePreview::setMaxImageSize(S32 size) @@ -228,7 +228,7 @@ bool LLSnapshotLivePreview::setSnapshotQuality(S32 quality, bool set_by_user) { gSavedSettings.setS32("SnapshotQuality", quality); } - mFormattedImage = NULL; // Invalidate the already formatted image if any + mFormattedImage = nullptr; // Invalidate the already formatted image if any return true; } return false; @@ -571,7 +571,7 @@ void LLSnapshotLivePreview::generateThumbnailImage(bool force_update) // Scale to the thumbnail size if (!raw->scale(mThumbnailWidth, mThumbnailHeight)) { - raw = NULL ; + raw = nullptr ; } } else @@ -585,7 +585,7 @@ void LLSnapshotLivePreview::generateThumbnailImage(bool force_update) gSavedSettings.getBOOL("RenderSnapshotNoPost"), mSnapshotBufferType) ) { - raw = NULL ; + raw = nullptr ; } } @@ -620,7 +620,7 @@ LLViewerTexture* LLSnapshotLivePreview::getBigThumbnailImage() { if (mThumbnailUpdateLock) //in the process of updating { - return NULL; + return nullptr; } if (mBigThumbnailUpToDate && mBigThumbnailImage)//already updated { @@ -756,9 +756,9 @@ bool LLSnapshotLivePreview::onIdle( void* snapshot_preview ) previewp->getMaxImageSize())) { // Invalidate/delete any existing encoded image - previewp->mPreviewImageEncoded = NULL; + previewp->mPreviewImageEncoded = nullptr; // Invalidate/delete any existing formatted image - previewp->mFormattedImage = NULL; + previewp->mFormattedImage = nullptr; // Update the data size previewp->estimateDataSize(); @@ -1005,7 +1005,7 @@ void LLSnapshotLivePreview::setSnapshotFormat(LLSnapshotModel::ESnapshotFormat f { if (mSnapshotFormat != format) { - mFormattedImage = NULL; // Invalidate the already formatted image if any + mFormattedImage = nullptr; // Invalidate the already formatted image if any mSnapshotFormat = format; } } diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h index c41c21c120..97ccc2e164 100644 --- a/indra/newview/llsnapshotlivepreview.h +++ b/indra/newview/llsnapshotlivepreview.h @@ -112,7 +112,7 @@ class LLSnapshotLivePreview : public LLView 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, LLColor4 alpha_color = LLColor4(0.5f, 0.5f, 0.5f, 0.8f)); void prepareFreezeFrame(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 2dc2810861..f85c46dcab 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -374,7 +374,7 @@ void LLSpatialPartition::rebuildGeom(LLSpatialGroup* group) LL_WARNS() << "Failed to allocate Vertex Buffer on rebuild to " << vertex_count << " vertices and " << index_count << " indices" << LL_ENDL; - group->mVertexBuffer = NULL; + group->mVertexBuffer = nullptr; group->mBufferMap.clear(); } } @@ -387,7 +387,7 @@ void LLSpatialPartition::rebuildGeom(LLSpatialGroup* group) } else { - group->mVertexBuffer = NULL; + group->mVertexBuffer = nullptr; group->mBufferMap.clear(); } @@ -418,11 +418,11 @@ bool LLSpatialGroup::removeObject(LLDrawable *drawablep, bool from_octree) unbound(); if (mOctreeNode && !from_octree) { - drawablep->setGroup(NULL); + drawablep->setGroup(nullptr); } else { - drawablep->setGroup(NULL); + drawablep->setGroup(nullptr); setState(GEOM_DIRTY); gPipeline.markRebuild(this); @@ -578,7 +578,7 @@ LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) : LLO mGeometryBytes(0), mSurfaceArea(0.f), mBuilt(0.f), - mVertexBuffer(NULL), + mVertexBuffer(nullptr), mDistance(0.f), mDepth(0.f), mLastUpdateDistance(-1.f), @@ -795,16 +795,16 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node) { if(entry->hasDrawable()) { - ((LLDrawable*)entry->getDrawable())->setGroup(NULL); + ((LLDrawable*)entry->getDrawable())->setGroup(nullptr); } } } clearDrawMap(); - mVertexBuffer = NULL; + mVertexBuffer = nullptr; mBufferMap.clear(); sZombieGroups++; - mOctreeNode = NULL; + mOctreeNode = nullptr; } void LLSpatialGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child) @@ -871,7 +871,7 @@ void LLSpatialGroup::destroyGLState(bool keep_occlusion) } mLastUpdateTime = gFrameTimeSeconds; - mVertexBuffer = NULL; + mVertexBuffer = nullptr; mBufferMap.clear(); clearDrawMap(); @@ -903,7 +903,7 @@ void LLSpatialGroup::destroyGLState(bool keep_occlusion) //============================================== LLSpatialPartition::LLSpatialPartition(U32 data_mask, bool render_by_group, LLViewerRegion* regionp) -: mRenderByGroup(render_by_group), mBridge(NULL) +: mRenderByGroup(render_by_group), mBridge(nullptr) { mRegionp = regionp; mPartitionType = LLViewerRegion::PARTITION_NONE; @@ -937,7 +937,7 @@ LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep, bool was_visible) } LLSpatialGroup* group = drawablep->getSpatialGroup(); - //llassert(group != NULL); + //llassert(group != nullptr); if (group && was_visible && group->isOcclusionState(LLSpatialGroup::QUERY_PENDING)) { @@ -956,7 +956,7 @@ bool LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp) } else { - drawablep->setGroup(NULL); + drawablep->setGroup(nullptr); } assert_octree_valid(mOctree); @@ -1463,7 +1463,7 @@ void pushVerts(LLDrawInfo* params) void pushVerts(LLSpatialGroup* group) { - LLDrawInfo* params = NULL; + LLDrawInfo* params = nullptr; for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i) { @@ -1498,7 +1498,7 @@ void pushVerts(LLVolume* volume) for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) { const LLVolumeFace& face = volume->getVolumeFace(i); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, NULL, face.mNumIndices, face.mIndices); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, nullptr, face.mNumIndices, face.mIndices); } } @@ -1546,7 +1546,7 @@ void pushBufferVerts(LLSpatialGroup* group, bool push_alpha = true) void pushVertsColorCoded(LLSpatialGroup* group) { - LLDrawInfo* params = NULL; + LLDrawInfo* params = nullptr; static const LLColor4 colors[] = { LLColor4::green, @@ -2405,7 +2405,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume, bool wireframe gGL.diffuseColor4fv(color.mV); LLVertexBuffer::unbind(); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, nullptr, phys_volume->mNumHullIndices, phys_volume->mHullIndices); } else { @@ -2710,7 +2710,7 @@ void renderTexelDensity(LLDrawable* drawable) LLVertexBuffer* buffer = facep->getVertexBuffer(); LLViewerTexture* texturep = facep->getTexture(); - if (texturep == NULL) continue; + if (texturep == nullptr) continue; switch(LLViewerTexture::sDebugTexelsMode) { @@ -2754,7 +2754,7 @@ void renderTexelDensity(LLDrawable* drawable) //for (S32 i = 0; i < num_textures; i++) //{ // LLViewerTexture* texturep = params->mTextureList.empty() ? params->mTexture.get() : params->mTextureList[i].get(); - // if (texturep == NULL) continue; + // if (texturep == nullptr) continue; // LLMatrix4 checkboard_matrix; // S32 discard_level = -1; @@ -2841,7 +2841,7 @@ class LLRenderOctreeRaycast : public LLOctreeTriangleRayIntersect { public: LLRenderOctreeRaycast(const LLVector4a& start, const LLVector4a& dir, F32* closest_t) - : LLOctreeTriangleRayIntersect(start, dir, nullptr, closest_t, NULL, NULL, NULL, NULL) + : LLOctreeTriangleRayIntersect(start, dir, nullptr, closest_t, nullptr, nullptr, nullptr, nullptr) { } @@ -3329,11 +3329,11 @@ class LLOctreeRenderXRay : public OctreeTraveler gGL.flush(); gGL.pushMatrix(); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); renderXRay(group, mCamera); stop_glerror(); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.popMatrix(); } } @@ -3510,7 +3510,7 @@ void LLSpatialPartition::renderPhysicsShapes(bool wireframe) if (bridge) { - camera = NULL; + camera = nullptr; } gGL.flush(); @@ -3562,7 +3562,7 @@ void LLSpatialPartition::renderDebug() if (bridge) { - camera = NULL; + camera = nullptr; } LLOctreeStateCheck checker; @@ -3644,7 +3644,7 @@ class alignas(16) LLOctreeIntersect : public LLOctreeTraveler void LLCullResult::pushBack(T& head, U32& count, V* val) { head[count] = val; - head.push_back(NULL); + head.push_back(nullptr); count++; } diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index dd11099c69..da85474379 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -141,7 +141,7 @@ class alignas(16) LLDrawInfo final : public LLRefCount { //sort by texture bool operator()(const LLPointer& lhs, const LLPointer& rhs) { - // sort by pointer, sort NULL down to the end + // sort by pointer, sort nullptr down to the end return lhs.get() != rhs.get() && (lhs.isNull() || (rhs.notNull() && lhs->mTexture.get() > rhs->mTexture.get())); } @@ -151,7 +151,7 @@ class alignas(16) LLDrawInfo final : public LLRefCount { //sort by texture bool operator()(const LLPointer& lhs, const LLPointer& rhs) { - // sort by pointer, sort NULL down to the end + // sort by pointer, sort nullptr down to the end return lhs.get() != rhs.get() && (lhs.isNull() || (rhs.notNull() && lhs->mVertexBuffer.get() > rhs->mVertexBuffer.get())); } @@ -183,7 +183,7 @@ class alignas(16) LLDrawInfo final : public LLRefCount { bool operator()(const LLPointer& lhs, const LLPointer& rhs) { - // sort by mBump value, sort NULL down to the end + // sort by mBump value, sort nullptr down to the end return lhs.get() != rhs.get() && (lhs.isNull() || (rhs.notNull() && lhs->mBump > rhs->mBump)); } @@ -304,10 +304,10 @@ class alignas(16) LLSpatialGroup : public LLOcclusionCullingGroup bool pick_unselectable, bool pick_reflection_probe, 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 ); @@ -382,10 +382,10 @@ class LLSpatialPartition: public LLViewerOctreePartition, public LLGeometryManag bool pick_unselectable, bool pick_reflection_probe, 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 ); @@ -407,7 +407,7 @@ class LLSpatialPartition: public LLViewerOctreePartition, public LLGeometryManag bool isHUDPartition() ; LLSpatialBridge* asBridge() { return mBridge; } - bool isBridge() { return asBridge() != NULL; } + bool isBridge() { return asBridge() != nullptr; } void renderPhysicsShapes(bool depth_only); void renderDebug(); @@ -417,7 +417,7 @@ class LLSpatialPartition: public LLViewerOctreePartition, public LLGeometryManag bool getVisibleExtents(LLCamera& camera, LLVector3& visMin, LLVector3& visMax); public: - LLSpatialBridge* mBridge; // NULL for non-LLSpatialBridge instances, otherwise, mBridge == this + LLSpatialBridge* mBridge; // nullptr for non-LLSpatialBridge instances, otherwise, mBridge == this // use a pointer instead of making "isBridge" and "asBridge" virtual so it's safe // to call asBridge() from the destructor @@ -444,7 +444,7 @@ class LLSpatialBridge : public LLDrawable, public LLSpatialPartition virtual bool isSpatialBridge() const { return true; } virtual void updateSpatialExtents(); virtual void updateBinRadius(); - virtual void setVisible(LLCamera& camera_in, std::vector* results = NULL, bool for_select = false); + virtual void setVisible(LLCamera& camera_in, std::vector* results = nullptr, 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); diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index f079c70c6c..5ace2e6771 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -290,12 +290,12 @@ LLPointer LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin { if (!mVoiceChannel) { - return NULL; + return nullptr; } LLUUID session_id = getSessionID(); if (id.isNull() || (id == session_id)) { - return NULL; + return nullptr; } LLPointer speakerp; @@ -498,7 +498,7 @@ void LLSpeakerMgr::updateSpeakerList() } else if (mVoiceChannel) { - // If not, check if the list is empty, except if it's Nearby Chat (session_id NULL). + // If not, check if the list is empty, except if it's Nearby Chat (session_id nullptr). LLUUID session_id = getSessionID(); if (!session_id.isNull() && !mSpeakerListUpdated) { @@ -599,11 +599,11 @@ LLPointer LLSpeakerMgr::findSpeaker(const LLUUID& speaker_id) { //In some conditions map causes crash if it is empty(Windows only), adding check (EK) if (mSpeakers.size() == 0) - return NULL; + return nullptr; speaker_map_t::iterator found_it = mSpeakers.find(speaker_id); if (found_it == mSpeakers.end()) { - return NULL; + return nullptr; } return found_it->second; } @@ -655,7 +655,7 @@ void LLSpeakerMgr::speakerChatted(const LLUUID& speaker_id) bool LLSpeakerMgr::isVoiceActive() { - // mVoiceChannel = NULL means current voice channel, whatever it is + // mVoiceChannel = nullptr means current voice channel, whatever it is return LLVoiceClient::getInstance()->voiceEnabled() && mVoiceChannel && mVoiceChannel->isActive(); } @@ -964,7 +964,7 @@ void LLIMSpeakerMgr::forceVoiceModeratedMode(bool should_be_muted) // LLActiveSpeakerMgr // -LLActiveSpeakerMgr::LLActiveSpeakerMgr() : LLSpeakerMgr(NULL) +LLActiveSpeakerMgr::LLActiveSpeakerMgr() : LLSpeakerMgr(nullptr) { } diff --git a/indra/newview/llsplitbutton.cpp b/indra/newview/llsplitbutton.cpp index 140b63c84d..d33a1a511c 100644 --- a/indra/newview/llsplitbutton.cpp +++ b/indra/newview/llsplitbutton.cpp @@ -123,12 +123,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)) { @@ -184,9 +184,9 @@ void LLSplitButton::hideButtons() LLSplitButton::LLSplitButton(const LLSplitButton::Params& p) : LLUICtrl(p), - mArrowBtn(NULL), - mShownItem(NULL), - mItemsPanel(NULL), + mArrowBtn(nullptr), + mShownItem(nullptr), + mItemsPanel(nullptr), mArrowPosition(p.arrow_position) { LLRect rc(p.rect); diff --git a/indra/newview/llsprite.cpp b/indra/newview/llsprite.cpp index e51aeb6080..af56fb69ee 100644 --- a/indra/newview/llsprite.cpp +++ b/indra/newview/llsprite.cpp @@ -56,7 +56,7 @@ LLVector3 LLSprite::sNormal(0.0f,0.0f,0.0f); // A simple initialization LLSprite::LLSprite(const LLUUID &image_uuid) : mImageID(image_uuid), - mImagep(NULL), + mImagep(nullptr), mPitch(0.f), mYaw(0.f), mPosition(0.0f, 0.0f, 0.0f), diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3ce9526488..0b08a5d97d 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -392,7 +392,7 @@ void set_flags_and_update_appearance() // true when all initialization done. bool idle_startup() { - if (gViewerWindow == NULL) + if (gViewerWindow == nullptr) { // We expect window to be initialized LL_WARNS_ONCE() << "gViewerWindow is not initialized" << LL_ENDL; @@ -546,7 +546,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") ) ) { @@ -586,7 +586,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 @@ -626,7 +626,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( @@ -677,20 +677,20 @@ 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 // the sender /*msg->setExceptionFunc(MX_RAN_OFF_END_OF_PACKET, invalid_message_callback, - NULL);*/ + nullptr);*/ msg->setExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE, invalid_message_callback, - NULL); + nullptr); if (gSavedSettings.getBOOL("LogMessages")) { @@ -726,11 +726,11 @@ bool idle_startup() if (false == gSavedSettings.getBOOL("NoAudio")) { delete gAudiop; - gAudiop = NULL; + gAudiop = nullptr; #ifdef LL_OPENAL #if !LL_WINDOWS - if (NULL == getenv("LL_BAD_OPENAL_DRIVER")) + if (nullptr == getenv("LL_BAD_OPENAL_DRIVER")) #endif // !LL_WINDOWS { gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL(); @@ -744,7 +744,7 @@ bool idle_startup() // when window is minimized. JC void* window_handle = (HWND)gViewerWindow->getPlatformWindow(); #else - void* window_handle = NULL; + void* window_handle = nullptr; #endif if (gAudiop->init(window_handle, LLAppViewer::instance()->getSecondLifeTitle())) { @@ -757,7 +757,7 @@ bool idle_startup() { LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL; delete gAudiop; - gAudiop = NULL; + gAudiop = nullptr; } } } @@ -848,7 +848,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_spellcheck_menu(); @@ -914,7 +914,7 @@ bool idle_startup() #ifdef _WIN32 LL_DEBUGS("AppInit") << "Processing PeekMessage" << LL_ENDL; 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 ) ) { } LL_DEBUGS("AppInit") << "PeekMessage processed" << LL_ENDL; @@ -1550,7 +1550,7 @@ bool idle_startup() update_texture_fetch(); do_startup_frame(); - if ( gViewerWindow != NULL) + if ( gViewerWindow != nullptr) { // This isn't the first logon attempt, so show the UI gViewerWindow->setNormalControlsVisible( true ); } @@ -1616,8 +1616,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); do_startup_frame(); //reset statistics @@ -1715,7 +1715,7 @@ bool idle_startup() false, (F32Seconds)gSavedSettings.getF32("UseCircuitCodeTimeout"), use_circuit_callback, - NULL); + nullptr); timeout.reset(); do_startup_frame(); @@ -2468,7 +2468,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(); @@ -2476,7 +2476,7 @@ bool idle_startup() do_startup_frame(); - llassert(LLPathfindingManager::getInstance() != NULL); + llassert(LLPathfindingManager::getInstance() != nullptr); LLPathfindingManager::getInstance()->initSystem(); gAgentAvatarp->sendHoverHeight(); @@ -2534,7 +2534,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. @@ -2764,18 +2764,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); @@ -2790,14 +2790,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); @@ -2870,14 +2870,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); @@ -3085,7 +3085,7 @@ std::string LLStartUp::getUserId() void release_start_screen() { LL_DEBUGS("AppInit") << "Releasing bitmap..." << LL_ENDL; - gStartTexture = NULL; + gStartTexture = nullptr; } @@ -3239,7 +3239,7 @@ void LLStartUp::initExperiences() void LLStartUp::cleanupNameCache() { delete gCacheName; - gCacheName = NULL; + gCacheName = nullptr; } bool LLStartUp::dispatchURL() @@ -3265,7 +3265,7 @@ bool LLStartUp::dispatchURL() || (dy*dy > SLOP*SLOP) ) { LLURLDispatcher::dispatch(getStartSLURL().getSLURLString(), LLCommandHandler::NAV_TYPE_CLICKED, - NULL, false); + nullptr, false); } return true; } @@ -3760,13 +3760,13 @@ bool process_login_success_response() 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()) { @@ -3777,8 +3777,8 @@ bool process_login_success_response() 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); } @@ -3797,10 +3797,10 @@ bool process_login_success_response() 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 = (S32)(server_utc_time - now); // Print server timestamp diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 44bada13c2..6b3678ab0e 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -93,7 +93,7 @@ // // Globals // -LLStatusBar *gStatusBar = NULL; +LLStatusBar *gStatusBar = nullptr; S32 STATUS_BAR_HEIGHT = 26; extern S32 MENU_BAR_HEIGHT; @@ -109,19 +109,19 @@ static void onClickVolume(void*); LLStatusBar::LLStatusBar(const LLRect& rect) : LLPanel(), - mTextTime(NULL), - mSGBandwidth(NULL), - mSGPacketLoss(NULL), - mBtnVolume(NULL), - mBoxBalance(NULL), + mTextTime(nullptr), + mSGBandwidth(nullptr), + mSGPacketLoss(nullptr), + mBtnVolume(nullptr), + mBoxBalance(nullptr), mBalance(0), mBalanceClicked(false), mObscureBalance(false), mHealth(100), mSquareMetersCredit(0), mSquareMetersCommitted(0), - mFilterEdit(NULL), // Edit for filtering - mSearchPanel(NULL) // Panel for filtering + mFilterEdit(nullptr), // Edit for filtering + mSearchPanel(nullptr) // Panel for filtering { setRect(rect); @@ -448,7 +448,7 @@ void LLStatusBar::sendMoneyBalanceRequest() } // Double amount of retries due to this request initially happening during busy stage // Ideally this should be turned into a capability - gMessageSystem->sendReliable(gAgent.getRegionHost(), LL_DEFAULT_RELIABLE_RETRIES * 2, true, LL_PING_BASED_TIMEOUT_DUMMY, NULL, NULL); + gMessageSystem->sendReliable(gAgent.getRegionHost(), LL_DEFAULT_RELIABLE_RETRIES * 2, true, LL_PING_BASED_TIMEOUT_DUMMY, nullptr, nullptr); } diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index 64359b6cbe..dffd6dac3d 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -996,7 +996,7 @@ void LLSurface::createPatchData() // We make each patch point to its neighbors so we can do resolution checking // when butting up different resolutions. Patches that don't have neighbors - // somewhere will point to NULL on that side. + // somewhere will point to nullptr on that side. if (i < mPatchesPerEdge-1) { patchp->setNeighborPatch(EAST,getPatch(i+1, j)); diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h index a599019ca5..a7d00b4f2f 100644 --- a/indra/newview/llsurface.h +++ b/indra/newview/llsurface.h @@ -149,7 +149,7 @@ class LLSurface S32 mNumberOfPatches; // Total number of patches - // Each surface points at 8 neighbors (or NULL) + // Each surface points at 8 neighbors (or nullptr) // +---+---+---+ // |NW | N | NE| // +---+---+---+ diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index 875af76c10..ead3a2d59b 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -53,9 +53,9 @@ LLSurfacePatch::LLSurfacePatch() mDirtyZStats(true), mHeightsGenerated(false), mDataOffset(0), - mDataZ(NULL), - mDataNorm(NULL), - mVObjp(NULL), + mDataZ(nullptr), + mDataNorm(nullptr), + mVObjp(nullptr), mOriginRegion(0.f, 0.f, 0.f), mCenterRegion(0.f, 0.f, 0.f), mMinZ(0.f), @@ -69,12 +69,12 @@ LLSurfacePatch::LLSurfacePatch() // set to non-zero values by higher classes. mConnectedEdge(NO_EDGE), mLastUpdateTime(0), - mSurfacep(NULL) + mSurfacep(nullptr) { S32 i; for (i = 0; i < 8; i++) { - setNeighborPatch(i, NULL); + setNeighborPatch(i, nullptr); } for (i = 0; i < 9; i++) { @@ -85,7 +85,7 @@ LLSurfacePatch::LLSurfacePatch() LLSurfacePatch::~LLSurfacePatch() { - mVObjp = NULL; + mVObjp = nullptr; } @@ -116,7 +116,7 @@ void LLSurfacePatch::dirty() void LLSurfacePatch::setSurface(LLSurface *surfacep) { mSurfacep = surfacep; - if (mVObjp == (LLVOSurfacePatch *)NULL) + if (mVObjp == (LLVOSurfacePatch *)nullptr) { llassert(mSurfacep->mType == 'l'); @@ -136,7 +136,7 @@ void LLSurfacePatch::disconnectNeighbor(LLSurface *surfacep) { if (getNeighborPatch(i)->mSurfacep == surfacep) { - setNeighborPatch(i, NULL); + setNeighborPatch(i, nullptr); mNormalsInvalid[i] = true; } } @@ -1188,5 +1188,5 @@ LLSurfacePatch *LLSurfacePatch::getNeighborPatch(const U32 direction) const void LLSurfacePatch::clearVObj() { - mVObjp = NULL; + mVObjp = nullptr; } diff --git a/indra/newview/llsurfacepatch.h b/indra/newview/llsurfacepatch.h index 505fc8c24c..f12dfdee12 100644 --- a/indra/newview/llsurfacepatch.h +++ b/indra/newview/llsurfacepatch.h @@ -124,7 +124,7 @@ class LLSurfacePatch const LLVector3d &getOriginGlobal() const; void setOriginGlobal(const LLVector3d &origin_global); - // connectivity -- each LLPatch points at 5 neighbors (or NULL) + // connectivity -- each LLPatch points at 5 neighbors (or nullptr) // +---+---+---+ // | | 2 | 5 | // +---+---+---+ diff --git a/indra/newview/llsyswellitem.cpp b/indra/newview/llsyswellitem.cpp index 6da55b0a0a..79db8b777d 100644 --- a/indra/newview/llsyswellitem.cpp +++ b/indra/newview/llsyswellitem.cpp @@ -35,8 +35,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/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 30142ad601..c2f805e9be 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -37,10 +37,10 @@ #include "lltoastpanel.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), + mChannel(nullptr), + mMessageList(nullptr), + mSysWellChiclet(nullptr), NOTIFICATION_WELL_ANCHOR_NAME("notification_well_panel"), IM_WELL_ANCHOR_NAME("im_well_panel"), mIsReshapedByUser(false) @@ -83,7 +83,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()); } @@ -99,7 +99,7 @@ void LLSysWellWindow::removeItemByID(const LLUUID& id) { if(mMessageList->removeItemByValue(id)) { - if (NULL != mSysWellChiclet) + if (nullptr != mSysWellChiclet) { mSysWellChiclet->updateWidget(isWindowEmpty()); } @@ -130,7 +130,7 @@ void LLSysWellWindow::initChannel() LLNotificationsUI::LLScreenChannelBase* channel = LLNotificationsUI::LLChannelManager::getInstance()->findChannelByID( LLNotificationsUI::NOTIFICATION_CHANNEL_UUID); mChannel = dynamic_cast(channel); - if(NULL == mChannel) + if(nullptr == mChannel) { LL_WARNS() << "LLSysWellWindow::initChannel() - could not get a requested screen channel" << LL_ENDL; } @@ -141,7 +141,7 @@ void LLSysWellWindow::setVisible(bool visible) { if (visible) { - if (NULL == getDockControl() && getDockTongue().notNull()) + if (nullptr == getDockControl() && getDockTongue().notNull()) { setDockControl(new LLDockControl( LLChicletBar::getInstance()->getChild(getAnchorViewName()), this, @@ -150,7 +150,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); @@ -222,7 +222,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"); @@ -335,11 +335,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(notification_id); - if (panel != NULL) + if (panel != nullptr) { res = panel->mChiclet; } @@ -352,7 +352,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/lltable.h b/indra/newview/lltable.h index e8099a3737..6173152a19 100644 --- a/indra/newview/lltable.h +++ b/indra/newview/lltable.h @@ -49,7 +49,7 @@ template class LLTable ~LLTable() { delete[] _tab; - _tab = NULL; + _tab = nullptr; } void init(const T& t) diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp index 8fd7c7ab9a..abf90c11b7 100644 --- a/indra/newview/llteleporthistory.cpp +++ b/indra/newview/llteleporthistory.cpp @@ -62,7 +62,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.cpp b/indra/newview/lltexturecache.cpp index 612af0d147..4e7eb3f667 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -102,7 +102,7 @@ class LLTextureCacheWorker : public LLWorkerClass : LLWorkerClass(cache, "LLTextureCacheWorker"), mID(id), mCache(cache), - mReadData(NULL), + mReadData(nullptr), mWriteData(data), mDataSize(datasize), mOffset(offset), @@ -219,7 +219,7 @@ bool LLTextureCacheLocalFileWorker::doRead() // << " / " << mDataSize << LL_ENDL; mDataSize = 0; ll_aligned_free_16(mReadData); - mReadData = NULL; + mReadData = nullptr; } else { @@ -359,7 +359,7 @@ bool LLTextureCacheRemoteWorker::doRead() << " / " << mDataSize << LL_ENDL; mDataSize = 0; ll_aligned_free_16(mReadData); - mReadData = NULL; + mReadData = nullptr; } else { @@ -418,7 +418,7 @@ bool LLTextureCacheRemoteWorker::doRead() << " incorrect number of bytes read from header: " << bytes_read << " / " << size << LL_ENDL; ll_aligned_free_16(mReadData); - mReadData = NULL; + mReadData = nullptr; mDataSize = -1; // failed done = true; } @@ -436,7 +436,7 @@ bool LLTextureCacheRemoteWorker::doRead() { LL_WARNS() << "LLTextureCacheWorker: " << mID << " failed to allocate memory for reading: " << mDataSize << LL_ENDL; - mReadData = NULL; + mReadData = nullptr; mDataSize = -1; // failed done = true; } @@ -471,7 +471,7 @@ bool LLTextureCacheRemoteWorker::doRead() llassert_always(mReadData); memcpy(data, mReadData, data_offset); ll_aligned_free_16(mReadData); - mReadData = NULL; + mReadData = nullptr; } else { @@ -483,7 +483,7 @@ bool LLTextureCacheRemoteWorker::doRead() } // Now use that buffer as the object read buffer - llassert_always(mReadData == NULL); + llassert_always(mReadData == nullptr); mReadData = data; // Read the data at last @@ -497,7 +497,7 @@ bool LLTextureCacheRemoteWorker::doRead() << " incorrect number of bytes read from body: " << bytes_read << " / " << file_size << LL_ENDL; ll_aligned_free_16(mReadData); - mReadData = NULL; + mReadData = nullptr; mDataSize = -1; // failed done = true; } @@ -507,7 +507,7 @@ bool LLTextureCacheRemoteWorker::doRead() LL_WARNS() << "LLTextureCacheWorker: " << mID << " failed to allocate memory for reading: " << mDataSize << LL_ENDL; ll_aligned_free_16(mReadData); - mReadData = NULL; + mReadData = nullptr; mDataSize = -1; // failed done = true; } @@ -701,7 +701,7 @@ bool LLTextureCacheRemoteWorker::doWrite() done = true; } } - mRawImage = NULL; + mRawImage = nullptr; // Clean up and exit return done; @@ -741,21 +741,21 @@ void LLTextureCacheWorker::finishWork(S32 param, bool completed) if (success) { mResponder->setData(mReadData, mDataSize, mImageSize, mImageFormat, mImageLocal); - mReadData = NULL; // responder owns data + mReadData = nullptr; // responder owns data mDataSize = 0; } else { LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("tcwfw - read fail"); ll_aligned_free_16(mReadData); - mReadData = NULL; + mReadData = nullptr; } } else { LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("tcwfw - write"); // write - mWriteData = NULL; // we never owned data + mWriteData = nullptr; // we never owned data mDataSize = 0; } mCache->addCompleted(mResponder, success); @@ -795,13 +795,13 @@ LLTextureCache::LLTextureCache(bool threaded) mHeaderMutex(), mListMutex(), mFastCacheMutex(), - mHeaderAPRFile(NULL), + mHeaderAPRFile(nullptr), mReadOnly(true), //do not allow to change the texture cache until setReadOnly() is called. mTexturesSizeTotal(0), mDoPurge(false), - mFastCachep(NULL), - mFastCachePoolp(NULL), - mFastCachePadBuffer(NULL) + mFastCachep(nullptr), + mFastCachePoolp(nullptr), + mFastCachePadBuffer(nullptr) { mHeaderAPRFilePoolp = new LLVolatileAPRPool(); // is_local = true, because this pool is for headers, headers are under own mutex } @@ -956,7 +956,7 @@ void LLTextureCache::purgeCache(ELLPath location, bool remove_dir) if (!mReadOnly) { setDirNames(location); - llassert_always(mHeaderAPRFile == NULL); + llassert_always(mHeaderAPRFile == nullptr); //remove the legacy cache if exists std::string texture_dir = mTexturesDirName ; @@ -1044,7 +1044,7 @@ S64 LLTextureCache::initCache(ELLPath location, S64 max_size, bool texture_cache LLAPRFile* LLTextureCache::openHeaderEntriesFile(bool readonly, S32 offset) { - llassert_always(mHeaderAPRFile == NULL); + llassert_always(mHeaderAPRFile == nullptr); apr_int32_t flags = readonly ? APR_READ|APR_BINARY : APR_READ|APR_WRITE|APR_BINARY; mHeaderAPRFile = new LLAPRFile(mHeaderEntriesFileName, flags, mHeaderAPRFilePoolp); if(offset > 0) @@ -1062,13 +1062,13 @@ void LLTextureCache::closeHeaderEntriesFile() } delete mHeaderAPRFile; - mHeaderAPRFile = NULL; + mHeaderAPRFile = nullptr; } void LLTextureCache::readEntriesHeader() { // mHeaderEntriesInfo initializes to default values so safe not to read it - llassert_always(mHeaderAPRFile == NULL); + llassert_always(mHeaderAPRFile == nullptr); if (LLAPRFile::isExist(mHeaderEntriesFileName, mHeaderAPRFilePoolp)) { LLAPRFile::readEx(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo), @@ -1100,7 +1100,7 @@ void LLTextureCache::setEntriesHeader() void LLTextureCache::writeEntriesHeader() { - llassert_always(mHeaderAPRFile == NULL); + llassert_always(mHeaderAPRFile == nullptr); if (!mReadOnly) { LLAPRFile::writeEx(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo), @@ -1258,7 +1258,7 @@ void LLTextureCache::updateEntryTimeStamp(S32 idx, Entry& entry) { if (!mReadOnly) { - entry.mTime = (U32)time(NULL); + entry.mTime = (U32)time(nullptr); mUpdatedEntryMap[idx] = entry ; } } @@ -1297,7 +1297,7 @@ bool LLTextureCache::updateEntry(S32& idx, Entry& entry, S32 new_image_size, S32 mTexturesSizeTotal -= entry.mBodySize ; mTexturesSizeTotal += new_body_size ; } - entry.mTime = (U32)time(NULL); + entry.mTime = (U32)time(nullptr); entry.mImageSize = new_image_size ; entry.mBodySize = new_body_size ; @@ -1328,7 +1328,7 @@ U32 LLTextureCache::openAndReadEntries(std::vector& entries) mFreeList.clear(); mTexturesSizeTotal = 0; - LLAPRFile* aprfile = NULL; + LLAPRFile* aprfile = nullptr; if(mUpdatedEntryMap.empty()) { aprfile = openHeaderEntriesFile(true, (S32)sizeof(EntriesInfo)); @@ -1842,7 +1842,7 @@ void LLTextureCache::purgeTextures(bool validate) LLTextureCacheWorker* LLTextureCache::getReader(handle_t handle) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - LLTextureCacheWorker* res = NULL; + LLTextureCacheWorker* res = nullptr; handle_map_t::iterator iter = mReaders.find(handle); if (iter != mReaders.end()) { @@ -1854,7 +1854,7 @@ LLTextureCacheWorker* LLTextureCache::getReader(handle_t handle) LLTextureCacheWorker* LLTextureCache::getWriter(handle_t handle) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - LLTextureCacheWorker* res = NULL; + LLTextureCacheWorker* res = nullptr; handle_map_t::iterator iter = mWriters.find(handle); if (iter != mWriters.end()) { @@ -1923,7 +1923,7 @@ LLTextureCache::handle_t LLTextureCache::readFromCache(const std::string& filena // so let the thread handle it LLMutexLock lock(&mWorkersMutex); LLTextureCacheWorker* worker = new LLTextureCacheLocalFileWorker(this, filename, id, - NULL, size, offset, 0, + nullptr, size, offset, 0, responder); handle_t handle = worker->read(); mReaders[handle] = worker; @@ -1938,8 +1938,8 @@ LLTextureCache::handle_t LLTextureCache::readFromCache(const LLUUID& id, // so let the thread handle it LLMutexLock lock(&mWorkersMutex); LLTextureCacheWorker* worker = new LLTextureCacheRemoteWorker(this, id, - NULL, size, offset, - 0, NULL, 0, responder); + nullptr, size, offset, + 0, nullptr, 0, responder); handle_t handle = worker->read(); mReaders[handle] = worker; return handle; @@ -1951,7 +1951,7 @@ bool LLTextureCache::readComplete(handle_t handle, bool abort) LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; lockWorkers(); handle_map_t::iterator iter = mReaders.find(handle); - LLTextureCacheWorker* worker = NULL; + LLTextureCacheWorker* worker = nullptr; bool complete = false; if (iter != mReaders.end()) { @@ -2011,7 +2011,7 @@ LLPointer LLTextureCache::readFromFastCache(const LLUUID& id, S32& d id_map_t::const_iterator iter = mHeaderIDMap.find(id); if(iter == mHeaderIDMap.end()) { - return NULL; //not in the cache + return nullptr; //not in the cache } offset = iter->second; @@ -2031,7 +2031,7 @@ LLPointer LLTextureCache::readFromFastCache(const LLUUID& id, S32& d { //cache corrupted or under thread race condition closeFastCache(); - return NULL; + return nullptr; } S32 image_size = head[0] * head[1] * head[2]; @@ -2040,7 +2040,7 @@ LLPointer LLTextureCache::readFromFastCache(const LLUUID& id, S32& d || head[3] < 0) //invalid { closeFastCache(); - return NULL; + return nullptr; } discardlevel = head[3]; @@ -2049,7 +2049,7 @@ LLPointer LLTextureCache::readFromFastCache(const LLUUID& id, S32& d { ll_aligned_free_16(data); closeFastCache(); - return NULL; + return nullptr; } closeFastCache(); @@ -2069,7 +2069,7 @@ bool LLTextureCache::writeToFastCache(LLUUID image_id, S32 id, LLPointerisBufferInvalid() || !raw->getData()) { - LL_ERRS() << "Attempted to write NULL raw image to fastcache" << LL_ENDL; + LL_ERRS() << "Attempted to write nullptr raw image to fastcache" << LL_ENDL; return false; } @@ -2184,7 +2184,7 @@ void LLTextureCache::closeFastCache(bool forced) } delete mFastCachep; - mFastCachep = NULL; + mFastCachep = nullptr; return; } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 52ec8c17c1..2657afb681 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -684,9 +684,9 @@ void LLFloaterTexturePicker::draw() //bool allow_copy = false; if( mOwner ) { - mTexturep = NULL; + mTexturep = nullptr; LLPointer old_material = mGLTFMaterial; - mGLTFMaterial = NULL; + mGLTFMaterial = nullptr; if (mImageAssetID.notNull()) { if (mInventoryPickType == PICK_MATERIAL) @@ -712,7 +712,7 @@ void LLFloaterTexturePicker::draw() } else { - LLPointer texture = NULL; + LLPointer texture = nullptr; mGLTFPreview = nullptr; if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID)) @@ -723,7 +723,7 @@ void LLFloaterTexturePicker::draw() if (obj) { LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID); - texture = viewerTexture ? dynamic_cast(viewerTexture) : NULL; + texture = viewerTexture ? dynamic_cast(viewerTexture) : nullptr; } } @@ -1958,7 +1958,7 @@ void LLTextureCtrl::closeDependentFloater() LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); if( floaterp && floaterp->isInVisibleChain()) { - floaterp->setOwner(NULL); + floaterp->setOwner(nullptr); floaterp->setVisible(false); floaterp->closeFloater(); } @@ -2042,7 +2042,7 @@ void LLTextureCtrl::onFloaterClose() { mOnCloseCallback(this,LLSD()); } - floaterp->setOwner(NULL); + floaterp->setOwner(nullptr); } mFloaterHandle.markDead(); @@ -2249,13 +2249,13 @@ void LLTextureCtrl::draw() { mBorder->setKeyboardFocusHighlight(hasFocus()); - LLPointer preview = NULL; + LLPointer preview = nullptr; if (!mValid) { - mTexturep = NULL; - mGLTFMaterial = NULL; - mGLTFPreview = NULL; + mTexturep = nullptr; + mGLTFMaterial = nullptr; + mGLTFPreview = nullptr; } else if (!mImageAssetID.isNull()) { @@ -2265,9 +2265,9 @@ void LLTextureCtrl::draw() if (obj) { LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID); - mTexturep = viewerTexture ? dynamic_cast(viewerTexture) : NULL; - mGLTFMaterial = NULL; - mGLTFPreview = NULL; + mTexturep = viewerTexture ? dynamic_cast(viewerTexture) : nullptr; + mGLTFMaterial = nullptr; + mGLTFPreview = nullptr; preview = mTexturep; } @@ -2277,8 +2277,8 @@ void LLTextureCtrl::draw() if (preview.isNull()) { LLPointer old_material = mGLTFMaterial; - mGLTFMaterial = NULL; - mTexturep = NULL; + mGLTFMaterial = nullptr; + mTexturep = nullptr; if (mInventoryPickType == PICK_MATERIAL) { mGLTFMaterial = gGLTFMaterialList.getMaterial(mImageAssetID); @@ -2313,9 +2313,9 @@ void LLTextureCtrl::draw() } else//mImageAssetID == LLUUID::null { - mTexturep = NULL; - mGLTFMaterial = NULL; - mGLTFPreview = NULL; + mTexturep = nullptr; + mGLTFMaterial = nullptr; + mGLTFPreview = nullptr; } // Border diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 51ade60827..11f30d3245 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -73,7 +73,7 @@ LLTrace::SampleStatHandle LLTextureFetch::sTexDecodeLatency("texture LLTrace::SampleStatHandle LLTextureFetch::sCacheWriteLatency("texture_write_latency"); LLTrace::SampleStatHandle LLTextureFetch::sTexFetchLatency("texture_fetch_latency"); -LLTextureFetchTester* LLTextureFetch::sTesterp = NULL ; +LLTextureFetchTester* LLTextureFetch::sTesterp = nullptr ; const std::string sTesterName("TextureFetchTester"); ////////////////////////////////////////////////////////////////////////////// @@ -904,7 +904,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mImageCodec(IMG_CODEC_INVALID), mMetricsStartTime(0), mHttpHandle(LLCORE_HTTP_HANDLE_INVALID), - mHttpBufferArray(NULL), + mHttpBufferArray(nullptr), mHttpPolicyClass(mFetcher->mHttpPolicyClass), mHttpActive(false), mHttpReplySize(0U), @@ -955,11 +955,11 @@ LLTextureFetchWorker::~LLTextureFetchWorker() { mFetcher->mTextureCache->writeComplete(mCacheWriteHandle, true); } - mFormattedImage = NULL; + mFormattedImage = nullptr; if (mHttpBufferArray) { mHttpBufferArray->release(); - mHttpBufferArray = NULL; + mHttpBufferArray = nullptr; } unlockWorkMutex(); // -Mw mFetcher->removeFromHTTPQueue(mID, (S32Bytes)0); @@ -1011,7 +1011,7 @@ void LLTextureFetchWorker::resetFormattedData() if (mHttpBufferArray) { mHttpBufferArray->release(); - mHttpBufferArray = NULL; + mHttpBufferArray = nullptr; } if (mFormattedImage.notNull()) { @@ -1109,7 +1109,7 @@ bool LLTextureFetchWorker::doWork(S32 param) mStateTimersMap[i] = 0; } mSkippedStatesTime = 0; - mRawImage = NULL ; + mRawImage = nullptr ; mRequestedDiscard = -1; mLoadedDiscard = -1; mDecodedDiscard = -1; @@ -1124,7 +1124,7 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mHttpBufferArray) { mHttpBufferArray->release(); - mHttpBufferArray = NULL; + mHttpBufferArray = nullptr; } mHttpReplySize = 0; mHttpReplyOffset = 0; @@ -1622,7 +1622,7 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mHttpBufferArray) { mHttpBufferArray->release(); - mHttpBufferArray = NULL; + mHttpBufferArray = nullptr; } // abort. @@ -1700,7 +1700,7 @@ bool LLTextureFetchWorker::doWork(S32 param) // Done with buffer array mHttpBufferArray->release(); - mHttpBufferArray = NULL; + mHttpBufferArray = nullptr; mHttpReplySize = 0; mHttpReplyOffset = 0; @@ -1786,8 +1786,8 @@ bool LLTextureFetchWorker::doWork(S32 param) } mDecodeTimer.reset(); - mRawImage = NULL; - mAuxImage = NULL; + mRawImage = nullptr; + mAuxImage = nullptr; // if we have the entire image data (and the image is not J2C), decode the full res image // DO NOT decode a higher res j2c than was requested. This is a waste of time and memory. @@ -1828,7 +1828,7 @@ bool LLTextureFetchWorker::doWork(S32 param) // Cache file should be deleted, try again LL_DEBUGS(LOG_TXT) << mID << ": Decode of cached file failed (removed), retrying" << LL_ENDL; llassert_always(mDecodeHandle == 0); - mFormattedImage = NULL; + mFormattedImage = nullptr; ++mRetryAttempt; setState(INIT); //return false; @@ -2063,7 +2063,7 @@ void LLTextureFetchWorker::endWork(S32 param, bool aborted) // LL::ThreadPool has no operation to cancel a particular work item mDecodeHandle = 0; } - mFormattedImage = NULL; + mFormattedImage = nullptr; } ////////////////////////////////////////////////////////////////////////////// @@ -2194,7 +2194,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response, // *TODO: set the formatted image data here directly to avoid the copy // Hold on to body for later copy - llassert_always(NULL == mHttpBufferArray); + llassert_always(nullptr == mHttpBufferArray); body->addRef(); mHttpBufferArray = body; @@ -2234,7 +2234,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response, } mHaveAllData = true; llassert_always(mDecodeHandle == 0); - mFormattedImage = NULL; // discard any previous data we had + mFormattedImage = nullptr; // discard any previous data we had } else if (data_size < mRequestedSize) { @@ -2246,7 +2246,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response, LL_WARNS(LOG_TXT) << "data_size = " << data_size << " > requested: " << mRequestedSize << LL_ENDL; mHaveAllData = true; llassert_always(mDecodeHandle == 0); - mFormattedImage = NULL; // discard any previous data we had + mFormattedImage = nullptr; // discard any previous data we had } } else @@ -2445,7 +2445,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, bool threaded, bool qa_mod mHTTPTextureBits(0), mTotalHTTPRequests(0), mQAMode(qa_mode), - mHttpRequest(NULL), + mHttpRequest(nullptr), mHttpOptions(), mHttpOptionsWithHeaders(), mHttpHeaders(), @@ -2484,7 +2484,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, bool threaded, bool qa_mod if (!sTesterp->isValid()) { delete sTesterp; - sTesterp = NULL; + sTesterp = nullptr; } } } @@ -2503,7 +2503,7 @@ LLTextureFetch::~LLTextureFetch() mHttpWaitResource.clear(); delete mHttpRequest; - mHttpRequest = NULL; + mHttpRequest = nullptr; // ~LLQueuedThread() called here } @@ -2529,7 +2529,7 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L LL_WARNS(LOG_TXT) << "LLTextureFetch::createRequest " << id << " called with multiple hosts: " << host << " != " << worker->mHost << LL_ENDL; removeRequest(worker, true); - worker = NULL; + worker = nullptr; return CREATE_REQUEST_ERROR_MHOSTS; } } @@ -2753,7 +2753,7 @@ U32 LLTextureFetch::getTotalNumHTTPRequests() LLTextureFetchWorker* LLTextureFetch::getWorkerAfterLock(const LLUUID& id) { LL_PROFILE_ZONE_SCOPED; - LLTextureFetchWorker* res = NULL; + LLTextureFetchWorker* res = nullptr; map_t::iterator iter = mRequestMap.find(id); if (iter != mRequestMap.end()) { @@ -3007,7 +3007,7 @@ void LLTextureFetch::shutDownTextureCacheThread() if(mTextureCache) { llassert_always(mTextureCache->isQuitting() || mTextureCache->isStopped()) ; - mTextureCache = NULL ; + mTextureCache = nullptr ; } } @@ -3094,7 +3094,7 @@ void LLTextureFetchWorker::setState(e_state new_state) LLViewerRegion* LLTextureFetchWorker::getRegion() { - LLViewerRegion* region = NULL; + LLViewerRegion* region = nullptr; if (mHost.isInvalid()) { region = gAgent.getRegion(); @@ -3707,7 +3707,7 @@ LLTextureFetchTester::LLTextureFetchTester() : LLMetricPerformanceTesterBasic(sT LLTextureFetchTester::~LLTextureFetchTester() { outputTestResults(); - LLTextureFetch::sTesterp = NULL; + LLTextureFetch::sTesterp = nullptr; } //virtual diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 851d6c11a0..1a6fbca581 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -285,7 +285,7 @@ class LLTextureFetch : public LLWorkerThread /** * Returns the first TFRequest object in the command queue or - * NULL if none is present. + * nullptr if none is present. * * Caller acquires ownership of the object and must dispose of it. * diff --git a/indra/newview/lltextureinfo.cpp b/indra/newview/lltextureinfo.cpp index 514064cf49..6a50698477 100644 --- a/indra/newview/lltextureinfo.cpp +++ b/indra/newview/lltextureinfo.cpp @@ -209,8 +209,8 @@ void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64Microsecon object_cache["vo_entries_max"] = LLSD::Integer(LLVOCache::getInstance()->getCacheEntriesMax()); object_cache["vo_entries_curent"] = LLSD::Integer(LLVOCache::getInstance()->getCacheEntries()); object_cache["vo_active_entries"] = LLSD::Integer(LLWorld::getInstance()->getNumOfActiveCachedObjects()); - U64 region_hit_count = gAgent.getRegion() != NULL ? gAgent.getRegion()->getRegionCacheHitCount() : 0; - U64 region_miss_count = gAgent.getRegion() != NULL ? gAgent.getRegion()->getRegionCacheMissCount() : 0; + U64 region_hit_count = gAgent.getRegion() != nullptr ? gAgent.getRegion()->getRegionCacheHitCount() : 0; + U64 region_miss_count = gAgent.getRegion() != nullptr ? gAgent.getRegion()->getRegionCacheMissCount() : 0; F64 region_vocache_hit_rate = 0; if (region_hit_count > 0 || region_miss_count > 0) { diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 8cbede8303..df9974079e 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -60,7 +60,7 @@ #include "llvoavatarself.h" #include "lltexlayer.h" -LLTextureView *gTextureView = NULL; +LLTextureView *gTextureView = nullptr; #define HIGH_PRIORITY 100000000.f diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 3c939a88e5..adaff408dc 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -107,13 +107,13 @@ LLToast::LLToast(const LLToast::Params& p) mCanFade(p.can_fade), mCanBeStored(p.can_be_stored), mHideBtnEnabled(p.enable_hide_btn), - mHideBtn(NULL), - mPanel(NULL), + mHideBtn(nullptr), + mPanel(nullptr), mNotification(p.notification), mIsHidden(false), mHideBtnPressed(false), mIsTip(p.is_tip), - mWrapperPanel(NULL), + mWrapperPanel(nullptr), mIsFading(false), mIsHovered(false) { diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 05ac9dacf3..b07f2e05da 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -51,7 +51,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; //----------------------------------------------------------------------------- // Private methods @@ -65,7 +65,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal mDefaultOption( 0 ), 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 diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp index 95653dc19b..8b733f0888 100644 --- a/indra/newview/lltoastgroupnotifypanel.cpp +++ b/indra/newview/lltoastgroupnotifypanel.cpp @@ -53,7 +53,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(); @@ -174,10 +174,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(); @@ -192,7 +192,7 @@ void LLToastGroupNotifyPanel::onClickOk() void LLToastGroupNotifyPanel::onClickAttachment() { - if (mInventoryOffer != NULL) { + if (mInventoryOffer != nullptr) { mInventoryOffer->forceResponse(IOR_ACCEPT); LLTextBox * pAttachLink = getChild ("attachment"); @@ -209,7 +209,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 42ee30409d..31b1be5541 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -43,8 +43,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), mAvatarName(nullptr), + mTime(nullptr), mMessage(nullptr), mGroupIcon(nullptr) { buildFromFile( "panel_instant_message.xml"); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 6c0b3bfa13..60566c8a65 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -58,7 +58,7 @@ LLToastNotifyPanel::button_click_signal_t LLToastNotifyPanel::sButtonClickSignal LLToastNotifyPanel::LLToastNotifyPanel(const LLNotificationPtr& notification, const LLRect& rect, bool show_images) : LLCheckBoxToastPanel(notification) , LLInstanceTracker(notification->getID()) -, mTextBox(NULL) +, mTextBox(nullptr) { init(rect, show_images); } @@ -149,8 +149,8 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectorgetRect().getWidth(); - LLButton* ignore_btn = NULL; - LLButton* mute_btn = NULL; + LLButton* ignore_btn = nullptr; + LLButton* mute_btn = nullptr; for (std::vector::const_iterator it = buttons.begin(); it != buttons.end(); it++) { if (-2 == it->first) @@ -189,7 +189,7 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectorgetRect()); S32 ignore_btn_left = max_width - ignore_btn_rect.getWidth(); @@ -201,7 +201,7 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectorgetRect()); // Place mute (Block) button to the left of the ignore button. @@ -438,9 +438,9 @@ void LLToastNotifyPanel::deleteAllChildren() // some visibility changes, re-init and reshape will attempt to // use mTextBox or other variables. Reset to avoid crashes // and other issues. - mTextBox = NULL; - mInfoPanel = NULL; - mControlPanel = NULL; + mTextBox = nullptr; + mInfoPanel = nullptr; + mControlPanel = nullptr; mNumOptions = 0; mNumButtons = 0; mAddedDefaultBtn = false; @@ -522,7 +522,7 @@ void LLIMToastNotifyPanel::compactButtons() for (child_list_t::const_reverse_iterator it = children->rbegin(); it != children->rend(); it++) { LLButton * button = dynamic_cast (*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 d694513aba..d44ba0e93c 100644 --- a/indra/newview/lltoastnotifypanel.h +++ b/indra/newview/lltoastnotifypanel.h @@ -146,7 +146,7 @@ class LLIMToastNotifyPanel : public LLToastNotifyPanel const LLUUID& session_id, const LLRect& rect = LLRect::null, bool show_images = true, - LLTextBase* parent_text = NULL); + LLTextBase* parent_text = nullptr); void compactButtons(); diff --git a/indra/newview/lltoastpanel.cpp b/indra/newview/lltoastpanel.cpp index 6f8691bb26..00280f550a 100644 --- a/indra/newview/lltoastpanel.cpp +++ b/indra/newview/lltoastpanel.cpp @@ -115,7 +115,7 @@ LLToastPanel* LLToastPanel::buidPanelFromNotification( const LLNotificationPtr& notification) { LL_PROFILE_ZONE_SCOPED; - LLToastPanel* res = NULL; + LLToastPanel* res = nullptr; //process tip toast panels if ("notifytip" == notification->getType()) @@ -152,7 +152,7 @@ LLToastPanel* LLToastPanel::buidPanelFromNotification( LLCheckBoxToastPanel::LLCheckBoxToastPanel(const LLNotificationPtr& p_ntf) : LLToastPanel(p_ntf), -mCheck(NULL) +mCheck(nullptr) { } diff --git a/indra/newview/lltoastpanel.h b/indra/newview/lltoastpanel.h index eae3718398..93bde0f7ac 100644 --- a/indra/newview/lltoastpanel.h +++ b/indra/newview/lltoastpanel.h @@ -74,9 +74,9 @@ class LLCheckBoxToastPanel : public LLToastPanel virtual ~LLCheckBoxToastPanel() {}; // set checkboxes acording to defaults from form - void setCheckBoxes(const S32 &h_pad, const S32 &v_pad, LLView *parent_view = NULL); + void setCheckBoxes(const S32 &h_pad, const S32 &v_pad, LLView *parent_view = nullptr); // set single checkbox - bool setCheckBox(const std::string&, const std::string&, const commit_signal_t::slot_type& cb, const S32 &h_pad, const S32 &v_pad, LLView *parent_view = NULL); + bool setCheckBox(const std::string&, const std::string&, const commit_signal_t::slot_type& cb, const S32 &h_pad, const S32 &v_pad, LLView *parent_view = nullptr); protected: void onCommitCheckbox(LLUICtrl* ctrl); diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index c595fc42ca..83d2988d5f 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -70,7 +70,7 @@ bool LLTool::handleAnyMouseClick(S32 x, S32 y, MASK mask, EMouseClickType clickt // 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; @@ -172,7 +172,7 @@ void LLTool::setMouseCapture( bool b ) else if( hasMouseCapture() ) { - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture( nullptr ); } } @@ -195,7 +195,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; } static LLCachedControl alt_zoom(gSavedSettings, "EnableAltZoom", true); @@ -206,5 +206,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 10af156395..45d9b99d06 100644 --- a/indra/newview/lltool.h +++ b/indra/newview/lltool.h @@ -42,7 +42,7 @@ 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 @@ -72,9 +72,9 @@ class LLTool virtual const std::string& getName() const { 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; } diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index c1ec5fa183..029e534fb3 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -46,7 +46,7 @@ #include "llviewercontrol.h" // HACK for destinations guide on startup #include "llinventorymodel.h" // HACK to disable starter avatars button for NUX -LLToolBarView* gToolBarView = NULL; +LLToolBarView* gToolBarView = nullptr; static LLDefaultChildRegistry::Register r("toolbar_view"); @@ -71,14 +71,14 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p) : LLUICtrl(p), mDragStarted(false), mShowToolbars(true), - mDragToolbarButton(NULL), - mDragItem(NULL), + mDragToolbarButton(nullptr), + mDragItem(nullptr), mToolbarsLoaded(false), - mBottomToolbarPanel(NULL) + mBottomToolbarPanel(nullptr) { for (S32 i = 0; i < LLToolBarEnums::TOOLBAR_COUNT; i++) { - mToolbars[i] = NULL; + mToolbars[i] = nullptr; } } @@ -226,7 +226,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; @@ -324,7 +324,7 @@ bool LLToolBarView::loadToolbars(bool force_default) { LLViewerInventoryCategory* my_outfits_cat = gInventory.getCategory(gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS)); LL_WARNS() << "First login: checking for NUX user." << LL_ENDL; - if (my_outfits_cat != NULL && my_outfits_cat->getDescendentCount() > 0) + if (my_outfits_cat != nullptr && my_outfits_cat->getDescendentCount() > 0) { LL_WARNS() << "First login: My Outfits folder is not empty, removing the avatar picker button." << LL_ENDL; for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++) @@ -421,7 +421,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); @@ -470,7 +470,7 @@ void LLToolBarView::onToolBarButtonAdded(LLView* button) llassert(incoming); LLDockControl* dock_control = incoming->getDockControl(); - if (dock_control->getDock() == NULL) + if (dock_control->getDock() == nullptr) { incoming->dockToToolbarButton("speak"); } @@ -482,7 +482,7 @@ void LLToolBarView::onToolBarButtonAdded(LLView* button) llassert(outgoing); LLDockControl* dock_control = outgoing->getDockControl(); - if (dock_control->getDock() == NULL) + if (dock_control->getDock() == nullptr) { outgoing->dockToToolbarButton("speak"); } @@ -515,7 +515,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()) @@ -524,7 +524,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") @@ -629,7 +629,7 @@ bool LLToolBarView::handleDropTool( void* cargo_data, EDragAndDropType cargo_typ if (cargo_type == DAD_PERSON) { // DAD_PERSON means that cargo_data contains an uuid, not an LLInventoryObject - resetDragTool(NULL); + resetDragTool(nullptr); return false; } bool handled = false; @@ -648,7 +648,7 @@ bool LLToolBarView::handleDropTool( void* cargo_data, EDragAndDropType cargo_typ // 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) { @@ -684,7 +684,7 @@ bool LLToolBarView::handleDropTool( void* cargo_data, EDragAndDropType cargo_typ } } - resetDragTool(NULL); + resetDragTool(nullptr); return handled; } diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index cf7b123fa7..bd4f449e9e 100644 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -462,7 +462,7 @@ void LLToolBrushLand::handleDeselect() { if( gEditMenuHandler == this ) { - gEditMenuHandler = NULL; + gEditMenuHandler = nullptr; } LLViewerParcelMgr::getInstance()->setSelectionVisible(true); mBrushSelected = false; @@ -592,7 +592,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/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index c6e59a81c9..e9881352b6 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -56,7 +56,7 @@ extern LLControlGroup gSavedSettings; // we use this in various places instead of NULL -static LLPointer sNullTool(new LLTool(std::string("null"), NULL)); +static LLPointer sNullTool(new LLTool(std::string("null"), nullptr)); //----------------------------------------------------------------------- // LLToolComposite @@ -84,7 +84,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) { } @@ -144,7 +144,7 @@ LLToolCompInspect::LLToolCompInspect() LLToolCompInspect::~LLToolCompInspect() { delete mSelectRect; - mSelectRect = NULL; + mSelectRect = nullptr; } bool LLToolCompInspect::handleMouseDown(S32 x, S32 y, MASK mask) @@ -249,10 +249,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) @@ -698,14 +698,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 4b945967d1..3ccb22e0f8 100644 --- a/indra/newview/lltoolcomp.h +++ b/indra/newview/lltoolcomp.h @@ -233,7 +233,7 @@ class LLToolCompGun : public LLToolComposite, public LLSingleton virtual void onMouseCaptureLost() override; virtual void handleSelect() override; virtual void handleDeselect() override; - virtual LLTool* getOverrideTool(MASK mask) override { return NULL; } + virtual LLTool* getOverrideTool(MASK mask) override { return nullptr; } protected: LLToolGun* mGun; diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index f78ff2226c..a0f9b637aa 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -210,7 +210,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) @@ -283,7 +283,7 @@ LLToolDragAndDrop::LLDragAndDropDictionary::LLDragAndDropDictionary() }; LLToolDragAndDrop::LLToolDragAndDrop() -: LLTool(std::string("draganddrop"), NULL), +: LLTool(std::string("draganddrop"), nullptr), mCargoCount(0), mDragStartX(0), mDragStartY(0), @@ -355,7 +355,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); } @@ -412,7 +412,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; auto count = llmin(cargo_ids.size(), types.size()); uuid_set_t cat_ids; for (size_t i = 0; i < count; ++i) @@ -423,7 +423,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()); } @@ -812,7 +812,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); } @@ -827,7 +827,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) @@ -2105,7 +2105,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: @@ -2176,7 +2176,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; @@ -2208,7 +2208,7 @@ static void show_object_sharing_confirmation(const std::string name, { if (!inv_item) { - llassert(NULL != inv_item); + llassert(nullptr != inv_item); return; } LLSD substitutions; @@ -2273,7 +2273,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; @@ -2979,7 +2979,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; @@ -2994,8 +2994,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) { @@ -3195,8 +3195,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; @@ -3309,7 +3309,7 @@ EAcceptance LLToolDragAndDrop::dad3dAssetOnLand( if((rv >= ACCEPT_YES_COPY_SINGLE) && drop) { - createContainer(copyable_items, NULL); + createContainer(copyable_items, nullptr); } return rv; @@ -3320,13 +3320,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)) @@ -3367,14 +3367,14 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory( if(item) return item; if(cat) return cat; - return NULL; + return nullptr; } /* LLInventoryObject* LLToolDragAndDrop::locateMultipleInventory(LLViewerInventoryCategory::cat_array_t& cats, LLViewerInventoryItem::item_array_t& items) { - if(mCargoIDs.size() == 0) return NULL; + if(mCargoIDs.size() == 0) return nullptr; if((mSource == SOURCE_AGENT) || (mSource == SOURCE_LIBRARY)) { // The object should be in user inventory. @@ -3435,7 +3435,7 @@ LLInventoryObject* LLToolDragAndDrop::locateMultipleInventory(LLViewerInventoryC } if(items.size()) return items[0]; if(cats.size()) return cats[0]; - return NULL; + return nullptr; } */ diff --git a/indra/newview/lltoolfocus.h b/indra/newview/lltoolfocus.h index c2460e7aa4..6471a51d05 100644 --- a/indra/newview/lltoolfocus.h +++ b/indra/newview/lltoolfocus.h @@ -47,7 +47,7 @@ class LLToolCamera virtual void handleSelect() override; virtual void handleDeselect() override; - virtual LLTool* getOverrideTool(MASK mask) override { return NULL; } + virtual LLTool* getOverrideTool(MASK mask) override { return nullptr; } void setClickPickPending() { mClickPickPending = true; } static void pickCallback(const LLPickInfo& pick_info); diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index f3ec655f00..80822309de 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -64,7 +64,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; // @@ -206,7 +206,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; @@ -217,7 +217,7 @@ bool LLToolGrabBase::handleObjectHit(const LLPickInfo& info) if (gGrabTransientTool) { gBasicToolset->selectTool( gGrabTransientTool ); - gGrabTransientTool = NULL; + gGrabTransientTool = nullptr; } return true; } @@ -322,7 +322,7 @@ bool LLToolGrabBase::handleObjectHit(const LLPickInfo& info) && (mMode == GRAB_NONPHYSICAL || mMode == GRAB_LOCKED)) { gBasicToolset->selectTool( gGrabTransientTool ); - gGrabTransientTool = NULL; + gGrabTransientTool = nullptr; } return true; @@ -995,7 +995,7 @@ bool LLToolGrabBase::handleMouseUp(S32 x, S32 y, MASK mask) if (gGrabTransientTool) { gBasicToolset->selectTool( gGrabTransientTool ); - gGrabTransientTool = NULL; + gGrabTransientTool = nullptr; } } diff --git a/indra/newview/lltoolgrab.h b/indra/newview/lltoolgrab.h index 7806cbc24f..bd295eea91 100644 --- a/indra/newview/lltoolgrab.h +++ b/indra/newview/lltoolgrab.h @@ -55,7 +55,7 @@ const MASK DEFAULT_GRAB_MASK = MASK_CONTROL; class LLToolGrabBase : public LLTool { public: - LLToolGrabBase(LLToolComposite* composite=NULL); + LLToolGrabBase(LLToolComposite* composite=nullptr); ~LLToolGrabBase(); /*virtual*/ bool handleHover(S32 x, S32 y, MASK mask); diff --git a/indra/newview/lltoolgun.h b/indra/newview/lltoolgun.h index f9bb9bb39a..d04a31dc77 100644 --- a/indra/newview/lltoolgun.h +++ b/indra/newview/lltoolgun.h @@ -34,7 +34,7 @@ class LLToolGun : public LLTool { public: - LLToolGun( LLToolComposite* composite=NULL ); + LLToolGun( LLToolComposite* composite=nullptr ); virtual void draw(); @@ -44,7 +44,7 @@ class LLToolGun : public LLTool virtual bool handleMouseDown(S32 x, S32 y, MASK mask); virtual bool handleHover(S32 x, S32 y, MASK mask); - virtual LLTool* getOverrideTool(MASK mask) { return NULL; } + virtual LLTool* getOverrideTool(MASK mask) { return nullptr; } virtual bool clipMouseWhenDown() { return false; } private: bool mIsSelected; diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 07963a7bed..183303ac44 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -60,25 +60,25 @@ // Used when app not active to avoid processing hover. -LLTool* gToolNull = NULL; +LLTool* gToolNull = nullptr; -LLToolset* gBasicToolset = NULL; -LLToolset* gCameraToolset = NULL; -//LLToolset* gLandToolset = NULL; -LLToolset* gMouselookToolset = NULL; -LLToolset* gFaceEditToolset = NULL; +LLToolset* gBasicToolset = nullptr; +LLToolset* gCameraToolset = nullptr; +//LLToolset* gLandToolset = nullptr; +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)); @@ -128,19 +128,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 @@ -206,7 +206,7 @@ LLTool* LLToolMgr::getCurrentTool() } else { - mOverrideTool = mBaseTool ? mBaseTool->getOverrideTool(override_mask) : NULL; + mOverrideTool = mBaseTool ? mBaseTool->getOverrideTool(override_mask) : nullptr; // use override tool if available otherwise drop back to base tool cur_tool = mOverrideTool ? mOverrideTool : mBaseTool; @@ -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; } ///////////////////////////////////////////////////// @@ -453,7 +453,7 @@ void LLToolset::selectTool(LLTool* tool) void LLToolset::selectToolByIndex( S32 index ) { - LLTool *tool = (index >= 0 && index < (S32)mToolList.size()) ? mToolList[index] : NULL; + LLTool *tool = (index >= 0 && index < (S32)mToolList.size()) ? mToolList[index] : nullptr; if (tool) { mSelectedTool = tool; @@ -463,21 +463,21 @@ void LLToolset::selectToolByIndex( S32 index ) bool LLToolset::isToolSelected( S32 index ) { - LLTool *tool = (index >= 0 && index < (S32)mToolList.size()) ? mToolList[index] : NULL; + LLTool *tool = (index >= 0 && index < (S32)mToolList.size()) ? mToolList[index] : nullptr; return (tool == mSelectedTool); } void LLToolset::selectFirstTool() { - mSelectedTool = (0 < mToolList.size()) ? mToolList[0] : NULL; + mSelectedTool = (0 < mToolList.size()) ? mToolList[0] : nullptr; LLToolMgr::getInstance()->setCurrentTool( mSelectedTool ); } 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 6cfdbaac06..08f88820d7 100644 --- a/indra/newview/lltoolmgr.h +++ b/indra/newview/lltoolmgr.h @@ -92,7 +92,7 @@ class LLToolMgr : public LLSingleton 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 fb62ba9bba..207919d201 100644 --- a/indra/newview/lltoolmorph.h +++ b/indra/newview/lltoolmorph.h @@ -79,7 +79,7 @@ class LLVisualParamHint : public LLViewerDynamicTexture 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? diff --git a/indra/newview/lltoolobjpicker.cpp b/indra/newview/lltoolobjpicker.cpp index 20089b15a3..d1f184d224 100644 --- a/indra/newview/lltoolobjpicker.cpp +++ b/indra/newview/lltoolobjpicker.cpp @@ -46,11 +46,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 ) { } @@ -138,8 +138,8 @@ void LLToolObjPicker::onMouseCaptureLost() { mExitCallback(mExitCallbackData); - mExitCallback = NULL; - mExitCallbackData = NULL; + mExitCallback = nullptr; + mExitCallbackData = nullptr; } mPicked = false; diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 0a69be528f..6141c64e44 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -260,13 +260,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) { @@ -307,7 +307,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) } @@ -395,7 +395,7 @@ bool LLToolPie::handleLeftClickPick() // put focus back "in world" if (gFocusMgr.getKeyboardFocus()) { - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } bool touchable = object @@ -498,7 +498,7 @@ U8 final_click_action(LLViewerObject* obj) ECursorType LLToolPie::cursorFromObject(LLViewerObject* object) { - LLViewerObject* parent = NULL; + LLViewerObject* parent = nullptr; if (object) { parent = object->getRootEdit(); @@ -559,8 +559,8 @@ ECursorType LLToolPie::cursorFromObject(LLViewerObject* object) void LLToolPie::resetSelection() { - mLeftClickSelection = NULL; - mClickActionObject = NULL; + mLeftClickSelection = nullptr; + mClickActionObject = nullptr; mClickAction = 0; } @@ -631,7 +631,7 @@ bool LLToolPie::walkToClickedLocation() mAutoPilotDestination->setDuration(3.f); LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; - gAgent.startAutoPilotGlobal(pos, std::string(), NULL, NULL, NULL, 0.f, 0.03f, false); + gAgent.startAutoPilotGlobal(pos, std::string(), nullptr, nullptr, nullptr, 0.f, 0.03f, false); LLFirstUse::notMoving(false); showVisualContextMenuEffect(); return true; @@ -661,7 +661,7 @@ bool LLToolPie::teleportToClickedLocation() pick_rigged); } LLViewerObject* objp = mHoverPick.getObject(); - LLViewerObject* parentp = objp ? objp->getRootEdit() : NULL; + LLViewerObject* parentp = objp ? objp->getRootEdit() : nullptr; if (objp && (objp->getAvatar() == gAgentAvatarp || objp == gAgentAvatarp)) // ex: nametag { @@ -741,7 +741,7 @@ bool LLToolPie::handleHover(S32 x, S32 y, MASK mask) { bool pick_rigged = false; //gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick"); mHoverPick = gViewerWindow->pickImmediate(x, y, false, pick_rigged); - LLViewerObject *parent = NULL; + LLViewerObject *parent = nullptr; LLViewerObject *object = mHoverPick.getObject(); LLSelectMgr::getInstance()->setHoverObject(object, mHoverPick.mObjectFace); if (object) @@ -1156,11 +1156,11 @@ bool LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l if(tep) { has_media = tep->hasMedia(); - const LLMediaEntry* mep = has_media ? tep->getMediaData() : NULL; + const LLMediaEntry* mep = has_media ? tep->getMediaData() : nullptr; if (mep) { viewer_media_t media_impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID()); - LLPluginClassMedia* media_plugin = NULL; + LLPluginClassMedia* media_plugin = nullptr; if (media_impl.notNull() && (media_impl->hasMedia())) { @@ -1325,13 +1325,13 @@ void LLToolPie::playCurrentMedia(const LLPickInfo& info) if (!tep) return; - const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL; + const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : nullptr; if(!mep) return; //TODO: Can you Use it? - LLPluginClassMedia* media_plugin = NULL; + LLPluginClassMedia* media_plugin = nullptr; viewer_media_t media_impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID()); @@ -1377,13 +1377,13 @@ void LLToolPie::VisitHomePage(const LLPickInfo& info) if (!tep) return; - const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL; + const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : nullptr; if(!mep) return; //TODO: Can you Use it? - LLPluginClassMedia* media_plugin = NULL; + LLPluginClassMedia* media_plugin = nullptr; viewer_media_t media_impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID()); @@ -1410,7 +1410,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 @@ -1660,7 +1660,7 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) if (!tep) return false; - LLMediaEntry* mep = (tep->hasMedia()) ? tep->getMediaData() : NULL; + LLMediaEntry* mep = (tep->hasMedia()) ? tep->getMediaData() : nullptr; if (!mep) return false; @@ -1724,7 +1724,7 @@ bool LLToolPie::handleMediaDblClick(const LLPickInfo& pick) if (!tep) return false; - LLMediaEntry* mep = (tep->hasMedia()) ? tep->getMediaData() : NULL; + LLMediaEntry* mep = (tep->hasMedia()) ? tep->getMediaData() : nullptr; if (!mep) return false; @@ -1779,7 +1779,7 @@ bool LLToolPie::handleMediaHover(const LLPickInfo& pick) if(!tep) return false; - const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL; + const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : nullptr; if (mep && gSavedSettings.getBOOL("MediaOnAPrimUI")) { @@ -1850,7 +1850,7 @@ static void handle_click_action_open_media(LLPointer objectp) if( face < 0 || face >= objectp->getNumTEs() ) return; // is media playing on this face? - if (LLViewerMedia::getInstance()->getMediaImplFromTextureID(objectp->getTE(face)->getID()) != NULL) + if (LLViewerMedia::getInstance()->getMediaImplFromTextureID(objectp->getTE(face)->getID()) != nullptr) { handle_click_action_play(); return; @@ -2003,7 +2003,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/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp index 0d141d7545..10bd1f96b7 100644 --- a/indra/newview/lltoolplacer.cpp +++ b/indra/newview/lltoolplacer.cpp @@ -87,7 +87,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 @@ -160,10 +160,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 ) @@ -177,7 +177,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; @@ -446,10 +446,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/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index 5ccda7d4eb..d4220cc5d9 100644 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -199,8 +199,8 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi gAgent.startAutoPilotGlobal(gAgent.getPositionGlobal(), "", &target_rot, - NULL, - NULL, + nullptr, + nullptr, MAX_FAR_CLIP /*stop_distance, don't care since we are looking, not moving*/, gAgentAvatarp->isSitting() ? SELECTION_SITTING_ROTATION_TRESHOLD : SELECTION_ROTATION_TRESHOLD); } diff --git a/indra/newview/lltoolselectland.cpp b/indra/newview/lltoolselectland.cpp index 331581fd88..7671145249 100644 --- a/indra/newview/lltoolselectland.cpp +++ b/indra/newview/lltoolselectland.cpp @@ -216,7 +216,7 @@ void LLToolSelectLand::handleSelect() void LLToolSelectLand::handleDeselect() { - mSelection = NULL; + mSelection = nullptr; } diff --git a/indra/newview/lltoolview.cpp b/indra/newview/lltoolview.cpp index 179aae1e02..dadf395a37 100644 --- a/indra/newview/lltoolview.cpp +++ b/indra/newview/lltoolview.cpp @@ -42,9 +42,9 @@ LLToolContainer::LLToolContainer(LLToolView* parent) : mParent(parent), - mButton(NULL), - mPanel(NULL), - mTool(NULL) + mButton(nullptr), + mPanel(nullptr), + mTool(nullptr) { } @@ -54,7 +54,7 @@ LLToolContainer::~LLToolContainer() // mButton is owned by the tool view // mPanel is owned by the tool view delete mTool; - mTool = NULL; + mTool = nullptr; } @@ -180,7 +180,7 @@ LLToolContainer* LLToolView::findToolContainer( LLTool *tool ) } } LL_ERRS() << "LLToolView::findToolContainer - tool not found" << LL_ENDL; - return NULL; + return nullptr; } // static diff --git a/indra/newview/lltoolview.h b/indra/newview/lltoolview.h index 7b348e7088..2d1b784578 100644 --- a/indra/newview/lltoolview.h +++ b/indra/newview/lltoolview.h @@ -50,7 +50,7 @@ class LLToolContainer LLToolView* mParent; // toolview that owns this container LLButton* mButton; LLPanel* mPanel; - LLTool* mTool; // if not NULL, this is a tool ref + LLTool* mTool; // if not nullptr, this is a tool ref }; diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index d4d3e71b46..9b7d35f06d 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -74,7 +74,7 @@ const S32 ARROW_OFF_RADIUS_SQRD = 100; const S32 HUD_ARROW_SIZE = 32; // static -LLTracker *LLTracker::sTrackerp = NULL; +LLTracker *LLTracker::sTrackerp = nullptr; bool LLTracker::sCheesyBeacon = false; LLTracker::LLTracker() @@ -900,7 +900,7 @@ void LLTracker::purgeBeaconText() if(!mBeaconText.isNull()) { mBeaconText->markDead(); - mBeaconText = NULL; + mBeaconText = nullptr; } } diff --git a/indra/newview/lltracker.h b/indra/newview/lltracker.h index bf341216dd..d14b7eb4d3 100644 --- a/indra/newview/lltracker.h +++ b/indra/newview/lltracker.h @@ -68,7 +68,7 @@ class LLTracker return sTrackerp; } - static void cleanupInstance() { delete sTrackerp; sTrackerp = NULL; } + static void cleanupInstance() { delete sTrackerp; sTrackerp = nullptr; } //static void drawTrackerArrow(); // these are static so that they can be used a callbacks diff --git a/indra/newview/lltransientdockablefloater.cpp b/indra/newview/lltransientdockablefloater.cpp index a3818d5c01..984cd6d463 100644 --- a/indra/newview/lltransientdockablefloater.cpp +++ b/indra/newview/lltransientdockablefloater.cpp @@ -45,7 +45,7 @@ LLTransientDockableFloater::~LLTransientDockableFloater() LLView* dock = getDockWidget(); LLTransientFloaterMgr::getInstance()->removeControlView( LLTransientFloaterMgr::DOCKED, this); - if (dock != NULL) + if (dock != nullptr) { LLTransientFloaterMgr::getInstance()->removeControlView( LLTransientFloaterMgr::DOCKED, dock); @@ -58,7 +58,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); } @@ -66,7 +66,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); } @@ -81,7 +81,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); } @@ -89,7 +89,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/lltransientfloatermgr.cpp b/indra/newview/lltransientfloatermgr.cpp index dc777dbb67..4bced4c34e 100644 --- a/indra/newview/lltransientfloatermgr.cpp +++ b/indra/newview/lltransientfloatermgr.cpp @@ -110,7 +110,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 handle = *it; if (handle.isDead()) @@ -148,7 +148,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/lluilistener.cpp b/indra/newview/lluilistener.cpp index beae71e7bf..eb2a7c5d7d 100644 --- a/indra/newview/lluilistener.cpp +++ b/indra/newview/lluilistener.cpp @@ -74,9 +74,9 @@ void LLUIListener::call(const LLSD& event) const // Interestingly, view_listener_t::addMenu() (addCommit(), // addEnable()) constructs a commit_callback_t callable that accepts // two parameters but discards the first. Only the second is passed to - // handleEvent(). Therefore we feel completely safe passing NULL for + // handleEvent(). Therefore we feel completely safe passing nullptr 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 4961d38f8e..5f02ecc923 100644 --- a/indra/newview/lluploaddialog.cpp +++ b/indra/newview/lluploaddialog.cpp @@ -38,7 +38,7 @@ #include "llrootview.h" // static -LLUploadDialog* LLUploadDialog::sDialog = NULL; +LLUploadDialog* LLUploadDialog::sDialog = nullptr; // static LLUploadDialog* LLUploadDialog::modalUploadDialog(const std::string& msg) @@ -52,7 +52,7 @@ void LLUploadDialog::modalUploadFinished() { // Note: object adds, removes, and destroys itself. delete LLUploadDialog::sDialog; - LLUploadDialog::sDialog = NULL; + LLUploadDialog::sDialog = nullptr; } //////////////////////////////////////////////////////////// @@ -112,7 +112,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(); @@ -155,7 +155,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 b6d401982d..ee38ad02f9 100644 --- a/indra/newview/lluploaddialog.h +++ b/indra/newview/lluploaddialog.h @@ -37,7 +37,7 @@ class LLUploadDialog : public LLPanel 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 6bff31122e..fb51280b77 100644 --- a/indra/newview/llurl.cpp +++ b/indra/newview/llurl.cpp @@ -262,7 +262,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 39a9f0f8bc..74a45fd9c5 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -147,7 +147,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, LLCommandHandler::NAV_TYPE_CLICKED, right_click, web, trusted_browser); } @@ -418,7 +418,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), LLCommandHandler::NAV_TYPE_CLICKED, web, trusted_content); } diff --git a/indra/newview/llurldispatcherlistener.cpp b/indra/newview/llurldispatcherlistener.cpp index 9d62a16370..79af8d0732 100644 --- a/indra/newview/llurldispatcherlistener.cpp +++ b/indra/newview/llurldispatcherlistener.cpp @@ -61,7 +61,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/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index 011b8afd73..1e2069e65d 100644 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -102,7 +102,7 @@ class DCCountStatHandle: public CountStatHandle { public: - DCCountStatHandle(const char *name = makeNewAutoName(), const char *description=NULL): + DCCountStatHandle(const char *name = makeNewAutoName(), const char *description=nullptr): CountStatHandle(name,description) { } @@ -113,7 +113,7 @@ class DCEventStatHandle: public EventStatHandle { public: - DCEventStatHandle(const char *name = makeNewAutoName(), const char *description=NULL): + DCEventStatHandle(const char *name = makeNewAutoName(), const char *description=nullptr): EventStatHandle(name,description) { } @@ -182,7 +182,7 @@ LLViewerAssetStats * gViewerAssetStats(0); // ------------------------------------------------------ LLViewerAssetStats::LLViewerAssetStats() : mRegionHandle(U64(0)), - mCurRecording(NULL) + mCurRecording(nullptr) { start(); } diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h index 297d0a70ff..b225617f36 100644 --- a/indra/newview/llviewerassetstats.h +++ b/indra/newview/llviewerassetstats.h @@ -193,7 +193,7 @@ class LLViewerAssetStats : public LLStopWatchControlsMixin // collection calls. void setRegion(region_handle_t region_handle); - // Retrieve current metrics for all visited regions (NULL region UUID/handle excluded) + // Retrieve current metrics for all visited regions (nullptr region UUID/handle excluded) // Uses AssetStats structure seen above void getStats(AssetStats& stats, bool compact_output); diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index 65a69acc88..f40f29ffa2 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -546,7 +546,7 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile() // copy this file into the cache for upload S32 file_size; LLAPRFile infile; - infile.open(filename, LL_APR_RB, NULL, &file_size); + infile.open(filename, LL_APR_RB, nullptr, &file_size); if (infile.getFileHandle()) { LLFileSystem file(getAssetId(), assetType, LLFileSystem::APPEND); diff --git a/indra/newview/llviewerattachmenu.cpp b/indra/newview/llviewerattachmenu.cpp index 9828ab1fdf..07e533f3b8 100644 --- a/indra/newview/llviewerattachmenu.cpp +++ b/indra/newview/llviewerattachmenu.cpp @@ -93,7 +93,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(); ) { @@ -105,7 +105,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/llviewerchat.cpp b/indra/newview/llviewerchat.cpp index 2ca2c5c07d..c2494973cb 100644 --- a/indra/newview/llviewerchat.cpp +++ b/indra/newview/llviewerchat.cpp @@ -192,7 +192,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/llviewercontrollistener.cpp b/indra/newview/llviewercontrollistener.cpp index 6f77e21fcc..7b732fe0e1 100644 --- a/indra/newview/llviewercontrollistener.cpp +++ b/indra/newview/llviewercontrollistener.cpp @@ -93,7 +93,7 @@ struct Info groupname(request["group"]), group(LLControlGroup::getInstance(groupname)), key(request["key"]), - control(NULL) + control(nullptr) { if (! group) { diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index ce59e844ec..8dc4bf2003 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -534,7 +534,7 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot) static F32 last_update_time = 0.f; if ((gFrameTimeSeconds - last_update_time) > 1.f) { - InvalidateRect((HWND)gViewerWindow->getPlatformWindow(), NULL, false); + InvalidateRect((HWND)gViewerWindow->getPlatformWindow(), nullptr, false); last_update_time = gFrameTimeSeconds; } #elif LL_DARWIN @@ -1820,7 +1820,7 @@ void render_disconnected_background() if (!image_png->decode(raw, 0.0f)) { LL_INFOS() << "Bitmap decode failed" << LL_ENDL; - gDisconnectedImagep = NULL; + gDisconnectedImagep = nullptr; return; } diff --git a/indra/newview/llviewergenericmessage.cpp b/indra/newview/llviewergenericmessage.cpp index fd894a5997..3434786640 100644 --- a/indra/newview/llviewergenericmessage.cpp +++ b/indra/newview/llviewergenericmessage.cpp @@ -56,7 +56,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/llviewerinput.cpp b/indra/newview/llviewerinput.cpp index 3c79f0b21c..d219c5d647 100644 --- a/indra/newview/llviewerinput.cpp +++ b/indra/newview/llviewerinput.cpp @@ -642,7 +642,7 @@ bool start_chat( EKeystate s ) if (KEYSTATE_DOWN != s) return true; // start chat - LLFloaterIMNearbyChat::startChat(NULL); + LLFloaterIMNearbyChat::startChat(nullptr); return true; } @@ -660,7 +660,7 @@ bool start_gesture( EKeystate s ) else { // Don't overwrite existing text in chat editor - LLFloaterIMNearbyChat::startChat(NULL); + LLFloaterIMNearbyChat::startChat(nullptr); } } return true; @@ -1431,7 +1431,7 @@ S32 LLViewerInput::loadBindingsXML(const std::string& filename) // this is only for the file from user_settings LL_INFOS("ViewerInput") << "Updating file " << filename << " to a newer version" << LL_ENDL; LLFILE *fp = LLFile::fopen(filename, "w"); - if (fp != NULL) + if (fp != nullptr) { LLXMLNode::writeHeaderToFile(fp); output_node->writeToFile(fp); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index efa3f5cd1e..5f4f159f61 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -450,7 +450,7 @@ void LLViewerInventoryItem::updateServer(bool is_new) const updates["hash_id"] = getTransactionID(); } } - AISAPI::completion_t cr = boost::bind(&doInventoryCb, (LLPointer)NULL, _1); + AISAPI::completion_t cr = boost::bind(&doInventoryCb, (LLPointer)nullptr, _1); AISAPI::UpdateItem(getUUID(), updates, cr); } @@ -563,7 +563,7 @@ void LLViewerInventoryItem::updateParentOnServer(bool restamp) const msg->nextBlockFast(_PREHASH_InventoryData); msg->addUUIDFast(_PREHASH_ItemID, mUUID); msg->addUUIDFast(_PREHASH_FolderID, mParentUUID); - msg->addString("NewName", NULL); + msg->addString("NewName", nullptr); gAgent.sendReliableMessage(); } @@ -659,7 +659,7 @@ void LLViewerInventoryCategory::updateServer(bool is_new) const } LLSD new_llsd = asLLSD(); - AISAPI::completion_t cr = boost::bind(&doInventoryCb, (LLPointer)NULL, _1); + AISAPI::completion_t cr = boost::bind(&doInventoryCb, (LLPointer)nullptr, _1); AISAPI::UpdateCategory(getUUID(), new_llsd, cr); } @@ -877,7 +877,7 @@ void LLViewerInventoryCategory::changeType(LLFolderType::EType new_folder_type) LLSD new_llsd = new_cat->asLLSD(); - AISAPI::completion_t cr = boost::bind(&doInventoryCb, (LLPointer) NULL, _1); + AISAPI::completion_t cr = boost::bind(&doInventoryCb, (LLPointer) nullptr, _1); AISAPI::UpdateCategory(folder_id, new_llsd, cr); setPreferredType(new_folder_type); @@ -908,12 +908,12 @@ void LLViewerInventoryCategory::unpackMessage(LLMessageSystem* msg, const char* /// Local function definitions ///---------------------------------------------------------------------------- -LLInventoryCallbackManager *LLInventoryCallbackManager::sInstance = NULL; +LLInventoryCallbackManager *LLInventoryCallbackManager::sInstance = nullptr; LLInventoryCallbackManager::LLInventoryCallbackManager() : mLastCallback(0) { - if( sInstance != NULL ) + if( sInstance != nullptr ) { LL_WARNS(LOG_INV) << "LLInventoryCallbackManager::LLInventoryCallbackManager: unexpected multiple instances" << LL_ENDL; return; @@ -928,7 +928,7 @@ LLInventoryCallbackManager::~LLInventoryCallbackManager() LL_WARNS(LOG_INV) << "LLInventoryCallbackManager::~LLInventoryCallbackManager: unexpected multiple instances" << LL_ENDL; return; } - sInstance = NULL; + sInstance = nullptr; } //static @@ -939,7 +939,7 @@ void LLInventoryCallbackManager::destroyClass() for (callback_map_t::iterator it = sInstance->mMap.begin(), end_it = sInstance->mMap.end(); it != end_it; ++it) { // drop LLPointer reference to callback - it->second = NULL; + it->second = nullptr; } sInstance->mMap.clear(); } @@ -1203,7 +1203,7 @@ void create_inventory_callingcard_callback(LLPointer cb, cb); } -void create_inventory_callingcard(const LLUUID& avatar_id, const LLUUID& parent /*= LLUUID::null*/, LLPointer cb/*=NULL*/) +void create_inventory_callingcard(const LLUUID& avatar_id, const LLUUID& parent /*= LLUUID::null*/, LLPointer cb/*=nullptr*/) { LLAvatarName av_name; LLAvatarNameCache::get(avatar_id, boost::bind(&create_inventory_callingcard_callback, cb, parent, _1, _2)); @@ -1661,7 +1661,7 @@ void copy_inventory_from_notecard(const LLUUID& destination_id, const LLInventoryItem *src, U32 callback_id) { - if (NULL == src) + if (nullptr == src) { LL_WARNS(LOG_NOTECARD) << "Null pointer to item was passed for object_id " << object_id << " and notecard_inv_id " @@ -1669,9 +1669,9 @@ void copy_inventory_from_notecard(const LLUUID& destination_id, return; } - LLViewerRegion* viewer_region = NULL; - LLViewerObject* vo = NULL; - if (object_id.notNull() && (vo = gObjectList.findObject(object_id)) != NULL) + LLViewerRegion* viewer_region = nullptr; + LLViewerObject* vo = nullptr; + if (object_id.notNull() && (vo = gObjectList.findObject(object_id)) != nullptr) { viewer_region = vo->getRegion(); } @@ -1718,7 +1718,7 @@ void create_new_item(const std::string& name, LLViewerAssetType::generateDescriptionFor(asset_type, desc); next_owner_perm = (next_owner_perm) ? next_owner_perm : PERM_MOVE | PERM_TRANSFER; - LLPointer cb = NULL; + LLPointer cb = nullptr; switch (inv_type) { @@ -1755,7 +1755,7 @@ void create_new_item(const std::string& name, break; } } - if (created_cb != NULL) + if (created_cb != nullptr) { cb->addOnFireFunc(created_cb); } @@ -1851,7 +1851,7 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLUUID dest_id, const L LL_DEBUGS(LOG_INV) << "Done creating inventory: " << new_category_id << LL_ENDL; }; } - else if (created_cb != NULL) + else if (created_cb != nullptr) { callback_cat_created = created_cb; } @@ -2209,11 +2209,11 @@ LLViewerInventoryItem *LLViewerInventoryItem::getLinkedItem() const if (linked_item && linked_item->getIsLinkType()) { LL_WARNS(LOG_INV) << "Warning: Accessing link to link" << LL_ENDL; - return NULL; + return nullptr; } return linked_item; } - return NULL; + return nullptr; } LLViewerInventoryCategory *LLViewerInventoryItem::getLinkedCategory() const @@ -2223,7 +2223,7 @@ LLViewerInventoryCategory *LLViewerInventoryItem::getLinkedCategory() const LLViewerInventoryCategory *linked_category = gInventory.getCategory(mAssetUUID); return linked_category; } - return NULL; + return nullptr; } bool LLViewerInventoryItem::checkPermissionsSet(PermissionMask mask) const diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index a42bdaa2b0..0d1a92b0d6 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -354,7 +354,7 @@ class LLInventoryCallbackManager : public LLDestroyClass cb); -void create_inventory_callingcard(const LLUUID& avatar_id, const LLUUID& parent = LLUUID::null, LLPointer cb=NULL); +void create_inventory_callingcard(const LLUUID& avatar_id, const LLUUID& parent = LLUUID::null, LLPointer cb=nullptr); /** * @brief Securely create a new inventory item by copying from another. diff --git a/indra/newview/llviewerjoint.h b/indra/newview/llviewerjoint.h index 57959ec2fc..d5dba78e19 100644 --- a/indra/newview/llviewerjoint.h +++ b/indra/newview/llviewerjoint.h @@ -48,7 +48,7 @@ class alignas(16) LLViewerJoint : 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. diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 7870fe7823..3bb3baf678 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -101,7 +101,7 @@ void LLViewerJointMesh::uploadJointMatrices() { S32 joint_num; LLPolyMesh *reference_mesh = mMesh->getReferenceMesh(); - LLDrawPool *poolp = mFace ? mFace->getPool() : NULL; + LLDrawPool *poolp = mFace ? mFace->getPool() : nullptr; bool hardware_skinning = (poolp && poolp->getShaderLevel() > 0); //calculate joint matrices @@ -215,7 +215,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, bool first_pass, bool is_dummy) if (!mValid || !mMesh || !mFace || !mVisible || !mFace->getVertexBuffer() || mMesh->getNumFaces() == 0 || - LLGLSLShader::sCurBoundShaderPtr == NULL) + LLGLSLShader::sCurBoundShaderPtr == nullptr) { return 0; } diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index c4d87d7e16..d8133f1b3b 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -164,12 +164,12 @@ BOOL CALLBACK di8_devices_callback(LPCDIDEVICEINSTANCE device_instance_ptr, LPVO { LL_DEBUGS("Joystick") << "Found and attempting to use device: " << product_name << LL_ENDL; LPDIRECTINPUT8 di8_interface = *((LPDIRECTINPUT8 *)gViewerWindow->getWindow()->getDirectInput8()); - LPDIRECTINPUTDEVICE8 device = NULL; + LPDIRECTINPUTDEVICE8 device = nullptr; HRESULT status = di8_interface->CreateDevice( device_instance_ptr->guidInstance, // REFGUID rguid, &device, // LPDIRECTINPUTDEVICE * lplpDirectInputDevice, - NULL // LPUNKNOWN pUnkOuter + nullptr // LPUNKNOWN pUnkOuter ); if (status == DI_OK) @@ -314,7 +314,7 @@ void LLViewerJoystick::HotPlugRemovalCallback(NDOF_Device *dev) // ----------------------------------------------------------------------------- LLViewerJoystick::LLViewerJoystick() : mDriverState(JDS_UNINITIALIZED), - mNdofDev(NULL), + mNdofDev(nullptr), mResetFlag(false), mCameraUpdated(true), mOverrideCamera(false), @@ -408,12 +408,12 @@ void LLViewerJoystick::init(bool autoenable) #endif if (mDriverState != JDS_INITIALIZED) { - if (!gViewerWindow->getWindow()->getInputDevices(device_type, osx_callback, win_callback, NULL)) + if (!gViewerWindow->getWindow()->getInputDevices(device_type, osx_callback, win_callback, nullptr)) { LL_INFOS("Joystick") << "Failed to gather input devices. Falling back to ndof's init" << LL_ENDL; // Failed to gather devices, init first suitable one mLastDeviceUUID = LLSD(); - void *preffered_device = NULL; + void *preffered_device = nullptr; initDevice(preffered_device); } } @@ -505,11 +505,11 @@ void LLViewerJoystick::initDevice(LLSD &guid) if (mDriverState != JDS_INITIALIZED) { - if (!gViewerWindow->getWindow()->getInputDevices(device_type, osx_callback, win_callback, NULL)) + if (!gViewerWindow->getWindow()->getInputDevices(device_type, osx_callback, win_callback, nullptr)) { LL_INFOS("Joystick") << "Failed to gather input devices. Falling back to ndof's init" << LL_ENDL; // Failed to gather devices from window, init first suitable one - void *preffered_device = NULL; + void *preffered_device = nullptr; mLastDeviceUUID = LLSD(); initDevice(preffered_device); } @@ -593,11 +593,11 @@ bool LLViewerJoystick::initDevice(void * preffered_device /* LPDIRECTINPUTDEVICE void LLViewerJoystick::terminate() { #if LIB_NDOF - if (mNdofDev != NULL) + if (mNdofDev != nullptr) { ndof_libcleanup(); // frees alocated memory in mNdofDev mDriverState = JDS_UNINITIALIZED; - mNdofDev = NULL; + mNdofDev = nullptr; LL_INFOS("Joystick") << "Terminated connection with NDOF device." << LL_ENDL; } #endif diff --git a/indra/newview/llviewerlayer.cpp b/indra/newview/llviewerlayer.cpp index 24b72de1d5..0272889782 100644 --- a/indra/newview/llviewerlayer.cpp +++ b/indra/newview/llviewerlayer.cpp @@ -46,7 +46,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 24560aa21d..9972a99759 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -217,26 +217,26 @@ LLViewerMedia::LLViewerMedia(): mAnyMediaShowing(false), mAnyMediaPlaying(false), mMaxIntances(MAX_MEDIA_INSTANCES_DEFAULT), -mSpareBrowserMediaSource(NULL) +mSpareBrowserMediaSource(nullptr) { } LLViewerMedia::~LLViewerMedia() { - gIdleCallbacks.deleteFunction(LLViewerMedia::onIdle, NULL); + gIdleCallbacks.deleteFunction(LLViewerMedia::onIdle, nullptr); mTeleportFinishConnection.disconnect(); mMaxInstancesConnection.disconnect(); - if (mSpareBrowserMediaSource != NULL) + if (mSpareBrowserMediaSource != nullptr) { delete mSpareBrowserMediaSource; - mSpareBrowserMediaSource = NULL; + mSpareBrowserMediaSource = nullptr; } } // static void LLViewerMedia::initSingleton() { - gIdleCallbacks.addFunction(LLViewerMedia::onIdle, NULL); + gIdleCallbacks.addFunction(LLViewerMedia::onIdle, nullptr); mTeleportFinishConnection = LLViewerParcelMgr::getInstance()-> setTeleportFinishedCallback(boost::bind(&LLViewerMedia::onTeleportFinished, this)); @@ -279,7 +279,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); @@ -400,7 +400,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s ////////////////////////////////////////////////////////////////////////////////////////// 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); @@ -526,7 +526,7 @@ bool LLViewerMedia::isInterestingEnough(const LLVOVolume *object, const F64 &obj { bool result = false; - if (NULL == object) + if (nullptr == object) { result = false; } @@ -727,7 +727,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. @@ -1543,7 +1543,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) - mSpareBrowserMediaSource = LLViewerMediaImpl::newSourceFromMediaType(HTTP_CONTENT_TEXT_HTML, NULL, 0, 0, 1.0); + mSpareBrowserMediaSource = LLViewerMediaImpl::newSourceFromMediaType(HTTP_CONTENT_TEXT_HTML, nullptr, 0, 0, 1.0); } } @@ -1551,7 +1551,7 @@ void LLViewerMedia::createSpareBrowserMediaSource() LLPluginClassMedia* LLViewerMedia::getSpareBrowserMediaSource() { LLPluginClassMedia* result = mSpareBrowserMediaSource; - mSpareBrowserMediaSource = NULL; + mSpareBrowserMediaSource = nullptr; return result; }; @@ -1616,7 +1616,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, U8 media_auto_scale, U8 media_loop) : - mMediaSource( NULL ), + mMediaSource( nullptr ), mMovieImageHasMips(false), mMediaWidth(media_width), mMediaHeight(media_height), @@ -1728,7 +1728,7 @@ bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type) mMimeType = mime_type; } - return (mMediaSource != NULL); + return (mMediaSource != nullptr); } ////////////////////////////////////////////////////////////////////////////////////////// @@ -1773,7 +1773,7 @@ void LLViewerMediaImpl::destroyMediaSource() if(mMediaSource) { mMediaSource->setDeleteOK(true) ; - mMediaSource = NULL; // shared pointer + mMediaSource = nullptr; // shared pointer } } } @@ -1786,15 +1786,15 @@ void LLViewerMediaImpl::setMediaType(const std::string& media_type) ////////////////////////////////////////////////////////////////////////////////////////// /*static*/ -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) +LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be nullptr */, S32 default_width, S32 default_height, F64 zoom_factor, const std::string target, bool clean_browser) { if (gNonInteractive) { - return NULL; + return nullptr; } 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. @@ -1910,7 +1910,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ sMimeTypesFailed.push_back(media_type); } } - return NULL; + return nullptr; } ////////////////////////////////////////////////////////////////////////////////////////// @@ -2065,7 +2065,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)) { @@ -2908,7 +2908,7 @@ static LLTrace::BlockTimerStatHandle FTM_MEDIA_SET_SUBIMAGE("Set Subimage"); void LLViewerMediaImpl::update() { LL_PROFILE_ZONE_SCOPED_CATEGORY_MEDIA; //LL_RECORD_BLOCK_TIME(FTM_MEDIA_DO_UPDATE); - if(mMediaSource == NULL) + if(mMediaSource == nullptr) { if(mPriority == LLPluginClassMedia::PRIORITY_UNLOADED) { @@ -2949,7 +2949,7 @@ void LLViewerMediaImpl::update() } - if(mMediaSource == NULL) + if(mMediaSource == nullptr) { return; } @@ -2961,7 +2961,7 @@ void LLViewerMediaImpl::update() setNavigateSuspended(false); - if(mMediaSource == NULL) + if(mMediaSource == nullptr) { return; } @@ -3062,7 +3062,7 @@ bool LLViewerMediaImpl::preMediaTexUpdate(LLViewerMediaTexture*& media_tex, U8*& data_width = mMediaSource->getWidth(); data_height = mMediaSource->getHeight(); - if (data != NULL) + if (data != nullptr) { // data is ready to be copied to GL retval = true; @@ -3276,7 +3276,7 @@ bool LLViewerMediaImpl::isMediaPaused() // bool LLViewerMediaImpl::hasMedia() const { - return mMediaSource != NULL; + return mMediaSource != nullptr; } ////////////////////////////////////////////////////////////////////////////////////////// @@ -3368,7 +3368,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: @@ -3765,7 +3765,7 @@ void LLViewerMediaImpl::calculateInterest() llassert(!gCubeSnapshot); - if(texture != NULL) + if(texture != nullptr) { mInterest = texture->getMaxVirtualSize(); } @@ -3783,7 +3783,7 @@ void LLViewerMediaImpl::calculateInterest() // Just use the first object in the list. We could go through the list and find the closest object, but this should work well enough. std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ; LLVOVolume* objp = *iter ; - llassert_always(objp != NULL) ; + llassert_always(objp != nullptr) ; // The distance calculation is invalid for HUD attachments -- leave both mProximityDistance and mProximityCamera at 0 for them. if(!objp->isHUDAttachment()) @@ -4025,7 +4025,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()) @@ -4165,13 +4165,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 (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 1fc5bbc9e0..cdda39f6d8 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -115,8 +115,8 @@ class LLViewerMedia: public LLSingleton // Set all media paused(stopped for non time based) or playing, depending on val. Does not include media in the UI. void setAllMediaPaused(bool val); - static void onIdle(void* dummy_arg = NULL); // updateMedia wrapper - void updateMedia(void* dummy_arg = NULL); + static void onIdle(void* dummy_arg = nullptr); // updateMedia wrapper + void updateMedia(void* dummy_arg = nullptr); F32 getVolume(); void muteListChanged(); @@ -309,7 +309,7 @@ class LLViewerMediaImpl void setTarget(const std::string& target) { mTarget = target; } // utility function to create a ready-to-use media instance from a desired media type. - static LLPluginClassMedia* newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be NULL */, S32 default_width, S32 default_height, F64 zoom_factor, const std::string target = LLStringUtil::null, bool clean_browser = false); + static LLPluginClassMedia* newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be nullptr */, S32 default_width, S32 default_height, F64 zoom_factor, const std::string target = LLStringUtil::null, bool clean_browser = false); // Internally set our desired browser user agent string, including // the Second Life version and skin name. Used because we can diff --git a/indra/newview/llviewermedia_streamingaudio.cpp b/indra/newview/llviewermedia_streamingaudio.cpp index 4a1c433f8e..33385f12d3 100644 --- a/indra/newview/llviewermedia_streamingaudio.cpp +++ b/indra/newview/llviewermedia_streamingaudio.cpp @@ -36,7 +36,7 @@ #include "lldir.h" LLStreamingAudio_MediaPlugins::LLStreamingAudio_MediaPlugins() : - mMediaPlugin(NULL), + mMediaPlugin(nullptr), mGain(1.0) { // nothing interesting to do? @@ -46,7 +46,7 @@ LLStreamingAudio_MediaPlugins::LLStreamingAudio_MediaPlugins() : LLStreamingAudio_MediaPlugins::~LLStreamingAudio_MediaPlugins() { delete mMediaPlugin; - mMediaPlugin = NULL; + mMediaPlugin = nullptr; } void LLStreamingAudio_MediaPlugins::start(const std::string& url) @@ -167,7 +167,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.cpp b/indra/newview/llviewermediafocus.cpp index dbec66f81d..3eb5540b67 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -78,7 +78,7 @@ void LLViewerMediaFocus::setFocusFace(LLPointer objectp, S32 fac // Always clear the current selection. If we're setting focus on a face, we'll reselect the correct object below. LLSelectMgr::getInstance()->deselectAll(); - mSelection = NULL; + mSelection = nullptr; if (media_impl.notNull() && objectp.notNull()) { @@ -143,13 +143,13 @@ void LLViewerMediaFocus::setFocusFace(LLPointer objectp, S32 fac { if(hasFocus()) { - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } LLViewerMediaImpl* impl = getFocusedMediaImpl(); if (LLEditMenuHandler::gEditMenuHandler == impl) { - LLEditMenuHandler::gEditMenuHandler = NULL; + LLEditMenuHandler::gEditMenuHandler = nullptr; } @@ -170,7 +170,7 @@ void LLViewerMediaFocus::setFocusFace(LLPointer objectp, S32 fac void LLViewerMediaFocus::clearFocus() { - setFocusFace(NULL, 0, NULL); + setFocusFace(nullptr, 0, nullptr); } void LLViewerMediaFocus::setHoverFace(LLPointer objectp, S32 face, viewer_media_t media_impl, LLVector3 pick_normal) @@ -192,7 +192,7 @@ void LLViewerMediaFocus::setHoverFace(LLPointer objectp, S32 fac void LLViewerMediaFocus::clearHover() { - setHoverFace(NULL, 0, NULL); + setHoverFace(nullptr, 0, nullptr); } @@ -448,7 +448,7 @@ void LLViewerMediaFocus::update() // The media HUD is no longer needed. if(mMediaControls.get()) { - mMediaControls.get()->setMediaFace(NULL, 0, NULL); + mMediaControls.get()->setMediaFace(nullptr, 0, nullptr); } } } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index abaf813530..ea3e6e864c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -171,35 +171,35 @@ extern bool gShaderProfileFrame; // Globals // -LLMenuBarGL *gMenuBarView = NULL; -LLViewerMenuHolderGL *gMenuHolder = NULL; -LLMenuGL *gPopupMenuView = NULL; -LLMenuGL *gEditMenu = NULL; -LLMenuBarGL *gLoginMenuBarView = NULL; +LLMenuBarGL *gMenuBarView = nullptr; +LLViewerMenuHolderGL *gMenuHolder = nullptr; +LLMenuGL *gPopupMenuView = nullptr; +LLMenuGL *gEditMenu = nullptr; +LLMenuBarGL *gLoginMenuBarView = nullptr; // Pie menus -LLContextMenu *gMenuAvatarSelf = NULL; -LLContextMenu *gMenuAvatarOther = NULL; -LLContextMenu *gMenuObject = NULL; -LLContextMenu *gMenuAttachmentSelf = NULL; -LLContextMenu *gMenuAttachmentOther = NULL; -LLContextMenu *gMenuLand = NULL; -LLContextMenu *gMenuMuteParticle = NULL; +LLContextMenu *gMenuAvatarSelf = nullptr; +LLContextMenu *gMenuAvatarOther = nullptr; +LLContextMenu *gMenuObject = nullptr; +LLContextMenu *gMenuAttachmentSelf = nullptr; +LLContextMenu *gMenuAttachmentOther = nullptr; +LLContextMenu *gMenuLand = nullptr; +LLContextMenu *gMenuMuteParticle = nullptr; const std::string SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents"); -LLMenuGL* gAttachSubMenu = NULL; -LLMenuGL* gDetachSubMenu = NULL; -LLMenuGL* gTakeOffClothes = NULL; -LLMenuGL* gDetachAvatarMenu = NULL; -LLMenuGL* gDetachHUDAvatarMenu = NULL; -LLContextMenu* gAttachScreenPieMenu = NULL; -LLContextMenu* gAttachPieMenu = NULL; +LLMenuGL* gAttachSubMenu = nullptr; +LLMenuGL* gDetachSubMenu = nullptr; +LLMenuGL* gTakeOffClothes = nullptr; +LLMenuGL* gDetachAvatarMenu = nullptr; +LLMenuGL* gDetachHUDAvatarMenu = nullptr; +LLContextMenu* gAttachScreenPieMenu = nullptr; +LLContextMenu* gAttachPieMenu = nullptr; LLContextMenu* gAttachBodyPartPieMenus[9]; -LLContextMenu* gDetachPieMenu = NULL; -LLContextMenu* gDetachScreenPieMenu = NULL; -LLContextMenu* gDetachAttSelfMenu = NULL; -LLContextMenu* gDetachHUDAttSelfMenu = NULL; +LLContextMenu* gDetachPieMenu = nullptr; +LLContextMenu* gDetachScreenPieMenu = nullptr; +LLContextMenu* gDetachAttSelfMenu = nullptr; +LLContextMenu* gDetachHUDAttSelfMenu = nullptr; LLContextMenu* gDetachBodyPartPieMenus[9]; // @@ -344,7 +344,7 @@ class LLMenuParcelObserver : public LLParcelObserver LLHandle mLandBuyPassHandle; }; -static LLMenuParcelObserver* gMenuParcelObserver = NULL; +static LLMenuParcelObserver* gMenuParcelObserver = nullptr; static LLUIListener sUIListener; @@ -409,7 +409,7 @@ class LLSLMMenuUpdater LLHandle mMarketplaceListingsItem; }; -static LLSLMMenuUpdater* gSLMMenuUpdater = NULL; +static LLSLMMenuUpdater* gSLMMenuUpdater = nullptr; LLSLMMenuUpdater::LLSLMMenuUpdater() { @@ -1849,7 +1849,7 @@ class LLAdvancedAppearanceToXML : public view_listener_t bool handleEvent(const LLSD& userdata) { LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); - LLVOAvatar *avatar = NULL; + LLVOAvatar *avatar = nullptr; if (obj) { if (obj->isAvatar()) @@ -2857,37 +2857,37 @@ void cleanup_menus() gSLMMenuUpdater = nullptr; delete gMenuParcelObserver; - gMenuParcelObserver = NULL; + gMenuParcelObserver = nullptr; delete gMenuAvatarSelf; - gMenuAvatarSelf = NULL; + gMenuAvatarSelf = nullptr; delete gMenuAvatarOther; - gMenuAvatarOther = NULL; + gMenuAvatarOther = nullptr; delete gMenuObject; - gMenuObject = NULL; + gMenuObject = nullptr; delete gMenuAttachmentSelf; - gMenuAttachmentSelf = NULL; + gMenuAttachmentSelf = nullptr; delete gMenuAttachmentOther; - gMenuAttachmentOther = NULL; + gMenuAttachmentOther = nullptr; delete gMenuLand; - gMenuLand = NULL; + gMenuLand = nullptr; delete gMenuMuteParticle; - gMenuMuteParticle = NULL; + gMenuMuteParticle = nullptr; delete gMenuBarView; - gMenuBarView = NULL; + gMenuBarView = nullptr; delete gPopupMenuView; - gPopupMenuView = NULL; + gPopupMenuView = nullptr; delete gMenuHolder; - gMenuHolder = NULL; + gMenuHolder = nullptr; } //----------------------------------------------------------------------------- @@ -3037,7 +3037,7 @@ bool enable_object_inspect() { LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); LLViewerObject* selected_objectp = selection->getFirstRootObject(); - return selected_objectp != NULL; + return selected_objectp != nullptr; } struct LLSelectedTEGetmatIdAndPermissions : public LLSelectedTEFunctor @@ -3740,7 +3740,7 @@ bool callback_freeze(const LLSD& notification, const LLSD& response) void handle_avatar_freeze(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()); @@ -3863,7 +3863,7 @@ bool callback_eject(const LLSD& notification, const LLSD& response) void handle_avatar_eject(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()); @@ -3940,7 +3940,7 @@ bool picks_tab_visible() bool enable_freeze_eject(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()); @@ -4016,7 +4016,7 @@ bool enable_buy_object() // In order to buy, there must only be 1 purchaseable object in // the selection manager. if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 1) return false; - LLViewerObject* obj = NULL; + LLViewerObject* obj = nullptr; LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if(node) { @@ -4394,7 +4394,7 @@ void process_grant_godlike_powers(LLMessageSystem* msg, void**) bool is_agent_mappable(const LLUUID& agent_id) { - const LLRelationship* buddy_info = NULL; + const LLRelationship* buddy_info = nullptr; bool is_friend = LLAvatarActions::isFriend(agent_id); if (is_friend) @@ -4570,7 +4570,7 @@ class LLLandSit : public view_listener_t { target_rot = gAgent.getFrameAgent().getQuaternion(); } - gAgent.startAutoPilotGlobal(posGlobal, "Sit", &target_rot, near_sit_down_point, NULL, 0.7f); + gAgent.startAutoPilotGlobal(posGlobal, "Sit", &target_rot, near_sit_down_point, nullptr, 0.7f); return true; } }; @@ -4903,9 +4903,9 @@ static bool get_derezzable_objects( static bool can_derez(EDeRezDestination dest) { - LLViewerRegion* first_region = NULL; + LLViewerRegion* first_region = nullptr; std::string error; - return get_derezzable_objects(dest, error, first_region, NULL, true); + return get_derezzable_objects(dest, error, first_region, nullptr, true); } static void derez_objects( @@ -5004,16 +5004,16 @@ static void derez_objects( static void derez_objects(EDeRezDestination dest, const LLUUID& dest_id) { - LLViewerRegion* first_region = NULL; + LLViewerRegion* first_region = nullptr; std::string error; - derez_objects(dest, dest_id, first_region, error, NULL); + derez_objects(dest, dest_id, first_region, error, nullptr); } static void derez_objects_separate(EDeRezDestination dest, const LLUUID &dest_id) { std::vector derez_object_list; std::string error; - LLViewerRegion* first_region = NULL; + LLViewerRegion* first_region = nullptr; if (!get_derezzable_objects(dest, error, first_region, &derez_object_list, false)) { LL_WARNS() << "No objects to derez" << LL_ENDL; @@ -5087,10 +5087,10 @@ class LLObjectReturn : public view_listener_t mReturnableObjects.clear(); mError.clear(); - mFirstRegion = NULL; + mFirstRegion = nullptr; // drop reference to current selection - mObjectSelection = NULL; + mObjectSelection = nullptr; return false; } @@ -5496,14 +5496,14 @@ void show_buy_currency(const char* extra) // Don't show currency web page for branded clients. /* std::ostringstream mesg; - if (extra != NULL) + if (extra != nullptr) { mesg << extra << "\n \n"; } mesg << "Go to " << LLNotifications::instance().getGlobalString("BUY_CURRENCY_URL")<< "\nfor information on purchasing currency?"; */ LLSD args; - if (extra != NULL) + if (extra != nullptr) { args["EXTRA"] = extra; } @@ -5596,7 +5596,7 @@ class LLToolsEnablePathfinding : public view_listener_t { bool handleEvent(const LLSD& userdata) { - return (LLPathfindingManager::getInstance() != NULL) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion(); + return (LLPathfindingManager::getInstance() != nullptr) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion(); } }; @@ -5604,7 +5604,7 @@ class LLToolsEnablePathfindingView : public view_listener_t { bool handleEvent(const LLSD& userdata) { - return (LLPathfindingManager::getInstance() != NULL) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLPathfindingManager::getInstance()->isPathfindingViewEnabled(); + return (LLPathfindingManager::getInstance() != nullptr) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLPathfindingManager::getInstance()->isPathfindingViewEnabled(); } }; @@ -5612,7 +5612,7 @@ class LLToolsDoPathfindingRebakeRegion : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool hasPathfinding = (LLPathfindingManager::getInstance() != NULL); + bool hasPathfinding = (LLPathfindingManager::getInstance() != nullptr); if (hasPathfinding) { @@ -5749,7 +5749,7 @@ class LLToolsSelectNextPartFace : public view_listener_t bool ifwd = (userdata.asString() == "includenext"); bool iprev = (userdata.asString() == "includeprevious"); - LLViewerObject* to_select = NULL; + LLViewerObject* to_select = nullptr; bool restart_face_on_part = !cycle_faces; S32 new_te = 0; @@ -6010,7 +6010,7 @@ class LLEditDelete : public view_listener_t void handle_spellcheck_replace_with_suggestion(const LLUICtrl* ctrl, const LLSD& param) { const LLContextMenu* menu = dynamic_cast(ctrl->getParent()); - LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : NULL; + LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : nullptr; if ( (!spellcheck_handler) || (!spellcheck_handler->getSpellCheck()) ) { return; @@ -6028,8 +6028,8 @@ void handle_spellcheck_replace_with_suggestion(const LLUICtrl* ctrl, const LLSD& bool visible_spellcheck_suggestion(LLUICtrl* ctrl, const LLSD& param) { LLMenuItemGL* item = dynamic_cast(ctrl); - const LLContextMenu* menu = (item) ? dynamic_cast(item->getParent()) : NULL; - const LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : NULL; + const LLContextMenu* menu = (item) ? dynamic_cast(item->getParent()) : nullptr; + const LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : nullptr; if ( (!spellcheck_handler) || (!spellcheck_handler->getSpellCheck()) ) { return false; @@ -6048,7 +6048,7 @@ bool visible_spellcheck_suggestion(LLUICtrl* ctrl, const LLSD& param) void handle_spellcheck_add_to_dictionary(const LLUICtrl* ctrl) { const LLContextMenu* menu = dynamic_cast(ctrl->getParent()); - LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : NULL; + LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : nullptr; if ( (spellcheck_handler) && (spellcheck_handler->canAddToDictionary()) ) { spellcheck_handler->addToDictionary(); @@ -6058,14 +6058,14 @@ void handle_spellcheck_add_to_dictionary(const LLUICtrl* ctrl) bool enable_spellcheck_add_to_dictionary(const LLUICtrl* ctrl) { const LLContextMenu* menu = dynamic_cast(ctrl->getParent()); - const LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : NULL; + const LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : nullptr; return (spellcheck_handler) && (spellcheck_handler->canAddToDictionary()); } void handle_spellcheck_add_to_ignore(const LLUICtrl* ctrl) { const LLContextMenu* menu = dynamic_cast(ctrl->getParent()); - LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : NULL; + LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : nullptr; if ( (spellcheck_handler) && (spellcheck_handler->canAddToIgnore()) ) { spellcheck_handler->addToIgnore(); @@ -6075,7 +6075,7 @@ void handle_spellcheck_add_to_ignore(const LLUICtrl* ctrl) bool enable_spellcheck_add_to_ignore(const LLUICtrl* ctrl) { const LLContextMenu* menu = dynamic_cast(ctrl->getParent()); - const LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : NULL; + const LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : nullptr; return (spellcheck_handler) && (spellcheck_handler->canAddToIgnore()); } @@ -6109,7 +6109,7 @@ class LLObjectsReturnPackage mObjectSelection.clear(); mReturnableObjects.clear(); mError.clear(); - mFirstRegion = NULL; + mFirstRegion = nullptr; }; LLObjectSelectionHandle mObjectSelection; @@ -6810,7 +6810,7 @@ bool enable_pay_avatar() { LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); LLVOAvatar* avatar = find_avatar_from_object(obj); - return (avatar != NULL); + return (avatar != nullptr); } bool enable_pay_object() @@ -7274,9 +7274,9 @@ class LLObjectAttachToAvatar : public view_listener_t if (selectedObject) { S32 index = userdata.asInteger(); - LLViewerJointAttachment* attachment_point = NULL; + LLViewerJointAttachment* attachment_point = nullptr; if (index > 0) - attachment_point = get_if_there(gAgentAvatarp->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); + attachment_point = get_if_there(gAgentAvatarp->mAttachmentPoints, index, (LLViewerJointAttachment*)nullptr); confirmReplaceAttachment(0, attachment_point); } return true; @@ -7363,7 +7363,7 @@ void LLObjectAttachToAvatar::confirmReplaceAttachment(S32 option, LLViewerJointA // The callback will be called even if avatar fails to get close enough to the object, so we won't get a memory leak. CallbackData* user_data = new CallbackData(attachment_point, mReplace); - gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(walkToSpot), "Attach", NULL, onNearAttachObject, user_data, stop_distance); + gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(walkToSpot), "Attach", nullptr, onNearAttachObject, user_data, stop_distance); gAgentCamera.clearFocusObject(); } } @@ -7445,7 +7445,7 @@ class LLAttachmentDetachFromPoint : public view_listener_t bool handleEvent(const LLSD& user_data) { uuid_vec_t ids_to_remove; - const LLViewerJointAttachment *attachment = get_if_there(gAgentAvatarp->mAttachmentPoints, user_data.asInteger(), (LLViewerJointAttachment*)NULL); + const LLViewerJointAttachment *attachment = get_if_there(gAgentAvatarp->mAttachmentPoints, user_data.asInteger(), (LLViewerJointAttachment*)nullptr); if (attachment->getNumObjects() > 0) { for (LLViewerJointAttachment::attachedobjs_vec_t::const_iterator iter = attachment->mAttachedObjects.begin(); @@ -7470,7 +7470,7 @@ static bool onEnableAttachmentLabel(LLUICtrl* ctrl, const LLSD& data) LLMenuItemGL* menu = dynamic_cast(ctrl); if (menu) { - const LLViewerJointAttachment *attachment = get_if_there(gAgentAvatarp->mAttachmentPoints, data["index"].asInteger(), (LLViewerJointAttachment*)NULL); + const LLViewerJointAttachment *attachment = get_if_there(gAgentAvatarp->mAttachmentPoints, data["index"].asInteger(), (LLViewerJointAttachment*)nullptr); if (attachment) { label = data["label"].asString(); @@ -7607,14 +7607,14 @@ class LLAttachmentEnableDrop : public view_listener_t // item is in your inventory LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); - LLViewerJointAttachment* attachment = NULL; - LLInventoryItem* item = NULL; + LLViewerJointAttachment* attachment = nullptr; + LLInventoryItem* item = nullptr; // Do not enable drop if all faces of object are not enabled if (object && LLSelectMgr::getInstance()->getSelection()->contains(object,SELECT_ALL_TES )) { S32 attachmentID = ATTACHMENT_ID_FROM_STATE(object->getAttachmentState()); - attachment = get_if_there(gAgentAvatarp->mAttachmentPoints, attachmentID, (LLViewerJointAttachment*)NULL); + attachment = get_if_there(gAgentAvatarp->mAttachmentPoints, attachmentID, (LLViewerJointAttachment*)nullptr); if (attachment) { @@ -7710,7 +7710,7 @@ bool object_selected_and_point_valid() selection->getFirstRootObject()->flagObjectMove() && !selection->getFirstRootObject()->flagObjectPermanent() && !((LLViewerObject*)selection->getFirstRootObject()->getRoot())->isAvatar() && - (selection->getFirstRootObject()->getNVPair("AssetContainer") == NULL); + (selection->getFirstRootObject()->getNVPair("AssetContainer") == nullptr); } @@ -8025,7 +8025,7 @@ void handle_dump_attachments() ++attachment_iter) { LLViewerObject *attached_object = attachment_iter->get(); - bool visible = (attached_object != NULL && + bool visible = (attached_object != nullptr && attached_object->mDrawable.notNull() && !attached_object->mDrawable->isRenderType(0)); LLVector3 pos; @@ -8268,7 +8268,7 @@ class LLSomethingSelectedNoHUD : public view_listener_t static bool is_editable_selected() { - return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); + return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != nullptr); } class LLEditableSelected : public view_listener_t @@ -8700,7 +8700,7 @@ bool enable_grab_baked_texture(EBakedTextureIndex baked_tex_index) } // Returns a pointer to the avatar give the UUID of the avatar OR of an attachment the avatar is wearing. -// Returns NULL on failure. +// Returns nullptr on failure. LLVOAvatar* find_avatar_from_object(LLViewerObject* object) { if (object) @@ -8715,7 +8715,7 @@ LLVOAvatar* find_avatar_from_object(LLViewerObject* object) } else if( !object->isAvatar() ) { - object = NULL; + object = nullptr; } } @@ -8724,7 +8724,7 @@ LLVOAvatar* find_avatar_from_object(LLViewerObject* object) // Returns a pointer to the avatar give the UUID of the avatar OR of an attachment the avatar is wearing. -// Returns NULL on failure. +// Returns nullptr on failure. LLVOAvatar* find_avatar_from_object(const LLUUID& object_id) { return find_avatar_from_object( gObjectList.findObject(object_id) ); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 0e9bfb102f..1e3a9c9d57 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -133,7 +133,7 @@ class LLMeshUploadVisible : public view_listener_t } }; -LLMutex* LLFilePickerThread::sMutex = NULL; +LLMutex* LLFilePickerThread::sMutex = nullptr; std::queue LLFilePickerThread::sDeadQ; void LLFilePickerThread::getFile() @@ -275,7 +275,7 @@ void LLFilePickerThread::cleanupClass() clearDead(); delete sMutex; - sMutex = NULL; + sMutex = nullptr; } //static @@ -298,8 +298,8 @@ LLFilePickerReplyThread::LLFilePickerReplyThread(const file_picked_signal_t::slo : LLFilePickerThread(filter, get_multiple), mLoadFilter(filter), mSaveFilter(LLFilePicker::FFSAVE_ALL), - mFilePickedSignal(NULL), - mFailureSignal(NULL) + mFilePickedSignal(nullptr), + mFailureSignal(nullptr) { mFilePickedSignal = new file_picked_signal_t(); mFilePickedSignal->connect(cb); @@ -312,8 +312,8 @@ LLFilePickerReplyThread::LLFilePickerReplyThread(const file_picked_signal_t::slo : LLFilePickerThread(filter, proposed_name), mLoadFilter(LLFilePicker::FFLOAD_ALL), mSaveFilter(filter), - mFilePickedSignal(NULL), - mFailureSignal(NULL) + mFilePickedSignal(nullptr), + mFailureSignal(nullptr) { mFilePickedSignal = new file_picked_signal_t(); mFilePickedSignal->connect(cb); @@ -372,7 +372,7 @@ LLMediaFilePicker::LLMediaFilePicker(LLPluginClassMedia* plugin, LLFilePicker::E void LLMediaFilePicker::notify(const std::vector& filenames) { mPlugin->sendPickFileResponse(mResponses); - mPlugin = NULL; + mPlugin = nullptr; } //============================================================================ @@ -997,8 +997,8 @@ class LLFileEnableCloseWindow : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool frontmost_fl_exists = (NULL != gFloaterView->getFrontmostClosableFloater()); - bool frontmost_snapshot_fl_exists = (NULL != gSnapshotFloaterView->getFrontmostClosableFloater()); + bool frontmost_fl_exists = (nullptr != gFloaterView->getFrontmostClosableFloater()); + bool frontmost_snapshot_fl_exists = (nullptr != gSnapshotFloaterView->getFrontmostClosableFloater()); return !LLNotificationsUI::LLToast::isAlertToastShown() && (frontmost_fl_exists || frontmost_snapshot_fl_exists); } @@ -1008,13 +1008,13 @@ class LLFileCloseWindow : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool frontmost_fl_exists = (NULL != gFloaterView->getFrontmostClosableFloater()); + bool frontmost_fl_exists = (nullptr != gFloaterView->getFrontmostClosableFloater()); LLFloater* snapshot_floater = gSnapshotFloaterView->getFrontmostClosableFloater(); if(snapshot_floater && (!frontmost_fl_exists || snapshot_floater->hasFocus())) { snapshot_floater->closeFloater(); - if (gFocusMgr.getKeyboardFocus() == NULL) + if (gFocusMgr.getKeyboardFocus() == nullptr) { gFloaterView->focusFrontFloater(); } @@ -1322,7 +1322,7 @@ void upload_done_callback( msg->addU8Fast(_PREHASH_AggregatePermNextOwner, (U8)LLAggregatePermissions::AP_EMPTY); msg->addU8Fast(_PREHASH_AggregatePermInventory, (U8)LLAggregatePermissions::AP_EMPTY); msg->addS32Fast(_PREHASH_TransactionType, TRANS_UPLOAD_CHARGE); - msg->addStringFast(_PREHASH_Description, NULL); + msg->addStringFast(_PREHASH_Description, nullptr); msg->sendReliable(region->getHost()); } } @@ -1343,7 +1343,7 @@ void upload_done_callback( folder_id, data->mAssetInfo.mTransactionID, data->mAssetInfo.getName(), data->mAssetInfo.getDescription(), data->mAssetInfo.mType, data->mInventoryType, NO_INV_SUBTYPE, next_owner_perms, - LLPointer(NULL)); + LLPointer(nullptr)); } else { @@ -1360,7 +1360,7 @@ void upload_done_callback( } delete data; - data = NULL; + data = nullptr; } LLUploadDialog::modalUploadFinished(); @@ -1379,7 +1379,7 @@ void upload_done_callback( std::string display_name = LLStringUtil::null; LLAssetStorage::LLStoreAssetCallback callback; - void *userdata = NULL; + void *userdata = nullptr; upload_new_resource( next_file, asset_name, diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index e40dd84bc9..65fd390c6a 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -62,7 +62,7 @@ LLUUID upload_new_resource( void upload_new_resource( LLResourceUploadInfo::ptr_t &uploadInfo, LLAssetStorage::LLStoreAssetCallback callback = LLAssetStorage::LLStoreAssetCallback(), - void *userdata = NULL); + void *userdata = nullptr); bool get_bulk_upload_expected_cost( const std::vector& filenames, diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3a7b721f70..d897ab4ca3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -533,7 +533,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; @@ -757,7 +757,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) static void highlight_inventory_objects_in_panel(const std::vector& items, LLInventoryPanel *inventory_panel) { - if (NULL == inventory_panel) return; + if (nullptr == inventory_panel) return; for (std::vector::const_iterator item_iter = items.begin(); item_iter != items.end(); @@ -902,7 +902,7 @@ class LLViewerInventoryMoveFromWorldObserver : public LLInventoryAddItemByAssetO { LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if (NULL == active_panel) + if (nullptr == active_panel) { return true; } @@ -949,7 +949,7 @@ class LLViewerInventoryMoveFromWorldObserver : public LLInventoryAddItemByAssetO LLUUID mMoveIntoFolderID; }; -LLViewerInventoryMoveFromWorldObserver* gInventoryMoveObserver = NULL; +LLViewerInventoryMoveFromWorldObserver* gInventoryMoveObserver = nullptr; void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder_uuid) { @@ -993,7 +993,7 @@ void LLViewerInventoryMoveObserver::changed(U32 mask) { LLInventoryPanel* active_panel = dynamic_cast(mActivePanel.get()); - if (NULL == active_panel) + if (nullptr == active_panel) { gInventory.removeObserver(this); return; @@ -1091,7 +1091,7 @@ class LLOpenTaskGroupOffer : public LLInventoryAddedObserver }; //one global instance to bind them -LLOpenTaskOffer* gNewInventoryObserver=NULL; +LLOpenTaskOffer* gNewInventoryObserver=nullptr; class LLNewInventoryHintObserver : public LLInventoryAddedObserver { protected: @@ -1101,7 +1101,7 @@ class LLNewInventoryHintObserver : public LLInventoryAddedObserver } }; -LLNewInventoryHintObserver* gNewInventoryHintObserver=NULL; +LLNewInventoryHintObserver* gNewInventoryHintObserver=nullptr; void start_new_inventory_observer() { @@ -1641,10 +1641,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); @@ -1659,7 +1659,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) { @@ -1727,7 +1727,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); } @@ -1747,7 +1747,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); } @@ -1793,7 +1793,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& sendReceiveResponse(accept_to_trash, trash); } - if (modified_form != NULL) + if (modified_form != nullptr) { modified_form->setElementEnabled("Show", false); modified_form->setElementEnabled("Discard", false); @@ -1842,8 +1842,8 @@ 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) + llassert(notification_ptr != nullptr); + if (notification_ptr != nullptr) { if (mFromGroup) { @@ -2973,7 +2973,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) { // Could happen if you were immediately god-teleported away on login, // maybe other cases. Continue, but warn. - LL_WARNS("Teleport", "Messaging") << "agent_movement_complete() with NULL avatarp." << LL_ENDL; + LL_WARNS("Teleport", "Messaging") << "agent_movement_complete() with nullptr avatarp." << LL_ENDL; } F32 x, y; @@ -3060,7 +3060,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) LLAppViewer::updateDiscordActivity(); #endif - if ( LLTracker::isTracking(NULL) ) + if ( LLTracker::isTracking(nullptr) ) { // Check distance to beacon, if < 5m, remove beacon LLVector3d beacon_pos = LLTracker::getTrackedPositionGlobal(); @@ -3638,7 +3638,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); @@ -3881,7 +3881,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); @@ -3971,7 +3971,7 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data) LLUUID animation_id; LLUUID uuid; S32 anim_sequence_id; - LLVOAvatar *avatarp = NULL; + LLVOAvatar *avatarp = nullptr; mesgsys->getUUIDFast(_PREHASH_Sender, _PREHASH_ID, uuid); @@ -4216,7 +4216,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 @@ -4858,7 +4858,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); @@ -4984,7 +4984,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); @@ -5253,7 +5253,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"); } @@ -6800,7 +6800,7 @@ void process_covenant_reply(LLMessageSystem* msg, void**) LLAssetType::AT_NOTECARD, ET_Covenant, onCovenantLoadComplete, - NULL, + nullptr, high_priority); } else diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 1675c44c5c..d298d75faf 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -151,7 +151,7 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco LL_PROFILE_ZONE_SCOPED; LL_DEBUGS("ObjectUpdate") << "creating " << id << LL_ENDL; - LLViewerObject *res = NULL; + LLViewerObject *res = nullptr; if (gNonInteractive && pcode != LL_PCODE_LEGACY_AVATAR @@ -216,13 +216,13 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco case LL_PCODE_LEGACY_PART_SYS: // LL_WARNS() << "Creating old part sys!" << LL_ENDL; // res = new LLVOPart(id, pcode, regionp); break; - res = NULL; break; + res = nullptr; break; case LL_PCODE_LEGACY_TREE: res = new LLVOTree(id, pcode, regionp); break; case LL_PCODE_TREE_NEW: // LL_WARNS() << "Creating new tree!" << LL_ENDL; // res = new LLVOTree(id, pcode, regionp); break; - res = NULL; break; + res = nullptr; break; case LL_VO_SURFACE_PATCH: res = new LLVOSurfacePatch(id, pcode, regionp); break; case LL_VO_SKY: @@ -239,7 +239,7 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco res = new LLVOWLSky(id, pcode, regionp); break; default: LL_WARNS() << "Unknown object pcode " << (S32)pcode << LL_ENDL; - res = NULL; break; + res = nullptr; break; } return res; @@ -252,9 +252,9 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mLocalID(0), mTotalCRC(0), mListIndex(-1), - mTEImages(NULL), - mTENormalMaps(NULL), - mTESpecularMaps(NULL), + mTEImages(nullptr), + mTENormalMaps(nullptr), + mTESpecularMaps(nullptr), mbCanSelect(true), mFlags(0), mPhysicsShapeType(0), @@ -269,18 +269,18 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mText(), mHudText(""), mHudTextColor(LLColor4::white), - mControlAvatar(NULL), + mControlAvatar(nullptr), mLastInterpUpdateSecs(0.f), mLastMessageUpdateSecs(0.f), mLatestRecvPacketID(0), mRegionCrossExpire(0), - mData(NULL), - mAudioSourcep(NULL), + mData(nullptr), + mAudioSourcep(nullptr), mAudioGain(1.f), mSoundCutOffRadius(0.f), mAppAngle(0.f), mPixelArea(1024.f), - mInventory(NULL), + mInventory(nullptr), mInventorySerialNum(0), mExpectedInventorySerialNum(0), mInvRequestState(INVENTORY_REQUEST_STOPPED), @@ -299,7 +299,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mAngularVelocityRot(), mPreviousRotation(), mAttachmentState(0), - mMedia(NULL), + mMedia(nullptr), mClickAction(0), mObjectCost(0), mLinksetCost(0), @@ -350,27 +350,27 @@ LLViewerObject::~LLViewerObject() { mInventory->clear(); // will deref and delete entries delete mInventory; - mInventory = NULL; + mInventory = nullptr; } if (mPartSourcep) { mPartSourcep->setDead(); - mPartSourcep = NULL; + mPartSourcep = nullptr; } if (mText) { // something recovered LLHUDText when object was already dead mText->markDead(); - mText = NULL; + mText = nullptr; } // Delete memory associated with extra parameters. std::unordered_map::iterator iter; for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter) { - if(iter->second != NULL) + if(iter->second != nullptr) { delete iter->second->data; delete iter->second; @@ -382,10 +382,10 @@ LLViewerObject::~LLViewerObject() mNameValuePairs.clear(); delete[] mData; - mData = NULL; + mData = nullptr; delete mMedia; - mMedia = NULL; + mMedia = nullptr; sNumObjects--; sNumZombieObjects--; @@ -394,7 +394,7 @@ LLViewerObject::~LLViewerObject() if (mControlAvatar.notNull()) { mControlAvatar->markForDeath(); - mControlAvatar = NULL; + mControlAvatar = nullptr; LL_WARNS() << "Dead object owned a live control avatar" << LL_ENDL; } @@ -404,18 +404,18 @@ LLViewerObject::~LLViewerObject() void LLViewerObject::deleteTEImages() { delete[] mTEImages; - mTEImages = NULL; + mTEImages = nullptr; - if (mTENormalMaps != NULL) + if (mTENormalMaps != nullptr) { delete[] mTENormalMaps; - mTENormalMaps = NULL; + mTENormalMaps = nullptr; } - if (mTESpecularMaps != NULL) + if (mTESpecularMaps != nullptr) { delete[] mTESpecularMaps; - mTESpecularMaps = NULL; + mTESpecularMaps = nullptr; } } @@ -460,16 +460,16 @@ void LLViewerObject::markDead() if (childp->getPCode() != LL_PCODE_LEGACY_AVATAR) { //LL_INFOS() << "Marking child " << childp->getLocalID() << " as dead." << LL_ENDL; - childp->setParent(NULL); // LLViewerObject::markDead 1 + childp->setParent(nullptr); // LLViewerObject::markDead 1 childp->markDead(); } else { // make sure avatar is no longer parented, // so we can properly set it's position - childp->setDrawableParent(NULL); + childp->setDrawableParent(nullptr); ((LLVOAvatar*)childp)->getOffObject(); - childp->setParent(NULL); // LLViewerObject::markDead 2 + childp->setParent(nullptr); // LLViewerObject::markDead 2 } mChildList.pop_back(); } @@ -478,25 +478,25 @@ void LLViewerObject::markDead() { // Drawables are reference counted, mark as dead, then nuke the pointer. mDrawable->markDead(); - mDrawable = NULL; + mDrawable = nullptr; } if (mText) { mText->markDead(); - mText = NULL; + mText = nullptr; } if (mIcon) { mIcon->markDead(); - mIcon = NULL; + mIcon = nullptr; } if (mPartSourcep) { mPartSourcep->setDead(); - mPartSourcep = NULL; + mPartSourcep = nullptr; } if (mAudioSourcep) @@ -506,7 +506,7 @@ void LLViewerObject::markDead() { gAudiop->cleanupAudioSource(mAudioSourcep); } - mAudioSourcep = NULL; + mAudioSourcep = nullptr; } if (flagAnimSource()) @@ -846,7 +846,7 @@ void LLViewerObject::buildReturnablesForChildrenVO( std::vectorgetParent() == this) { - childp->setParent(NULL); + childp->setParent(nullptr); } if (childp->isAvatar()) @@ -1043,7 +1043,7 @@ bool LLViewerObject::setDrawableParent(LLDrawable* parentp) return false; } - bool ret = mDrawable->mXform.setParent(parentp ? &parentp->mXform : NULL); + bool ret = mDrawable->mXform.setParent(parentp ? &parentp->mXform : nullptr); if(!ret) { return false ; @@ -1115,7 +1115,7 @@ U32 LLViewerObject::checkMediaURL(const std::string &media_url) { retval |= MEDIA_URL_REMOVED; delete mMedia; - mMedia = NULL; + mMedia = nullptr; } else if (mMedia->mMediaURL != media_url) // <-- This is an optimization. If they are equal don't bother with below's test. { @@ -1190,7 +1190,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // Coordinates of objects on simulators are region-local. U64 region_handle = 0; - if(mesgsys != NULL) + if(mesgsys != nullptr) { mesgsys->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle); LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromHandle(region_handle); @@ -1230,7 +1230,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, } F32 time_dilation = 1.f; - if(mesgsys != NULL) + if(mesgsys != nullptr) { U16 time_dilation16; mesgsys->getU16Fast(_PREHASH_RegionData, _PREHASH_TimeDilation, time_dilation16); @@ -1422,7 +1422,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (mData) { delete [] mData; - mData = NULL; + mData = nullptr; } // Dec 2023 new generic data: @@ -1493,7 +1493,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (mText.notNull()) { mText->markDead(); - mText = NULL; + mText = nullptr; } mHudText.clear(); } @@ -1795,7 +1795,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, } else { - mData = NULL; + mData = nullptr; } // Setup object text @@ -1825,7 +1825,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (mText.notNull()) { mText->markDead(); - mText = NULL; + mText = nullptr; } mHudText.clear(); } @@ -1905,7 +1905,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // Preload these five flags for every object. // Finer shades require the object to be selected, and the selection manager // stores the extended permission info. - if(mesgsys != NULL) + if(mesgsys != nullptr) { U32 flags; mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, block_num); @@ -1940,7 +1940,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // No parent now, new parent in message -> attach to that parent if possible LLUUID parent_uuid; - if(mesgsys != NULL) + if(mesgsys != nullptr) { gObjectList.getUUIDFromLocal(parent_uuid, parent_id, @@ -1966,7 +1966,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, LL_WARNS("UpdateFail") << "Attempt to attach a parent to it's child: " << this->getID() << " to " << sent_parentp->getID() << LL_ENDL; this->removeChild(sent_parentp); - sent_parentp->setDrawableParent(NULL); + sent_parentp->setDrawableParent(nullptr); } if (sent_parentp && (sent_parentp != this) && !sent_parentp->isDead()) @@ -2001,8 +2001,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, LL_WARNS("UpdateFail") << "Attempting to recover from parenting cycle! " << "Killing " << sent_parentp->getID() << " and " << getID() << ", Adding to cache miss list" << LL_ENDL; - setParent(NULL); - sent_parentp->setParent(NULL); + setParent(nullptr); + sent_parentp->setParent(nullptr); getRegion()->addCacheMissFull(getLocalID()); getRegion()->addCacheMissFull(sent_parentp->getLocalID()); gObjectList.killObject(sent_parentp); @@ -2037,7 +2037,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, //parent_id U32 ip, port; - if(mesgsys != NULL) + if(mesgsys != nullptr) { ip = mesgsys->getSenderIP(); port = mesgsys->getSenderPort(); @@ -2079,13 +2079,13 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // // This object is no longer parented, we sent in a zero parent ID. // - sent_parentp = NULL; + sent_parentp = nullptr; } else { LLUUID parent_uuid; - if(mesgsys != NULL) + if(mesgsys != nullptr) { gObjectList.getUUIDFromLocal(parent_uuid, parent_id, @@ -2121,7 +2121,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // U32 ip, port; - if(mesgsys != NULL) + if(mesgsys != nullptr) { ip = mesgsys->getSenderIP(); port = mesgsys->getSenderPort(); @@ -2152,8 +2152,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, LL_WARNS() << "Attempting to recover from parenting cycle!" << LL_ENDL; LL_WARNS() << "Killing " << sent_parentp->getID() << " and " << getID() << LL_ENDL; LL_WARNS() << "Adding to cache miss list" << LL_ENDL; - setParent(NULL); - sent_parentp->setParent(NULL); + setParent(nullptr); + sent_parentp->setParent(nullptr); getRegion()->addCacheMissFull(getLocalID()); getRegion()->addCacheMissFull(sent_parentp->getLocalID()); gObjectList.killObject(sent_parentp); @@ -2194,7 +2194,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (mDrawable.notNull()) { // clear parent to removeChild can put the drawable on the damped list - setDrawableParent(NULL); // LLViewerObject::processUpdateMessage 3 + setDrawableParent(nullptr); // LLViewerObject::processUpdateMessage 3 } cur_parentp->removeChild(this); @@ -2214,7 +2214,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, new_rot.normQuat(); - if (sPingInterpolate && mesgsys != NULL) + if (sPingInterpolate && mesgsys != nullptr) { LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mesgsys->getSender()); if (cdp) @@ -2239,7 +2239,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // If we're going to skip this message, why are we // doing all the parenting, etc above? - if(mesgsys != NULL) + if(mesgsys != nullptr) { U32 packet_id = mesgsys->getCurrentRecvPacketID(); if (packet_id < mLatestRecvPacketID && @@ -2688,7 +2688,7 @@ void LLViewerObject::doUpdateInventory( U8 key, bool is_new) { - LLViewerInventoryItem* old_item = NULL; + LLViewerInventoryItem* old_item = nullptr; if(TASK_INVENTORY_ITEM_KEY == key) { old_item = (LLViewerInventoryItem*)getInventoryObject(item->getUUID()); @@ -2707,7 +2707,7 @@ void LLViewerObject::doUpdateInventory( new_owner = old_item->getPermissions().getOwner(); new_group = old_item->getPermissions().getGroup(); group_owned = old_item->getPermissions().isGroupOwned(); - old_item = NULL; + old_item = nullptr; } else { @@ -2844,7 +2844,7 @@ void LLViewerObject::dirtyInventory() { mInventory->clear(); // will deref and delete entries delete mInventory; - mInventory = NULL; + mInventory = nullptr; } mInventoryDirty = true; } @@ -2859,7 +2859,7 @@ void LLViewerObject::registerInventoryListener(LLVOInventoryListener* listener, void LLViewerObject::removeInventoryListener(LLVOInventoryListener* listener) { - if (listener == NULL) + if (listener == nullptr) return; for (callback_list_t::iterator iter = mInventoryCallbacks.begin(); iter != mInventoryCallbacks.end(); ) @@ -2897,7 +2897,7 @@ void LLViewerObject::requestInventory() { mInventory->clear(); // will deref and delete entries delete mInventory; - mInventory = NULL; + mInventory = nullptr; } if(mInventory) @@ -2921,7 +2921,7 @@ void LLViewerObject::fetchInventoryFromServer() if (!isInventoryPending()) { delete mInventory; - mInventory = NULL; + mInventory = nullptr; // This will get reset by doInventoryCallback or processTaskInv mInvRequestState = INVENTORY_REQUEST_PENDING; @@ -3170,7 +3170,7 @@ void LLViewerObject::unlinkControlAvatar() if (mControlAvatar) { mControlAvatar->markForDeath(); - mControlAvatar = NULL; + mControlAvatar = nullptr; } } // For non-root prims, removing from the linkset will @@ -3328,7 +3328,7 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data) void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtStat ext_status) { LLFilenameAndTask* ft = (LLFilenameAndTask*)user_data; - LLViewerObject* object = NULL; + LLViewerObject* object = nullptr; if (ft && (0 == error_code) @@ -3498,7 +3498,7 @@ void LLViewerObject::doInventoryCallback() { callback_list_t::iterator curiter = iter++; LLInventoryCallbackInfo* info = *curiter; - if (info->mListener != NULL) + if (info->mListener != nullptr) { info->mListener->inventoryChanged(this, mInventory, @@ -3556,7 +3556,7 @@ bool LLViewerObject::isAssetInInventory(LLViewerInventoryItem* item, LLAssetType // null is the default asset for materials and default for scripts // so need to check type as well - bool is_fetched = getInventoryItemByAsset(item->getAssetUUID(), type) != NULL; + bool is_fetched = getInventoryItemByAsset(item->getAssetUUID(), type) != nullptr; result = is_fetched || is_fetching; } @@ -3637,7 +3637,7 @@ void LLViewerObject::updateInventoryLocal(LLInventoryItem* item, U8 key) LLInventoryObject* LLViewerObject::getInventoryObject(const LLUUID& item_id) { - LLInventoryObject* rv = NULL; + LLInventoryObject* rv = nullptr; if(mInventory) { LLInventoryObject::object_list_t::iterator it = mInventory->begin(); @@ -3659,7 +3659,7 @@ LLInventoryItem* LLViewerObject::getInventoryItem(const LLUUID& item_id) LLInventoryObject* iobj = getInventoryObject(item_id); if (!iobj || iobj->getType() == LLAssetType::AT_CATEGORY) { - return NULL; + return nullptr; } LLInventoryItem* item = dynamic_cast(iobj); return item; @@ -3685,7 +3685,7 @@ LLInventoryObject* LLViewerObject::getInventoryRoot() { if (!mInventory || !mInventory->size()) { - return NULL; + return nullptr; } return mInventory->back(); } @@ -3695,10 +3695,10 @@ LLViewerInventoryItem* LLViewerObject::getInventoryItemByAsset(const LLUUID& ass if (mInventoryDirty) LL_WARNS() << "Peforming inventory lookup for object " << mID << " that has dirty inventory!" << LL_ENDL; - LLViewerInventoryItem* rv = NULL; + LLViewerInventoryItem* rv = nullptr; if(mInventory) { - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; LLInventoryObject::object_list_t::iterator it = mInventory->begin(); LLInventoryObject::object_list_t::iterator end = mInventory->end(); @@ -3725,7 +3725,7 @@ LLViewerInventoryItem* LLViewerObject::getInventoryItemByAsset(const LLUUID& ass if (mInventoryDirty) LL_WARNS() << "Peforming inventory lookup for object " << mID << " that has dirty inventory!" << LL_ENDL; - LLViewerInventoryItem* rv = NULL; + LLViewerInventoryItem* rv = nullptr; if (type == LLAssetType::AT_CATEGORY) { // Whatever called this shouldn't be trying to get a folder by asset @@ -3736,7 +3736,7 @@ LLViewerInventoryItem* LLViewerObject::getInventoryItemByAsset(const LLUUID& ass if (mInventory) { - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; LLInventoryObject::object_list_t::iterator it = mInventory->begin(); LLInventoryObject::object_list_t::iterator end = mInventory->end(); @@ -3839,7 +3839,7 @@ void LLViewerObject::updateFaceSize(S32 idx) LLDrawable* LLViewerObject::createDrawable(LLPipeline *pipeline) { - return NULL; + return nullptr; } void LLViewerObject::setScale(const LLVector3 &scale, bool damped) @@ -4333,7 +4333,7 @@ LLNameValue *LLViewerObject::getNVPair(const std::string& name) const } else { - return NULL; + return nullptr; } } @@ -5052,9 +5052,9 @@ void LLViewerObject::setNumTEs(const U8 num_tes) } else { - new_images[i] = NULL; - new_normmaps[i] = NULL; - new_specmaps[i] = NULL; + new_images[i] = nullptr; + new_normmaps[i] = nullptr; + new_specmaps[i] = nullptr; } } @@ -5155,7 +5155,7 @@ void LLViewerObject::sendTEUpdate() const } else { - msg->addString("MediaURL", NULL); + msg->addString("MediaURL", nullptr); } // TODO send media type @@ -5170,7 +5170,7 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) { if (!LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) { - return NULL; + return nullptr; } LLViewerObject *root = getRootEdit(); @@ -5184,7 +5184,7 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) { LLAvatarAppearanceDefines::EBakedTextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id); LLViewerTexture* bakedTexture = avatar->getBakedTexture(texIndex); - if (bakedTexture == NULL || bakedTexture->isMissingAsset()) + if (bakedTexture == nullptr || bakedTexture->isMissingAsset()) { return LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); } @@ -5371,7 +5371,7 @@ S32 LLViewerObject::setTENormalMapCore(const U8 te, LLViewerTexture *image) uuid == LLUUID::null) { LLTextureEntry* tep = getTE(te); - LLMaterial* mat = NULL; + LLMaterial* mat = nullptr; if (tep) { mat = tep->getMaterialParams(); @@ -5394,7 +5394,7 @@ S32 LLViewerObject::setTESpecularMapCore(const U8 te, LLViewerTexture *image) uuid == LLUUID::null) { LLTextureEntry* tep = getTE(te); - LLMaterial* mat = NULL; + LLMaterial* mat = nullptr; if (tep) { mat = tep->getMaterialParams(); @@ -5449,14 +5449,14 @@ S32 LLViewerObject::setTETexture(const U8 te, const LLUUID& uuid) S32 LLViewerObject::setTENormalMap(const U8 te, const LLUUID& uuid) { - LLViewerFetchedTexture *image = (uuid == LLUUID::null) ? NULL : LLViewerTextureManager::getFetchedTexture( + LLViewerFetchedTexture *image = (uuid == LLUUID::null) ? nullptr : LLViewerTextureManager::getFetchedTexture( uuid, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost()); return setTENormalMapCore(te, image); } S32 LLViewerObject::setTESpecularMap(const U8 te, const LLUUID& uuid) { - LLViewerFetchedTexture *image = (uuid == LLUUID::null) ? NULL : LLViewerTextureManager::getFetchedTexture( + LLViewerFetchedTexture *image = (uuid == LLUUID::null) ? nullptr : LLViewerTextureManager::getFetchedTexture( uuid, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost()); return setTESpecularMapCore(te, image); } @@ -5849,7 +5849,7 @@ LLViewerTexture *LLViewerObject::getTEImage(const U8 face) const LL_ERRS() << llformat("Requested Image from invalid face: %d/%d",face,getNumTEs()) << LL_ENDL; - return NULL; + return nullptr; } @@ -5896,7 +5896,7 @@ LLViewerTexture *LLViewerObject::getTENormalMap(const U8 face) const LL_ERRS() << llformat("Requested Image from invalid face: %d/%d",face,getNumTEs()) << LL_ENDL; - return NULL; + return nullptr; } LLViewerTexture *LLViewerObject::getTESpecularMap(const U8 face) const @@ -5918,7 +5918,7 @@ LLViewerTexture *LLViewerObject::getTESpecularMap(const U8 face) const LL_ERRS() << llformat("Requested Image from invalid face: %d/%d",face,getNumTEs()) << LL_ENDL; - return NULL; + return nullptr; } void LLViewerObject::fitFaceTexture(const U8 face) @@ -5930,7 +5930,7 @@ LLBBox LLViewerObject::getBoundingBoxAgent() const { LLVector3 position_agent; LLQuaternion rot; - LLViewerObject* avatar_parent = NULL; + LLViewerObject* avatar_parent = nullptr; LLViewerObject* root_edit = (LLViewerObject*)getRootEdit(); if (root_edit) { @@ -6063,7 +6063,7 @@ void LLViewerObject::restoreHudText() if (mText) { mText->markDead(); - mText = NULL; + mText = nullptr; } } else @@ -6103,7 +6103,7 @@ void LLViewerObject::clearIcon() { if (mIcon) { - mIcon = NULL; + mIcon = nullptr; } } @@ -6176,7 +6176,7 @@ bool LLViewerObject::isOwnerInMuteList(LLUUID id) LLVOAvatar* LLViewerObject::asAvatar() { - return NULL; + return nullptr; } // If this object is directly or indirectly parented by an avatar, @@ -6198,7 +6198,7 @@ LLVOAvatar* LLViewerObject::getAvatarAncestor() } pobj = (LLViewerObject*) pobj->getParent(); } - return NULL; + return nullptr; } bool LLViewerObject::isParticleSource() const @@ -6243,7 +6243,7 @@ void LLViewerObject::unpackParticleSource(const S32 block_num, const LLUUID& own LL_PROFILE_ZONE_SCOPED_CATEGORY_VIEWER; if (!mPartSourcep.isNull() && mPartSourcep->isDead()) { - mPartSourcep = NULL; + mPartSourcep = nullptr; } if (mPartSourcep) { @@ -6251,12 +6251,12 @@ void LLViewerObject::unpackParticleSource(const S32 block_num, const LLUUID& own if (!LLViewerPartSourceScript::unpackPSS(this, mPartSourcep, block_num)) { mPartSourcep->setDead(); - mPartSourcep = NULL; + mPartSourcep = nullptr; } } else { - LLPointer pss = LLViewerPartSourceScript::unpackPSS(this, NULL, block_num); + LLPointer pss = LLViewerPartSourceScript::unpackPSS(this, nullptr, block_num); //If the owner is muted, don't create the system if(LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagParticles)) return; @@ -6292,7 +6292,7 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_ LL_PROFILE_ZONE_SCOPED_CATEGORY_VIEWER; if (!mPartSourcep.isNull() && mPartSourcep->isDead()) { - mPartSourcep = NULL; + mPartSourcep = nullptr; } if (mPartSourcep) { @@ -6300,12 +6300,12 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_ if (!LLViewerPartSourceScript::unpackPSS(this, mPartSourcep, dp, legacy)) { mPartSourcep->setDead(); - mPartSourcep = NULL; + mPartSourcep = nullptr; } } else { - LLPointer pss = LLViewerPartSourceScript::unpackPSS(this, NULL, dp, legacy); + LLPointer pss = LLViewerPartSourceScript::unpackPSS(this, nullptr, dp, legacy); //If the owner is muted, don't create the system if(LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagParticles)) return; // We need to be able to deal with a particle source that hasn't changed, but still got an update! @@ -6340,7 +6340,7 @@ void LLViewerObject::deleteParticleSource() if (mPartSourcep.notNull()) { mPartSourcep->setDead(); - mPartSourcep = NULL; + mPartSourcep = nullptr; } } @@ -6393,11 +6393,11 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow { // We don't clear the sound if it's a loop, it'll go away on its own. // At least, this appears to be how the scripts work. - // The attached sound ID is set to NULL to avoid it playing back when the + // The attached sound ID is set to nullptr to avoid it playing back when the // object rezzes in on non-looping sounds. //LL_INFOS() << "Clearing attached sound " << mAudioSourcep->getCurrentData()->getID() << LL_ENDL; gAudiop->cleanupAudioSource(mAudioSourcep); - mAudioSourcep = NULL; + mAudioSourcep = nullptr; } else if (flags & LL_SOUND_FLAG_STOP) { @@ -6418,7 +6418,7 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow if ( mAudioSourcep && mAudioSourcep->isDone() ) { gAudiop->cleanupAudioSource(mAudioSourcep); - mAudioSourcep = NULL; + mAudioSourcep = nullptr; } if (mAudioSourcep && mAudioSourcep->isMuted() && @@ -6506,7 +6506,7 @@ bool LLViewerObject::unpackParameterEntry(U16 param_type, LLDataPacker *dp) LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 param_type) { - LLNetworkData* new_block = NULL; + LLNetworkData* new_block = nullptr; switch (param_type) { case LLNetworkData::PARAMS_FLEXIBLE: @@ -6560,7 +6560,7 @@ LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 para mExtraParameterList[param_type] = new_entry; return new_entry; } - return NULL; + return nullptr; } LLViewerObject::ExtraParameter* LLViewerObject::getExtraParameterEntry(U16 param_type) const @@ -6571,7 +6571,7 @@ LLViewerObject::ExtraParameter* LLViewerObject::getExtraParameterEntry(U16 param { return itor->second; } - return NULL; + return nullptr; } LLViewerObject::ExtraParameter* LLViewerObject::getExtraParameterEntryCreate(U16 param_type) @@ -6593,7 +6593,7 @@ LLNetworkData* LLViewerObject::getParameterEntry(U16 param_type) const } else { - return NULL; + return nullptr; } } @@ -7485,7 +7485,7 @@ LLVOAvatar* LLViewerObject::getAvatar() const return (LLVOAvatar*) vobj; } - return NULL; + return nullptr; } bool LLViewerObject::hasRenderMaterialParams() const diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index a9c2db60e4..d9f48265d9 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -188,7 +188,7 @@ class LLViewerObject virtual bool isAttachment() const { return false; } const std::string& getAttachmentItemName() const; - virtual LLVOAvatar* getAvatar() const; //get the avatar this object is attached to, or NULL if object is not an attachment + virtual LLVOAvatar* getAvatar() const; //get the avatar this object is attached to, or nullptr if object is not an attachment bool hasRenderMaterialParams() const; void setHasRenderMaterialParams(bool has_params); @@ -316,11 +316,11 @@ class LLViewerObject bool pick_transparent = false, bool pick_rigged = false, bool pick_unselectable = true, - 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); @@ -424,11 +424,11 @@ class LLViewerObject virtual F32 getEstTrianglesStreamingCost() const; virtual F32 getStreamingCost() const; virtual bool getCostData(LLMeshCostData& costs) const; - virtual U32 getTriangleCount(S32* vcount = NULL) const; + virtual U32 getTriangleCount(S32* vcount = nullptr) const; virtual U32 getHighLODTriangleCount(); F32 recursiveGetScaledSurfaceArea() const; - U32 recursiveGetTriangleCount(S32* vcount = NULL) const; + U32 recursiveGetTriangleCount(S32* vcount = nullptr) const; void setObjectCost(F32 cost); F32 getObjectCost(); @@ -457,11 +457,11 @@ class LLViewerObject void setAttachedSound(const LLUUID &audio_uuid, const LLUUID& owner_id, const F32 gain, const U8 flags); void adjustAudioGain(const F32 gain); F32 getSoundCutOffRadius() const { return mSoundCutOffRadius; } - void clearAttachedSound() { mAudioSourcep = NULL; } + void clearAttachedSound() { mAudioSourcep = nullptr; } // Create if necessary LLAudioSource *getAudioSource(const LLUUID& owner_id); - bool isAudioSource() const {return mAudioSourcep != NULL;} + bool isAudioSource() const {return mAudioSourcep != nullptr;} U8 getMediaType() const; void setMediaType(U8 media_type); @@ -914,7 +914,7 @@ class LLViewerObject LLQuaternion mPreviousRotation; U8 mAttachmentState; // this encodes the attachment id in a somewhat complex way. 0 if not an attachment. - LLViewerObjectMedia* mMedia; // NULL if no media associated + LLViewerObjectMedia* mMedia; // nullptr if no media associated U8 mClickAction; F32 mObjectCost; //resource cost of this object or -1 if unknown F32 mLinksetCost; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 1b38fed3bb..ee1c6e91bf 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -230,7 +230,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, bool just_created, bool from_cache) { - LLMessageSystem* msg = NULL; + LLMessageSystem* msg = nullptr; if(!from_cache) { @@ -262,14 +262,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 || gNonInteractive) { - return NULL; //nothing cached. + return nullptr; //nothing cached. } LLViewerObject *objectp; @@ -362,7 +362,7 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* { LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL; recorder.objectUpdateFailure(); - return NULL; + return nullptr; } justCreated = true; mNumNewObjects++; @@ -373,7 +373,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) @@ -676,7 +676,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(update_type); objectp->setLastUpdateType(update_type); @@ -875,7 +875,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 idle_list; @@ -905,9 +905,9 @@ void LLViewerObjectList::update(LLAgent &agent) } } else - { // There shouldn't be any NULL pointers in the list, but they have caused + { // There shouldn't be any nullptr pointers in the list, but they have caused // crashes before. This may be idleUpdate() messing with the list. - LL_WARNS() << "LLViewerObjectList::update has a NULL objectp" << LL_ENDL; + LL_WARNS() << "LLViewerObjectList::update has a nullptr objectp" << LL_ENDL; } } } @@ -1333,7 +1333,7 @@ bool LLViewerObjectList::killObject(LLViewerObject *objectp) { LL_PROFILE_ZONE_SCOPED; // Don't ever kill gAgentAvatarp, just force it to the agent's region - // unless region is NULL which is assumed to mean you are logging out. + // unless region is nullptr which is assumed to mean you are logging out. if ((objectp == gAgentAvatarp) && gAgent.getRegion()) { objectp->setRegion(gAgent.getRegion()); @@ -1427,7 +1427,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; } @@ -1435,7 +1435,7 @@ void LLViewerObjectList::cleanDeadObjects(bool use_timer) if (objectp->isDead()) { LLPointer::swap(*iter, *target); - *target = NULL; + *target = nullptr; ++target; num_removed++; @@ -1833,7 +1833,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; @@ -1855,7 +1855,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; @@ -1891,7 +1891,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) { @@ -1922,7 +1922,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 547ef9fb2d..0d62ddb73d 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -256,12 +256,12 @@ extern LLViewerObjectList gObjectList; // Inlines /** * Note: - * it will return NULL for offline avatar_id + * it will return nullptr for offline avatar_id */ inline LLViewerObject *LLViewerObjectList::findObject(const LLUUID &id) { if (id.isNull()) - return NULL; + return nullptr; auto iter = mUUIDObjectMap.find(id); if (iter != mUUIDObjectMap.end()) @@ -269,7 +269,7 @@ inline LLViewerObject *LLViewerObjectList::findObject(const LLUUID &id) return iter->second; } - return NULL; + return nullptr; } inline LLViewerObject *LLViewerObjectList::getObject(const S32 index) @@ -279,7 +279,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.cpp b/indra/newview/llvieweroctree.cpp index b1673d2232..1387438289 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -232,7 +232,7 @@ S32 AABBSphereIntersectR2(const LLVector4a& min, const LLVector4a& max, const LL //class LLViewerOctreeEntry definitions //----------------------------------------------------------------------------------- LLViewerOctreeEntry::LLViewerOctreeEntry() -: mGroup(NULL), +: mGroup(nullptr), mBinRadius(0.f), mBinIndex(-1), mVisible(0) @@ -243,7 +243,7 @@ LLViewerOctreeEntry::LLViewerOctreeEntry() for(S32 i = 0; i < NUM_DATA_TYPE; i++) { - mData[i] = NULL; + mData[i] = nullptr; } } @@ -254,8 +254,8 @@ LLViewerOctreeEntry::~LLViewerOctreeEntry() void LLViewerOctreeEntry::addData(LLViewerOctreeEntryData* data) { - //llassert(mData[data->getDataType()] == NULL); - llassert(data != NULL); + //llassert(mData[data->getDataType()] == nullptr); + llassert(data != nullptr); mData[data->getDataType()] = data; } @@ -273,12 +273,12 @@ void LLViewerOctreeEntry::removeData(LLViewerOctreeEntryData* data) return; } - mData[data->getDataType()] = NULL; + mData[data->getDataType()] = nullptr; - if(mGroup != NULL && !mData[LLDRAWABLE]) + if(mGroup != nullptr && !mData[LLDRAWABLE]) { LLViewerOctreeGroup* group = mGroup; - mGroup = NULL; + mGroup = nullptr; group->removeFromGroup(data); llassert(mBinIndex == -1); @@ -288,7 +288,7 @@ void LLViewerOctreeEntry::removeData(LLViewerOctreeEntryData* data) //called by group handleDestruction() ONLY when group is destroyed by octree. void LLViewerOctreeEntry::nullGroup() { - mGroup = NULL; + mGroup = nullptr; } void LLViewerOctreeEntry::setGroup(LLViewerOctreeGroup* group) @@ -301,7 +301,7 @@ void LLViewerOctreeEntry::setGroup(LLViewerOctreeGroup* group) if(mGroup) { LLViewerOctreeGroup* old_group = mGroup; - mGroup = NULL; + mGroup = nullptr; old_group->removeFromGroup(this); llassert(mBinIndex == -1); @@ -323,7 +323,7 @@ LLViewerOctreeEntryData::~LLViewerOctreeEntryData() LLViewerOctreeEntryData::LLViewerOctreeEntryData(LLViewerOctreeEntry::eEntryDataType_t data_type) : mDataType(data_type), - mEntry(NULL) + mEntry(nullptr) { } @@ -353,7 +353,7 @@ void LLViewerOctreeEntryData::removeOctreeEntry() if(mEntry) { mEntry->removeData(this); - mEntry = NULL; + mEntry = nullptr; } } @@ -394,7 +394,7 @@ void LLViewerOctreeEntryData::shift(const LLVector4a &shift_vector) LLViewerOctreeGroup* LLViewerOctreeEntryData::getGroup()const { - return mEntry.notNull() ? mEntry->mGroup : NULL; + return mEntry.notNull() ? mEntry->mGroup : nullptr; } const LLVector4a& LLViewerOctreeEntryData::getPositionGroup() const @@ -489,7 +489,7 @@ bool LLViewerOctreeGroup::removeFromGroup(LLViewerOctreeEntryData* data) bool LLViewerOctreeGroup::removeFromGroup(LLViewerOctreeEntry* entry) { - llassert(entry != NULL); + llassert(entry != nullptr); llassert(!entry->getGroup()); if(isDead()) //group is about to be destroyed, not need to double delete the entry. @@ -528,7 +528,7 @@ void LLViewerOctreeGroup::unbound() if (mOctreeNode) { OctreeNode* parent = (OctreeNode*) mOctreeNode->getParent(); - while (parent != NULL) + while (parent != nullptr) { LLViewerOctreeGroup* group = (LLViewerOctreeGroup*) parent->getListener(0); if (!group || group->isDirty()) @@ -621,7 +621,7 @@ void LLViewerOctreeGroup::handleRemoval(const TreeNode* node, LLViewerOctreeEntr unbound(); setState(OBJECT_DIRTY); - obj->setGroup(NULL); //this could cause *this* pointer to be destroyed. So no more function calls after this. + obj->setGroup(nullptr); //this could cause *this* pointer to be destroyed. So no more function calls after this. } //virtual @@ -640,7 +640,7 @@ void LLViewerOctreeGroup::handleDestruction(const TreeNode* node) obj->nullGroup(); } } - mOctreeNode = NULL; + mOctreeNode = nullptr; } //virtual @@ -681,12 +681,12 @@ LLViewerOctreeGroup* LLViewerOctreeGroup::getParent() { if (isDead()) { - return NULL; + return nullptr; } if(!mOctreeNode) { - return NULL; + return nullptr; } OctreeNode* parent = mOctreeNode->getOctParent(); @@ -696,7 +696,7 @@ LLViewerOctreeGroup* LLViewerOctreeGroup::getParent() return (LLViewerOctreeGroup*) parent->getListener(0); } - return NULL; + return nullptr; } //virtual @@ -869,7 +869,7 @@ LLOcclusionCullingGroup::LLOcclusionCullingGroup(OctreeNode* node, LLViewerOctre mLODHash = part->mLODSeed; OctreeNode* oct_parent = node->getOctParent(); - LLOcclusionCullingGroup* parent = oct_parent ? (LLOcclusionCullingGroup*) oct_parent->getListener(0) : NULL; + LLOcclusionCullingGroup* parent = oct_parent ? (LLOcclusionCullingGroup*) oct_parent->getListener(0) : nullptr; for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) { @@ -1178,7 +1178,7 @@ void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera, const LLVector4a* sh LLVector4a bounds[2]; bounds[0] = mBounds[0]; bounds[1] = mBounds[1]; - if(shift != NULL) + if(shift != nullptr) { bounds[0].add(*shift); } @@ -1300,7 +1300,7 @@ void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera, const LLVector4a* sh //class LLViewerOctreePartition definitions //----------------------------------------------------------------------------------- LLViewerOctreePartition::LLViewerOctreePartition() : - mRegionp(NULL), + mRegionp(nullptr), mOcclusionEnabled(true), mDrawableType(0), mLODSeed(0), @@ -1310,7 +1310,7 @@ LLViewerOctreePartition::LLViewerOctreePartition() : center.splat(0.f); size.splat(1.f); - mOctree = new OctreeRoot(center,size, NULL); + mOctree = new OctreeRoot(center,size, nullptr); } LLViewerOctreePartition::~LLViewerOctreePartition() diff --git a/indra/newview/llvieweroctree.h b/indra/newview/llvieweroctree.h index 83b8aa8d03..07f15e2afc 100644 --- a/indra/newview/llvieweroctree.h +++ b/indra/newview/llvieweroctree.h @@ -94,9 +94,9 @@ class alignas(16) LLViewerOctreeEntry : public LLRefCount 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;} @@ -300,7 +300,7 @@ class LLOcclusionCullingGroup : public LLViewerOctreeGroup 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; } U32 getOcclusionState() const { return mOcclusionState[LLViewerCamera::sCurCameraID];} diff --git a/indra/newview/llviewerparcelaskplay.cpp b/indra/newview/llviewerparcelaskplay.cpp index 18257015ec..eacc40d1fe 100644 --- a/indra/newview/llviewerparcelaskplay.cpp +++ b/indra/newview/llviewerparcelaskplay.cpp @@ -44,7 +44,7 @@ // class LLViewerParcelAskPlay LLViewerParcelAskPlay::LLViewerParcelAskPlay() : -pNotification(NULL) +pNotification(nullptr) { } @@ -116,7 +116,7 @@ void LLViewerParcelAskPlay::cancelNotification() pNotification->setIgnored(false); LLNotifications::getInstance()->cancel(pNotification); } - pNotification = NULL; + pNotification = nullptr; } } @@ -163,7 +163,7 @@ LLViewerParcelAskPlay::ParcelData* LLViewerParcelAskPlay::getSetting(const LLUUI return &(found_parcel->second); } } - return NULL; + return nullptr; } LLViewerParcelAskPlay::EAskPlayMode LLViewerParcelAskPlay::getPlayMode(const LLUUID ®ion_id, const S32 &parcel_id) diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 9af0062f1e..d920d1c835 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -61,7 +61,7 @@ mMediaParcelLocalID(0) LLViewerParcelMedia::~LLViewerParcelMedia() { // This needs to be destroyed before global destructor time. - mMediaImpl = NULL; + mMediaImpl = nullptr; } ////////////////////////////////////////////////////////////////////////////////////////// @@ -179,7 +179,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. - mMediaImpl = NULL; + mMediaImpl = nullptr; // A new impl will be created below. } @@ -221,7 +221,7 @@ void LLViewerParcelMedia::stop() LLViewerMediaFocus::getInstance()->clearFocus(); // This will unload & kill the media instance. - mMediaImpl = NULL; + mMediaImpl = nullptr; } // static diff --git a/indra/newview/llviewerparcelmediaautoplay.cpp b/indra/newview/llviewerparcelmediaautoplay.cpp index 41bc5c8cfa..689e30abf0 100644 --- a/indra/newview/llviewerparcelmediaautoplay.cpp +++ b/indra/newview/llviewerparcelmediaautoplay.cpp @@ -62,8 +62,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/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 432da2e990..2d758bb3c5 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -79,7 +79,7 @@ const F32 PARCEL_COLLISION_DRAW_SECS_ON_PROXIMITY = 1.f; // Globals -U8* LLViewerParcelMgr::sPackedOverlay = NULL; +U8* LLViewerParcelMgr::sPackedOverlay = nullptr; S32 LLViewerParcelMgr::PARCEL_BAN_LINES_HIDE = 0; S32 LLViewerParcelMgr::PARCEL_BAN_LINES_ON_COLLISION = 1; S32 LLViewerParcelMgr::PARCEL_BAN_LINES_ON_PROXIMITY = 2; @@ -171,38 +171,38 @@ LLViewerParcelMgr::LLViewerParcelMgr() LLViewerParcelMgr::~LLViewerParcelMgr() { - mCurrentParcelSelection->setParcel(NULL); - mCurrentParcelSelection = NULL; + mCurrentParcelSelection->setParcel(nullptr); + mCurrentParcelSelection = nullptr; - mFloatingParcelSelection->setParcel(NULL); - mFloatingParcelSelection = NULL; + mFloatingParcelSelection->setParcel(nullptr); + mFloatingParcelSelection = nullptr; delete mCurrentParcel; - mCurrentParcel = NULL; + mCurrentParcel = nullptr; delete mAgentParcel; - mAgentParcel = NULL; + mAgentParcel = nullptr; delete mCollisionParcel; - mCollisionParcel = NULL; + mCollisionParcel = nullptr; delete mHoverParcel; - mHoverParcel = NULL; + mHoverParcel = nullptr; delete[] mHighlightSegments; - mHighlightSegments = NULL; + mHighlightSegments = nullptr; delete[] mCollisionSegments; - mCollisionSegments = NULL; + mCollisionSegments = nullptr; delete[] sPackedOverlay; - sPackedOverlay = NULL; + sPackedOverlay = nullptr; delete[] mAgentParcelOverlay; - mAgentParcelOverlay = NULL; + mAgentParcelOverlay = nullptr; - sBlockedImage = NULL; - sPassImage = NULL; + sBlockedImage = nullptr; + sPassImage = nullptr; } void LLViewerParcelMgr::dump() @@ -474,7 +474,7 @@ void LLViewerParcelMgr::selectCollisionParcel() resetSegments(mHighlightSegments); mFloatingParcelSelection->setParcel(mCurrentParcel); - mCurrentParcelSelection->setParcel(NULL); + mCurrentParcelSelection->setParcel(nullptr); mCurrentParcelSelection = new LLParcelSelection(mCurrentParcel); mSelected = true; @@ -496,7 +496,7 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, { mSelected = false; notifyObservers(); - return NULL; + return nullptr; } // ...y isn't more than one meter away @@ -505,7 +505,7 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, { mSelected = false; notifyObservers(); - return NULL; + return nullptr; } // Can't select across region boundary @@ -522,7 +522,7 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, { // just in case they somehow selected no land. mSelected = false; - return NULL; + return nullptr; } if (region != region_other) @@ -530,7 +530,7 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, LLNotificationsUtil::add("CantSelectLandFromMultipleRegions"); mSelected = false; notifyObservers(); - return NULL; + return nullptr; } // Build region global copies of corners @@ -555,7 +555,7 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, mRequestResult = PARCEL_RESULT_NO_DATA; mFloatingParcelSelection->setParcel(mCurrentParcel); - mCurrentParcelSelection->setParcel(NULL); + mCurrentParcelSelection->setParcel(nullptr); mCurrentParcelSelection = new LLParcelSelection(mCurrentParcel); mSelected = true; @@ -588,8 +588,8 @@ void LLViewerParcelMgr::deselectLand() mSelectedDwell = DWELL_NAN; // invalidate parcel selection so that existing users of this selection can clean up - mCurrentParcelSelection->setParcel(NULL); - mFloatingParcelSelection->setParcel(NULL); + mCurrentParcelSelection->setParcel(nullptr); + mFloatingParcelSelection->setParcel(nullptr); // create new parcel selection mCurrentParcelSelection = new LLParcelSelection(mCurrentParcel); @@ -665,7 +665,7 @@ LLParcel * LLViewerParcelMgr::getAgentOrSelectedParcel() const parcel = selection->getParcel(); if (parcel && (parcel->getLocalID() == INVALID_PARCEL_ID)) { - parcel = NULL; + parcel = nullptr; } } } @@ -849,7 +849,7 @@ bool LLViewerParcelMgr::inAgentParcel(const LLVector3d &pos_global) const } } -// Returns NULL when there is no valid data. +// Returns nullptr when there is no valid data. LLParcel* LLViewerParcelMgr::getHoverParcel() const { if (mHoverRequestResult == PARCEL_RESULT_SUCCESS) @@ -858,11 +858,11 @@ LLParcel* LLViewerParcelMgr::getHoverParcel() const } else { - return NULL; + return nullptr; } } -// Returns NULL when there is no valid data. +// Returns nullptr when there is no valid data. LLParcel* LLViewerParcelMgr::getCollisionParcel() const { if (mRenderCollision) @@ -871,7 +871,7 @@ LLParcel* LLViewerParcelMgr::getCollisionParcel() const } else { - return NULL; + return nullptr; } } @@ -1144,14 +1144,14 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy( if (!mSelected || !mCurrentParcel) { LLNotificationsUtil::add("CannotBuyLandNothingSelected"); - return NULL; + return nullptr; } LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) { LLNotificationsUtil::add("CannotBuyLandNoRegion"); - return NULL; + return nullptr; } if (is_claim) @@ -1169,7 +1169,7 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy( if (region != region2) { LLNotificationsUtil::add("CantBuyLandAcrossMultipleRegions"); - return NULL; + return nullptr; } } @@ -1243,7 +1243,7 @@ void LLViewerParcelMgr::deleteParcelBuy(ParcelBuyInfo* *info) { // Must be here because ParcelBuyInfo is local to this .cpp file delete *info; - *info = NULL; + *info = nullptr; } void LLViewerParcelMgr::sendParcelDeed(const LLUUID& group_id) @@ -1584,7 +1584,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use } // Decide where the data will go. - LLParcel* parcel = NULL; + LLParcel* parcel = nullptr; if (sequence_id == SELECTED_PARCEL_SEQ_ID) { // ...selected parcels report this sequence id @@ -1850,7 +1850,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mHighlightSegments ); delete[] bitmap; - bitmap = NULL; + bitmap = nullptr; parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = true; } @@ -1905,7 +1905,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mCollisionSegments ); delete[] bitmap; - bitmap = NULL; + bitmap = nullptr; } else if (sequence_id == HOVERED_PARCEL_SEQ_ID) @@ -2009,7 +2009,7 @@ void LLViewerParcelMgr::optionallyStartMusic(const std::string &music_url, const static LLCachedControl tentative_autoplay(gSavedSettings, "MediaTentativeAutoPlay", true); // only play music when you enter a new parcel if the UI control for this // was not *explicitly* stopped by the user. (part of SL-4878) - LLPanelNearByMedia* nearby_media_panel = gStatusBar ? gStatusBar->getNearbyMediaPanel() : NULL; + LLPanelNearByMedia* nearby_media_panel = gStatusBar ? gStatusBar->getNearbyMediaPanel() : nullptr; LLViewerAudio* viewer_audio = LLViewerAudio::getInstance(); // ask mode //todo constants diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index cf92850762..3f92d2c57d 100755 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -115,8 +115,8 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_ LLViewerParcelOverlay::~LLViewerParcelOverlay() { delete[] mOwnership; - mOwnership = NULL; - mImageRaw = NULL; + mOwnership = nullptr; + mImageRaw = nullptr; } //--------------------------------------------------------------------------- diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 6dead0cf82..cf29ea880b 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -89,7 +89,7 @@ LLViewerPart::~LLViewerPart() { if (mPartSourcep.notNull() && mPartSourcep->mLastPart == this) { - mPartSourcep->mLastPart = NULL; + mPartSourcep->mLastPart = nullptr; } //patch up holes in the ribbon @@ -105,7 +105,7 @@ LLViewerPart::~LLViewerPart() mChild->mParent = mParent; } - mPartSourcep = NULL; + mPartSourcep = nullptr; --LLViewerPartSim::sParticleCount2 ; } @@ -136,7 +136,7 @@ void LLViewerPart::init(LLPointer sourcep, LLViewerTexture * LLViewerPartGroup::LLViewerPartGroup(const LLVector3 ¢er_agent, const F32 box_side, bool hud) : mHud(hud) { - mVOPartGroupp = NULL; + mVOPartGroupp = nullptr; mUniformParticles = true; mRegionp = LLWorld::getInstance()->getRegionFromPosAgent(center_agent); @@ -172,7 +172,7 @@ LLViewerPartGroup::LLViewerPartGroup(const LLVector3 ¢er_agent, const F32 bo LLSpatialGroup* group = mVOPartGroupp->mDrawable->getSpatialGroup(); - if (group != NULL) + if (group != nullptr) { LLVector3 center(group->getOctreeNode()->getCenter().getF32ptr()); LLVector3 size(group->getOctreeNode()->getSize().getF32ptr()); @@ -216,7 +216,7 @@ void LLViewerPartGroup::cleanup() { gObjectList.killObject(mVOPartGroupp); } - mVOPartGroupp = NULL; + mVOPartGroupp = nullptr; } } @@ -435,7 +435,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) if (mParticles.empty()) { gObjectList.killObject(mVOPartGroupp); - mVOPartGroupp = NULL; + mVOPartGroupp = nullptr; } LLViewerPartSim::checkParticleCount() ; @@ -564,7 +564,7 @@ void LLViewerPartSim::addPart(LLViewerPart* part) { //delete the particle if can not add it in delete part ; - part = NULL ; + part = nullptr ; } } @@ -572,7 +572,7 @@ void LLViewerPartSim::addPart(LLViewerPart* part) LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part) { const F32 MAX_MAG = 1000000.f*1000000.f; // 1 million - LLViewerPartGroup *return_group = NULL ; + LLViewerPartGroup *return_group = nullptr ; if (part->mPosAgent.magVecSquared() > MAX_MAG || !part->mPosAgent.isFinite()) { #if 0 && !LL_RELEASE_FOR_DOWNLOAD @@ -611,7 +611,7 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part) LL_INFOS() << part->mPosAgent << LL_ENDL; mViewerPartGroups.pop_back() ; delete groupp; - groupp = NULL ; + groupp = nullptr ; } return_group = groupp; } @@ -620,7 +620,7 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part) if(!return_group) //failed to insert the particle { delete part ; - part = NULL ; + part = nullptr ; } return return_group ; diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index 54e0470604..f91ead19e0 100644 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -55,7 +55,7 @@ static LLVOAvatar* find_avatar(const LLUUID& id) } else { - return NULL; + return nullptr; } } @@ -71,7 +71,7 @@ LLViewerPartSource::LLViewerPartSource(const U32 type) : static U32 id_seed = 0; mID = ++id_seed; - mLastPart = NULL; + mLastPart = nullptr; mDelay = 0 ; } @@ -123,8 +123,8 @@ LLViewerPartSourceScript::LLViewerPartSourceScript(LLViewerObject *source_objp) void LLViewerPartSourceScript::setDead() { mIsDead = true; - mSourceObjectp = NULL; - mTargetObjectp = NULL; + mSourceObjectp = nullptr; + mTargetObjectp = nullptr; } void LLViewerPartSourceScript::update(const F32 dt) @@ -153,7 +153,7 @@ void LLViewerPartSourceScript::update(const F32 dt) { if (mSourceObjectp->isDead()) { - mSourceObjectp = NULL; + mSourceObjectp = nullptr; } else if (mSourceObjectp->mDrawable.notNull()) { @@ -176,7 +176,7 @@ void LLViewerPartSourceScript::update(const F32 dt) { if (mTargetObjectp->isDead()) { - mTargetObjectp = NULL; + mTargetObjectp = nullptr; } else if (mTargetObjectp->mDrawable.notNull()) { @@ -303,7 +303,7 @@ void LLViewerPartSourceScript::update(const F32 dt) LLViewerPart* part = new LLViewerPart(); - part->init(this, mImagep, NULL); + part->init(this, mImagep, nullptr); part->mFlags = mPartSysData.mPartData.mFlags; if (!mSourceObjectp.isNull() && mSourceObjectp->isHUDAttachment()) { @@ -448,12 +448,12 @@ LLPointer LLViewerPartSourceScript::unpackPSS(LLViewer { if (LLPartSysData::isNullPS(block_num)) { - return NULL; + return nullptr; } LLPointer new_pssp = new LLViewerPartSourceScript(source_objp); if (!new_pssp->mPartSysData.unpackBlock(block_num)) { - return NULL; + return nullptr; } if (new_pssp->mPartSysData.mTargetUUID.notNull()) { @@ -466,14 +466,14 @@ LLPointer LLViewerPartSourceScript::unpackPSS(LLViewer { if (LLPartSysData::isNullPS(block_num)) { - return NULL; + return nullptr; } F32 prev_max_age = pssp->mPartSysData.mMaxAge; F32 prev_start_age = pssp->mPartSysData.mStartAge; if (!pssp->mPartSysData.unpackBlock(block_num)) { - return NULL; + return nullptr; } else if (pssp->mPartSysData.mMaxAge && (prev_max_age != pssp->mPartSysData.mMaxAge || prev_start_age != pssp->mPartSysData.mStartAge)) @@ -502,14 +502,14 @@ LLPointer LLViewerPartSourceScript::unpackPSS(LLViewer { if (!new_pssp->mPartSysData.unpackLegacy(dp)) { - return NULL; + return nullptr; } } else { if (!new_pssp->mPartSysData.unpack(dp)) { - return NULL; + return nullptr; } } @@ -527,14 +527,14 @@ LLPointer LLViewerPartSourceScript::unpackPSS(LLViewer { if (!pssp->mPartSysData.unpackLegacy(dp)) { - return NULL; + return nullptr; } } else { if (!pssp->mPartSysData.unpack(dp)) { - return NULL; + return nullptr; } } @@ -587,7 +587,7 @@ LLViewerPartSourceSpiral::LLViewerPartSourceSpiral(const LLVector3 &pos) : void LLViewerPartSourceSpiral::setDead() { mIsDead = true; - mSourceObjectp = NULL; + mSourceObjectp = nullptr; } @@ -691,8 +691,8 @@ LLViewerPartSourceBeam::~LLViewerPartSourceBeam() void LLViewerPartSourceBeam::setDead() { mIsDead = true; - mSourceObjectp = NULL; - mTargetObjectp = NULL; + mSourceObjectp = nullptr; + mTargetObjectp = nullptr; } void LLViewerPartSourceBeam::setColor(const LLColor4 &color) @@ -844,7 +844,7 @@ LLViewerPartSourceChat::LLViewerPartSourceChat(const LLVector3 &pos) : void LLViewerPartSourceChat::setDead() { mIsDead = true; - mSourceObjectp = NULL; + mSourceObjectp = nullptr; } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index cd70f8f9b9..40ac18b8e1 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -177,15 +177,15 @@ class LLViewerRegionImpl public: LLViewerRegionImpl(LLViewerRegion * region, LLHost const & host): mHost(host), - mCompositionp(NULL), - mEventPoll(NULL), + mCompositionp(nullptr), + mEventPoll(nullptr), mSeedCapMaxAttempts(MAX_CAP_REQUEST_ATTEMPTS), mSeedCapAttempts(0), mHttpResponderID(0), mLastCameraUpdate(0), mLastCameraOrigin(), - mVOCachePartition(NULL), - mLandp(NULL) + mVOCachePartition(nullptr), + mLandp(nullptr) {} static void buildCapabilityNames(LLSD& capabilityNames); @@ -256,7 +256,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle) LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result; - LLViewerRegion *regionp = NULL; + LLViewerRegion *regionp = nullptr; // This loop is used for retrying a capabilities request. do @@ -313,8 +313,8 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle) << " (attempt #" << impl->mSeedCapAttempts + 1 << ")" << LL_ENDL; LL_DEBUGS("AppInit", "Capabilities") << "Capabilities requested: " << capabilityNames << LL_ENDL; - regionp = NULL; - impl = NULL; + regionp = nullptr; + impl = nullptr; result = httpAdapter->postAndSuspend(httpRequest, url, capabilityNames); if (STATE_WORLD_INIT > LLStartUp::getStartupState()) @@ -410,7 +410,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle) LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result; - LLViewerRegion *regionp = NULL; + LLViewerRegion *regionp = nullptr; // This loop is used for retrying a capabilities request. do @@ -449,8 +449,8 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle) LL_INFOS("AppInit", "Capabilities") << "Requesting second Seed from " << url << " for region " << regionp->getRegionID() << LL_ENDL; - regionp = NULL; - world_inst = NULL; + regionp = nullptr; + world_inst = nullptr; result = httpAdapter->postAndSuspend(httpRequest, url, capabilityNames); LLSD httpResults = result["http_result"]; @@ -543,7 +543,7 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region httpAdapter = std::make_shared("requestSimulatorFeatureCoro", httpPolicy); LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); - LLViewerRegion *regionp = NULL; + LLViewerRegion *regionp = nullptr; S32 attemptNumber = 0; // This loop is used for retrying a capabilities request. do @@ -571,8 +571,8 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region break; // this error condition is not recoverable. } - regionp = NULL; - world_inst = NULL; + regionp = nullptr; + world_inst = nullptr; LLSD result = httpAdapter->getAndSuspend(httpRequest, url); LLSD httpResults = result["http_result"]; @@ -644,7 +644,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mBitsReceived(0.f), mPacketsReceived(0.f), mDead(false), - mLastVisitedEntry(NULL), + mLastVisitedEntry(nullptr), mInvisibilityCheckHistory(-1), mPaused(false), mRegionCacheHitCount(0), @@ -655,7 +655,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, 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 = @@ -694,7 +694,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mObjectPartition.push_back(new LLControlAVPartition(this)); //PARTITION_CONTROL_AV 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)); @@ -754,7 +754,7 @@ LLViewerRegion::~LLViewerRegion() } delete mImpl; - mImpl = NULL; + mImpl = nullptr; } /*virtual*/ @@ -1155,7 +1155,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(); @@ -1216,7 +1216,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; @@ -1387,9 +1387,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(); } } @@ -1563,7 +1563,7 @@ void LLViewerRegion::clearCachedVisibleObjects() } //remove all visible entries. - mLastVisitedEntry = NULL; + mLastVisitedEntry = nullptr; std::vector delete_list; for(LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mActiveSet.begin(); iter != mImpl->mActiveSet.end(); ++iter) @@ -1788,7 +1788,7 @@ void LLViewerRegion::killInvisibleObjects(F32 max_time) if(iter == mImpl->mActiveSet.end()) { - mLastVisitedEntry = NULL; + mLastVisitedEntry = nullptr; } else { @@ -1867,10 +1867,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 @@ -1894,7 +1894,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; @@ -2533,7 +2533,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); @@ -2554,7 +2554,7 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry) if(!entry->getEntry()) { - entry->setOctreeEntry(NULL); + entry->setOctreeEntry(nullptr); } if(entry->getEntry()->hasDrawable()) //already in the rendering pipeline @@ -2577,7 +2577,7 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry) //set parent id U32 parent_id = 0; - if (entry->getDP()) // NULL if nothing cached + if (entry->getDP()) // nullptr if nothing cached { LLViewerObject::unpackParentID(entry->getDP(), parent_id); } @@ -2640,7 +2640,7 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry) if(isNonCacheableObjectCreated(parent_id)) { //parent is visible, so is the child. - addVisibleChildCacheEntry(NULL, entry); + addVisibleChildCacheEntry(nullptr, entry); } else { @@ -2787,7 +2787,7 @@ LLVOCacheEntry* LLViewerRegion::getCacheEntryForOctree(U32 local_id) { if(!sVOCacheCullingEnabled) { - return NULL; + return nullptr; } LLVOCacheEntry* entry = getCacheEntry(local_id); @@ -2806,7 +2806,7 @@ LLVOCacheEntry* LLViewerRegion::getCacheEntry(U32 local_id, bool valid) return iter->second; } } - return NULL; + return nullptr; } void LLViewerRegion::addCacheMiss(U32 id, LLViewerRegion::eCacheMissType cache_miss_type) @@ -3353,7 +3353,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url) } delete mImpl->mEventPoll; - mImpl->mEventPoll = NULL; + mImpl->mEventPoll = nullptr; mImpl->mCapabilities.clear(); setCapability("Seed", url); @@ -3380,7 +3380,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") @@ -3641,7 +3641,7 @@ LLSpatialPartition *LLViewerRegion::getSpatialPartition(U32 type) { return (LLSpatialPartition*)mImpl->mObjectPartition[type]; } - return NULL; + return nullptr; } LLVOCachePartition* LLViewerRegion::getVOCachePartition() @@ -3650,7 +3650,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 @@ -3660,7 +3660,7 @@ const U64 ALLOW_RETURN_ENCROACHING_OBJECT = REGION_FLAGS_ALLOW_RETURN_ENCROACHIN bool LLViewerRegion::objectIsReturnable(const LLVector3& pos, const std::vector& boxes) const { - return (mParcelOverlay != NULL) + return (mParcelOverlay != nullptr) && (mParcelOverlay->isOwnedSelf(pos) || mParcelOverlay->isOwnedGroup(pos) || (getRegionFlag(ALLOW_RETURN_ENCROACHING_OBJECT) diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 08bedc697b..bfe84a62b3 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -482,7 +482,7 @@ void LLViewerShaderMgr::finalizeShaderList() // static LLViewerShaderMgr * LLViewerShaderMgr::instance() { - if(NULL == sInstance) + if(nullptr == sInstance) { sInstance = new LLViewerShaderMgr(); } @@ -493,10 +493,10 @@ LLViewerShaderMgr * LLViewerShaderMgr::instance() // static void LLViewerShaderMgr::releaseInstance() { - if (sInstance != NULL) + if (sInstance != nullptr) { delete sInstance; - sInstance = NULL; + sInstance = nullptr; } } diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index d39d466205..499f32ed0f 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -817,7 +817,7 @@ void send_viewer_stats(bool include_preferences) // C:\Windows\System32 // C:\Windows\SysWOW64 HMODULE vulkan_loader = LoadLibraryA("vulkan-1.dll"); - if (NULL != vulkan_loader) + if (nullptr != vulkan_loader) { vulkan_detected = true; vulkan_max_api_version = "1.0"; // We have at least 1.0. See the note about vkEnumerateInstanceVersion() below. @@ -846,7 +846,7 @@ void send_viewer_stats(bool include_preferences) // Check for vkEnumerateInstanceVersion. If it exists then we have at least 1.1 and can query the max API version. // NOTE: Each VkPhysicalDevice that supports Vulkan has its own VkPhysicalDeviceProperties.apiVersion which is separate from the max API version! // See: https://www.lunarg.com/wp-content/uploads/2019/02/Vulkan-1.1-Compatibility-Statement_01_19.pdf - PFN_vkEnumerateInstanceVersion pEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion) pGetInstanceProcAddr(NULL, "vkEnumerateInstanceVersion"); + PFN_vkEnumerateInstanceVersion pEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion) pGetInstanceProcAddr(nullptr, "vkEnumerateInstanceVersion"); if(pEnumerateInstanceVersion) { uint32_t version = VK_MAKE_API_VERSION(0,1,1,0); // e.g. 4202631 = 1.2.135.0 diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp index 58065ecce5..44bd9b19f6 100644 --- a/indra/newview/llviewerstatsrecorder.cpp +++ b/indra/newview/llviewerstatsrecorder.cpp @@ -35,7 +35,7 @@ #include "llworld.h" LLViewerStatsRecorder::LLViewerStatsRecorder() : - mStatsFile(NULL), + mStatsFile(nullptr), mTimer(), mFileOpenTime(0.0), mLastSnapshotTime(0.0), @@ -185,7 +185,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << mObjectKills << " object kills" << LL_ENDL; - if (mStatsFile == NULL) + if (mStatsFile == nullptr) { // Refresh settings mInterval = gSavedSettings.getF32("StatsReportFileInterval"); @@ -283,7 +283,7 @@ void LLViewerStatsRecorder::closeStatsFile() LL_INFOS("ILX") << "ILX: Stopped writing update information to " << mStatsFileName << " after " << getTimeSinceStart() << " seconds." << LL_ENDL; LLFile::close(mStatsFile); - mStatsFile = NULL; + mStatsFile = nullptr; } mEnableStatsLogging = false; } diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 210cd62d6f..29ac60b7d7 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -127,7 +127,7 @@ class LLEmbeddedNotecardOpener : public LLInventoryCallback public: LLEmbeddedNotecardOpener() - : mTextEditor(NULL) + : mTextEditor(nullptr) { } @@ -436,7 +436,7 @@ LLPointer LLEmbeddedItems::getEmbeddedItemPtr(llwchar ext_char) return iter->second.mItemPtr; } } - return NULL; + return nullptr; } // static @@ -700,7 +700,7 @@ LLViewerTextEditor::~LLViewerTextEditor() // The inventory callback may still be in use by gInventoryCallbackManager... // so set its reference to this to null. - mInventoryCallback->setEditor(NULL); + mInventoryCallback->setEditor(nullptr); } /////////////////////////////////////////////////////////////////// @@ -721,7 +721,7 @@ bool LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) bool handled = false; // Let scrollbar have first dibs - handled = LLView::childrenHandleMouseDown(x, y, mask) != NULL; + handled = LLView::childrenHandleMouseDown(x, y, mask) != nullptr; if( !handled) { @@ -756,7 +756,7 @@ bool LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) } else { - mDragItem = NULL; + mDragItem = nullptr; } } @@ -822,7 +822,7 @@ bool LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) } } } - mDragItem = NULL; + mDragItem = nullptr; } handled = LLTextEditor::handleMouseUp(x,y,mask); @@ -835,7 +835,7 @@ bool LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) bool handled = false; // let scrollbar have first dibs - handled = LLView::childrenHandleDoubleClick(x, y, mask) != NULL; + handled = LLView::childrenHandleDoubleClick(x, y, mask) != nullptr; if( !handled) { diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 1e83482752..e651476e34 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -227,7 +227,7 @@ LLViewerFetchedTexture* LLViewerTextureManager::staticCastToFetchedTexture(LLTex { if(!tex) { - return NULL; + return nullptr; } S8 type = tex->getType(); @@ -241,7 +241,7 @@ LLViewerFetchedTexture* LLViewerTextureManager::staticCastToFetchedTexture(LLTex LL_ERRS() << "not a fetched texture type: " << type << LL_ENDL; } - return NULL; + return nullptr; } LLPointer LLViewerTextureManager::getLocalTexture(bool usemipmaps, bool generate_gl_tex) @@ -410,7 +410,7 @@ void LLViewerTextureManager::init() { LL_WARNS() << "Failed to create default texture " << IMG_DEFAULT << LL_ENDL; } - image_raw = NULL; + image_raw = nullptr; #else LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, true, LLGLTexture::BOOST_UI); #endif @@ -443,7 +443,7 @@ void LLViewerTextureManager::init() if (!sTesterp->isValid()) { delete sTesterp; - sTesterp = NULL; + sTesterp = nullptr; } } } @@ -453,18 +453,18 @@ void LLViewerTextureManager::cleanup() stop_glerror(); delete gTextureManagerBridgep; - LLImageGL::sDefaultGLTexture = NULL; - LLViewerTexture::sNullImagep = NULL; - LLViewerTexture::sBlackImagep = NULL; - LLViewerTexture::sCheckerBoardImagep = NULL; - LLViewerFetchedTexture::sDefaultImagep = NULL; - LLViewerFetchedTexture::sSmokeImagep = NULL; - LLViewerFetchedTexture::sMissingAssetImagep = NULL; + LLImageGL::sDefaultGLTexture = nullptr; + LLViewerTexture::sNullImagep = nullptr; + LLViewerTexture::sBlackImagep = nullptr; + LLViewerTexture::sCheckerBoardImagep = nullptr; + LLViewerFetchedTexture::sDefaultImagep = nullptr; + LLViewerFetchedTexture::sSmokeImagep = nullptr; + LLViewerFetchedTexture::sMissingAssetImagep = nullptr; LLTexUnit::sWhiteTexture = 0; - LLViewerFetchedTexture::sWhiteImagep = NULL; + LLViewerFetchedTexture::sWhiteImagep = nullptr; - LLViewerFetchedTexture::sFlatNormalImagep = NULL; - LLViewerFetchedTexture::sDefaultIrradiancePBRp = NULL; + LLViewerFetchedTexture::sFlatNormalImagep = nullptr; + LLViewerFetchedTexture::sDefaultIrradiancePBRp = nullptr; LLViewerMediaTexture::cleanUpClass(); } @@ -746,7 +746,7 @@ void LLViewerTexture::init(bool firstinit) mMaxVirtualSize = 0.f; mMaxVirtualSizeResetInterval = 1; mMaxVirtualSizeResetCounter = mMaxVirtualSizeResetInterval; - mParcelMedia = NULL; + mParcelMedia = nullptr; memset(&mNumVolumes, 0, sizeof(U32)* LLRender::NUM_VOLUME_TEXTURE_CHANNELS); mVolumeList[LLRender::LIGHT_TEX].clear(); @@ -1194,7 +1194,7 @@ void LLViewerFetchedTexture::init(bool firstinit) mIsFetched = false; mInFastCacheList = false; - mSavedRawImage = NULL; + mSavedRawImage = nullptr; mForceToSaveRawImage = false; mSaveRawImage = false; mSavedRawDiscardLevel = -1; @@ -1210,7 +1210,7 @@ void LLViewerFetchedTexture::init(bool firstinit) LLViewerFetchedTexture::~LLViewerFetchedTexture() { assert_main_thread(); - //*NOTE getTextureFetch can return NULL when Viewer is shutting down. + //*NOTE getTextureFetch can return nullptr when Viewer is shutting down. // This is due to LLWearableList is singleton and is destroyed after // LLAppViewer::cleanup() was called. (see ticket EXT-177) if (mHasFetcher && LLAppViewer::getTextureFetch()) @@ -1240,7 +1240,7 @@ void LLViewerFetchedTexture::cleanup() LLLoadedCallbackEntry *entryp = *iter++; // We never finished loading the image. Indicate failure. // Note: this allows mLoadedCallbackUserData to be cleaned up. - entryp->mCallback( false, this, NULL, NULL, 0, true, entryp->mUserData ); + entryp->mCallback( false, this, nullptr, nullptr, 0, true, entryp->mUserData ); entryp->removeTexture(this); delete entryp; } @@ -1249,7 +1249,7 @@ void LLViewerFetchedTexture::cleanup() // Clean up image data destroyRawImage(); - mSavedRawImage = NULL; + mSavedRawImage = nullptr; mSavedRawDiscardLevel = -1; } @@ -1425,7 +1425,7 @@ void LLViewerFetchedTexture::addToCreateTexture() } mSavedRawDiscardLevel = -1; - mSavedRawImage = NULL; + mSavedRawImage = nullptr; } if(isForSculptOnly()) @@ -2367,7 +2367,7 @@ void LLViewerFetchedTexture::clearCallbackEntryList() // We never finished loading the image. Indicate failure. // Note: this allows mLoadedCallbackUserData to be cleaned up. - entryp->mCallback(false, this, NULL, NULL, 0, true, entryp->mUserData); + entryp->mCallback(false, this, nullptr, nullptr, 0, true, entryp->mUserData); iter = mLoadedCallbackList.erase(iter); delete entryp; } @@ -2399,7 +2399,7 @@ void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::so { // We never finished loading the image. Indicate failure. // Note: this allows mLoadedCallbackUserData to be cleaned up. - entryp->mCallback(false, this, NULL, NULL, 0, true, entryp->mUserData); + entryp->mCallback(false, this, nullptr, nullptr, 0, true, entryp->mUserData); iter = mLoadedCallbackList.erase(iter); delete entryp; } @@ -2548,7 +2548,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() LLLoadedCallbackEntry *entryp = *iter++; // We never finished loading the image. Indicate failure. // Note: this allows mLoadedCallbackUserData to be cleaned up. - entryp->mCallback(false, this, NULL, NULL, 0, true, entryp->mUserData); + entryp->mCallback(false, this, nullptr, nullptr, 0, true, entryp->mUserData); delete entryp; } mLoadedCallbackList.clear(); @@ -2706,7 +2706,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() mLastCallBackActiveTime = sCurrentTime; bool final = gl_discard <= entryp->mDesiredDiscard; entryp->mLastUsedDiscard = gl_discard; - entryp->mCallback(true, this, NULL, NULL, gl_discard, final, entryp->mUserData); + entryp->mCallback(true, this, nullptr, nullptr, gl_discard, final, entryp->mUserData); if (final) { iter = mLoadedCallbackList.erase(curiter); @@ -2866,7 +2866,7 @@ void LLViewerFetchedTexture::forceToRefetchTexture(S32 desired_discard, F32 kept mDesiredSavedRawDiscardLevel = desired_discard ; mKeptSavedRawImageTime = kept_time ; mLastReferencedSavedRawImageTime = sCurrentTime ; - mSavedRawImage = NULL ; + mSavedRawImage = nullptr ; mSavedRawDiscardLevel = -1 ; } @@ -2927,7 +2927,7 @@ void LLViewerFetchedTexture::destroySavedRawImage() clearCallbackEntryList(); - mSavedRawImage = NULL ; + mSavedRawImage = nullptr ; mForceToSaveRawImage = false ; mSaveRawImage = false ; mSavedRawDiscardLevel = -1 ; @@ -2938,7 +2938,7 @@ void LLViewerFetchedTexture::destroySavedRawImage() if(mAuxRawImage.notNull()) { sAuxCount--; - mAuxRawImage = NULL; + mAuxRawImage = nullptr; } } @@ -3197,7 +3197,7 @@ LLViewerMediaTexture* LLViewerMediaTexture::findMediaTexture(const LLUUID& media media_map_t::iterator iter = sMediaMap.find(media_id); if(iter == sMediaMap.end()) { - return NULL; + return nullptr; } LLViewerMediaTexture* media_tex = iter->second; @@ -3209,7 +3209,7 @@ LLViewerMediaTexture* LLViewerMediaTexture::findMediaTexture(const LLUUID& media LLViewerMediaTexture::LLViewerMediaTexture(const LLUUID& id, bool usemipmaps, LLImageGL* gl_image) : LLViewerTexture(id, usemipmaps), - mMediaImplp(NULL), + mMediaImplp(nullptr), mUpdateVirtualSizeTime(0) { sMediaMap.insert(std::make_pair(id, this)); @@ -3244,7 +3244,7 @@ LLViewerMediaTexture::~LLViewerMediaTexture() LLViewerTexture* tex = gTextureList.findImage(mID, TEX_LIST_STANDARD); if(tex) //this media is a parcel media for tex. { - tex->setParcelMedia(NULL); + tex->setParcelMedia(nullptr); } } @@ -3276,7 +3276,7 @@ S8 LLViewerMediaTexture::getType() const void LLViewerMediaTexture::invalidateMediaImpl() { - mMediaImplp = NULL; + mMediaImplp = nullptr; } void LLViewerMediaTexture::setMediaImpl() @@ -3497,7 +3497,7 @@ void LLViewerMediaTexture::removeFace(U32 ch, LLFace* facep) { if(te_list[i] && te_list[i]->getID() == (*iter)->getID())//the texture is in use. { - te_list[i] = NULL; + te_list[i] = nullptr; break; } } @@ -3560,7 +3560,7 @@ void LLViewerMediaTexture::switchTexture(U32 ch, LLFace* facep) const LLTextureEntry* te = facep->getTextureEntry(); if(te) { - LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_STANDARD) : NULL; + LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_STANDARD) : nullptr; if(!tex && te->getID() != mID)//try parcel media. { tex = gTextureList.findImage(mID, TEX_LIST_STANDARD); @@ -3714,7 +3714,7 @@ LLTexturePipelineTester::LLTexturePipelineTester() : LLMetricPerformanceTesterWi LLTexturePipelineTester::~LLTexturePipelineTester() { - LLViewerTextureManager::sTesterp = NULL; + LLViewerTextureManager::sTesterp = nullptr; } void LLTexturePipelineTester::update() @@ -3944,7 +3944,7 @@ LLMetricPerformanceTesterWithSession::LLTestSession* LLTexturePipelineTester::lo LLTexturePipelineTester::LLTextureTestSession* sessionp = new LLTexturePipelineTester::LLTextureTestSession(); if(!sessionp) { - return NULL; + return nullptr; } F32 total_gray_time = 0.f; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 2937651995..7de557f7ea 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -168,7 +168,7 @@ class LLViewerTexture : public LLGLTexture 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() ; @@ -558,7 +558,7 @@ class LLViewerMediaTexture : public LLViewerTexture /*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; void reinit(bool usemipmaps = true); @@ -626,7 +626,7 @@ class LLViewerTextureManager //texture pipeline tester static LLTexturePipelineTester* sTesterp ; - //returns NULL if tex is not a LLViewerFetchedTexture nor derived from LLViewerFetchedTexture. + //returns nullptr if tex is not a LLViewerFetchedTexture nor derived from LLViewerFetchedTexture. static LLViewerFetchedTexture* staticCastToFetchedTexture(LLTexture* tex, bool report_error = false) ; // @@ -637,12 +637,12 @@ class LLViewerTextureManager 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 getLocalTexture(bool usemipmaps = true, bool generate_gl_tex = true); static LLPointer getLocalTexture(const LLUUID& id, bool usemipmaps, bool generate_gl_tex = true) ; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 11ca3098fd..68e441a844 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -65,7 +65,7 @@ //////////////////////////////////////////////////////////////////////////// -void (*LLViewerTextureList::sUUIDCallback)(void **, const LLUUID&) = NULL; +void (*LLViewerTextureList::sUUIDCallback)(void **, const LLUUID&) = nullptr; S32 LLViewerTextureList::sNumImages = 0; @@ -410,7 +410,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromFile(const std::string& LL_PROFILE_ZONE_TEXT(filename.c_str(), filename.size()); if(!mInitialized) { - return NULL ; + return nullptr ; } std::string full_path = gDirUtilp->findSkinnedFilename("textures", filename); @@ -438,7 +438,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string& LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; if(!mInitialized) { - return NULL ; + return nullptr ; } // generate UUID based on hash of filename @@ -561,7 +561,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImage(const LLUUID &image_id, LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; if(!mInitialized) { - return NULL ; + return nullptr ; } // Return the image with ID image_id @@ -684,7 +684,7 @@ LLViewerFetchedTexture *LLViewerTextureList::findImage(const LLTextureKey &searc LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; uuid_map_t::iterator iter = mUUIDMap.find(search_key); if (iter == mUUIDMap.end()) - return NULL; + return nullptr; return iter->second; } @@ -1341,7 +1341,7 @@ void LLViewerTextureList::decodeAllImages(F32 max_time) LLViewerFetchedTexture* imagep = *iter++; imagep->updateFetch(); } - std::shared_ptr main_queue = LLImageGLThread::sEnabledTextures ? LL::WorkQueue::getInstance("mainloop") : NULL; + std::shared_ptr main_queue = LLImageGLThread::sEnabledTextures ? LL::WorkQueue::getInstance("mainloop") : nullptr; // Run threads size_t fetch_pending = 0; while (1) @@ -1548,7 +1548,7 @@ LLPointer LLViewerTextureList::convertToUploadFile(LLPointersetAddressMode(LLTexUnit::TAM_CLAMP); @@ -1687,7 +1687,7 @@ LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const st datap->mImageScaleRegion = scale_rect; datap->mImageClipRegion = clip_rect; - imagep->setLoadedCallback(onUIImageLoaded, 0, false, false, datap, NULL); + imagep->setLoadedCallback(onUIImageLoaded, 0, false, false, datap, nullptr); } return new_imagep; } @@ -1826,7 +1826,7 @@ bool LLUIImageList::initFromFile() // The first (most generic) file gets special validations LLXMLNodePtr root; - if (!LLXMLNode::parseFile(*pi, root, NULL)) + if (!LLXMLNode::parseFile(*pi, root, nullptr)) { LL_WARNS() << "Unable to parse UI image list file " << *pi << LL_ENDL; return false; @@ -1845,7 +1845,7 @@ bool LLUIImageList::initFromFile() while (++pi != pend) { LLXMLNodePtr update_root; - if (LLXMLNode::parseFile(*pi, update_root, NULL)) + if (LLXMLNode::parseFile(*pi, update_root, nullptr)) { parser.readXUI(update_root, images, *pi); } diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index 583fb25330..eb627fa399 100644 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -128,7 +128,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); } } @@ -427,7 +427,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 (src->getLocalTextureObject(te)->getImage()); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 0980c4a291..07c14859c4 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -223,15 +223,15 @@ extern bool gResizeScreenTexture; extern bool gCubeSnapshot; extern bool gSnapshotNoPost; -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; @@ -895,7 +895,7 @@ class LLDebugText static LLCachedControl debug_show_texture_info(gSavedSettings, "DebugShowTextureInfo", false); if (debug_show_texture_info()) { - LLViewerObject* objectp = NULL ; + LLViewerObject* objectp = nullptr ; LLSelectNode* nodep = LLSelectMgr::instance().getHoverNode(); if (nodep) @@ -1248,7 +1248,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi { if (drop) { - LLURLDispatcher::dispatch( dropped_slurl.getSLURLString(), LLCommandHandler::NAV_TYPE_CLICKED, NULL, true ); + LLURLDispatcher::dispatch( dropped_slurl.getSLURLString(), LLCommandHandler::NAV_TYPE_CLICKED, nullptr, true ); return LLWindowCallbacks::DND_MOVE; } return LLWindowCallbacks::DND_COPY; @@ -1327,13 +1327,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.get()) { @@ -1361,7 +1361,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi result == LLWindowCallbacks::DND_NONE && !mDragHoveredObject.isNull()) { LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); - mDragHoveredObject = NULL; + mDragHoveredObject = nullptr; } } @@ -1461,7 +1461,7 @@ void LLViewerWindow::handleMouseDragged(LLWindow *window, LLCoordGL pos, MASK m void LLViewerWindow::handleMouseLeave(LLWindow *window) { // Note: we won't get this if we have captured the mouse. - llassert( gFocusMgr.getMouseCapture() == NULL ); + llassert( gFocusMgr.getMouseCapture() == nullptr ); mMouseInWindow = false; LLToolTipMgr::instance().blockToolTips(); } @@ -1548,7 +1548,7 @@ void LLViewerWindow::handleFocusLost(LLWindow *window) gFocusMgr.setAppHasFocus(false); //LLModalDialog::onAppFocusLost(); LLToolMgr::getInstance()->onAppFocusLost(); - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture( nullptr ); if (gMenuBarView) { @@ -1753,7 +1753,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, LLCommandHandler::NAV_TYPE_EXTERNAL, web, trusted_browser)) @@ -1859,7 +1859,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), @@ -1872,14 +1872,14 @@ LLViewerWindow::LLViewerWindow(const Params& p) mAllowMouseDragging(true), mMouseDownTimer(), mLastMask( MASK_NONE ), - mToolStored( NULL ), + mToolStored( nullptr ), mHideCursorPermanent( false ), mCursorHidden(false), mResDirty(false), mStatesDirty(false), - mProgressView(NULL) + mProgressView(nullptr) { - // gKeyboard is still NULL, so it doesn't do LLWindowListener any good to + // gKeyboard is still nullptr, so it doesn't do LLWindowListener any good to // pass its value right now. Instead, pass it a nullary function that // will, when we later need it, return the value of gKeyboard. // boost::lambda::var() constructs such a functor on the fly. @@ -1925,7 +1925,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) max_core_count, max_gl_version); //don't use window level anti-aliasing, windows only - if (NULL == mWindow) + if (nullptr == mWindow) { LLSplashScreen::update(LLTrans::getString("StartupRequireDriverUpdate")); @@ -2285,7 +2285,7 @@ void LLViewerWindow::initWorldUI() topinfo_bar->setVisible(false); } - if ( gHUDView == NULL ) + if ( gHUDView == nullptr ) { LLRect hud_rect = full_window; hud_rect.mBottom += 50; @@ -2346,16 +2346,16 @@ void LLViewerWindow::shutdownViews() LL_INFOS() << "Warning logger is cleaned." << LL_ENDL ; gFocusMgr.unlockFocus(); - gFocusMgr.setMouseCapture(NULL); - gFocusMgr.setKeyboardFocus(NULL); - gFocusMgr.setTopCtrl(NULL); + gFocusMgr.setMouseCapture(nullptr); + gFocusMgr.setKeyboardFocus(nullptr); + gFocusMgr.setTopCtrl(nullptr); if (mWindow) { - mWindow->allowLanguageTextInput(NULL, false); + mWindow->allowLanguageTextInput(nullptr, false); } delete mDebugText; - mDebugText = NULL; + mDebugText = nullptr; LL_INFOS() << "DebugText deleted." << LL_ENDL ; @@ -2388,26 +2388,26 @@ void LLViewerWindow::shutdownViews() LL_INFOS() << "view listeners destroyed." << LL_ENDL ; // Clean up pointers that are going to be invalid. (todo: check sMenuContainer) - mProgressView = NULL; - mPopupView = NULL; + mProgressView = nullptr; + mPopupView = nullptr; // 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() @@ -2464,7 +2464,7 @@ LLViewerWindow::~LLViewerWindow() destroyWindow(); delete mDebugText; - mDebugText = NULL; + mDebugText = nullptr; if (LLViewerShaderMgr::sInitialized) { @@ -2853,7 +2853,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); } } @@ -3017,7 +3017,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(); @@ -3132,8 +3132,8 @@ bool LLViewerWindow::handleKey(KEY key, MASK mask) LLChatEntry* chat_editor = LLFloaterReg::findTypedInstance("nearby_chat")->getChatBox(); if (chat_editor) { - // passing NULL here, character will be added later when it is handled by character handler. - nearby_chat->startChat(NULL); + // passing nullptr here, character will be added later when it is handled by character handler. + nearby_chat->startChat(nullptr); return true; } } @@ -3442,7 +3442,7 @@ void LLViewerWindow::updateUI() if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST)) { gDebugRaycastFaceHit = gDebugRaycastGLTFNodeHit = gDebugRaycastGLTFPrimitiveHit = -1; - gDebugRaycastObject = cursorIntersect(-1, -1, 512.f, NULL, -1, false, false, true, false, + gDebugRaycastObject = cursorIntersect(-1, -1, 512.f, nullptr, -1, false, false, true, false, &gDebugRaycastFaceHit, &gDebugRaycastGLTFNodeHit, &gDebugRaycastGLTFPrimitiveHit, @@ -3453,7 +3453,7 @@ void LLViewerWindow::updateUI() &gDebugRaycastStart, &gDebugRaycastEnd); - gDebugRaycastParticle = gPipeline.lineSegmentIntersectParticle(gDebugRaycastStart, gDebugRaycastEnd, &gDebugRaycastParticleIntersection, NULL); + gDebugRaycastParticle = gPipeline.lineSegmentIntersectParticle(gDebugRaycastStart, gDebugRaycastEnd, &gDebugRaycastParticleIntersection, nullptr); } updateMouseDelta(); @@ -3856,8 +3856,8 @@ void LLViewerWindow::updateUI() void LLViewerWindow::updateLayout() { LLTool* tool = LLToolMgr::getInstance()->getCurrentTool(); - if (gFloaterTools != NULL - && tool != NULL + if (gFloaterTools != nullptr + && tool != nullptr && tool != gToolNull && tool != LLToolCompInspect::getInstance() && tool != LLToolDragAndDrop::getInstance() @@ -3878,7 +3878,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(captor) != NULL))) // not dragging + && (!captor || dynamic_cast(captor) != nullptr))) // not dragging { // Force floater tools to be visible (unless minimized) if (!gFloaterTools->getVisible()) @@ -3960,7 +3960,7 @@ void LLViewerWindow::updateKeyboardFocus() { if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { - gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setKeyboardFocus(nullptr); } // clean up current focus @@ -4021,7 +4021,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(); } @@ -4410,7 +4410,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, pick_reflection_probe, true, false, NULL); + mLastPick = LLPickInfo(LLCoordGL(x, y_from_bot), key_mask, pick_transparent, pick_rigged, pick_particle, pick_reflection_probe, true, false, nullptr); mLastPick.fetchResults(); return mLastPick; @@ -4515,7 +4515,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 { @@ -5021,7 +5021,7 @@ bool LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei //check if there is enough memory for the snapshot image 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. @@ -5605,7 +5605,7 @@ void LLViewerWindow::destroyWindow() { LLWindowManager::destroyWindow(mWindow); } - mWindow = NULL; + mWindow = nullptr; } @@ -6153,7 +6153,7 @@ LLPickInfo::LLPickInfo(const LLCoordGL& mouse_pos, mNormal(), mTangent(), mBinormal(), - mHUDIcon(NULL), + mHUDIcon(nullptr), mPickTransparent(pick_transparent), mPickRigged(pick_rigged), mPickParticle(pick_particle), @@ -6275,7 +6275,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 9a0bb28f1d..fe46fe28c8 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -423,21 +423,21 @@ class LLViewerWindow : public LLWindowCallbacks 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, bool pick_unselectable = true, bool pick_reflection_probe = true, - S32* face_hit = NULL, + S32* face_hit = nullptr, S32* gltf_node_hit = nullptr, S32* gltf_primitive_hit = nullptr, - LLVector4a *intersection = NULL, - LLVector2 *uv = NULL, - LLVector4a *normal = NULL, - LLVector4a *tangent = NULL, - LLVector4a* start = NULL, - LLVector4a* end = NULL); + 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 3441e25c6a..cfa674ebdc 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -582,9 +582,9 @@ void LLVLComposition::setDetailAssetID(S32 asset, const LLUUID& id) return; } LLTerrainMaterials::setDetailAssetID(asset, id); - mRawImages[asset] = NULL; - mRawImagesBaseColor[asset] = NULL; - mRawImagesEmissive[asset] = NULL; + mRawImages[asset] = nullptr; + mRawImagesBaseColor[asset] = nullptr; + mRawImagesEmissive[asset] = nullptr; } void LLVLComposition::setStartHeight(S32 corner, const F32 start_height) diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp index c2bcd32921..55ca5952d7 100644 --- a/indra/newview/llvlmanager.cpp +++ b/indra/newview/llvlmanager.cpp @@ -163,6 +163,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 14de3461c9..3e804b57ae 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -378,7 +378,7 @@ class LLBreatheMotionRot : LLBreatheMotionRot(const LLUUID &id) : LLMotion(id), mBreatheRate(1.f), - mCharacter(NULL) + mCharacter(nullptr) { mName = "breathe_rot"; mChestState = new LLJointState; @@ -490,7 +490,7 @@ class LLPelvisFixMotion : public: // Constructor LLPelvisFixMotion(const LLUUID &id) - : LLMotion(id), mCharacter(NULL) + : LLMotion(id), mCharacter(nullptr) { mName = "pelvis_fix"; @@ -620,7 +620,7 @@ F32 LLVOAvatar::sUnbakedTime = 0.f; F32 LLVOAvatar::sUnbakedUpdateTime = 0.f; F32 LLVOAvatar::sGreyTime = 0.f; F32 LLVOAvatar::sGreyUpdateTime = 0.f; -LLPointer LLVOAvatar::sCloudTexture = NULL; +LLPointer LLVOAvatar::sCloudTexture = nullptr; std::vector LLVOAvatar::sAVsIgnoringARTLimit; S32 LLVOAvatar::sAvatarsNearby = 0; @@ -709,11 +709,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 @@ -750,8 +750,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mStepMaterial = 0; mLipSyncActive = false; - mOohMorph = NULL; - mAahMorph = NULL; + mOohMorph = nullptr; + mAahMorph = nullptr; mCurrentGesticulationLevel = 0; @@ -855,7 +855,7 @@ void LLVOAvatar::markDead() if (mNameText) { mNameText->markDead(); - mNameText = NULL; + mNameText = nullptr; sNumVisibleChatBubbles--; } mVoiceVisualizer->markDead(); @@ -1523,7 +1523,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++) { LLJoint *joint = getJoint(joint_num); - LLJointRiggingInfo *rig_info = NULL; + LLJointRiggingInfo *rig_info = nullptr; if (joint_num < mJointRiggingInfoTab.size()) { rig_info = &mJointRiggingInfoTab[joint_num]; @@ -1746,7 +1746,7 @@ void LLVOAvatar::renderBones(const std::string &selected_joint) for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++) { LLJoint* joint = getJoint(joint_num); - LLJointRiggingInfo* rig_info = NULL; + LLJointRiggingInfo* rig_info = nullptr; if (joint_num < mJointRiggingInfoTab.size()) { rig_info = &mJointRiggingInfoTab[joint_num]; @@ -2031,10 +2031,10 @@ LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector { if (isSelf() && !gAgent.needsRenderAvatar()) { - return NULL; + return nullptr; } - LLViewerObject* hit = NULL; + LLViewerObject* hit = nullptr; if (lineSegmentBoundingBox(start, end)) { @@ -2204,7 +2204,7 @@ void LLVOAvatar::applyDefaultParams() std::map female_params = { {1,33}, {2,61}, {4,85}, {5,23}, {6,58}, {7,127}, {8,63}, {10,85}, {11,63}, {12,42}, {13,0}, {14,85}, {15,63}, {16,36}, {17,85}, {18,95}, {19,153}, {20,63}, {21,34}, {22,0}, {23,63}, {24,109}, {25,88}, {27,132}, {31,63}, {33,136}, {34,81}, {35,85}, {36,103}, {37,136}, {38,127}, {80,0}, {93,203}, {98,0}, {99,0}, {105,127}, {108,0}, {110,0}, {111,127}, {112,0}, {113,0}, {114,127}, {115,0}, {116,0}, {117,0}, {119,127}, {130,114}, {131,127}, {132,99}, {133,63}, {134,127}, {135,140}, {136,127}, {137,127}, {140,0}, {141,0}, {142,0}, {143,191}, {150,0}, {155,104}, {157,0}, {162,0}, {163,0}, {165,0}, {166,0}, {167,0}, {168,0}, {169,0}, {177,0}, {181,145}, {182,216}, {183,133}, {184,0}, {185,127}, {192,0}, {193,127}, {196,170}, {198,0}, {503,0}, {505,127}, {506,127}, {507,109}, {508,85}, {513,127}, {514,127}, {515,63}, {517,85}, {518,42}, {603,100}, {604,216}, {605,214}, {606,204}, {607,204}, {608,204}, {609,51}, {616,25}, {617,89}, {619,76}, {624,204}, {625,0}, {629,127}, {637,0}, {638,0}, {646,144}, {647,85}, {649,127}, {650,132}, {652,127}, {653,85}, {654,0}, {656,127}, {659,127}, {662,127}, {663,127}, {664,127}, {665,127}, {674,59}, {675,127}, {676,85}, {678,127}, {682,127}, {683,106}, {684,47}, {685,79}, {690,127}, {692,127}, {693,204}, {700,63}, {701,0}, {702,0}, {703,0}, {704,0}, {705,127}, {706,127}, {707,0}, {708,0}, {709,0}, {710,0}, {711,127}, {712,0}, {713,159}, {714,0}, {715,0}, {750,178}, {752,127}, {753,36}, {754,85}, {755,131}, {756,127}, {757,127}, {758,127}, {759,153}, {760,95}, {762,0}, {763,140}, {764,74}, {765,27}, {769,127}, {773,127}, {775,0}, {779,214}, {780,204}, {781,198}, {785,0}, {789,0}, {795,63}, {796,30}, {799,127}, {800,226}, {801,255}, {802,198}, {803,255}, {804,255}, {805,255}, {806,255}, {807,255}, {808,255}, {812,255}, {813,255}, {814,255}, {815,204}, {816,0}, {817,255}, {818,255}, {819,255}, {820,255}, {821,255}, {822,255}, {823,255}, {824,255}, {825,255}, {826,255}, {827,255}, {828,0}, {829,255}, {830,255}, {834,255}, {835,255}, {836,255}, {840,0}, {841,127}, {842,127}, {844,255}, {848,25}, {858,100}, {859,255}, {860,255}, {861,255}, {862,255}, {863,84}, {868,0}, {869,0}, {877,0}, {879,51}, {880,132}, {921,255}, {922,255}, {923,255}, {10000,0}, {10001,0}, {10002,25}, {10003,0}, {10004,25}, {10005,23}, {10006,51}, {10007,0}, {10008,25}, {10009,23}, {10010,51}, {10011,0}, {10012,0}, {10013,25}, {10014,0}, {10015,25}, {10016,23}, {10017,51}, {10018,0}, {10019,0}, {10020,25}, {10021,0}, {10022,25}, {10023,23}, {10024,51}, {10025,0}, {10026,25}, {10027,23}, {10028,51}, {10029,0}, {10030,25}, {10031,23}, {10032,51}, {11000,1}, {11001,127} }; - std::map *params = NULL; + std::map *params = nullptr; if (getSex() == SEX_MALE) params = &male_params; else @@ -2455,7 +2455,7 @@ void LLVOAvatar::updateMeshData() part_index-- ; } - LLFace* facep = NULL; + LLFace* facep = nullptr; if(f_num < mDrawable->getNumFaces()) { facep = mDrawable->getFace(f_num); @@ -2597,7 +2597,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 || @@ -2613,7 +2613,7 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU if (url.empty()) { LL_WARNS() << "unable to determine URL for te " << te << " uuid " << uuid << LL_ENDL; - return NULL; + return nullptr; } LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << LL_ENDL; result = LLViewerTextureManager::getFetchedTextureFromUrl( @@ -2695,7 +2695,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) { mNameIsSet = false; mNameText->markDead(); - mNameText = NULL; + mNameText = nullptr; sNumVisibleChatBubbles--; } deleteParticleSource(); @@ -3394,7 +3394,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) { // ...clean up old name tag mNameText->markDead(); - mNameText = NULL; + mNameText = nullptr; sNumVisibleChatBubbles--; } return; @@ -3440,7 +3440,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) if (mNameText) { mNameText->markDead(); - mNameText = NULL; + mNameText = nullptr; sNumVisibleChatBubbles--; } return; @@ -4030,7 +4030,7 @@ void LLVOAvatar::updateAppearanceMessageDebugText() LLViewerInventoryItem* getObjectInventoryItem(LLViewerObject *vobj, LLUUID asset_id) { - LLViewerInventoryItem *item = NULL; + LLViewerInventoryItem *item = nullptr; if (vobj) { @@ -4115,7 +4115,7 @@ void LLVOAvatar::updateAnimationDebugText() } else { - LLViewerInventoryItem* item = NULL; + LLViewerInventoryItem* item = nullptr; if (!object->isInventoryDirty()) { item = object->getInventoryItemByAsset(motionp->getID()); @@ -4184,7 +4184,7 @@ void LLVOAvatar::updateDebugText() if (!mDebugText.size() && mText.notNull()) { mText->markDead(); - mText = NULL; + mText = nullptr; } else if (mDebugText.size()) { @@ -5569,7 +5569,7 @@ void LLVOAvatar::collectLocalTextureUUIDs(std::set& ids) const LLWearableType::EType wearable_type = LLAvatarAppearance::getDictionary()->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); @@ -5592,7 +5592,7 @@ void LLVOAvatar::collectBakedTextureUUIDs(std::set& 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); @@ -5726,7 +5726,7 @@ void LLVOAvatar::updateTextures() LL_WARNS() << "getTE( " << texture_index << " ) returned 0" <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; @@ -6373,7 +6373,7 @@ LLJoint* LLVOAvatar::getJoint(std::string_view name) LLJoint *LLVOAvatar::getJoint( S32 joint_num ) { - LLJoint *pJoint = NULL; + LLJoint *pJoint = nullptr; if (joint_num >= 0) { if (joint_num < mNumBones) @@ -7116,7 +7116,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()) { @@ -7189,7 +7189,7 @@ void LLVOAvatar::updateVisualParams() ESex avatar_sex = (getVisualParamWeight("male") > 0.5f) ? SEX_MALE : SEX_FEMALE; if (getSex() != avatar_sex) { - if (mIsSitting && findMotion(avatar_sex == SEX_MALE ? ANIM_AGENT_SIT_FEMALE : ANIM_AGENT_SIT) != NULL) + if (mIsSitting && findMotion(avatar_sex == SEX_MALE ? ANIM_AGENT_SIT_FEMALE : ANIM_AGENT_SIT) != nullptr) { // In some cases of gender change server changes sit motion with motion message, // but in case of some avatars (legacy?) there is no update from server side, @@ -7335,7 +7335,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(mIsControlAvatar ? LLPipeline::RENDER_TYPE_CONTROL_AV : LLPipeline::RENDER_TYPE_AVATAR); mNumInitFaces = mDrawable->getNumFaces() ; @@ -7373,7 +7373,7 @@ bool LLVOAvatar::updateGeometry(LLDrawable *drawable) if (!drawable) { - LL_ERRS() << "LLVOAvatar::updateGeometry() called with NULL drawable" << LL_ENDL; + LL_ERRS() << "LLVOAvatar::updateGeometry() called with nullptr drawable" << LL_ENDL; } return true; @@ -7428,7 +7428,7 @@ void LLVOAvatar::hideSkirt() bool LLVOAvatar::setParent(LLViewerObject* parent) { bool ret ; - if (parent == NULL) + if (parent == nullptr) { getOffObject(); ret = LLViewerObject::setParent(parent); @@ -7499,7 +7499,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) { @@ -7507,7 +7507,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 @@ -8026,7 +8026,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); @@ -8071,7 +8071,7 @@ LLVOAvatar* LLVOAvatar::findAvatarFromAttachment( LLViewerObject* obj ) return (LLVOAvatar*)obj; } } - return NULL; + return nullptr; } S32 LLVOAvatar::getAttachmentCount() const @@ -8149,7 +8149,7 @@ LLViewerObject * LLVOAvatar::findAttachmentByID( const LLUUID & target_id ) c } } - return NULL; + return nullptr; } // virtual @@ -8875,7 +8875,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()) { @@ -8894,7 +8894,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) { @@ -9327,7 +9327,7 @@ LLBBox LLVOAvatar::getHUDBBox() const ++attachment_iter) { const LLViewerObject* attached_object = attachment_iter->get(); - if (attached_object == NULL) + if (attached_object == nullptr) { LL_WARNS() << "HUD attached object is NULL!" << LL_ENDL; continue; @@ -9361,7 +9361,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()) { @@ -9944,12 +9944,12 @@ LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te) { if (te < 0 || te >= BAKED_NUM_INDICES) { - return NULL; + return nullptr; } bool is_layer_baked = isTextureDefined(mBakedTextureDatas[te].mTextureIndex); - LLViewerTexLayerSet* layerset = NULL; + LLViewerTexLayerSet* layerset = nullptr; layerset = getTexLayerSet(te); @@ -9966,7 +9966,7 @@ LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te) return layerset->getViewerComposite(); } - return NULL; + return nullptr; } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 7ccf46d643..c69bd97e46 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -166,22 +166,22 @@ class LLVOAvatar : bool pick_transparent = false, bool pick_rigged = false, bool pick_unselectable = true, - 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 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, bool pick_unselectable = true, - 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 @@ -211,7 +211,7 @@ class LLVOAvatar : inline size_t getSkeletonJointCount() const { return mSkeleton.size(); } void notifyAttachmentMeshLoaded(); - void addAttachmentOverridesForObject(LLViewerObject *vo, std::set* meshes_seen = NULL, bool recursive = true); + void addAttachmentOverridesForObject(LLViewerObject *vo, std::set* meshes_seen = nullptr, bool recursive = true); void removeAttachmentOverridesForObject(const LLUUID& mesh_id); void removeAttachmentOverridesForObject(LLViewerObject *vo); bool jointIsRiggedTo(const LLJoint *joint) const; @@ -259,8 +259,8 @@ class LLVOAvatar : virtual bool isBuddy() const; // If this is an attachment, return the avatar it is attached to. Otherwise NULL. - virtual const LLVOAvatar *getAttachedAvatar() const { return NULL; } - virtual LLVOAvatar *getAttachedAvatar() { return NULL; } + virtual const LLVOAvatar *getAttachedAvatar() const { return nullptr; } + virtual LLVOAvatar *getAttachedAvatar() { return nullptr; } private: //aligned members diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index e5c14a34a5..370e71d387 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -64,7 +64,7 @@ #include -LLPointer gAgentAvatarp = NULL; +LLPointer gAgentAvatarp = nullptr; bool isAgentAvatarValid() { @@ -111,9 +111,9 @@ struct LocalTextureData LocalTextureData() : mIsBakedReady(false), mDiscard(MAX_DISCARD_LEVEL+1), - mImage(NULL), + mImage(nullptr), mWearableID(IMG_DEFAULT_AVATAR), - mTexEntry(NULL) + mTexEntry(nullptr) {} LLPointer mImage; bool mIsBakedReady; @@ -151,7 +151,7 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp) : LLVOAvatar(id, pcode, regionp), - mScreenp(NULL), + mScreenp(nullptr), mLastRegionHandle(0), mRegionCrossingCount(0), // Value outside legal range, so will always be a mismatch the @@ -286,7 +286,7 @@ bool LLVOAvatarSelf::checkStuckAppearance() // virtual void LLVOAvatarSelf::markDead() { - mBeam = NULL; + mBeam = nullptr; LLVOAvatar::markDead(); } @@ -328,7 +328,7 @@ bool LLVOAvatarSelf::loadAvatarSelf() bool LLVOAvatarSelf::buildSkeletonSelf(const LLAvatarSkeletonInfo *info) { // add special-purpose "screen" joint - mScreenp = new LLViewerJoint("mScreen", NULL); + mScreenp = new LLViewerJoint("mScreen", nullptr); // for now, put screen at origin, as it is only used during special // HUD rendering mode F32 aspect = LLViewerCamera::getInstance()->getAspect(); @@ -346,7 +346,7 @@ bool LLVOAvatarSelf::buildMenus() //------------------------------------------------------------------------- // build the attach and detach menus //------------------------------------------------------------------------- - gAttachBodyPartPieMenus[0] = NULL; + gAttachBodyPartPieMenus[0] = nullptr; LLContextMenu::Params params; params.label(LLTrans::getString("BodyPartsRightArm")); @@ -362,7 +362,7 @@ bool LLVOAvatarSelf::buildMenus() params.name(params.label); gAttachBodyPartPieMenus[3] = LLUICtrlFactory::create (params); - gAttachBodyPartPieMenus[4] = NULL; + gAttachBodyPartPieMenus[4] = nullptr; params.label(LLTrans::getString("BodyPartsLeftLeg")); params.name(params.label); @@ -380,7 +380,7 @@ bool LLVOAvatarSelf::buildMenus() params.name(params.label); gAttachBodyPartPieMenus[8] = LLUICtrlFactory::create(params); - gDetachBodyPartPieMenus[0] = NULL; + gDetachBodyPartPieMenus[0] = nullptr; params.label(LLTrans::getString("BodyPartsRightArm")); params.name(params.label); @@ -394,7 +394,7 @@ bool LLVOAvatarSelf::buildMenus() params.name(params.label); gDetachBodyPartPieMenus[3] = LLUICtrlFactory::create (params); - gDetachBodyPartPieMenus[4] = NULL; + gDetachBodyPartPieMenus[4] = nullptr; params.label(LLTrans::getString("BodyPartsLeftLeg")); params.name(params.label); @@ -619,7 +619,7 @@ bool LLVOAvatarSelf::buildMenus() { S32 attach_index = attach_it->second; - LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attach_index, (LLViewerJointAttachment*)NULL); + LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attach_index, (LLViewerJointAttachment*)nullptr); if (attachment) { LLMenuItemCallGL::Params item_params; @@ -649,8 +649,8 @@ void LLVOAvatarSelf::cleanup() { markDead(); delete mScreenp; - mScreenp = NULL; - mRegionp = NULL; + mScreenp = nullptr; + mRegionp = nullptr; } LLVOAvatarSelf::~LLVOAvatarSelf() @@ -683,7 +683,7 @@ bool LLVOAvatarSelf::updateCharacter(LLAgent &agent) // virtual bool LLVOAvatarSelf::isValid() const { - return ((getRegion() != NULL) && !isDead()); + return ((getRegion() != nullptr) && !isDead()); } // virtual @@ -972,7 +972,7 @@ void LLVOAvatarSelf::idleUpdateTractorBeam() // This is only done for yourself (maybe it should be in the agent?) if (!needsRenderBeam() || !isBuilt()) { - mBeam = NULL; + mBeam = nullptr; } else if (!mBeam || mBeam->isDead()) { @@ -1001,7 +1001,7 @@ void LLVOAvatarSelf::idleUpdateTractorBeam() } else { - mBeam->setTargetObject(NULL); + mBeam->setTargetObject(nullptr); LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); if (tool->isEditing()) { @@ -1154,7 +1154,7 @@ LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id) return attached_object; } } - return NULL; + return nullptr; } bool LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const @@ -1325,8 +1325,8 @@ void LLVOAvatarSelf::localTextureLoaded(bool success, LLViewerFetchedTexture *sr LLLocalTextureObject *local_tex_obj = getLocalTextureObject(index, 0); - // fix for EXT-268. Preventing using of NULL pointer - if(NULL == local_tex_obj) + // fix for EXT-268. Preventing using of nullptr pointer + if(nullptr == local_tex_obj) { LL_WARNS("TAG") << "There is no Local Texture Object with index: " << index << ", final: " << final @@ -1336,7 +1336,7 @@ void LLVOAvatarSelf::localTextureLoaded(bool success, LLViewerFetchedTexture *sr if (success) { if (!local_tex_obj->getBakedReady() && - local_tex_obj->getImage() != NULL && + local_tex_obj->getImage() != nullptr && (local_tex_obj->getID() == src_id) && discard_level < local_tex_obj->getDiscard()) { @@ -1353,7 +1353,7 @@ void LLVOAvatarSelf::localTextureLoaded(bool success, LLViewerFetchedTexture *sr { // Failed: asset is missing if (!local_tex_obj->getBakedReady() && - local_tex_obj->getImage() != NULL && + local_tex_obj->getImage() != nullptr && local_tex_obj->getImage()->getID() == src_id) { local_tex_obj->setDiscard(0); @@ -1366,7 +1366,7 @@ void LLVOAvatarSelf::localTextureLoaded(bool success, LLViewerFetchedTexture *sr // virtual bool LLVOAvatarSelf::getLocalTextureGL(ETextureIndex type, LLViewerTexture** tex_pp, U32 index) const { - *tex_pp = NULL; + *tex_pp = nullptr; if (!isIndexLocalTexture(type)) return false; if (getLocalTextureID(type, index) == IMG_DEFAULT_AVATAR) return true; @@ -1384,13 +1384,13 @@ LLViewerFetchedTexture* LLVOAvatarSelf::getLocalTextureGL(LLAvatarAppearanceDefi { if (!isIndexLocalTexture(type)) { - return NULL; + return nullptr; } const LLLocalTextureObject *local_tex_obj = getLocalTextureObject(type, index); if (!local_tex_obj) { - return NULL; + return nullptr; } if (local_tex_obj->getID() == IMG_DEFAULT_AVATAR) { @@ -1404,7 +1404,7 @@ const LLUUID& LLVOAvatarSelf::getLocalTextureID(ETextureIndex type, U32 index) c if (!isIndexLocalTexture(type)) return IMG_DEFAULT_AVATAR; const LLLocalTextureObject *local_tex_obj = getLocalTextureObject(type, index); - if (local_tex_obj && local_tex_obj->getImage() != NULL) + if (local_tex_obj && local_tex_obj->getImage() != nullptr) { return local_tex_obj->getImage()->getID(); } @@ -1789,7 +1789,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te } else { - tex->setLoadedCallback(onLocalTextureLoaded, desired_discard, true, false, new LLAvatarTexData(getID(), type), NULL); + tex->setLoadedCallback(onLocalTextureLoaded, desired_discard, true, false, new LLAvatarTexData(getID(), type), nullptr); } } tex->setMinDiscardLevel(desired_discard); @@ -1844,7 +1844,7 @@ void LLVOAvatarSelf::dumpLocalTextures() const LL_INFOS() << "LocTex " << name << ": Baked " << getTEImage(baked_equiv)->getID() << LL_ENDL; #endif } - else if (local_tex_obj && local_tex_obj->getImage() != NULL) + else if (local_tex_obj && local_tex_obj->getImage() != nullptr) { if (local_tex_obj->getImage()->getID() == IMG_DEFAULT_AVATAR) { @@ -2515,7 +2515,7 @@ LLLocalTextureObject* LLVOAvatarSelf::getLocalTextureObject(LLAvatarAppearanceDe return wearable->getLocalTextureObject(i); } - return NULL; + return nullptr; } //----------------------------------------------------------------------------- @@ -2673,7 +2673,7 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; return getLayerSet(baked_index); } - return NULL; + return nullptr; } LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index) const @@ -2686,7 +2686,7 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index) { return getTexLayerSet(baked_index); } - return NULL; + return nullptr; } diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 5d456b1a19..2a4d580eab 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -182,7 +182,7 @@ LLVOCacheEntry::LLVOCacheEntry() mHitCount(0), mDupeCount(0), mCRCChangeCount(0), - mBuffer(NULL), + mBuffer(nullptr), mState(INACTIVE), mSceneContrib(0.f), mValid(true), @@ -194,7 +194,7 @@ LLVOCacheEntry::LLVOCacheEntry() LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) : LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY), - mBuffer(NULL), + mBuffer(nullptr), mUpdateFlags(-1), mState(INACTIVE), mSceneContrib(0.f), @@ -242,7 +242,7 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) // Improve logging around vocache LL_WARNS() << "Error loading cache entry for " << mLocalID << ", size " << size << " aborting!" << LL_ENDL; delete[] mBuffer ; - mBuffer = NULL ; + mBuffer = nullptr ; } } @@ -253,8 +253,8 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) mHitCount = 0; mDupeCount = 0; mCRCChangeCount = 0; - mBuffer = NULL; - mEntry = NULL; + mBuffer = nullptr; + mEntry = nullptr; mState = INACTIVE; } } @@ -359,9 +359,9 @@ void LLVOCacheEntry::setState(U32 state) void LLVOCacheEntry::addChild(LLVOCacheEntry* entry) { - llassert(entry != NULL); + llassert(entry != nullptr); llassert(entry->getParentID() == mLocalID); - llassert(entry->getEntry() != NULL); + llassert(entry->getEntry() != nullptr); if(!entry || !entry->getEntry() || entry->getParentID() != mLocalID) { @@ -371,7 +371,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(); @@ -392,7 +392,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()) { @@ -408,7 +408,7 @@ LLDataPackerBinaryBuffer *LLVOCacheEntry::getDP() if (mDP.getBufferSize() == 0) { //LL_INFOS() << "Not getting cache entry, invalid!" << LL_ENDL; - return NULL; + return nullptr; } return &mDP; @@ -774,7 +774,7 @@ bool LLVOCachePartition::addEntry(LLViewerOctreeEntry* entry) void LLVOCachePartition::removeEntry(LLViewerOctreeEntry* entry) { - entry->getVOCacheEntry()->setGroup(NULL); + entry->getVOCacheEntry()->setGroup(nullptr); llassert(!entry->getGroup()); } @@ -1403,7 +1403,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) @@ -1418,7 +1418,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) @@ -1429,7 +1429,7 @@ void LLVOCache::readCacheHeader() entry->mIndex = mNumEntries++ ; mHeaderEntryQueue.insert(entry) ; mHandleEntryMap[entry->mHandle] = entry ; - entry = NULL ; + entry = nullptr ; } if(entry) { @@ -1769,7 +1769,7 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry: entry = new HeaderEntryInfo(); entry->mHandle = handle ; - entry->mTime = (U32)time(NULL) ; + entry->mTime = (U32)time(nullptr) ; entry->mIndex = mNumEntries++; mHeaderEntryQueue.insert(entry) ; mHandleEntryMap[handle] = entry ; @@ -1782,7 +1782,7 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry: //resort mHeaderEntryQueue.erase(entry) ; - entry->mTime = (U32)time(NULL) ; + entry->mTime = (U32)time(nullptr) ; mHeaderEntryQueue.insert(entry) ; } diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 86d08b8658..c0bf3fcc73 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -69,7 +69,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(); @@ -439,7 +439,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); @@ -448,7 +448,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(); const LLVector4a* ext = mDrawable->getSpatialExtents(); @@ -871,18 +871,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 f34883fa59..ef2f35aac7 100644 --- a/indra/newview/llvograss.h +++ b/indra/newview/llvograss.h @@ -80,11 +80,11 @@ class LLVOGrass : public LLAlphaObject bool pick_transparent = false, bool pick_rigged = false, bool pick_unselectable = true, - 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 ); static S32 sMaxGrassSpecies; diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index b941d356a1..84f15f0b39 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -39,8 +39,8 @@ #include "llcorehttputil.h" LLVoiceChannel::voice_channel_map_t LLVoiceChannel::sVoiceChannelMap; -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; @@ -75,11 +75,11 @@ LLVoiceChannel::~LLVoiceChannel() { if (sSuspendedVoiceChannel == this) { - sSuspendedVoiceChannel = NULL; + sSuspendedVoiceChannel = nullptr; } if (sCurrentVoiceChannel == this) { - sCurrentVoiceChannel = NULL; + sCurrentVoiceChannel = nullptr; } LLVoiceClient::removeObserver(this); @@ -282,7 +282,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 { diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 507154a2a3..2a4ef642cb 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -140,9 +140,9 @@ LLVoiceModuleInterface *getVoiceModule(const std::string &voice_server_type) LLVoiceClient::LLVoiceClient(LLPumpIO *pump) : - mSpatialVoiceModule(NULL), - mNonSpatialVoiceModule(NULL), - m_servicePump(NULL), + mSpatialVoiceModule(nullptr), + mNonSpatialVoiceModule(nullptr), + m_servicePump(nullptr), mVoiceEffectEnabled(LLCachedControl(gSavedSettings, "VoiceMorphingEnabled", true)), mVoiceEffectDefault(LLCachedControl(gSavedPerAccountSettings, "VoiceEffectDefault", "00000000-0000-0000-0000-000000000000")), mVoiceEffectSupportNotified(false), @@ -313,8 +313,8 @@ void LLVoiceClient::terminate() { LLVivoxVoiceClient::getInstance()->terminate(); } - mSpatialVoiceModule = NULL; - m_servicePump = NULL; + mSpatialVoiceModule = nullptr; + m_servicePump = nullptr; // Shutdown speaker volume storage before LLSingletonBase::deleteAll() does it if (LLSpeakerVolumeStorage::instanceExists()) @@ -1007,7 +1007,7 @@ LLSD LLVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const LLVoiceEffectInterface* LLVoiceClient::getVoiceEffectInterface() const { - return NULL; + return nullptr; } /////////////////// @@ -1027,7 +1027,7 @@ class LLViewerRequiredVoiceVersion : public LLHTTPNode voice_server_type = input["body"]["voice_server_type"].asString(); } - LLVoiceModuleInterface *voiceModule = NULL; + LLVoiceModuleInterface *voiceModule = nullptr; if (voice_server_type == "vivox" || voice_server_type.empty()) { diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 788ea3b3b3..6135f9ec6c 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -497,7 +497,7 @@ class LLVoiceClient: public LLParamSingleton bool getVoiceEffectEnabled() const { return mVoiceEffectEnabled; }; LLUUID getVoiceEffectDefault() const { return LLUUID(mVoiceEffectDefault); }; - // Returns NULL if voice effects are not supported, or not enabled. + // Returns nullptr if voice effects are not supported, or not enabled. LLVoiceEffectInterface* getVoiceEffectInterface() const; //@} diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp index c5704982b8..df6355f19e 100644 --- a/indra/newview/llvoicevisualizer.cpp +++ b/indra/newview/llvoicevisualizer.cpp @@ -78,15 +78,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/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index d132cbfa36..a78b8f38cd 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -267,7 +267,7 @@ static void killGateway() sGatewayPump.stopListening("VivoxDaemonPump"); sGatewayPtr->kill(__FUNCTION__); - sGatewayPtr=NULL; + sGatewayPtr=nullptr; } else { @@ -435,7 +435,7 @@ void LLVivoxVoiceClient::terminate() } sShuttingDown = true; - sPump = NULL; + sPump = nullptr; } //--------------------------------------------------- @@ -1554,7 +1554,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; @@ -1840,7 +1840,7 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait) // Save looped recording std::string savepath("/tmp/vivoxrecording"); { - time_t now = time(NULL); + time_t now = time(nullptr); const size_t BUF_SIZE = 64; char time_str[BUF_SIZE]; /* Flawfinder: ignore */ @@ -1906,7 +1906,7 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait) } else { - LL_WARNS("Voice") << "terminateAudioSession(" << wait << ") with NULL mAudioSession" << LL_ENDL; + LL_WARNS("Voice") << "terminateAudioSession(" << wait << ") with nullptr mAudioSession" << LL_ENDL; notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL); } @@ -2004,7 +2004,7 @@ bool LLVivoxVoiceClient::waitForChannel() { recordingAndPlaybackMode(); } - else if (mProcessChannels && ((mNextAudioSession == NULL) || checkParcelChanged())) + else if (mProcessChannels && ((mNextAudioSession == nullptr) || checkParcelChanged())) { // the parcel is changed, or we have no pending audio sessions, // so try to request the parcel voice info @@ -2669,7 +2669,7 @@ void LLVivoxVoiceClient::leaveAudioSession() // Save looped recording std::string savepath("/tmp/vivoxrecording"); { - time_t now = time(NULL); + time_t now = time(nullptr); const size_t BUF_SIZE = 64; char time_str[BUF_SIZE]; /* Flawfinder: ignore */ @@ -5075,7 +5075,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(); } @@ -5090,7 +5090,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(); } @@ -5731,7 +5731,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 @@ -5749,7 +5749,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 @@ -5766,7 +5766,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 @@ -5784,7 +5784,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 @@ -6109,7 +6109,7 @@ void LLVivoxVoiceClient::clearSessionHandle(const sessionStatePtr_t &session) } else { - LL_WARNS("Voice") << "Attempt to clear NULL session!" << LL_ENDL; + LL_WARNS("Voice") << "Attempt to clear nullptr session!" << LL_ENDL; } } @@ -6535,7 +6535,7 @@ void LLVivoxVoiceClient::addVoiceFont(const S32 font_index, font_id.generate(STRINGIZE(font_type << ":" << name)); } - 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; @@ -6856,7 +6856,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(); @@ -6884,7 +6884,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") { @@ -6919,7 +6919,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) @@ -7146,7 +7146,7 @@ void LLVivoxVoiceClient::captureBufferPlayStopSendMessage() LLVivoxProtocolParser::LLVivoxProtocolParser() { - parser = XML_ParserCreate(NULL); + parser = XML_ParserCreate(nullptr); reset(); } @@ -7216,7 +7216,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); @@ -7402,21 +7402,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)) @@ -7424,7 +7424,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)) @@ -7436,7 +7436,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)) @@ -7458,11 +7458,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)) @@ -7523,7 +7523,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)) { @@ -7539,11 +7539,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/llvoinventorylistener.cpp b/indra/newview/llvoinventorylistener.cpp index 7ebbbd9f6f..79c432223e 100644 --- a/indra/newview/llvoinventorylistener.cpp +++ b/indra/newview/llvoinventorylistener.cpp @@ -34,14 +34,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); @@ -59,5 +59,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 3686aa25cf..dc35a249a4 100644 --- a/indra/newview/llvoinventorylistener.h +++ b/indra/newview/llvoinventorylistener.h @@ -49,7 +49,7 @@ class LLVOInventoryListener 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.cpp b/indra/newview/llvopartgroup.cpp index ec32a79829..209c7edc1e 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -78,7 +78,7 @@ bool ll_is_part_idx_allocated(S32 idx, S32* start, S32* end) LLVOPartGroup::LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : LLAlphaObject(id, pcode, regionp), - mViewerPartGroupp(NULL) + mViewerPartGroupp(nullptr) { setNumTEs(1); setTETexture(0, LLUUID::null); @@ -239,7 +239,7 @@ bool LLVOPartGroup::updateGeometry(LLDrawable *drawable) { group->setState(LLSpatialGroup::GEOM_DIRTY); } - drawable->setNumFaces(0, NULL, getTEImage(0)); + drawable->setNumFaces(0, nullptr, getTEImage(0)); LLPipeline::sCompiles++; return true; } @@ -251,7 +251,7 @@ bool LLVOPartGroup::updateGeometry(LLDrawable *drawable) if (num_parts > drawable->getNumFaces()) { - drawable->setNumFacesFast(num_parts+num_parts/4, NULL, getTEImage(0)); + drawable->setNumFacesFast(num_parts+num_parts/4, nullptr, getTEImage(0)); } F32 tot_area = 0; @@ -280,7 +280,7 @@ bool LLVOPartGroup::updateGeometry(LLDrawable *drawable) if (part->mFlags & LLPartData::LL_PART_RIBBON_MASK) { //include ribbon segment length in scale - const LLVector3* pos_agent = NULL; + const LLVector3* pos_agent = nullptr; if (part->mParent) { pos_agent = &(part->mParent->mPosAgent); @@ -730,7 +730,7 @@ void LLParticlePartition::rebuildGeom(LLSpatialGroup* group) } else { - group->mVertexBuffer = NULL; + group->mVertexBuffer = nullptr; group->mBufferMap.clear(); } diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 38c702c4ca..efd1859b82 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -91,8 +91,8 @@ S32 LLSkyTex::sCurrent = 0; LLSkyTex::LLSkyTex() : - mSkyData(NULL), - mSkyDirs(NULL), + mSkyData(nullptr), + mSkyDirs(nullptr), mIsShiny(false) { } @@ -123,8 +123,8 @@ void LLSkyTex::init(bool isShiny) void LLSkyTex::cleanupGL() { - mTexture[0] = NULL; - mTexture[1] = NULL; + mTexture[0] = nullptr; + mTexture[1] = nullptr; } void LLSkyTex::restoreGL() @@ -139,10 +139,10 @@ void LLSkyTex::restoreGL() LLSkyTex::~LLSkyTex() { delete[] mSkyData; - mSkyData = NULL; + mSkyData = nullptr; delete[] mSkyDirs; - mSkyDirs = NULL; + mSkyDirs = nullptr; } S32 LLSkyTex::getResolution() @@ -434,7 +434,7 @@ LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) } for (S32 i=0; iaddFace(poolp, NULL); + mFace[FACE_SIDE0 + i] = mDrawable->addFace(poolp, nullptr); } mFace[FACE_SUN] = mDrawable->addFace(poolp, nullptr); @@ -980,12 +980,12 @@ void LLVOSky::setBloomTextures(const LLUUID& bloom_texture, const LLUUID& bloom_ bool LLVOSky::updateGeometry(LLDrawable *drawable) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; - if (mFace[FACE_REFLECTION] == NULL) + if (mFace[FACE_REFLECTION] == nullptr) { LLDrawPoolWater *poolp = (LLDrawPoolWater*) gPipeline.getPool(LLDrawPool::POOL_WATER); if (gPipeline.getPool(LLDrawPool::POOL_WATER)->getShaderLevel() != 0) { - mFace[FACE_REFLECTION] = drawable->addFace(poolp, NULL); + mFace[FACE_REFLECTION] = drawable->addFace(poolp, nullptr); } } diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp index bc326a74a8..91bfb796c1 100644 --- a/indra/newview/llvosurfacepatch.cpp +++ b/indra/newview/llvosurfacepatch.cpp @@ -49,9 +49,9 @@ F32 LLVOSurfacePatch::sLODFactor = 1.f; 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), @@ -67,7 +67,7 @@ LLVOSurfacePatch::LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLView LLVOSurfacePatch::~LLVOSurfacePatch() { - mPatchp = NULL; + mPatchp = nullptr; } @@ -76,7 +76,7 @@ void LLVOSurfacePatch::markDead() if (mPatchp) { mPatchp->clearVObj(); - mPatchp = NULL; + mPatchp = nullptr; } LLViewerObject::markDead(); } @@ -132,7 +132,7 @@ LLDrawable *LLVOSurfacePatch::createDrawable(LLPipeline *pipeline) LLFacePool *poolp = getPool(); - mDrawable->addFace(poolp, NULL); + mDrawable->addFace(poolp, nullptr); return mDrawable; } @@ -786,7 +786,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 c93a58d2d9..8bf2b4a586 100644 --- a/indra/newview/llvosurfacepatch.h +++ b/indra/newview/llvosurfacepatch.h @@ -78,11 +78,11 @@ class LLVOSurfacePatch : public LLStaticViewerObject bool pick_transparent = false, bool pick_rigged = false, bool pick_unselectable = true, - 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 ); bool mDirtiedPatch; diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index cfb15b42c4..cdb36bfc03 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -98,7 +98,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 ; } @@ -539,7 +539,7 @@ bool LLVOTree::updateGeometry(LLDrawable *drawable) LL_WARNS() << "Failed to allocate Vertex Buffer on update to " << max_vertices << " vertices and " << max_indices << " indices" << LL_ENDL; - mReferenceBuffer = NULL; //unref + mReferenceBuffer = nullptr; //unref return true; } diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h index b2fc16bd17..68c787cc00 100644 --- a/indra/newview/llvotree.h +++ b/indra/newview/llvotree.h @@ -112,11 +112,11 @@ class LLVOTree : public LLViewerObject bool pick_transparent = false, bool pick_rigged = false, bool pick_unselectable = true, - 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 ); static S32 sMaxTreeSpecies; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 9c0f4baf28..cef7f27dca 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -102,8 +102,8 @@ F32 LLVOVolume::sDistanceFactor = 1.0f; S32 LLVOVolume::sNumLODChanges = 0; S32 LLVOVolume::mRenderComplexity_last = 0; S32 LLVOVolume::mRenderComplexity_current = 0; -LLPointer LLVOVolume::sObjectMediaClient = NULL; -LLPointer LLVOVolume::sObjectMediaNavigateClient = NULL; +LLPointer LLVOVolume::sObjectMediaClient = nullptr; +LLPointer LLVOVolume::sObjectMediaNavigateClient = nullptr; extern bool gCubeSnapshot; @@ -127,10 +127,10 @@ class LLMediaDataClientObjectImpl : public LLMediaDataClientObject { LLSD result; LLTextureEntry *te = mObject->getTE(index); - if (NULL != te) + if (nullptr != te) { - llassert((te->getMediaData() != NULL) == te->hasMedia()); - if (te->getMediaData() != NULL) + llassert((te->getMediaData() != nullptr) == te->hasMedia()); + if (te->getMediaData() != nullptr) { result = te->getMediaData()->asLLSD(); // XXX HACK: workaround bug in asLLSD() where whitelist is not set properly @@ -210,7 +210,7 @@ class LLMediaDataClientObjectImpl : public LLMediaDataClientObject LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : LLViewerObject(id, pcode, regionp), - mVolumeImpl(NULL) + mVolumeImpl(nullptr) { mTexAnimMode = 0; mRelativeXform.setIdentity(); @@ -221,7 +221,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re mLODDistance = 0.0f; mLODAdjustedDistance = 0.0f; mLODRadius = 0.0f; - mTextureAnimp = NULL; + mTextureAnimp = nullptr; mVolumeChanged = false; mVObjRadius = LLVector3(1,1,0.5f).length(); mNumFaces = 0; @@ -231,7 +231,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re mSpotLightPriority = 0.f; mSkinInfoUnavaliable = false; - mSkinInfo = NULL; + mSkinInfo = nullptr; mMediaImplList.resize(getNumTEs()); mLastFetchedMediaVersion = -1; @@ -246,9 +246,9 @@ LLVOVolume::~LLVOVolume() { LL_PROFILE_ZONE_SCOPED; delete mTextureAnimp; - mTextureAnimp = NULL; + mTextureAnimp = nullptr; delete mVolumeImpl; - mVolumeImpl = NULL; + mVolumeImpl = nullptr; gMeshRepo.unregisterMesh(this); @@ -328,8 +328,8 @@ void LLVOVolume::initClass() // static void LLVOVolume::cleanupClass() { - sObjectMediaClient = NULL; - sObjectMediaNavigateClient = NULL; + sObjectMediaClient = nullptr; + sObjectMediaNavigateClient = nullptr; } U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, @@ -393,7 +393,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, if (mTextureAnimp) { delete mTextureAnimp; - mTextureAnimp = NULL; + mTextureAnimp = nullptr; for (S32 i = 0; i < getNumTEs(); i++) { @@ -402,7 +402,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, { // delete or reset delete facep->mTextureMatrix; - facep->mTextureMatrix = NULL; + facep->mTextureMatrix = nullptr; } } @@ -497,7 +497,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, else if (mTextureAnimp) { delete mTextureAnimp; - mTextureAnimp = NULL; + mTextureAnimp = nullptr; for (S32 i = 0; i < getNumTEs(); i++) { @@ -506,7 +506,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, { // delete or reset delete facep->mTextureMatrix; - facep->mTextureMatrix = NULL; + facep->mTextureMatrix = nullptr; } } @@ -850,7 +850,7 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) // If a face is animatable, it will always have non-null mTextureMatrix // pointer defined after the first call to LLVOVolume::animateTextures, // although the animation is not always turned on. - if (face->mTextureMatrix != NULL) + if (face->mTextureMatrix != nullptr) { if ((vsize > MIN_TEX_ANIM_SIZE) != (old_size > MIN_TEX_ANIM_SIZE)) { @@ -1093,7 +1093,7 @@ bool LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo if (mVolumeImpl) { delete mVolumeImpl; - mVolumeImpl = NULL; + mVolumeImpl = nullptr; if (mDrawable.notNull()) { // Undo the damage we did to this matrix @@ -1129,7 +1129,7 @@ bool LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo { if (mSkinInfo && mSkinInfo->mMeshID != volume_params.getSculptID()) { - mSkinInfo = NULL; + mSkinInfo = nullptr; mSkinInfoUnavaliable = false; } @@ -1206,11 +1206,11 @@ void LLVOVolume::updateSculptTexture() } mSkinInfoUnavaliable = false; - mSkinInfo = NULL; + mSkinInfo = nullptr; } else { - mSculptTexture = NULL; + mSculptTexture = nullptr; } if (mSculptTexture != old_sculpt) @@ -1293,7 +1293,7 @@ void LLVOVolume::sculpt() U16 sculpt_height = 0; U16 sculpt_width = 0; S8 sculpt_components = 0; - const U8* sculpt_data = NULL; + const U8* sculpt_data = nullptr; S32 discard_level = mSculptTexture->getRawImageLevel() ; LLImageRaw* raw_image = mSculptTexture->getRawImage() ; @@ -1369,7 +1369,7 @@ void LLVOVolume::sculpt() { sculpt_width = 0; sculpt_height = 0; - sculpt_data = NULL ; + sculpt_data = nullptr ; if(LLViewerTextureManager::sTesterp) { @@ -1888,7 +1888,7 @@ bool LLVOVolume::genBBoxes(bool force_global, bool should_update_octree_bounds) void LLVOVolume::preRebuild() { - if (mVolumeImpl != NULL) + if (mVolumeImpl != nullptr) { mVolumeImpl->preRebuild(); } @@ -2011,7 +2011,7 @@ bool LLVOVolume::lodOrSculptChanged(LLDrawable *drawable, bool &compiled, bool & old_volumep = getVolume(); old_lod = old_volumep->getDetail(); old_num_faces = old_volumep->getNumFaces(); - old_volumep = NULL; + old_volumep = nullptr; { const LLVolumeParams &volume_params = getVolume()->getParams(); @@ -2021,7 +2021,7 @@ bool LLVOVolume::lodOrSculptChanged(LLDrawable *drawable, bool &compiled, bool & new_volumep = getVolume(); new_lod = new_volumep->getDetail(); new_num_faces = new_volumep->getNumFaces(); - new_volumep = NULL; + new_volumep = nullptr; if ((new_lod != old_lod) || mSculptChanged) { @@ -2078,7 +2078,7 @@ bool LLVOVolume::updateGeometry(LLDrawable *drawable) mDrawable->clearState(LLDrawable::REBUILD_RIGGED); } - if (mVolumeImpl != NULL) + if (mVolumeImpl != nullptr) { bool res; { @@ -2623,7 +2623,7 @@ void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool m LL_DEBUGS("MediaOnAPrim") << "BEFORE: texture_index = " << texture_index << " hasMedia = " << te->hasMedia() << " : " - << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << LL_ENDL; + << ((nullptr == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << LL_ENDL; std::string previous_url; LLMediaEntry* mep = te->getMediaData(); @@ -2676,13 +2676,13 @@ void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool m LL_DEBUGS("MediaOnAPrim") << "AFTER: texture_index = " << texture_index << " hasMedia = " << te->hasMedia() << " : " - << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << LL_ENDL; + << ((nullptr == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << LL_ENDL; } void LLVOVolume::mediaNavigateBounceBack(U8 texture_index) { // Find the media entry for this navigate - const LLMediaEntry* mep = NULL; + const LLMediaEntry* mep = nullptr; viewer_media_t impl = getMediaImpl(texture_index); LLTextureEntry *te = getTE(texture_index); if(te) @@ -2730,7 +2730,7 @@ void LLVOVolume::mediaNavigateBounceBack(U8 texture_index) bool LLVOVolume::hasMediaPermission(const LLMediaEntry* media_entry, MediaPermType perm_type) { // NOTE: This logic ALMOST duplicates the logic in the server (in particular, in llmediaservice.cpp). - if (NULL == media_entry ) return false; // XXX should we assert here? + if (nullptr == media_entry ) return false; // XXX should we assert here? // The agent has permissions if: // - world permissions are on, or @@ -2778,7 +2778,7 @@ void LLVOVolume::mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plu int face_index = getFaceIndexWithMediaImpl(impl, -1); // Find the media entry for this navigate - LLMediaEntry* mep = NULL; + LLMediaEntry* mep = nullptr; LLTextureEntry *te = getTE(face_index); if(te) { @@ -2939,7 +2939,7 @@ void LLVOVolume::removeMediaImpl(S32 texture_index) mMediaImplList[texture_index]->removeObject(this) ; } - mMediaImplList[texture_index] = NULL ; + mMediaImplList[texture_index] = nullptr ; return ; } @@ -2966,7 +2966,7 @@ void LLVOVolume::addMediaImpl(LLViewerMediaImpl* media_impl, S32 texture_index) //add the face to show the media if it is in playing if(mDrawable) { - LLFace* facep(NULL); + LLFace* facep(nullptr); if( texture_index < mDrawable->getNumFaces() ) { facep = mDrawable->getFace(texture_index) ; @@ -2994,7 +2994,7 @@ viewer_media_t LLVOVolume::getMediaImpl(U8 face_id) const { return mMediaImplList[face_id]; } - return NULL; + return nullptr; } F64 LLVOVolume::getTotalMediaInterest() const @@ -3077,7 +3077,7 @@ void LLVOVolume::setLightTextureID(LLUUID id) } setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, false, true); parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true); - mLightTexture = NULL; + mLightTexture = nullptr; } } @@ -3326,7 +3326,7 @@ LLViewerTexture* LLVOVolume::getLightTexture() } else { - mLightTexture = NULL; + mLightTexture = nullptr; } return mLightTexture; @@ -3724,7 +3724,7 @@ const LLMeshSkinInfo* LLVOVolume::getSkinInfo() const } else { - return NULL; + return nullptr; } } @@ -3836,7 +3836,7 @@ void LLVOVolume::onReparent(LLViewerObject *old_parent, LLViewerObject *new_pare // Here an animated object is being made the child of some // other prim. Should remove the control av from the child. LLControlAvatar *av = mControlAvatar; - mControlAvatar = NULL; + mControlAvatar = nullptr; av->markForDeath(); } } @@ -4044,7 +4044,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const // Get access to params we'll need at various points. // Skip if this is object doesn't have a volume (e.g. is an avatar). - if (getVolume() == NULL) + if (getVolume() == nullptr) { return 0; } @@ -4202,7 +4202,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const // glow is a multiplier, don't add per-face glow = 1; } - if (face->mTextureMatrix != NULL) + if (face->mTextureMatrix != nullptr) { animtex = 1; } @@ -4453,7 +4453,7 @@ void LLVOVolume::parameterChanged(U16 param_type, LLNetworkData* data, bool in_u { U32 extended_mesh_flags = getExtendedMeshFlags(); bool enabled = (extended_mesh_flags & LLExtendedMeshParams::ANIMATED_MESH_ENABLED_FLAG); - bool was_enabled = (getControlAvatar() != NULL); + bool was_enabled = (getControlAvatar() != nullptr); if (enabled != was_enabled) { LL_DEBUGS("AnimatedObjects") << this @@ -4743,22 +4743,22 @@ bool LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& LLVector2 tc; LLVector4a tn; - if (intersection != NULL) + if (intersection != nullptr) { p = *intersection; } - if (tex_coord != NULL) + if (tex_coord != nullptr) { tc = *tex_coord; } - if (normal != NULL) + if (normal != nullptr) { n = *normal; } - if (tangent != NULL) + if (tangent != nullptr) { tn = *tangent; } @@ -4826,12 +4826,12 @@ bool LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& (ignore_alpha || pick_transparent || no_texture || mask)) { local_end = p; - if (face_hitp != NULL) + if (face_hitp != nullptr) { *face_hitp = face_hit; } - if (intersection != NULL) + if (intersection != nullptr) { if (transform) { @@ -4845,7 +4845,7 @@ bool LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& } } - if (normal != NULL) + if (normal != nullptr) { if (transform) { @@ -4859,7 +4859,7 @@ bool LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& (*normal).normalize3fast(); } - if (tangent != NULL) + if (tangent != nullptr) { if (transform) { @@ -4881,7 +4881,7 @@ bool LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& (*tangent).normalize3fast(); } - if (tex_coord != NULL) + if (tex_coord != nullptr) { *tex_coord = tc; } @@ -4912,7 +4912,7 @@ void LLVOVolume::clearRiggedVolume() { if (mRiggedVolume.notNull()) { - mRiggedVolume = NULL; + mRiggedVolume = nullptr; updateRelativeXform(); } } @@ -5212,14 +5212,14 @@ bool can_batch_texture(LLFace* facep) const static U32 MAX_FACE_COUNT = 4096U; int32_t LLVolumeGeometryManager::sInstanceCount = 0; -LLFace** LLVolumeGeometryManager::sFullbrightFaces[2] = { NULL }; -LLFace** LLVolumeGeometryManager::sBumpFaces[2] = { NULL }; -LLFace** LLVolumeGeometryManager::sSimpleFaces[2] = { NULL }; -LLFace** LLVolumeGeometryManager::sNormFaces[2] = { NULL }; -LLFace** LLVolumeGeometryManager::sSpecFaces[2] = { NULL }; -LLFace** LLVolumeGeometryManager::sNormSpecFaces[2] = { NULL }; -LLFace** LLVolumeGeometryManager::sPbrFaces[2] = { NULL }; -LLFace** LLVolumeGeometryManager::sAlphaFaces[2] = { NULL }; +LLFace** LLVolumeGeometryManager::sFullbrightFaces[2] = { nullptr }; +LLFace** LLVolumeGeometryManager::sBumpFaces[2] = { nullptr }; +LLFace** LLVolumeGeometryManager::sSimpleFaces[2] = { nullptr }; +LLFace** LLVolumeGeometryManager::sNormFaces[2] = { nullptr }; +LLFace** LLVolumeGeometryManager::sSpecFaces[2] = { nullptr }; +LLFace** LLVolumeGeometryManager::sNormSpecFaces[2] = { nullptr }; +LLFace** LLVolumeGeometryManager::sPbrFaces[2] = { nullptr }; +LLFace** LLVolumeGeometryManager::sAlphaFaces[2] = { nullptr }; LLVolumeGeometryManager::LLVolumeGeometryManager() : LLGeometryManager() @@ -5273,14 +5273,14 @@ void LLVolumeGeometryManager::freeFaces() ll_aligned_free<64>(sPbrFaces[i]); ll_aligned_free<64>(sAlphaFaces[i]); - sFullbrightFaces[i] = NULL; - sBumpFaces[i] = NULL; - sSimpleFaces[i] = NULL; - sNormFaces[i] = NULL; - sSpecFaces[i] = NULL; - sNormSpecFaces[i] = NULL; - sPbrFaces[i] = NULL; - sAlphaFaces[i] = NULL; + sFullbrightFaces[i] = nullptr; + sBumpFaces[i] = nullptr; + sSimpleFaces[i] = nullptr; + sNormFaces[i] = nullptr; + sSpecFaces[i] = nullptr; + sNormSpecFaces[i] = nullptr; + sPbrFaces[i] = nullptr; + sAlphaFaces[i] = nullptr; } } @@ -5334,13 +5334,13 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, return; } - const LLMatrix4* tex_mat = NULL; + const LLMatrix4* tex_mat = nullptr; if (facep->isState(LLFace::TEXTURE_ANIM) && facep->getVirtualSize() > MIN_TEX_ANIM_SIZE) { tex_mat = facep->mTextureMatrix; } - const LLMatrix4* model_mat = NULL; + const LLMatrix4* model_mat = nullptr; LLDrawable* drawable = facep->getDrawable(); @@ -5495,7 +5495,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, LLVector4 specColor(spec, spec, spec, spec); draw_info->mSpecColor = specColor; draw_info->mEnvIntensity = spec; - draw_info->mSpecularMap = NULL; + draw_info->mSpecularMap = nullptr; draw_info->mMaterial = mat; draw_info->mGLTFMaterial = gltf_mat; draw_info->mShaderMask = shader_mask; @@ -5621,8 +5621,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) group->mBuilt = 1.f; LLSpatialBridge* bridge = group->getSpatialPartition()->asBridge(); - LLViewerObject *vobj = NULL; - LLVOVolume *vol_obj = NULL; + LLViewerObject *vobj = nullptr; + LLVOVolume *vol_obj = nullptr; if (bridge) { @@ -5753,7 +5753,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (avatar != nullptr) { - avatar->addAttachmentOverridesForObject(vobj, NULL, false); + avatar->addAttachmentOverridesForObject(vobj, nullptr, false); } // Standard rigged mesh attachments: @@ -5803,7 +5803,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //ALWAYS null out vertex buffer on rebuild -- if the face lands in a render // batch, it will recover its vertex buffer reference from the spatial group - facep->setVertexBuffer(NULL); + facep->setVertexBuffer(nullptr); //sum up face verts and indices drawablep->updateFaceSize(i); @@ -5831,8 +5831,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) pool->removeFace(facep); } facep->clearState(LLFace::RIGGED); - facep->mAvatar = NULL; - facep->mSkinInfo = NULL; + facep->mAvatar = nullptr; + facep->mSkinInfo = nullptr; } } @@ -6300,7 +6300,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace LLSpatialGroup::buffer_map_t buffer_map; - LLViewerTexture* last_tex = NULL; + LLViewerTexture* last_tex = nullptr; S32 texture_index_channels = LLGLSLShader::sIndexedTextureChannels; @@ -6317,7 +6317,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace if (distance_sort) { - tex = NULL; + tex = nullptr; } if (last_tex != tex) @@ -6441,7 +6441,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace } //face has no texture index - facep->mDrawInfo = NULL; + facep->mDrawInfo = nullptr; facep->setTextureIndex(FACE_DO_NOT_BATCH_TEXTURES); if (geom_count + facep->getGeomCount() > max_vertices) @@ -6469,7 +6469,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace LL_WARNS() << "Failed to allocate group Vertex Buffer to " << geom_count << " vertices and " << index_count << " indices" << LL_ENDL; - buffer = NULL; + buffer = nullptr; } } diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 97a5131260..d71b203a77 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -154,18 +154,18 @@ class LLVOVolume : public LLViewerObject /* virtual*/ F32 getStreamingCost() const override; /*virtual*/ bool getCostData(LLMeshCostData& costs) const override; - /*virtual*/ U32 getTriangleCount(S32* vcount = NULL) const override; + /*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, bool pick_unselectable = true, - 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; diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 4a7e231f30..8e6f45136c 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -113,7 +113,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/llvowlsky.cpp b/indra/newview/llvowlsky.cpp index b5ee42f36c..f304fc7fcf 100644 --- a/indra/newview/llvowlsky.cpp +++ b/indra/newview/llvowlsky.cpp @@ -205,7 +205,7 @@ bool LLVOWLSky::updateGeometry(LLDrawable * drawable) // round up to a whole number of segments const U32 strips_segments = (total_stacks+stacks_per_seg-1) / stacks_per_seg; - mStripsVerts.resize(strips_segments, NULL); + mStripsVerts.resize(strips_segments, nullptr); #if RELEASE_SHOW_DEBUG LL_INFOS() << "WL Skydome strips in " << strips_segments << " batches." << LL_ENDL; diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index cc593fe7b4..a98665614a 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -151,7 +151,7 @@ LLPanelWearableOutfitItem* LLPanelWearableOutfitItem::create(LLViewerInventoryIt bool worn_indication_enabled, bool show_widgets) { - LLPanelWearableOutfitItem* list_item = NULL; + LLPanelWearableOutfitItem* list_item = nullptr; if (item) { const LLPanelWearableOutfitItem::Params& params = LLUICtrlFactory::getDefaultParams(); @@ -237,7 +237,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(); @@ -322,7 +322,7 @@ LLPanelBodyPartsListItem::Params::Params() // static LLPanelBodyPartsListItem* LLPanelBodyPartsListItem::create(LLViewerInventoryItem* item) { - LLPanelBodyPartsListItem* list_item = NULL; + LLPanelBodyPartsListItem* list_item = nullptr; if(item) { const Params& params = LLUICtrlFactory::getDefaultParams(); @@ -389,7 +389,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(); @@ -430,7 +430,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(); @@ -506,7 +506,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); @@ -747,8 +747,8 @@ LLPanel* LLWearableItemsList::createNewItem(LLViewerInventoryItem* item) if (!item) { LL_WARNS() << "No inventory item. Couldn't create flat list item." << LL_ENDL; - llassert(item != NULL); - return NULL; + llassert(item != nullptr); + return nullptr; } return LLPanelWearableOutfitItem::create(item, mWornIndicationEnabled, mShowItemWidgets); @@ -858,7 +858,7 @@ void LLWearableItemsList::setSortOrder(ESortOrder sort_order, bool sort_now) ////////////////////////////////////////////////////////////////////////// LLWearableItemsList::ContextMenu::ContextMenu() -: mParent(NULL) +: mParent(nullptr) { } @@ -866,7 +866,7 @@ void LLWearableItemsList::ContextMenu::show(LLView* spawning_view, const uuid_ve { mParent = dynamic_cast(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 } void LLWearableItemsList::ContextMenu::show(LLView* spawning_view, LLWearableType::EType w_type, S32 x, S32 y) @@ -906,7 +906,7 @@ void LLWearableItemsList::ContextMenu::show(LLView* spawning_view, LLWearableTyp menup->show(x, y); LLMenuGL::showPopup(spawning_view, menup, x, y); - mParent = NULL; // to avoid dereferencing an invalid pointer + mParent = nullptr; // to avoid dereferencing an invalid pointer } // virtual diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 2d59712142..9f6a3fbd23 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -79,7 +79,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; @@ -116,7 +116,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; // nullptr indicates failure LLAvatarAppearance *avatarp = data->mAvatarp; if( !filename ) @@ -147,7 +147,7 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID isNewWearable = true; } delete wearable; - wearable = NULL; + wearable = nullptr; } if(filename) @@ -221,7 +221,7 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID LLNotificationsUtil::add("FailedToFindWearable", args); } } - // Always call callback; wearable will be NULL if we failed + // Always call callback; wearable will be nullptr if we failed { if( data->mCallback ) { diff --git a/indra/newview/llwindebug.cpp b/indra/newview/llwindebug.cpp index 5cd75f7a02..9aee71e686 100644 --- a/indra/newview/llwindebug.cpp +++ b/indra/newview/llwindebug.cpp @@ -36,7 +36,7 @@ typedef bool (WINAPI *MINIDUMPWRITEDUMP)(HANDLE hProcess, DWORD dwPid, HANDLE hF CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam ); -MINIDUMPWRITEDUMP f_mdwp = NULL; +MINIDUMPWRITEDUMP f_mdwp = nullptr; class LLMemoryReserve { @@ -51,7 +51,7 @@ class LLMemoryReserve { }; LLMemoryReserve::LLMemoryReserve() : - mReserve(NULL) + mReserve(nullptr) { } @@ -65,7 +65,7 @@ const size_t LLMemoryReserve::MEMORY_RESERVATION_SIZE = 5 * 1024 * 1024; void LLMemoryReserve::reserve() { - if(NULL == mReserve) + if(nullptr == mReserve) { mReserve = new unsigned char[MEMORY_RESERVATION_SIZE]; } @@ -73,11 +73,11 @@ void LLMemoryReserve::reserve() void LLMemoryReserve::release() { - if (NULL != mReserve) + if (nullptr != mReserve) { delete [] mReserve; } - mReserve = NULL; + mReserve = nullptr; } static LLMemoryReserve gEmergencyMemoryReserve; @@ -104,7 +104,7 @@ void LLWinDebug::initSingleton() // First, try loading from the directory that the app resides in. std::string local_dll_name = gDirUtilp->findFile("dbghelp.dll", gDirUtilp->getWorkingDir(), gDirUtilp->getExecutableDir()); - HMODULE hDll = NULL; + HMODULE hDll = nullptr; hDll = LoadLibraryA(local_dll_name.c_str()); if (!hDll) { @@ -122,7 +122,7 @@ void LLWinDebug::initSingleton() if (!f_mdwp) { FreeLibrary(hDll); - hDll = NULL; + hDll = nullptr; } } @@ -147,7 +147,7 @@ void LLWinDebug::writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMAT const bool enable_write_dump_file = false; if ( enable_write_dump_file ) { - if(f_mdwp == NULL || gDirUtilp == NULL) + if(f_mdwp == nullptr || gDirUtilp == nullptr) { return; } @@ -158,10 +158,10 @@ void LLWinDebug::writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMAT HANDLE hFile = CreateFileA(dump_path.c_str(), GENERIC_WRITE, FILE_SHARE_WRITE, - NULL, + nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, - NULL); + nullptr); if (hFile != INVALID_HANDLE_VALUE) { @@ -171,8 +171,8 @@ void LLWinDebug::writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMAT hFile, type, ExInfop, - NULL, - NULL); + nullptr, + nullptr); CloseHandle(hFile); } @@ -195,7 +195,7 @@ void LLWinDebug::generateMinidump(struct _EXCEPTION_POINTERS *exception_infop) ExInfo.ThreadId = ::GetCurrentThreadId(); ExInfo.ExceptionPointers = exception_infop; - ExInfo.ClientPointers = NULL; + ExInfo.ClientPointers = FALSE; writeDumpToFile((MINIDUMP_TYPE)(MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory), &ExInfo, "SecondLife.dmp"); } } diff --git a/indra/newview/llwindebug.h b/indra/newview/llwindebug.h index 11b50e3327..7aaa198ed7 100644 --- a/indra/newview/llwindebug.h +++ b/indra/newview/llwindebug.h @@ -38,7 +38,7 @@ class LLWinDebug: LLSINGLETON_EMPTY_CTOR(LLWinDebug); public: void initSingleton() override; - static void generateMinidump(struct _EXCEPTION_POINTERS *pExceptionInfo = NULL); + static void generateMinidump(struct _EXCEPTION_POINTERS *pExceptionInfo = nullptr); void cleanupSingleton() override; private: static void writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename); diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index 6d234a9a34..c6f0ebfde5 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -229,7 +229,7 @@ void LLWindowListener::getInfo(LLSD const & evt) void LLWindowListener::getPaths(LLSD const & request) { Response response(LLSD(), request); - LLView *root(LLUI::getInstance()->getRootView()), *base(NULL); + LLView *root(LLUI::getInstance()->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. @@ -483,12 +483,12 @@ void LLWindowListener::mouseDown(LLSD const & request) Actions actions(buttons.lookup(request["button"])); if (actions.valid) { - // Normally you can pass NULL to an LLWindow* without compiler + // Normally you can pass nullptr to an LLWindow* without compiler // complaint, but going through std::bind() evidently // bypasses that special case: it only knows you're trying to pass an - // int to a pointer. Explicitly cast NULL to the desired pointer type. + // int to a pointer. Explicitly cast nullptr to the desired pointer type. mouseEvent(std::bind(actions.down, mWindow, - static_cast(NULL), std::placeholders::_1, std::placeholders::_2), + static_cast(nullptr), std::placeholders::_1, std::placeholders::_2), request); } } @@ -498,7 +498,7 @@ void LLWindowListener::mouseUp(LLSD const & request) Actions actions(buttons.lookup(request["button"])); if (actions.valid) { - mouseEvent(std::bind(actions.up, mWindow, static_cast(NULL), std::placeholders::_1, std::placeholders::_2), + mouseEvent(std::bind(actions.up, mWindow, static_cast(nullptr), std::placeholders::_1, std::placeholders::_2), request); } } @@ -510,7 +510,7 @@ void LLWindowListener::mouseMove(LLSD const & request) // void, whereas mouseEvent() accepts a function returning bool -- and // uses that bool return. Use MouseFuncTrue to construct a callable that // returns bool anyway. - mouseEvent(MouseFuncTrue(std::bind(&LLWindowCallbacks::handleMouseMove, mWindow, static_cast(NULL), std::placeholders::_1, + mouseEvent(MouseFuncTrue(std::bind(&LLWindowCallbacks::handleMouseMove, mWindow, static_cast(nullptr), std::placeholders::_1, std::placeholders::_2)), request); } @@ -519,5 +519,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/llworld.cpp b/indra/newview/llworld.cpp index 47e1815bc2..55abdf2aee 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -97,7 +97,7 @@ LLWorld::LLWorld() : { for (S32 i = 0; i < EDGE_WATER_OBJECTS_COUNT; i++) { - mEdgeWaterObjects[i] = NULL; + mEdgeWaterObjects[i] = nullptr; } LLPointer raw = new LLImageRaw(1,1,4); @@ -128,10 +128,10 @@ void LLWorld::resetClass() LLViewerPartSim::getInstance()->destroyClass(); - mDefaultWaterTexturep = NULL ; + mDefaultWaterTexturep = nullptr ; for (S32 i = 0; i < EDGE_WATER_OBJECTS_COUNT; i++) { - mEdgeWaterObjects[i] = NULL; + mEdgeWaterObjects[i] = nullptr; } //make all visible drawbles invisible. @@ -317,7 +317,7 @@ LLViewerRegion* LLWorld::getRegion(const LLHost &host) return regionp; } } - return NULL; + return nullptr; } LLViewerRegion* LLWorld::getRegionFromPosAgent(const LLVector3 &pos) @@ -336,7 +336,7 @@ LLViewerRegion* LLWorld::getRegionFromPosGlobal(const LLVector3d &pos) return regionp; } } - return NULL; + return nullptr; } @@ -420,7 +420,7 @@ LLViewerRegion* LLWorld::getRegionFromHandle(const U64 &handle) return regionp; } } - return NULL; + return nullptr; } LLViewerRegion* LLWorld::getRegionFromID(const LLUUID& region_id) @@ -434,7 +434,7 @@ LLViewerRegion* LLWorld::getRegionFromID(const LLUUID& region_id) return regionp; } } - return NULL; + return nullptr; } void LLWorld::updateAgentOffset(const LLVector3d &offset_global) @@ -485,7 +485,7 @@ LLViewerRegion* LLWorld::resolveRegionGlobal(LLVector3 &pos_region, const LLVect return regionp; } - return NULL; + return nullptr; } @@ -500,7 +500,7 @@ LLViewerRegion* LLWorld::resolveRegionAgent(LLVector3 &pos_region, const LLVecto return regionp; } - return NULL; + return nullptr; } @@ -536,7 +536,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); @@ -599,7 +599,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); @@ -824,7 +824,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) { @@ -901,7 +901,7 @@ void LLWorld::clearEdgeWaterObjects() for (S32 i = 0; i < EDGE_WATER_OBJECTS_COUNT; i++) { gObjectList.killObject(mEdgeWaterObjects[i]); - mEdgeWaterObjects[i] = NULL; + mEdgeWaterObjects[i] = nullptr; } } @@ -1312,11 +1312,11 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector* 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(); } @@ -1333,11 +1333,11 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector* 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); } @@ -1357,9 +1357,9 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector* 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 dc95a4eff1..02eb89b82c 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -107,7 +107,7 @@ class LLWorld : public LLSimpleton // 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 @@ -161,8 +161,8 @@ class LLWorld : public LLSimpleton // 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* positions = NULL, + uuid_vec_t* avatar_ids = nullptr, + std::vector* positions = nullptr, const LLVector3d& relative_to = LLVector3d(), F32 radius = FLT_MAX) const; // Returns 'true' if the region is in mRegionList, diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 153bee3aef..148c975bf3 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -85,7 +85,7 @@ void LLSimInfo::setLandForSaleImage (LLUUID image_id) } else { - mOverlayImage = NULL; + mOverlayImage = nullptr; } } @@ -129,7 +129,7 @@ void LLSimInfo::clearImage() if (!mOverlayImage.isNull()) { mOverlayImage->setBoostLevel(0); - mOverlayImage = NULL; + mOverlayImage = nullptr; } } @@ -263,7 +263,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; @@ -285,7 +285,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; @@ -331,13 +331,13 @@ LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 handle) { return it->second; } - 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 @@ -353,7 +353,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; } @@ -371,7 +371,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) @@ -412,7 +412,7 @@ bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, std::string& name, LLUUI // 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); } @@ -453,9 +453,9 @@ bool LLWorldMap::insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& LLVector3d pos((F32)x_world, (F32)y_world, 40.0); U64 handle = to_region_handle(pos); - // Get the region record for that handle or NULL if we haven't browsed it yet + // Get the region record for that handle or nullptr 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/llworldmap.h b/indra/newview/llworldmap.h index 68e7f3ee29..e29a6e2ef9 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -216,7 +216,7 @@ class LLWorldMap : public LLSingleton static bool insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& uuid, U32 type, S32 extra, S32 extra2); // Get info on sims (region) : note that those methods only search the range of loaded sims (the one that are being browsed) - // *not* the entire world. So a NULL return does not mean a down or unexisting region, just an out of range region. + // *not* the entire world. So a nullptr return does not mean a down or unexisting region, just an out of range region. LLSimInfo* simInfoFromHandle(const U64 handle); LLSimInfo* simInfoFromPosGlobal(const LLVector3d& pos_global); LLSimInfo* simInfoFromName(const std::string& sim_name); diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 6b2bd3e6fb..4dd69577d4 100755 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -77,27 +77,27 @@ constexpr F32 GODLY_TELEPORT_HEIGHT = 200.f; constexpr F32 BIG_DOT_RADIUS = 5.f; bool LLWorldMapView::sHandledLastClick = false; -LLUIImagePtr LLWorldMapView::sAvatarSmallImage = NULL; -LLUIImagePtr LLWorldMapView::sAvatarYouImage = NULL; -LLUIImagePtr LLWorldMapView::sAvatarYouLargeImage = NULL; -LLUIImagePtr LLWorldMapView::sAvatarLevelImage = NULL; -LLUIImagePtr LLWorldMapView::sAvatarAboveImage = NULL; -LLUIImagePtr LLWorldMapView::sAvatarBelowImage = NULL; -LLUIImagePtr LLWorldMapView::sAvatarUnknownImage = NULL; - -LLUIImagePtr LLWorldMapView::sTelehubImage = NULL; -LLUIImagePtr LLWorldMapView::sInfohubImage = NULL; -LLUIImagePtr LLWorldMapView::sHomeImage = NULL; -LLUIImagePtr LLWorldMapView::sEventImage = NULL; -LLUIImagePtr LLWorldMapView::sEventMatureImage = NULL; -LLUIImagePtr LLWorldMapView::sEventAdultImage = NULL; - -LLUIImagePtr LLWorldMapView::sTrackCircleImage = NULL; -LLUIImagePtr LLWorldMapView::sTrackArrowImage = NULL; - -LLUIImagePtr LLWorldMapView::sClassifiedsImage = NULL; -LLUIImagePtr LLWorldMapView::sForSaleImage = NULL; -LLUIImagePtr LLWorldMapView::sForSaleAdultImage = NULL; +LLUIImagePtr LLWorldMapView::sAvatarSmallImage = nullptr; +LLUIImagePtr LLWorldMapView::sAvatarYouImage = nullptr; +LLUIImagePtr LLWorldMapView::sAvatarYouLargeImage = nullptr; +LLUIImagePtr LLWorldMapView::sAvatarLevelImage = nullptr; +LLUIImagePtr LLWorldMapView::sAvatarAboveImage = nullptr; +LLUIImagePtr LLWorldMapView::sAvatarBelowImage = nullptr; +LLUIImagePtr LLWorldMapView::sAvatarUnknownImage = nullptr; + +LLUIImagePtr LLWorldMapView::sTelehubImage = nullptr; +LLUIImagePtr LLWorldMapView::sInfohubImage = nullptr; +LLUIImagePtr LLWorldMapView::sHomeImage = nullptr; +LLUIImagePtr LLWorldMapView::sEventImage = nullptr; +LLUIImagePtr LLWorldMapView::sEventMatureImage = nullptr; +LLUIImagePtr LLWorldMapView::sEventAdultImage = nullptr; + +LLUIImagePtr LLWorldMapView::sTrackCircleImage = nullptr; +LLUIImagePtr LLWorldMapView::sTrackArrowImage = nullptr; + +LLUIImagePtr LLWorldMapView::sClassifiedsImage = nullptr; +LLUIImagePtr LLWorldMapView::sForSaleImage = nullptr; +LLUIImagePtr LLWorldMapView::sForSaleAdultImage = nullptr; S32 LLWorldMapView::sTrackingArrowX = 0; S32 LLWorldMapView::sTrackingArrowY = 0; @@ -149,26 +149,26 @@ void LLWorldMapView::initClass() // static void LLWorldMapView::cleanupClass() { - sAvatarSmallImage = NULL; - sAvatarYouImage = NULL; - sAvatarYouLargeImage = NULL; - sAvatarLevelImage = NULL; - sAvatarAboveImage = NULL; - sAvatarBelowImage = NULL; - sAvatarUnknownImage = NULL; - - sTelehubImage = NULL; - sInfohubImage = NULL; - sHomeImage = NULL; - sEventImage = NULL; - sEventMatureImage = NULL; - sEventAdultImage = NULL; - - sTrackCircleImage = NULL; - sTrackArrowImage = NULL; - sClassifiedsImage = NULL; - sForSaleImage = NULL; - sForSaleAdultImage = NULL; + sAvatarSmallImage = nullptr; + sAvatarYouImage = nullptr; + sAvatarYouLargeImage = nullptr; + sAvatarLevelImage = nullptr; + sAvatarAboveImage = nullptr; + sAvatarBelowImage = nullptr; + sAvatarUnknownImage = nullptr; + + sTelehubImage = nullptr; + sInfohubImage = nullptr; + sHomeImage = nullptr; + sEventImage = nullptr; + sEventMatureImage = nullptr; + sEventAdultImage = nullptr; + + sTrackCircleImage = nullptr; + sTrackArrowImage = nullptr; + sClassifiedsImage = nullptr; + sForSaleImage = nullptr; + sForSaleAdultImage = nullptr; } LLWorldMapView::LLWorldMapView() : @@ -535,7 +535,7 @@ void LLWorldMapView::draw() LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, S32_MAX, //max_chars (S32)mMapScale, //max_pixels - NULL, + nullptr, /*use_ellipses*/true); } } @@ -718,7 +718,7 @@ bool LLWorldMapView::drawMipmapLevel(S32 width, S32 height, S32 level, bool load LLVector3d pos_global(index_x, index_y, pos_SW[VZ]); // Convert to the mipmap level coordinates for that point (i.e. which tile to we hit) LLWorldMipmap::globalToMipmap(pos_global[VX], pos_global[VY], level, &grid_x, &grid_y); - // Get the tile. Note: NULL means that the image does not exist (so it's considered "complete" as far as fetching is concerned) + // Get the tile. Note: nullptr means that the image does not exist (so it's considered "complete" as far as fetching is concerned) LLPointer simimage = LLWorldMap::getInstance()->getObjectsTile(grid_x, grid_y, level, load); if (simimage) { @@ -868,7 +868,7 @@ void LLWorldMapView::drawItems() { U64 handle = *iter; LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromHandle(handle); - if ((info == NULL) || (info->isDown())) + if ((info == nullptr) || (info->isDown())) { continue; } @@ -920,7 +920,7 @@ void LLWorldMapView::drawAgents() { U64 handle = *iter; LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromHandle(handle); - if ((siminfo == NULL) || (siminfo->isDown())) + if ((siminfo == nullptr) || (siminfo->isDown())) { continue; } @@ -1562,7 +1562,7 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, { U64 handle = *iter; LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromHandle(handle); - if ((siminfo == NULL) || (siminfo->isDown())) + if ((siminfo == nullptr) || (siminfo->isDown())) { continue; } @@ -1701,7 +1701,7 @@ bool LLWorldMapView::handleMouseUp( S32 x, S32 y, MASK mask ) handleClick(x, y, mask, &hit_type, &id); } gViewerWindow->showCursor(); - gFocusMgr.setMouseCapture( NULL ); + gFocusMgr.setMouseCapture( nullptr ); return true; } return false; @@ -1771,7 +1771,7 @@ bool LLWorldMapView::handleHover( S32 x, S32 y, MASK mask ) { // While we're waiting for data from the tracker, we're busy. JC LLVector3d pos_global = LLTracker::getTrackedPositionGlobal(); - if (LLTracker::isTracking(NULL) + if (LLTracker::isTracking(nullptr) && pos_global.isExactlyZero()) { gViewerWindow->setCursor( UI_CURSOR_WAIT ); @@ -1810,7 +1810,7 @@ bool LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask ) // Invoke the event details floater if someone is clicking on an event. LLSD params(LLSD::emptyArray()); params.append(event_id); - LLCommandDispatcher::dispatch("event", params, LLSD(), LLGridManager::getInstance()->getGrid(), NULL, LLCommandHandler::NAV_TYPE_CLICKED, true); + LLCommandDispatcher::dispatch("event", params, LLSD(), LLGridManager::getInstance()->getGrid(), nullptr, LLCommandHandler::NAV_TYPE_CLICKED, true); break; } case MAP_ITEM_LAND_FOR_SALE: diff --git a/indra/newview/llworldmipmap.cpp b/indra/newview/llworldmipmap.cpp index d8ea2b884f..892a7d61da 100644 --- a/indra/newview/llworldmipmap.cpp +++ b/indra/newview/llworldmipmap.cpp @@ -155,8 +155,8 @@ LLPointer LLWorldMipmap::getObjectsTile(U32 grid_x, U32 } else { - // Return with NULL if not found and we're not trying to load - return NULL; + // Return with nullptr if not found and we're not trying to load + return nullptr; } } @@ -164,8 +164,8 @@ LLPointer LLWorldMipmap::getObjectsTile(U32 grid_x, U32 LLPointer img = found->second; if (img->isMissingAsset()) { - // Return NULL if asset missing - return NULL; + // Return nullptr if asset missing + return nullptr; } else { diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index 758615a730..242b08844b 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -242,7 +242,7 @@ class Poller LLSD http_params = command.get("http_params"); mTransaction = std::make_unique(mUri, mMethod, request_params, http_params); - mPreviousStatus = mTransaction->status(NULL); + mPreviousStatus = mTransaction->status(nullptr); // Now ensure that we get regular callbacks to poll for completion. mBoundListener = diff --git a/indra/newview/noise.h b/indra/newview/noise.h index fe3292ab9e..88dc835769 100644 --- a/indra/newview/noise.h +++ b/indra/newview/noise.h @@ -344,7 +344,7 @@ static void init(void) } // reintroduce entropy - srand((unsigned int)time(NULL)); // Flawfinder: ignore + srand((unsigned int)time(nullptr)); // Flawfinder: ignore } #undef B diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 259ea0c84f..bb78fc57f2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -250,7 +250,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"); @@ -349,7 +349,7 @@ F32 LLPipeline::sDistortionWaterClipPlaneMargin = 1.0125f; // EventHost API LLPipeline listener. static LLPipelineListener sPipelineListener; -static LLCullResult* sCull = NULL; +static LLCullResult* sCull = nullptr; void validate_framebuffer_object(); @@ -399,7 +399,7 @@ LLPipeline::LLPipeline() : mMeshDirtyQueryObject(0), mGroupQ1Locked(false), mResetVertexBuffers(false), - mLastRebuildPool(NULL), + mLastRebuildPool(nullptr), mLightMask(0), mLightMovingMask(0) { @@ -672,28 +672,28 @@ void LLPipeline::cleanup() delete mAlphaPoolPostWater; mAlphaPoolPostWater = nullptr; delete mSkyPool; - mSkyPool = NULL; + mSkyPool = nullptr; delete mTerrainPool; - mTerrainPool = NULL; + mTerrainPool = nullptr; delete mWaterPool; - mWaterPool = NULL; + mWaterPool = 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; delete mWaterExclusionPool; mWaterExclusionPool = nullptr; releaseGLBuffers(); - mFaceSelectImagep = NULL; + mFaceSelectImagep = nullptr; mMovedList.clear(); mMovedBridge.clear(); @@ -701,10 +701,10 @@ void LLPipeline::cleanup() mInitialized = false; - mDeferredVB = NULL; + mDeferredVB = nullptr; mScreenTriangleVB = nullptr; - mCubeVB = NULL; + mCubeVB = nullptr; mReflectionMapManager.cleanup(); mHeroProbeManager.cleanup(); @@ -1653,7 +1653,7 @@ LLDrawPool *LLPipeline::findPool(const U32 type, LLViewerTexture *tex0) { assertInitialized(); - LLDrawPool *poolp = NULL; + LLDrawPool *poolp = nullptr; switch( type ) { case LLDrawPool::POOL_SIMPLE: @@ -1887,12 +1887,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; } } } @@ -1980,7 +1980,7 @@ void LLPipeline::createObject(LLViewerObject* vobj) } else { - vobj->setDrawableParent(NULL); // LLPipeline::addObject 2 + vobj->setDrawableParent(nullptr); // LLPipeline::addObject 2 } markRebuild(drawablep, LLDrawable::REBUILD_ALL); @@ -2021,7 +2021,7 @@ void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep) } if (!drawablep) { - LL_ERRS() << "updateMove called with NULL drawablep" << LL_ENDL; + LL_ERRS() << "updateMove called with nullptr drawablep" << LL_ENDL; return; } if (drawablep->isState(LLDrawable::EARLY_MOVE)) @@ -2052,7 +2052,7 @@ void LLPipeline::updateMoveNormalAsync(LLDrawable* drawablep) } if (!drawablep) { - LL_ERRS() << "updateMove called with NULL drawablep" << LL_ENDL; + LL_ERRS() << "updateMove called with nullptr drawablep" << LL_ENDL; return; } if (drawablep->isState(LLDrawable::EARLY_MOVE)) @@ -2221,7 +2221,7 @@ void LLPipeline::grabReferences(LLCullResult& result) void LLPipeline::clearReferences() { LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE; - sCull = NULL; + sCull = nullptr; mGroupSaveQ1.clear(); } @@ -3162,7 +3162,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD && !gCubeSnapshot) { - LLSpatialGroup* last_group = NULL; + LLSpatialGroup* last_group = nullptr; bool fov_changed = LLViewerCamera::getInstance()->isDefaultFOVChanged(); for (LLCullResult::bridge_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i) { @@ -3170,7 +3170,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) LLSpatialBridge* bridge = *cur_iter; LLSpatialGroup* group = bridge->getSpatialGroup(); - if (last_group == NULL) + if (last_group == nullptr) { last_group = group; } @@ -3291,7 +3291,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; @@ -3310,7 +3310,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); } } @@ -4057,7 +4057,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera, bool do_occlusion) { llassert(!gCubeSnapshot); // never do occlusion culling on cube snapshots occlude = false; - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); doOcclusion(camera); } @@ -4067,7 +4067,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera, bool do_occlusion) { LL_PROFILE_ZONE_NAMED_CATEGORY_DRAWPOOL("deferred pool render"); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); for( S32 i = 0; i < poolp->getNumDeferredPasses(); i++ ) @@ -4106,7 +4106,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera, bool do_occlusion) stop_glerror(); } - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.loadMatrix(gGLModelView); @@ -4203,7 +4203,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) { LL_PROFILE_ZONE_NAMED_CATEGORY_DRAWPOOL("deferred poolrender"); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); for( S32 i = 0; i < poolp->getNumPostDeferredPasses(); i++ ) @@ -4245,7 +4245,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) stop_glerror(); } - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.loadMatrix(gGLModelView); @@ -4287,7 +4287,7 @@ void LLPipeline::renderGeomShadow(LLCamera& camera) { poolp->prerender() ; - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); for( S32 i = 0; i < poolp->getNumShadowPasses(); i++ ) @@ -4324,7 +4324,7 @@ void LLPipeline::renderGeomShadow(LLCamera& camera) stop_glerror(); } - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); } @@ -4417,7 +4417,7 @@ void LLPipeline::renderDebug() { //Render any navmesh geometry LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance(); - if ( llPathingLibInstance != NULL ) + if ( llPathingLibInstance != nullptr ) { //character floater renderables @@ -4687,7 +4687,7 @@ void LLPipeline::renderDebug() } } - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); gGL.setColorMask(true, false); @@ -4811,7 +4811,7 @@ void LLPipeline::renderDebug() { LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("probe debug display"); - bindDeferredShader(gReflectionProbeDisplayProgram, NULL); + bindDeferredShader(gReflectionProbeDisplayProgram, nullptr); mScreenTriangleVB->setBuffer(); LLGLEnable blend(GL_BLEND); @@ -5054,7 +5054,7 @@ void LLPipeline::rebuildPools() removeFromQuickLookup( poolp ); if (poolp == mLastRebuildPool) { - mLastRebuildPool = NULL; + mLastRebuildPool = nullptr; } delete poolp; } @@ -5298,37 +5298,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: @@ -5355,12 +5355,12 @@ 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_PRE_WATER: @@ -5379,22 +5379,22 @@ 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_GLTF_PBR: llassert( poolp == mPBROpaquePool ); - mPBROpaquePool = NULL; + mPBROpaquePool = nullptr; break; case LLDrawPool::POOL_GLTF_PBR_ALPHA_MASK: llassert(poolp == mPBRAlphaMaskPool); - mPBRAlphaMaskPool = NULL; + mPBRAlphaMaskPool = nullptr; break; case LLDrawPool::POOL_WATEREXCLUSION: @@ -6526,7 +6526,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) @@ -6536,7 +6536,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, true, false, face_hit, &position, NULL, NULL, NULL); + LLDrawable* hit = part->lineSegmentIntersect(start, local_end, true, false, true, false, face_hit, &position, nullptr, nullptr, nullptr); if (hit) { drawable = hit; @@ -6545,7 +6545,7 @@ LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector4a& start, } } - LLVOPartGroup* ret = NULL; + LLVOPartGroup* ret = nullptr; if (drawable) { //make sure we're returning an LLVOPartGroup @@ -6575,7 +6575,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; @@ -6734,7 +6734,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, *intersection = position; } - return drawable ? drawable->getVObj().get() : NULL; + return drawable ? drawable->getVObj().get() : nullptr; } LLViewerObject* LLPipeline::lineSegmentIntersectInHUD(const LLVector4a& start, const LLVector4a& end, @@ -6746,7 +6746,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) @@ -6775,7 +6775,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInHUD(const LLVector4a& start, c toggleRenderType(LLPipeline::RENDER_TYPE_HUD); } } - return drawable ? drawable->getVObj().get() : NULL; + return drawable ? drawable->getVObj().get() : nullptr; } LLSpatialPartition* LLPipeline::getSpatialPartition(LLViewerObject* vobj) @@ -6788,7 +6788,7 @@ LLSpatialPartition* LLPipeline::getSpatialPartition(LLViewerObject* vobj) return region->getSpatialPartition(vobj->getPartitionType()); } } - return NULL; + return nullptr; } void LLPipeline::resetVertexBuffers(LLDrawable* drawable) @@ -6812,7 +6812,7 @@ void LLPipeline::renderObjects(U32 type, bool texture, bool batch_texture, bool { assertInitialized(); gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; if (rigged) { @@ -6824,14 +6824,14 @@ void LLPipeline::renderObjects(U32 type, bool texture, bool batch_texture, bool } gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; } void LLPipeline::renderGLTFObjects(U32 type, bool texture, bool rigged) { assertInitialized(); gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; if (rigged) { @@ -6843,7 +6843,7 @@ void LLPipeline::renderGLTFObjects(U32 type, bool texture, bool rigged) } gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; if (!rigged) { @@ -6861,7 +6861,7 @@ void LLPipeline::renderAlphaObjects(bool rigged) LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE; assertInitialized(); gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; S32 sun_up = LLEnvironment::instance().getIsSunUp() ? 1 : 0; U32 target_width = LLRenderTarget::sCurResX; U32 type = LLRenderPass::PASS_ALPHA; @@ -6932,7 +6932,7 @@ void LLPipeline::renderAlphaObjects(bool rigged) } gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; } // Currently only used for shadows -Cosmic,2023-04-19 @@ -6940,7 +6940,7 @@ void LLPipeline::renderMaskedObjects(U32 type, bool texture, bool batch_texture, { assertInitialized(); gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; if (rigged) { mAlphaMaskPool->pushRiggedMaskBatches(type+1, texture, batch_texture); @@ -6950,7 +6950,7 @@ void LLPipeline::renderMaskedObjects(U32 type, bool texture, bool batch_texture, mAlphaMaskPool->pushMaskBatches(type, texture, batch_texture); } gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; } // Currently only used for shadows -Cosmic,2023-04-19 @@ -6958,7 +6958,7 @@ void LLPipeline::renderFullbrightMaskedObjects(U32 type, bool texture, bool batc { assertInitialized(); gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; if (rigged) { mFullbrightAlphaMaskPool->pushRiggedMaskBatches(type+1, texture, batch_texture); @@ -6968,7 +6968,7 @@ void LLPipeline::renderFullbrightMaskedObjects(U32 type, bool texture, bool batc mFullbrightAlphaMaskPool->pushMaskBatches(type, texture, batch_texture); } gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; } void apply_cube_face_rotation(U32 face) @@ -8341,7 +8341,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_ channel = shader.enableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP); if (channel > -1) { - LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL; + LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : nullptr; if (cube_map) { cube_map->enable(channel); @@ -8647,7 +8647,7 @@ void LLPipeline::renderDeferredLighting() { for (U32 i = 0; i < 2; i++) { - mTargetShadowSpotLight[i] = NULL; + mTargetShadowSpotLight[i] = nullptr; } } @@ -9076,7 +9076,7 @@ void LLPipeline::doWaterHaze() LLGLDepthTest depth(GL_TRUE, GL_FALSE); LLGLDisable cull(GL_CULL_FACE); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); if (mWaterPool) @@ -9226,7 +9226,7 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep) LLViewerTexture* img = volume->getLightTexture(); - if (img == NULL) + if (img == nullptr) { img = LLViewerFetchedTexture::sWhiteImagep; } @@ -9290,7 +9290,7 @@ void LLPipeline::unbindDeferredShader(LLGLSLShader &shader) S32 channel = shader.disableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP); if (channel > -1) { - LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL; + LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : nullptr; if (cube_map) { cube_map->disable(); @@ -9506,7 +9506,7 @@ void LLPipeline::renderShadow(const glm::mat4& view, const glm::mat4& proj, LLCa gGL.loadMatrix(glm::value_ptr(view)); stop_glerror(); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -9626,7 +9626,7 @@ void LLPipeline::renderShadow(const glm::mat4& view, const glm::mat4& proj, LLCa LLGLSLShader::sCurBoundShaderPtr->uniform1f(LLShaderMgr::DEFERRED_SHADOW_TARGET_WIDTH, (float)target_width); gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; U32 type = LLRenderPass::PASS_GLTF_PBR_ALPHA_MASK; @@ -9640,12 +9640,12 @@ void LLPipeline::renderShadow(const glm::mat4& view, const glm::mat4& proj, LLCa } gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; } } gDeferredShadowCubeProgram.bind(); - gGLLastMatrix = NULL; + gGLLastMatrix = nullptr; gGL.loadMatrix(gGLModelView); gGL.setColorMask(true, true); @@ -9654,7 +9654,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; // reset occlusion culling flag sUseOcclusion = saved_occlusion; @@ -10554,7 +10554,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) if (!volume) { - mShadowSpotLight[i] = NULL; + mShadowSpotLight[i] = nullptr; continue; } @@ -10644,7 +10644,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) } else { //no spotlight shadows - mShadowSpotLight[0] = mShadowSpotLight[1] = NULL; + mShadowSpotLight[0] = mShadowSpotLight[1] = nullptr; } @@ -11364,7 +11364,7 @@ void LLPipeline::restorePermanentObjects( const std::vector& 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 c051306385..44a886a4de 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -172,12 +172,12 @@ class LLPipeline bool isInit() { return mInitialized; }; /// @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); + /// @return Draw pool, or nullptr if not found. + 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); @@ -216,10 +216,10 @@ class LLPipeline S32* face_hit, // return the face hit S32* gltf_node_hit = nullptr, // return the gltf node hit S32* gltf_primitive_hit = nullptr, // return the gltf primitive 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 @@ -230,10 +230,10 @@ class LLPipeline 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. diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp index 6f5b3a9721..1598588766 100644 --- a/indra/newview/tests/llagentaccess_test.cpp +++ b/indra/newview/tests/llagentaccess_test.cpp @@ -52,7 +52,7 @@ LLControlGroup::~LLControlGroup() LLControlVariable* LLControlGroup::declareU32(const std::string& name, U32 initial_val, const std::string& comment, LLControlVariable::ePersist persist) { test_preferred_maturity = initial_val; - return NULL; + return nullptr; } void LLControlGroup::setU32(std::string_view name, U32 val) diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index b82a58163c..6282d931bc 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -125,12 +125,12 @@ LLNotificationPtr LLNotificationsUtil::add(const std::string& name, const LLSD& payload, std::function functor) { - return LLNotificationPtr((LLNotification*)NULL); + return LLNotificationPtr((LLNotification*)nullptr); } LLNotificationPtr LLNotificationsUtil::add(const std::string& name, const LLSD& args) { - return LLNotificationPtr((LLNotification*)NULL); + return LLNotificationPtr((LLNotification*)nullptr); } //----------------------------------------------------------------------------- @@ -205,8 +205,8 @@ F32 LLControlGroup::getF32(std::string_view name) { return 0.0f; } U32 LLControlGroup::saveToFile(const std::string& filename, bool nondefault_only) { return 1; } void LLControlGroup::setString(std::string_view name, const std::string& val) {} std::string LLControlGroup::getString(std::string_view name) { return "test_string"; } -LLControlVariable* LLControlGroup::declareBOOL(const std::string& name, bool initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return NULL; } -LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string &initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return NULL; } +LLControlVariable* LLControlGroup::declareBOOL(const std::string& name, bool initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return nullptr; } +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string &initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return nullptr; } #include "lluicolortable.h" void LLUIColorTable::saveUserSettings(void)const {} @@ -231,7 +231,7 @@ LLAppViewer * LLAppViewer::sInstance = 0; #include "llnotifications.h" #include "llfloaterreg.h" static std::string gTOSType; -static LLEventPump * gTOSReplyPump = NULL; +static LLEventPump * gTOSReplyPump = nullptr; LLPointer gSecAPIHandler; @@ -240,7 +240,7 @@ LLFloater* LLFloaterReg::showInstance(std::string_view name, const LLSD& key, bo { gTOSType = name; gTOSReplyPump = &LLEventPumps::instance().obtain(key["reply_pump"]); - return NULL; + return nullptr; } //---------------------------------------------------------------------------- @@ -273,7 +273,7 @@ class MockNotifications : public LLNotificationsInterface { mResponder = functor; mAddedCount++; - return LLNotificationPtr((LLNotification*)NULL); + return LLNotificationPtr((LLNotification*)nullptr); } void sendYesResponse() diff --git a/indra/newview/tests/llmediadataclient_test.cpp b/indra/newview/tests/llmediadataclient_test.cpp index f741eb47f6..c360a18916 100644 --- a/indra/newview/tests/llmediadataclient_test.cpp +++ b/indra/newview/tests/llmediadataclient_test.cpp @@ -104,7 +104,7 @@ const char *DATA = _DATA(VALID_OBJECT_ID,"1.0","true"); "==================================== TEST " #N " ===================================\n" << \ "================================================================================\n" << LL_ENDL; -LLSD *gPostRecords = NULL; +LLSD *gPostRecords = nullptr; F64 gMinimumInterestLevel = (F64)0.0; #if 0 // stubs: diff --git a/indra/newview/tests/llremoteparcelrequest_test.cpp b/indra/newview/tests/llremoteparcelrequest_test.cpp index c8fa2fbd6f..b051e81e78 100644 --- a/indra/newview/tests/llremoteparcelrequest_test.cpp +++ b/indra/newview/tests/llremoteparcelrequest_test.cpp @@ -67,7 +67,7 @@ LLPounceable gMessageSystem; char const* const _PREHASH_AgentID = 0; // never dereferenced during this test char const* const _PREHASH_AgentData = 0; // never dereferenced during this test LLAgent gAgent; -LLAgent::LLAgent() : mAgentAccess(NULL) { } +LLAgent::LLAgent() : mAgentAccess(nullptr) { } LLAgent::~LLAgent() { } void LLAgent::sendReliableMessage(void) { } LLUUID gAgentSessionID; @@ -115,7 +115,7 @@ namespace tut LLRemoteParcelInfoProcessor & processor = LLRemoteParcelInfoProcessor::instance(); processor.addObserver(LLUUID(TEST_PARCEL_ID), observer.get()); - processor.processParcelInfoReply(gMessageSystem, NULL); + processor.processParcelInfoReply(gMessageSystem, nullptr); ensure(observer->mProcessed); } @@ -131,9 +131,9 @@ namespace tut processor.addObserver(LLUUID(TEST_PARCEL_ID), observer); delete observer; - observer = NULL; + observer = nullptr; - processor.processParcelInfoReply(gMessageSystem, NULL); + processor.processParcelInfoReply(gMessageSystem, nullptr); } } #endif diff --git a/indra/newview/tests/llsecapi_test.cpp b/indra/newview/tests/llsecapi_test.cpp index 1a2fa7d8f6..787ba3aa83 100644 --- a/indra/newview/tests/llsecapi_test.cpp +++ b/indra/newview/tests/llsecapi_test.cpp @@ -42,7 +42,7 @@ LLControlGroup::~LLControlGroup() {} LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - LLControlVariable::ePersist persist) {return NULL;} + LLControlVariable::ePersist persist) {return nullptr;} void LLControlGroup::setString(std::string_view name, const std::string& val){} std::string LLControlGroup::getString(std::string_view name) { @@ -55,24 +55,24 @@ LLControlGroup gSavedSettings("test"); LLSecAPIBasicHandler::LLSecAPIBasicHandler() {} void LLSecAPIBasicHandler::init() {} LLSecAPIBasicHandler::~LLSecAPIBasicHandler() {} -LLPointer LLSecAPIBasicHandler::getCertificate(const std::string& pem_cert) { return NULL; } -LLPointer LLSecAPIBasicHandler::getCertificate(X509* openssl_cert) { return NULL; } -LLPointer LLSecAPIBasicHandler::getCertificateChain(X509_STORE_CTX* chain) { return NULL; } -LLPointer LLSecAPIBasicHandler::getCertificateStore(const std::string& store_id) { return NULL; } +LLPointer LLSecAPIBasicHandler::getCertificate(const std::string& pem_cert) { return nullptr; } +LLPointer LLSecAPIBasicHandler::getCertificate(X509* openssl_cert) { return nullptr; } +LLPointer LLSecAPIBasicHandler::getCertificateChain(X509_STORE_CTX* chain) { return nullptr; } +LLPointer LLSecAPIBasicHandler::getCertificateStore(const std::string& store_id) { return nullptr; } void LLSecAPIBasicHandler::setProtectedData(const std::string& data_type, const std::string& data_id, const LLSD& data) {} void LLSecAPIBasicHandler::addToProtectedMap(const std::string& data_type, const std::string& data_id, const std::string& map_elem, const LLSD& data) {} void LLSecAPIBasicHandler::removeFromProtectedMap(const std::string& data_type, const std::string& data_id, const std::string& map_elem) {} void LLSecAPIBasicHandler::syncProtectedMap() {} LLSD LLSecAPIBasicHandler::getProtectedData(const std::string& data_type, const std::string& data_id) { return LLSD(); } void LLSecAPIBasicHandler::deleteProtectedData(const std::string& data_type, const std::string& data_id) {} -LLPointer LLSecAPIBasicHandler::createCredential(const std::string& grid, const LLSD& identifier, const LLSD& authenticator) { return NULL; } -LLPointer LLSecAPIBasicHandler::loadCredential(const std::string& grid) { return NULL; } +LLPointer LLSecAPIBasicHandler::createCredential(const std::string& grid, const LLSD& identifier, const LLSD& authenticator) { return nullptr; } +LLPointer LLSecAPIBasicHandler::loadCredential(const std::string& grid) { return nullptr; } void LLSecAPIBasicHandler::saveCredential(LLPointer cred, bool save_authenticator) {} void LLSecAPIBasicHandler::deleteCredential(LLPointer cred) {} bool LLSecAPIBasicHandler::hasCredentialMap(const std::string& storage, const std::string& grid) { return false; } bool LLSecAPIBasicHandler::emptyCredentialMap(const std::string& storage, const std::string& grid) { return false; } void LLSecAPIBasicHandler::loadCredentialMap(const std::string& storage, const std::string& grid, credential_map_t& credential_map) {} -LLPointer LLSecAPIBasicHandler::loadFromCredentialMap(const std::string& storage, const std::string& grid, const std::string& userkey) { return NULL; } +LLPointer LLSecAPIBasicHandler::loadFromCredentialMap(const std::string& storage, const std::string& grid, const std::string& userkey) { return nullptr; } void LLSecAPIBasicHandler::addToCredentialMap(const std::string& storage, LLPointer cred, bool save_authenticator) {} void LLSecAPIBasicHandler::removeFromCredentialMap(const std::string& storage, LLPointer cred) {} void LLSecAPIBasicHandler::removeFromCredentialMap(const std::string& storage, const std::string& grid, const std::string& userkey) {} diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp index acbadbc85a..1e3b0ed3ab 100644 --- a/indra/newview/tests/llsechandler_basic_test.cpp +++ b/indra/newview/tests/llsechandler_basic_test.cpp @@ -77,7 +77,7 @@ LLControlGroup::~LLControlGroup() {} LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - LLControlVariable::ePersist persist) {return NULL;} + LLControlVariable::ePersist persist) {return nullptr;} void LLControlGroup::setString(std::string_view name, const std::string& val){} std::string LLControlGroup::getString(std::string_view name) { @@ -648,27 +648,27 @@ namespace tut LLFile::remove("test_password.dat"); LLFile::remove("sechandler_settings.tmp"); - mX509TestCert = NULL; - mX509RootCert = NULL; - mX509IntermediateCert = NULL; - mX509ChildCert = NULL; + mX509TestCert = nullptr; + mX509RootCert = nullptr; + mX509IntermediateCert = nullptr; + mX509ChildCert = nullptr; // Read each of the 4 Pem certs and store in mX509*Cert pointers BIO * validation_bio; validation_bio = BIO_new_mem_buf((void*)mPemTestCert.c_str(), static_cast(mPemTestCert.length())); - PEM_read_bio_X509(validation_bio, &mX509TestCert, 0, NULL); + PEM_read_bio_X509(validation_bio, &mX509TestCert, 0, nullptr); BIO_free(validation_bio); validation_bio = BIO_new_mem_buf((void*)mPemRootCert.c_str(), static_cast(mPemRootCert.length())); - PEM_read_bio_X509(validation_bio, &mX509RootCert, 0, NULL); + PEM_read_bio_X509(validation_bio, &mX509RootCert, 0, nullptr); BIO_free(validation_bio); validation_bio = BIO_new_mem_buf((void*)mPemIntermediateCert.c_str(), static_cast(mPemIntermediateCert.length())); - PEM_read_bio_X509(validation_bio, &mX509IntermediateCert, 0, NULL); + PEM_read_bio_X509(validation_bio, &mX509IntermediateCert, 0, nullptr); BIO_free(validation_bio); validation_bio = BIO_new_mem_buf((void*)mPemChildCert.c_str(), static_cast(mPemChildCert.length())); - PEM_read_bio_X509(validation_bio, &mX509ChildCert, 0, NULL); + PEM_read_bio_X509(validation_bio, &mX509ChildCert, 0, nullptr); BIO_free(validation_bio); } ~sechandler_basic_test() @@ -835,7 +835,7 @@ namespace tut ensure("not found", data.isUndefined()); // cause a 'write' by using 'LLPointer' to delete then instantiate a handler - handler = NULL; + handler = nullptr; handler = new LLSecAPIBasicHandler("sechandler_settings.tmp", "test_password.dat"); handler->init(); @@ -845,7 +845,7 @@ namespace tut ensure_equals("verify datatype stored data5a", (std::string)data["store_data5"]["subelem2"], "test_subelem2"); // rewrite the initial file to verify reloads - handler = NULL; + handler = nullptr; llofstream temp_file2("sechandler_settings.tmp", std::ofstream::binary); temp_file2.write((const char *)&binary_data[0], binary_data.size()); temp_file2.close(); @@ -864,7 +864,7 @@ namespace tut handler->init(); data = handler->getProtectedData("test_data_type1", "test_data_id"); ensure("not found", data.isUndefined()); - handler = NULL; + handler = nullptr; ensure(LLFile::isfile("sechandler_settings.tmp")); } @@ -1085,10 +1085,10 @@ namespace tut // validate load with empty file test_store->save(); - test_store = NULL; + test_store = nullptr; test_store = new LLBasicCertificateStore("mycertstore.pem"); ensure_equals("when loading with nothing, we should result in no certs in store", test_store->size(), 0); - test_store=NULL; + test_store=nullptr; // instantiate a cert store from a file llofstream certstorefile("mycertstore.pem", std::ios::out); @@ -1111,7 +1111,7 @@ namespace tut // validate save LLFile::remove("mycertstore.pem"); test_store->save(); - test_store = NULL; + test_store = nullptr; test_store = new LLBasicCertificateStore("mycertstore.pem"); ensure_equals("two elements in store after save", test_store->size(), 2); LLCertificateStore::iterator current_cert = test_store->begin(); @@ -1236,13 +1236,13 @@ namespace tut void sechandler_basic_test_object::test<8>() { // validate create from empty chain - LLPointer test_chain = new LLBasicCertificateChain(NULL); + LLPointer test_chain = new LLBasicCertificateChain(nullptr); ensure_equals("when loading with nothing, we should result in no certs in chain", test_chain->size(), 0); // Single cert in the chain. X509_STORE_CTX *test_store = X509_STORE_CTX_new(); X509_STORE_CTX_set_cert(test_store, mX509ChildCert); - X509_STORE_CTX_set0_untrusted(test_store, NULL); + X509_STORE_CTX_set0_untrusted(test_store, nullptr); test_chain = new LLBasicCertificateChain(test_store); X509_STORE_CTX_free(test_store); ensure_equals("two elements in store [1]", test_chain->size(), 1); @@ -1327,7 +1327,7 @@ namespace tut LLSD validation_params; // validate basic trust for a chain containing only the intermediate cert. (1 deep) - LLPointer test_chain = new LLBasicCertificateChain(NULL); + LLPointer test_chain = new LLBasicCertificateChain(nullptr); test_chain->add(new LLBasicCertificate(mX509IntermediateCert, &mValidationDate)); @@ -1342,7 +1342,7 @@ namespace tut test_store->validate(0, test_chain, validation_params); // basic failure cases - test_chain = new LLBasicCertificateChain(NULL); + test_chain = new LLBasicCertificateChain(nullptr); //validate with only the child cert in chain, but child cert was previously // trusted test_chain->add(new LLBasicCertificate(mX509ChildCert, &mValidationDate)); @@ -1413,13 +1413,13 @@ namespace tut // test SSL KU // validate basic trust for a chain containing child and intermediate. - test_chain = new LLBasicCertificateChain(NULL); + test_chain = new LLBasicCertificateChain(nullptr); test_chain->add(new LLBasicCertificate(mX509ChildCert, &mValidationDate)); test_chain->add(new LLBasicCertificate(mX509IntermediateCert, &mValidationDate)); test_store->validate(VALIDATION_POLICY_SSL_KU | VALIDATION_POLICY_TRUSTED, test_chain, validation_params); - test_chain = new LLBasicCertificateChain(NULL); + test_chain = new LLBasicCertificateChain(nullptr); test_chain->add(new LLBasicCertificate(mX509TestCert, &mValidationDate)); test_store = new LLBasicCertificateStore("mycertstore.pem"); diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp index 3ff38ea372..b4bec58843 100644 --- a/indra/newview/tests/llslurl_test.cpp +++ b/indra/newview/tests/llslurl_test.cpp @@ -63,7 +63,7 @@ LLControlGroup::~LLControlGroup() {} LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - LLControlVariable::ePersist persist) {return NULL;} + LLControlVariable::ePersist persist) {return nullptr;} void LLControlGroup::setString(std::string_view name, const std::string& val){} std::string gCmdLineLoginURI; diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index 10c68432a1..8628722d3c 100644 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -248,7 +248,7 @@ namespace tut ~tst_viewerassetstats_index() { - LLTrace::set_master_thread_recorder(NULL); + LLTrace::set_master_thread_recorder(nullptr); } LLTrace::ThreadRecorder mThreadRecorder; @@ -262,7 +262,7 @@ namespace tut void tst_viewerassetstats_index_object_t::test<1>() { // Check that helpers aren't bothered by missing global stats - ensure("Global gViewerAssetStats should be NULL", (NULL == gViewerAssetStats)); + ensure("Global gViewerAssetStats should be NULL", (nullptr == gViewerAssetStats)); LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_TEXTURE, false, false); @@ -275,15 +275,15 @@ namespace tut template<> template<> void tst_viewerassetstats_index_object_t::test<2>() { - ensure("Global gViewerAssetStats should be NULL", (NULL == gViewerAssetStats)); + ensure("Global gViewerAssetStats should be NULL", (nullptr == gViewerAssetStats)); LLViewerAssetStats * it = new LLViewerAssetStats(); - ensure("Global gViewerAssetStats should still be NULL", (NULL == gViewerAssetStats)); + ensure("Global gViewerAssetStats should still be NULL", (nullptr == gViewerAssetStats)); LLSD sd_full = it->asLLSD(false); - // Default (NULL) region ID doesn't produce LLSD results so should + // Default (nullptr) region ID doesn't produce LLSD results so should // get an empty map back from output ensure("Stat-less LLSD initially", is_no_stats_map(sd_full)); @@ -373,7 +373,7 @@ namespace tut sd = gViewerAssetStats->asLLSD(false)["regions"][region1_handle_str]; delete gViewerAssetStats; - gViewerAssetStats = NULL; + gViewerAssetStats = nullptr; ensure("sd[get_texture_non_temp_udp][enqueued] is reset", (0 == sd["get_texture_non_temp_udp"]["enqueued"].asInteger())); ensure("sd[get_gesture_udp][dequeued] is reset", (0 == sd["get_gesture_udp"]["dequeued"].asInteger())); @@ -432,7 +432,7 @@ namespace tut sd2 = sd["regions"][0]; delete gViewerAssetStats; - gViewerAssetStats = NULL; + gViewerAssetStats = nullptr; ensure("sd2[get_texture_non_temp_udp][enqueued] is reset", (0 == sd2["get_texture_non_temp_udp"]["enqueued"].asInteger())); ensure("sd2[get_gesture_udp][enqueued] is reset", (0 == sd2["get_gesture_udp"]["enqueued"].asInteger())); @@ -505,7 +505,7 @@ namespace tut ensure("Region2 is present in results", sd2.isMap()); delete gViewerAssetStats; - gViewerAssetStats = NULL; + gViewerAssetStats = nullptr; ensure_equals("sd2[get_texture_non_temp_udp][enqueued] is reset", sd2["get_texture_non_temp_udp"]["enqueued"].asInteger(), 0); ensure_equals("sd2[get_gesture_udp][enqueued] is reset", sd2["get_gesture_udp"]["enqueued"].asInteger(), 0); @@ -570,7 +570,7 @@ namespace tut ensure("Region1 is present in results", sd.isMap()); delete gViewerAssetStats; - gViewerAssetStats = NULL; + gViewerAssetStats = nullptr; ensure_equals("sd[get_texture_non_temp_udp][enqueued] is reset", sd["get_texture_non_temp_udp"]["enqueued"].asInteger(), 0); ensure_equals("sd[get_gesture_udp][dequeued] is reset", sd["get_gesture_udp"]["dequeued"].asInteger(), 0); diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp index 9ee6625bf1..3d4b7dc92d 100644 --- a/indra/newview/tests/llviewerhelputil_test.cpp +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -52,7 +52,7 @@ LLControlGroup::~LLControlGroup() {} LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - LLControlVariable::ePersist persist) {return NULL;} + LLControlVariable::ePersist persist) {return nullptr;} void LLControlGroup::setString(std::string_view name, const std::string& val){} std::string LLControlGroup::getString(std::string_view name) { @@ -73,7 +73,7 @@ static void substitute_string(std::string &input, const std::string &search, con } #include "../llagent.h" -LLAgent::LLAgent() : mAgentAccess(NULL) { } +LLAgent::LLAgent() : mAgentAccess(nullptr) { } LLAgent::~LLAgent() { } bool LLAgent::isGodlike() const { return false; } diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index 94cf0fcf10..03f330d86c 100644 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -72,7 +72,7 @@ LLControlGroup::~LLControlGroup() {} LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - LLControlVariable::ePersist persist) {return NULL;} + LLControlVariable::ePersist persist) {return nullptr;} void LLControlGroup::setString(std::string_view name, const std::string& val){} std::string gCmdLineLoginURI; diff --git a/indra/newview/tests/llviewershadermgr_stub.cpp b/indra/newview/tests/llviewershadermgr_stub.cpp index 5d6cb33019..a833205299 100644 --- a/indra/newview/tests/llviewershadermgr_stub.cpp +++ b/indra/newview/tests/llviewershadermgr_stub.cpp @@ -32,10 +32,10 @@ LLShaderMgr::~LLShaderMgr() {} LLViewerShaderMgr::LLViewerShaderMgr() {} LLViewerShaderMgr::~LLViewerShaderMgr() {} -LLViewerShaderMgr* stub_instance = NULL; +LLViewerShaderMgr* stub_instance = nullptr; LLViewerShaderMgr* LLViewerShaderMgr::instance() { - if(NULL == stub_instance) + if(nullptr == stub_instance) { stub_instance = new LLViewerShaderMgr(); } diff --git a/indra/newview/tests/llworldmap_test.cpp b/indra/newview/tests/llworldmap_test.cpp index 60172b3960..a89e050e4e 100644 --- a/indra/newview/tests/llworldmap_test.cpp +++ b/indra/newview/tests/llworldmap_test.cpp @@ -51,7 +51,7 @@ void LLGLTexture::setBoostLevel(S32 ) { } void LLGLTexture::setAddressMode(LLTexUnit::eTextureAddressMode ) { } LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTexture(const LLUUID&, FTType, bool, LLGLTexture::EBoostLevel, S8, - LLGLint, LLGLenum, LLHost ) { return NULL; } + LLGLint, LLGLenum, LLHost ) { return nullptr; } // Stub related map calls LLWorldMapMessage::LLWorldMapMessage() { } @@ -64,7 +64,7 @@ LLWorldMipmap::~LLWorldMipmap() { } void LLWorldMipmap::reset() { } void LLWorldMipmap::dropBoostLevels() { } void LLWorldMipmap::equalizeBoostLevels() { } -LLPointer LLWorldMipmap::getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load) { return NULL; } +LLPointer LLWorldMipmap::getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load) { return nullptr; } // Stub other stuff std::string LLTrans::getString(std::string_view, const LLStringUtil::format_map_t&, bool def_string) { return std::string("test_trans"); } @@ -141,7 +141,7 @@ namespace tut } ~worldmap_test() { - mWorld = NULL; + mWorld = nullptr; } }; @@ -436,23 +436,23 @@ namespace tut 0.0f); LLSimInfo* sim; sim = mWorld->simInfoFromPosGlobal(pos1); - ensure("LLWorldMap::simInfoFromPosGlobal() test on existing region failed", sim != NULL); + ensure("LLWorldMap::simInfoFromPosGlobal() test on existing region failed", sim != nullptr); // Test 14 : simInfoFromPosGlobal() outside region LLVector3d pos2( X_WORLD_TEST + REGION_WIDTH_METERS*4 + REGION_WIDTH_METERS/2, Y_WORLD_TEST + REGION_WIDTH_METERS*4 + REGION_WIDTH_METERS/2, 0.0f); sim = mWorld->simInfoFromPosGlobal(pos2); - ensure("LLWorldMap::simInfoFromPosGlobal() test outside region failed", sim == NULL); + ensure("LLWorldMap::simInfoFromPosGlobal() test outside region failed", sim == nullptr); // Test 15 : simInfoFromName() sim = mWorld->simInfoFromName(name_sim); - ensure("LLWorldMap::simInfoFromName() test on existing region failed", sim != NULL); + ensure("LLWorldMap::simInfoFromName() test on existing region failed", sim != nullptr); // Test 16 : simInfoFromHandle() U64 handle = to_region_handle_global(X_WORLD_TEST, Y_WORLD_TEST); sim = mWorld->simInfoFromHandle(handle); - ensure("LLWorldMap::simInfoFromHandle() test on existing region failed", sim != NULL); + ensure("LLWorldMap::simInfoFromHandle() test on existing region failed", sim != nullptr); // Test 17 : simNameFromPosGlobal() LLVector3d pos3( X_WORLD_TEST + REGION_WIDTH_METERS/2, diff --git a/indra/newview/tests/llworldmipmap_test.cpp b/indra/newview/tests/llworldmipmap_test.cpp index 0a5de18e0f..6e6e487236 100644 --- a/indra/newview/tests/llworldmipmap_test.cpp +++ b/indra/newview/tests/llworldmipmap_test.cpp @@ -44,7 +44,7 @@ void LLGLTexture::setBoostLevel(S32 ) { } LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromUrl(const std::string&, FTType, bool, LLGLTexture::EBoostLevel, S8, - LLGLint, LLGLenum, const LLUUID& ) { return NULL; } + LLGLint, LLGLenum, const LLUUID& ) { return nullptr; } LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) { } LLControlGroup::~LLControlGroup() { }