Enable unused param checking for public includes.
This CL cleans up the existing violations and enables the build time check to ensure that we don't regress. The motiviation behind this change is to allow clients who include our headers to be able to build with this warning enabled. Review URL: https://codereview.chromium.org/726923002
This commit is contained in:
parent
33068c19f1
commit
c87dd2ce96
@ -628,7 +628,9 @@
|
||||
{
|
||||
'target_name': 'test_public_includes',
|
||||
'type': 'static_library',
|
||||
#'cflags!': [ '-Wno-unused-parameter' ],
|
||||
# Ensure that our public headers don't have unused params so that clients
|
||||
# (e.g. Android) that include us can build with these warnings enabled
|
||||
'cflags!': [ '-Wno-unused-parameter' ],
|
||||
'variables': {
|
||||
'includes_to_test': [
|
||||
'<(skia_include_path)/animator',
|
||||
|
@ -1078,7 +1078,7 @@ public:
|
||||
subclasses like SkPicture's recording canvas, that can store the data
|
||||
and then play it back later (via another call to drawData).
|
||||
*/
|
||||
virtual void drawData(const void* data, size_t length) {
|
||||
virtual void drawData(const void* /*data*/, size_t /*length*/) {
|
||||
// do nothing. Subclasses may do something with the data
|
||||
}
|
||||
|
||||
@ -1086,10 +1086,10 @@ public:
|
||||
Each comment added via addComment is notionally attached to its
|
||||
enclosing group. Top-level comments simply belong to no group.
|
||||
*/
|
||||
virtual void beginCommentGroup(const char* description) {
|
||||
virtual void beginCommentGroup(const char* /*description*/) {
|
||||
// do nothing. Subclasses may do something
|
||||
}
|
||||
virtual void addComment(const char* kywd, const char* value) {
|
||||
virtual void addComment(const char* /*kywd*/, const char* /*value*/) {
|
||||
// do nothing. Subclasses may do something
|
||||
}
|
||||
virtual void endCommentGroup() {
|
||||
|
@ -281,8 +281,8 @@ protected:
|
||||
* it just returns false and leaves result and offset unchanged.
|
||||
*/
|
||||
virtual bool filterImage(const SkImageFilter*, const SkBitmap&,
|
||||
const SkImageFilter::Context& ctx,
|
||||
SkBitmap* result, SkIPoint* offset) {
|
||||
const SkImageFilter::Context&,
|
||||
SkBitmap* /*result*/, SkIPoint* /*offset*/) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -352,7 +352,7 @@ protected:
|
||||
const SkPixelGeometry fPixelGeometry;
|
||||
};
|
||||
|
||||
virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo& cinfo) {
|
||||
virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -348,13 +348,13 @@ protected:
|
||||
|
||||
// If the decoder wants to support tiled based decoding,
|
||||
// this method must be overridden. This guy is called by buildTileIndex(...)
|
||||
virtual bool onBuildTileIndex(SkStreamRewindable*, int *width, int *height) {
|
||||
virtual bool onBuildTileIndex(SkStreamRewindable*, int* /*width*/, int* /*height*/) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the decoder wants to support tiled based decoding,
|
||||
// this method must be overridden. This guy is called by decodeRegion(...)
|
||||
virtual bool onDecodeSubset(SkBitmap* bitmap, const SkIRect& rect) {
|
||||
virtual bool onDecodeSubset(SkBitmap*, const SkIRect&) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -364,8 +364,9 @@ protected:
|
||||
updates componentSizes to the final image size.
|
||||
Returns whether the decoding was successful.
|
||||
*/
|
||||
virtual bool onDecodeYUV8Planes(SkStream* stream, SkISize componentSizes[3], void* planes[3],
|
||||
size_t rowBytes[3], SkYUVColorSpace*) {
|
||||
virtual bool onDecodeYUV8Planes(SkStream*, SkISize[3] /*componentSizes*/,
|
||||
void*[3] /*planes*/, size_t[3] /*rowBytes*/,
|
||||
SkYUVColorSpace*) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -247,7 +247,7 @@ public:
|
||||
* not be created with the given config), or this PixelRef does not support deep
|
||||
* copies.
|
||||
*/
|
||||
virtual SkPixelRef* deepCopy(SkColorType colortype, const SkIRect* subset) {
|
||||
virtual SkPixelRef* deepCopy(SkColorType, const SkIRect* /*subset*/) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -366,7 +366,7 @@ public:
|
||||
const SkXfermode* fMode;
|
||||
};
|
||||
|
||||
virtual bool asACompose(ComposeRec* rec) const { return false; }
|
||||
virtual bool asACompose(ComposeRec*) const { return false; }
|
||||
|
||||
|
||||
/**
|
||||
|
@ -102,13 +102,13 @@ public:
|
||||
* If an attempt is made to seek past the end of the stream, the position will be set
|
||||
* to the end of the stream.
|
||||
*/
|
||||
virtual bool seek(size_t position) { return false; }
|
||||
virtual bool seek(size_t /*position*/) { return false; }
|
||||
|
||||
/** Seeks to an relative offset in the stream. If this cannot be done, returns false.
|
||||
* If an attempt is made to move to a position outside the stream, the position will be set
|
||||
* to the closest point within the stream (beginning or end).
|
||||
*/
|
||||
virtual bool move(long offset) { return false; }
|
||||
virtual bool move(long /*offset*/) { return false; }
|
||||
|
||||
/** Duplicates this stream. If this cannot be done, returns NULL.
|
||||
* The returned stream will be positioned the same as this stream.
|
||||
|
@ -464,7 +464,7 @@ private:
|
||||
|
||||
// Use the below macro (SkNEW_APPEND_TO_TARRAY) rather than calling this directly
|
||||
template <typename T, bool MEM_COPY>
|
||||
void* operator new(size_t, SkTArray<T, MEM_COPY>* array, int atIndex) {
|
||||
void* operator new(size_t, SkTArray<T, MEM_COPY>* array, int SkDEBUGCODE(atIndex)) {
|
||||
// Currently, we only support adding to the end of the array. When the array class itself
|
||||
// supports random insertion then this should be updated.
|
||||
// SkASSERT(atIndex >= 0 && atIndex <= array->count());
|
||||
@ -476,7 +476,7 @@ void* operator new(size_t, SkTArray<T, MEM_COPY>* array, int atIndex) {
|
||||
// to match the op new silences warnings about missing op delete when a constructor throws an
|
||||
// exception.
|
||||
template <typename T, bool MEM_COPY>
|
||||
void operator delete(void*, SkTArray<T, MEM_COPY>* array, int atIndex) {
|
||||
void operator delete(void*, SkTArray<T, MEM_COPY>* /*array*/, int /*atIndex*/) {
|
||||
SK_CRASH();
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
#ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES
|
||||
static SkShader* CreateLinear(const SkPoint pts[2],
|
||||
const SkColor colors[], const SkScalar pos[], int count,
|
||||
SkShader::TileMode mode, void* ignored,
|
||||
SkShader::TileMode mode, void* /*ignored*/,
|
||||
uint32_t flags, const SkMatrix* localMatrix) {
|
||||
return CreateLinear(pts, colors, pos, count, mode, flags, localMatrix);
|
||||
}
|
||||
@ -94,7 +94,7 @@ public:
|
||||
#ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES
|
||||
static SkShader* CreateRadial(const SkPoint& center, SkScalar radius,
|
||||
const SkColor colors[], const SkScalar pos[], int count,
|
||||
SkShader::TileMode mode, void* ignored,
|
||||
SkShader::TileMode mode, void* /*ignored*/,
|
||||
uint32_t flags, const SkMatrix* localMatrix) {
|
||||
return CreateRadial(center, radius, colors, pos, count, mode, flags, localMatrix);
|
||||
}
|
||||
@ -137,7 +137,7 @@ public:
|
||||
static SkShader* CreateTwoPointRadial(const SkPoint& start, SkScalar startRadius,
|
||||
const SkPoint& end, SkScalar endRadius,
|
||||
const SkColor colors[], const SkScalar pos[], int count,
|
||||
SkShader::TileMode mode, void* ignored,
|
||||
SkShader::TileMode mode, void* /*ignored*/,
|
||||
uint32_t flags, const SkMatrix* localMatrix) {
|
||||
return CreateTwoPointRadial(start, startRadius, end, endRadius, colors, pos, count, mode,
|
||||
flags, localMatrix);
|
||||
@ -168,7 +168,7 @@ public:
|
||||
static SkShader* CreateTwoPointConical(const SkPoint& start, SkScalar startRadius,
|
||||
const SkPoint& end, SkScalar endRadius,
|
||||
const SkColor colors[], const SkScalar pos[], int count,
|
||||
SkShader::TileMode mode, void* ignored,
|
||||
SkShader::TileMode mode, void* /*ignored*/,
|
||||
uint32_t flags, const SkMatrix* localMatrix) {
|
||||
return CreateTwoPointConical(start, startRadius, end, endRadius, colors, pos, count, mode,
|
||||
flags, localMatrix);
|
||||
@ -202,7 +202,7 @@ public:
|
||||
#ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES
|
||||
static SkShader* CreateSweep(SkScalar cx, SkScalar cy,
|
||||
const SkColor colors[], const SkScalar pos[], int count,
|
||||
void* ignored,
|
||||
void* /*ignored*/,
|
||||
uint32_t flags, const SkMatrix* localMatrix) {
|
||||
return CreateSweep(cx, cy, colors, pos, count, flags, localMatrix);
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ static inline GrColor GrColorPackRGBA(unsigned r, unsigned g,
|
||||
/**
|
||||
* Assert in debug builds that a GrColor is premultiplied.
|
||||
*/
|
||||
static inline void GrColorIsPMAssert(GrColor c) {
|
||||
static inline void GrColorIsPMAssert(GrColor SkDEBUGCODE(c)) {
|
||||
#ifdef SK_DEBUG
|
||||
unsigned a = GrColorUnpackA(c);
|
||||
unsigned r = GrColorUnpackR(c);
|
||||
|
@ -827,7 +827,7 @@ public:
|
||||
kWideOpen_InitialClip,
|
||||
};
|
||||
|
||||
AutoClip(GrContext* context, InitialClip initialState)
|
||||
AutoClip(GrContext* context, InitialClip SkDEBUGCODE(initialState))
|
||||
: fContext(context) {
|
||||
SkASSERT(kWideOpen_InitialClip == initialState);
|
||||
fNewClipData.fClipStack = &fNewClipStack;
|
||||
|
@ -105,8 +105,8 @@ public:
|
||||
// New APIS, which have default impls for now (which do nothing)
|
||||
|
||||
virtual SkDataTable* getFamilyNames() { return SkDataTable::NewEmpty(); }
|
||||
virtual bool matchFamilySet(const char inFamilyName[],
|
||||
SkString* outFamilyName,
|
||||
virtual bool matchFamilySet(const char[] /*inFamilyName*/,
|
||||
SkString* /*outFamilyName*/,
|
||||
SkTArray<FontIdentity>*) {
|
||||
return false;
|
||||
}
|
||||
|
@ -84,8 +84,8 @@ public:
|
||||
}
|
||||
|
||||
// deprecated, but still here for animator (for now)
|
||||
void rotate(SkScalar x, SkScalar y, SkScalar z) {}
|
||||
void rotateDegrees(SkScalar x, SkScalar y, SkScalar z) {}
|
||||
void rotate(SkScalar /*x*/, SkScalar /*y*/, SkScalar /*z*/) {}
|
||||
void rotateDegrees(SkScalar /*x*/, SkScalar /*y*/, SkScalar /*z*/) {}
|
||||
|
||||
private:
|
||||
public: // make public for SkDraw3D for now
|
||||
|
@ -222,8 +222,7 @@ public:
|
||||
* @param newAllocatedStorage same value as would be returned by
|
||||
* storageAllocatedForRecording(), for convenience.
|
||||
*/
|
||||
virtual void storageAllocatedForRecordingChanged(
|
||||
size_t newAllocatedStorage) {}
|
||||
virtual void storageAllocatedForRecordingChanged(size_t /*newAllocatedStorage*/) {}
|
||||
|
||||
/**
|
||||
* Called after pending draw commands have been flushed
|
||||
|
@ -337,12 +337,12 @@ protected:
|
||||
//! called once before all of the children are drawn (or clipped/translated)
|
||||
virtual SkCanvas* beforeChildren(SkCanvas* c) { return c; }
|
||||
//! called once after all of the children are drawn (or clipped/translated)
|
||||
virtual void afterChildren(SkCanvas* orig) {}
|
||||
virtual void afterChildren(SkCanvas*) {}
|
||||
|
||||
//! called right before this child's onDraw is called
|
||||
virtual void beforeChild(SkView* child, SkCanvas* canvas) {}
|
||||
virtual void beforeChild(SkView* /*child*/, SkCanvas*) {}
|
||||
//! called right after this child's onDraw is called
|
||||
virtual void afterChild(SkView* child, SkCanvas* canvas) {}
|
||||
virtual void afterChild(SkView* /*child*/, SkCanvas*) {}
|
||||
|
||||
/** Override this if you might handle the click
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user