diff --git a/src/core/smallmap_type.hpp b/src/core/smallmap_type.hpp index debd4165e6..d7a9a38322 100644 --- a/src/core/smallmap_type.hpp +++ b/src/core/smallmap_type.hpp @@ -39,7 +39,7 @@ struct SmallPair { * * @see SmallVector */ -template +template struct SmallMap : std::vector > { typedef ::SmallPair Pair; typedef Pair *iterator; diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 19dab22286..e71edf89ff 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -77,9 +77,8 @@ T* grow(std::vector& vec, std::size_t num) * inside the list. * * @param T The type of the items stored, must be a pointer - * @param S The steps of allocation */ -template +template class AutoFreeSmallVector : public std::vector { public: ~AutoFreeSmallVector() @@ -108,9 +107,8 @@ public: * inside the list. * * @param T The type of the items stored, must be a pointer - * @param S The steps of allocation */ -template +template class AutoDeleteSmallVector : public std::vector { public: ~AutoDeleteSmallVector() @@ -131,6 +129,6 @@ public: } }; -typedef AutoFreeSmallVector StringList; ///< Type for a list of strings. +typedef AutoFreeSmallVector StringList; ///< Type for a list of strings. #endif /* SMALLVEC_TYPE_HPP */ diff --git a/src/game/game_text.hpp b/src/game/game_text.hpp index 14da7d9b2e..11c63b5abb 100644 --- a/src/game/game_text.hpp +++ b/src/game/game_text.hpp @@ -32,9 +32,9 @@ struct GameStrings { uint version; ///< The version of the language strings. LanguageStrings *cur_language; ///< The current (compiled) language. - AutoDeleteSmallVector raw_strings; ///< The raw strings per language, first must be English/the master language!. - AutoDeleteSmallVector compiled_strings; ///< The compiled strings per language, first must be English/the master language!. - StringList string_names; ///< The names of the compiled strings. + AutoDeleteSmallVector raw_strings; ///< The raw strings per language, first must be English/the master language!. + AutoDeleteSmallVector compiled_strings; ///< The compiled strings per language, first must be English/the master language!. + StringList string_names; ///< The names of the compiled strings. void Compile(); }; diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 6d4759cfbd..f09b87efa9 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -124,7 +124,7 @@ le_bool Font::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &poin /** * Wrapper for doing layouts with ICU. */ -class ICUParagraphLayout : public AutoDeleteSmallVector, public ParagraphLayouter { +class ICUParagraphLayout : public AutoDeleteSmallVector, public ParagraphLayouter { icu::ParagraphLayout *p; ///< The actual ICU paragraph layout. public: /** Visual run contains data about the bit of text with the same font. */ @@ -143,7 +143,7 @@ public: }; /** A single line worth of VisualRuns. */ - class ICULine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { + class ICULine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { icu::ParagraphLayout::Line *l; ///< The actual ICU line. public: @@ -269,7 +269,7 @@ public: }; /** A single line worth of VisualRuns. */ - class FallbackLine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { + class FallbackLine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { public: int GetLeading() const; int GetWidth() const; diff --git a/src/gfx_layout.h b/src/gfx_layout.h index 6f611d6e66..93cc6fb2da 100644 --- a/src/gfx_layout.h +++ b/src/gfx_layout.h @@ -150,7 +150,7 @@ public: * * It also accounts for the memory allocations and frees. */ -class Layouter : public AutoDeleteSmallVector { +class Layouter : public AutoDeleteSmallVector { const char *string; ///< Pointer to the original string. /** Key into the linecache */ diff --git a/src/music/midifile.hpp b/src/music/midifile.hpp index e0e5170b7f..4d362a1be2 100644 --- a/src/music/midifile.hpp +++ b/src/music/midifile.hpp @@ -22,8 +22,8 @@ struct MusicSongInfo; struct MidiFile { struct DataBlock { - uint32 ticktime; ///< tick number since start of file this block should be triggered at - uint32 realtime; ///< real-time (microseconds) since start of file this block should be triggered at + uint32 ticktime; ///< tick number since start of file this block should be triggered at + uint32 realtime; ///< real-time (microseconds) since start of file this block should be triggered at std::vector data; ///< raw midi data contained in block DataBlock(uint32 _ticktime = 0) : ticktime(_ticktime) { } }; diff --git a/src/network/core/address.h b/src/network/core/address.h index f6d7870bf6..2f26a3d00f 100644 --- a/src/network/core/address.h +++ b/src/network/core/address.h @@ -19,7 +19,7 @@ class NetworkAddress; typedef std::vector NetworkAddressList; ///< Type for a list of addresses. -typedef SmallMap SocketList; ///< Type for a mapping between address and socket. +typedef SmallMap SocketList; ///< Type for a mapping between address and socket. /** * Wrapper for (un)resolved network addresses; there's no reason to transform diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 12aa3fc0ad..7b658e8b5a 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -41,7 +41,7 @@ struct PacketReader : LoadFilter { static const size_t CHUNK = 32 * 1024; ///< 32 KiB chunks of memory. - AutoFreeSmallVector blocks; ///< Buffer with blocks of allocated memory. + AutoFreeSmallVector blocks; ///< Buffer with blocks of allocated memory. byte *buf; ///< Buffer we're going to write to/read from. byte *bufe; ///< End of the buffer we write to/read from. byte **block; ///< The block we're reading from/writing to. diff --git a/src/network/network_content.h b/src/network/network_content.h index e62c921e6a..29a25f2597 100644 --- a/src/network/network_content.h +++ b/src/network/network_content.h @@ -67,11 +67,11 @@ struct ContentCallback { class ClientNetworkContentSocketHandler : public NetworkContentSocketHandler, ContentCallback, HTTPCallback { protected: typedef std::vector ContentIDList; ///< List of content IDs to (possibly) select. - std::vector callbacks; ///< Callbacks to notify "the world" - ContentIDList requested; ///< ContentIDs we already requested (so we don't do it again) - ContentVector infos; ///< All content info we received - std::vector http_response; ///< The HTTP response to the requests we've been doing - int http_response_index; ///< Where we are, in the response, with handling it + std::vector callbacks; ///< Callbacks to notify "the world" + ContentIDList requested; ///< ContentIDs we already requested (so we don't do it again) + ContentVector infos; ///< All content info we received + std::vector http_response; ///< The HTTP response to the requests we've been doing + int http_response_index; ///< Where we are, in the response, with handling it FILE *curFile; ///< Currently downloaded file ContentInfo *curInfo; ///< Information about the currently downloaded file diff --git a/src/newgrf.h b/src/newgrf.h index d58fe870fe..e99b733476 100644 --- a/src/newgrf.h +++ b/src/newgrf.h @@ -122,10 +122,10 @@ struct GRFFile : ZeroedMemoryAllocator { GRFLabel *label; ///< Pointer to the first label. This is a linked list, not an array. - std::vector cargo_list; ///< Cargo translation table (local ID -> label) + std::vector cargo_list; ///< Cargo translation table (local ID -> label) uint8 cargo_map[NUM_CARGO]; ///< Inverse cargo translation table (CargoID -> local ID) - std::vector railtype_list; ///< Railtype translation table + std::vector railtype_list; ///< Railtype translation table RailTypeByte railtype_map[RAILTYPE_END]; CanalProperties canal_local_properties[CF_END]; ///< Canal properties as set by this NewGRF diff --git a/src/newgrf_config.h b/src/newgrf_config.h index 6396fa368c..88110f0ed5 100644 --- a/src/newgrf_config.h +++ b/src/newgrf_config.h @@ -133,7 +133,7 @@ struct GRFParameterInfo { byte param_nr; ///< GRF parameter to store content in byte first_bit; ///< First bit to use in the GRF parameter byte num_bit; ///< Number of bits to use for this parameter - SmallMap value_names; ///< Names for each value. + SmallMap value_names; ///< Names for each value. bool complete_labels; ///< True if all values have a label. uint32 GetValue(struct GRFConfig *config) const; @@ -155,27 +155,27 @@ struct GRFConfig : ZeroedMemoryAllocator { GRFConfig(const GRFConfig &config); ~GRFConfig(); - GRFIdentifier ident; ///< grfid and md5sum to uniquely identify newgrfs - uint8 original_md5sum[16]; ///< MD5 checksum of original file if only a 'compatible' file was loaded - char *filename; ///< Filename - either with or without full path - GRFTextWrapper *name; ///< NOSAVE: GRF name (Action 0x08) - GRFTextWrapper *info; ///< NOSAVE: GRF info (author, copyright, ...) (Action 0x08) - GRFTextWrapper *url; ///< NOSAVE: URL belonging to this GRF. - GRFError *error; ///< NOSAVE: Error/Warning during GRF loading (Action 0x0B) + GRFIdentifier ident; ///< grfid and md5sum to uniquely identify newgrfs + uint8 original_md5sum[16]; ///< MD5 checksum of original file if only a 'compatible' file was loaded + char *filename; ///< Filename - either with or without full path + GRFTextWrapper *name; ///< NOSAVE: GRF name (Action 0x08) + GRFTextWrapper *info; ///< NOSAVE: GRF info (author, copyright, ...) (Action 0x08) + GRFTextWrapper *url; ///< NOSAVE: URL belonging to this GRF. + GRFError *error; ///< NOSAVE: Error/Warning during GRF loading (Action 0x0B) - uint32 version; ///< NOSAVE: Version a NewGRF can set so only the newest NewGRF is shown - uint32 min_loadable_version; ///< NOSAVE: Minimum compatible version a NewGRF can define - uint8 flags; ///< NOSAVE: GCF_Flags, bitset - GRFStatus status; ///< NOSAVE: GRFStatus, enum - uint32 grf_bugs; ///< NOSAVE: bugs in this GRF in this run, @see enum GRFBugs - uint32 param[0x80]; ///< GRF parameters - uint8 num_params; ///< Number of used parameters - uint8 num_valid_params; ///< NOSAVE: Number of valid parameters (action 0x14) - uint8 palette; ///< GRFPalette, bitset + uint32 version; ///< NOSAVE: Version a NewGRF can set so only the newest NewGRF is shown + uint32 min_loadable_version; ///< NOSAVE: Minimum compatible version a NewGRF can define + uint8 flags; ///< NOSAVE: GCF_Flags, bitset + GRFStatus status; ///< NOSAVE: GRFStatus, enum + uint32 grf_bugs; ///< NOSAVE: bugs in this GRF in this run, @see enum GRFBugs + uint32 param[0x80]; ///< GRF parameters + uint8 num_params; ///< Number of used parameters + uint8 num_valid_params; ///< NOSAVE: Number of valid parameters (action 0x14) + uint8 palette; ///< GRFPalette, bitset std::vector param_info; ///< NOSAVE: extra information about the parameters - bool has_param_defaults; ///< NOSAVE: did this newgrf specify any defaults for it's parameters + bool has_param_defaults; ///< NOSAVE: did this newgrf specify any defaults for it's parameters - struct GRFConfig *next; ///< NOSAVE: Next item in the linked list + struct GRFConfig *next; ///< NOSAVE: Next item in the linked list void CopyParams(const GRFConfig &src); diff --git a/src/newgrf_debug.h b/src/newgrf_debug.h index b73c93266f..dac97726da 100644 --- a/src/newgrf_debug.h +++ b/src/newgrf_debug.h @@ -29,7 +29,7 @@ struct NewGrfDebugSpritePicker { NewGrfDebugSpritePickerMode mode; ///< Current state void *clicked_pixel; ///< Clicked pixel (pointer to blitter buffer) uint32 click_time; ///< Realtime tick when clicked to detect next frame - std::vector sprites; ///< Sprites found + std::vector sprites; ///< Sprites found }; extern NewGrfDebugSpritePicker _newgrf_debug_sprite_picker; diff --git a/src/newgrf_text.h b/src/newgrf_text.h index 601535d991..141e1536f1 100644 --- a/src/newgrf_text.h +++ b/src/newgrf_text.h @@ -59,7 +59,7 @@ struct LanguageMap { * both cases. Thus we are basically implementing a multi-map. */ std::vector gender_map; ///< Mapping of NewGRF and OpenTTD IDs for genders. std::vector case_map; ///< Mapping of NewGRF and OpenTTD IDs for cases. - int plural_form; ///< The plural form used for this language. + int plural_form; ///< The plural form used for this language. int GetMapping(int newgrf_id, bool gender) const; int GetReverseMapping(int openttd_id, bool gender) const; diff --git a/src/os/macosx/string_osx.cpp b/src/os/macosx/string_osx.cpp index 51cf50ea07..e14ca4183b 100644 --- a/src/os/macosx/string_osx.cpp +++ b/src/os/macosx/string_osx.cpp @@ -65,7 +65,7 @@ public: }; /** A single line worth of VisualRuns. */ - class CoreTextLine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { + class CoreTextLine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { public: CoreTextLine(CTLineRef line, const FontMap &fontMapping, const CoreTextParagraphLayoutFactory::CharType *buff) { diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp index a3fd35d0ad..5cba9a3d8b 100644 --- a/src/os/windows/string_uniscribe.cpp +++ b/src/os/windows/string_uniscribe.cpp @@ -106,7 +106,7 @@ public: }; /** A single line worth of VisualRuns. */ - class UniscribeLine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { + class UniscribeLine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { public: virtual int GetLeading() const; virtual int GetWidth() const; diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index ee4876fd5c..c97087224b 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -125,9 +125,9 @@ struct ReadBuffer { /** Container for dumping the savegame (quickly) to memory. */ struct MemoryDumper { - AutoFreeSmallVector blocks; ///< Buffer with blocks of allocated memory. - byte *buf; ///< Buffer we're going to write to. - byte *bufe; ///< End of the buffer we write to. + AutoFreeSmallVector blocks; ///< Buffer with blocks of allocated memory. + byte *buf; ///< Buffer we're going to write to. + byte *bufe; ///< End of the buffer we write to. /** Initialise our variables. */ MemoryDumper() : buf(NULL), bufe(NULL) diff --git a/src/settings_func.h b/src/settings_func.h index ee63e2bf4c..a16c31c207 100644 --- a/src/settings_func.h +++ b/src/settings_func.h @@ -30,7 +30,7 @@ void IniSaveWindowSettings(IniFile *ini, const char *grpname, void *desc); /* Functions to load and save NewGRF settings to a separate * configuration file, used for presets. */ -typedef AutoFreeSmallVector GRFPresetList; +typedef AutoFreeSmallVector GRFPresetList; void GetGRFPresetList(GRFPresetList *list); struct GRFConfig *LoadGRFPresetFromConfig(const char *config_name); diff --git a/src/stringfilter_type.h b/src/stringfilter_type.h index 0a4a464c7f..5ba8e876b6 100644 --- a/src/stringfilter_type.h +++ b/src/stringfilter_type.h @@ -39,7 +39,7 @@ private: }; const char *filter_buffer; ///< Parsed filter string. Words separated by 0. - std::vector word_index; ///< Word index and filter state. + std::vector word_index; ///< Word index and filter state. uint word_matches; ///< Summary of filter state: Number of words matched. const bool *case_sensitive; ///< Match case-sensitively (usually a static variable). diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 35ef97e940..be5af4acff 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -3457,7 +3457,7 @@ Town *ClosestTownFromTile(TileIndex tile, uint threshold) } static bool _town_rating_test = false; ///< If \c true, town rating is in test-mode. -static SmallMap _town_test_ratings; ///< Map of towns to modified ratings, while in town rating test-mode. +static SmallMap _town_test_ratings; ///< Map of towns to modified ratings, while in town rating test-mode. /** * Switch the town rating to test-mode, to allow commands to be tested without affecting current ratings. diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 9f15d9be05..856fc6737c 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -688,7 +688,7 @@ void ResetVehicleColourMap() * List of vehicles that should check for autoreplace this tick. * Mapping of vehicle -> leave depot immediately after autoreplace. */ -typedef SmallMap AutoreplaceMap; +typedef SmallMap AutoreplaceMap; static AutoreplaceMap _vehicles_to_autoreplace; void InitializeVehicles() diff --git a/src/widgets/dropdown_type.h b/src/widgets/dropdown_type.h index 56510b0abe..d8e9b90288 100644 --- a/src/widgets/dropdown_type.h +++ b/src/widgets/dropdown_type.h @@ -98,7 +98,7 @@ public: /** * A drop down list is a collection of drop down list items. */ -typedef AutoDeleteSmallVector DropDownList; +typedef AutoDeleteSmallVector DropDownList; void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int button, Rect wi_rect, Colours wi_colour, bool auto_width = false, bool instant_close = false);