From c728e983b71898a06685773128ab9f7b76f2ada8 Mon Sep 17 00:00:00 2001 From: Nicolas 'Pixel' Noble Date: Thu, 17 Jan 2013 09:12:32 -0800 Subject: Shutting off a few warnings. --- includes/Exceptions.h | 6 +++--- src/BStream.cc | 12 ++++++------ src/Exceptions.cc | 4 ++-- tests/test-Handles.cc | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/Exceptions.h b/includes/Exceptions.h index 103e394..962a869 100644 --- a/includes/Exceptions.h +++ b/includes/Exceptions.h @@ -62,7 +62,7 @@ static inline void * malloc(size_t size) { void * r = ::malloc(size); if (!r && size) - ExitHelper("Failed to allocate memory", "%li bytes", size); + ExitHelper("Failed to allocate memory", "%zu bytes", size); return r; } @@ -71,7 +71,7 @@ static inline void * calloc(size_t count, size_t size) { void * r = ::calloc(count, size); if (!r && ((count * size) != 0)) - ExitHelper("Failed to allocate memory", "%li * %li = %li bytes", count, size, count * size); + ExitHelper("Failed to allocate memory", "%zu * %zu = %zu bytes", count, size, count * size); return r; } @@ -80,7 +80,7 @@ static inline void * realloc(void * previous, size_t size) { void * r = ::realloc(previous, size); if (!r && size) - ExitHelper("Failed to re-allocate memory", "%li bytes", size); + ExitHelper("Failed to re-allocate memory", "%zu bytes", size); return r; } diff --git a/src/BStream.cc b/src/BStream.cc index 6c51c4f..16fd1d1 100644 --- a/src/BStream.cc +++ b/src/BStream.cc @@ -50,9 +50,9 @@ ssize_t Balau::BStream::read(void * _buf, size_t count) throw (Balau::GeneralExc return m_h->read(buf, count) + copied; m_cursor = 0; - IAssert(m_availBytes == 0, "At this point, our internal buffer should be empty, but it's not: %lu", m_availBytes); + IAssert(m_availBytes == 0, "At this point, our internal buffer should be empty, but it's not: %zu", m_availBytes); ssize_t r = m_h->read(m_buffer, s_blockSize); - EAssert(r >= 0, "BStream got an error while reading: %li", r); + EAssert(r >= 0, "BStream got an error while reading: %zu", r); m_availBytes = r; if (toCopy > m_availBytes) @@ -74,9 +74,9 @@ int Balau::BStream::peekNextByte() { ssize_t r = read(&b, 1); if (!r) return -1; - EAssert(r == 1, "We asked for one byte, yet we got %li", r); - IAssert(m_cursor > 0, "m_cursor is %li", m_cursor); - IAssert(m_availBytes < s_blockSize, "m_availBytes = %li; s_blockSize = %i", m_availBytes, s_blockSize); + EAssert(r == 1, "We asked for one byte, yet we got %zi", r); + IAssert(m_cursor > 0, "m_cursor is %zi", m_cursor); + IAssert(m_availBytes < s_blockSize, "m_availBytes = %zi; s_blockSize = %i", m_availBytes, s_blockSize); m_cursor--; m_availBytes++; } @@ -109,7 +109,7 @@ Balau::String Balau::BStream::readString(bool putNL) { if (isClosed() || isEOF()) return ret; peekNextByte(); - IAssert(m_cursor == 0, "m_cursor is %li", m_cursor); + IAssert(m_cursor == 0, "m_cursor is %zi", m_cursor); cr = (uint8_t *) memchr(m_buffer, '\r', m_availBytes); lf = (uint8_t *) memchr(m_buffer, '\n', m_availBytes); if (cr && lf) { diff --git a/src/Exceptions.cc b/src/Exceptions.cc index d7d360f..09d9d8e 100644 --- a/src/Exceptions.cc +++ b/src/Exceptions.cc @@ -52,7 +52,7 @@ void Balau::GeneralException::genTrace() { String line; for (int i = 0; i < n; i++) - line += String().set("%08lx ", (uintptr_t) trace[i]); + line += String().set("%08zx ", (uintptr_t) trace[i]); m_trace.push_back(line); Dl_info info; @@ -68,7 +68,7 @@ void Balau::GeneralException::genTrace() { } else { demangled = NULL; } - line.set("%i: %s(%s%c0x%lx) [0x%08lx]", i, info.dli_fname, info.dli_sname ? (demangled ? (status == 0 ? demangled : info.dli_sname) : info.dli_sname) : "??", dist < 0 ? '-' : '+', dist < 0 ? -dist : dist, (uintptr_t) trace[i]); + line.set("%i: %s(%s%c0x%lx) [0x%08zx]", i, info.dli_fname, info.dli_sname ? (demangled ? (status == 0 ? demangled : info.dli_sname) : info.dli_sname) : "??", dist < 0 ? '-' : '+', dist < 0 ? -dist : dist, (uintptr_t) trace[i]); m_trace.push_back(line); if (demangled) free(demangled); diff --git a/tests/test-Handles.cc b/tests/test-Handles.cc index 04c35fc..d64fe9b 100644 --- a/tests/test-Handles.cc +++ b/tests/test-Handles.cc @@ -50,7 +50,7 @@ void MainTask::Do() { i->rseek(0, SEEK_SET); char * buf1 = (char *) malloc(i->getSize()); ssize_t r = i->read(buf1, s + 15); - Printer::log(M_STATUS, "Read %li bytes (instead of %lli)", r, s + 15); + Printer::log(M_STATUS, "Read %zi bytes (instead of %lli)", r, s + 15); TAssert(i->isEOF()) char * buf2 = (char *) malloc(i->getSize()); -- cgit v1.2.3