diff options
author | Kissaki <kissaki@gmx.de> | 2011-10-03 16:46:48 +0400 |
---|---|---|
committer | Kissaki <kissaki@gmx.de> | 2011-10-09 16:01:58 +0400 |
commit | 5fe6801b1b2b652be8bd3244cfc6ae90b7466f16 (patch) | |
tree | b5c961a73d702b67baeff3e67a7db30720f9ab60 /src/murmur | |
parent | 683d39b26b5e8b1bd928b911790dc1d80be874a5 (diff) |
handle some cppcheck-found issues:
* uninitialized membervars,
* AudioOutput.cpp: fix delete on array to delete[]
* OSS.cpp: close file descriptor in false data case
* OverlayEditorScene.cpp: rm duplicate logic
* fix ifndef to match usage of declared variable
* member var initializations
* check for null (ds in d3d9 as some lines above),
* lower scope of var decl.,
* swap bufsize check and array dereference so check is before! deref,
* initialize member vars in constr.
Diffstat (limited to 'src/murmur')
-rw-r--r-- | src/murmur/DBus.cpp | 2 | ||||
-rw-r--r-- | src/murmur/DBus.h | 12 | ||||
-rw-r--r-- | src/murmur/ServerUser.cpp | 2 | ||||
-rw-r--r-- | src/murmur/UnixMurmur.cpp | 2 | ||||
-rw-r--r-- | src/murmur/main.cpp | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/src/murmur/DBus.cpp b/src/murmur/DBus.cpp index 8f6822e66..20addfdb3 100644 --- a/src/murmur/DBus.cpp +++ b/src/murmur/DBus.cpp @@ -738,7 +738,7 @@ ACLInfo::ACLInfo(const ChanACL *acl) { deny = acl->pDeny; } -GroupInfo::GroupInfo(const Group *g) { +GroupInfo::GroupInfo(const Group *g) : inherited(false) { name = g->qsName; inherit = g->bInherit; inheritable = g->bInheritable; diff --git a/src/murmur/DBus.h b/src/murmur/DBus.h index 98046ebc1..9a3e8e6df 100644 --- a/src/murmur/DBus.h +++ b/src/murmur/DBus.h @@ -49,7 +49,7 @@ struct PlayerInfo { bool mute, deaf, suppressed; bool selfMute, selfDeaf; int channel; - PlayerInfo() { }; + PlayerInfo() : session(0), mute(false), deaf(false), suppressed(false), selfMute(false), selfDeaf(false), channel(-1) { }; PlayerInfo(const User *); }; Q_DECLARE_METATYPE(PlayerInfo); @@ -59,7 +59,7 @@ struct PlayerInfoExtended : public PlayerInfo { QString name; int onlinesecs; int bytespersec; - PlayerInfoExtended() {}; + PlayerInfoExtended() : id(-1), onlinesecs(-1), bytespersec(-1) {}; PlayerInfoExtended(const User *); }; Q_DECLARE_METATYPE(PlayerInfoExtended); @@ -70,7 +70,7 @@ struct ChannelInfo { QString name; int parent; QList<int> links; - ChannelInfo() { }; + ChannelInfo() : id(-1), parent(-1) { }; ChannelInfo(const Channel *c); }; Q_DECLARE_METATYPE(ChannelInfo); @@ -80,7 +80,7 @@ struct GroupInfo { QString name; bool inherited, inherit, inheritable; QList<int> add, remove, members; - GroupInfo() { }; + GroupInfo() : inherited(false), inherit(false), inheritable(false) { }; GroupInfo(const Group *g); }; Q_DECLARE_METATYPE(GroupInfo); @@ -91,7 +91,7 @@ struct ACLInfo { int playerid; QString group; unsigned int allow, deny; - ACLInfo() { }; + ACLInfo() : applyHere(false), applySubs(false), inherited(false) { }; ACLInfo(const ChanACL *acl); }; Q_DECLARE_METATYPE(ACLInfo); @@ -100,7 +100,7 @@ Q_DECLARE_METATYPE(QList<ACLInfo>); struct BanInfo { unsigned int address; int bits; - BanInfo() { }; + BanInfo() : address(0), bits(0) { }; BanInfo(const Ban &); }; Q_DECLARE_METATYPE(BanInfo); diff --git a/src/murmur/ServerUser.cpp b/src/murmur/ServerUser.cpp index aacee597b..3af2be76a 100644 --- a/src/murmur/ServerUser.cpp +++ b/src/murmur/ServerUser.cpp @@ -35,7 +35,7 @@ #include "ServerUser.h" #include "Meta.h" -ServerUser::ServerUser(Server *p, QSslSocket *socket) : Connection(p, socket), User() { +ServerUser::ServerUser(Server *p, QSslSocket *socket) : Connection(p, socket), User(), s(NULL) { sState = ServerUser::Connected; sUdpSocket = INVALID_SOCKET; diff --git a/src/murmur/UnixMurmur.cpp b/src/murmur/UnixMurmur.cpp index 9e1c81c08..13b067ea6 100644 --- a/src/murmur/UnixMurmur.cpp +++ b/src/murmur/UnixMurmur.cpp @@ -36,7 +36,7 @@ QMutex *LimitTest::qm; QWaitCondition *LimitTest::qw; QWaitCondition *LimitTest::qstartw; -LimitTest::LimitTest() : QThread() { +LimitTest::LimitTest() : QThread(), tid(-1) { } void LimitTest::run() { diff --git a/src/murmur/main.cpp b/src/murmur/main.cpp index b29d10c05..f70cc2ca1 100644 --- a/src/murmur/main.cpp +++ b/src/murmur/main.cpp @@ -196,7 +196,7 @@ int main(int argc, char **argv) { bool wipeSsl = false; bool wipeLogs = false; int sunum = 1; -#ifndef Q_OS_WIN +#ifdef Q_OS_UNIX bool readPw = false; #endif |