Skip to content

Commit

Permalink
Fixed|GCC: Compiler warnings and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Feb 11, 2013
1 parent aab5170 commit 4348e3a
Show file tree
Hide file tree
Showing 31 changed files with 49 additions and 51 deletions.
2 changes: 1 addition & 1 deletion doomsday/client/src/audio/s_main.cpp
Expand Up @@ -269,7 +269,7 @@ sfxinfo_t* S_GetSoundInfo(int soundID, float* freq, float* volume)
info = info->link, *freq =
(info->linkPitch > 0 ? info->linkPitch / 128.0f : *freq), *volume +=
(info->linkVolume != -1 ? info->linkVolume / 127.0f : 0), soundID =
info - sounds, i++);
info - sounds, i++) {}

assert(soundID < defs.count.sounds.num);

Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/gl/gl_defer.cpp
Expand Up @@ -307,7 +307,7 @@ int GL_DeferredTaskCount(void)
return 0;

Sys_Lock(deferredMutex);
for(i = (deferredtask_t*) deferredTaskFirst; i; i = i->next, ++count);
for(i = (deferredtask_t*) deferredTaskFirst; i; i = i->next, ++count) {}
Sys_Unlock(deferredMutex);
return count;
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/gridmap.cpp
Expand Up @@ -263,7 +263,7 @@ static TreeCell* findLeaf(Gridmap* gm, GridmapCoord x, GridmapCoord y, boolean a
static GridmapCoord ceilPow2(GridmapCoord unit)
{
GridmapCoord cumul;
for(cumul = 1; unit > cumul; cumul <<= 1);
for(cumul = 1; unit > cumul; cumul <<= 1) {}
return cumul;
}

Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/map/p_think.cpp
Expand Up @@ -36,7 +36,7 @@ static thid_t newMobjID(GameMap* map)
assert(map);
// Increment the ID dealer until a free ID is found.
// @todo What if all IDs are in use? 65535 thinkers!?
while(GameMap_IsUsedMobjID(map, ++map->thinkers.iddealer));
while(GameMap_IsUsedMobjID(map, ++map->thinkers.iddealer)) {}
// Mark this ID as used.
GameMap_SetMobjID(map, map->thinkers.iddealer, true);
return map->thinkers.iddealer;
Expand Down
6 changes: 3 additions & 3 deletions doomsday/client/src/ui/b_context.cpp
Expand Up @@ -845,7 +845,7 @@ void B_PrintAllBindings(void)
(bc->flags & BCF_ACTIVE)? "active" : "inactive");

// Commands.
for(count = 0, e = bc->commandBinds.next; e != &bc->commandBinds; e = e->next, count++);
for(count = 0, e = bc->commandBinds.next; e != &bc->commandBinds; e = e->next, count++) {}

if(count)
Con_Printf(" %i event bindings:\n", count);
Expand All @@ -858,7 +858,7 @@ void B_PrintAllBindings(void)
}

// Controls.
for(count = 0, c = bc->controlBinds.next; c != &bc->controlBinds; c = c->next, count++);
for(count = 0, c = bc->controlBinds.next; c != &bc->controlBinds; c = c->next, count++) {}

if(count)
Con_Printf(" %i control bindings.\n", count);
Expand All @@ -873,7 +873,7 @@ void B_PrintAllBindings(void)
for(k = 0; k < DDMAXPLAYERS; ++k)
{
for(count = 0, d = c->deviceBinds[k].next; d != &c->deviceBinds[k];
d = d->next, count++);
d = d->next, count++) {}

if(!count)
continue;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/ui/fi_main.cpp
Expand Up @@ -120,7 +120,7 @@ static void stopFinale(finale_t* f)
static finaleid_t finalesUniqueId(void)
{
finaleid_t id = 0;
while(finalesById(++id));
while(finalesById(++id)) {}
return id;
}

Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/updater/updatersettingsdialog.cpp
Expand Up @@ -54,7 +54,7 @@ DENG2_PIMPL(UpdaterSettingsDialog)
QComboBox* pathList;
QCheckBox* deleteAfter;

Instance(Public &i) : Private(i)
Instance(Public &i) : Base(i)
{
// As a modal dialog it is implicitly clear that this belongs to
// Doomsday, so we don't need to have the name in the window title.
Expand Down
3 changes: 2 additions & 1 deletion doomsday/libdeng2/include/de/libdeng2.h
Expand Up @@ -210,7 +210,7 @@
* <pre>
* DENG2_PIMPL(MyClass)
* {
* Instance(Public &inst) : Private(inst) {
* Instance(Public &inst) : Base(inst) {
* // constructor
* }
* // private data and methods
Expand All @@ -231,6 +231,7 @@ namespace de {
template <typename Type>
struct Private {
Type &self;
typedef Private<Type> Base;
Private(Type &i) : self(i) {}
};

Expand Down
2 changes: 1 addition & 1 deletion doomsday/libdeng2/src/core/app.cpp
Expand Up @@ -82,7 +82,7 @@ DENG2_PIMPL(App), DENG2_OBSERVES(Record, Deletion)
void (*terminateFunc)(char const *);

Instance(Public &a, QStringList args)
: Private(a), cmdLine(args), persistentData(0), config(0), terminateFunc(0)
: Base(a), cmdLine(args), persistentData(0), config(0), terminateFunc(0)
{
singletonApp = &a;

Expand Down
2 changes: 1 addition & 1 deletion doomsday/libdeng2/src/core/commandline.cpp
Expand Up @@ -57,7 +57,7 @@ DENG2_PIMPL(CommandLine)
typedef std::map<std::string, ArgumentStrings> Aliases;
Aliases aliases;

Instance(Public &i) : Private(i)
Instance(Public &i) : Base(i)
{
initialDir = QDir::current();
}
Expand Down
6 changes: 4 additions & 2 deletions doomsday/libdeng2/src/core/log.cpp
Expand Up @@ -83,7 +83,8 @@ LogEntry::Arg::Arg(const LogEntry::Arg::Base &arg) : _type(arg.logEntryArgType()
}
}

LogEntry::Arg::Arg(Arg const &other) : _type(other._type)
LogEntry::Arg::Arg(Arg const &other)
: String::IPatternArg(), ISerializable(), _type(other._type)
{
switch(other._type)
{
Expand Down Expand Up @@ -200,7 +201,8 @@ LogEntry::LogEntry(Level level, String const &section, int sectionDepth, String
}

LogEntry::LogEntry(LogEntry const &other, Flags extraFlags)
: _when(other._when),
: Lockable(), ISerializable(),
_when(other._when),
_level(other._level),
_section(other._section),
_sectionDepth(other._sectionDepth),
Expand Down
2 changes: 2 additions & 0 deletions doomsday/libdeng2/src/widgets/animation.cpp
Expand Up @@ -140,6 +140,8 @@ struct Animation::Instance
return value + t * delta;
}
}

return target;
}
};

Expand Down
2 changes: 1 addition & 1 deletion doomsday/libshell/src/choicewidget.cpp
Expand Up @@ -30,7 +30,7 @@ DENG2_PIMPL(ChoiceWidget)
MenuWidget *menu;
String prompt;

Instance(Public &i) : Private(i), selection(0)
Instance(Public &i) : Base(i), selection(0)
{}

void updateMenu()
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libshell/src/commandlinewidget.cpp
Expand Up @@ -42,7 +42,7 @@ DENG2_PIMPL(CommandLineWidget)
QList<Command> history;
int historyPos;

Instance(Public &i) : Private(i), historyPos(0)
Instance(Public &i) : Base(i), historyPos(0)
{
history.append(Command());
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libshell/src/lineeditwidget.cpp
Expand Up @@ -56,7 +56,7 @@ DENG2_PIMPL(LineEditWidget)
LineWrapping wraps;

Instance(Public &i)
: Private(i),
: Base(i),
signalOnEnter(true),
cursor(0)
{
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libshell/src/link.cpp
Expand Up @@ -39,7 +39,7 @@ DENG2_PIMPL(Link)
Time connectedAt;

Instance(Public &i)
: Private(i),
: Base(i),
socket(0),
status(Disconnected),
connectedAt(Time::invalidTime()) {}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libshell/src/menuwidget.cpp
Expand Up @@ -50,7 +50,7 @@ DENG2_PIMPL(MenuWidget)
int cursor;

Instance(Public &i)
: Private(i),
: Base(i),
borderAttr(TextCanvas::Char::Reverse),
backgroundAttr(TextCanvas::Char::Reverse),
borderStyle(LineBorder),
Expand Down
9 changes: 0 additions & 9 deletions doomsday/plugins/config_plugin.pri
Expand Up @@ -9,15 +9,6 @@ win32 {
TARGET_EXT = .dll
}

!deng_macx4u_32bit : !deng_macx6_32bit_64bit {
*-g++* | *-gcc* | *-clang* {
# In the game plugins there is a large number of thinkfunc_t related
# casting from various types of functions. This should be removed
# when the issue has been resolved:
QMAKE_CFLAGS_WARN_ON += -Wno-incompatible-pointer-types
}
}

INCLUDEPATH += $$DENG_API_DIR

!dengplugin_libdeng2_full {
Expand Down
2 changes: 1 addition & 1 deletion doomsday/postbuild/postbuild.pro
Expand Up @@ -16,7 +16,7 @@ macx {

bundleapp.target = FORCE
bundleapp.commands = \
cd "$$OUT_PWD/.." && sh "$$PWD/bundleapp.sh" "$$PWD/.."
"cd \"$$OUT_PWD/..\" && sh \"$$PWD/bundleapp.sh\" \"$$PWD/..\""
}

OTHER_FILES = bundleapp.sh
6 changes: 3 additions & 3 deletions doomsday/server/src/server/sv_frame.cpp
Expand Up @@ -830,14 +830,14 @@ size_t Sv_GetMaxFrameSize(int playerNumber)
}

/**
* @return A unique resend ID. Never returns zero.
* @return A unique resend ID. Never returns zero.
*/
byte Sv_GetNewResendID(pool_t* pool)
{
byte id = pool->resendDealer;
byte id = pool->resendDealer;

// Advance to next ID, skipping zero.
while(!++pool->resendDealer);
while(!++pool->resendDealer) {}

return id;
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/server/src/shelluser.cpp
Expand Up @@ -38,7 +38,7 @@ DENG2_PIMPL(ShellUser), public LogSink
/// Log entries to be sent are collected here.
shell::LogEntryPacket logEntryPacket;

Instance(Public &i) : Private(i)
Instance(Public &i) : Base(i)
{
// We will send all log entries to a shell user.
LogBuffer::appBuffer().addSink(*this);
Expand Down
11 changes: 6 additions & 5 deletions doomsday/tools/md2tool/md2tool.pro
Expand Up @@ -11,11 +11,12 @@ CONFIG -= app_bundle
win32: CONFIG += console
QT -= core gui

!deng_macx4u_32bit : !deng_macx6_32bit_64bit {
*-g++* | *-gcc* | *-clang* {
QMAKE_CFLAGS_WARN_ON += -Wno-unused-result
}
}
# TODO: need to test whether compiler supports this option
#!deng_macx4u_32bit : !deng_macx6_32bit_64bit {
# *-g++* | *-gcc* | *-clang* {
# QMAKE_CFLAGS_WARN_ON += -Wno-unused-result
# }
#}

SOURCES += md2tool.c

Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/shell/shell-gui/src/linkwindow.cpp
Expand Up @@ -64,7 +64,7 @@ DENG2_PIMPL(LinkWindow)
QAction *stopAction;

Instance(Public &i)
: Private(i),
: Base(i),
link(0),
statusButton(0),
consoleButton(0),
Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/shell/shell-gui/src/localserverdialog.cpp
Expand Up @@ -41,7 +41,7 @@ DENG2_PIMPL(LocalServerDialog)
QLineEdit *folder;
QLineEdit *iwadFolder;

Instance(Public &i) : Private(i)
Instance(Public &i) : Base(i)
{
QSettings st;

Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/shell/shell-gui/src/opendialog.cpp
Expand Up @@ -43,7 +43,7 @@ DENG2_PIMPL(OpenDialog)
QStringList history;
bool edited;

Instance(Public &i) : Private(i), edited(false)
Instance(Public &i) : Base(i), edited(false)
{
// Restore the historical entries.
QSettings st;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/shell/shell-gui/src/qtrootwidget.cpp
Expand Up @@ -52,7 +52,7 @@ DENG2_PIMPL(QtRootWidget)
QPoint origin;
QString overlay;

Instance(Public &inst) : Private(inst),
Instance(Public &inst) : Base(inst),
margin(4),
canvas(new QtTextCanvas(Vector2i(1, 1))),
root(canvas),
Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/shell/shell-gui/src/statuswidget.cpp
Expand Up @@ -36,7 +36,7 @@ DENG2_PIMPL(StatusWidget)
QRect mapBounds;
shell::Link *link;

Instance(Public &i) : Private(i), link(0)
Instance(Public &i) : Base(i), link(0)
{
//gameMode = "Ultimate DOOM";
//map = "E1M3";
Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/shell/shell-text/src/cursesapp.cpp
Expand Up @@ -85,7 +85,7 @@ DENG2_PIMPL(CursesApp)

TextRootWidget *rootWidget;

Instance(Public &i) : Private(i), unicodeContinuation(0), rootWidget(0)
Instance(Public &i) : Base(i), unicodeContinuation(0), rootWidget(0)
{
logBuffer.enableStandardOutput(false);

Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/shell/shell-text/src/shellapp.cpp
Expand Up @@ -47,7 +47,7 @@ DENG2_PIMPL(ShellApp)
Link *link;
ServerFinder finder;

Instance(Public &i) : Private(i), link(0)
Instance(Public &i) : Base(i), link(0)
{
RootWidget &root = self.rootWidget();

Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/shell/shell-text/src/statuswidget.cpp
Expand Up @@ -28,7 +28,7 @@ DENG2_PIMPL(StatusWidget)
Link *link;
QTimer *updateTimer;

Instance(Public &i) : Private(i), link(0)
Instance(Public &i) : Base(i), link(0)
{
updateTimer = new QTimer(&self);
}
Expand Down
11 changes: 6 additions & 5 deletions doomsday/tools/texc/texc.pro
Expand Up @@ -11,11 +11,12 @@ CONFIG -= app_bundle
win32: CONFIG += console
QT -= core gui

!deng_macx4u_32bit : !deng_macx6_32bit_64bit {
*-g++* | *-gcc* | *-clang* {
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-result
}
}
# TODO: need to test whether compiler supports this option
#!deng_macx4u_32bit : !deng_macx6_32bit_64bit {
# *-g++* | *-gcc* | *-clang* {
# QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-result
# }
#}

SOURCES += import.cpp texc.cpp

Expand Down

0 comments on commit 4348e3a

Please sign in to comment.