diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj index 857dd6b3df..7004a16fad 100644 --- a/projects/openttd_vs80.vcproj +++ b/projects/openttd_vs80.vcproj @@ -1451,6 +1451,10 @@ RelativePath=".\..\src\slope_type.h" > + + @@ -2403,10 +2407,6 @@ RelativePath=".\..\src\misc\hashtable.hpp" > - - diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj index 9ddc651620..2e6db1a30e 100644 --- a/projects/openttd_vs90.vcproj +++ b/projects/openttd_vs90.vcproj @@ -1448,6 +1448,10 @@ RelativePath=".\..\src\slope_type.h" > + + @@ -2400,10 +2404,6 @@ RelativePath=".\..\src\misc\hashtable.hpp" > - - diff --git a/source.list b/source.list index b82d400ccc..2135dfb1b3 100644 --- a/source.list +++ b/source.list @@ -288,6 +288,7 @@ signs_func.h signs_type.h slope_func.h slope_type.h +core/smallvec_type.hpp core/sort_func.hpp sortlist_type.h sound_func.h @@ -552,7 +553,6 @@ misc/dbg_helpers.cpp misc/dbg_helpers.h misc/fixedsizearray.hpp misc/hashtable.hpp -misc/smallvec.h misc/str.hpp misc/strapi.hpp diff --git a/src/misc/smallvec.h b/src/core/smallvec_type.hpp similarity index 90% rename from src/misc/smallvec.h rename to src/core/smallvec_type.hpp index 477a931785..ce41af9fdf 100644 --- a/src/misc/smallvec.h +++ b/src/core/smallvec_type.hpp @@ -1,12 +1,12 @@ /* $Id$ */ -/** @file smallvec.h Simple vector class that allows allocating an item without the need to copy this->data needlessly. */ +/** @file smallvec_type.hpp Simple vector class that allows allocating an item without the need to copy this->data needlessly. */ -#ifndef SMALLVEC_H -#define SMALLVEC_H +#ifndef SMALLVEC_TYPE_HPP +#define SMALLVEC_TYPE_HPP -#include "../core/alloc_func.hpp" -#include "../core/math_func.hpp" +#include "alloc_func.hpp" +#include "math_func.hpp" /** * Simple vector template class. @@ -19,11 +19,13 @@ * @param S The steps of allocation */ template -struct SmallVector { +class SmallVector { +protected: T *data; ///< The pointer to the first item uint items; ///< The number of items stored uint capacity; ///< The avalible space for storing items +public: SmallVector() : data(NULL), items(0), capacity(0) { } ~SmallVector() @@ -160,4 +162,4 @@ struct SmallVector { } }; -#endif /* SMALLVEC_H */ +#endif /* SMALLVEC_TYPE_HPP */ diff --git a/src/fios.h b/src/fios.h index 7e7e80975d..6a46987b37 100644 --- a/src/fios.h +++ b/src/fios.h @@ -6,7 +6,7 @@ #define FIOS_H #include "strings_type.h" -#include "misc/smallvec.h" +#include "core/smallvec_type.hpp" enum { /** diff --git a/src/sortlist_type.h b/src/sortlist_type.h index 371de1a9c7..9c0f6638ef 100644 --- a/src/sortlist_type.h +++ b/src/sortlist_type.h @@ -9,7 +9,7 @@ #include "core/bitmath_func.hpp" #include "core/mem_func.hpp" #include "core/sort_func.hpp" -#include "misc/smallvec.h" +#include "core/smallvec_type.hpp" #include "date_type.h" enum SortListFlags { diff --git a/src/vehiclelist.h b/src/vehiclelist.h index 93a643e5ae..a5ba00f8b1 100644 --- a/src/vehiclelist.h +++ b/src/vehiclelist.h @@ -5,7 +5,7 @@ #ifndef VEHICLELIST_H #define VEHICLELIST_H -#include "misc/smallvec.h" +#include "core/smallvec_type.hpp" typedef SmallVector VehicleList; diff --git a/src/viewport.cpp b/src/viewport.cpp index 7b0cfb107b..c63375155d 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -44,7 +44,7 @@ #include "settings_type.h" #include "station_func.h" #include "core/alloc_type.hpp" -#include "misc/smallvec.h" +#include "core/smallvec_type.hpp" #include "window_func.h" #include "tilehighlight_func.h" #include "window_gui.h"