Commit b4e42106 authored by Roberto Raggi's avatar Roberto Raggi

Removed stray tokens and fixed warnings/errors when compiling with pedantic C++ compilers.

parent 63522a04
......@@ -2461,7 +2461,7 @@ static const char *qConnectionType(uint type)
#endif
};
return output;
};
}
#if QT_VERSION >= 0x040400
static const ConnectionList &qConnectionList(const QObject *ob, int signalNumber)
......
......@@ -70,9 +70,9 @@ public:
WarnUseBeforeDeclaration = 1 << 8,
WarnDuplicateDeclaration = 1 << 9,
WarnDeclarationsNotStartOfFunction = 1 << 10,
WarnCaseWithoutFlowControlEnd = 1 << 11,
WarnCaseWithoutFlowControlEnd = 1 << 11
};
Q_DECLARE_FLAGS(Options, Option);
Q_DECLARE_FLAGS(Options, Option)
protected:
virtual bool preVisit(AST::Node *ast);
......
......@@ -169,7 +169,7 @@ public: // must be public to make Q_GADGET introspection work
switch_statement, // After 'switch' token
case_start, // after a 'case' or 'default' token
case_cont, // after the colon in a case/default
case_cont // after the colon in a case/default
};
Q_ENUMS(StateType)
......@@ -233,7 +233,7 @@ protected:
Question,
PlusPlus,
MinusMinus,
MinusMinus
};
TokenKind extendedTokenKind(const QmlJS::Token &token) const;
......
......@@ -34,7 +34,7 @@
#include <QtGui/QWidget>
QT_FORWARD_DECLARE_CLASS(QResizeEvent);
QT_FORWARD_DECLARE_CLASS(QResizeEvent)
namespace Utils {
......
......@@ -5,9 +5,9 @@
#include <QtGui/QWidget>
QT_FORWARD_DECLARE_CLASS(QCheckBox);
QT_FORWARD_DECLARE_CLASS(QLabel);
QT_FORWARD_DECLARE_CLASS(QSpinBox);
QT_FORWARD_DECLARE_CLASS(QCheckBox)
QT_FORWARD_DECLARE_CLASS(QLabel)
QT_FORWARD_DECLARE_CLASS(QSpinBox)
namespace Utils {
......
......@@ -65,7 +65,7 @@ public:
HistoryCompleterPrivate(HistoryCompleter *parent);
HistoryCompleter *q_ptr;
HistoryListModel *model;
Q_DECLARE_PUBLIC(HistoryCompleter);
Q_DECLARE_PUBLIC(HistoryCompleter)
};
class HistoryLineDelegate : public QItemDelegate
......
......@@ -59,7 +59,7 @@ protected:
HistoryCompleterPrivate *d_ptr;
private:
Q_DECLARE_PRIVATE(HistoryCompleter);
Q_DECLARE_PRIVATE(HistoryCompleter)
};
} // namespace Utils
......
......@@ -51,6 +51,6 @@ public:
const QString &file);
};
};
}
#endif // UNIXUTILS_H
......@@ -277,5 +277,5 @@ private:
} // namespace Core
Q_DECLARE_OPERATORS_FOR_FLAGS(Core::EditorManager::OpenEditorFlags);
Q_DECLARE_OPERATORS_FOR_FLAGS(Core::EditorManager::OpenEditorFlags)
#endif // EDITORMANAGER_H
......@@ -113,7 +113,7 @@ namespace Internal {
// and read while checking).
class FileMatchContext {
Q_DISABLE_COPY(FileMatchContext);
Q_DISABLE_COPY(FileMatchContext)
public:
// Max data to be read from a file
enum { MaxData = 2048 };
......@@ -164,7 +164,7 @@ QByteArray FileMatchContext::data()
// The binary fallback matcher for "application/octet-stream".
class BinaryMatcher : public IMagicMatcher {
Q_DISABLE_COPY(BinaryMatcher);
Q_DISABLE_COPY(BinaryMatcher)
public:
BinaryMatcher() {}
virtual bool matches(const QByteArray & /*data*/) const { return true; }
......@@ -174,7 +174,7 @@ public:
// A heuristic text file matcher: If the data do not contain any character
// below tab (9), detect as text.
class HeuristicTextMagicMatcher : public IMagicMatcher {
Q_DISABLE_COPY(HeuristicTextMagicMatcher);
Q_DISABLE_COPY(HeuristicTextMagicMatcher)
public:
HeuristicTextMagicMatcher() {}
virtual bool matches(const QByteArray &data) const;
......@@ -646,7 +646,7 @@ namespace Internal {
// MimeDatabase helpers: Generic parser for a sequence of <mime-type>.
// Calls abstract handler function process for MimeType it finds.
class BaseMimeTypeParser {
Q_DISABLE_COPY(BaseMimeTypeParser);
Q_DISABLE_COPY(BaseMimeTypeParser)
public:
BaseMimeTypeParser();
virtual ~BaseMimeTypeParser() {}
......
......@@ -34,7 +34,7 @@
#include <QtCore/QObject>
#include <QtCore/QString>
QT_FORWARD_DECLARE_CLASS(QTimer);
QT_FORWARD_DECLARE_CLASS(QTimer)
namespace Core {
namespace Internal {
......
......@@ -75,7 +75,7 @@ enum SshPacketType {
SSH_MSG_CHANNEL_CLOSE = 97,
SSH_MSG_CHANNEL_REQUEST = 98,
SSH_MSG_CHANNEL_SUCCESS = 99,
SSH_MSG_CHANNEL_FAILURE = 100,
SSH_MSG_CHANNEL_FAILURE = 100
};
enum SshExtendedDataType { SSH_EXTENDED_DATA_STDERR = 1 };
......
......@@ -50,7 +50,7 @@ namespace TextEditor {
class TabSettings;
}
namespace CppTools {
namespace CppTools {
namespace Internal {
class CppCodeFormatterData;
}
......@@ -170,7 +170,7 @@ public: // must be public to make Q_GADGET introspection work
assign_open, // after an assignment token
expression, // after a '=' in a declaration_start once we're sure it's not '= {'
initializer, // after a '=' in a declaration start
initializer // after a '=' in a declaration start
};
Q_ENUMS(StateType)
......
......@@ -94,7 +94,7 @@ public:
PublicSlot = Public | SlotBit,
ProtectedSlot = Protected | SlotBit,
PrivateSlot = Private | SlotBit,
PrivateSlot = Private | SlotBit
};
public:
......
......@@ -1036,7 +1036,7 @@ static QString stateToString(BreakpointState state)
case BreakpointDead: return "Dead";
default: return "<invalid state>";
}
};
}
bool BreakHandler::BreakpointItem::needsChange() const
{
......
......@@ -54,7 +54,7 @@ enum BreakpointType
BreakpointAtThrow,
BreakpointAtCatch,
BreakpointAtMain,
Watchpoint,
Watchpoint
};
enum BreakpointState
......@@ -67,7 +67,7 @@ enum BreakpointState
BreakpointInserted,
BreakpointRemoveRequested,
BreakpointRemoveProceeding,
BreakpointDead,
BreakpointDead
};
class BreakpointParameters
......
......@@ -151,7 +151,7 @@ public:
History() : m_index(0) {}
void append(const QString &item) {
m_items.removeAll(item);
m_items.append(item); m_index = m_items.size() - 1;
m_items.append(item); m_index = m_items.size() - 1;
}
void down() { m_index = qMin(m_index + 1, m_items.size()); }
void up() { m_index = qMax(m_index - 1, 0); }
......@@ -289,7 +289,7 @@ ConsoleWindow::ConsoleWindow(QWidget *parent)
//connect(m_console, SIGNAL(statusMessageRequested(QString,int)),
// this, SIGNAL(statusMessageRequested(QString,int)));
};
}
void ConsoleWindow::showOutput(int channel, const QString &output)
{
......
......@@ -162,7 +162,7 @@ enum DebuggerCapabilities
CreateFullBacktraceCapability = 0x800,
AddWatcherCapability = 0x1000,
WatchpointCapability = 0x2000,
ShowModuleSymbolsCapability = 0x4000,
ShowModuleSymbolsCapability = 0x4000
};
enum LogChannel
......@@ -209,7 +209,7 @@ enum ModelRoles
LocalsIsWatchpointAtPointerValueRole,
// Snapshots
SnapshotCapabilityRole,
SnapshotCapabilityRole
};
enum DebuggerEngineType
......
......@@ -72,7 +72,7 @@ enum DebuggingHelperState
DebuggingHelperUninitialized,
DebuggingHelperLoadTried,
DebuggingHelperAvailable,
DebuggingHelperUnavailable,
DebuggingHelperUnavailable
};
......@@ -182,7 +182,7 @@ private: ////////// Gdb Command Management //////////
enum GdbCommandFlag {
NoFlags = 0,
// The command needs a stopped inferior.
NeedsStop = 1,
NeedsStop = 1,
// No need to wait for the reply before continuing inferior.
Discardable = 2,
// Trigger watch model rebuild when no such commands are pending anymore.
......@@ -201,7 +201,7 @@ private: ////////// Gdb Command Management //////////
// This command needs to be send immediately.
Immediate = 256,
// This is a command that needs to be wrapped into -interpreter-exec console
ConsoleCommand = 512,
ConsoleCommand = 512
};
Q_DECLARE_FLAGS(GdbCommandFlags, GdbCommandFlag)
private:
......@@ -524,7 +524,7 @@ private: ////////// View & Data Stuff //////////
QtDumperHelper m_dumperHelper;
QString m_gdb;
//
//
// Convenience Functions
//
QString errorMessage(QProcess::ProcessError error);
......
......@@ -386,7 +386,7 @@ QByteArray GdbResponse::stringFromResultClass(GdbResultClass resultClass)
case GdbResultExit: return "exit";
default: return "unknown";
}
};
}
QByteArray GdbResponse::toString() const
{
......
......@@ -100,7 +100,7 @@ public:
Invalid,
Const,
Tuple,
List,
List
};
Type m_type;
......@@ -152,7 +152,7 @@ enum GdbResultClass
GdbResultRunning,
GdbResultConnected,
GdbResultError,
GdbResultExit,
GdbResultExit
};
class GdbResponse
......
......@@ -91,7 +91,7 @@ private slots:
private:
enum State {
Inactive, Connecting, CreatingFifo, StartingFifoReader,
StartingGdb, RunningGdb,
StartingGdb, RunningGdb
};
static QByteArray readerCmdLine(const QByteArray &file);
......
......@@ -84,7 +84,7 @@ namespace Symbian {
enum CodeMode
{
ArmMode = 0,
ThumbMode,
ThumbMode
};
enum TargetConstants
......
......@@ -124,7 +124,7 @@ public:
UpdateWatchData = 47,
FrameSourceFetched = 48
};
Q_ENUMS(Function);
Q_ENUMS(Function)
DebuggerState state() const;
void notifyEngineSetupOk();
......
......@@ -85,7 +85,7 @@ public:
RequestUpdateWatchData = 25,
FetchFrameSource = 26
};
Q_ENUMS(Function);
Q_ENUMS(Function)
void setupEngine();
void setupInferior();
......
......@@ -382,7 +382,7 @@ LogWindow::LogWindow(QWidget *parent)
this, SIGNAL(statusMessageRequested(QString,int)));
connect(m_inputText, SIGNAL(commandSelected(int)),
m_combinedText, SLOT(gotoResult(int)));
};
}
void LogWindow::showOutput(int channel, const QString &output)
{
......
......@@ -75,12 +75,12 @@ public:
enum SymbolReadState {
UnknownReadState, // Not tried.
ReadFailed, // Tried to read, but failed.
ReadOk, // Dwarf index available.
ReadOk // Dwarf index available.
};
enum SymbolType {
UnknownType, // Unknown.
PlainSymbols, // Ordinary symbols available.
FastSymbols, // Dwarf index available.
FastSymbols // Dwarf index available.
};
QString moduleName;
QString modulePath;
......
......@@ -51,7 +51,7 @@ public:
String,
Number,
Object,
Array,
Array
};
Type m_type;
......
......@@ -59,7 +59,7 @@ enum IntegerFormat
DecimalFormat = 0, // Keep that at 0 as default.
HexadecimalFormat,
BinaryFormat,
OctalFormat,
OctalFormat
};
class WatchModel : public QAbstractItemModel
......
......@@ -691,7 +691,7 @@ bool currentTextEditorPosition(QString *fileNameIn /* = 0 */,
int *lineNumberIn /* = 0 */)
{
QString fileName;
int lineNumber;
int lineNumber = 0;
if (TextEditor::ITextEditor *textEditor = currentTextEditor()) {
if (const Core::IFile *file = textEditor->file()) {
fileName = file->fileName();
......
......@@ -57,7 +57,7 @@ namespace Internal {
class FormEditorStack : public QStackedWidget
{
Q_OBJECT
Q_DISABLE_COPY(FormEditorStack);
Q_DISABLE_COPY(FormEditorStack)
public:
explicit FormEditorStack(QWidget *parent = 0);
......
......@@ -139,7 +139,7 @@ enum Mode
InsertMode,
ReplaceMode,
CommandMode,
ExMode,
ExMode
};
/*! A \e SubMode is used for things that require one more data item
......@@ -162,7 +162,7 @@ enum SubMode
CapitalZSubMode, // Used for Z
ReplaceSubMode, // Used for r
OpenSquareSubMode, // Used for [
CloseSquareSubMode, // Used for ]
CloseSquareSubMode // Used for ]
};
/*! A \e SubSubMode is used for things that require one more data item
......@@ -179,7 +179,7 @@ enum SubSubMode
DownCaseSubSubMode, // Used for gu.
UpCaseSubSubMode, // Used for gU.
TextObjectSubSubMode, // Used for thing like iw, aW, as etc.
SearchSubSubMode,
SearchSubSubMode
};
enum VisualMode
......@@ -187,14 +187,14 @@ enum VisualMode
NoVisualMode,
VisualCharMode,
VisualLineMode,
VisualBlockMode,
VisualBlockMode
};
enum MoveType
{
MoveExclusive,
MoveInclusive,
MoveLineWise,
MoveLineWise
};
/*!
......@@ -1948,7 +1948,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(const Input &input)
m_findPending = true;
m_findStartPosition = position();
m_movetype = MoveExclusive;
setAnchor(); // clear selection: otherwise, search is restricted to selection
setAnchor(); // clear selection: otherwise, search is restricted to selection
emit q->findRequested(!m_lastSearchForward);
} else {
// FIXME: make core find dialog sufficiently flexible to
......
......@@ -44,7 +44,7 @@ enum RangeMode
RangeLineMode, // V
RangeLineModeExclusive,
RangeBlockMode, // Ctrl-v
RangeBlockAndTailMode, // Ctrl-v for D and X
RangeBlockAndTailMode // Ctrl-v for D and X
};
struct Range
......
......@@ -53,7 +53,7 @@ struct GitoriousRepository
CloneRepository,
BaselineRepository, // Nokia extension
SharedRepository, // Nokia extension
PersonalRepository, // Nokia extension
PersonalRepository // Nokia extension
};
GitoriousRepository();
......
......@@ -281,7 +281,7 @@ QByteArray GLSLEditorPlugin::glslFile(const QString &fileName)
void GLSLEditorPlugin::parseGlslFile(const QString &fileName, InitFile *initFile)
{
// Parse the builtins for any langugage variant so we can use all keywords.
const int variant = GLSL::Lexer::Variant_All;
const unsigned variant = GLSL::Lexer::Variant_All;
const QByteArray code = glslFile(fileName);
initFile->engine = new GLSL::Engine();
......
......@@ -32,7 +32,7 @@
#include <QtGui/QWidget>
QT_FORWARD_DECLARE_CLASS(QLabel);
QT_FORWARD_DECLARE_CLASS(QLabel)
namespace HelloWorld {
namespace Internal {
......
......@@ -82,7 +82,7 @@ bool Settings::equals(const Settings &rhs) const
&& p4Client == rhs.p4Client && p4User == rhs.p4User
&& timeOutS == rhs.timeOutS && promptToSubmit == rhs.promptToSubmit
&& autoOpen == rhs.autoOpen;
};
}
QStringList Settings::commonP4Arguments() const
{
......
......@@ -82,7 +82,7 @@ inline bool operator!=(const Settings &s1, const Settings &s2) { return !s1.equa
* "-d" option, so that running p4 in "/depot/dev/foo" results in "-d $HOME/dev/foo". */
class PerforceSettings {
Q_DISABLE_COPY(PerforceSettings);
Q_DISABLE_COPY(PerforceSettings)
public:
PerforceSettings();
~PerforceSettings();
......
......@@ -78,7 +78,7 @@ Core::IVersionControl::SettingsFlags PerforceVersionControl::settingsFlags() con
if (m_plugin->settings().autoOpen())
rc|= AutoOpen;
return rc;
};
}
bool PerforceVersionControl::vcsAdd(const QString &fileName)
{
......
......@@ -388,7 +388,7 @@ static ParseState nextOpeningState(ParseState in, const QStringRef &name)
break;
}
return ParseError;
};
}
// Switch parser state depending on closing element name.
static ParseState nextClosingState(ParseState in, const QStringRef &name)
......@@ -454,7 +454,7 @@ static ParseState nextClosingState(ParseState in, const QStringRef &name)
break;
}
return ParseError;
};
}
// Parse kind attribute
static inline Core::IWizard::WizardKind kindAttribute(const QXmlStreamReader &r)
......
......@@ -35,7 +35,7 @@
namespace Core {
class GeneratedFile;
};
}
namespace ProjectExplorer {
namespace Internal {
......
......@@ -34,10 +34,10 @@
#include <QtCore/QObject>
QT_FORWARD_DECLARE_CLASS(QMouseEvent);
QT_FORWARD_DECLARE_CLASS(QPlainTextEdit);
QT_FORWARD_DECLARE_CLASS(QTextCharFormat);
QT_FORWARD_DECLARE_CLASS(QColor);
QT_FORWARD_DECLARE_CLASS(QMouseEvent)
QT_FORWARD_DECLARE_CLASS(QPlainTextEdit)
QT_FORWARD_DECLARE_CLASS(QTextCharFormat)
QT_FORWARD_DECLARE_CLASS(QColor)
namespace ProjectExplorer {
......
......@@ -36,7 +36,7 @@
namespace Utils {
class AbstractMacroExpander;
};
}