diff options
author | Roxie Linden <roxie@lindenlab.com> | 2024-06-13 14:59:28 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-06-13 14:59:28 -0700 |
commit | 5e60392c273f0c9c5efa765a05414c618381780a (patch) | |
tree | d1eedbb1dfa86e66532a6d8746b7a81e5a444d3a /indra/llinventory | |
parent | 0f3c3563b0861e8ea82b201aab8343d99f993bbc (diff) | |
parent | 100ebbab2437de7f5d124a0d7b8279a7a7b57656 (diff) |
Merge branch 'develop' of github.com:secondlife/viewer into roxie/webrtc-voice
Diffstat (limited to 'indra/llinventory')
-rw-r--r-- | indra/llinventory/llfoldertype.cpp | 60 | ||||
-rw-r--r-- | indra/llinventory/llinventory.cpp | 40 | ||||
-rw-r--r-- | indra/llinventory/llinventory.h | 22 | ||||
-rw-r--r-- | indra/llinventory/llinventorytype.cpp | 7 | ||||
-rw-r--r-- | indra/llinventory/llinventorytype.h | 4 | ||||
-rw-r--r-- | indra/llinventory/llnotecard.cpp | 26 | ||||
-rw-r--r-- | indra/llinventory/llparcel.cpp | 158 | ||||
-rw-r--r-- | indra/llinventory/llparcel.h | 232 | ||||
-rw-r--r-- | indra/llinventory/llpermissions.cpp | 87 | ||||
-rw-r--r-- | indra/llinventory/llpermissions.h | 74 | ||||
-rw-r--r-- | indra/llinventory/llsaleinfo.cpp | 18 | ||||
-rw-r--r-- | indra/llinventory/llsaleinfo.h | 8 | ||||
-rw-r--r-- | indra/llinventory/llsettingsdaycycle.cpp | 12 | ||||
-rw-r--r-- | indra/llinventory/llsettingsdaycycle.h | 8 | ||||
-rw-r--r-- | indra/llinventory/llsettingssky.h | 12 | ||||
-rw-r--r-- | indra/llinventory/lltransactionflags.cpp | 9 | ||||
-rw-r--r-- | indra/llinventory/lltransactionflags.h | 8 | ||||
-rw-r--r-- | indra/llinventory/tests/inventorymisc_test.cpp | 4 |
18 files changed, 375 insertions, 414 deletions
diff --git a/indra/llinventory/llfoldertype.cpp b/indra/llinventory/llfoldertype.cpp index 8f968ae2fd..7e1be17ecc 100644 --- a/indra/llinventory/llfoldertype.cpp +++ b/indra/llinventory/llfoldertype.cpp @@ -84,47 +84,47 @@ protected: LLFolderDictionary::LLFolderDictionary() { // TYPE NAME, PROTECTED, AUTOMATIC, SINGLETON - addEntry(LLFolderType::FT_TEXTURE, new FolderEntry("texture", TRUE, TRUE, TRUE)); - addEntry(LLFolderType::FT_SOUND, new FolderEntry("sound", TRUE, TRUE, TRUE)); - addEntry(LLFolderType::FT_CALLINGCARD, new FolderEntry("callcard", TRUE, TRUE, FALSE)); - addEntry(LLFolderType::FT_LANDMARK, new FolderEntry("landmark", TRUE, FALSE, FALSE)); - addEntry(LLFolderType::FT_CLOTHING, new FolderEntry("clothing", TRUE, TRUE, TRUE)); - addEntry(LLFolderType::FT_OBJECT, new FolderEntry("object", TRUE, TRUE, TRUE)); - addEntry(LLFolderType::FT_NOTECARD, new FolderEntry("notecard", TRUE, TRUE, TRUE)); - addEntry(LLFolderType::FT_ROOT_INVENTORY, new FolderEntry("root_inv", TRUE, TRUE, TRUE)); - addEntry(LLFolderType::FT_LSL_TEXT, new FolderEntry("lsltext", TRUE, TRUE, TRUE)); - addEntry(LLFolderType::FT_BODYPART, new FolderEntry("bodypart", TRUE, TRUE, TRUE)); - addEntry(LLFolderType::FT_TRASH, new FolderEntry("trash", TRUE, FALSE, TRUE)); - addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, new FolderEntry("snapshot", TRUE, TRUE, TRUE)); - addEntry(LLFolderType::FT_LOST_AND_FOUND, new FolderEntry("lstndfnd", TRUE, TRUE, TRUE)); - addEntry(LLFolderType::FT_ANIMATION, new FolderEntry("animatn", TRUE, TRUE, TRUE)); - addEntry(LLFolderType::FT_GESTURE, new FolderEntry("gesture", TRUE, TRUE, TRUE)); - addEntry(LLFolderType::FT_FAVORITE, new FolderEntry("favorite", TRUE, FALSE, TRUE)); + addEntry(LLFolderType::FT_TEXTURE, new FolderEntry("texture", true, true, true)); + addEntry(LLFolderType::FT_SOUND, new FolderEntry("sound", true, true, true)); + addEntry(LLFolderType::FT_CALLINGCARD, new FolderEntry("callcard", true, true, false)); + addEntry(LLFolderType::FT_LANDMARK, new FolderEntry("landmark", true, false, false)); + addEntry(LLFolderType::FT_CLOTHING, new FolderEntry("clothing", true, true, true)); + addEntry(LLFolderType::FT_OBJECT, new FolderEntry("object", true, true, true)); + addEntry(LLFolderType::FT_NOTECARD, new FolderEntry("notecard", true, true, true)); + addEntry(LLFolderType::FT_ROOT_INVENTORY, new FolderEntry("root_inv", true, true, true)); + addEntry(LLFolderType::FT_LSL_TEXT, new FolderEntry("lsltext", true, true, true)); + addEntry(LLFolderType::FT_BODYPART, new FolderEntry("bodypart", true, true, true)); + addEntry(LLFolderType::FT_TRASH, new FolderEntry("trash", true, false, true)); + addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, new FolderEntry("snapshot", true, true, true)); + addEntry(LLFolderType::FT_LOST_AND_FOUND, new FolderEntry("lstndfnd", true, true, true)); + addEntry(LLFolderType::FT_ANIMATION, new FolderEntry("animatn", true, true, true)); + addEntry(LLFolderType::FT_GESTURE, new FolderEntry("gesture", true, true, true)); + addEntry(LLFolderType::FT_FAVORITE, new FolderEntry("favorite", true, false, true)); for (S32 ensemble_num = S32(LLFolderType::FT_ENSEMBLE_START); ensemble_num <= S32(LLFolderType::FT_ENSEMBLE_END); ensemble_num++) { - addEntry(LLFolderType::EType(ensemble_num), new FolderEntry("ensemble", FALSE, FALSE, FALSE)); // Not used + addEntry(LLFolderType::EType(ensemble_num), new FolderEntry("ensemble", false, false, false)); // Not used } - addEntry(LLFolderType::FT_CURRENT_OUTFIT, new FolderEntry("current", TRUE, FALSE, TRUE)); - addEntry(LLFolderType::FT_OUTFIT, new FolderEntry("outfit", FALSE, FALSE, FALSE)); - addEntry(LLFolderType::FT_MY_OUTFITS, new FolderEntry("my_otfts", TRUE, FALSE, TRUE)); + addEntry(LLFolderType::FT_CURRENT_OUTFIT, new FolderEntry("current", true, false, true)); + addEntry(LLFolderType::FT_OUTFIT, new FolderEntry("outfit", false, false, false)); + addEntry(LLFolderType::FT_MY_OUTFITS, new FolderEntry("my_otfts", true, false, true)); - addEntry(LLFolderType::FT_MESH, new FolderEntry("mesh", TRUE, FALSE, FALSE)); // Not used? + addEntry(LLFolderType::FT_MESH, new FolderEntry("mesh", true, false, false)); // Not used? - addEntry(LLFolderType::FT_INBOX, new FolderEntry("inbox", TRUE, FALSE, TRUE)); - addEntry(LLFolderType::FT_OUTBOX, new FolderEntry("outbox", TRUE, FALSE, FALSE)); + addEntry(LLFolderType::FT_INBOX, new FolderEntry("inbox", true, false, true)); + addEntry(LLFolderType::FT_OUTBOX, new FolderEntry("outbox", true, false, false)); - addEntry(LLFolderType::FT_BASIC_ROOT, new FolderEntry("basic_rt", TRUE, FALSE, FALSE)); + addEntry(LLFolderType::FT_BASIC_ROOT, new FolderEntry("basic_rt", true, false, false)); - addEntry(LLFolderType::FT_MARKETPLACE_LISTINGS, new FolderEntry("merchant", FALSE, FALSE, FALSE)); - addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new FolderEntry("stock", FALSE, FALSE, FALSE)); - addEntry(LLFolderType::FT_MARKETPLACE_VERSION, new FolderEntry("version", FALSE, FALSE, FALSE)); + addEntry(LLFolderType::FT_MARKETPLACE_LISTINGS, new FolderEntry("merchant", false, false, false)); + addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new FolderEntry("stock", false, false, false)); + addEntry(LLFolderType::FT_MARKETPLACE_VERSION, new FolderEntry("version", false, false, false)); - addEntry(LLFolderType::FT_SETTINGS, new FolderEntry("settings", TRUE, FALSE, TRUE)); - addEntry(LLFolderType::FT_MATERIAL, new FolderEntry("material", TRUE, FALSE, TRUE)); + addEntry(LLFolderType::FT_SETTINGS, new FolderEntry("settings", true, false, true)); + addEntry(LLFolderType::FT_MATERIAL, new FolderEntry("material", true, false, true)); - addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE, FALSE, FALSE)); + addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", false, false, false)); }; // static diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index d7e655d537..082d8b2f9f 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -133,7 +133,7 @@ LLAssetType::EType LLInventoryObject::getActualType() const return mType; } -BOOL LLInventoryObject::getIsLinkType() const +bool LLInventoryObject::getIsLinkType() const { return LLAssetType::lookupIsLinkType(mType); } @@ -182,7 +182,7 @@ void LLInventoryObject::setType(LLAssetType::EType type) // virtual -BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream) +bool LLInventoryObject::importLegacyStream(std::istream& input_stream) { // *NOTE: Changing the buffer size will require changing the scanf // calls below. @@ -265,10 +265,10 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream) << "' in LLInventoryObject::importLegacyStream() for object " << mUUID << LL_ENDL; } } - return TRUE; + return true; } -BOOL LLInventoryObject::exportLegacyStream(std::ostream& output_stream, BOOL) const +bool LLInventoryObject::exportLegacyStream(std::ostream& output_stream, bool) const { std::string uuid_str; output_stream << "\tinv_object\t0\n\t{\n"; @@ -279,16 +279,16 @@ BOOL LLInventoryObject::exportLegacyStream(std::ostream& output_stream, BOOL) co output_stream << "\t\ttype\t" << LLAssetType::lookup(mType) << "\n"; output_stream << "\t\tname\t" << mName.c_str() << "|\n"; output_stream << "\t}\n"; - return TRUE; + return true; } -void LLInventoryObject::updateParentOnServer(BOOL) const +void LLInventoryObject::updateParentOnServer(bool) const { // don't do nothin' LL_WARNS() << "LLInventoryObject::updateParentOnServer() called. Doesn't do anything." << LL_ENDL; } -void LLInventoryObject::updateServer(BOOL) const +void LLInventoryObject::updateServer(bool) const { // don't do nothin' LL_WARNS() << "LLInventoryObject::updateServer() called. Doesn't do anything." << LL_ENDL; @@ -575,7 +575,7 @@ void LLInventoryItem::packMessage(LLMessageSystem* msg) const } // virtual -BOOL LLInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num) +bool LLInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num) { msg->getUUIDFast(block, _PREHASH_ItemID, mUUID, block_num); msg->getUUIDFast(block, _PREHASH_FolderID, mParentUUID, block_num); @@ -611,13 +611,13 @@ BOOL LLInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32 if(local_crc == remote_crc) { LL_DEBUGS() << "crc matches" << LL_ENDL; - return TRUE; + return true; } else { LL_WARNS() << "inventory crc mismatch: local=" << std::hex << local_crc << " remote=" << remote_crc << std::dec << LL_ENDL; - return FALSE; + return false; } #else return (local_crc == remote_crc); @@ -625,7 +625,7 @@ BOOL LLInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32 } // virtual -BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) +bool LLInventoryItem::importLegacyStream(std::istream& input_stream) { // *NOTE: Changing the buffer size will require changing the scanf // calls below. @@ -633,7 +633,7 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) char keyword[MAX_STRING]; /* Flawfinder: ignore */ char valuestr[MAX_STRING]; /* Flawfinder: ignore */ char junk[MAX_STRING]; /* Flawfinder: ignore */ - BOOL success = TRUE; + bool success = true; keyword[0] = '\0'; valuestr[0] = '\0'; @@ -673,7 +673,7 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) // the permissions. Thus, we read that out, and fix legacy // objects. It's possible this op would fail, but it // should pick up the vast majority of the tasks. - BOOL has_perm_mask = FALSE; + bool has_perm_mask = false; U32 perm_mask = 0; success = mSaleInfo.importLegacyStream(input_stream, has_perm_mask, perm_mask); if(has_perm_mask) @@ -815,7 +815,7 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) return success; } -BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key) const +bool LLInventoryItem::exportLegacyStream(std::ostream& output_stream, bool include_asset_key) const { std::string uuid_str; output_stream << "\tinv_item\t0\n\t{\n"; @@ -874,7 +874,7 @@ BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL inclu output_stream << "\t\tdesc\t" << mDescription.c_str() << "|\n"; output_stream << "\t\tcreation_date\t" << mCreationDate << "\n"; output_stream << "\t}\n"; - return TRUE; + return true; } LLSD LLInventoryItem::asLLSD() const @@ -994,7 +994,7 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd, bool is_new) // the permissions. Thus, we read that out, and fix legacy // objects. It's possible this op would fail, but it // should pick up the vast majority of the tasks. - BOOL has_perm_mask = FALSE; + bool has_perm_mask = false; U32 perm_mask = 0; if (!mSaleInfo.fromLLSD(i->second, has_perm_mask, perm_mask)) { @@ -1278,7 +1278,7 @@ void LLInventoryCategory::unpackMessage(LLMessageSystem* msg, } // virtual -BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream) +bool LLInventoryCategory::importLegacyStream(std::istream& input_stream) { // *NOTE: Changing the buffer size will require changing the scanf // calls below. @@ -1369,10 +1369,10 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream) << "' in inventory import category " << mUUID << LL_ENDL; } } - return TRUE; + return true; } -BOOL LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, BOOL) const +bool LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, bool) const { std::string uuid_str; output_stream << "\tinv_category\t0\n\t{\n"; @@ -1393,7 +1393,7 @@ BOOL LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, BOOL) output_stream << "|\n"; } output_stream << "\t}\n"; - return TRUE; + return true; } LLSD LLInventoryCategory::exportLLSD() const diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index 1039fe7b72..e63f2deba7 100644 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -74,7 +74,7 @@ public: virtual const std::string& getName() const; virtual LLAssetType::EType getType() const; LLAssetType::EType getActualType() const; // bypasses indirection for linked items - BOOL getIsLinkType() const; + bool getIsLinkType() const; virtual time_t getCreationDate() const; //-------------------------------------------------------------------- @@ -98,11 +98,11 @@ public: // between simulator and viewer. //-------------------------------------------------------------------- - virtual BOOL importLegacyStream(std::istream& input_stream); - virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const; + virtual bool importLegacyStream(std::istream& input_stream); + virtual bool exportLegacyStream(std::ostream& output_stream, bool include_asset_key = true) const; - virtual void updateParentOnServer(BOOL) const; - virtual void updateServer(BOOL) const; + virtual void updateParentOnServer(bool) const; + virtual void updateServer(bool) const; //-------------------------------------------------------------------- // Member Variables @@ -190,17 +190,17 @@ public: // Assumes you have already called nextBlock(). virtual void packMessage(LLMessageSystem* msg) const; - // Returns TRUE if the inventory item came through the network correctly. + // Returns true if the inventory item came through the network correctly. // Uses a simple crc check which is defeatable, but we want to detect // network mangling somehow. - virtual BOOL unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); + virtual bool unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); //-------------------------------------------------------------------- // File Support //-------------------------------------------------------------------- public: - virtual BOOL importLegacyStream(std::istream& input_stream); - virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const; + virtual bool importLegacyStream(std::istream& input_stream); + virtual bool exportLegacyStream(std::ostream& output_stream, bool include_asset_key = true) const; //-------------------------------------------------------------------- // Helper Functions @@ -267,8 +267,8 @@ public: // File Support //-------------------------------------------------------------------- public: - virtual BOOL importLegacyStream(std::istream& input_stream); - virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const; + virtual bool importLegacyStream(std::istream& input_stream); + virtual bool exportLegacyStream(std::ostream& output_stream, bool include_asset_key = true) const; LLSD exportLLSD() const; bool importLLSD(const LLSD& cat_data); diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp index 303dd8b711..3dd1a5638d 100644 --- a/indra/llinventory/llinventorytype.cpp +++ b/indra/llinventory/llinventorytype.cpp @@ -83,6 +83,8 @@ LLInventoryDictionary::LLInventoryDictionary() addEntry(LLInventoryType::IT_ANIMATION, new InventoryEntry("animation", "animation", 1, LLAssetType::AT_ANIMATION)); addEntry(LLInventoryType::IT_GESTURE, new InventoryEntry("gesture", "gesture", 1, LLAssetType::AT_GESTURE)); addEntry(LLInventoryType::IT_MESH, new InventoryEntry("mesh", "mesh", 1, LLAssetType::AT_MESH)); + addEntry(LLInventoryType::IT_GLTF, new InventoryEntry("gltf", "gltf", 1, LLAssetType::AT_GLTF)); + addEntry(LLInventoryType::IT_GLTF_BIN, new InventoryEntry("glbin", "glbin", 1, LLAssetType::AT_GLTF_BIN)); addEntry(LLInventoryType::IT_WIDGET, new InventoryEntry("widget", "widget", 1, LLAssetType::AT_WIDGET)); addEntry(LLInventoryType::IT_PERSON, new InventoryEntry("person", "person", 1, LLAssetType::AT_PERSON)); addEntry(LLInventoryType::IT_SETTINGS, new InventoryEntry("settings", "settings", 1, LLAssetType::AT_SETTINGS)); @@ -153,9 +155,12 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] = LLInventoryType::IT_NONE, // 52 AT_RESERVED_3 LLInventoryType::IT_NONE, // 53 AT_RESERVED_4 LLInventoryType::IT_NONE, // 54 AT_RESERVED_5 + LLInventoryType::IT_NONE, // 55 AT_RESERVED_6 - LLInventoryType::IT_SETTINGS, // 55 AT_SETTINGS <- why doesnt this match the value in llassettype.h? -brad + LLInventoryType::IT_SETTINGS, // 56 AT_SETTINGS LLInventoryType::IT_MATERIAL, // 57 AT_MATERIAL + LLInventoryType::IT_GLTF, // 58 AT_GLTF + LLInventoryType::IT_GLTF_BIN, // 59 AT_GLTF_BIN }; // static diff --git a/indra/llinventory/llinventorytype.h b/indra/llinventory/llinventorytype.h index fd80a0be04..c90f8aa107 100644 --- a/indra/llinventory/llinventorytype.h +++ b/indra/llinventory/llinventorytype.h @@ -66,7 +66,9 @@ public: IT_PERSON = 24, IT_SETTINGS = 25, IT_MATERIAL = 26, - IT_COUNT = 27, + IT_GLTF = 27, + IT_GLTF_BIN = 28, + IT_COUNT = 29, IT_UNKNOWN = 255, IT_NONE = -1 diff --git a/indra/llinventory/llnotecard.cpp b/indra/llinventory/llnotecard.cpp index cc40a0c6b8..d73e9c8966 100644 --- a/indra/llinventory/llnotecard.cpp +++ b/indra/llinventory/llnotecard.cpp @@ -162,25 +162,25 @@ bool LLNotecard::importStream(std::istream& str) if(str.fail()) { LL_WARNS() << "Invalid Linden text file header " << LL_ENDL; - return FALSE; + return false; } if( 1 != mVersion && 2 != mVersion) { LL_WARNS() << "Invalid Linden text file version: " << mVersion << LL_ENDL; - return FALSE; + return false; } str >> std::ws >> "{\n"; if(str.fail()) { LL_WARNS() << "Invalid Linden text file format" << LL_ENDL; - return FALSE; + return false; } if(!importEmbeddedItemsStream(str)) { - return FALSE; + return false; } char line_buf[STD_STRING_BUF_SIZE]; /* Flawfinder: ignore */ @@ -188,7 +188,7 @@ bool LLNotecard::importStream(std::istream& str) if(str.fail()) { LL_WARNS() << "Invalid Linden text length field" << LL_ENDL; - return FALSE; + return false; } line_buf[STD_STRING_STR_LEN] = '\0'; @@ -196,23 +196,23 @@ bool LLNotecard::importStream(std::istream& str) if( 1 != sscanf(line_buf, "Text length %d", &text_len) ) { LL_WARNS() << "Invalid Linden text length field" << LL_ENDL; - return FALSE; + return false; } if(text_len > mMaxText || text_len < 0) { LL_WARNS() << "Invalid Linden text length: " << text_len << LL_ENDL; - return FALSE; + return false; } - BOOL success = TRUE; + bool success = true; char* text = new char[text_len + 1]; fullread(str, text, text_len); if(str.fail()) { LL_WARNS() << "Invalid Linden text: text shorter than text length: " << text_len << LL_ENDL; - success = FALSE; + success = false; } text[text_len] = '\0'; @@ -247,7 +247,7 @@ bool LLNotecard::exportEmbeddedItemsStream( std::ostream& out_stream ) out_stream << llformat("ext char index %d\n", idx ); if( !item->exportLegacyStream( out_stream ) ) { - return FALSE; + return false; } out_stream << "}\n"; } @@ -256,7 +256,7 @@ bool LLNotecard::exportEmbeddedItemsStream( std::ostream& out_stream ) out_stream << "}\n"; - return TRUE; + return true; } bool LLNotecard::exportStream( std::ostream& out_stream ) @@ -266,14 +266,14 @@ bool LLNotecard::exportStream( std::ostream& out_stream ) if( !exportEmbeddedItemsStream( out_stream ) ) { - return FALSE; + return false; } out_stream << llformat("Text length %d\n", mText.length() ); out_stream << mText; out_stream << "}\n"; - return TRUE; + return true; } //////////////////////////////////////////////////////////////////////////// diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index 0cb9070ff6..ef6ddb3cab 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -119,15 +119,15 @@ LLParcel::ECategory category_ui_string_to_category(const std::string& s); LLParcel::LLParcel() { - init(LLUUID::null, TRUE, FALSE, FALSE, 0, 0, 0, 0, 0, 1.f, 0); + init(LLUUID::null, true, false, false, 0, 0, 0, 0, 0, 1.f, 0); } 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; @@ -191,13 +191,13 @@ void LLParcel::init(const LLUUID &owner_id, setMediaType(LLStringUtil::null); mMediaID.setNull(); mMediaAutoScale = 0; - mMediaLoop = TRUE; + mMediaLoop = 1; mMediaWidth = 0; mMediaHeight = 0; setMediaCurrentURL(LLStringUtil::null); - mMediaAllowNavigate = TRUE; + mMediaAllowNavigate = 1; mMediaURLTimeout = 0.0f; - mMediaPreventCameraZoom = FALSE; + mMediaPreventCameraZoom = 0; mGroupID.setNull(); @@ -219,26 +219,26 @@ void LLParcel::init(const LLUUID &owner_id, setSelectedPrimCount(0); setTempPrimCount(0); setCleanOtherTime(0); - setRegionPushOverride(FALSE); - setRegionDenyAnonymousOverride(FALSE); - setRegionDenyAgeUnverifiedOverride(FALSE); + setRegionPushOverride(false); + setRegionDenyAnonymousOverride(false); + setRegionDenyAgeUnverifiedOverride(false); setParcelPrimBonus(parcel_object_bonus); setPreviousOwnerID(LLUUID::null); - setPreviouslyGroupOwned(FALSE); + setPreviouslyGroupOwned(false); - setSeeAVs(TRUE); - setAllowGroupAVSounds(TRUE); - setAllowAnyAVSounds(TRUE); - setHaveNewParcelLimitData(FALSE); + setSeeAVs(true); + setAllowGroupAVSounds(true); + setAllowAnyAVSounds(true); + setHaveNewParcelLimitData(false); - setRegionAllowEnvironmentOverride(FALSE); + setRegionAllowEnvironmentOverride(false); setParcelEnvironmentVersion(INVALID_PARCEL_ENVIRONMENT_VERSION); 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,25 +365,25 @@ 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) { // system always can enter - return TRUE; + return true; } else if (isPublic()) { - return TRUE; + return true; } else if (agent_id == mOwnerID) { // owner can always perform operations - return TRUE; + return true; } else if (mParcelFlags & PF_CREATE_OBJECTS) { - return TRUE; + return true; } else if ((mParcelFlags & PF_CREATE_GROUP_OBJECTS) && group_id.notNull() ) @@ -391,22 +391,22 @@ BOOL LLParcel::allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) con return (getGroupID() == group_id); } - return FALSE; + return false; } -BOOL LLParcel::allowTerraformBy(const LLUUID &agent_id) const +bool LLParcel::allowTerraformBy(const LLUUID &agent_id) const { if (agent_id == LLUUID::null) { // system always can enter - return TRUE; + return true; } else if(OS_LEASED == mStatus) { if(agent_id == mOwnerID) { // owner can modify leased land - return TRUE; + return true; } else { @@ -416,7 +416,7 @@ BOOL LLParcel::allowTerraformBy(const LLUUID &agent_id) const } else { - return FALSE; + return false; } } @@ -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); @@ -728,21 +728,21 @@ void LLParcel::expirePasses(S32 now) bool LLParcel::operator==(const LLParcel &rhs) const { if (mOwnerID != rhs.mOwnerID) - return FALSE; + return false; if (mParcelFlags != rhs.mParcelFlags) - return FALSE; + return false; if (mClaimDate != rhs.mClaimDate) - return FALSE; + return false; if (mClaimPricePerMeter != rhs.mClaimPricePerMeter) - return FALSE; + return false; if (mRentPricePerMeter != rhs.mRentPricePerMeter) - return FALSE; + return false; - return TRUE; + return true; } // Calculate rent @@ -787,16 +787,16 @@ 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) { - return FALSE; + return false; } if (agent_id == getOwnerID()) { // Can't add owner to these lists - return FALSE; + return false; } LLAccessEntry::map::iterator itor = mAccessList.begin(); while (itor != mAccessList.end()) @@ -811,7 +811,7 @@ BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) else { // existing one expires later - return FALSE; + return false; } } else @@ -825,20 +825,20 @@ BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) new_entry.mTime = time; new_entry.mFlags = 0x0; mAccessList[new_entry.mID] = new_entry; - return TRUE; + 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) { // Not using ban list, so not a rational thing to do - return FALSE; + return false; } if (agent_id == getOwnerID()) { // Can't add owner to these lists - return FALSE; + return false; } LLAccessEntry::map::iterator itor = mBanList.begin(); @@ -854,7 +854,7 @@ BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) else { // existing one expires later - return FALSE; + return false; } } else @@ -868,13 +868,13 @@ BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) new_entry.mTime = time; new_entry.mFlags = 0x0; mBanList[new_entry.mID] = new_entry; - return TRUE; + return true; } -BOOL remove_from_access_array(std::map<LLUUID,LLAccessEntry>* list, +bool remove_from_access_array(std::map<LLUUID,LLAccessEntry>* 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<LLUUID,LLAccessEntry>* 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<LLUUID,LLAccessEntry>* 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) + if (!mSaleTimerExpires.getStarted()) { - return 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()) { - return 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 @@ -1011,11 +1011,11 @@ void LLParcel::expireSale( mSaleTimerExpires.setTimerExpirySec(0.0); mSaleTimerExpires.stop(); setPreviousOwnerID(LLUUID::null); - setPreviouslyGroupOwned(FALSE); - setSellWithObjects(FALSE); + setPreviouslyGroupOwned(false); + setSellWithObjects(false); type = TRANS_LAND_RELEASE; mStatus = OS_NONE; - flags = pack_transaction_flags(mGroupOwned, FALSE); + flags = pack_transaction_flags(mGroupOwned, false); mAuthBuyerID.setNull(); from_id = mOwnerID; mOwnerID.setNull(); @@ -1037,12 +1037,12 @@ void LLParcel::completeSale( // Purchased parcels are assumed to no longer be for sale. // Otherwise someone can snipe the sale. - setForSale(FALSE); + setForSale(false); setAuctionID(0); // 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(); @@ -1062,23 +1062,23 @@ void LLParcel::clearSale() mStatus = OS_LEASED; } mAuthBuyerID.setNull(); - setForSale(FALSE); + setForSale(false); setAuctionID(0); setPreviousOwnerID(LLUUID::null); - setPreviouslyGroupOwned(FALSE); - setSellWithObjects(FALSE); + setPreviouslyGroupOwned(false); + 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()) { - return TRUE; + return true; } return (mAuthBuyerID == buyer_id); } @@ -1093,15 +1093,15 @@ void LLParcel::clearParcel() setMediaID(LLUUID::null); setMediaDesc(LLStringUtil::null); setMediaAutoScale(0); - setMediaLoop(TRUE); + setMediaLoop(1); mMediaWidth = 0; mMediaHeight = 0; setMediaCurrentURL(LLStringUtil::null); - setMediaAllowNavigate(TRUE); - setMediaPreventCameraZoom(FALSE); + setMediaAllowNavigate(1); + setMediaPreventCameraZoom(0); setMediaURLTimeout(0.0f); setMusicURL(LLStringUtil::null); - setInEscrow(FALSE); + setInEscrow(false); setAuthorizedBuyerID(LLUUID::null); setCategory(C_NONE); setSnapshotID(LLUUID::null); diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index 8717f38ecf..67d713db1f 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 @@ -277,35 +277,35 @@ public: void setUserLocation(const LLVector3& pos) { mUserLocation = pos; } void setUserLookAt(const LLVector3& rot) { mUserLookAt = rot; } void setLandingType(const ELandingType type) { mLandingType = type; } - void setSeeAVs(BOOL see_avs) { mSeeAVs = see_avs; } + void setSeeAVs(bool see_avs) { mSeeAVs = see_avs; } void setHaveNewParcelLimitData(bool have_new_parcel_data) { mHaveNewParcelLimitData = have_new_parcel_data; } // Remove this once hidden AV feature is fully available grid-wide 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); - void setAllowModify(BOOL b) { setParcelFlag(PF_CREATE_OBJECTS, b); } - void setAllowGroupModify(BOOL b) { setParcelFlag(PF_CREATE_GROUP_OBJECTS, b); } - void setAllowAllObjectEntry(BOOL b) { setParcelFlag(PF_ALLOW_ALL_OBJECT_ENTRY, b); } - void setAllowGroupObjectEntry(BOOL b) { setParcelFlag(PF_ALLOW_GROUP_OBJECT_ENTRY, b); } - void setAllowTerraform(BOOL b){setParcelFlag(PF_ALLOW_TERRAFORM, b); } - void setAllowDamage(BOOL b) { setParcelFlag(PF_ALLOW_DAMAGE, b); } - void setAllowFly(BOOL b) { setParcelFlag(PF_ALLOW_FLY, b); } - void setAllowGroupScripts(BOOL b) { setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, b); } - void setAllowOtherScripts(BOOL b) { setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, b); } - void setAllowDeedToGroup(BOOL b) { setParcelFlag(PF_ALLOW_DEED_TO_GROUP, b); } - void setContributeWithDeed(BOOL b) { setParcelFlag(PF_CONTRIBUTE_WITH_DEED, b); } - void setForSale(BOOL b) { setParcelFlag(PF_FOR_SALE, b); } - void setSoundOnly(BOOL b) { setParcelFlag(PF_SOUND_LOCAL, b); } - void setDenyAnonymous(BOOL b) { setParcelFlag(PF_DENY_ANONYMOUS, b); } - void setDenyAgeUnverified(BOOL b) { setParcelFlag(PF_DENY_AGEUNVERIFIED, b); } - void setRestrictPushObject(BOOL b) { setParcelFlag(PF_RESTRICT_PUSHOBJECT, b); } - void setAllowGroupAVSounds(BOOL b) { mAllowGroupAVSounds = b; } - void setAllowAnyAVSounds(BOOL b) { mAllowAnyAVSounds = b; } + void setAllowModify(bool b) { setParcelFlag(PF_CREATE_OBJECTS, b); } + void setAllowGroupModify(bool b) { setParcelFlag(PF_CREATE_GROUP_OBJECTS, b); } + void setAllowAllObjectEntry(bool b) { setParcelFlag(PF_ALLOW_ALL_OBJECT_ENTRY, b); } + void setAllowGroupObjectEntry(bool b) { setParcelFlag(PF_ALLOW_GROUP_OBJECT_ENTRY, b); } + void setAllowTerraform(bool b){setParcelFlag(PF_ALLOW_TERRAFORM, b); } + void setAllowDamage(bool b) { setParcelFlag(PF_ALLOW_DAMAGE, b); } + void setAllowFly(bool b) { setParcelFlag(PF_ALLOW_FLY, b); } + void setAllowGroupScripts(bool b) { setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, b); } + void setAllowOtherScripts(bool b) { setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, b); } + void setAllowDeedToGroup(bool b) { setParcelFlag(PF_ALLOW_DEED_TO_GROUP, b); } + void setContributeWithDeed(bool b) { setParcelFlag(PF_CONTRIBUTE_WITH_DEED, b); } + void setForSale(bool b) { setParcelFlag(PF_FOR_SALE, b); } + void setSoundOnly(bool b) { setParcelFlag(PF_SOUND_LOCAL, b); } + void setDenyAnonymous(bool b) { setParcelFlag(PF_DENY_ANONYMOUS, b); } + void setDenyAgeUnverified(bool b) { setParcelFlag(PF_DENY_AGEUNVERIFIED, b); } + void setRestrictPushObject(bool b) { setParcelFlag(PF_RESTRICT_PUSHOBJECT, b); } + void setAllowGroupAVSounds(bool b) { mAllowGroupAVSounds = b; } + void setAllowAnyAVSounds(bool b) { mAllowAnyAVSounds = b; } void setObscureMOAP(bool b) { mObscureMOAP = b; } void setDrawDistance(F32 dist) { mDrawDistance = dist; } @@ -315,9 +315,9 @@ public: void setPassPrice(S32 price) { mPassPrice = price; } void setPassHours(F32 hours) { mPassHours = hours; } -// BOOL importStream(std::istream& input_stream); - BOOL importAccessEntry(std::istream& input_stream, LLAccessEntry* entry); - // BOOL exportStream(std::ostream& output_stream); +// bool importStream(std::istream& input_stream); + bool importAccessEntry(std::istream& input_stream, LLAccessEntry* entry); + // bool exportStream(std::ostream& output_stream); void packMessage(LLMessageSystem* msg); void packMessage(LLSD& msg); @@ -343,11 +343,11 @@ public: // time earlier than "now". 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); + // 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); // ACCESSORS const LLUUID& getID() const { return mID; } @@ -372,19 +372,19 @@ public: const LLUUID& getGroupID() const { return mGroupID; } S32 getPassPrice() const { return mPassPrice; } F32 getPassHours() const { return mPassHours; } - BOOL getIsGroupOwned() const { return mGroupOwned; } + bool getIsGroupOwned() const { return mGroupOwned; } 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 @@ -419,10 +419,10 @@ public: // dealing with sales and parcel conversion. // - // the isSaleTimerExpired will trivially return FALSE if there is + // 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,86 +440,54 @@ public: void clearSale(); - BOOL isMediaResetTimerExpired(const U64& time); + bool isMediaResetTimerExpired(const U64& time); // more accessors - U32 getParcelFlags() const { return mParcelFlags; } + U32 getParcelFlags() const { return mParcelFlags; } - BOOL getParcelFlag(U32 flag) const - { return (mParcelFlags & flag) ? TRUE : FALSE; } + bool getParcelFlag(U32 flag) const { return (mParcelFlags & flag) != 0; } // 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 getParcelFlag(PF_CREATE_OBJECTS); } // objects can be added or modified by group members - BOOL getAllowGroupModify() const - { return (mParcelFlags & PF_CREATE_GROUP_OBJECTS) ? TRUE : FALSE; } + bool getAllowGroupModify() const { return getParcelFlag(PF_CREATE_GROUP_OBJECTS); } // the parcel can be deeded to the group - BOOL getAllowDeedToGroup() const - { return (mParcelFlags & PF_ALLOW_DEED_TO_GROUP) ? TRUE : FALSE; } + bool getAllowDeedToGroup() const { return getParcelFlag(PF_ALLOW_DEED_TO_GROUP); } // Does the owner want to make a contribution along with the deed. - BOOL getContributeWithDeed() const - { return (mParcelFlags & PF_CONTRIBUTE_WITH_DEED) ? TRUE : FALSE; } + bool getContributeWithDeed() const { return getParcelFlag(PF_CONTRIBUTE_WITH_DEED); } // heightfield can be modified - BOOL getAllowTerraform() const - { return (mParcelFlags & PF_ALLOW_TERRAFORM) ? TRUE : FALSE; } + bool getAllowTerraform() const { return getParcelFlag(PF_ALLOW_TERRAFORM); } // avatars can be hurt here - BOOL getAllowDamage() const - { return (mParcelFlags & PF_ALLOW_DAMAGE) ? TRUE : FALSE; } - - BOOL getAllowFly() const - { return (mParcelFlags & PF_ALLOW_FLY) ? TRUE : FALSE; } - - BOOL getAllowGroupScripts() const - { return (mParcelFlags & PF_ALLOW_GROUP_SCRIPTS) ? TRUE : FALSE; } - - BOOL getAllowOtherScripts() const - { return (mParcelFlags & PF_ALLOW_OTHER_SCRIPTS) ? TRUE : FALSE; } - - BOOL getAllowAllObjectEntry() const - { return (mParcelFlags & PF_ALLOW_ALL_OBJECT_ENTRY) ? TRUE : FALSE; } - - BOOL getAllowGroupObjectEntry() const - { return (mParcelFlags & PF_ALLOW_GROUP_OBJECT_ENTRY) ? TRUE : FALSE; } - - BOOL getForSale() const - { return (mParcelFlags & PF_FOR_SALE) ? TRUE : FALSE; } - BOOL getSoundLocal() const - { return (mParcelFlags & PF_SOUND_LOCAL) ? TRUE : FALSE; } - BOOL getParcelFlagAllowVoice() const - { return (mParcelFlags & PF_ALLOW_VOICE_CHAT) ? TRUE : FALSE; } - BOOL getParcelFlagUseEstateVoiceChannel() const - { return (mParcelFlags & PF_USE_ESTATE_VOICE_CHAN) ? TRUE : FALSE; } - BOOL getAllowPublish() const - { return (mParcelFlags & PF_ALLOW_PUBLISH) ? TRUE : FALSE; } - BOOL getMaturePublish() const - { return (mParcelFlags & PF_MATURE_PUBLISH) ? TRUE : FALSE; } - BOOL getRestrictPushObject() const - { return (mParcelFlags & PF_RESTRICT_PUSHOBJECT) ? TRUE : FALSE; } - BOOL getRegionPushOverride() const - { return mRegionPushOverride; } - BOOL getRegionDenyAnonymousOverride() const - { return mRegionDenyAnonymousOverride; } - BOOL getRegionDenyAgeUnverifiedOverride() const - { return mRegionDenyAgeUnverifiedOverride; } - BOOL getRegionAllowAccessOverride() const - { return mRegionAllowAccessoverride; } - BOOL getRegionAllowEnvironmentOverride() const - { return mRegionAllowEnvironmentOverride; } - S32 getParcelEnvironmentVersion() const - { return mCurrentEnvironmentVersion; } - - - BOOL getAllowGroupAVSounds() const { return mAllowGroupAVSounds; } - BOOL getAllowAnyAVSounds() const { return mAllowAnyAVSounds; } - - bool getObscureMOAP() const { return mObscureMOAP; } + bool getAllowDamage() const { return getParcelFlag(PF_ALLOW_DAMAGE); } + + bool getAllowFly() const { return getParcelFlag(PF_ALLOW_FLY); } + bool getAllowGroupScripts() const { return getParcelFlag(PF_ALLOW_GROUP_SCRIPTS); } + bool getAllowOtherScripts() const { return getParcelFlag(PF_ALLOW_OTHER_SCRIPTS); } + bool getAllowAllObjectEntry() const { return getParcelFlag(PF_ALLOW_ALL_OBJECT_ENTRY); } + bool getAllowGroupObjectEntry() const { return getParcelFlag(PF_ALLOW_GROUP_OBJECT_ENTRY); } + bool getForSale() const { return getParcelFlag(PF_FOR_SALE); } + bool getSoundLocal() const { return getParcelFlag(PF_SOUND_LOCAL); } + bool getParcelFlagAllowVoice() const { return getParcelFlag(PF_ALLOW_VOICE_CHAT); } + bool getParcelFlagUseEstateVoiceChannel() const { return getParcelFlag(PF_USE_ESTATE_VOICE_CHAN); } + bool getAllowPublish() const { return getParcelFlag(PF_ALLOW_PUBLISH); } + bool getMaturePublish() const { return getParcelFlag(PF_MATURE_PUBLISH); } + bool getRestrictPushObject() const { return getParcelFlag(PF_RESTRICT_PUSHOBJECT); } + + bool getRegionPushOverride() const { return mRegionPushOverride; } + bool getRegionDenyAnonymousOverride() const { return mRegionDenyAnonymousOverride; } + bool getRegionDenyAgeUnverifiedOverride() const { return mRegionDenyAgeUnverifiedOverride; } + bool getRegionAllowAccessOverride() const { return mRegionAllowAccessoverride; } + bool getRegionAllowEnvironmentOverride() const { return mRegionAllowEnvironmentOverride; } + S32 getParcelEnvironmentVersion() const { return mCurrentEnvironmentVersion; } + bool getAllowGroupAVSounds() const { return mAllowGroupAVSounds; } + bool getAllowAnyAVSounds() const { return mAllowAnyAVSounds; } + bool getObscureMOAP() const { return mObscureMOAP; } F32 getDrawDistance() const { return mDrawDistance; } S32 getSalePrice() const { return mSalePrice; } @@ -537,10 +505,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; @@ -582,30 +550,30 @@ public: void setParcelPrimBonus(F32 bonus) { mParcelPrimBonus = bonus; } void setCleanOtherTime(S32 time) { mCleanOtherTime = time; } - void setRegionPushOverride(BOOL override) {mRegionPushOverride = override; } - void setRegionDenyAnonymousOverride(BOOL override) { mRegionDenyAnonymousOverride = override; } - void setRegionDenyAgeUnverifiedOverride(BOOL override) { mRegionDenyAgeUnverifiedOverride = override; } - void setRegionAllowAccessOverride(BOOL override) { mRegionAllowAccessoverride = override; } - void setRegionAllowEnvironmentOverride(BOOL override) { mRegionAllowEnvironmentOverride = override; } + void setRegionPushOverride(bool override) {mRegionPushOverride = override; } + void setRegionDenyAnonymousOverride(bool override) { mRegionDenyAnonymousOverride = override; } + void setRegionDenyAgeUnverifiedOverride(bool override) { mRegionDenyAgeUnverifiedOverride = override; } + void setRegionAllowAccessOverride(bool override) { mRegionAllowAccessoverride = override; } + void setRegionAllowEnvironmentOverride(bool override) { mRegionAllowEnvironmentOverride = override; } void setParcelEnvironmentVersion(S32 version) { mCurrentEnvironmentVersion = version; } // Accessors for parcel sellWithObjects void setPreviousOwnerID(LLUUID prev_owner) { mPreviousOwnerID = prev_owner; } - void setPreviouslyGroupOwned(BOOL b) { mPreviouslyGroupOwned = b; } - void setSellWithObjects(BOOL b) { setParcelFlag(PF_SELL_PARCEL_OBJECTS, b); } + void setPreviouslyGroupOwned(bool b) { mPreviouslyGroupOwned = b; } + void setSellWithObjects(bool b) { setParcelFlag(PF_SELL_PARCEL_OBJECTS, b); } LLUUID getPreviousOwnerID() const { return mPreviousOwnerID; } - BOOL getPreviouslyGroupOwned() const { return mPreviouslyGroupOwned; } - BOOL getSellWithObjects() const { return (mParcelFlags & PF_SELL_PARCEL_OBJECTS) ? TRUE : FALSE; } + bool getPreviouslyGroupOwned() const { return mPreviouslyGroupOwned; } + bool getSellWithObjects() const { return getParcelFlag(PF_SELL_PARCEL_OBJECTS); } protected: LLUUID mID; LLUUID mOwnerID; LLUUID mGroupID; - BOOL mGroupOwned; // TRUE if mOwnerID is a group_id + bool mGroupOwned; // true if mOwnerID is a group_id LLUUID mPreviousOwnerID; - BOOL mPreviouslyGroupOwned; + bool mPreviouslyGroupOwned; EOwnershipStatus mStatus; ECategory mCategory; @@ -614,8 +582,8 @@ protected: LLVector3 mUserLocation; LLVector3 mUserLookAt; ELandingType mLandingType; - BOOL mSeeAVs; // Avatars on this parcel are visible from outside it - BOOL mHaveNewParcelLimitData; // Remove once hidden AV feature is grid-wide + bool mSeeAVs; // Avatars on this parcel are visible from outside it + bool mHaveNewParcelLimitData; // Remove once hidden AV feature is grid-wide LLTimer mSaleTimerExpires; LLTimer mMediaResetTimer; @@ -666,13 +634,13 @@ protected: S32 mTempPrimCount; F32 mParcelPrimBonus; S32 mCleanOtherTime; - BOOL mRegionPushOverride; - BOOL mRegionDenyAnonymousOverride; - BOOL mRegionDenyAgeUnverifiedOverride; - BOOL mRegionAllowAccessoverride; - BOOL mRegionAllowEnvironmentOverride; - BOOL mAllowGroupAVSounds; - BOOL mAllowAnyAVSounds; + bool mRegionPushOverride; + bool mRegionDenyAnonymousOverride; + bool mRegionDenyAgeUnverifiedOverride; + bool mRegionAllowAccessoverride; + bool mRegionAllowEnvironmentOverride; + bool mAllowGroupAVSounds; + bool mAllowAnyAVSounds; bool mObscureMOAP; S32 mCurrentEnvironmentVersion; @@ -692,13 +660,11 @@ public: void setExperienceKeyType(const LLUUID& experience_key, U32 type); U32 countExperienceKeyType(U32 type); - U32 getExperienceKeyType(const LLUUID& experience_key)const; LLAccessEntry::map getExperienceKeysByType(U32 type)const; void clearExperienceKeysByType(U32 type); private: xp_type_map_t mExperienceKeys; - }; diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp index 65df5ebb91..c8963881df 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 = false; 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 b6071118ff..a68abcfa34 100644 --- a/indra/llinventory/llpermissions.h +++ b/indra/llinventory/llpermissions.h @@ -151,18 +151,18 @@ public: U32 getMaskEveryone() const { return mMaskEveryone; } U32 getMaskNextOwner() const { return mMaskNextOwner; } - // return TRUE if the object has any owner + // return true if the object has any owner bool isOwned() const { return (mOwner.notNull() || mIsGroupOwned); } - // return TRUE if group_id is owner. + // return true if group_id is owner. bool isGroupOwned() const { return mIsGroupOwned; } - // This API returns TRUE if the object is owned at all, and FALSE + // This API returns true if the object is owned at all, and false // otherwise. If it is owned at all, owner id is filled with // 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 @@ -237,18 +237,18 @@ public: // checked manipulators (since that is how it is used.) If the // agent is the system or (group == mGroup and group modify and // 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); - // Attempt to set or clear the given bitmask. Returns TRUE if you + // 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); + // 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); + // 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); // 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. @@ -270,6 +270,7 @@ public: inline bool allowModifyBy(const LLUUID &agent_id) const; inline bool allowCopyBy(const LLUUID& agent_id) const; inline bool allowMoveBy(const LLUUID& agent_id) const; + inline bool allowModifyBy(const LLUUID &agent_id, const LLUUID& group) const; inline bool allowCopyBy(const LLUUID& agent_id, const LLUUID& group) const; inline bool allowMoveBy(const LLUUID &agent_id, const LLUUID &group) const; @@ -278,27 +279,11 @@ public: // current owner is allowed to transfer to the specified agent id. inline bool allowTransferTo(const LLUUID &agent_id) const; - // - // DEPRECATED. - // - // These return true if the given agent can perform the function. - // They also return true if the object isn't owned, or the - // requesting agent is a system agent. See llpermissionsflags.h - // for bits. - //BOOL allowDeleteBy(const LLUUID& agent_id) const { return allowModifyBy(agent_id); } - //BOOL allowEditBy(const LLUUID& agent_id) const { return allowModifyBy(agent_id); } - // saves last owner and sets current owner - //BOOL setOwner(const LLUUID& agent, const LLUUID& owner); - // This method saves the last owner, sets the current owner to the - // one provided, and sets the base mask as indicated. - //BOOL setOwner(const LLUUID& agent, const LLUUID& owner, U32 new_base_mask); - - // 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 setGroupBits( const LLUUID& agent, BOOL set, PermissionMask bits); - //BOOL setEveryoneBits(const LLUUID& agent, BOOL set, PermissionMask bits); + // Returns true if the object can exported by the given agent + // (e.g. saved as a local .gltf file) + // The current test should return true if the agent is the owner + // AND the creator of the object. + inline bool allowExportBy(const LLUUID& agent_id) const; // // MISC METHODS and OPERATORS @@ -311,8 +296,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; @@ -353,6 +338,11 @@ bool LLPermissions::allowMoveBy(const LLUUID& agent) const return allowOperationBy(PERM_MOVE, agent, LLUUID::null); } +bool LLPermissions::allowExportBy(const LLUUID& agent) const +{ + return agent == mOwner && agent == mCreator; +} + bool LLPermissions::allowTransferTo(const LLUUID &agent_id) const { if (mIsGroupOwned) @@ -361,7 +351,7 @@ bool LLPermissions::allowTransferTo(const LLUUID &agent_id) const } else { - return ((mOwner == agent_id) ? TRUE : allowOperationBy(PERM_TRANSFER, mOwner)); + return ((mOwner == agent_id) ? true : allowOperationBy(PERM_TRANSFER, mOwner)); } } @@ -401,8 +391,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 +422,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); diff --git a/indra/llinventory/llsaleinfo.cpp b/indra/llinventory/llsaleinfo.cpp index d38ffcc4bf..98836b178e 100644 --- a/indra/llinventory/llsaleinfo.cpp +++ b/indra/llinventory/llsaleinfo.cpp @@ -66,7 +66,7 @@ LLSaleInfo::LLSaleInfo(EForSale sale_type, S32 sale_price) : mSalePrice = llclamp(mSalePrice, 0, S32_MAX); } -BOOL LLSaleInfo::isForSale() const +bool LLSaleInfo::isForSale() const { return (FS_NOT != mSaleType); } @@ -78,13 +78,13 @@ U32 LLSaleInfo::getCRC32() const return rv; } -BOOL LLSaleInfo::exportLegacyStream(std::ostream& output_stream) const +bool LLSaleInfo::exportLegacyStream(std::ostream& output_stream) const { output_stream << "\tsale_info\t0\n\t{\n"; output_stream << "\t\tsale_type\t" << lookup(mSaleType) << "\n"; output_stream << "\t\tsale_price\t" << mSalePrice << "\n"; output_stream <<"\t}\n"; - return TRUE; + return true; } LLSD LLSaleInfo::asLLSD() const @@ -95,7 +95,7 @@ LLSD LLSaleInfo::asLLSD() const return sd; } -bool LLSaleInfo::fromLLSD(const LLSD& sd, BOOL& has_perm_mask, U32& perm_mask) +bool LLSaleInfo::fromLLSD(const LLSD& sd, bool& has_perm_mask, U32& perm_mask) { const char *w; @@ -113,22 +113,22 @@ bool LLSaleInfo::fromLLSD(const LLSD& sd, BOOL& has_perm_mask, U32& perm_mask) w = "perm_mask"; if (sd.has(w)) { - has_perm_mask = TRUE; + has_perm_mask = true; perm_mask = ll_U32_from_sd(sd[w]); } return true; } -BOOL LLSaleInfo::importLegacyStream(std::istream& input_stream, BOOL& has_perm_mask, U32& perm_mask) +bool LLSaleInfo::importLegacyStream(std::istream& input_stream, bool& has_perm_mask, U32& perm_mask) { - has_perm_mask = FALSE; + has_perm_mask = false; // *NOTE: Changing the buffer size will require changing the scanf // calls below. char buffer[MAX_STRING]; /* Flawfinder: ignore */ char keyword[MAX_STRING]; /* Flawfinder: ignore */ char valuestr[MAX_STRING]; /* Flawfinder: ignore */ - BOOL success = TRUE; + bool success = true; keyword[0] = '\0'; valuestr[0] = '\0'; @@ -163,7 +163,7 @@ BOOL LLSaleInfo::importLegacyStream(std::istream& input_stream, BOOL& has_perm_m else if (!strcmp("perm_mask", keyword)) { //LL_INFOS() << "found deprecated keyword perm_mask" << LL_ENDL; - has_perm_mask = TRUE; + has_perm_mask = true; sscanf(valuestr, "%x", &perm_mask); } else diff --git a/indra/llinventory/llsaleinfo.h b/indra/llinventory/llsaleinfo.h index 961b6f4236..44eb841641 100644 --- a/indra/llinventory/llsaleinfo.h +++ b/indra/llinventory/llsaleinfo.h @@ -74,7 +74,7 @@ public: LLSaleInfo(EForSale sale_type, S32 sale_price); // accessors - BOOL isForSale() const; + bool isForSale() const; EForSale getSaleType() const { return mSaleType; } S32 getSalePrice() const { return mSalePrice; } U32 getCRC32() const; @@ -84,11 +84,11 @@ public: void setSalePrice(S32 price); //void setNextOwnerPermMask(U32 mask) { mNextOwnerPermMask = mask; } - BOOL exportLegacyStream(std::ostream& output_stream) const; + bool exportLegacyStream(std::ostream& output_stream) const; LLSD asLLSD() const; operator LLSD() const { return asLLSD(); } - bool fromLLSD(const LLSD& sd, BOOL& has_perm_mask, U32& perm_mask); - BOOL importLegacyStream(std::istream& input_stream, BOOL& has_perm_mask, U32& perm_mask); + bool fromLLSD(const LLSD& sd, bool& has_perm_mask, U32& perm_mask); + bool importLegacyStream(std::istream& input_stream, bool& has_perm_mask, U32& perm_mask); LLSD packMessage() const; void unpackMessage(LLSD sales); diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index ef6a187d06..2ff1cc74c6 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -111,10 +111,10 @@ const LLSettingsDay::Seconds LLSettingsDay::MINIMUM_DAYOFFSET(0); const LLSettingsDay::Seconds LLSettingsDay::DEFAULT_DAYOFFSET(57600); // +16 hours == -8 hours (SLT time offset) const LLSettingsDay::Seconds LLSettingsDay::MAXIMUM_DAYOFFSET(86400); // 24 hours -const S32 LLSettingsDay::TRACK_WATER(0); // water track is 0 -const S32 LLSettingsDay::TRACK_GROUND_LEVEL(1); -const S32 LLSettingsDay::TRACK_MAX(5); // 5 tracks, 4 skys, 1 water -const S32 LLSettingsDay::FRAME_MAX(56); +const U32 LLSettingsDay::TRACK_WATER(0); // water track is 0 +const U32 LLSettingsDay::TRACK_GROUND_LEVEL(1); +const U32 LLSettingsDay::TRACK_MAX(5); // 5 tracks, 4 skys, 1 water +const U32 LLSettingsDay::FRAME_MAX(56); const F32 LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR(0.02501f); @@ -462,7 +462,7 @@ namespace // Trim extra tracks. while (value.size() > LLSettingsDay::TRACK_MAX) { - value.erase(value.size() - 1); + value.erase(static_cast<LLSD::Integer>(value.size()) - 1); } S32 framecount(0); @@ -511,7 +511,7 @@ namespace } - int waterTracks = value[0].size(); + int waterTracks = static_cast<int>(value[0].size()); int skyTracks = framecount - waterTracks; if (waterTracks < 1) diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h index 4a46eba6fe..917b0870f2 100644 --- a/indra/llinventory/llsettingsdaycycle.h +++ b/indra/llinventory/llsettingsdaycycle.h @@ -59,10 +59,10 @@ public: static const Seconds DEFAULT_DAYOFFSET; static const Seconds MAXIMUM_DAYOFFSET; - static const S32 TRACK_WATER; - static const S32 TRACK_GROUND_LEVEL; - static const S32 TRACK_MAX; - static const S32 FRAME_MAX; + static const U32 TRACK_WATER; + static const U32 TRACK_GROUND_LEVEL; + static const U32 TRACK_MAX; + static const U32 FRAME_MAX; static const F32 DEFAULT_FRAME_SLOP_FACTOR; diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index 222ab040cb..40bb337a48 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -62,7 +62,7 @@ public: static const std::string SETTING_DOME_OFFSET; static const std::string SETTING_DOME_RADIUS; static const std::string SETTING_GAMMA; - static const std::string SETTING_GLOW; + static const std::string SETTING_GLOW; static const std::string SETTING_LIGHT_NORMAL; static const std::string SETTING_MAX_Y; static const std::string SETTING_MOON_ROTATION; @@ -92,7 +92,7 @@ public: static const std::string SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR; static const std::string SETTING_DENSITY_PROFILE_LINEAR_TERM; static const std::string SETTING_DENSITY_PROFILE_CONSTANT_TERM; - + static const std::string SETTING_SKY_MOISTURE_LEVEL; static const std::string SETTING_SKY_DROPLET_RADIUS; static const std::string SETTING_SKY_ICE_LEVEL; @@ -117,7 +117,7 @@ public: virtual std::string getSettingsType() const SETTINGS_OVERRIDE { return std::string("sky"); } virtual LLSettingsType::type_e getSettingsTypeValue() const SETTINGS_OVERRIDE { return LLSettingsType::ST_SKY; } - // Settings status + // Settings status virtual void blend(const LLSettingsBase::ptr_t &end, F64 blendf) SETTINGS_OVERRIDE; virtual void replaceSettings(LLSD settings) SETTINGS_OVERRIDE; @@ -129,7 +129,7 @@ public: F32 getSkyBottomRadius() const; F32 getSkyTopRadius() const; F32 getSunArcRadians() const; - F32 getMieAnisotropy() const; + F32 getMieAnisotropy() const; F32 getSkyMoistureLevel() const; F32 getSkyDropletRadius() const; @@ -196,7 +196,7 @@ public: F32 getCloudShadow() const; void setCloudShadow(F32 val); - + F32 getCloudVariance() const; void setCloudVariance(F32 val); @@ -295,7 +295,7 @@ public: // color based on brightness LLColor3 getMoonlightColor() const; - + LLColor4 getMoonAmbient() const; LLColor3 getMoonDiffuse() const; LLColor4 getSunAmbient() const; diff --git a/indra/llinventory/lltransactionflags.cpp b/indra/llinventory/lltransactionflags.cpp index fc3e684a65..3719a295c3 100644 --- a/indra/llinventory/lltransactionflags.cpp +++ b/indra/llinventory/lltransactionflags.cpp @@ -38,7 +38,7 @@ const U8 TRANSACTION_FLAG_OWNER_GROUP = 4; const U8 TRANSACTION_FLAG_SIMULTANEOUS_CONTRIBUTION = 8; const U8 TRANSACTION_FLAG_SIMULTANEOUS_CONTRIBUTION_REMOVAL = 16; -U8 pack_transaction_flags(BOOL is_source_group, BOOL is_dest_group) +U8 pack_transaction_flags(bool is_source_group, bool is_dest_group) { U8 rv = 0; if(is_source_group) rv |= TRANSACTION_FLAG_SOURCE_GROUP; @@ -46,17 +46,17 @@ U8 pack_transaction_flags(BOOL is_source_group, BOOL is_dest_group) return rv; } -BOOL is_tf_source_group(TransactionFlags flags) +bool is_tf_source_group(TransactionFlags flags) { return ((flags & TRANSACTION_FLAG_SOURCE_GROUP) == TRANSACTION_FLAG_SOURCE_GROUP); } -BOOL is_tf_dest_group(TransactionFlags flags) +bool is_tf_dest_group(TransactionFlags flags) { return ((flags & TRANSACTION_FLAG_DEST_GROUP) == TRANSACTION_FLAG_DEST_GROUP); } -BOOL is_tf_owner_group(TransactionFlags flags) +bool is_tf_owner_group(TransactionFlags flags) { return ((flags & TRANSACTION_FLAG_OWNER_GROUP) == TRANSACTION_FLAG_OWNER_GROUP); } @@ -79,6 +79,7 @@ void append_reason( break; case TRANS_GROUP_LAND_DEED: ostr << " for deeding land"; + break; default: break; } diff --git a/indra/llinventory/lltransactionflags.h b/indra/llinventory/lltransactionflags.h index bb267ad2be..3c61b785a3 100644 --- a/indra/llinventory/lltransactionflags.h +++ b/indra/llinventory/lltransactionflags.h @@ -39,10 +39,10 @@ extern const TransactionFlags TRANSACTION_FLAG_SIMULTANEOUS_CONTRIBUTION; extern const TransactionFlags TRANSACTION_FLAG_SIMULTANEOUS_CONTRIBUTION_REMOVAL; // very simple helper functions -TransactionFlags pack_transaction_flags(BOOL is_source_group, BOOL is_dest_group); -BOOL is_tf_source_group(TransactionFlags flags); -BOOL is_tf_dest_group(TransactionFlags flags); -BOOL is_tf_owner_group(TransactionFlags flags); +TransactionFlags pack_transaction_flags(bool is_source_group, bool is_dest_group); +bool is_tf_source_group(TransactionFlags flags); +bool is_tf_dest_group(TransactionFlags flags); +bool is_tf_owner_group(TransactionFlags flags); // stupid helper functions which should be replaced with some kind of // internationalizeable message. diff --git a/indra/llinventory/tests/inventorymisc_test.cpp b/indra/llinventory/tests/inventorymisc_test.cpp index a2a6aa339f..bcf6131bd8 100644 --- a/indra/llinventory/tests/inventorymisc_test.cpp +++ b/indra/llinventory/tests/inventorymisc_test.cpp @@ -374,7 +374,7 @@ namespace tut LLPointer<LLInventoryItem> src1 = create_random_inventory_item(); std::ostringstream ostream; - src1->exportLegacyStream(ostream, TRUE); + src1->exportLegacyStream(ostream, true); std::istringstream istream(ostream.str()); LLPointer<LLInventoryItem> src2 = new LLInventoryItem(); @@ -496,7 +496,7 @@ namespace tut LLPointer<LLInventoryCategory> src1 = create_random_inventory_cat(); std::ostringstream ostream; - src1->exportLegacyStream(ostream, TRUE); + src1->exportLegacyStream(ostream, true); std::istringstream istream(ostream.str()); LLPointer<LLInventoryCategory> src2 = new LLInventoryCategory(); |