Skip to content

Commit

Permalink
clang-tidy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
prharvey committed Dec 27, 2023
1 parent 829d219 commit 78ff0de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/mapdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ void reset_furn_ter()
furniture_data.reset();
}

static const furn_str_id furn_t_null( "f_null" );
static const furn_str_id furn_f_null( "f_null" );

resolved_furn_id f_null, f_clear,
f_hay,
Expand Down Expand Up @@ -1244,7 +1244,7 @@ resolved_furn_id f_null, f_clear,

void set_furn_ids()
{
f_null = null_furn = furn_t_null;
f_null = null_furn = furn_f_null;
f_clear = furn_id( "f_clear" );
f_hay = furn_id( "f_hay" );
f_rubble = furn_id( "f_rubble" );
Expand Down Expand Up @@ -1807,7 +1807,7 @@ void activity_data_ter::load( const JsonObject &jo )

void activity_data_furn::load( const JsonObject &jo )
{
optional( jo, was_loaded, "result", result_, furn_t_null );
optional( jo, was_loaded, "result", result_, furn_f_null );
activity_data_common::load( jo );
valid_ = true;
}
Expand Down
4 changes: 3 additions & 1 deletion tests/generic_factory_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct test_obj {
test_obj invalid;
test_id test_int_id_null( -1 );

generic_factory<test_obj> *current_factory;
generic_factory<test_obj> *current_factory = nullptr;

} // namespace

Expand Down Expand Up @@ -78,6 +78,7 @@ TEST_CASE( "generic_factory_insert_convert_valid", "[generic_factory]" )
test_obj_id id_2( "id_2" );

generic_factory<test_obj> test_factory( "test_factory" );
restore_on_out_of_scope<generic_factory<test_obj>*> current_factory_prev( current_factory );
current_factory = &test_factory;

REQUIRE_FALSE( test_factory.is_valid( id_0 ) );
Expand Down Expand Up @@ -175,6 +176,7 @@ TEST_CASE( "generic_factory_repeated_invalidation", "[generic_factory]" )
// if id is static, factory must be static (or singleton by other means)
static test_obj_id id_1( "id_1" );
static generic_factory<test_obj> test_factory( "test_factory" );
restore_on_out_of_scope<generic_factory<test_obj>*> current_factory_prev( current_factory );
current_factory = &test_factory;

for( int i = 0; i < 10; i++ ) {
Expand Down

0 comments on commit 78ff0de

Please sign in to comment.