fixed regression with g++-4.6 (Ubuntu Linux, 64 Bit). Moved local struct definition out of function scope. No functional change.

This commit is contained in:
Ettl Martin 2012-05-22 15:43:40 +02:00
parent a8382ea553
commit 1fd6d36493
1 changed files with 11 additions and 9 deletions

View File

@ -77,6 +77,17 @@ static OpenMode getMode(const std::string& str)
return READ_MODE; return READ_MODE;
return UNKNOWN; return UNKNOWN;
} }
struct Filepointer {
OpenMode mode;
unsigned int mode_indent;
enum Operation {NONE, UNIMPORTANT, READ, WRITE, POSITIONING, OPEN, CLOSE, UNKNOWN_OP} lastOperation;
unsigned int op_indent;
Filepointer(OpenMode mode_ = UNKNOWN)
: mode(mode_), mode_indent(0), lastOperation(NONE), op_indent(0) {
}
};
void CheckIO::checkFileUsage() void CheckIO::checkFileUsage()
{ {
static const char* _whitelist[] = { static const char* _whitelist[] = {
@ -84,15 +95,6 @@ void CheckIO::checkFileUsage()
}; };
static const std::set<std::string> whitelist(_whitelist, _whitelist + sizeof(_whitelist)/sizeof(*_whitelist)); static const std::set<std::string> whitelist(_whitelist, _whitelist + sizeof(_whitelist)/sizeof(*_whitelist));
struct Filepointer {
OpenMode mode;
unsigned int mode_indent;
enum Operation {NONE, UNIMPORTANT, READ, WRITE, POSITIONING, OPEN, CLOSE, UNKNOWN_OP} lastOperation;
unsigned int op_indent;
Filepointer(OpenMode mode_ = UNKNOWN)
: mode(mode_), mode_indent(0), lastOperation(NONE), op_indent(0) {
}
};
std::map<unsigned int, Filepointer> filepointers; std::map<unsigned int, Filepointer> filepointers;
const SymbolDatabase* symbolDatabase = _tokenizer->getSymbolDatabase(); const SymbolDatabase* symbolDatabase = _tokenizer->getSymbolDatabase();