From 68c87a44d0a82ae228aaac4c5850d34b06608724 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 8 Feb 2018 12:40:06 +0100 Subject: [PATCH] ResizeablePointer const fix --- lib/util.cpp | 4 ++-- lib/util.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/util.cpp b/lib/util.cpp index 9f03fa4a..57e71f9a 100644 --- a/lib/util.cpp +++ b/lib/util.cpp @@ -171,14 +171,14 @@ namespace Util{ maxSize = 0; } - bool ResizeablePointer::assign(void * p, uint32_t l){ + bool ResizeablePointer::assign(const void * p, uint32_t l){ if (!allocate(l)){return false;} memcpy(ptr, p, l); currSize = l; return true; } - bool ResizeablePointer::append(void * p, uint32_t l){ + bool ResizeablePointer::append(const void * p, uint32_t l){ if (!allocate(l+currSize)){return false;} memcpy(((char*)ptr)+currSize, p, l); currSize += l; diff --git a/lib/util.h b/lib/util.h index d721885f..212e5e28 100644 --- a/lib/util.h +++ b/lib/util.h @@ -21,8 +21,8 @@ namespace Util{ ResizeablePointer(); ~ResizeablePointer(); inline uint32_t& size(){return currSize;} - bool assign(void * p, uint32_t l); - bool append(void * p, uint32_t l); + bool assign(const void * p, uint32_t l); + bool append(const void * p, uint32_t l); bool allocate(uint32_t l); inline operator char*(){return (char*)ptr;} inline operator void*(){return ptr;}