Commit 155947fc by Jamie Madill Committed by Commit Bot

Enable "-Wconditional-uninitialized".

This is a final warning used by Skia. Bug: angleproject:4046 Change-Id: I3970e30e4bd2aef07cddadd7322ef120ac857493 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1877481Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 16370a65
......@@ -137,6 +137,7 @@ config("extra_warnings") {
}
if (is_clang) {
cflags += [
"-Wconditional-uninitialized",
"-Wextra-semi-stmt",
"-Wfloat-conversion",
"-Winconsistent-missing-destructor-override",
......
......@@ -288,27 +288,25 @@ const TSymbol *TSymbolTable::findGlobal(const ImmutableString &name) const
const TSymbol *TSymbolTable::findGlobalWithConversion(
const std::vector<ImmutableString> &names) const
{
const TSymbol *target;
for (ImmutableString name : names)
for (const ImmutableString &name : names)
{
target = findGlobal(name);
const TSymbol *target = findGlobal(name);
if (target != nullptr)
break;
return target;
}
return target;
return nullptr;
}
const TSymbol *TSymbolTable::findBuiltInWithConversion(const std::vector<ImmutableString> &names,
int shaderVersion) const
{
const TSymbol *target;
for (ImmutableString name : names)
for (const ImmutableString &name : names)
{
target = findBuiltIn(name, shaderVersion);
const TSymbol *target = findBuiltIn(name, shaderVersion);
if (target != nullptr)
break;
return target;
}
return target;
return nullptr;
}
bool TSymbolTable::declare(TSymbol *symbol)
......
......@@ -537,12 +537,12 @@ class RewriteCubeMapSamplersAs2DArrayTraverser : public TIntermTraverser
*mSymbolTable, 300));
body->appendStatement(recipOuterDecl);
TIntermSymbol *dPDXdx;
TIntermSymbol *dPDYdx;
TIntermSymbol *dPDZdx;
TIntermSymbol *dPDXdy;
TIntermSymbol *dPDYdy;
TIntermSymbol *dPDZdy;
TIntermSymbol *dPDXdx = nullptr;
TIntermSymbol *dPDYdx = nullptr;
TIntermSymbol *dPDZdx = nullptr;
TIntermSymbol *dPDXdy = nullptr;
TIntermSymbol *dPDYdy = nullptr;
TIntermSymbol *dPDZdy = nullptr;
if (implicit)
{
dPDXdx = new TIntermSymbol(CreateTempVariable(mSymbolTable, vec3Type));
......@@ -869,7 +869,7 @@ class RewriteCubeMapSamplersAs2DArrayTraverser : public TIntermTraverser
}
else if (function->name().beginsWith("textureCubeGrad"))
{
isGrad = true;
isGrad = true;
}
else if (!mIsFragmentShader)
{
......
......@@ -156,8 +156,8 @@ bool GetPCIDevices(std::vector<GPUDeviceInfo> *devices)
void SetActiveGPUIndex(SystemInfo *info)
{
VendorID activeVendor;
DeviceID activeDevice;
VendorID activeVendor = 0;
DeviceID activeDevice = 0;
uint64_t gpuID = GetGpuIDFromDisplayID(kCGDirectMainDisplay);
......
......@@ -1042,12 +1042,12 @@ struct ETC2Block
// Power iteration algorithm to get the eigenvalues and eigenvector
// Starts with diagonal vector
float vfr = static_cast<float>(max[0] - min[0]);
float vfg = static_cast<float>(max[1] - min[1]);
float vfb = static_cast<float>(max[2] - min[2]);
float eigenvalue;
float vfr = static_cast<float>(max[0] - min[0]);
float vfg = static_cast<float>(max[1] - min[1]);
float vfb = static_cast<float>(max[2] - min[2]);
float eigenvalue = 0.0f;
static const size_t kPowerIterations = 4;
constexpr size_t kPowerIterations = 4;
for (size_t i = 0; i < kPowerIterations; i++)
{
float r = vfr * cov[0] + vfg * cov[1] + vfb * cov[2];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment