Fix win32 warnings

This commit is contained in:
Liru Færs
2019-10-11 15:53:27 -04:00
parent b5afce0bbd
commit bd2c67e8ec
12 changed files with 28 additions and 27 deletions

View File

@@ -139,7 +139,7 @@ bool skip_to_end_of_next_keyword(const char* keyword, std::istream& input_stream
}
else
{
int key_index = 1;
size_t key_index = 1;
while ( key_index < key_length
&& keyword[key_index - 1] == c
&& input_stream.good())

View File

@@ -577,7 +577,7 @@ std::string utf8str_truncate(const std::string& utf8str, const S32 max_len)
}
// [RLVa:KB] - Checked: RLVa-2.1.0
std::string utf8str_substr(const std::string& utf8str, const S32 index, const S32 max_len)
std::string utf8str_substr(const std::string& utf8str, const size_t index, const size_t max_len)
{
if (0 == max_len)
{
@@ -589,7 +589,7 @@ std::string utf8str_substr(const std::string& utf8str, const S32 index, const S3
}
else
{
S32 cur_char = max_len;
size_t cur_char = max_len;
// If we're ASCII, we don't need to do anything
if ((U8)utf8str[index + cur_char] > 0x7f)
@@ -648,7 +648,7 @@ void utf8str_split(std::list<std::string>& split_list, const std::string& utf8st
}
// [/RLVa:KB]
std::string utf8str_symbol_truncate(const std::string& utf8str, const S32 symbol_len)
std::string utf8str_symbol_truncate(const std::string& utf8str, const size_t symbol_len)
{
if (0 == symbol_len)
{
@@ -660,7 +660,7 @@ std::string utf8str_symbol_truncate(const std::string& utf8str, const S32 symbol
}
else
{
int len = 0, byteIndex = 0;
size_t len = 0, byteIndex = 0;
const char* aStr = utf8str.c_str();
size_t origSize = utf8str.size();

View File

@@ -608,7 +608,7 @@ LLSettingsDay::validation_list_t LLSettingsDay::validationList()
return validation;
}
LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrack(S32 track)
LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrack(size_t track)
{
static CycleTrack_t emptyTrack;
if (mDayTracks.size() <= track)
@@ -617,7 +617,7 @@ LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrack(S32 track)
return mDayTracks[track];
}
const LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrackConst(S32 track) const
const LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrackConst(size_t track) const
{
static CycleTrack_t emptyTrack;
if (mDayTracks.size() <= track)

View File

@@ -118,8 +118,8 @@ public:
virtual LLSettingsWaterPtr_t buildWater(LLSD) const = 0;
void setInitialized(bool value = true) { mInitialized = value; }
CycleTrack_t & getCycleTrack(S32 track);
const CycleTrack_t & getCycleTrackConst(S32 track) const;
CycleTrack_t & getCycleTrack(size_t track);
const CycleTrack_t & getCycleTrackConst(size_t track) const;
bool clearCycleTrack(S32 track);
bool replaceCycleTrack(S32 track, const CycleTrack_t &source);
bool isTrackEmpty(S32 track) const;

View File

@@ -6331,7 +6331,9 @@ void LLVolumeFace::allocateIndices(S32 num_indices, bool copy)
S32 new_size = ((num_indices * sizeof(U16)) + 0xF) & ~0xF;
if (copy && num_indices && mIndices && mNumIndices)
{
#if !LL_USE_TCMALLOC
S32 old_size = ((mNumIndices * sizeof(U16)) + 0xF) & ~0xF;
#endif
mIndices = (U16*)ll_aligned_realloc_16(mIndices, new_size, old_size);

View File

@@ -4355,7 +4355,7 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s
if (mReadOnly && mParseHTML && !is_link) // Singu Note: Do not replace html if the user is going to edit it. (Like in profiles)
{
LL_RECORD_BLOCK_TIME(FTM_PARSE_HTML);
S32 start=0,end=0;
size_t start=0, end=0;
LLUrlMatch match;
auto append_substr = [&](const size_t& pos, const size_t& count)
{

View File

@@ -736,7 +736,7 @@ void LLFavoritesBarCtrl::updateButtons()
}
const child_list_t* childs = getChildList();
child_list_const_iter_t child_it = childs->begin();
int first_changed_item_index = 0;
size_t first_changed_item_index = 0;
int rightest_point = getRect().mRight - mMoreTextBox->getRect().getWidth();
//lets find first changed button
while (child_it != childs->end() && first_changed_item_index < mItems.size())
@@ -798,7 +798,7 @@ void LLFavoritesBarCtrl::updateButtons()
}
//last_right_edge is saving coordinates
LLButton* last_new_button = NULL;
int j = first_changed_item_index;
size_t j = first_changed_item_index;
for (; j < mItems.size(); j++)
{
last_new_button = createButton(mItems[j], button_params, last_right_edge);
@@ -982,7 +982,7 @@ void LLFavoritesBarCtrl::updateMenuItems(LLMenuGL* menu)
U32 widest_item = 0;
for (S32 i = mFirstDropDownItem; i < mItems.size(); i++)
for (size_t i = mFirstDropDownItem; i < mItems.size(); i++)
{
LLViewerInventoryItem* item = mItems.at(i);
const std::string& item_name = item->getName();

View File

@@ -101,8 +101,8 @@ protected:
LLUUID mFavoriteFolderId;
const LLFontGL *mFont;
S32 mFirstDropDownItem;
S32 mDropDownItemsCount;
size_t mFirstDropDownItem;
U32 mDropDownItemsCount;
bool mUpdateDropDownItems;
bool mRestoreOverflowMenu;

View File

@@ -2021,7 +2021,7 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod)
}
//add current model to current LoD's model list (LLModel::mLocalID makes a good vector index)
S32 idx = list_iter->mModel->mLocalID;
size_t idx = list_iter->mModel->mLocalID;
if (mModel[lod].size() <= idx)
{ //stretch model list to fit model at given index

View File

@@ -263,14 +263,14 @@ void LLParticipantList::refreshSpeakers()
mSpeakerMgr->update(resort_ok);
bool re_sort = false;
int start_pos = llmax(0, scroll_pos - 20);
int end_pos = scroll_pos + mAvatarList->getLinesPerPage() + 20;
size_t start_pos = llmax(0, scroll_pos - 20);
size_t end_pos = scroll_pos + mAvatarList->getLinesPerPage() + 20;
std::vector<LLScrollListItem*> items = mAvatarList->getAllData();
if (start_pos >= items.size())
{
return;
}
int count = 0;
size_t count = 0;
for (std::vector<LLScrollListItem*>::iterator item_it = items.begin(); item_it != items.end(); ++item_it)
{

View File

@@ -439,7 +439,7 @@ bool LLScriptEdCore::loadScriptText(const std::string& filename)
// read in the whole file
fseek(file, 0L, SEEK_END);
long file_length = ftell(file);
size_t file_length = ftell(file);
fseek(file, 0L, SEEK_SET);
if (file_length > 0)
{

View File

@@ -1808,11 +1808,11 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
for (polymesh_map_t::iterator i = mPolyMeshes.begin(); i != mPolyMeshes.end(); ++i)
{
LLPolyMesh* mesh = i->second;
for (S32 joint_num = 0; joint_num < mesh->mJointRenderData.size(); joint_num++)
for (const auto& joint : mesh->mJointRenderData)
{
static const LLVector4Logical mask = _mm_load_ps((F32*)&S_V4LOGICAL_MASK_TABLE[3 * 4]);
LLVector4a trans;
trans.setSelectWithMask(mask, _mm_setzero_ps(), mesh->mJointRenderData[joint_num]->mWorldMatrix->getRow<3>());
trans.setSelectWithMask(mask, _mm_setzero_ps(), joint->mWorldMatrix->getRow<3>());
update_min_max(newMin, newMax, trans);
}
}
@@ -8778,7 +8778,7 @@ void LLVOAvatar::updateMeshVisibility()
//LL_INFOS() << "head " << bake_flag[BAKED_HEAD] << "eyes " << bake_flag[BAKED_EYES] << "hair " << bake_flag[BAKED_HAIR] << "lower " << bake_flag[BAKED_LOWER] << "upper " << bake_flag[BAKED_UPPER] << "skirt " << bake_flag[BAKED_SKIRT] << LL_ENDL;
for (S32 i = 0; i < mMeshLOD.size(); i++)
for (size_t i = 0; i < mMeshLOD.size(); i++)
{
LLAvatarJoint* joint = mMeshLOD[i];
if (i == MESH_ID_HAIR)
@@ -9471,7 +9471,7 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix,
apr_file_printf(file, "\n<params>\n");
LLVisualParam* param = getFirstVisualParam();
for (S32 i = 0; i < params_for_dump.size(); i++)
for (const auto& param_for_dump : params_for_dump)
{
while( param && ((param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) &&
(param->getGroup() != VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE)) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
@@ -9479,7 +9479,7 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix,
param = getNextVisualParam();
}
LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param;
F32 value = params_for_dump[i];
F32 value = param_for_dump;
dump_visual_param(file, viewer_param, value);
param = getNextVisualParam();
}
@@ -10187,9 +10187,8 @@ void LLVOAvatar::getSortedJointNames(S32 joint_type, std::vector<std::string>& r
}
else if (joint_type==1)
{
for (S32 i = 0; i < mCollisionVolumes.size(); i++)
for (const auto& pJoint : mCollisionVolumes)
{
LLAvatarJointCollisionVolume* pJoint = mCollisionVolumes[i];
result.push_back(pJoint->getName());
}
}