mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 07:53:12 +00:00
Fix formatting of some switch statements.
svn-id: r42513
This commit is contained in:
parent
6a26f1b56f
commit
249b4eb4c3
@ -276,126 +276,126 @@ bool XMLParser::parse() {
|
||||
continue;
|
||||
|
||||
switch (_state) {
|
||||
case kParserNeedHeader:
|
||||
case kParserNeedKey:
|
||||
if (_char != '<') {
|
||||
parserError("Parser expecting key start.");
|
||||
break;
|
||||
}
|
||||
|
||||
if ((_char = _stream->readByte()) == 0) {
|
||||
parserError("Unexpected end of file.");
|
||||
break;
|
||||
}
|
||||
|
||||
if (_state == kParserNeedHeader) {
|
||||
if (_char != '?') {
|
||||
parserError("Expecting XML header.");
|
||||
break;
|
||||
}
|
||||
|
||||
_char = _stream->readByte();
|
||||
activeHeader = true;
|
||||
} else if (_char == '/') {
|
||||
_char = _stream->readByte();
|
||||
activeClosure = true;
|
||||
} else if (_char == '?') {
|
||||
parserError("Unexpected header. There may only be one XML header per file.");
|
||||
break;
|
||||
}
|
||||
|
||||
_state = kParserNeedKeyName;
|
||||
case kParserNeedHeader:
|
||||
case kParserNeedKey:
|
||||
if (_char != '<') {
|
||||
parserError("Parser expecting key start.");
|
||||
break;
|
||||
}
|
||||
|
||||
case kParserNeedKeyName:
|
||||
if (!parseToken()) {
|
||||
parserError("Invalid key name.");
|
||||
break;
|
||||
}
|
||||
|
||||
if (activeClosure) {
|
||||
if (_activeKey.empty() || _token != _activeKey.top()->name) {
|
||||
parserError("Unexpected closure.");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
ParserNode *node = allocNode(); //new ParserNode;
|
||||
node->name = _token;
|
||||
node->ignore = false;
|
||||
node->header = activeHeader;
|
||||
node->depth = _activeKey.size();
|
||||
node->layout = 0;
|
||||
_activeKey.push(node);
|
||||
}
|
||||
|
||||
_state = kParserNeedPropertyName;
|
||||
if ((_char = _stream->readByte()) == 0) {
|
||||
parserError("Unexpected end of file.");
|
||||
break;
|
||||
}
|
||||
|
||||
case kParserNeedPropertyName:
|
||||
if (activeClosure) {
|
||||
if (!closeKey()) {
|
||||
parserError("Missing data when closing key '%s'.", _activeKey.top()->name.c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
activeClosure = false;
|
||||
|
||||
if (_char != '>')
|
||||
parserError("Invalid syntax in key closure.");
|
||||
else
|
||||
_state = kParserNeedKey;
|
||||
|
||||
_char = _stream->readByte();
|
||||
if (_state == kParserNeedHeader) {
|
||||
if (_char != '?') {
|
||||
parserError("Expecting XML header.");
|
||||
break;
|
||||
}
|
||||
|
||||
selfClosure = false;
|
||||
_char = _stream->readByte();
|
||||
activeHeader = true;
|
||||
} else if (_char == '/') {
|
||||
_char = _stream->readByte();
|
||||
activeClosure = true;
|
||||
} else if (_char == '?') {
|
||||
parserError("Unexpected header. There may only be one XML header per file.");
|
||||
break;
|
||||
}
|
||||
|
||||
if (_char == '/' || (_char == '?' && activeHeader)) {
|
||||
selfClosure = true;
|
||||
_char = _stream->readByte();
|
||||
_state = kParserNeedKeyName;
|
||||
break;
|
||||
|
||||
case kParserNeedKeyName:
|
||||
if (!parseToken()) {
|
||||
parserError("Invalid key name.");
|
||||
break;
|
||||
}
|
||||
|
||||
if (activeClosure) {
|
||||
if (_activeKey.empty() || _token != _activeKey.top()->name) {
|
||||
parserError("Unexpected closure.");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
ParserNode *node = allocNode(); //new ParserNode;
|
||||
node->name = _token;
|
||||
node->ignore = false;
|
||||
node->header = activeHeader;
|
||||
node->depth = _activeKey.size();
|
||||
node->layout = 0;
|
||||
_activeKey.push(node);
|
||||
}
|
||||
|
||||
if (_char == '>') {
|
||||
if (activeHeader && !selfClosure) {
|
||||
parserError("XML Header must be self-closed.");
|
||||
} else if (parseActiveKey(selfClosure)) {
|
||||
_char = _stream->readByte();
|
||||
_state = kParserNeedKey;
|
||||
}
|
||||
_state = kParserNeedPropertyName;
|
||||
break;
|
||||
|
||||
activeHeader = false;
|
||||
case kParserNeedPropertyName:
|
||||
if (activeClosure) {
|
||||
if (!closeKey()) {
|
||||
parserError("Missing data when closing key '%s'.", _activeKey.top()->name.c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
if (selfClosure)
|
||||
parserError("Expecting key closure after '/' symbol.");
|
||||
else if (!parseToken())
|
||||
parserError("Error when parsing key value.");
|
||||
activeClosure = false;
|
||||
|
||||
if (_char != '>')
|
||||
parserError("Invalid syntax in key closure.");
|
||||
else
|
||||
_state = kParserNeedPropertyOperator;
|
||||
|
||||
break;
|
||||
|
||||
case kParserNeedPropertyOperator:
|
||||
if (_char != '=')
|
||||
parserError("Syntax error after key name.");
|
||||
else
|
||||
_state = kParserNeedPropertyValue;
|
||||
_state = kParserNeedKey;
|
||||
|
||||
_char = _stream->readByte();
|
||||
break;
|
||||
}
|
||||
|
||||
case kParserNeedPropertyValue:
|
||||
if (!parseKeyValue(_token))
|
||||
parserError("Invalid key value.");
|
||||
else
|
||||
_state = kParserNeedPropertyName;
|
||||
selfClosure = false;
|
||||
|
||||
if (_char == '/' || (_char == '?' && activeHeader)) {
|
||||
selfClosure = true;
|
||||
_char = _stream->readByte();
|
||||
}
|
||||
|
||||
if (_char == '>') {
|
||||
if (activeHeader && !selfClosure) {
|
||||
parserError("XML Header must be self-closed.");
|
||||
} else if (parseActiveKey(selfClosure)) {
|
||||
_char = _stream->readByte();
|
||||
_state = kParserNeedKey;
|
||||
}
|
||||
|
||||
activeHeader = false;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
if (selfClosure)
|
||||
parserError("Expecting key closure after '/' symbol.");
|
||||
else if (!parseToken())
|
||||
parserError("Error when parsing key value.");
|
||||
else
|
||||
_state = kParserNeedPropertyOperator;
|
||||
|
||||
break;
|
||||
|
||||
case kParserNeedPropertyOperator:
|
||||
if (_char != '=')
|
||||
parserError("Syntax error after key name.");
|
||||
else
|
||||
_state = kParserNeedPropertyValue;
|
||||
|
||||
_char = _stream->readByte();
|
||||
break;
|
||||
|
||||
case kParserNeedPropertyValue:
|
||||
if (!parseKeyValue(_token))
|
||||
parserError("Invalid key value.");
|
||||
else
|
||||
_state = kParserNeedPropertyName;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -912,21 +912,21 @@ void ThemeEngine::drawDialogBackground(const Common::Rect &r, DialogBackground b
|
||||
return;
|
||||
|
||||
switch (bgtype) {
|
||||
case kDialogBackgroundMain:
|
||||
queueDD(kDDMainDialogBackground, r);
|
||||
break;
|
||||
case kDialogBackgroundMain:
|
||||
queueDD(kDDMainDialogBackground, r);
|
||||
break;
|
||||
|
||||
case kDialogBackgroundSpecial:
|
||||
queueDD(kDDSpecialColorBackground, r);
|
||||
break;
|
||||
case kDialogBackgroundSpecial:
|
||||
queueDD(kDDSpecialColorBackground, r);
|
||||
break;
|
||||
|
||||
case kDialogBackgroundPlain:
|
||||
queueDD(kDDPlainColorBackground, r);
|
||||
break;
|
||||
case kDialogBackgroundPlain:
|
||||
queueDD(kDDPlainColorBackground, r);
|
||||
break;
|
||||
|
||||
case kDialogBackgroundDefault:
|
||||
queueDD(kDDDefaultBackground, r);
|
||||
break;
|
||||
case kDialogBackgroundDefault:
|
||||
queueDD(kDDDefaultBackground, r);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1039,26 +1039,26 @@ void ThemeEngine::drawText(const Common::Rect &r, const Common::String &str, Wid
|
||||
}
|
||||
|
||||
switch (font) {
|
||||
case kFontStyleNormal:
|
||||
queueDDText(kTextDataNormalFont, r, str, true, useEllipsis, align, kTextAlignVCenter, deltax);
|
||||
return;
|
||||
case kFontStyleNormal:
|
||||
queueDDText(kTextDataNormalFont, r, str, true, useEllipsis, align, kTextAlignVCenter, deltax);
|
||||
return;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (state) {
|
||||
case kStateDisabled:
|
||||
queueDDText(kTextDataDisabled, r, str, true, useEllipsis, align, kTextAlignVCenter, deltax);
|
||||
return;
|
||||
case kStateDisabled:
|
||||
queueDDText(kTextDataDisabled, r, str, true, useEllipsis, align, kTextAlignVCenter, deltax);
|
||||
return;
|
||||
|
||||
case kStateHighlight:
|
||||
queueDDText(kTextDataHover, r, str, true, useEllipsis, align, kTextAlignVCenter, deltax);
|
||||
return;
|
||||
case kStateHighlight:
|
||||
queueDDText(kTextDataHover, r, str, true, useEllipsis, align, kTextAlignVCenter, deltax);
|
||||
return;
|
||||
|
||||
case kStateEnabled:
|
||||
queueDDText(kTextDataDefault, r, str, true, useEllipsis, align, kTextAlignVCenter, deltax);
|
||||
return;
|
||||
case kStateEnabled:
|
||||
queueDDText(kTextDataDefault, r, str, true, useEllipsis, align, kTextAlignVCenter, deltax);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user