Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
6d3fe428
Commit
6d3fe428
authored
Jun 27, 2014
by
Daenyth
Browse files
Fix some warnings
Ref #127
parent
d3b4ef38
Changes
11
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
6d3fe428
...
...
@@ -58,8 +58,8 @@ IF(MSVC)
#set(CMAKE_CXX_FLAGS_DEBUG "/Zi")
ELSEIF
(
CMAKE_COMPILER_IS_GNUCXX
)
# linux/gcc, bsd/gcc, windows/mingw
set
(
CMAKE_CXX_FLAGS_RELEASE
"-s -O2"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-ggdb -O0"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-s -O2
-Wall -Wextra -pedantic -Werror -Wcast-align -Wmissing-declarations -Winline -Wno-long-long -Wno-error=extra -Wno-unused-parameter -Wno-inline -Wno-delete-non-virtual-dtor -Wno-error=sign-compare -Wno-reorder -Wno-missing-declarations
"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-ggdb -O0
-Wall -Wextra -pedantic -Werror -Wcast-align -Wmissing-declarations -Winline -Wno-long-long -Wno-error=extra -Wno-error=unused-parameter -Wno-inline -Wno-error=delete-non-virtual-dtor -W-noerror=sign-compare -Wno-error=reorder -Wno-error=missing-declarations
"
)
ELSE
()
# other: osx/llvm, bsd/llvm
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O2"
)
...
...
cockatrice/src/abstractclient.h
View file @
6d3fe428
...
...
@@ -31,7 +31,7 @@ enum ClientStatus {
StatusConnecting
,
StatusAwaitingWelcome
,
StatusLoggingIn
,
StatusLoggedIn
,
StatusLoggedIn
};
class
AbstractClient
:
public
QObject
{
...
...
cockatrice/src/carddatabase.cpp
View file @
6d3fe428
...
...
@@ -16,7 +16,7 @@
const
int
CardDatabase
::
versionNeeded
=
3
;
QXmlStreamWriter
&
operator
<<
(
QXmlStreamWriter
&
xml
,
const
CardSet
*
set
)
static
QXmlStreamWriter
&
operator
<<
(
QXmlStreamWriter
&
xml
,
const
CardSet
*
set
)
{
xml
.
writeStartElement
(
"set"
);
xml
.
writeTextElement
(
"name"
,
set
->
getShortName
());
...
...
@@ -280,13 +280,13 @@ CardInfo::CardInfo(CardDatabase *_db,
name
(
_name
),
isToken
(
_isToken
),
sets
(
_sets
),
muIds
(
_muIds
),
manacost
(
_manacost
),
cardtype
(
_cardtype
),
powtough
(
_powtough
),
text
(
_text
),
colors
(
_colors
),
loyalty
(
_loyalty
),
muIds
(
_muIds
),
cipt
(
_cipt
),
tableRow
(
_tableRow
),
pixmap
(
NULL
)
...
...
@@ -434,7 +434,7 @@ int CardInfo::getPreferredMuId()
return
muIds
[
getPreferredSet
()
->
getShortName
()];
}
QXmlStreamWriter
&
operator
<<
(
QXmlStreamWriter
&
xml
,
const
CardInfo
*
info
)
static
QXmlStreamWriter
&
operator
<<
(
QXmlStreamWriter
&
xml
,
const
CardInfo
*
info
)
{
xml
.
writeStartElement
(
"card"
);
xml
.
writeTextElement
(
"name"
,
info
->
getName
());
...
...
@@ -473,7 +473,7 @@ QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfo *info)
}
CardDatabase
::
CardDatabase
(
QObject
*
parent
)
:
QObject
(
parent
),
loadStatus
(
NotLoaded
)
,
noCard
(
0
)
:
QObject
(
parent
),
noCard
(
0
),
loadStatus
(
NotLoaded
)
{
connect
(
settingsCache
,
SIGNAL
(
picsPathChanged
()),
this
,
SLOT
(
picsPathChanged
()));
connect
(
settingsCache
,
SIGNAL
(
cardDatabasePathChanged
()),
this
,
SLOT
(
loadCardDatabase
()));
...
...
cockatrice/src/cardfilter.h
View file @
6d3fe428
...
...
@@ -26,9 +26,9 @@ public:
};
private:
QString
trm
;
enum
Type
t
;
enum
Attr
a
;
QString
trm
;
public:
CardFilter
(
QString
term
,
Type
type
,
Attr
attr
)
:
trm
(
term
),
t
(
type
),
a
(
attr
)
{};
...
...
cockatrice/src/decklistmodel.cpp
View file @
6d3fe428
...
...
@@ -340,6 +340,9 @@ void DeckListModel::sort(int column, Qt::SortOrder order)
break
;
case
2
:
sortMethod
=
ByPrice
;
break
;
default:
sortMethod
=
ByName
;
}
root
->
setSortMethod
(
sortMethod
);
sortHelper
(
root
,
order
);
...
...
cockatrice/src/filtertree.h
View file @
6d3fe428
...
...
@@ -66,7 +66,7 @@ public:
const
CardFilter
::
Attr
attr
;
LogicMap
(
CardFilter
::
Attr
a
,
FilterTree
*
parent
)
:
attr
(
a
),
p
(
parent
)
{}
:
p
(
parent
),
attr
(
a
)
{}
const
FilterItemList
*
findTypeList
(
CardFilter
::
Type
type
)
const
;
FilterItemList
*
typeList
(
CardFilter
::
Type
type
);
FilterTreeNode
*
parent
()
const
;
...
...
@@ -81,7 +81,7 @@ public:
const
CardFilter
::
Type
type
;
FilterItemList
(
CardFilter
::
Type
t
,
LogicMap
*
parent
)
:
type
(
t
),
p
(
paren
t
)
{}
:
p
(
parent
),
type
(
t
)
{}
CardFilter
::
Attr
attr
()
const
{
return
p
->
attr
;
}
FilterTreeNode
*
parent
()
const
{
return
p
;
}
int
termIndex
(
const
QString
&
term
)
const
;
...
...
cockatrice/src/main.cpp
View file @
6d3fe428
...
...
@@ -55,7 +55,7 @@ QString translationPath = TRANSLATION_PATH;
QString
translationPath
=
QString
();
#endif
void
myMessageOutput
(
QtMsgType
/*type*/
,
const
char
*
msg
)
static
void
myMessageOutput
(
QtMsgType
/*type*/
,
const
char
*
msg
)
{
QFile
file
(
"qdebug.txt"
);
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Truncate
|
QIODevice
::
Text
);
...
...
cockatrice/src/main.h
View file @
6d3fe428
...
...
@@ -13,4 +13,6 @@ extern QString translationPath;
void
installNewTranslator
();
bool
settingsValid
();
#endif
common/decklist.cpp
View file @
6d3fe428
...
...
@@ -180,6 +180,7 @@ bool InnerDecklistNode::compare(AbstractDecklistNode *other) const
case
2
:
return
comparePrice
(
other
);
}
return
0
;
}
bool
InnerDecklistNode
::
compareNumber
(
AbstractDecklistNode
*
other
)
const
...
...
@@ -226,6 +227,7 @@ bool AbstractDecklistCardNode::compare(AbstractDecklistNode *other) const
case
ByPrice
:
return
compareTotalPrice
(
other
);
}
return
0
;
}
bool
AbstractDecklistCardNode
::
compareNumber
(
AbstractDecklistNode
*
other
)
const
...
...
@@ -351,6 +353,7 @@ DeckList::DeckList()
root
=
new
InnerDecklistNode
;
}
// TODO: http://qt-project.org/doc/qt-4.8/qobject.html#no-copy-constructor-or-assignment-operator
DeckList
::
DeckList
(
const
DeckList
&
other
)
:
name
(
other
.
name
),
comments
(
other
.
comments
),
...
...
common/server_response_containers.cpp
View file @
6d3fe428
...
...
@@ -64,7 +64,7 @@ void GameEventStorage::sendToGame(Server_Game *game)
}
ResponseContainer
::
ResponseContainer
(
int
_cmdId
)
:
responseExtension
(
0
)
,
cmdId
(
_cmdId
)
:
cmdId
(
_cmdId
),
responseExtension
(
0
)
{
}
...
...
oracle/src/oracleimporter.h
View file @
6d3fe428
...
...
@@ -17,7 +17,7 @@ public:
bool
getImport
()
const
{
return
import
;
}
void
setImport
(
bool
_import
)
{
import
=
_import
;
}
SetToDownload
(
const
QString
&
_shortName
,
const
QString
&
_longName
,
const
QVariant
&
_cards
,
bool
_import
)
:
shortName
(
_shortName
),
longName
(
_longName
),
cards
(
_cards
),
import
(
_import
)
{
}
:
shortName
(
_shortName
),
longName
(
_longName
),
import
(
_import
)
,
cards
(
_cards
)
{
}
bool
operator
<
(
const
SetToDownload
&
set
)
const
{
return
longName
.
compare
(
set
.
longName
,
Qt
::
CaseInsensitive
)
<
0
;
}
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment