Skip to content

Commit

Permalink
run the scarf script
Browse files Browse the repository at this point in the history
wrapping the clang-tidy all nice and tight
  • Loading branch information
RobbieNeko committed Oct 21, 2024
1 parent 3e7af7e commit eef972f
Show file tree
Hide file tree
Showing 26 changed files with 56 additions and 58 deletions.
6 changes: 3 additions & 3 deletions src/ballistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ struct projectile_attack_aim {
/**
* Evaluates dispersion sources, range, and target to determine attack trajectory.
**/
projectile_attack_aim projectile_attack_roll( const dispersion_sources &dispersion, double range,
struct projectile_attack_aim projectile_attack_roll( const dispersion_sources &dispersion, double range,
double target_size );

/**
* Fires a projectile at the target point from the source point with total_dispersion
* dispersion.
* Returns the rolled dispersion of the shot and the actually hit point.
*/
dealt_projectile_attack projectile_attack( const projectile &proj_arg, const tripoint &source,
struct dealt_projectile_attack projectile_attack( const struct projectile &proj_arg, const tripoint &source,
const tripoint &target_arg, const dispersion_sources &dispersion,
Creature *origin = nullptr, item *source_weapon = nullptr, const vehicle *in_veh = nullptr );

namespace ranged
namespace ranged;
{

/**
Expand Down
2 changes: 1 addition & 1 deletion src/cached_item_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef CATA_SRC_CACHED_ITEM_OPTIONS_H
#define CATA_SRC_CACHED_ITEM_OPTIONS_H

enum class merge_comestible_t {
enum class merge_comestible_t; {
merge_legacy,
merge_liquid,
merge_all,
Expand Down
4 changes: 2 additions & 2 deletions src/cached_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ struct FungalOptions {
int spore_creatures_threshold;
};

extern FungalOptions fungal_opt;
extern struct FungalOptions fungal_opt;

enum class error_log_format_t {
enum class error_log_format_t; {
human_readable,
// Output error messages in github action command format (currently json only)
// See https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
Expand Down
2 changes: 1 addition & 1 deletion src/cata_unreachable.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef CATA_SRC_CATA_UNREACHABLE_H
#define CATA_SRC_CATA_UNREACHABLE_H

namespace cata
namespace cata;
{

/**
Expand Down
4 changes: 2 additions & 2 deletions src/catalua_bindings_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ void reg_serde_functions( sol::usertype<T> &ut )
#define SET_FX(func_name) luna::set_fx ( ut, #func_name, &UT_CLASS::func_name)
// SET FX (function) with Type
#define SET_FX_T(func_name, func_type) luna::set_fx( ut, #func_name, \
sol::resolve< func_type >( &UT_CLASS::func_name))
sol::resolve< (func_type) >( &UT_CLASS::func_name))
// SET FX (function) with Name
//#define SET_FX_N(func_name, lua_name_str) luna::set_fx ( ut, lua_name_str, &UT_CLASS::func_name)
// SET FX (function) with Name and Type
#define SET_FX_N_T(func_name, lua_name_str, func_type) luna::set_fx( ut, lua_name_str, \
sol::resolve< func_type >( &UT_CLASS::func_name))
sol::resolve< (func_type) >( &UT_CLASS::func_name))

#endif // CATA_SRC_CATALUA_BINDINGS_UTILS_H
2 changes: 1 addition & 1 deletion src/catalua_console.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef CATA_SRC_CATALUA_CONSOLE_H
#define CATA_SRC_CATALUA_CONSOLE_H

namespace cata
namespace cata;
{

void show_lua_console_impl();
Expand Down
6 changes: 3 additions & 3 deletions src/catalua_luna.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define LUNA_VAL( Class, Name ) \
namespace luna::detail { \
template<> \
struct luna_traits<Class> { \
struct luna_traits<(Class)> { \
constexpr static bool impl = true; \
constexpr static std::string_view name = Name; \
}; \
Expand All @@ -29,8 +29,8 @@

#define LUNA_ID( Class, Name ) \
LUNA_DOC( Class, Name "Raw" ) \
LUNA_VAL( string_id<Class>, Name "Id" ) \
LUNA_VAL( int_id<Class>, Name "IntId" )
LUNA_VAL( string_id<(Class)>, Name "Id" ) \
LUNA_VAL( int_id<(Class)>, Name "IntId" )

#define LUNA_ENUM( Class, Name ) LUNA_VAL( Class, Name )

Expand Down
12 changes: 6 additions & 6 deletions src/character_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
class Character;

struct stat_mod {
int strength = 0;
int dexterity = 0;
int intelligence = 0;
int perception = 0;
int strength; = 0;
int dexterity; = 0;
int intelligence; = 0;
int perception; = 0;

int speed = 0;
int speed; = 0;
};

namespace character_effects
namespace character_effects;
{

/** Returns the effect of pain on stats */
Expand Down
2 changes: 1 addition & 1 deletion src/character_turn.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class Character;
struct w_point;

namespace character_funcs
namespace character_funcs;
{

/** Maintains body wetness and handles the rate at which the player dries */
Expand Down
2 changes: 1 addition & 1 deletion src/fmtlib_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,7 @@ using wformat_context = buffer_context<wchar_t>;

// Workaround an alias issue: https://stackoverflow.com/q/62767544/471164.
#define FMT_BUFFER_CONTEXT(Char) \
basic_format_context<detail::buffer_appender<Char>, Char>
basic_format_context<detail::buffer_appender<(Char)>, (Char)>

/**
\rst
Expand Down
2 changes: 1 addition & 1 deletion src/fmtlib_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -3971,7 +3971,7 @@ struct formatter < T, Char,
struct formatter<Type, Char> : formatter<Base, Char> { \
template <typename FormatContext> \
auto format(Type const& val, FormatContext& ctx) -> decltype(ctx.out()) { \
return formatter<Base, Char>::format(val, ctx); \
return formatter<(Base), Char>::format(val, ctx); \
} \
}

Expand Down
2 changes: 1 addition & 1 deletion src/fungal_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class map;
class game;
class Creature;

class fungal_effects
class fungal_effects;
{
private:
// Dependency injection to try to be less global
Expand Down
2 changes: 1 addition & 1 deletion src/game_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef CATA_SRC_GAME_UI_H
#define CATA_SRC_GAME_UI_H

namespace game_ui
namespace game_ui;
{
void init_ui();
} // namespace game_ui
Expand Down
2 changes: 1 addition & 1 deletion src/ime.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void disable_ime();
/**
* used before text input to change IME mode and auto-restore IME mode when leaving the scope
*/
class ime_sentry
class ime_sentry;
{
public:
enum mode {
Expand Down
2 changes: 1 addition & 1 deletion src/io_tags.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef CATA_SRC_IO_TAGS_H
#define CATA_SRC_IO_TAGS_H

namespace io
namespace io;
{

class JsonArrayInputArchive;
Expand Down
4 changes: 2 additions & 2 deletions src/iuse_software_snake.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#ifndef CATA_SRC_IUSE_SOFTWARE_SNAKE_H
#define CATA_SRC_IUSE_SOFTWARE_SNAKE_H

namespace catacurses
namespace catacurses;
{
class window;
} // namespace catacurses

class snake_game
class snake_game;
{
public:
snake_game();
Expand Down
18 changes: 9 additions & 9 deletions src/melee.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ struct attack_statblock;
* statistics data for melee attacks, used for test purposes
*/
struct melee_statistic_data {
int attack_count = 0;
int hit_count = 0;
int double_crit_count = 0;
int crit_count = 0;
int actual_crit_count = 0;
double double_crit_chance = 0.0;
double crit_chance = 0.0;
int damage_amount = 0;
int attack_count; = 0;
int hit_count; = 0;
int double_crit_count; = 0;
int crit_count; = 0;
int actual_crit_count; = 0;
double double_crit_chance; = 0.0;
double crit_chance; = 0.0;
int damage_amount; = 0;
};

namespace melee
namespace melee;
{

constexpr double accuracy_roll_stddev = 5.0;
Expand Down
2 changes: 1 addition & 1 deletion src/monattack.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class monster;
class Creature;

namespace mattack
namespace mattack;
{
bool none( monster *z );
bool eat_crop( monster *z );
Expand Down
2 changes: 1 addition & 1 deletion src/mondeath.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class monster;

namespace mdeath
namespace mdeath;
{
// Drop a body
void normal( monster &z );
Expand Down
2 changes: 1 addition & 1 deletion src/mondefense.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class monster;
class Creature;
struct dealt_projectile_attack;

namespace mdefense
namespace mdefense;
{
/**
* @param m The monster the defends itself.
Expand Down
2 changes: 1 addition & 1 deletion src/monexamine.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class monster;

namespace monexamine
namespace monexamine;
{
bool pet_menu( monster &z );
bool mech_hack( monster &z );
Expand Down
8 changes: 4 additions & 4 deletions src/rot.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#ifndef CATA_SRC_ROT_H
#define CATA_SRC_ROT_H

enum class temperature_flag : int;
enum class temperature_flag ; int;

class map;
class item;
enum class map;
enum class item;

namespace rot
namespace rot;
{

// TODO: Move to item_location method?
Expand Down
2 changes: 1 addition & 1 deletion src/sets_intersect.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef CATA_SRC_SETS_INTERSECT_H
#define CATA_SRC_SETS_INTERSECT_H

namespace cata
namespace cata;
{

template<typename SetL, typename SetR>
Expand Down
2 changes: 1 addition & 1 deletion src/teleport.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Creature;

namespace teleport
namespace teleport;
{
/** Teleports a creature to a tile within min_distance and max_distance tiles. Limited to 2D.
*bool safe determines wether the teleported creature can telefrag others/itself.
Expand Down
10 changes: 5 additions & 5 deletions src/type_id_implement.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
} \
/** @relates string_id */ \
template<> \
const T& string_id<T>::obj() const \
const T& string_id<(T)>::obj() const \
{ \
return (factory).obj(*this); \
}
Expand All @@ -30,7 +30,7 @@
return (factory).is_valid(*this); \
} \
template<> \
const T& int_id<T>::obj() const \
const T& int_id<(T)>::obj() const \
{ \
return (factory).obj(*this); \
}
Expand All @@ -41,15 +41,15 @@
template<> \
int_id<T> string_id<T>::id() const \
{ \
return (factory).convert(*this, int_id<T>(-1)); \
return (factory).convert(*this, int_id<(T)>(-1)); \
} \
template<> \
int_id<T>::int_id(const string_id<T>& id) \
int_id<(T)>::int_id(const string_id<(T)>& id) \
{ \
*this = id.id(); \
} \
template<> \
const string_id<T>& int_id<T>::id() const \
const string_id<(T)>& int_id<(T)>::id() const \
{ \
return (factory).convert(*this); \
}
Expand Down
10 changes: 4 additions & 6 deletions src/wdirent.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,10 @@ static WIN32_FIND_DATAW *dirent_first( _WDIR *dirp );
static WIN32_FIND_DATAW *dirent_next( _WDIR *dirp );

static int dirent_mbstowcs_s(
size_t *pReturnValue, wchar_t *wcstr, size_t sizeInWords,
const char *mbstr, size_t count );
size_t *pReturnValue, wchar_t *wcstr, const char *mbstr, size_t count );

static int dirent_wcstombs_s(
size_t *pReturnValue, char *mbstr, size_t sizeInBytes,
const wchar_t *wcstr, size_t count );
size_t *pReturnValue, char *mbstr, const wchar_t *wcstr, size_t count );

#if !defined(_MSC_VER) || _MSC_VER < 1400
static void dirent_set_errno( int error );
Expand Down Expand Up @@ -710,7 +708,7 @@ static int closedir( DIR *dirp )
/* Convert multi-byte string to wide character string */
static int dirent_mbstowcs_s(
size_t *pReturnValue, wchar_t *wcstr,
size_t sizeInWords, const char *mbstr, size_t /*count*/ )
const char *mbstr, size_t /*count*/ )
{
const int required_size = MultiByteToWideChar( CP_UTF8, 0, mbstr, -1, NULL, 0 ) + 1;
if( required_size > static_cast<int>( sizeInWords ) ) {
Expand All @@ -730,7 +728,7 @@ static int dirent_mbstowcs_s(
/* Convert wide-character string to multi-byte string */
static int dirent_wcstombs_s(
size_t *pReturnValue, char *mbstr,
size_t sizeInBytes, const wchar_t *wcstr, size_t /*count*/ )
const wchar_t *wcstr, size_t /*count*/ )
{
const int required_size = WideCharToMultiByte( CP_UTF8, 0, wcstr, -1, NULL, 0, NULL, 0 ) + 1;
if( required_size > static_cast<int>( sizeInBytes ) ) {
Expand Down

0 comments on commit eef972f

Please sign in to comment.