Commit ce871144 authored by Toni Asensi Esteve's avatar Toni Asensi Esteve

Avoid 'conversion may change value' cases in krarc.cpp and related files

Revision: !26
parent 1057f224
......@@ -577,7 +577,7 @@ void kio_krarcProtocol::get(const QUrl &url, int tries)
char buffer[ MAX_IPC_SIZE ];
while (1) {
int n = ::read(fd, buffer, MAX_IPC_SIZE);
int n = int(::read(fd, buffer, MAX_IPC_SIZE));
if (n == -1) {
if (errno == EINTR)
continue;
......@@ -1327,7 +1327,7 @@ void kio_krarcProtocol::parseLine(int lineNo, QString line)
// next field is md5sum, ignore it
nextWord(line);
// permissions
mode = nextWord(line).toULong(nullptr, 8);
mode = nextWord(line).toUInt(nullptr, 8);
// Owner & Group
owner = nextWord(line);
group = nextWord(line);
......@@ -1863,7 +1863,7 @@ QString kio_krarcProtocol::localeEncodedString(QString str)
const char *data = array.data();
for (int i = 0; i != size; i++) {
unsigned short ch = (((int)data[ i ]) & 0xFF) + 0xE000; // user defined character
unsigned int ch = (((int)data[ i ]) & 0xFF) + 0xE000; // user defined character
result.append(QChar(ch));
}
return result;
......
......@@ -213,7 +213,7 @@ QString KrArcBaseManager::detectArchive(bool &encrypted, const QString& fileName
checksum -= ((unsigned char *)buffer)[ i ];
sprintf(chksum, "0%o", checksum);
if (!memcmp(buffer + 148, chksum, strlen(chksum))) {
int k = strlen(chksum);
auto k = strlen(chksum);
for (; k < 8; k++)
if (buffer[148+k] != 0 && buffer[148+k] != 32)
break;
......
......@@ -261,7 +261,7 @@ public:
qApp->processEvents();
}
void subJobStarted(const QString & jobTitle, int count) override {
void subJobStarted(const QString & jobTitle, long count) override {
_jobThread->sendReset(jobTitle);
_jobThread->sendMaxProgressValue(count);
}
......
......@@ -42,7 +42,7 @@ public:
~KrArcObserver() override = default;
virtual void processEvents() = 0;
virtual void subJobStarted(const QString & jobTitle, int count) = 0;
virtual void subJobStarted(const QString & jobTitle, long count) = 0;
virtual void subJobStopped() = 0;
virtual bool wasCancelled() = 0;
virtual void error(const QString & error) = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment