From 93b9bfd3bde24a76bf7ef58b71f0d8757d3b38e5 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 7 Oct 2008 21:32:43 +0000 Subject: Fixed some compiler warnings. This probably also fixed the logging of several error messages. --- src/gui/updatewindow.cpp | 4 ++-- src/particleemitter.cpp | 5 ++--- src/resources/spritedef.cpp | 5 ++--- src/simpleanimation.cpp | 5 ++--- 4 files changed, 8 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 42b6e9bc..518abda2 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -58,9 +58,9 @@ unsigned long fadler32(FILE *file) // Calculate Adler-32 checksum char *buffer = (char*) malloc(fileSize); - fread(buffer, 1, fileSize, file); + const size_t read = fread(buffer, 1, fileSize, file); unsigned long adler = adler32(0L, Z_NULL, 0); - adler = adler32(adler, (Bytef*) buffer, fileSize); + adler = adler32(adler, (Bytef*) buffer, read); free(buffer); return adler; diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index 3e0a3d75..816a5d28 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -213,7 +213,7 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * if (!img) { - logger->log("No image at index " + (index)); + logger->log("No image at index %d", index); continue; } @@ -236,8 +236,7 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * if (!img) { - logger->log("No image at index " + - (start)); + logger->log("No image at index %d", start); continue; } diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index ebc60240..a6d8891e 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -232,7 +232,7 @@ SpriteDef::loadAnimation(xmlNodePtr animationNode, if (!img) { - logger->log("No image at index " + (index + variant_offset)); + logger->log("No image at index %d", index + variant_offset); continue; } @@ -255,8 +255,7 @@ SpriteDef::loadAnimation(xmlNodePtr animationNode, if (!img) { - logger->log("No image at index " + - (start + variant_offset)); + logger->log("No image at index %d", start + variant_offset); continue; } diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp index 18e732ef..f425d3c1 100644 --- a/src/simpleanimation.cpp +++ b/src/simpleanimation.cpp @@ -68,7 +68,7 @@ SimpleAnimation::SimpleAnimation(xmlNodePtr animationNode): if (!img) { - logger->log("No image at index " + (index)); + logger->log("No image at index %d", index); continue; } @@ -91,8 +91,7 @@ SimpleAnimation::SimpleAnimation(xmlNodePtr animationNode): if (!img) { - logger->log("No image at index " + - (start)); + logger->log("No image at index %d", start); continue; } -- cgit v1.2.3-60-g2f50