Fix some warnings

This commit is contained in:
heckflosse 2018-11-20 20:32:36 +01:00
parent aa286a32f9
commit a19f3484dd
2 changed files with 5 additions and 5 deletions

View File

@ -1136,19 +1136,19 @@ public:
void readData (FILE *f)
{
for (int i = 0; i < height; i++) {
if (fread(r(i), sizeof(T), width, f) < width) {
if (fread(r(i), sizeof(T), width, f) < static_cast<size_t>(width)) {
break;
}
}
for (int i = 0; i < height; i++) {
if (fread(g(i), sizeof(T), width, f) < width) {
if (fread(g(i), sizeof(T), width, f) < static_cast<size_t>(width)) {
break;
}
}
for (int i = 0; i < height; i++) {
if (fread(b(i), sizeof(T), width, f) < width) {
if (fread(b(i), sizeof(T), width, f) < static_cast<size_t>(width)) {
break;
}
}
@ -1718,7 +1718,7 @@ public:
void readData (FILE *f)
{
for (int i = 0; i < height; i++) {
if (fread(r(i), sizeof(T), 3 * width, f) < 3 * width) {
if (fread(r(i), sizeof(T), 3 * width, f) < 3 * static_cast<size_t>(width)) {
break;
}
}

View File

@ -2237,7 +2237,7 @@ bool Thumbnail::readAEHistogram (const Glib::ustring& fname)
} else {
aeHistogram(65536 >> aeHistCompression);
const size_t histoBytes = (65536 >> aeHistCompression) * sizeof(aeHistogram[0]);
const int bytesRead = fread(&aeHistogram[0], 1, histoBytes, f);
const size_t bytesRead = fread(&aeHistogram[0], 1, histoBytes, f);
fclose (f);
if (bytesRead != histoBytes) {
aeHistogram.reset();