From 9e854b697a06abed2a0917fb6120445f176764f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Fri, 16 Feb 2024 19:29:51 +0100 Subject: misc: BOOL to bool --- indra/llinventory/llparcel.cpp | 58 ++++++++++++------------- indra/llinventory/llparcel.h | 64 +++++++++++++-------------- indra/llinventory/llpermissions.cpp | 87 ++++++++++++++++++------------------- indra/llinventory/llpermissions.h | 26 +++++------ 4 files changed, 116 insertions(+), 119 deletions(-) (limited to 'indra/llinventory') diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index aa9d9572be..78dcf40ac6 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -124,10 +124,10 @@ LLParcel::LLParcel() LLParcel::LLParcel(const LLUUID &owner_id, - BOOL modify, BOOL terraform, BOOL damage, + bool modify, bool terraform, bool damage, time_t claim_date, S32 claim_price_per_meter, S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, - BOOL is_group_owned) + bool is_group_owned) { init( owner_id, modify, terraform, damage, claim_date, claim_price_per_meter, rent_price_per_meter, area, sim_object_limit, parcel_object_bonus, @@ -142,10 +142,10 @@ LLParcel::~LLParcel() } void LLParcel::init(const LLUUID &owner_id, - BOOL modify, BOOL terraform, BOOL damage, + bool modify, bool terraform, bool damage, time_t claim_date, S32 claim_price_per_meter, S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, - BOOL is_group_owned) + bool is_group_owned) { mID.setNull(); mOwnerID = owner_id; @@ -172,7 +172,7 @@ void LLParcel::init(const LLUUID &owner_id, mSaleTimerExpires.stop(); mGraceExtension = 0; //mExpireAction = STEA_REVERT; - //mRecordTransaction = FALSE; + //mRecordTransaction = false; mAuctionID = 0; mInEscrow = false; @@ -238,7 +238,7 @@ void LLParcel::init(const LLUUID &owner_id, setObscureMOAP(false); } -void LLParcel::overrideOwner(const LLUUID& owner_id, BOOL is_group_owned) +void LLParcel::overrideOwner(const LLUUID& owner_id, bool is_group_owned) { // Override with system permission (LLUUID::null) // Overridden parcels have no group @@ -352,7 +352,7 @@ void LLParcel::setAllParcelFlags(U32 flags) mParcelFlags = flags; } -void LLParcel::setParcelFlag(U32 flag, BOOL b) +void LLParcel::setParcelFlag(U32 flag, bool b) { if (b) { @@ -365,7 +365,7 @@ void LLParcel::setParcelFlag(U32 flag, BOOL b) } -BOOL LLParcel::allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) const +bool LLParcel::allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) const { if (agent_id == LLUUID::null) { @@ -394,7 +394,7 @@ BOOL LLParcel::allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) con return false; } -BOOL LLParcel::allowTerraformBy(const LLUUID &agent_id) const +bool LLParcel::allowTerraformBy(const LLUUID &agent_id) const { if (agent_id == LLUUID::null) { @@ -441,7 +441,7 @@ void LLParcel::setDiscountRate(F32 rate) // File input and output //----------------------------------------------------------- -BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entry) +bool LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entry) { skip_to_end_of_next_keyword("{", input_stream); while (input_stream.good()) @@ -561,9 +561,9 @@ void LLParcel::unpackMessage(LLMessageSystem* msg) msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, buffer ); setMediaURL(buffer); - BOOL see_avs = TRUE; // All default to true for legacy server behavior - BOOL any_av_sounds = TRUE; - BOOL group_av_sounds = TRUE; + bool see_avs = true; // All default to true for legacy server behavior + bool any_av_sounds = true; + bool group_av_sounds = true; bool have_new_parcel_limit_data = (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_SeeAVs) > 0); // New version of server should send all 3 of these values have_new_parcel_limit_data &= (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_AnyAVSounds) > 0); have_new_parcel_limit_data &= (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_GroupAVSounds) > 0); @@ -787,7 +787,7 @@ void LLParcel::extendAABB(const LLVector3& box_min, const LLVector3& box_max) } } -BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) +bool LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) { if (mAccessList.size() >= (U32) PARCEL_MAX_ACCESS_LIST) { @@ -828,7 +828,7 @@ BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) return true; } -BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) +bool LLParcel::addToBanList(const LLUUID& agent_id, S32 time) { if (mBanList.size() >= (U32) PARCEL_MAX_ACCESS_LIST) { @@ -871,10 +871,10 @@ BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) return true; } -BOOL remove_from_access_array(std::map* list, +bool remove_from_access_array(std::map* list, const LLUUID& agent_id) { - BOOL removed = FALSE; + bool removed = false; LLAccessEntry::map::iterator itor = list->begin(); while (itor != list->end()) { @@ -882,7 +882,7 @@ BOOL remove_from_access_array(std::map* list, if (entry.mID == agent_id) { list->erase(itor++); - removed = TRUE; + removed = true; } else { @@ -892,12 +892,12 @@ BOOL remove_from_access_array(std::map* list, return removed; } -BOOL LLParcel::removeFromAccessList(const LLUUID& agent_id) +bool LLParcel::removeFromAccessList(const LLUUID& agent_id) { return remove_from_access_array(&mAccessList, agent_id); } -BOOL LLParcel::removeFromBanList(const LLUUID& agent_id) +bool LLParcel::removeFromBanList(const LLUUID& agent_id) { return remove_from_access_array(&mBanList, agent_id); } @@ -947,13 +947,13 @@ const std::string& LLParcel::getActionString(LLParcel::EAction action) return PARCEL_ACTION_STRING[index]; } -BOOL LLParcel::isSaleTimerExpired(const U64& time) +bool LLParcel::isSaleTimerExpired(const U64& time) { if (mSaleTimerExpires.getStarted() == FALSE) { return false; } - BOOL expired = mSaleTimerExpires.checkExpirationAndReset(0.0); + bool expired = mSaleTimerExpires.checkExpirationAndReset(0.0); if (expired) { mSaleTimerExpires.stop(); @@ -961,13 +961,13 @@ BOOL LLParcel::isSaleTimerExpired(const U64& time) return expired; } -BOOL LLParcel::isMediaResetTimerExpired(const U64& time) +bool LLParcel::isMediaResetTimerExpired(const U64& time) { - if (mMediaResetTimer.getStarted() == FALSE) + if (mMediaResetTimer.getStarted() == false) { return false; } - BOOL expired = mMediaResetTimer.checkExpirationAndReset(0.0); + bool expired = mMediaResetTimer.checkExpirationAndReset(0.0); if (expired) { mMediaResetTimer.stop(); @@ -976,7 +976,7 @@ BOOL LLParcel::isMediaResetTimerExpired(const U64& time) } -void LLParcel::startSale(const LLUUID& buyer_id, BOOL is_buyer_group) +void LLParcel::startSale(const LLUUID& buyer_id, bool is_buyer_group) { // TODO -- this and all Sale related methods need to move out of the LLParcel // base class and into server-side-only LLSimParcel class @@ -1042,7 +1042,7 @@ void LLParcel::completeSale( // Turn off show directory, since it's a recurring fee that // the buyer may not want. - setParcelFlag(PF_SHOW_DIRECTORY, FALSE); + setParcelFlag(PF_SHOW_DIRECTORY, false); //should be cleared on sale. mAccessList.clear(); @@ -1069,12 +1069,12 @@ void LLParcel::clearSale() setSellWithObjects(FALSE); } -BOOL LLParcel::isPublic() const +bool LLParcel::isPublic() const { return (mOwnerID.isNull()); } -BOOL LLParcel::isBuyerAuthorized(const LLUUID& buyer_id) const +bool LLParcel::isBuyerAuthorized(const LLUUID& buyer_id) const { if(mAuthBuyerID.isNull()) { diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index f5ee1241ab..e3c27e7d73 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -209,37 +209,37 @@ public: LLParcel(); LLParcel( const LLUUID &owner_id, - BOOL modify, - BOOL terraform, - BOOL damage, + bool modify, + bool terraform, + bool damage, time_t claim_date, S32 claim_price, S32 rent_price, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, - BOOL is_group_owned = FALSE); + bool is_group_owned = false); virtual ~LLParcel(); void init( const LLUUID &owner_id, - BOOL modify, - BOOL terraform, - BOOL damage, + bool modify, + bool terraform, + bool damage, time_t claim_date, S32 claim_price, S32 rent_price, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, - BOOL is_group_owned = FALSE); + bool is_group_owned = false); // TODO: make an actual copy constructor for this void overrideParcelFlags(U32 flags); // if you specify an agent id here, the group id will be zeroed void overrideOwner( const LLUUID& owner_id, - BOOL is_group_owned = FALSE); + bool is_group_owned = false); void overrideSaleTimerExpires(F32 secs_left) { mSaleTimerExpires.setTimerExpirySec(secs_left); } // MANIPULATORS @@ -283,7 +283,7 @@ public: void setAuctionID(U32 auction_id) { mAuctionID = auction_id;} void setAllParcelFlags(U32 flags); - void setParcelFlag(U32 flag, BOOL b); + void setParcelFlag(U32 flag, bool b); virtual void setArea(S32 area, S32 sim_object_limit); void setDiscountRate(F32 rate); @@ -316,7 +316,7 @@ public: void setPassHours(F32 hours) { mPassHours = hours; } // BOOL importStream(std::istream& input_stream); - BOOL importAccessEntry(std::istream& input_stream, LLAccessEntry* entry); + bool importAccessEntry(std::istream& input_stream, LLAccessEntry* entry); // BOOL exportStream(std::ostream& output_stream); void packMessage(LLMessageSystem* msg); @@ -344,10 +344,10 @@ public: void expirePasses(S32 now); // Add to list, suppressing duplicates. Returns TRUE if added. - BOOL addToAccessList(const LLUUID& agent_id, S32 time); - BOOL addToBanList(const LLUUID& agent_id, S32 time); - BOOL removeFromAccessList(const LLUUID& agent_id); - BOOL removeFromBanList(const LLUUID& agent_id); + bool addToAccessList(const LLUUID& agent_id, S32 time); + bool addToBanList(const LLUUID& agent_id, S32 time); + bool removeFromAccessList(const LLUUID& agent_id); + bool removeFromBanList(const LLUUID& agent_id); // ACCESSORS const LLUUID& getID() const { return mID; } @@ -377,14 +377,14 @@ public: U32 getAuctionID() const { return mAuctionID; } bool isInEscrow() const { return mInEscrow; } - BOOL isPublic() const; + bool isPublic() const; // Region-local user-specified position const LLVector3& getUserLocation() const { return mUserLocation; } const LLVector3& getUserLookAt() const { return mUserLookAt; } ELandingType getLandingType() const { return mLandingType; } - BOOL getSeeAVs() const { return mSeeAVs; } - BOOL getHaveNewParcelLimitData() const { return mHaveNewParcelLimitData; } + bool getSeeAVs() const { return mSeeAVs; } + bool getHaveNewParcelLimitData() const { return mHaveNewParcelLimitData; } // User-specified snapshot const LLUUID& getSnapshotID() const { return mSnapshotID; } @@ -395,7 +395,7 @@ public: const LLUUID& getAuthorizedBuyerID() const { return mAuthBuyerID; } // helper function - BOOL isBuyerAuthorized(const LLUUID& buyer_id) const; + bool isBuyerAuthorized(const LLUUID& buyer_id) const; // The buyer of a plot is set when someone indicates they want to // buy the plot, and the system is simply waiting for tier-up @@ -422,7 +422,7 @@ public: // the isSaleTimerExpired will trivially return FALSE if there is // no sale going on. Pass in the current time in usec which will // be used for comparison. - BOOL isSaleTimerExpired(const U64& time); + bool isSaleTimerExpired(const U64& time); F32 getSaleTimerExpires() { return mSaleTimerExpires.getRemainingTimeF32(); } @@ -431,7 +431,7 @@ public: // need to record a few things with the parcel when a sale // starts. - void startSale(const LLUUID& buyer_id, BOOL is_buyer_group); + void startSale(const LLUUID& buyer_id, bool is_buyer_group); // do the expiration logic, which needs to return values usable in // a L$ transaction. @@ -440,26 +440,26 @@ public: void clearSale(); - BOOL isMediaResetTimerExpired(const U64& time); + bool isMediaResetTimerExpired(const U64& time); // more accessors U32 getParcelFlags() const { return mParcelFlags; } - BOOL getParcelFlag(U32 flag) const - { return (mParcelFlags & flag) ? TRUE : FALSE; } + bool getParcelFlag(U32 flag) const + { return (mParcelFlags & flag) ? true : false; } // objects can be added or modified by anyone (only parcel owner if disabled) - BOOL getAllowModify() const - { return (mParcelFlags & PF_CREATE_OBJECTS) ? TRUE : FALSE; } + bool getAllowModify() const + { return (mParcelFlags & PF_CREATE_OBJECTS) ? true : false; } // objects can be added or modified by group members - BOOL getAllowGroupModify() const - { return (mParcelFlags & PF_CREATE_GROUP_OBJECTS) ? TRUE : FALSE; } + bool getAllowGroupModify() const + { return (mParcelFlags & PF_CREATE_GROUP_OBJECTS) ? true : false; } // the parcel can be deeded to the group - BOOL getAllowDeedToGroup() const - { return (mParcelFlags & PF_ALLOW_DEED_TO_GROUP) ? TRUE : FALSE; } + bool getAllowDeedToGroup() const + { return (mParcelFlags & PF_ALLOW_DEED_TO_GROUP) ? true : false; } // Does the owner want to make a contribution along with the deed. BOOL getContributeWithDeed() const @@ -537,10 +537,10 @@ public: S32 getClaimPrice() const { return mClaimPricePerMeter * mArea; } // Can this agent create objects here? - BOOL allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) const; + bool allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) const; // Can this agent change the shape of the land? - BOOL allowTerraformBy(const LLUUID &agent_id) const; + bool allowTerraformBy(const LLUUID &agent_id) const; bool operator==(const LLParcel &rhs) const; diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp index 0359d2f554..693a0da123 100644 --- a/indra/llinventory/llpermissions.cpp +++ b/indra/llinventory/llpermissions.cpp @@ -87,21 +87,21 @@ void LLPermissions::initMasks(LLInventoryType::EType type) } } -BOOL LLPermissions::getOwnership(LLUUID& owner_id, BOOL& is_group_owned) const +bool LLPermissions::getOwnership(LLUUID& owner_id, bool& is_group_owned) const { if(mOwner.notNull()) { owner_id = mOwner; - is_group_owned = FALSE; - return TRUE; + is_group_owned = false; + return true; } else if(mIsGroupOwned) { owner_id = mGroup; - is_group_owned = TRUE; - return TRUE; + is_group_owned = true; + return true; } - return FALSE; + return false; } LLUUID LLPermissions::getSafeOwner() const @@ -232,13 +232,13 @@ void LLPermissions::accumulate(const LLPermissions& perm) // saves last owner, sets current owner, and sets the group. note // that this function has to more cleverly apply the fair use // permissions. -BOOL LLPermissions::setOwnerAndGroup( +bool LLPermissions::setOwnerAndGroup( const LLUUID& agent, const LLUUID& owner, const LLUUID& group, bool is_atomic) { - BOOL allowed = FALSE; + bool allowed = false; if( agent.isNull() || mOwner.isNull() || ((agent == mOwner) && ((owner == mOwner) || (mMaskOwner & PERM_TRANSFER)) ) ) @@ -246,7 +246,7 @@ BOOL LLPermissions::setOwnerAndGroup( // ...system can alway set owner // ...public objects can be claimed by anyone // ...otherwise, agent must own it and have transfer ability - allowed = TRUE; + allowed = true; } if (allowed) @@ -301,7 +301,7 @@ void LLPermissions::yesReallySetOwner(const LLUUID& owner, bool group_owned) mIsGroupOwned = group_owned; } -BOOL LLPermissions::deedToGroup(const LLUUID& agent, const LLUUID& group) +bool LLPermissions::deedToGroup(const LLUUID& agent, const LLUUID& group) { if(group.notNull() && (agent.isNull() || ((group == mGroup) && (mMaskOwner & PERM_TRANSFER) @@ -318,18 +318,18 @@ BOOL LLPermissions::deedToGroup(const LLUUID& agent, const LLUUID& group) mIsGroupOwned = true; fixFairUse(); fix(); - return TRUE; + return true; } - return FALSE; + return false; } -BOOL LLPermissions::setBaseBits(const LLUUID& agent, BOOL set, PermissionMask bits) +bool LLPermissions::setBaseBits(const LLUUID& agent, bool set, PermissionMask bits) { - BOOL ownership = FALSE; + bool ownership = true; if(agent.isNull()) { // only the system is always allowed to change base bits - ownership = TRUE; + ownership = true; } if (ownership) @@ -351,19 +351,19 @@ BOOL LLPermissions::setBaseBits(const LLUUID& agent, BOOL set, PermissionMask bi // Note: If you attempt to set bits that the base bits doesn't allow, // the function will succeed, but those bits will not be set. -BOOL LLPermissions::setOwnerBits(const LLUUID& agent, BOOL set, PermissionMask bits) +bool LLPermissions::setOwnerBits(const LLUUID& agent, bool set, PermissionMask bits) { - BOOL ownership = FALSE; + bool ownership = false; if(agent.isNull()) { // ...system always allowed to change things - ownership = TRUE; + ownership = true; } else if (agent == mOwner) { // ...owner bits can only be set by owner - ownership = TRUE; + ownership = true; } // If we have correct ownership and @@ -383,15 +383,15 @@ BOOL LLPermissions::setOwnerBits(const LLUUID& agent, BOOL set, PermissionMask b return (ownership); } -BOOL LLPermissions::setGroupBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits) +bool LLPermissions::setGroupBits(const LLUUID& agent, const LLUUID& group, bool set, PermissionMask bits) { - BOOL ownership = FALSE; + bool ownership = false; if((agent.isNull()) || (agent == mOwner) || ((group == mGroup) && (!mGroup.isNull()))) { // The group bits can be set by the system, the owner, or a // group member. - ownership = TRUE; + ownership = true; } if (ownership) @@ -412,15 +412,15 @@ BOOL LLPermissions::setGroupBits(const LLUUID& agent, const LLUUID& group, BOOL // Note: If you attempt to set bits that the creator or owner doesn't allow, // the function will succeed, but those bits will not be set. -BOOL LLPermissions::setEveryoneBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits) +bool LLPermissions::setEveryoneBits(const LLUUID& agent, const LLUUID& group, bool set, PermissionMask bits) { - BOOL ownership = FALSE; + bool ownership = false; if((agent.isNull()) || (agent == mOwner) || ((group == mGroup) && (!mGroup.isNull()))) { // The everyone bits can be set by the system, the owner, or a // group member. - ownership = TRUE; + ownership = true; } if (ownership) { @@ -441,15 +441,15 @@ BOOL LLPermissions::setEveryoneBits(const LLUUID& agent, const LLUUID& group, BO // Note: If you attempt to set bits that the creator or owner doesn't allow, // the function will succeed, but those bits will not be set. -BOOL LLPermissions::setNextOwnerBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits) +bool LLPermissions::setNextOwnerBits(const LLUUID& agent, const LLUUID& group, bool set, PermissionMask bits) { - BOOL ownership = FALSE; + bool ownership = false; if((agent.isNull()) || (agent == mOwner) || ((group == mGroup) && (!mGroup.isNull()))) { // The next owner bits can be set by the system, the owner, or // a group member. - ownership = TRUE; + ownership = true; } if (ownership) { @@ -478,7 +478,7 @@ bool LLPermissions::allowOperationBy(PermissionBit op, const LLUUID& requester, { // ...system making request // ...not owned - return TRUE; + return true; } else if (mIsGroupOwned && (mGroup == requester)) { @@ -513,7 +513,7 @@ LLSD LLPermissions::packMessage() const result["group-mask"] = (S32)mMaskGroup; result["everyone-mask"] = (S32)mMaskEveryone; result["next-owner-mask"]= (S32)mMaskNextOwner; - result["group-owned"] = (BOOL)mIsGroupOwned; + result["group-owned"] = (bool)mIsGroupOwned; return result; } @@ -531,7 +531,7 @@ void LLPermissions::packMessage(LLMessageSystem* msg) const msg->addU32Fast(_PREHASH_GroupMask, mMaskGroup ); msg->addU32Fast(_PREHASH_EveryoneMask, mMaskEveryone ); msg->addU32Fast(_PREHASH_NextOwnerMask, mMaskNextOwner ); - msg->addBOOLFast(_PREHASH_GroupOwned, (BOOL)mIsGroupOwned); + msg->addBOOLFast(_PREHASH_GroupOwned, mIsGroupOwned); } void LLPermissions::unpackMessage(LLSD perms) @@ -559,13 +559,13 @@ void LLPermissions::unpackMessage(LLMessageSystem* msg, const char* block, S32 b msg->getU32Fast(block, _PREHASH_GroupMask, mMaskGroup, block_num ); msg->getU32Fast(block, _PREHASH_EveryoneMask, mMaskEveryone, block_num ); msg->getU32Fast(block, _PREHASH_NextOwnerMask, mMaskNextOwner, block_num ); - BOOL tmp; + bool tmp; msg->getBOOLFast(block, _PREHASH_GroupOwned, tmp, block_num); - mIsGroupOwned = (bool)tmp; + mIsGroupOwned = tmp; } -BOOL LLPermissions::importLegacyStream(std::istream& input_stream) +bool LLPermissions::importLegacyStream(std::istream& input_stream) { init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null); const S32 BUFSIZE = 16384; @@ -661,11 +661,11 @@ BOOL LLPermissions::importLegacyStream(std::istream& input_stream) } } fix(); - return TRUE; + return true; } -BOOL LLPermissions::exportLegacyStream(std::ostream& output_stream) const +bool LLPermissions::exportLegacyStream(std::ostream& output_stream) const { std::string uuid_str; @@ -701,12 +701,9 @@ BOOL LLPermissions::exportLegacyStream(std::ostream& output_stream) const output_stream << "\t\tgroup_owned\t1\n"; } output_stream << "\t}\n"; - return TRUE; + return true; } -// Deleted LLPermissions::exportFileXML() and LLPermissions::importXML() -// because I can't find any non-test code references to it. 2009-05-04 JC - bool LLPermissions::operator==(const LLPermissions &rhs) const { return @@ -791,21 +788,21 @@ U8 LLAggregatePermissions::getU8() const return byte; } -BOOL LLAggregatePermissions::isEmpty() const +bool LLAggregatePermissions::isEmpty() const { for(S32 i = 0; i < PI_END; ++i) { if(mBits[i] != AP_EMPTY) { - return FALSE; + return false; } } - return TRUE; + return true; } void LLAggregatePermissions::aggregate(PermissionMask mask) { - BOOL is_allowed = mask & PERM_COPY; + bool is_allowed = mask & PERM_COPY; aggregateBit(PI_COPY, is_allowed); is_allowed = mask & PERM_MODIFY; aggregateBit(PI_MODIFY, is_allowed); @@ -821,7 +818,7 @@ void LLAggregatePermissions::aggregate(const LLAggregatePermissions& ag) } } -void LLAggregatePermissions::aggregateBit(EPermIndex idx, BOOL allowed) +void LLAggregatePermissions::aggregateBit(EPermIndex idx, bool allowed) { //if(AP_SOME == mBits[idx]) return; // P4 branch prediction optimization switch(mBits[idx]) diff --git a/indra/llinventory/llpermissions.h b/indra/llinventory/llpermissions.h index 27252f7b97..a8acef098a 100644 --- a/indra/llinventory/llpermissions.h +++ b/indra/llinventory/llpermissions.h @@ -162,7 +162,7 @@ public: // either the owner id or the group id, and the is_group_owned // parameter is appropriately filled. The values of owner_id and // is_group_owned are not changed if the object is not owned. - BOOL getOwnership(LLUUID& owner_id, BOOL& is_group_owned) const; + bool getOwnership(LLUUID& owner_id, bool& is_group_owned) const; // Gets the 'safe' owner. This should never return LLUUID::null. // If no group owned, return the agent owner id normally. @@ -218,7 +218,7 @@ public: // Currently, the only way to have a collection is when an object // has inventory and is then itself rolled up into an inventory // item. - BOOL setOwnerAndGroup(const LLUUID& agent, const LLUUID& owner, const LLUUID& group, bool is_atomic); + bool setOwnerAndGroup(const LLUUID& agent, const LLUUID& owner, const LLUUID& group, bool is_atomic); // only call this if you know what you're doing // there are usually perm-bit consequences when the @@ -239,16 +239,16 @@ public: // owner transfer) then this function will deed the permissions, // set the next owner mask, and return TRUE. Otherwise, no change // is effected, and the function returns FALSE. - BOOL deedToGroup(const LLUUID& agent, const LLUUID& group); + bool deedToGroup(const LLUUID& agent, const LLUUID& group); // Attempt to set or clear the given bitmask. Returns TRUE if you // are allowed to modify the permissions. If you attempt to turn // on bits not allowed by the base bits, the function will return // TRUE, but those bits will not be set. - BOOL setBaseBits( const LLUUID& agent, BOOL set, PermissionMask bits); - BOOL setOwnerBits( const LLUUID& agent, BOOL set, PermissionMask bits); - BOOL setGroupBits( const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits); - BOOL setEveryoneBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits); - BOOL setNextOwnerBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits); + bool setBaseBits( const LLUUID& agent, bool set, PermissionMask bits); + bool setOwnerBits( const LLUUID& agent, bool set, PermissionMask bits); + bool setGroupBits( const LLUUID& agent, const LLUUID& group, bool set, PermissionMask bits); + bool setEveryoneBits(const LLUUID& agent, const LLUUID& group, bool set, PermissionMask bits); + bool setNextOwnerBits(const LLUUID& agent, const LLUUID& group, bool set, PermissionMask bits); // This is currently only used in the Viewer to handle calling cards // where the creator is actually used to store the target. Use with care. @@ -311,8 +311,8 @@ public: void packMessage(LLMessageSystem* msg) const; void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); - BOOL importLegacyStream(std::istream& input_stream); - BOOL exportLegacyStream(std::ostream& output_stream) const; + bool importLegacyStream(std::istream& input_stream); + bool exportLegacyStream(std::ostream& output_stream) const; bool operator==(const LLPermissions &rhs) const; bool operator!=(const LLPermissions &rhs) const; @@ -401,8 +401,8 @@ public: // LSB is to the right U8 getU8() const; - // return TRUE is the aggregate permissions are empty, otherwise FALSE. - BOOL isEmpty() const ; + // return true is the aggregate permissions are empty, otherwise false. + bool isEmpty() const ; // pass in a PERM_COPY, PERM_TRANSFER, etc, and an EValue // enumeration to specifically set that value. Not implemented @@ -432,7 +432,7 @@ protected: PI_END = 3, PI_COUNT = 3 }; - void aggregateBit(EPermIndex idx, BOOL allowed); + void aggregateBit(EPermIndex idx, bool allowed); void aggregateIndex(EPermIndex idx, U8 bits); static EPermIndex perm2PermIndex(PermissionBit bit); -- cgit v1.2.3