Remove warnings (5)

This commit is contained in:
CalciteM Team 2019-08-25 19:22:53 +08:00
parent 10c1b177ce
commit 81609ddbef
7 changed files with 20 additions and 19 deletions

View File

@ -136,6 +136,7 @@
#ifdef WIN32
#define sscanf sscanf_s
#define sprintf sprintf_s
#endif
#endif // CONFIG_H

View File

@ -117,7 +117,7 @@
<AssemblerListingLocation>release\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
<DebugInformationFormat>None</DebugInformationFormat>
<DisableSpecificWarnings>4577;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>4577;4467;4125;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>$(IntDir)</ObjectFileName>
<Optimization>MaxSpeed</Optimization>
@ -127,7 +127,7 @@
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>true</WholeProgramOptimization>
@ -254,7 +254,7 @@
<AssemblerListingLocation>debug\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4577;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>4577;4467;4125;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>$(IntDir)</ObjectFileName>
<Optimization>Disabled</Optimization>
@ -263,7 +263,7 @@
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
<LanguageStandard>stdcpp17</LanguageStandard>

View File

@ -52,11 +52,11 @@ private slots:
void sessionOpened();
void setPort(uint16_t port)
{
this->port = port;
this->port_ = port;
}
uint16_t getPort()
{
return port;
return port_;
}
private:
@ -71,7 +71,7 @@ private:
QNetworkSession *networkSession = nullptr;
uint16_t port {};
uint16_t port_ {};
};
#endif // CLIENT_H

View File

@ -1679,7 +1679,7 @@ void NineChess::mirror(bool cmdChange /*= true*/)
r = static_cast<int>(llp[i]) / N_SEATS;
s = static_cast<int>(llp[i]) % N_SEATS;
s = (N_SEATS - s) % N_SEATS;
llp[i] = static_cast<uint64_t>(r * N_SEATS + s);
llp[i] = (static_cast<uint64_t>(r) * N_SEATS + s);
}
move_ = static_cast<int16_t>(((llp[0] << 8) | llp[1]));

View File

@ -235,7 +235,7 @@ public:
enum NineChess::Player turn;
// 动作状态标识
enum NineChess::Action action;
enum NineChess::Action action {};
// 玩家1剩余未放置子数
int nPiecesInHand_1 {};

View File

@ -31,7 +31,7 @@ Server::Server(QWidget *parent, uint16_t port)
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
statusLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
this->port = port;
this->port_ = port;
QNetworkConfigurationManager manager;
@ -110,9 +110,9 @@ void Server::sessionOpened()
tcpServer = new QTcpServer(this);
if (!tcpServer->listen(QHostAddress::LocalHost, port)) {
port++;
if (!tcpServer->listen(QHostAddress::LocalHost, port)) {
if (!tcpServer->listen(QHostAddress::LocalHost, port_)) {
port_++;
if (!tcpServer->listen(QHostAddress::LocalHost, port_)) {
QMessageBox::critical(this, tr("Server"),
tr("Unable to start the server: %1.")
.arg(tcpServer->errorString()));
@ -162,10 +162,10 @@ void Server::sendAction()
out.setVersion(QDataStream::Qt_5_10);
if (!actions.empty()) {
action = actions.front();
action_ = actions.front();
}
out << action;
out << action_;
QTcpSocket *clientConnection = tcpServer->nextPendingConnection();

View File

@ -41,11 +41,11 @@ public:
void setAction(const QString &action);
void setPort(uint16_t port)
{
this->port = port;
this->port_ = port;
}
uint16_t getPort()
{
return port;
return port_;
}
private slots:
@ -56,9 +56,9 @@ private:
QLabel *statusLabel = nullptr;
QTcpServer *tcpServer = nullptr;
QNetworkSession *networkSession = nullptr;
uint16_t port;
uint16_t port_;
std::queue<QString> actions;
QString action;
QString action_;
};
#endif // SERVER_H