From f342d1765948ede4f47bd67ad071ec5cdb027f0f Mon Sep 17 00:00:00 2001 From: Cinder <cinder@sdf.org> Date: Wed, 29 Oct 2014 09:42:52 -0600 Subject: [PATCH] Size fixes and misc --- indra/newview/llfloaterworldmap.cpp | 3 ++- indra/newview/llgiveinventory.cpp | 16 ++++++++-------- indra/newview/lllogchat.cpp | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index f7964178e1..bf17d6722a 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -250,7 +250,8 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) mTrackedStatus(LLTracker::TRACKING_NOTHING), mListFriendCombo(NULL), mListLandmarkCombo(NULL), - mListSearchResults(NULL) + mListSearchResults(NULL), + mPanel(nullptr) { gFloaterWorldMap = this; diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 813d2081ce..87e8a23144 100755 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -50,7 +50,7 @@ // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES // or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a // bit from there to give some pad. -const S32 MAX_ITEMS = 42; +const size_t MAX_ITEMS = 50; class LLGiveable : public LLInventoryCollectFunctor { @@ -248,9 +248,9 @@ bool LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent, items, LLInventoryModel::EXCLUDE_TRASH, giveable); - S32 count = cats.size(); + size_t count = cats.size(); bool complete = true; - for(S32 i = 0; i < count; ++i) + for(size_t i = 0; i < count; ++i) { if (!gInventory.isCategoryComplete(cats.at(i)->getUUID())) { @@ -447,8 +447,8 @@ bool LLGiveInventory::handleCopyProtectedCategory(const LLSD& notification, cons items, LLInventoryModel::EXCLUDE_TRASH, remove); - S32 count = items.size(); - for(S32 i = 0; i < count; ++i) + size_t count = items.size(); + for(size_t i = 0; i < count; ++i) { gInventory.deleteObject(items.at(i)->getUUID()); } @@ -504,7 +504,7 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < // MTUBYTES or 18 * count < 1200 => count < 1200/18 => // 66. I've cut it down a bit from there to give some pad. - S32 count = items.size() + cats.size(); + size_t count = items.size() + cats.size(); if (count > MAX_ITEMS) { LLNotificationsUtil::add("TooManyItems"); @@ -521,7 +521,7 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, LLAgentUI::buildFullname(name); LLUUID transaction_id; transaction_id.generate(); - S32 bucket_size = (sizeof(U8) + UUID_BYTES) * (count + 1); + size_t bucket_size = (sizeof(U8) + UUID_BYTES) * (count + 1); U8* bucket = new U8[bucket_size]; U8* pos = bucket; U8 type = (U8)cat->getType(); @@ -529,7 +529,7 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, pos += sizeof(U8); memcpy(pos, &(cat->getUUID()), UUID_BYTES); /* Flawfinder: ignore */ pos += UUID_BYTES; - S32 i; + size_t i; count = cats.size(); for(i = 0; i < count; ++i) { diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 18b74ad8de..0a4e1bed05 100755 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -59,7 +59,7 @@ #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/local_time_adjustor.hpp> -const S32 LOG_RECALL_SIZE = 2048; +const size_t LOG_RECALL_SIZE = 2048; const std::string LL_IM_TIME("time"); const std::string LL_IM_TEXT("message"); @@ -570,7 +570,7 @@ void LLLogChat::findTranscriptFiles(std::string pattern, std::vector<std::string LLFILE * filep = LLFile::fopen(fullname, "rb"); if (NULL != filep) { - if(makeLogFileName("chat")== fullname) + if(makeLogFileName("chat") == fullname) { //Add Nearby chat history to the list of transcriptions list_of_transcriptions.push_back(gDirUtilp->add(dirname, filename)); @@ -580,7 +580,7 @@ void LLLogChat::findTranscriptFiles(std::string pattern, std::vector<std::string char buffer[LOG_RECALL_SIZE]; fseek(filep, 0, SEEK_END); // seek to end of file - S32 bytes_to_read = ftell(filep); // get current file pointer + size_t bytes_to_read = ftell(filep); // get current file pointer fseek(filep, 0, SEEK_SET); // seek back to beginning of file // limit the number characters to read from file -- GitLab