Use -Werror in system/core/libpixelflinger
* Remove unused local variables.
* Suppress/fix warning of unused functions, conditionally used variables.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: If92bc79f15a0486364da0389defbb2d43b3bd6ea
diff --git a/libpixelflinger/codeflinger/Arm64Assembler.cpp b/libpixelflinger/codeflinger/Arm64Assembler.cpp
index bff87bb..aebc129 100644
--- a/libpixelflinger/codeflinger/Arm64Assembler.cpp
+++ b/libpixelflinger/codeflinger/Arm64Assembler.cpp
@@ -151,11 +151,11 @@
namespace android {
-static const char* shift_codes[] =
+static __unused const char* shift_codes[] =
{
"LSL", "LSR", "ASR", "ROR"
};
-static const char *cc_codes[] =
+static __unused const char *cc_codes[] =
{
"EQ", "NE", "CS", "CC", "MI",
"PL", "VS", "VC", "HI", "LS",
@@ -984,7 +984,7 @@
// A64 instructions
// ----------------------------------------------------------------------------
-static const char * dataTransferOpName[] =
+static __unused const char * dataTransferOpName[] =
{
"LDR","LDRB","LDRH","STR","STRB","STRH"
};
diff --git a/libpixelflinger/codeflinger/GGLAssembler.cpp b/libpixelflinger/codeflinger/GGLAssembler.cpp
index 91fbd53..04e285d 100644
--- a/libpixelflinger/codeflinger/GGLAssembler.cpp
+++ b/libpixelflinger/codeflinger/GGLAssembler.cpp
@@ -94,8 +94,6 @@
int GGLAssembler::scanline_core(const needs_t& needs, context_t const* c)
{
- int64_t duration = ggl_system_time();
-
mBlendFactorCached = 0;
mBlending = 0;
mMasking = 0;
@@ -353,7 +351,6 @@
fragment_parts_t& parts, const needs_t& needs)
{
Scratch scratches(registerFile());
- int Rctx = mBuilderContext.Rctx;
// compute count
comment("compute ct (# of pixels to process)");
diff --git a/libpixelflinger/codeflinger/load_store.cpp b/libpixelflinger/codeflinger/load_store.cpp
index da21e1d..4db0a49 100644
--- a/libpixelflinger/codeflinger/load_store.cpp
+++ b/libpixelflinger/codeflinger/load_store.cpp
@@ -232,7 +232,6 @@
void GGLAssembler::downshift(
pixel_t& d, int component, component_t s, const reg_t& dither)
{
- const needs_t& needs = mBuilderContext.needs;
Scratch scratches(registerFile());
int sh = s.h;
diff --git a/libpixelflinger/codeflinger/texturing.cpp b/libpixelflinger/codeflinger/texturing.cpp
index 4c357af..e6997bd 100644
--- a/libpixelflinger/codeflinger/texturing.cpp
+++ b/libpixelflinger/codeflinger/texturing.cpp
@@ -41,7 +41,6 @@
void GGLAssembler::init_iterated_color(fragment_parts_t& parts, const reg_t& x)
{
context_t const* c = mBuilderContext.c;
- const needs_t& needs = mBuilderContext.needs;
if (mSmooth) {
// NOTE: we could take this case in the mDithering + !mSmooth case,
@@ -324,9 +323,7 @@
tex_coord_t* coords,
const reg_t& x, const reg_t& y)
{
- context_t const* c = mBuilderContext.c;
const needs_t& needs = mBuilderContext.needs;
- int Rctx = mBuilderContext.Rctx;
int Rx = x.reg;
int Ry = y.reg;
@@ -402,10 +399,6 @@
void GGLAssembler::build_textures( fragment_parts_t& parts,
Scratch& regs)
{
- context_t const* c = mBuilderContext.c;
- const needs_t& needs = mBuilderContext.needs;
- int Rctx = mBuilderContext.Rctx;
-
// We don't have a way to spill registers automatically
// spill depth and AA regs, when we know we may have to.
// build the spill list...
@@ -434,7 +427,6 @@
Spill spill(registerFile(), *this, spill_list);
- const bool multiTexture = mTextureMachine.activeUnits > 1;
for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT; i++) {
const texture_unit_t& tmu = mTextureMachine.tmu[i];
if (tmu.format_idx == 0)
@@ -442,7 +434,7 @@
pointer_t& txPtr = parts.coords[i].ptr;
pixel_t& texel = parts.texel[i];
-
+
// repeat...
if ((tmu.swrap == GGL_NEEDS_WRAP_11) &&
(tmu.twrap == GGL_NEEDS_WRAP_11))
@@ -656,7 +648,6 @@
void GGLAssembler::build_iterate_texture_coordinates(
const fragment_parts_t& parts)
{
- const bool multiTexture = mTextureMachine.activeUnits > 1;
for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT; i++) {
const texture_unit_t& tmu = mTextureMachine.tmu[i];
if (tmu.format_idx == 0)