From: Hamatoma Date: Mon, 2 Feb 2015 22:36:52 +0000 (+0100) Subject: warnings X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=e8cce372cb93d30b274b2b48756dff6ff997e01c;p=crepublib warnings --- diff --git a/.gitignore b/.gitignore index 028bb5e..a2d4278 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *.o -dirtool -alltest +dirtool/ .hg/ Debug/ .settings/ diff --git a/base/ReByteBuffer.cpp b/base/ReByteBuffer.cpp index c81b062..dde837e 100644 --- a/base/ReByteBuffer.cpp +++ b/base/ReByteBuffer.cpp @@ -213,7 +213,7 @@ ReByteBuffer& ReByteBuffer::appendHexDump(const char* data, size_t length, appendInt(offset, offsetFormat); int ix; for (ix = 0; ix < bytesPerLine; ix++){ - if (ix < length) + if (ix < (int) length) appendInt((unsigned) data[ix] % 0xff, "%02x"); else append(" "); @@ -230,7 +230,7 @@ ReByteBuffer& ReByteBuffer::appendHexDump(const char* data, size_t length, } char cc; for (ix = 0; ix < bytesPerLine; ix++){ - if (ix < length) + if (ix < (int) length) appendInt( (cc = data[ix]) < ' ' || cc > 127 ? '.' : cc, "%c"); else append(" "); @@ -239,7 +239,7 @@ ReByteBuffer& ReByteBuffer::appendHexDump(const char* data, size_t length, append(" ", 1); } append("\n", 1); - length = length <= bytesPerLine ? 0 : length - bytesPerLine; + length = length <= (int) bytesPerLine ? 0 : length - bytesPerLine; data += bytesPerLine; offset += bytesPerLine; } diff --git a/math/md5.cpp b/math/md5.cpp index 0c1b9dc..f90e5b3 100644 --- a/math/md5.cpp +++ b/math/md5.cpp @@ -32,6 +32,7 @@ documentation and/or software. /* interface header */ #include "math/md5.hpp" +#include "assert.h" /* system implementation headers */ #include @@ -349,6 +350,7 @@ std::string MD5::hexdigest() const std::ostream& operator<<(std::ostream& out, MD5 md5) { + assert(false); return out << md5.hexdigest(); } diff --git a/os/ReDirTools.cpp b/os/ReDirTools.cpp index 7b016a1..d628273 100644 --- a/os/ReDirTools.cpp +++ b/os/ReDirTools.cpp @@ -489,7 +489,7 @@ void ReDirOptions::optimizePathPattern(ReByteBuffer& buffer){ list.split(buffer.str() + 1, buffer.str()[0]); buffer.replaceAll(OS_SEPARATOR, 1, "/", 1); ReByteBuffer item; - for (int ix = 0; ix < list.count(); ix++){ + for (int ix = 0; ix < (int) list.count(); ix++){ item.set(list.strOf(ix), -1); if (item.endsWith("/*")) item.setLength(item.length() - 2); @@ -1207,7 +1207,7 @@ bool ReDirSync::copyFile(const char* source, ReFileProperties_t* properties, } #elif defined __WIN32__ BOOL dummy; - rc = CopyFileEx(source, target, NULL, NULL, &dummy, COPY_FILE_NO_BUFFERING) != 0; + rc = CopyFileExA(source, target, NULL, NULL, &dummy, COPY_FILE_NO_BUFFERING) != 0; int errNo = 0; if (! rc) errNo = GetLastError(); @@ -1278,7 +1278,7 @@ bool ReDirSync::makeDirectory(const char* directory, int minLength, // for all parents and the full path itself: while(ixSlash >= 0){ ixSlash = path.indexOf(OS_SEPARATOR_CHAR, ixSlash + 1); - if (ixSlash >= path.length() - 1) + if (ixSlash >= (int) path.length() - 1) break; // is the slash in front of the first node, e.g. 'e:\'? if (ixSlash == start + 1)