From 77e9a8bb42285c118a8a0d51fa166d838cc9f473 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 20 Dec 2013 20:23:03 -0800 Subject: Switching off_t to off64_t. --- src/Buffer.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Buffer.cc') diff --git a/src/Buffer.cc b/src/Buffer.cc index 25639b7..42dbd52 100644 --- a/src/Buffer.cc +++ b/src/Buffer.cc @@ -19,10 +19,10 @@ void Balau::Buffer::close() throw (GeneralException) { } ssize_t Balau::Buffer::read(void * buf, size_t count) throw (GeneralException) { - off_t cursor = rtell(); + off64_t cursor = rtell(); if (cursor >= m_bufSize) return 0; - off_t avail = m_bufSize - cursor; + off64_t avail = m_bufSize - cursor; if (count > avail) count = avail; @@ -38,10 +38,10 @@ ssize_t Balau::Buffer::write(const void * buf, size_t count) throw (GeneralExcep if (m_fromConst) throw GeneralException("Buffer is read only and can't be written to."); - off_t cursor = wtell(); - off_t end = cursor + count; - off_t endBlock = (end / s_blockSize) + ((end % s_blockSize) ? 1 : 0); - off_t oldEndBlock = m_numBlocks; + off64_t cursor = wtell(); + off64_t end = cursor + count; + off64_t endBlock = (end / s_blockSize) + ((end % s_blockSize) ? 1 : 0); + off64_t oldEndBlock = m_numBlocks; if (endBlock > oldEndBlock) { m_buffer = (uint8_t *) realloc(m_buffer, endBlock * s_blockSize); @@ -71,6 +71,6 @@ void Balau::Buffer::reset() { bool Balau::Buffer::isClosed() { return false; } bool Balau::Buffer::isEOF() { return rtell() == m_bufSize; } const char * Balau::Buffer::getName() { return "Buffer"; } -off_t Balau::Buffer::getSize() { return m_bufSize; } +off64_t Balau::Buffer::getSize() { return m_bufSize; } bool Balau::Buffer::canRead() { return true; } bool Balau::Buffer::canWrite() { return !m_fromConst; } -- cgit v1.2.3