Skip to content

Commit

Permalink
Astyling, the revenge.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingranade committed Aug 2, 2017
1 parent 442feb9 commit dd70798
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 55 deletions.
20 changes: 0 additions & 20 deletions astyle_blacklist
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
src/action.cpp
src/activity_handlers.cpp
src/advanced_inv.cpp
src/animation.cpp
Expand All @@ -17,12 +16,10 @@ src/construction.cpp
src/creature.cpp
src/cursesport.cpp
src/defense.cpp
src/dispersion.cpp
src/dump.cpp
src/effect.cpp
src/event.cpp
src/faction.cpp
src/fault.cpp
src/field.cpp
src/filesystem.cpp
src/game.cpp
Expand Down Expand Up @@ -75,7 +72,6 @@ src/overmapbuffer.cpp
src/overmap.cpp
src/path_info.cpp
src/player.cpp
src/profession.cpp
src/projectile.cpp
src/ranged.cpp
src/requirements.cpp
Expand All @@ -97,16 +93,10 @@ src/weather_data.cpp
src/wincurse.cpp
src/worldfactory.cpp
src/addiction.h
src/ballistics.h
src/bonuses.h
src/cata_tiles.h
src/character.h
src/clzones.h
src/creature.h
src/damage.h
src/dialogue.h
src/dispersion.h
src/editmap.h
src/effect.h
src/enums.h
src/field.h
Expand Down Expand Up @@ -136,8 +126,6 @@ src/output.h
src/overmapbuffer.h
src/overmap.h
src/player.h
src/profession.h
src/ranged.h
src/scenario.h
src/simplexnoise.h
src/submap.h
Expand All @@ -147,34 +135,26 @@ src/wcwidth.h
src/wdirent.h
tests/bionics_test.cpp
tests/catacharset_test.cpp
tests/char_validity_check_test.cpp
tests/crafting_test.cpp
tests/creature_test.cpp
tests/fake_messages.cpp
tests/invlet_test.cpp
tests/iuse_test.cpp
tests/line_test.cpp
tests/map_iterator_test.cpp
tests/map_test.cpp
tests/math_functions.cpp
tests/melee_test.cpp
tests/mod_test.cpp
tests/monster_test.cpp
tests/new_character_test.cpp
tests/npc_test.cpp
tests/overmap_test.cpp
tests/player_test.cpp
tests/positional_arguments_test.cpp
tests/reloading_test.cpp
tests/reload_magazine.cpp
tests/rewrite_vsnprintf_test.cpp
tests/savegame_test.cpp
tests/shadowcasting_test.cpp
tests/test_main.cpp
tests/vehicle_efficiency.cpp
tests/vehicle_test.cpp
tests/vehicle_turrets.cpp
tests/visitable.cpp
tests/visitable_remove.cpp
tests/wield_times_test.cpp
tests/test_statistics.h
2 changes: 1 addition & 1 deletion src/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ bool can_interact_at( action_id action, const tripoint &p )
case ACTION_BUTCHER:
return can_butcher_at( p );
case ACTION_MOVE_UP:
return can_move_vertical_at( p , 1 );
return can_move_vertical_at( p, 1 );
case ACTION_MOVE_DOWN:
return can_move_vertical_at( p, -1 );
break;
Expand Down
4 changes: 2 additions & 2 deletions src/ballistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct tripoint;
* Returns the rolled dispersion of the shot and the actually hit point.
*/
dealt_projectile_attack projectile_attack( const projectile &proj, const tripoint &source,
const tripoint &target, dispersion_sources dispersion,
Creature *origin = nullptr, const vehicle *in_veh = nullptr );
const tripoint &target, dispersion_sources dispersion,
Creature *origin = nullptr, const vehicle *in_veh = nullptr );

#endif
2 changes: 1 addition & 1 deletion src/cata_tiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ class cata_tiles

/* Tile Picking */
void get_tile_values( const int t, const int *tn, int &subtile, int &rotation );
void get_connect_values( const tripoint &p, int &subtile, int &rotation , int connect_group );
void get_connect_values( const tripoint &p, int &subtile, int &rotation, int connect_group );
void get_terrain_orientation( const tripoint &p, int &rota, int &subtype );
void get_rotation_and_subtile( const char val, const int num_connects, int &rota, int &subtype );

Expand Down
9 changes: 6 additions & 3 deletions src/dispersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

#include "rng.h"

double dispersion_sources::roll() const {
double dispersion_sources::roll() const
{
double this_roll = 0.0;
for( const double &source : linear_sources ) {
this_roll += rng_float( 0.0, source );
Expand All @@ -16,7 +17,8 @@ double dispersion_sources::roll() const {
return this_roll;
}

double dispersion_sources::max() const {
double dispersion_sources::max() const
{
double sum = 0.0;
for( const double &source : linear_sources ) {
sum += source;
Expand All @@ -30,7 +32,8 @@ double dispersion_sources::max() const {
return sum;
}

double dispersion_sources::avg() const {
double dispersion_sources::avg() const
{
return max() / 2.0;
}

2 changes: 1 addition & 1 deletion src/dispersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class dispersion_sources
std::vector<double> linear_sources;
std::vector<double> multipliers;
public:
dispersion_sources( double normal_source = 0.0) {
dispersion_sources( double normal_source = 0.0 ) {
if( normal_source != 0.0 ) {
normal_sources.push_back( normal_source );
}
Expand Down
2 changes: 1 addition & 1 deletion src/effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct mutation_branch;
using trait_id = string_id<mutation_branch>;

/** Handles the large variety of weed messages. */
void weed_msg(player *p);
void weed_msg( player *p );

enum effect_rating {
e_good, // The effect is good for the one who has it.
Expand Down
2 changes: 1 addition & 1 deletion src/fault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void fault::load_fault( JsonObject &jo )
auto sk = jo.get_array( "skills" );
while( sk.has_more() ) {
auto cur = sk.next_array();
f.skills_.emplace( skill_id( cur.get_string( 0 ) ) , cur.size() >= 2 ? cur.get_int( 1 ) : 1 );
f.skills_.emplace( skill_id( cur.get_string( 0 ) ), cur.size() >= 2 ? cur.get_int( 1 ) : 1 );
}

if( jo.has_string( "requirements" ) ) {
Expand Down
4 changes: 2 additions & 2 deletions src/gamemode.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ struct special_game;
struct mtype;
using mtype_id = string_id<mtype>;

std::string special_game_name(special_game_id id);
std::unique_ptr<special_game> get_special_game(special_game_id id);
std::string special_game_name( special_game_id id );
std::unique_ptr<special_game> get_special_game( special_game_id id );

struct special_game {
virtual ~special_game() {
Expand Down
6 changes: 4 additions & 2 deletions src/monster.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,10 @@ class monster : public Creature, public JsonSerializer, public JsonDeserializer
field_id gibType() const override;

void add_msg_if_npc( const char *msg, ... ) const override PRINTF_LIKE( 2, 3 );
void add_msg_if_npc( game_message_type type, const char *msg, ... ) const override PRINTF_LIKE( 3, 4 );
void add_msg_player_or_npc( const char *, const char *npc_str, ... ) const override PRINTF_LIKE( 3, 4 );
void add_msg_if_npc( game_message_type type, const char *msg,
... ) const override PRINTF_LIKE( 3, 4 );
void add_msg_player_or_npc( const char *, const char *npc_str,
... ) const override PRINTF_LIKE( 3, 4 );
void add_msg_player_or_npc( game_message_type type, const char *, const char *npc_str,
... ) const override PRINTF_LIKE( 4, 5 );

Expand Down
6 changes: 3 additions & 3 deletions src/monstergenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ enum m_size : int;
class monster;
class Creature;
struct dealt_projectile_attack;
using mon_action_death = void (*)(monster*);
using mon_action_attack = bool (*)(monster*);
using mon_action_defend = void (*)(monster&, Creature*, dealt_projectile_attack const*);
using mon_action_death = void ( * )( monster * );
using mon_action_attack = bool ( * )( monster * );
using mon_action_defend = void ( * )( monster &, Creature *, dealt_projectile_attack const * );
using mtype_id = string_id<mtype>;
struct species_type;
using species_id = string_id<species_type>;
Expand Down
2 changes: 1 addition & 1 deletion src/profession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void profession::check_item_definitions( const itypedecvec &items ) const
{
for( auto &itd : items ) {
if( !item::type_is_defined( itd.type_id ) ) {
debugmsg( "profession %s: item %s does not exist", id.c_str() , itd.type_id.c_str() );
debugmsg( "profession %s: item %s does not exist", id.c_str(), itd.type_id.c_str() );
} else if( !itd.snippet_id.empty() ) {
const itype *type = item::find_type( itd.type_id );
if( type->snippet_category.empty() ) {
Expand Down
7 changes: 4 additions & 3 deletions src/ranged.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct tripoint;
* Targeting UI callback is passed the item being targeted (if any)
* and should return pointer to effective ammo data (if any)
*/
using target_callback = std::function<const itype *(item *obj)>;
using target_callback = std::function<const itype *( item *obj )>;
using firing_callback = std::function<void( const int )>;

enum target_mode {
Expand All @@ -38,8 +38,9 @@ struct targeting_data {
firing_callback post_fire;
};

class target_handler {
// @todo: alias return type of target_ui
class target_handler
{
// @todo: alias return type of target_ui
public:
/**
* Prompts for target and returns trajectory to it.
Expand Down
3 changes: 2 additions & 1 deletion tests/char_validity_check_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "catch/catch.hpp"
#include "char_validity_check.h"

TEST_CASE( "char_validity_check" ) {
TEST_CASE( "char_validity_check" )
{
CHECK( is_char_allowed( '\0' ) == false );
CHECK( is_char_allowed( '\b' ) == false );
CHECK( is_char_allowed( '\t' ) == false );
Expand Down
10 changes: 6 additions & 4 deletions tests/crafting_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#include "player.h"
#include "recipe_dictionary.h"

TEST_CASE( "recipe_subset" ) {
TEST_CASE( "recipe_subset" )
{
recipe_subset subset;

REQUIRE( subset.size() == 0 );
Expand Down Expand Up @@ -102,7 +103,8 @@ TEST_CASE( "recipe_subset" ) {
}

// This crashes subsequent testcases for some reason.
TEST_CASE( "available_recipes", "[.]" ) {
TEST_CASE( "available_recipes", "[.]" )
{
const recipe *r = &recipe_dict[ "brew_mead" ];
player dummy;

Expand All @@ -114,7 +116,7 @@ TEST_CASE( "available_recipes", "[.]" ) {
WHEN( "the player has lower skill" ) {
dummy.set_skill_level( r->skill_used, r->difficulty - 1 );

THEN( "he can't brew it") {
THEN( "he can't brew it" ) {
CHECK_FALSE( dummy.knows_recipe( r ) );
}
}
Expand Down Expand Up @@ -156,7 +158,7 @@ TEST_CASE( "available_recipes", "[.]" ) {
CHECK( dummy.get_recipes_from_books( dummy.inv ).get_custom_difficulty( r ) == 2 );
}

THEN( "he still hasn't the recipe memorized") {
THEN( "he still hasn't the recipe memorized" ) {
CHECK_FALSE( dummy.knows_recipe( r ) );
}
}
Expand Down
3 changes: 2 additions & 1 deletion tests/map_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include "map.h"
#include "player.h"

TEST_CASE( "destroy_grabbed_furniture" ) {
TEST_CASE( "destroy_grabbed_furniture" )
{
GIVEN( "Furniture grabbed by the player" ) {
tripoint test_origin( 60, 60, 0 );
g->u.setpos( test_origin );
Expand Down
3 changes: 2 additions & 1 deletion tests/mod_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

#include <algorithm>

TEST_CASE("Boat mod is loaded correctly or not at all") {
TEST_CASE( "Boat mod is loaded correctly or not at all" )
{
const auto &mods = world_generator->active_world->active_mod_order;
if( std::find( mods.begin(), mods.end(), "boats" ) != mods.end() ) {
REQUIRE( item::type_is_defined( "inflatable_boat" ) );
Expand Down
8 changes: 5 additions & 3 deletions tests/overmap_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include "overmap.h"
#include "overmapbuffer.h"

TEST_CASE( "set_and_get_overmap_scents" ) {
TEST_CASE( "set_and_get_overmap_scents" )
{
std::unique_ptr<overmap> test_overmap = std::unique_ptr<overmap>( new overmap( 0, 0 ) );

// By default there are no scents set.
Expand All @@ -22,10 +23,11 @@ TEST_CASE( "set_and_get_overmap_scents" ) {
REQUIRE( test_overmap->scent_at( { 75, 85, 0} ).initial_strength == 90 );
}

TEST_CASE( "default_overmap_generation_always_succeeds" ) {
TEST_CASE( "default_overmap_generation_always_succeeds" )
{
int overmaps_to_construct = 10;
for( point candidate_addr : closest_points_first( 10, { 0, 0 } ) ) {
// Skip populated overmaps.
// Skip populated overmaps.
if( overmap_buffer.has( candidate_addr.x, candidate_addr.y ) ) {
continue;
}
Expand Down
6 changes: 4 additions & 2 deletions tests/reloading_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#include "itype.h"
#include "player.h"

TEST_CASE( "reload_gun_with_integral_magazine", "[reload],[gun]" ) {
TEST_CASE( "reload_gun_with_integral_magazine", "[reload],[gun]" )
{
player &dummy = g->u;

// Remove first worn item until there are none left.
Expand All @@ -30,7 +31,8 @@ TEST_CASE( "reload_gun_with_integral_magazine", "[reload],[gun]" ) {
REQUIRE( gun.ammo_remaining() == gun.ammo_capacity() );
}

TEST_CASE( "reload_gun_with_swappable_magazine", "[reload],[gun]" ) {
TEST_CASE( "reload_gun_with_swappable_magazine", "[reload],[gun]" )
{
player &dummy = g->u;

// Remove first worn item until there are none left.
Expand Down
3 changes: 2 additions & 1 deletion tests/vehicle_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#include "veh_type.h"
#include "player.h"

TEST_CASE( "destroy_grabbed_vehicle_section" ) {
TEST_CASE( "destroy_grabbed_vehicle_section" )
{
GIVEN( "A vehicle grabbed by the player" ) {
tripoint test_origin( 60, 60, 0 );
g->u.setpos( test_origin );
Expand Down
3 changes: 2 additions & 1 deletion tests/visitable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#include "item.h"


TEST_CASE( "visitable_summation" ) {
TEST_CASE( "visitable_summation" )
{
inventory test_inv;

item bottle_of_water( "bottle_plastic", calendar::turn );
Expand Down

0 comments on commit dd70798

Please sign in to comment.