Skip to content

Commit

Permalink
Normalized TODO/HACK/FIXME comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhilkinSerg committed Jan 5, 2020
1 parent f1490fc commit 1cabb58
Show file tree
Hide file tree
Showing 26 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/auto_pickup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ void rule_list::create_rule( cache &map_items, const std::string &to_match )

void player_settings::create_rule( const item *it )
{
// @todo change it to be a reference
// @TODO: change it to be a reference
global_rules.create_rule( map_items, *it );
character_rules.create_rule( map_items, *it );
}
Expand Down
2 changes: 1 addition & 1 deletion src/calendar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ time_point night_time( const time_point &p )

time_point daylight_time( const time_point &p )
{
// @TODO Actual dailight should start 18 degrees before sunrise
// @TODO: Actual dailight should start 18 degrees before sunrise
return sunrise( p ) + 15_minutes;
}

Expand Down
2 changes: 1 addition & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3829,7 +3829,7 @@ void Character::update_bodytemp()
// Morale bonus for comfiness - only if actually comfy (not too warm/cold)
// Spread the morale bonus in time.
if( comfortable_warmth > 0 &&
// @todo make this simpler and use time_duration/time_point
// @TODO: make this simpler and use time_duration/time_point
to_turn<int>( calendar::turn ) % to_turns<int>( 1_minutes ) == to_turns<int>
( 1_minutes * bp ) / to_turns<int>( 1_minutes * num_bp ) &&
get_effect_int( effect_cold, num_bp ) == 0 &&
Expand Down
2 changes: 1 addition & 1 deletion src/clzones.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ void zone_manager::cache_vzones()
const std::string &type_hash = elem->get_type_hash();
auto &cache = area_cache[type_hash];

// @todo looks very similar to the above cache_data - maybe merge it?
// @TODO: looks very similar to the above cache_data - maybe merge it?

// Draw marked area
for( const tripoint &p : tripoint_range( elem->get_start_point(), elem->get_end_point() ) ) {
Expand Down
6 changes: 3 additions & 3 deletions src/flat_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ class flat_set : private Compare, Data
}

iterator insert( iterator, const value_type &value ) {
/// @todo Use insertion hint
/// @TODO: Use insertion hint
return insert( value ).first;
}
iterator insert( iterator, value_type &&value ) {
/// @todo Use insertion hint
/// @TODO: Use insertion hint
return insert( std::move( value ) ).first;
}
std::pair<iterator, bool> insert( const value_type &value ) {
Expand All @@ -171,7 +171,7 @@ class flat_set : private Compare, Data

template<typename InputIt>
void insert( InputIt first, InputIt last ) {
/// @todo could be faster when inserting only a few elements
/// @TODO: could be faster when inserting only a few elements
Data::insert( end(), first, last );
sort_data();
}
Expand Down
6 changes: 3 additions & 3 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3975,7 +3975,7 @@ void game::mon_info_update( )
new_seen_mon.clear();

static int previous_turn = 0;
// @todo change current_turn to time_point
// @TODO: change current_turn to time_point
const int current_turn = to_turns<int>( calendar::turn - calendar::turn_zero );
const int sm_ignored_turns = get_option<int>( "SAFEMODEIGNORETURNS" );

Expand Down Expand Up @@ -4722,7 +4722,7 @@ monster *game::place_critter_at( const shared_ptr_fast<monster> mon, const tripo

monster *game::place_critter_around( const mtype_id &id, const tripoint &center, const int radius )
{
// @todo change this into an assert, it must never happen.
// @TODO: change this into an assert, it must never happen.
if( id.is_null() ) {
return nullptr;
}
Expand Down Expand Up @@ -4753,7 +4753,7 @@ monster *game::place_critter_around( const shared_ptr_fast<monster> mon,

monster *game::place_critter_within( const mtype_id &id, const tripoint_range &range )
{
// @todo change this into an assert, it must never happen.
// @TODO: change this into an assert, it must never happen.
if( id.is_null() ) {
return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion src/itype.h
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ struct itype {
bool stackable_ = false;

/** Minimum and maximum amount of damage to an item (state of maximum repair). */
// @todo create and use a MinMax class or similar to put both values into one object.
// @TODO: create and use a MinMax class or similar to put both values into one object.
/// @{
int damage_min_ = -1000;
int damage_max_ = +4000;
Expand Down
4 changes: 2 additions & 2 deletions src/iuse_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4648,8 +4648,8 @@ int sew_advanced_actor::use( player &p, item &it, bool, const tripoint & ) const
bool enab = false;
std::string prompt;
if( mod.item_tags.count( obj.flag ) == 0 ) {
// @TODO Fix for UTF-8 strings
// @TODO find other places where this is used and make a global function for all
// @TODO: Fix for UTF-8 strings
// @TODO: find other places where this is used and make a global function for all
static const auto tolower = []( std::string t ) {
if( !t.empty() ) {
t.front() = std::tolower( t.front() );
Expand Down
2 changes: 1 addition & 1 deletion src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ std::string spell::enumerate_targets() const
return all_valid_targets[0];
}
std::string ret;
// @todo if only we had a function to enumerate strings and concatenate them...
// @TODO: if only we had a function to enumerate strings and concatenate them...
for( auto iter = all_valid_targets.begin(); iter != all_valid_targets.end(); iter++ ) {
if( iter + 1 == all_valid_targets.end() ) {
ret = string_format( _( "%s and %s" ), ret, *iter );
Expand Down
4 changes: 2 additions & 2 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7093,7 +7093,7 @@ void map::spawn_monsters_submap_group( const tripoint &gp, mongroup &group, bool
}

static const auto allow_on_terrain = [&]( const tripoint & p ) {
// @todo flying creatures should be allowed to spawn without a floor,
// @TODO: flying creatures should be allowed to spawn without a floor,
// but the new creature is created *after* determining the terrain, so
// we can't check for it here.
return passable( p ) && has_floor( p );
Expand Down Expand Up @@ -8125,7 +8125,7 @@ tripoint_range map::points_in_radius( const tripoint &center, size_t radius, siz
tripoint_range map::points_on_zlevel( const int z ) const
{
if( z < -OVERMAP_DEPTH || z > OVERMAP_HEIGHT ) {
// @todo need a default constructor that creates an empty range.
// @TODO: need a default constructor that creates an empty range.
return tripoint_range( tripoint_zero, tripoint_zero - tripoint_above );
}
return tripoint_range( tripoint( 0, 0, z ), tripoint( SEEX * my_MAPSIZE - 1, SEEY * my_MAPSIZE - 1,
Expand Down
2 changes: 1 addition & 1 deletion src/map_extras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ static void mx_portal( map &m, const tripoint &abs_sub )
// Get a random location from our points that is not the portal location, does not have the
// NO_FLOOR flag, and isn't currently occupied by a creature.
const cata::optional<tripoint> mon_pos = random_point( points, [&]( const tripoint & p ) {
/// @todo wrong: this checks for creatures on the main game map. Not within the map m.
/// @TODO: wrong: this checks for creatures on the main game map. Not within the map m.
return !m.has_flag_ter( TFLAG_NO_FLOOR, p ) && *portal_pos != p && !g->critter_at( p );
} );

Expand Down
6 changes: 3 additions & 3 deletions src/mapgendata.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ enum class type : int;
* An instance of this class is passed through most of the mapgen code.
* If any of these functions need more information, add them here.
*/
// @todo documentation
// @todo encapsulate data member
// @TODO: documentation
// @TODO: encapsulate data member
class mapgendata
{
private:
Expand Down Expand Up @@ -94,7 +94,7 @@ class mapgendata
return mission_;
}
int zlevel() const {
// @todo should be able to determine this from the map itself
// @TODO: should be able to determine this from the map itself
return zlevel_;
}

Expand Down
2 changes: 1 addition & 1 deletion src/mapsharing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void ofstream_wrapper::open( const std::ios::openmode mode )
temp_path = path + "." + std::to_string( GetCurrentProcessId() ) + ".temp";

#else
// @todo exclusive I/O for other systems
// @TODO: exclusive I/O for other systems
temp_path = path + ".temp";

#endif
Expand Down
2 changes: 1 addition & 1 deletion src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void monster::try_upgrade( bool pin_time )
upgrade_time += current_day;
} else {
// offset by starting season
// @todo revisit this and make it simpler
// @TODO: revisit this and make it simpler
upgrade_time += to_days<int>( calendar::start_of_cataclysm - calendar::turn_zero );
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1166,8 +1166,8 @@ bool npc::wield( item &it )
assert( !maybe_holster.contents.empty() );
const size_t old_size = maybe_holster.contents.size();
invoke_item( &maybe_holster );
// @TODO change invoke_item to somehow report this change
// Hacky: test whether wielding the item from the holster has been done.
// @TODO: change invoke_item to somehow report this change
// @HACK: test whether wielding the item from the holster has been done.
// (Wielding may be prevented by various reasons: see player::wield_contained)
if( old_size != maybe_holster.contents.size() ) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/npcmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ tripoint npc::good_escape_direction( bool include_pos )
float rating = threat_val;
for( const auto &e : g->m.field_at( pt ) ) {
if( is_dangerous_field( e.second ) ) {
// @todo: Rate fire higher than smoke
// @TODO: Rate fire higher than smoke
rating += e.second.get_field_intensity();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/npctalk_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void spawn_animal( npc &p, const mtype_id &mon )
mon_ptr->friendly = -1;
mon_ptr->add_effect( effect_pet, 1_turns, num_bp, true );
} else {
// @todo handle this gracefully (return the money, proper in-character message from npc)
// @TODO: handle this gracefully (return the money, proper in-character message from npc)
add_msg( m_debug, "No space to spawn purchased pet" );
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/overmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ void overmap::init_layers()
void overmap::ter_set( const tripoint &p, const oter_id &id )
{
if( !inbounds( p ) ) {
/// @todo Add a debug message reporting this, but currently there are way too many place that would trigger it.
/// @TODO: Add a debug message reporting this, but currently there are way too many place that would trigger it.
return;
}

Expand All @@ -1156,7 +1156,7 @@ void overmap::ter_set( const tripoint &p, const oter_id &id )
const oter_id &overmap::ter( const tripoint &p ) const
{
if( !inbounds( p ) ) {
/// @todo Add a debug message reporting this, but currently there are way too many place that would trigger it.
/// @TODO: Add a debug message reporting this, but currently there are way too many place that would trigger it.
return ot_null;
}

Expand Down Expand Up @@ -3568,7 +3568,7 @@ void overmap::chip_rock( const tripoint &p )
bool overmap::check_ot( const std::string &otype, ot_match_type match_type,
const tripoint &p ) const
{
/// @todo this check should be done by the caller. Probably.
/// @TODO: this check should be done by the caller. Probably.
if( !inbounds( p ) ) {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2206,7 +2206,7 @@ void player::update_body( const time_point &from, const time_point &to )
update_needs( five_mins );
regen( five_mins );
// Note: mend ticks once per 5 minutes, but wants rate in TURNS, not 5 minute intervals
//@todo change @ref med to take time_duration
//@TODO: change @ref med to take time_duration
mend( five_mins * to_turns<int>( 5_minutes ) );
}
if( ticks_between( from, to, 24_hours ) > 0 ) {
Expand Down Expand Up @@ -6909,7 +6909,7 @@ void player::place_corpse( const tripoint &om_target )
// Q: Why check for furniture? (Check for passable or can-place-items seems more useful.)
// Q: Why not grep a random point out of all the possible points (e.g. via random_entry)?
// Q: Why use furn_str_id instead of f_null?
// @todo fix it, see above.
// @TODO: fix it, see above.
if( bay.furn( point( finX, finY ) ) != furn_str_id( "f_null" ) ) {
for( const tripoint &p : bay.points_on_zlevel() ) {
if( bay.furn( p ) == furn_str_id( "f_null" ) ) {
Expand Down
2 changes: 1 addition & 1 deletion src/ranged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ std::vector<tripoint> target_handler::target_ui( player &pc, target_mode mode,
aim_mode = aim_types.begin();
}

// @TODO this assumes that relevant == null means firing turrets, but that may not
// @TODO: this assumes that relevant == null means firing turrets, but that may not
// always be the case. Consider passing a name into this function.
int num_instruction_lines = draw_targeting_window( w_target,
relevant ? relevant->tname() : _( "turrets" ), mode, ctxt, aim_types, tiny );
Expand Down
2 changes: 1 addition & 1 deletion src/savegame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,7 @@ void Creature_tracker::deserialize( JsonIn &jsin )
monsters_by_location.clear();
jsin.start_array();
while( !jsin.end_array() ) {
// @todo would be nice if monster had a constructor using JsonIn or similar, so this could be one statement.
// @TODO: would be nice if monster had a constructor using JsonIn or similar, so this could be one statement.
shared_ptr_fast<monster> mptr = make_shared_fast<monster>();
jsin.read( *mptr );
add( mptr );
Expand Down
2 changes: 1 addition & 1 deletion src/text_snippets.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class snippet_library
* The tags in the snippet are not automatically expanded - you need to
* call `expand()` to do that.
*
* @todo: make the result stay the same through different game sessions
* @TODO: make the result stay the same through different game sessions
*/
cata::optional<translation> random_from_category( const std::string &cat, unsigned int seed ) const;
/**
Expand Down
4 changes: 2 additions & 2 deletions src/translations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,8 @@ void translation::deserialize( JsonIn &jsin )
try {
const std::string str_before = utf32_to_utf8( std::u32string( beg, to ) );
// +1 for the starting quotation mark
//@todo: properly handle escape sequences inside strings, instead
//of using `length()` here.
// @TODO: properly handle escape sequences inside strings, instead
// of using `length()` here.
throw_error( err, 1 + str_before.length() );
} catch( const JsonError &e ) {
debugmsg( "\n%s", e.what() );
Expand Down
10 changes: 5 additions & 5 deletions src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class DefaultRemovePartHandler : public RemovePartHandler
}
}
}
// @todo maybe do this for all the nearby NPCs as well?
// @TODO: maybe do this for all the nearby NPCs as well?

if( g->u.get_grab_type() == OBJECT_VEHICLE && g->u.grab_point == veh.global_part_pos3( part ) ) {
if( veh.parts_at_relative( veh.parts[part].mount, false ).empty() ) {
Expand Down Expand Up @@ -174,15 +174,15 @@ class MapgenRemovePartHandler : public RemovePartHandler
// Ignored for now. We don't initialize the transparency cache in mapgen anyway.
}
void removed( vehicle &veh, const int /*part*/ ) override {
// @todo check if this is necessary, it probably isn't during mapgen
// @TODO: check if this is necessary, it probably isn't during mapgen
m.dirty_vehicle_list.insert( &veh );
}
void spawn_animal_from_part( item &/*base*/, const tripoint &/*loc*/ ) override {
debugmsg( "Tried to spawn animal from vehicle part during mapgen!" );
// Ignored. The base item will not be changed and will spawn as is:
// still containing the animal.
// This should not happend during mapgen anyway.
// @todo *if* this actually happens: create a spawn point for the animal instead.
// @TODO: *if* this actually happens: create a spawn point for the animal instead.
}
};

Expand Down Expand Up @@ -2094,7 +2094,7 @@ bool vehicle::remove_part( const int p, RemovePartHandler &handler )

for( auto &i : get_items( p ) ) {
// Note: this can spawn items on the other side of the wall!
// @todo fix this ^^
// @TODO: fix this ^^
tripoint dest( part_loc + point( rng( -3, 3 ), rng( -3, 3 ) ) );
handler.add_item_or_charges( dest, i );
}
Expand Down Expand Up @@ -3805,7 +3805,7 @@ void vehicle::noise_and_smoke( int load, time_duration time )
if( !combustion ) {
return;
}
/// @todo handle other engine types: muscle / animal / wind / coal / ...
/// @TODO: handle other engine types: muscle / animal / wind / coal / ...

if( exhaust_part != -1 && engine_on ) {
spew_field( mufflesmoke, exhaust_part, fd_smoke,
Expand Down
2 changes: 1 addition & 1 deletion src/vehicle_use.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ bool vehicle::start_engine( const int e )
"engine_single_click_fail" );
return false;
}
// @todo start_moves is in moves, but it's an integer, convert it to some time class
// @TODO: start_moves is in moves, but it's an integer, convert it to some time class
const int start_draw_bat = power_to_energy_bat( engine_power *
( 1.0 + dmg / 2 + cold_factor / 5 ) * 10,
1_turns * start_moves / 100 );
Expand Down
2 changes: 1 addition & 1 deletion src/weather_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static weather_result weather_data_internal( weather_type const type )
* light modifier, sound attenuation, warn player?
* Note light modifier assumes baseline of default_daylight_level() at 60
*/
// @todo but it actually isn't 60, it's 100. Fix this comment or fix the value
// @TODO: but it actually isn't 60, it's 100. Fix this comment or fix the value
static const std::array<weather_datum, NUM_WEATHER_TYPES> data {{
weather_datum {
"NULL Weather - BUG (weather_data.cpp:weather_data)", c_magenta, c_magenta_red,
Expand Down

0 comments on commit 1cabb58

Please sign in to comment.