summaryrefslogtreecommitdiff
path: root/src/util/areastore.h
diff options
context:
space:
mode:
authorVincent Glize <vincentglize@hotmail.fr>2017-06-19 23:54:58 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-06-19 23:54:58 +0200
commit4a5e8ad343079f6552fab639770e5771ed7c4e7a (patch)
treeeeab3adec1fc3e7a3b06d9f53b92ab99a5e0d290 /src/util/areastore.h
parent4a789490834157baa8788a2f36c95b86c1e4440e (diff)
downloadminetest-4a5e8ad343079f6552fab639770e5771ed7c4e7a.tar.gz
minetest-4a5e8ad343079f6552fab639770e5771ed7c4e7a.tar.bz2
minetest-4a5e8ad343079f6552fab639770e5771ed7c4e7a.zip
C++11 cleanup on constructors (#6000)
* C++11 cleanup on constructors dir script
Diffstat (limited to 'src/util/areastore.h')
-rw-r--r--src/util/areastore.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/util/areastore.h b/src/util/areastore.h
index bebecfd78..8c22c3ad7 100644
--- a/src/util/areastore.h
+++ b/src/util/areastore.h
@@ -38,14 +38,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
struct Area {
- Area() : id(U32_MAX) {}
+ Area() {}
Area(const v3s16 &mine, const v3s16 &maxe) :
- id(U32_MAX), minedge(mine), maxedge(maxe)
+ minedge(mine), maxedge(maxe)
{
sortBoxVerticies(minedge, maxedge);
}
- u32 id;
+ u32 id = U32_MAX;
v3s16 minedge, maxedge;
std::string data;
};
@@ -54,10 +54,7 @@ struct Area {
class AreaStore {
public:
AreaStore() :
- m_cache_enabled(true),
- m_cacheblock_radius(64),
- m_res_cache(1000, &cacheMiss, this),
- m_next_id(0)
+ m_res_cache(1000, &cacheMiss, this)
{}
virtual ~AreaStore() {}
@@ -123,13 +120,13 @@ private:
/// Called by the cache when a value isn't found in the cache.
static void cacheMiss(void *data, const v3s16 &mpos, std::vector<Area *> *dest);
- bool m_cache_enabled;
+ bool m_cache_enabled = true;
/// Range, in nodes, of the getAreasForPos cache.
/// If you modify this, call invalidateCache()
- u8 m_cacheblock_radius;
+ u8 m_cacheblock_radius = 64;
LRUCache<v3s16, std::vector<Area *> > m_res_cache;
- u32 m_next_id;
+ u32 m_next_id = 0;
};
@@ -165,8 +162,8 @@ protected:
virtual void getAreasForPosImpl(std::vector<Area *> *result, v3s16 pos);
private:
- SpatialIndex::ISpatialIndex *m_tree;
- SpatialIndex::IStorageManager *m_storagemanager;
+ SpatialIndex::ISpatialIndex *m_tree = nullptr;
+ SpatialIndex::IStorageManager *m_storagemanager = nullptr;
class VectorResultVisitor : public SpatialIndex::IVisitor {
public:
@@ -194,8 +191,8 @@ private:
}
private:
- SpatialAreaStore *m_store;
- std::vector<Area *> *m_result;
+ SpatialAreaStore *m_store = nullptr;
+ std::vector<Area *> *m_result = nullptr;
};
};