Enable MSVS warning 4512.
Fix up the missing DISALLOW_COPY_AND_ASSIGN macros and various small
problems preventing us from turning on this warning. This should
ensure we more often use the DISALLOW macro going forward.
Change-Id: I2e1a9d23a31a51279a577fad8dffb8c1530e2ee8
Reviewed-on: https://chromium-review.googlesource.com/251100
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cooper Partin <coopp@microsoft.com>
Tested-by: Cooper Partin <coopp@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/compiler/translator/StructureHLSL.cpp b/src/compiler/translator/StructureHLSL.cpp
index 304949b..fd1a29c 100644
--- a/src/compiler/translator/StructureHLSL.cpp
+++ b/src/compiler/translator/StructureHLSL.cpp
@@ -21,9 +21,23 @@
unsigned *uniqueCounter)
: mPaddingCounter(uniqueCounter),
mElementIndex(0),
- mStructElementIndexes(structElementIndexes)
+ mStructElementIndexes(&structElementIndexes)
{}
+Std140PaddingHelper::Std140PaddingHelper(const Std140PaddingHelper &other)
+ : mPaddingCounter(other.mPaddingCounter),
+ mElementIndex(other.mElementIndex),
+ mStructElementIndexes(other.mStructElementIndexes)
+{}
+
+Std140PaddingHelper &Std140PaddingHelper::operator=(const Std140PaddingHelper &other)
+{
+ mPaddingCounter = other.mPaddingCounter;
+ mElementIndex = other.mElementIndex;
+ mStructElementIndexes = other.mStructElementIndexes;
+ return *this;
+}
+
TString Std140PaddingHelper::next()
{
unsigned value = (*mPaddingCounter)++;
@@ -107,7 +121,7 @@
{
const TString &structName = QualifiedStructNameString(*structure,
useHLSLRowMajorPacking, true);
- numComponents = mStructElementIndexes.find(structName)->second;
+ numComponents = mStructElementIndexes->find(structName)->second;
if (numComponents == 0)
{