forked from mirror/openmw-tes3mp
Change a switch to a series of if/else if/.../else, hopefully resolving compilation issues on OSX and Linux.
This commit is contained in:
parent
2b829f7f7b
commit
7243583963
2 changed files with 13 additions and 14 deletions
|
@ -164,6 +164,10 @@ bool ConfigurationManager::loadConfig(const boost::filesystem::path& path,
|
|||
return false;
|
||||
}
|
||||
|
||||
const int escape_hash_filter::sEscape = '@';
|
||||
const int escape_hash_filter::sEscapeIdentifier = 'a';
|
||||
const int escape_hash_filter::sHashIdentifier = 'h';
|
||||
|
||||
escape_hash_filter::escape_hash_filter() : mNext(), mSeenNonWhitespace(false), mFinishLine(false)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -71,9 +71,9 @@ struct ConfigurationManager
|
|||
*/
|
||||
struct escape_hash_filter : public boost::iostreams::input_filter
|
||||
{
|
||||
static const int sEscape = '@';
|
||||
static const int sHashIdentifier = 'h';
|
||||
static const int sEscapeIdentifier = 'a';
|
||||
static const int sEscape;
|
||||
static const int sHashIdentifier;
|
||||
static const int sEscapeIdentifier;
|
||||
|
||||
escape_hash_filter();
|
||||
virtual ~escape_hash_filter();
|
||||
|
@ -114,22 +114,17 @@ int unescape_hash_filter::get(Source & src)
|
|||
{
|
||||
int nextChar = boost::iostreams::get(src);
|
||||
int intended;
|
||||
switch (nextChar)
|
||||
{
|
||||
case escape_hash_filter::sEscapeIdentifier:
|
||||
if (nextChar == escape_hash_filter::sEscapeIdentifier)
|
||||
intended = escape_hash_filter::sEscape;
|
||||
break;
|
||||
case escape_hash_filter::sHashIdentifier:
|
||||
else if (nextChar == escape_hash_filter::sHashIdentifier)
|
||||
intended = '#';
|
||||
break;
|
||||
case boost::iostreams::WOULD_BLOCK:
|
||||
else if (nextChar == boost::iostreams::WOULD_BLOCK)
|
||||
{
|
||||
expectingIdentifier = true;
|
||||
intended = nextChar;
|
||||
break;
|
||||
default:
|
||||
intended = '?';
|
||||
break;
|
||||
}
|
||||
else
|
||||
intended = '?';
|
||||
return intended;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue