Fixing some warnings on Linux
There were only a few warnings left, so I fixed them and enabled the unused variable warning by removing the "-Wno-unused" flag. Only the -Wno-unused-parameter remains for now (could be removed later). Review URL: https://codereview.chromium.org/12480002 git-svn-id: http://skia.googlecode.com/svn/trunk@8030 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
428fc4a37b
commit
9c55f801a3
@ -676,10 +676,10 @@ int tool_main(int argc, char** argv) {
|
||||
configName = gConfigs[configIndex].fName;
|
||||
backend = gConfigs[configIndex].fBackend;
|
||||
GrContext* context = NULL;
|
||||
SkGLContextHelper* glContext = NULL;
|
||||
BenchTimer* timer = timers[configIndex];
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
SkGLContextHelper* glContext = NULL;
|
||||
if (kGPU_Backend == backend) {
|
||||
context = gContextFactory.get(gConfigs[configIndex].fContextType);
|
||||
if (NULL == context) {
|
||||
|
@ -1165,7 +1165,9 @@ int tool_main(int argc, char** argv) {
|
||||
bool doRTree = true;
|
||||
bool doTileGrid = true;
|
||||
bool doVerbose = false;
|
||||
#if SK_SUPPORT_GPU
|
||||
bool disableTextureCache = false;
|
||||
#endif
|
||||
SkTDArray<size_t> configs;
|
||||
SkTDArray<size_t> excludeConfigs;
|
||||
SkTDArray<SkScalar> tileGridReplayScales;
|
||||
@ -1302,7 +1304,9 @@ int tool_main(int argc, char** argv) {
|
||||
} else if (strcmp(*argv, "--noserialize") == 0) {
|
||||
doSerialize = false;
|
||||
} else if (strcmp(*argv, "--notexturecache") == 0) {
|
||||
#if SK_SUPPORT_GPU
|
||||
disableTextureCache = true;
|
||||
#endif
|
||||
} else if (strcmp(*argv, "--tiledPipe") == 0) {
|
||||
doTiledPipe = true;
|
||||
} else if (!strcmp(*argv, "--verbose") || !strcmp(*argv, "-v")) {
|
||||
|
@ -145,7 +145,6 @@
|
||||
#'-Werror',
|
||||
'-Wall',
|
||||
'-Wextra',
|
||||
'-Wno-unused',
|
||||
# suppressions below here were added for clang
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-c++11-extensions'
|
||||
|
@ -103,7 +103,7 @@ public:
|
||||
protected:
|
||||
virtual bool onEvent(const SkEvent&);
|
||||
virtual void onDraw(SkCanvas*);
|
||||
virtual Click* onFindClickHandler(SkScalar x, SkScalar y);
|
||||
virtual Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) SK_OVERRIDE;
|
||||
virtual bool onClick(Click* click);
|
||||
|
||||
private:
|
||||
|
@ -98,7 +98,7 @@ protected:
|
||||
canvas->drawLine(x, y, x + SkIntToScalar(90), y + SkIntToScalar(90), paint);
|
||||
}
|
||||
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) {
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERRIDE {
|
||||
fAlpha = SkScalarRound(y);
|
||||
this->inval(NULL);
|
||||
return NULL;
|
||||
|
@ -101,7 +101,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) {
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERRIDE {
|
||||
this->inval(NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ protected:
|
||||
canvas->drawOval(oval, p);
|
||||
}
|
||||
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) {
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERRIDE {
|
||||
return new Click(this);
|
||||
}
|
||||
|
||||
|
@ -717,7 +717,7 @@ protected:
|
||||
gProc[fIndex](canvas);
|
||||
}
|
||||
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) {
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERRIDE {
|
||||
this->init();
|
||||
fIndex = (fIndex + 1) % SK_ARRAY_COUNT(gProc);
|
||||
this->inval(NULL);
|
||||
|
@ -94,7 +94,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) {
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERRIDE {
|
||||
return new Click(this);
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ protected:
|
||||
return -1;
|
||||
}
|
||||
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) {
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERRIDE {
|
||||
fDragIndex = hittest(x, y);
|
||||
return fDragIndex >= 0 ? new Click(this) : NULL;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) {
|
||||
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERRIDE {
|
||||
return new Click(this);
|
||||
}
|
||||
|
||||
|
@ -409,9 +409,9 @@ bool SkAnimator::onEvent(const SkEvent& evt) {
|
||||
#endif
|
||||
if (evt.isType(SK_EventType_OnEnd)) {
|
||||
SkEventState eventState;
|
||||
bool success = evt.findPtr("anim", (void**) &eventState.fDisplayable);
|
||||
SkDEBUGCODE(bool success =) evt.findPtr("anim", (void**) &eventState.fDisplayable);
|
||||
SkASSERT(success);
|
||||
success = evt.findS32("time", (int32_t*) &fMaker->fEnableTime);
|
||||
SkDEBUGCODE(success =) evt.findS32("time", (int32_t*) &fMaker->fEnableTime);
|
||||
SkASSERT(success);
|
||||
fMaker->fAdjustedStart = fMaker->getAppTime() - fMaker->fEnableTime;
|
||||
fMaker->fEvents.doEvent(*fMaker, SkDisplayEvent::kOnEnd, &eventState);
|
||||
|
@ -603,8 +603,6 @@ scalarCommon:
|
||||
}
|
||||
if (ch == '.') {
|
||||
if (fTokenLength == 0) {
|
||||
SkDEBUGCODE(SkScriptValue2 scriptValue;)
|
||||
SkDEBUGCODE(scriptValue.fOperand.fObject = NULL);
|
||||
int tokenLength = token_length(++script);
|
||||
const char* token = script;
|
||||
script += tokenLength;
|
||||
@ -1273,6 +1271,7 @@ bool SkScriptEngine2::ValueToString(const SkScriptValue2& value, SkString* strin
|
||||
}
|
||||
|
||||
#ifdef SK_DEBUG
|
||||
#if defined(SK_SUPPORT_UNITTEST)
|
||||
|
||||
#define testInt(expression) { #expression, SkOperand2::kS32, expression, 0, NULL }
|
||||
#ifdef SK_SCALAR_IS_FLOAT
|
||||
@ -1475,6 +1474,7 @@ static const SkScriptNAnswer2 scriptTests[] = {
|
||||
};
|
||||
|
||||
#define SkScriptNAnswer_testCount SK_ARRAY_COUNT(scriptTests)
|
||||
#endif // SK_SUPPORT_UNITTEST
|
||||
|
||||
void SkScriptEngine2::UnitTest() {
|
||||
#if defined(SK_SUPPORT_UNITTEST)
|
||||
@ -1506,6 +1506,7 @@ void SkScriptEngine2::UnitTest() {
|
||||
SkASSERT(0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // SK_SUPPORT_UNITTEST
|
||||
}
|
||||
#endif
|
||||
#endif // SK_DEBUG
|
||||
|
||||
|
@ -102,7 +102,7 @@ GrGLShaderBuilder::GrGLShaderBuilder(const GrGLContextInfo& ctxInfo,
|
||||
}
|
||||
|
||||
void GrGLShaderBuilder::codeAppendf(ShaderType type, const char format[], va_list args) {
|
||||
SkString* string;
|
||||
SkString* string = NULL;
|
||||
switch (type) {
|
||||
case kVertex_ShaderType:
|
||||
string = &fVSCode;
|
||||
@ -120,7 +120,7 @@ void GrGLShaderBuilder::codeAppendf(ShaderType type, const char format[], va_lis
|
||||
}
|
||||
|
||||
void GrGLShaderBuilder::codeAppend(ShaderType type, const char* str) {
|
||||
SkString* string;
|
||||
SkString* string = NULL;
|
||||
switch (type) {
|
||||
case kVertex_ShaderType:
|
||||
string = &fVSCode;
|
||||
|
@ -17,6 +17,7 @@ void gr_run_unittests();
|
||||
// If we aren't inheriting these as #defines from elsewhere,
|
||||
// clang demands they be declared before we #include the template
|
||||
// that relies on them.
|
||||
#if GR_DEBUG
|
||||
static bool LT(const int& elem, int value) {
|
||||
return elem < value;
|
||||
}
|
||||
@ -39,6 +40,7 @@ static void test_bsearch() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// bogus empty class for GrBinHashKey
|
||||
class BogusEntry {};
|
||||
@ -72,7 +74,7 @@ static void test_binHashKey()
|
||||
|
||||
|
||||
void gr_run_unittests() {
|
||||
test_bsearch();
|
||||
GR_DEBUGCODE(test_bsearch();)
|
||||
test_binHashKey();
|
||||
GrRedBlackTree<int>::UnitTest();
|
||||
GrDrawState::VertexAttributesUnitTest();
|
||||
|
@ -249,7 +249,6 @@ SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
|
||||
|
||||
static SkStream* open_stream(const FontConfigTypeface* face, int* ttcIndex) {
|
||||
SkStream* stream = face->getLocalStream();
|
||||
int index;
|
||||
if (stream) {
|
||||
stream->ref();
|
||||
// should have been provided by CreateFromStream()
|
||||
|
@ -309,7 +309,7 @@ void SkPushButtonWidget::onDraw(SkCanvas* canvas)
|
||||
}
|
||||
}
|
||||
|
||||
SkView::Click* SkPushButtonWidget::onFindClickHandler(SkScalar x, SkScalar y)
|
||||
SkView::Click* SkPushButtonWidget::onFindClickHandler(SkScalar x, SkScalar y, unsigned modi)
|
||||
{
|
||||
this->acceptFocus();
|
||||
return new Click(this);
|
||||
|
@ -122,12 +122,12 @@ void SkScrollBarView::adjust()
|
||||
int total = fTotalLength;
|
||||
int start = fStartPoint;
|
||||
int shown = fShownLength;
|
||||
int hideBar = 0;
|
||||
// int hideBar = 0;
|
||||
|
||||
if (total <= 0 || shown <= 0 || shown >= total) // no bar to show
|
||||
{
|
||||
total = 1; // avoid divide-by-zero. should be done by skin/script
|
||||
hideBar = 1; // signal we don't want a thumb
|
||||
// hideBar = 1; // signal we don't want a thumb
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -155,7 +155,6 @@ void SkOSWindow::post_linuxevent() {
|
||||
if (NULL == fUnixWindow.fDisplay) {
|
||||
return;
|
||||
}
|
||||
long event_mask = NoEventMask;
|
||||
XClientMessageEvent event;
|
||||
event.type = ClientMessage;
|
||||
Atom myAtom(0);
|
||||
|
Loading…
Reference in New Issue
Block a user