Skip to content

Commit

Permalink
Correct documentation comments for pedantic clang
Browse files Browse the repository at this point in the history
It appears clang 4.0 now checks documenation comments
  • Loading branch information
GregoryLundberg committed Jul 25, 2017
1 parent 3835303 commit e5d678b
Show file tree
Hide file tree
Showing 34 changed files with 48 additions and 62 deletions.
3 changes: 2 additions & 1 deletion src/actions/create.hpp
Expand Up @@ -141,14 +141,15 @@ const std::set<std::string> get_recruits(int side, const map_location &recruit_l
*/
std::vector<unit_const_ptr > get_recalls(int side, const map_location &recall_loc);

typedef std::tuple<bool /*event modified*/, int /*previous village owner side*/, bool /*capture bonus time*/> place_recruit_result;

/**
* Place a unit into the game.
* The unit will be placed on @a recruit_location, which should be retrieved
* through a call to recruit_location().
* @param facing the desired facing for the unit, map_location::NDIRECTIONS to determine facing automatically.
* @returns true if an event (or fog clearing) has mutated the game state.
*/
typedef std::tuple<bool /*event modified*/, int /*previous village owner side*/, bool /*capture bonus time*/> place_recruit_result;
place_recruit_result place_recruit(unit_ptr u, const map_location &recruit_location, const map_location& recruited_from,
int cost, bool is_recall, map_location::DIRECTION facing = map_location::NDIRECTIONS, bool show = false, bool fire_event = true, bool full_movement = false, bool wml_triggered = false);

Expand Down
2 changes: 1 addition & 1 deletion src/config_attribute_value.hpp
Expand Up @@ -188,7 +188,7 @@ class config_attribute_value
std::string str(const std::string& fallback = "") const;
t_string t_str() const;
/**
@param T a type created with MAKE_ENUM macro
@tparam T a type created with MAKE_ENUM macro
NOTE: since T::VALUE constants is not of type T but of the underlying enum type you must specify the template parameter explicitly
TODO: Fix this in c++11 using constexpr types.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/font/text.hpp
Expand Up @@ -270,9 +270,9 @@ class pango_text
/**
* The color to render links in.
*
* Links are formatted using pango <span> as follows:
* Links are formatted using pango &lt;span> as follows:
*
* "<span underline=\'single\' color=\'" + link_color_ + "\'>"
* &lt;span underline="single" color=" + link_color_ + ">
*/
color_t link_color_;

Expand Down
4 changes: 2 additions & 2 deletions src/font/text_formatting.hpp
Expand Up @@ -30,8 +30,8 @@ namespace font {
/**
* Retuns a Pango formatting string using the provided color_t object.
*
* The string returned will be in format: '<span foreground=#color>'
* Callers will need to manually append the closing</span>' tag.
* The string returned will be in format: &lt;span foreground=#color>
* Callers will need to manually append the closing &lt;/span>' tag.
*
* @param color The color_t object from which to retrieve the color.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/formula/variant_value.hpp
Expand Up @@ -172,15 +172,15 @@ class variant_value_base
* Implements the increment functionality of @ref variant_iterator
* for a value of this type.
*
* @param iter The opaque reference that was passed to the variant_iterator by @ref make_iterator.
* The parameter is an opaque reference that was passed to the variant_iterator by @ref make_iterator.
*/
virtual void iterator_inc(boost::any&) const {}

/**
* Implements the decrement functionality of @ref variant_iterator
* for a value of this type.
*
* @param iter The opaque reference that was passed to the variant_iterator by @ref make_iterator.
* The parameter is an opaque reference that was passed to the variant_iterator by @ref make_iterator.
*/
virtual void iterator_dec(boost::any&) const {}

Expand All @@ -190,8 +190,8 @@ class variant_value_base
*
* Note that this is only called if the two iterators are already known to be of the same type.
*
* @param first The opaque reference that was passed to the variant_iterator by @ref make_iterator.
* @param second The opaque reference that was passed to the variant_iterator by @ref make_iterator.
* The first parameter is an opaque reference that was passed to the variant_iterator by @ref make_iterator.
* The second parameter is an opaque reference that was passed to the variant_iterator by @ref make_iterator.
*/
virtual bool iterator_equals(const boost::any& /*first*/, const boost::any& /*second*/) const
{
Expand Down
2 changes: 1 addition & 1 deletion src/game_events/menu_item.hpp
Expand Up @@ -89,7 +89,7 @@ class wml_menu_item
* The undo stack will be cleared if the event mutated the gamestate.
*
* @param[in] event_hex The location of the event (where the menu was opened).
* @param[in] last_select The location of the most recent "select" event.
* @param[in] data The game data for the most recent "select" event.
*/
void fire_event(const map_location& event_hex, const game_data& data) const;

Expand Down
2 changes: 1 addition & 1 deletion src/game_events/wmi_manager.hpp
Expand Up @@ -63,7 +63,7 @@ class wmi_manager
/**
* Gets the menu item with the specified ID.
*
* @param Item id.
* @param id Item id.
* @returns Pointer to the relavent item, or nullptr if not found.
*/
item_ptr get_item(const std::string& id) const;
Expand Down
2 changes: 0 additions & 2 deletions src/game_initialization/connect_engine.hpp
Expand Up @@ -44,8 +44,6 @@ typedef std::pair<ng::controller, std::string> controller_option;
class connect_engine
{
public:
/// @param players the player which are already connected to the current game.
/// This is always empty unless we advance form a previous scenario.
connect_engine(saved_game& state,
const bool first_scenario, mp_campaign_info* campaign_info);

Expand Down
2 changes: 1 addition & 1 deletion src/game_initialization/depcheck.hpp
Expand Up @@ -139,7 +139,7 @@ class manager
/**
* Tells whether a certain mod is activated.
*
* @param string the string id of the mod
* @param id the string id of the mod
*
* @return true if activated, false is not
*/
Expand Down
2 changes: 1 addition & 1 deletion src/gui/core/event/dispatcher.hpp
Expand Up @@ -260,7 +260,7 @@ class dispatcher
* @param target The widget that should receive the event.
* Normally this is the window holding the
* widget.
* @param message The extra information needed for a window
* @param msg The extra information needed for a window
* (or another widget in the chain) to handle
* the message.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/gui/core/event/dispatcher_private.hpp
Expand Up @@ -288,7 +288,7 @@ namespace implementation
* @param event The event to test.
* @param dispatcher The final widget to test, this is also the
* dispatcher the sends the event.
* @param widget The widget should parent(s) to check.
* @param w The widget should parent(s) to check.
*
* @returns The list of widgets with a handler.
* The order will be (assuming all have a
Expand Down
2 changes: 0 additions & 2 deletions src/gui/dialogs/addon/connect.hpp
Expand Up @@ -36,8 +36,6 @@ class addon_connect : public modal_dialog
* the dialog returns @ref window::OK or 3
* undefined otherwise.
* @param allow_remove Sets @ref allow_remove_.
* @param disp The display object used for showing the
* in-game help when requested.
*/
addon_connect(std::string& host_name,
const bool allow_remove);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/campaign_difficulty.hpp
Expand Up @@ -34,7 +34,7 @@ class campaign_difficulty : public modal_dialog
{
public:
/**
* @param config of the campaign difficulty is being chosen for
* @param campaign The campaign the difficulty is being chosen for
*/
campaign_difficulty(const config& campaign);

Expand Down
2 changes: 0 additions & 2 deletions src/gui/dialogs/modal_dialog.hpp
Expand Up @@ -379,8 +379,6 @@ class modal_dialog
*
* At this point the registered fields are not yet registered.
*
* @param video The video which contains the surface to draw
* upon.
* @param window The window just created.
*/
virtual void post_build(window& window);
Expand Down
4 changes: 0 additions & 4 deletions src/gui/dialogs/modeless_dialog.hpp
Expand Up @@ -104,17 +104,13 @@ class modeless_dialog
/**
* Actions to be taken directly after the window is build.
*
* @param video The video which contains the surface to draw
* upon.
* @param window The window just created.
*/
virtual void post_build(window& window);

/**
* Actions to be taken before showing the window.
*
* @param video The video which contains the surface to draw
* upon.
* @param window The window to be shown.
*/
virtual void pre_show(window& window);
Expand Down
4 changes: 2 additions & 2 deletions src/gui/widgets/grid.hpp
Expand Up @@ -127,7 +127,7 @@ class grid : public widget
* touch the other settings of the child.
*
* @param id The id of the widget to free.
* @param widget The widget to put in the grid.
* @param w The widget to put in the grid.
* @param recurse Do we want to decent into the child grids.
* @param new_parent The new parent for the swapped out widget.
*
Expand Down Expand Up @@ -231,7 +231,7 @@ class grid : public widget
*
* @param widget The widget whose cell to modify.
* @param set_flag The alignment flag to set.
* @param mask Whether to affect horizontal or vertical alignment.
* @param mode_mask Whether to affect horizontal or vertical alignment.
* Use either HORIZONTAL_MASK or VERTICAL_MASK
*/
void set_child_alignment(widget* widget, unsigned set_flag, unsigned mode_mask);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/widgets/multimenu_button.hpp
Expand Up @@ -111,7 +111,7 @@ class multimenu_button : public styled_widget
/**
* Set the options selected in the menu.
*
* @param mask A mask specifying which options to select and deselect
* @param states A mask specifying which options to select and deselect
*/
void select_options(boost::dynamic_bitset<> states);

Expand Down
2 changes: 1 addition & 1 deletion src/gui/widgets/scrollbar_container.hpp
Expand Up @@ -318,7 +318,7 @@ class scrollbar_container : public container_base
* The position where the additional content was
* inserted/removed, defaults to -1 whcih means
* 'at end'
* @param height_modification_po
* @param height_modification_pos
* The position where the additional content was
* inserted/removed, defaults to -1 whcih means
* 'at end'
Expand Down
4 changes: 2 additions & 2 deletions src/gui/widgets/settings.hpp
Expand Up @@ -80,7 +80,7 @@ using widget_parser_t = std::function<styled_widget_definition_ptr(const config&
* regarding the static initialization problem.
*
* @param id The id of the widget to register.
* @param functor The function to parse the definition config.
* @param f The function to parse the definition config.
* @param key The tagname from which to read the widget's definition in the game config.
* If nullptr the default [<id>_definition] is used.
*/
Expand All @@ -89,7 +89,7 @@ void register_widget(const std::string& id, widget_parser_t f, const char* key =
/**
* Loads the definitions of a widget.
*
* @param gui_definition The gui definition the widget definition
* @param gui The gui definition the widget definition
* belongs to.
* @param definition_type The type of the widget whose definitions are
* to be loaded.
Expand Down
2 changes: 1 addition & 1 deletion src/gui/widgets/stacked_widget.hpp
Expand Up @@ -102,7 +102,7 @@ class stacked_widget : public container_base
* Gets the grid for a specified layer.
* This can be used to search for widgets in a hidden layer.
*
* @param The layer to retrieve
* @param i The layer to retrieve
* @returns The grid for the specified layer.
*/
grid* get_layer_grid(unsigned int i);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/widgets/tree_view_node.hpp
Expand Up @@ -298,7 +298,7 @@ class tree_view_node : public widget

point calculate_best_size(const int indentation_level,
const unsigned indentation_step_size) const;
/** @param assume_visible: if false (default) it will return 0 if the parent node is folded*/
/** @param assume_visible if false (default) it will return 0 if the parent node is folded*/
point get_current_size(bool assume_visible = false) const;
point get_folded_size() const;
point get_unfolded_size() const;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/widgets/window.hpp
Expand Up @@ -473,7 +473,7 @@ class window : public panel, public cursor::setter
*
* A window will only close if this function returns true.
*
* @param window The current window.
* @param func A function taking a window reference and returing a boolean result.
*/
void set_exit_hook(std::function<bool(window&)> func)
{
Expand Down
2 changes: 1 addition & 1 deletion src/hotkey/hotkey_item.hpp
Expand Up @@ -245,7 +245,7 @@ class hotkey_keyboard: public hotkey_base

/**
* Set the keycode associated with this class.
* @param keycode_ The SDL_Keycode that this hotkey should be associated with
* @param keycode The SDL_Keycode that this hotkey should be associated with
*/
void set_keycode(SDL_Keycode keycode)
{
Expand Down
6 changes: 3 additions & 3 deletions src/serialization/unicode.hpp
Expand Up @@ -87,9 +87,9 @@ namespace utf8 {
*
* The output is guaranteed to be valid UTF-8.
*
* @param[in] str String encoded in UTF-8.
* @param[out] str String encoded UTF-8 that contains at most @p size
* codepoints.
* @param[in,out] str [in] String encoded in UTF-8.
* [out] String encoded UTF-8 that contains at most @p size
* codepoints.
* @param size The size to truncate to.
*/
void truncate_as_ucs4(utf8::string& str, const size_t size);
Expand Down
2 changes: 1 addition & 1 deletion src/server/game.hpp
Expand Up @@ -282,7 +282,7 @@ class game
void transfer_ai_sides(const socket_ptr player);
void send_leave_game(socket_ptr user) const;
/**
@param sides: a comma sperated list of side numbers to which the package should be sent,
@param sides a comma sperated list of side numbers to which the package should be sent,
*/
void send_data_sides(simple_wml::document& data, const simple_wml::string_span& sides,
const socket_ptr exclude=socket_ptr(), std::string packet_type = "") const;
Expand Down
4 changes: 2 additions & 2 deletions src/synced_user_choice.hpp
Expand Up @@ -105,8 +105,8 @@ class user_choice_manager : events::pump_monitor
void ask_local_choice();
void fix_oos();
const std::string& wait_message() const { return wait_message_; }
/// @param name: the tagname for this user choice in the replay
/// @param sides: an array of team numbers (beginning with 1). the specified sides may not have an empty controller.
/// @param name the tagname for this user choice in the replay
/// @param sides an array of team numbers (beginning with 1). the specified sides may not have an empty controller.
static std::map<int, config> get_user_choice_internal(const std::string &name, const mp_sync::user_choice &uch, const std::set<int>& sides);
/// Inherited from events::pump_monitor
void process(events::pump_info&);
Expand Down
2 changes: 0 additions & 2 deletions src/terrain/filter.hpp
Expand Up @@ -47,7 +47,6 @@ class terrain_filter : public xy_pred {

/// @param loc The location to test
/// @param ref_unit A reference unit for the $teleport_unit auto-stored variable
/// @param unit_loc The reference unit's apparent location for this filter
/// @returns true if and only if the given location matches this filter
bool match(const map_location& loc, const unit& ref_unit) const {
return match_impl(loc, &ref_unit);
Expand All @@ -66,7 +65,6 @@ class terrain_filter : public xy_pred {
/// @param[out] locs set to store the results in
/// @param[in] with_border whether to include the borders
/// @param[in] ref_unit A reference unit for the $teleport_unit auto-stored variable
/// @param[in] unit_loc The reference unit's apparent location for this filter
void get_locations(std::set<map_location>& locs, const unit& ref_unit, bool with_border=false) const {
return get_locs_impl(locs, &ref_unit, with_border);
}
Expand Down
3 changes: 2 additions & 1 deletion src/terrain/translation.cpp
Expand Up @@ -61,6 +61,8 @@ namespace t_translation {
*/
static terrain_code get_mask_(const terrain_code& terrain);

static ter_layer string_to_layer_(const char* begin, const char* end);

/**
* Converts a string to a layer.
*
Expand All @@ -69,7 +71,6 @@ namespace t_translation {
*
* @return The converted layer.
*/
static ter_layer string_to_layer_(const char* begin, const char* end);
static ter_layer string_to_layer_(const std::string& str)
{
return string_to_layer_(str.c_str(), str.c_str() + str.size());
Expand Down
4 changes: 2 additions & 2 deletions src/terrain/translation.hpp
Expand Up @@ -247,7 +247,7 @@ namespace t_translation {
* [S ]T
* S = starting location a positive non-zero number
* T = terrain code (see read_terrain_code)
* @param starting_positions This parameter will be filled with the starting
* @param positions This parameter will be filled with the starting
* locations found. Starting locations can only occur once
* if multiple definitions occur of the same position only
* the last is stored. The returned value is a map:
Expand All @@ -263,7 +263,7 @@ namespace t_translation {
* Write a gamemap in to a vector string.
*
* @param map A terrain vector, as returned from read_game_map
* @param starting_positions A starting positions map, as returned from read_game_map
* @param positions A starting positions map, as returned from read_game_map
*
* @returns A terrain string which can be read with read_game_map.
* For readability the map is padded to groups of 12 chars,
Expand Down
8 changes: 4 additions & 4 deletions src/units/unit.hpp
Expand Up @@ -1274,17 +1274,17 @@ class unit

/**
* Count modifications of a particular type.
* @param The type of modification to count.
* Valid values are "advancement", "trait", "object"
* @param type The type of modification to count.
* Valid values are "advancement", "trait", "object"
* @param id The ID of the modification to count
* @return The total number of modifications of that type and ID.
*/
size_t modification_count(const std::string& type, const std::string& id) const;

/**
* Add a new modification to the unit.
* @param The type of modification to add.
* Valid values are "advancement", "trait", "object"
* @param type The type of modification to add.
* Valid values are "advancement", "trait", "object"
* @param modification The details of the modification
* @param no_add If true, apply the modification but don't save it for unit rebuild time.
* Defaults to false.
Expand Down
4 changes: 1 addition & 3 deletions src/utils/math.hpp
Expand Up @@ -108,9 +108,7 @@ inline std::size_t bit_width() {
*
* sizeof(x) * std::numeric_limits<unsigned char>::digits
*
* @tparam T The type of `x`.
*
* @param x The return value is the size, in bits, of this object.
* @tparam T The return value is the size, in bits, of the type of this object.
*
* @returns the size, in bits, of an instance of type `T`.
*/
Expand Down
3 changes: 1 addition & 2 deletions src/utils/name_generator_factory.hpp
Expand Up @@ -50,8 +50,7 @@ class name_generator_factory
* Determines a name generator from WML data. Tries first to load a context-free generator,
* then falls back to Markov.
* @param config the WML data to be parsed for name generators
* @param the prefix to look for
* @returns a name generator or nullptr if not found
* @param prefix the prefix to look for
*/
void add_name_generator_from_config(const config& config, const std::string id, const std::string prefix);
};

0 comments on commit e5d678b

Please sign in to comment.