/*
-Minetest-c55
-Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
#include "../irrlichttypes.h"
#include "../debug.h" // For assert()
+#include <cstring>
template <typename T>
class SharedPtr
else
data = NULL;
refcount = new unsigned int;
+ memset(data,0,sizeof(T)*m_size);
(*refcount) = 1;
}
SharedBuffer(const SharedBuffer &buffer)
/*
Copies whole buffer
*/
- SharedBuffer(T *t, unsigned int size)
+ SharedBuffer(const T *t, unsigned int size)
{
m_size = size;
if(m_size != 0)
}
T & operator[](unsigned int i) const
{
- //assert(i < m_size)
+ assert(i < m_size);
return data[i];
}
T * operator*() const