mirror of https://github.com/aria2/aria2
Fix compile warning with Mingw64 x86 build
parent
318c804504
commit
1adef4db0c
|
@ -213,7 +213,7 @@ void BtPieceMessage::send()
|
||||||
|
|
||||||
void BtPieceMessage::pushPieceData(int64_t offset, int32_t length) const
|
void BtPieceMessage::pushPieceData(int64_t offset, int32_t length) const
|
||||||
{
|
{
|
||||||
assert(length <= 16_k);
|
assert(length <= static_cast<int32_t>(16_k));
|
||||||
auto buf = make_unique<unsigned char[]>(length+MESSAGE_HEADER_LENGTH);
|
auto buf = make_unique<unsigned char[]>(length+MESSAGE_HEADER_LENGTH);
|
||||||
createMessageHeader(buf.get());
|
createMessageHeader(buf.get());
|
||||||
ssize_t r;
|
ssize_t r;
|
||||||
|
|
|
@ -215,7 +215,7 @@ HandshakeExtensionMessage::create(const unsigned char* data, size_t length)
|
||||||
|
|
||||||
// Only accept metadata smaller than 1MiB. Be aware that broken
|
// Only accept metadata smaller than 1MiB. Be aware that broken
|
||||||
// client can send negative size!
|
// client can send negative size!
|
||||||
if(size > 0 && size <= 1_m) {
|
if(size > 0 && size <= static_cast<int64_t>(1_m)) {
|
||||||
msg->metadataSize_ = size;
|
msg->metadataSize_ = size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -792,9 +792,9 @@ void checkBegin(int32_t begin, int32_t pieceLength)
|
||||||
|
|
||||||
void checkLength(int32_t length)
|
void checkLength(int32_t length)
|
||||||
{
|
{
|
||||||
if(length > MAX_BLOCK_LENGTH) {
|
if(length > static_cast<int32_t>(MAX_BLOCK_LENGTH)) {
|
||||||
throw DL_ABORT_EX
|
throw DL_ABORT_EX(fmt("Length too long: %d > %dKB", length,
|
||||||
(fmt("Length too long: %d > %luKB", length, MAX_BLOCK_LENGTH/1024));
|
static_cast<int32_t>(MAX_BLOCK_LENGTH / 1024)));
|
||||||
}
|
}
|
||||||
if(length == 0) {
|
if(length == 0) {
|
||||||
throw DL_ABORT_EX(fmt("Invalid length: %d", length));
|
throw DL_ABORT_EX(fmt("Invalid length: %d", length));
|
||||||
|
|
|
@ -1405,7 +1405,8 @@ std::string abbrevSize(int64_t size)
|
||||||
int64_t t = size;
|
int64_t t = size;
|
||||||
size_t uidx = 0;
|
size_t uidx = 0;
|
||||||
int r = 0;
|
int r = 0;
|
||||||
while(t >= 1_k && uidx+1 < sizeof(UNITS)/sizeof(UNITS[0])) {
|
while(t >= static_cast<int64_t>(1_k) &&
|
||||||
|
uidx + 1 < sizeof(UNITS) / sizeof(UNITS[0])) {
|
||||||
lldiv_t d = lldiv(t, 1_k);
|
lldiv_t d = lldiv(t, 1_k);
|
||||||
t = d.quot;
|
t = d.quot;
|
||||||
r = d.rem;
|
r = d.rem;
|
||||||
|
|
Loading…
Reference in New Issue