Revert "Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data'"
Seems to have quite a few warnings in 64-bit on my machine.
BUG=angleproject:1120
This reverts commit c5cf9bc47d0ee028adbbf9e9f94ca567eec601dc.
Change-Id: I86768b900aeba52e7a2242d9ae8949f93f1a5ba9
Reviewed-on: https://chromium-review.googlesource.com/293280
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/CallDAG.cpp b/src/compiler/translator/CallDAG.cpp
index eb6c031..ef57b39 100644
--- a/src/compiler/translator/CallDAG.cpp
+++ b/src/compiler/translator/CallDAG.cpp
@@ -71,10 +71,10 @@
record.callees.reserve(data.callees.size());
for (auto &callee : data.callees)
{
- record.callees.push_back(static_cast<int>(callee->index));
+ record.callees.push_back(callee->index);
}
- (*idToIndex)[data.node->getFunctionId()] = static_cast<int>(data.index);
+ (*idToIndex)[data.node->getFunctionId()] = data.index;
}
}
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index 3e9a0b6..396b390 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -544,7 +544,7 @@
infoSink.info << "Call stack too deep (larger than " << maxCallStackDepth
<< ") with the following call chain: " << record.name;
- int currentFunction = static_cast<int>(i);
+ int currentFunction = i;
int currentDepth = depth;
while (currentFunction != -1)
@@ -574,7 +574,7 @@
bool TCompiler::tagUsedFunctions()
{
// Search from main, starting from the end of the DAG as it usually is the root.
- for (size_t i = mCallDag.size(); i-- > 0;)
+ for (int i = mCallDag.size(); i-- > 0;)
{
if (mCallDag.getRecordFromIndex(i).name == "main(")
{
diff --git a/src/compiler/translator/IntermNode.cpp b/src/compiler/translator/IntermNode.cpp
index 1d26947..a4a6f70 100644
--- a/src/compiler/translator/IntermNode.cpp
+++ b/src/compiler/translator/IntermNode.cpp
@@ -1875,7 +1875,7 @@
{
TOperator op = aggregate->getOp();
TIntermSequence *sequence = aggregate->getSequence();
- unsigned int paramsCount = static_cast<unsigned int>(sequence->size());
+ unsigned int paramsCount = sequence->size();
std::vector<TConstantUnion *> unionArrays(paramsCount);
std::vector<size_t> objectSizes(paramsCount);
size_t maxObjectSize = 0;
@@ -2256,7 +2256,7 @@
{
// Perform component-wise matrix multiplication.
resultArray = new TConstantUnion[maxObjectSize];
- int size = (*sequence)[0]->getAsTyped()->getNominalSize();
+ size_t size = (*sequence)[0]->getAsTyped()->getNominalSize();
angle::Matrix<float> result =
GetMatrix(unionArrays[0], size).compMult(GetMatrix(unionArrays[1], size));
SetUnionArrayFromMatrix(result, resultArray);
@@ -2272,8 +2272,7 @@
size_t numCols = (*sequence)[1]->getAsTyped()->getType().getObjectSize();
resultArray = new TConstantUnion[numRows * numCols];
angle::Matrix<float> result =
- GetMatrix(unionArrays[0], 1, static_cast<int>(numCols))
- .outerProduct(GetMatrix(unionArrays[1], static_cast<int>(numRows), 1));
+ GetMatrix(unionArrays[0], 1, numCols).outerProduct(GetMatrix(unionArrays[1], numRows, 1));
SetUnionArrayFromMatrix(result, resultArray);
}
else
diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
index 8eaa111..60a48c2 100644
--- a/src/compiler/translator/ParseContext.cpp
+++ b/src/compiler/translator/ParseContext.cpp
@@ -537,7 +537,7 @@
{
if (type->isUnsizedArray())
{
- type->setArraySize(static_cast<int>(function.getParamCount()));
+ type->setArraySize(function.getParamCount());
}
else if (static_cast<size_t>(type->getArraySize()) != function.getParamCount())
{
diff --git a/src/compiler/translator/Types.h b/src/compiler/translator/Types.h
index 2302ad7..9147de9 100644
--- a/src/compiler/translator/Types.h
+++ b/src/compiler/translator/Types.h
@@ -124,7 +124,7 @@
return mDeepestNesting;
}
bool containsArrays() const;
- bool containsType(TBasicType t) const;
+ bool containsType(TBasicType type) const;
bool containsSamplers() const;
bool equals(const TStructure &other) const;
diff --git a/src/compiler/translator/VariableInfo.cpp b/src/compiler/translator/VariableInfo.cpp
index 8e1c008..d61dc40 100644
--- a/src/compiler/translator/VariableInfo.cpp
+++ b/src/compiler/translator/VariableInfo.cpp
@@ -55,8 +55,7 @@
{
if (variable.isArray())
{
- for (unsigned int elementIndex = 0; elementIndex < variable.elementCount();
- elementIndex++)
+ for (size_t elementIndex = 0; elementIndex < variable.elementCount(); elementIndex++)
{
std::string lname = name + ::ArrayString(elementIndex);
std::string lmappedName = mappedName + ::ArrayString(elementIndex);
diff --git a/src/compiler/translator/blocklayout.cpp b/src/compiler/translator/blocklayout.cpp
index ba63228..7c74105 100644
--- a/src/compiler/translator/blocklayout.cpp
+++ b/src/compiler/translator/blocklayout.cpp
@@ -27,10 +27,7 @@
getBlockLayoutInfo(type, arraySize, isRowMajorMatrix, &arrayStride, &matrixStride);
- const BlockMemberInfo memberInfo(static_cast<int>(mCurrentOffset * BytesPerComponent),
- static_cast<int>(arrayStride * BytesPerComponent),
- static_cast<int>(matrixStride * BytesPerComponent),
- isRowMajorMatrix);
+ const BlockMemberInfo memberInfo(mCurrentOffset * BytesPerComponent, arrayStride * BytesPerComponent, matrixStride * BytesPerComponent, isRowMajorMatrix);
advanceOffset(type, arraySize, isRowMajorMatrix, arrayStride, matrixStride);