summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/download.cpp42
-rw-r--r--src/net/ea/beingrecv.cpp2
-rw-r--r--src/net/ea/gamerecv.cpp2
-rw-r--r--src/net/ea/network.cpp6
-rw-r--r--src/net/ea/partyrecv.cpp2
-rw-r--r--src/net/eathena/beingrecv.cpp2
-rw-r--r--src/net/eathena/chatrecv.cpp2
-rw-r--r--src/net/eathena/inventoryrecv.cpp8
-rw-r--r--src/net/eathena/mailrecv.cpp2
-rw-r--r--src/net/messagein.cpp4
-rw-r--r--src/net/tmwa/beingrecv.cpp6
-rw-r--r--src/net/tmwa/chatrecv.cpp4
-rw-r--r--src/net/tmwa/inventoryrecv.cpp8
-rw-r--r--src/net/tmwa/loginrecv.cpp6
14 files changed, 48 insertions, 48 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp
index 05f10e027..92e205273 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -81,7 +81,7 @@ Download::Download(void *const ptr,
mOptions.cancel = 0;
mOptions.memoryWrite = 0;
- mOptions.checkAdler = 1u;
+ mOptions.checkAdler = 1U;
if (!mUpload)
{
const std::string serverName = settings.serverName;
@@ -170,7 +170,7 @@ void Download::setFile(const std::string &filename, const int64_t adler32)
if (adler32 > -1)
{
mAdler = static_cast<unsigned long>(adler32);
- mOptions.checkAdler = 1u;
+ mOptions.checkAdler = 1U;
}
else
{
@@ -180,7 +180,7 @@ void Download::setFile(const std::string &filename, const int64_t adler32)
void Download::setWriteFunction(WriteFunction write)
{
- mOptions.memoryWrite = 1u;
+ mOptions.memoryWrite = 1U;
mWriteFunction = write;
}
@@ -209,7 +209,7 @@ void Download::cancel()
{
logger->log("Canceling download: %s", mUrl.c_str());
- mOptions.cancel = 1u;
+ mOptions.cancel = 1U;
SDL::WaitThread(mThread);
mThread = nullptr;
}
@@ -230,7 +230,7 @@ int Download::downloadProgress(void *clientp, double dltotal, double dlnow,
if (d->mUpload)
return 0;
- if (d->mOptions.cancel != 0u)
+ if (d->mOptions.cancel != 0U)
{
return d->mUpdateFunction(d->mPtr, DownloadStatus::Cancelled,
CAST_SIZE(dltotal),
@@ -260,7 +260,7 @@ int Download::downloadThread(void *ptr)
}
else
{
- if (d->mOptions.memoryWrite == 0u)
+ if (d->mOptions.memoryWrite == 0U)
outFilename = d->mFileName + ".part";
else
outFilename.clear();
@@ -276,19 +276,19 @@ int Download::downloadThread(void *ptr)
logger->log_r("selected url: %s", d->mUrl.c_str());
while (attempts < 3 &&
!complete &&
- (d->mOptions.cancel == 0u) &&
+ (d->mOptions.cancel == 0U) &&
isTerminate == false)
{
d->mUpdateFunction(d->mPtr, DownloadStatus::Starting, 0, 0);
- if ((d->mOptions.cancel != 0u) || isTerminate == true)
+ if ((d->mOptions.cancel != 0U) || isTerminate == true)
{
return 0;
}
d->mCurl = curl_easy_init();
if (d->mCurl != nullptr &&
- d->mOptions.cancel == 0u &&
+ d->mOptions.cancel == 0U &&
isTerminate == false)
{
FILE *file = nullptr;
@@ -308,7 +308,7 @@ int Download::downloadThread(void *ptr)
curl_easy_setopt(d->mCurl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(d->mCurl, CURLOPT_HTTPHEADER,
d->mHeaders);
- if (d->mOptions.memoryWrite != 0u)
+ if (d->mOptions.memoryWrite != 0U)
{
curl_easy_setopt(d->mCurl, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(d->mCurl, CURLOPT_WRITEFUNCTION,
@@ -346,7 +346,7 @@ int Download::downloadThread(void *ptr)
addCommonFlags(d->mCurl);
if ((res = curl_easy_perform(d->mCurl)) != 0 &&
- (d->mOptions.cancel == 0u) &&
+ (d->mOptions.cancel == 0U) &&
isTerminate == false)
{
PRAGMA45(GCC diagnostic push)
@@ -354,7 +354,7 @@ int Download::downloadThread(void *ptr)
switch (res)
{
case CURLE_ABORTED_BY_CALLBACK:
- d->mOptions.cancel = 1u;
+ d->mOptions.cancel = 1U;
break;
case CURLE_COULDNT_CONNECT:
default:
@@ -362,7 +362,7 @@ int Download::downloadThread(void *ptr)
}
PRAGMA45(GCC diagnostic pop)
- if (res != 0u)
+ if (res != 0U)
{
if (d->mError != nullptr)
{
@@ -373,7 +373,7 @@ int Download::downloadThread(void *ptr)
continue;
}
- if ((d->mOptions.cancel != 0u) || isTerminate == true)
+ if ((d->mOptions.cancel != 0U) || isTerminate == true)
break;
// d->mUpdateFunction(d->mPtr, DownloadStatus::Error, 0, 0);
@@ -383,7 +383,7 @@ int Download::downloadThread(void *ptr)
fclose(file);
file = nullptr;
}
- if (!d->mUpload && (d->mOptions.memoryWrite == 0u))
+ if (!d->mUpload && (d->mOptions.memoryWrite == 0U))
::remove(outFilename.c_str());
attempts++;
continue;
@@ -404,10 +404,10 @@ int Download::downloadThread(void *ptr)
}
else
{
- if (d->mOptions.memoryWrite == 0u)
+ if (d->mOptions.memoryWrite == 0U)
{
// Don't check resources.xml checksum
- if (d->mOptions.checkAdler != 0u)
+ if (d->mOptions.checkAdler != 0U)
{
const unsigned long adler = fadler32(file);
@@ -438,7 +438,7 @@ int Download::downloadThread(void *ptr)
// Any existing file with this name is deleted first,
// otherwise the rename will fail on Windows.
- if ((d->mOptions.cancel == 0u) && isTerminate == false)
+ if ((d->mOptions.cancel == 0U) && isTerminate == false)
{
if (d->mIsXml)
{
@@ -478,18 +478,18 @@ int Download::downloadThread(void *ptr)
d->mCurl = nullptr;
}
- if ((d->mOptions.cancel != 0u) || isTerminate == true)
+ if ((d->mOptions.cancel != 0U) || isTerminate == true)
{
return 0;
}
attempts++;
}
- if ((complete && attempts < 3) || (d->mOptions.cancel != 0u))
+ if ((complete && attempts < 3) || (d->mOptions.cancel != 0U))
break;
}
- if ((d->mOptions.cancel != 0u) || isTerminate == true)
+ if ((d->mOptions.cancel != 0U) || isTerminate == true)
{
// Nothing to do...
}
diff --git a/src/net/ea/beingrecv.cpp b/src/net/ea/beingrecv.cpp
index b2909576d..e88fc1f02 100644
--- a/src/net/ea/beingrecv.cpp
+++ b/src/net/ea/beingrecv.cpp
@@ -261,7 +261,7 @@ void BeingRecv::processBeingEmotion(Net::MessageIn &msg)
}
const uint8_t emote = msg.readUInt8("emote");
- if ((emote != 0u) &&
+ if ((emote != 0U) &&
playerRelations.hasPermission(dstBeing, PlayerRelation::EMOTE))
{
dstBeing->setEmote(emote, 0);
diff --git a/src/net/ea/gamerecv.cpp b/src/net/ea/gamerecv.cpp
index 0d180dc45..ee5ccb9ce 100644
--- a/src/net/ea/gamerecv.cpp
+++ b/src/net/ea/gamerecv.cpp
@@ -54,7 +54,7 @@ void GameRecv::processWhoAnswer(Net::MessageIn &msg)
void GameRecv::processCharSwitchResponse(Net::MessageIn &msg)
{
- if (msg.readUInt8("response") != 0u)
+ if (msg.readUInt8("response") != 0U)
client->setState(State::SWITCH_CHARACTER);
}
diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp
index 618d4895f..11a0757f1 100644
--- a/src/net/ea/network.cpp
+++ b/src/net/ea/network.cpp
@@ -155,7 +155,7 @@ void Network::disconnect()
void Network::flush()
{
- if ((mOutSize == 0u) || mState != CONNECTED)
+ if ((mOutSize == 0U) || mState != CONNECTED)
return;
SDL_mutexP(mMutexOut);
@@ -181,7 +181,7 @@ void Network::skip(const int len)
{
SDL_mutexP(mMutexIn);
mToSkip += len;
- if (mInSize == 0u)
+ if (mInSize == 0U)
{
SDL_mutexV(mMutexIn);
return;
@@ -301,7 +301,7 @@ void Network::receive()
{
// DEBUGLOG("Receive " + toString(ret) + " bytes");
mInSize += ret;
- if (mToSkip != 0u)
+ if (mToSkip != 0U)
{
if (mInSize >= mToSkip)
{
diff --git a/src/net/ea/partyrecv.cpp b/src/net/ea/partyrecv.cpp
index 57ad76da0..248a44a96 100644
--- a/src/net/ea/partyrecv.cpp
+++ b/src/net/ea/partyrecv.cpp
@@ -54,7 +54,7 @@ namespace PartyRecv
void PartyRecv::processPartyCreate(Net::MessageIn &msg)
{
- if (msg.readUInt8("flag") != 0u)
+ if (msg.readUInt8("flag") != 0U)
NotifyManager::notify(NotifyTypes::PARTY_CREATE_FAILED);
else
NotifyManager::notify(NotifyTypes::PARTY_CREATED);
diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp
index a214dda39..f145bb17b 100644
--- a/src/net/eathena/beingrecv.cpp
+++ b/src/net/eathena/beingrecv.cpp
@@ -762,7 +762,7 @@ void BeingRecv::processBeingMove(Net::MessageIn &msg)
{
d = dstBeing->calcDirection(dstX, dstY);
}
- if ((d != 0u) && dstBeing->getDirection() != d)
+ if ((d != 0U) && dstBeing->getDirection() != d)
dstBeing->setDirection(d);
const int level = CAST_S32(msg.readInt16("level"));
diff --git a/src/net/eathena/chatrecv.cpp b/src/net/eathena/chatrecv.cpp
index 092fc0589..87fc6b63e 100644
--- a/src/net/eathena/chatrecv.cpp
+++ b/src/net/eathena/chatrecv.cpp
@@ -589,7 +589,7 @@ void ChatRecv::processBeingChat(Net::MessageIn &msg)
// because ignorePlayer' side effects are triggered
// right below for Being::IGNORE_SPEECH_FLOAT.
if ((playerRelations.checkPermissionSilently(sender_name,
- PlayerRelation::SPEECH_LOG) != 0u) && (chatWindow != nullptr))
+ PlayerRelation::SPEECH_LOG) != 0U) && (chatWindow != nullptr))
{
allow = chatWindow->resortChatLog(
removeColors(sender_name).append(" : ").append(chatMsg),
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp
index 7547d03c7..9d9707735 100644
--- a/src/net/eathena/inventoryrecv.cpp
+++ b/src/net/eathena/inventoryrecv.cpp
@@ -271,7 +271,7 @@ void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg)
Ea::InventoryRecv::mSentPickups.pop();
}
- if (err != 0u)
+ if (err != 0U)
{
PickupT pickup;
switch (err)
@@ -570,7 +570,7 @@ void InventoryRecv::processPlayerUnEquip(Net::MessageIn &msg)
equipType = msg.readInt16("wear location");
const uint8_t flag = msg.readUInt8("result");
- if (flag != 0u)
+ if (flag != 0U)
{
NotifyManager::notify(NotifyTypes::UNEQUIP_FAILED);
}
@@ -834,7 +834,7 @@ void InventoryRecv::processPlayerInsertCard(Net::MessageIn &msg)
{
const int itemIndex = msg.readInt16("item index") - INVENTORY_OFFSET;
const int cardIndex = msg.readInt16("card index") - INVENTORY_OFFSET;
- if (msg.readUInt8("flag") != 0u)
+ if (msg.readUInt8("flag") != 0U)
{
NotifyManager::notify(NotifyTypes::CARD_INSERT_FAILED);
}
@@ -1424,7 +1424,7 @@ int InventoryRecv::getSlot(const int eAthenaSlot)
unsigned int mask = 1;
int position = 0;
- while ((eAthenaSlot & mask) == 0u)
+ while ((eAthenaSlot & mask) == 0U)
{
mask <<= 1;
position++;
diff --git a/src/net/eathena/mailrecv.cpp b/src/net/eathena/mailrecv.cpp
index 434745386..94e6c6fb9 100644
--- a/src/net/eathena/mailrecv.cpp
+++ b/src/net/eathena/mailrecv.cpp
@@ -86,7 +86,7 @@ void MailRecv::processMailList(Net::MessageIn &msg)
MailMessage *const mail = new MailMessage;
mail->id = msg.readInt32("message id");
mail->title = msg.readString(40, "title");
- mail->read = msg.readUInt8("unread flag") != 0u ? true : false;
+ mail->read = msg.readUInt8("unread flag") != 0U ? true : false;
mail->sender = msg.readString(24, "sender name");
mail->time = msg.readInt32("time stamp");
mail->strTime = timeToStr(mail->time);
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index ff34cd2c5..1a82c8282 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -64,7 +64,7 @@ MessageIn::MessageIn(const char *const data,
MessageIn::~MessageIn()
{
- if (mLength != 0u)
+ if (mLength != 0U)
{
if (mPos != mLength && mPos != 2)
{
@@ -463,7 +463,7 @@ unsigned char *MessageIn::readBytes(int length, const char *const dstr)
str += " ";
for (int f = 0; f < length; f ++)
{
- if (buf[f] != 0u)
+ if (buf[f] != 0U)
str.append(strprintf("%c", buf[f]));
else
str.append("_");
diff --git a/src/net/tmwa/beingrecv.cpp b/src/net/tmwa/beingrecv.cpp
index f4b533891..69744946b 100644
--- a/src/net/tmwa/beingrecv.cpp
+++ b/src/net/tmwa/beingrecv.cpp
@@ -280,7 +280,7 @@ void BeingRecv::processPlayerUpdate1(Net::MessageIn &msg)
}
uint8_t dir = dstBeing->getDirectionDelayed();
- if (dir != 0u)
+ if (dir != 0U)
{
if (dir != dstBeing->getDirection())
dstBeing->setDirection(dir);
@@ -425,7 +425,7 @@ void BeingRecv::processPlayerUpdate2(Net::MessageIn &msg)
}
uint8_t dir = dstBeing->getDirectionDelayed();
- if (dir != 0u)
+ if (dir != 0U)
{
if (dir != dstBeing->getDirection())
dstBeing->setDirection(dir);
@@ -566,7 +566,7 @@ void BeingRecv::processPlayerMove(Net::MessageIn &msg)
}
const uint8_t dir = dstBeing->getDirectionDelayed();
- if (dir != 0u)
+ if (dir != 0U)
{
if (dir != dstBeing->getDirection())
dstBeing->setDirection(dir);
diff --git a/src/net/tmwa/chatrecv.cpp b/src/net/tmwa/chatrecv.cpp
index 83078bee9..e044d5877 100644
--- a/src/net/tmwa/chatrecv.cpp
+++ b/src/net/tmwa/chatrecv.cpp
@@ -77,7 +77,7 @@ void ChatRecv::processChatContinue(std::string chatMsg)
}
const std::string senseStr("You sense the following: ");
- if ((actorManager != nullptr) && (chatMsg.find(senseStr) == 0u))
+ if ((actorManager != nullptr) && (chatMsg.find(senseStr) == 0U))
{
actorManager->parseLevels(
chatMsg.substr(senseStr.size()));
@@ -372,7 +372,7 @@ void ChatRecv::processBeingChat(Net::MessageIn &msg)
// because ignorePlayer' side effects are triggered
// right below for Being::IGNORE_SPEECH_FLOAT.
if ((playerRelations.checkPermissionSilently(sender_name,
- PlayerRelation::SPEECH_LOG) != 0u) &&
+ PlayerRelation::SPEECH_LOG) != 0U) &&
(chatWindow != nullptr))
{
allow = chatWindow->resortChatLog(
diff --git a/src/net/tmwa/inventoryrecv.cpp b/src/net/tmwa/inventoryrecv.cpp
index 68521bfa4..2c0c51471 100644
--- a/src/net/tmwa/inventoryrecv.cpp
+++ b/src/net/tmwa/inventoryrecv.cpp
@@ -171,7 +171,7 @@ void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg)
Ea::InventoryRecv::mSentPickups.pop();
}
- if (err != 0u)
+ if (err != 0U)
{
PickupT pickup;
switch (err)
@@ -381,7 +381,7 @@ void InventoryRecv::processPlayerEquip(Net::MessageIn &msg)
const int equipType = msg.readInt16("equip type");
const uint8_t flag = msg.readUInt8("flag");
- if (flag == 0u)
+ if (flag == 0U)
{
NotifyManager::notify(NotifyTypes::EQUIP_FAILED);
}
@@ -401,7 +401,7 @@ void InventoryRecv::processPlayerUnEquip(Net::MessageIn &msg)
const int equipType = msg.readInt16("equip type");
const uint8_t flag = msg.readUInt8("flag");
- if (flag != 0u)
+ if (flag != 0U)
{
Ea::InventoryRecv::mEquips.setEquipment(
InventoryRecv::getSlot(equipType),
@@ -550,7 +550,7 @@ int InventoryRecv::getSlot(const int eAthenaSlot)
unsigned int mask = 1;
int position = 0;
- while ((eAthenaSlot & mask) == 0u)
+ while ((eAthenaSlot & mask) == 0U)
{
mask <<= 1;
position++;
diff --git a/src/net/tmwa/loginrecv.cpp b/src/net/tmwa/loginrecv.cpp
index 91d11b05e..43db7b99a 100644
--- a/src/net/tmwa/loginrecv.cpp
+++ b/src/net/tmwa/loginrecv.cpp
@@ -65,7 +65,7 @@ void LoginRecv::processServerVersion(Net::MessageIn &msg)
{ // old TMWA
const unsigned int options = msg.readInt32("options");
Ea::LoginRecv::mRegistrationEnabled =
- ((options & FLAG_REGISTRATION) != 0u);
+ ((options & FLAG_REGISTRATION) != 0U);
serverVersion = 0;
tmwServerVersion = 0;
}
@@ -73,7 +73,7 @@ void LoginRecv::processServerVersion(Net::MessageIn &msg)
{ // new TMWA
const unsigned int options = msg.readInt32("options");
Ea::LoginRecv::mRegistrationEnabled =
- ((options & FLAG_REGISTRATION) != 0u);
+ ((options & FLAG_REGISTRATION) != 0U);
serverVersion = 0;
tmwServerVersion = (b1 << 16) | (b2 << 8) | b3;
}
@@ -81,7 +81,7 @@ void LoginRecv::processServerVersion(Net::MessageIn &msg)
{ // eAthena
const unsigned int options = msg.readInt32("options");
Ea::LoginRecv::mRegistrationEnabled =
- ((options & FLAG_REGISTRATION) != 0u);
+ ((options & FLAG_REGISTRATION) != 0U);
serverVersion = 0;
tmwServerVersion = 0;
}