Skip to content

Commit a2552a5

Browse files
committed
Build fix for Visual Studio patch
1 parent 2e5b105 commit a2552a5

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

indra/llcommon/llbase64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ std::string LLBase64::encode(const U8* input, size_t input_size)
4242
&& input_size > 0)
4343
{
4444
// Yes, it returns int.
45-
int b64_buffer_length = apr_base64_encode_len(narrow(input_size));
45+
int b64_buffer_length = apr_base64_encode_len(narrow<size_t>(input_size));
4646
char* b64_buffer = new char[b64_buffer_length];
4747

4848
// This is faster than apr_base64_encode() if you know
@@ -52,7 +52,7 @@ std::string LLBase64::encode(const U8* input, size_t input_size)
5252
b64_buffer_length = apr_base64_encode_binary(
5353
b64_buffer,
5454
input,
55-
narrow(input_size));
55+
narrow<size_t>(input_size));
5656
output.assign(b64_buffer);
5757
delete[] b64_buffer;
5858
}

indra/llcommon/llrand.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ inline F32 ll_internal_random<F32>()
8585
// Per Monty, it's important to clamp using the correct fmodf() rather
8686
// than expanding to F64 for fmod() and then truncating back to F32. Prior
8787
// to this change, we were getting sporadic ll_frand() == 1.0 results.
88-
F32 rv{ narrow(gRandomGenerator()) };
88+
F32 rv{ narrow<F32>(gRandomGenerator()) };
8989
if(!((rv >= 0.0f) && (rv < 1.0f))) return fmodf(rv, 1.0f);
9090
return rv;
9191
}

indra/llcommon/llsd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ class LL_COMMON_API LLSD
197197
typename std::enable_if<std::is_integral<VALUE>::value &&
198198
! std::is_same<VALUE, Boolean>::value,
199199
bool>::type = true>
200-
LLSD(VALUE v): LLSD(Integer(narrow(v))) {}
200+
LLSD(VALUE v): LLSD(Integer(narrow<VALUE>(v))) {}
201201
// support construction from F32 et al.
202202
template <typename VALUE,
203203
typename std::enable_if<std::is_floating_point<VALUE>::value,
204204
bool>::type = true>
205-
LLSD(VALUE v): LLSD(Real(narrow(v))) {}
205+
LLSD(VALUE v): LLSD(Real(narrow<VALUE>(v))) {}
206206
//@}
207207

208208
/** @name Scalar Assignment */

indra/llcommon/llsdserialize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2174,7 +2174,7 @@ std::string zip_llsd(LLSD& data)
21742174

21752175
U8 out[CHUNK];
21762176

2177-
strm.avail_in = narrow(source.size());
2177+
strm.avail_in = narrow<size_t>(source.size());
21782178
strm.next_in = (U8*) source.data();
21792179
U8* output = NULL;
21802180

indra/llcommon/llsdserialize_xml.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr,
196196
// *FIX: memory inefficient.
197197
// *TODO: convert to use LLBase64
198198
ostr << pre << "<binary encoding=\"base64\">";
199-
int b64_buffer_length = apr_base64_encode_len(narrow(buffer.size()));
199+
int b64_buffer_length = apr_base64_encode_len(narrow<size_t>(buffer.size()));
200200
char* b64_buffer = new char[b64_buffer_length];
201201
b64_buffer_length = apr_base64_encode_binary(
202202
b64_buffer,
203203
&buffer[0],
204-
narrow(buffer.size()));
204+
narrow<size_t>(buffer.size()));
205205
ostr.write(b64_buffer, b64_buffer_length - 1);
206206
delete[] b64_buffer;
207207
ostr << "</binary>" << post;

indra/llcommon/llsys.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ void LLMemoryInfo::stream(std::ostream& s) const
917917
// Now stream stats
918918
BOOST_FOREACH(const MapEntry& pair, inMap(mStatsMap))
919919
{
920-
s << pfx << std::setw(narrow(key_width+1)) << (pair.first + ':') << ' ';
920+
s << pfx << std::setw(narrow<size_t>(key_width+1)) << (pair.first + ':') << ' ';
921921
LLSD value(pair.second);
922922
if (value.isInteger())
923923
s << std::setw(12) << value.asInteger();

indra/llcommon/lltrace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void TimeBlockTreeNode::setParent( BlockTimerStatHandle* parent )
6363
llassert_always(parent != mBlock);
6464
llassert_always(parent != NULL);
6565

66-
TimeBlockTreeNode* parent_tree_node = get_thread_recorder()->getTimeBlockTreeNode(narrow(parent->getIndex()));
66+
TimeBlockTreeNode* parent_tree_node = get_thread_recorder()->getTimeBlockTreeNode(narrow<size_t>(parent->getIndex()));
6767
if (!parent_tree_node) return;
6868

6969
if (mParent)

indra/llcommon/lltraceaccumulators.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void AccumulatorBufferGroup::makeCurrent()
7777
// update stacktimer parent pointers
7878
for (size_t i = 0, end_i = mStackTimers.size(); i < end_i; i++)
7979
{
80-
TimeBlockTreeNode* tree_node = thread_recorder->getTimeBlockTreeNode(narrow(i));
80+
TimeBlockTreeNode* tree_node = thread_recorder->getTimeBlockTreeNode(narrow<size_t>(i));
8181
if (tree_node)
8282
{
8383
timer_accumulator_buffer[i].mParent = tree_node->mParent;

indra/llcorehttp/bufferarray.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ int BufferArray::findBlock(size_t pos, size_t * ret_offset)
288288
if (pos >= mLen)
289289
return -1; // Doesn't exist
290290

291-
const int block_limit(narrow(mBlocks.size()));
291+
const int block_limit(narrow<size_t>(mBlocks.size()));
292292
for (int i(0); i < block_limit; ++i)
293293
{
294294
if (pos < mBlocks[i]->mUsed)

indra/newview/llmaterialeditor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,15 +2228,15 @@ bool LLMaterialEditor::canModifyObjectsMaterial()
22282228
LLSelectedTEGetMatData func(true);
22292229
LLPermissions permissions;
22302230
LLViewerInventoryItem* item_out;
2231-
return can_use_objects_material(func, std::vector({PERM_MODIFY}), ItemSource::OBJECT, permissions, item_out);
2231+
return can_use_objects_material(func, std::vector<PermissionBit>({PERM_MODIFY}), ItemSource::OBJECT, permissions, item_out);
22322232
}
22332233

22342234
bool LLMaterialEditor::canSaveObjectsMaterial()
22352235
{
22362236
LLSelectedTEGetMatData func(true);
22372237
LLPermissions permissions;
22382238
LLViewerInventoryItem* item_out;
2239-
return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), ItemSource::AGENT, permissions, item_out);
2239+
return can_use_objects_material(func, std::vector<PermissionBit>({PERM_COPY, PERM_MODIFY}), ItemSource::AGENT, permissions, item_out);
22402240
}
22412241

22422242
bool LLMaterialEditor::canClipboardObjectsMaterial()
@@ -2262,15 +2262,15 @@ bool LLMaterialEditor::canClipboardObjectsMaterial()
22622262
LLSelectedTEGetMatData func(true);
22632263
LLPermissions permissions;
22642264
LLViewerInventoryItem* item_out;
2265-
return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY, PERM_TRANSFER}), ItemSource::OBJECT, permissions, item_out);
2265+
return can_use_objects_material(func, std::vector<PermissionBit>({PERM_COPY, PERM_MODIFY, PERM_TRANSFER}), ItemSource::OBJECT, permissions, item_out);
22662266
}
22672267

22682268
void LLMaterialEditor::saveObjectsMaterialAs()
22692269
{
22702270
LLSelectedTEGetMatData func(true);
22712271
LLPermissions permissions;
22722272
LLViewerInventoryItem* item = nullptr;
2273-
bool allowed = can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), ItemSource::AGENT, permissions, item);
2273+
bool allowed = can_use_objects_material(func, std::vector<PermissionBit>({PERM_COPY, PERM_MODIFY}), ItemSource::AGENT, permissions, item);
22742274
if (!allowed)
22752275
{
22762276
LL_WARNS("MaterialEditor") << "Failed to save GLTF material from object" << LL_ENDL;

0 commit comments

Comments
 (0)