From 1fd6d36493c6de0250590d99a52599f16068e30e Mon Sep 17 00:00:00 2001 From: Ettl Martin Date: Tue, 22 May 2012 15:43:40 +0200 Subject: [PATCH] fixed regression with g++-4.6 (Ubuntu Linux, 64 Bit). Moved local struct definition out of function scope. No functional change. --- lib/checkio.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/checkio.cpp b/lib/checkio.cpp index 6901f2611..17121edc7 100644 --- a/lib/checkio.cpp +++ b/lib/checkio.cpp @@ -77,6 +77,17 @@ static OpenMode getMode(const std::string& str) return READ_MODE; 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() { static const char* _whitelist[] = { @@ -84,15 +95,6 @@ void CheckIO::checkFileUsage() }; static const std::set 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 filepointers; const SymbolDatabase* symbolDatabase = _tokenizer->getSymbolDatabase();