Eliminate Linux compile warnings throughout animator/ with variable
initializations, missing braces. git-svn-id: http://skia.googlecode.com/svn/trunk@1991 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
221db3c336
commit
a7ed3cc637
@ -78,8 +78,9 @@ void SkSet::onEndElement(SkAnimateMaker& maker) {
|
||||
SkASSERT(fValues.getType() == outType);
|
||||
if (fFieldInfo->fType == SkType_Array)
|
||||
comps = fValues.count();
|
||||
else
|
||||
else {
|
||||
SkASSERT(fValues.count() == comps);
|
||||
}
|
||||
}
|
||||
if (formula.size() > 0) {
|
||||
comps = 1;
|
||||
|
@ -465,7 +465,7 @@ bool SkAnimatorScript::Unbox(void* m, SkScriptValue* scriptValue) {
|
||||
scriptValue->fOperand.fString = SkNEW_ARGS(SkString, (boxedValue->value));
|
||||
} break;
|
||||
default: {
|
||||
const char* id;
|
||||
const char* id = NULL;
|
||||
bool success = maker->findKey(displayable, &id);
|
||||
SkASSERT(success);
|
||||
scriptValue->fOperand.fString = SkNEW_ARGS(SkString, (id));
|
||||
|
@ -74,7 +74,8 @@ handlePad:
|
||||
padTwo = true;
|
||||
break;
|
||||
} while (byte < 4);
|
||||
int two, three;
|
||||
int two = 0;
|
||||
int three = 0;
|
||||
if (writeDestination) {
|
||||
int one = (uint8_t) (bytes[0] << 2);
|
||||
two = bytes[1];
|
||||
|
@ -138,8 +138,9 @@ void SkApply::applyValues(int animatorIndex, SkOperand* values, int count,
|
||||
animator->packARGB(&values->fScalar, count, &converted);
|
||||
values = converted.begin();
|
||||
count = converted.count();
|
||||
} else
|
||||
} else {
|
||||
SkASSERT(count == 1);
|
||||
}
|
||||
}
|
||||
// SkASSERT(type == SkType_ARGB || type == SkType_String ||info->isSettable());
|
||||
if (type == SkType_String || type == SkType_DynamicString)
|
||||
|
@ -89,8 +89,9 @@ bool SkMemberInfo::getArrayValue(const SkDisplayable* displayable, int index, Sk
|
||||
if (dispArray->values.count() <= index)
|
||||
return false;
|
||||
type = dispArray->values.getType();
|
||||
} else
|
||||
} else {
|
||||
SkASSERT(0); // incomplete
|
||||
}
|
||||
size_t byteSize = GetSize(type);
|
||||
memcpy(value, valuePtr + index * byteSize, byteSize);
|
||||
return true;
|
||||
@ -257,7 +258,7 @@ scriptCommon: {
|
||||
SkASSERT(success);
|
||||
if (scriptValue.fType == SkType_Displayable) {
|
||||
if (type == SkType_String) {
|
||||
const char* charPtr;
|
||||
const char* charPtr = NULL;
|
||||
maker.findKey(scriptValue.fOperand.fDisplayable, &charPtr);
|
||||
scriptValue.fOperand.fString = new SkString(charPtr);
|
||||
scriptValue.fType = SkType_String;
|
||||
|
@ -184,6 +184,7 @@ SkScriptEngine::SkScriptEngine(SkOpType returnType) :
|
||||
noInitialSuppress.fOperator = kUnassigned;
|
||||
noInitialSuppress.fOpStackDepth = 0;
|
||||
noInitialSuppress.fSuppress = false;
|
||||
noInitialSuppress.fElse = 0;
|
||||
fSuppressStack.push(noInitialSuppress);
|
||||
*fOpStack.push() = kParen;
|
||||
fTrackArray.appendClear();
|
||||
@ -1218,6 +1219,7 @@ flipSuppress:
|
||||
suppress.fSuppress = true;
|
||||
suppress.fOperator = match;
|
||||
suppress.fOpStackDepth = fOpStack.count();
|
||||
suppress.fElse = false;
|
||||
fSuppressStack.push(suppress);
|
||||
} else {
|
||||
fTypeStack.pop();
|
||||
|
@ -505,8 +505,9 @@ bool SkScriptEngine2::innerScript(const char** scriptPtr, SkScriptValue2* value)
|
||||
}
|
||||
lastPush = false;
|
||||
continue;
|
||||
} else
|
||||
} else {
|
||||
SkASSERT(token_length(script) > 0);
|
||||
}
|
||||
}
|
||||
if (lastPush != false && fTokenLength > 0) {
|
||||
if (ch == '(') {
|
||||
@ -1038,8 +1039,9 @@ void SkScriptEngine2::processLogicalOp(Op op) {
|
||||
SkASSERT(fValueStack.top().fType == SkOperand2::kS32); // !!! add error handling, and conversion to int?
|
||||
addTokenValue(fValueStack.top(), kAccumulator);
|
||||
fValueStack.pop();
|
||||
} else
|
||||
} else {
|
||||
SkASSERT(fAccumulatorType == SkOperand2::kS32);
|
||||
}
|
||||
// if 'and', write beq goto opcode after end of predicate (after to bool)
|
||||
// if 'or', write bne goto to bool
|
||||
addToken(op == kLogicalAnd ? kLogicalAndInt : kLogicalOrInt);
|
||||
@ -1133,8 +1135,8 @@ bool SkScriptEngine2::processOp() {
|
||||
else if (value2.fType == SkOperand2::kString)
|
||||
typeOp = (TypeOp) (typeOp + 2);
|
||||
SkDynamicMemoryWStream stream;
|
||||
SkOperand2::OpType saveType;
|
||||
SkBool saveOperand;
|
||||
SkOperand2::OpType saveType = SkOperand2::kNoType;
|
||||
SkBool saveOperand = false;
|
||||
if (constantOperands) {
|
||||
fActiveStream = &stream;
|
||||
saveType = fAccumulatorType;
|
||||
|
Loading…
Reference in New Issue
Block a user