@@ -55,7 +55,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_null()
5555 int i;
5656 sexp_list_item head;
5757
58- for (i=0 ; i<( int ) Operators.size (); i++)
58+ for (i=0 ; i<static_cast < int >( Operators.size () ); i++)
5959 if (query_operator_return_type (i) == OPR_NULL )
6060 head.add_op (i);
6161
@@ -67,7 +67,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_flexible_argument()
6767 int i;
6868 sexp_list_item head;
6969
70- for (i=0 ; i<( int ) Operators.size (); i++)
70+ for (i=0 ; i<static_cast < int >( Operators.size () ); i++)
7171 if (query_operator_return_type (i) == OPR_FLEXIBLE_ARGUMENT )
7272 head.add_op (i);
7373
@@ -91,7 +91,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_bool(int parent_node)
9191
9292 }
9393
94- for (i=0 ; i<( int ) Operators.size (); i++) {
94+ for (i=0 ; i<static_cast < int >( Operators.size () ); i++) {
9595 if (query_operator_return_type (i) == OPR_BOOL ) {
9696 if ( !only_basic || (only_basic && ((Operators[i].value == OP_TRUE ) || (Operators[i].value == OP_FALSE ))) ) {
9797 head.add_op (i);
@@ -107,7 +107,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_positive()
107107 int i, z;
108108 sexp_list_item head;
109109
110- for (i=0 ; i<( int ) Operators.size (); i++) {
110+ for (i=0 ; i<static_cast < int >( Operators.size () ); i++) {
111111 z = query_operator_return_type (i);
112112 // Goober5000's number hack
113113 if ((z == OPR_NUMBER ) || (z == OPR_POSITIVE ))
@@ -122,7 +122,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_number()
122122 int i, z;
123123 sexp_list_item head;
124124
125- for (i=0 ; i<( int ) Operators.size (); i++) {
125+ for (i=0 ; i<static_cast < int >( Operators.size () ); i++) {
126126 z = query_operator_return_type (i);
127127 if ((z == OPR_NUMBER ) || (z == OPR_POSITIVE ))
128128 head.add_op (i);
@@ -244,7 +244,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_iff()
244244 int i;
245245 sexp_list_item head;
246246
247- for (i=0 ; i< ( int ) Iff_info.size (); i++)
247+ for (i=0 ; i< static_cast < int >( Iff_info.size () ); i++)
248248 head.add_data (Iff_info[i].iff_name );
249249
250250 return head.next ;
@@ -351,7 +351,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_arrival_anchor_all()
351351
352352 for (restrict_to_players = 0 ; restrict_to_players < 2 ; restrict_to_players++)
353353 {
354- for (i = 0 ; i < ( int ) Iff_info.size (); i++)
354+ for (i = 0 ; i < static_cast < int >( Iff_info.size () ); i++)
355355 {
356356 char tmp[NAME_LENGTH + 15 ];
357357 stuff_special_arrival_anchor_name (tmp, i, restrict_to_players, false );
@@ -384,7 +384,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_ai_goal(int parent_node)
384384 n = ship_name_lookup (_model.tree_nodes [child].text , 1 );
385385 if (n >= 0 ) {
386386 // add operators if it's an ai-goal and ai-goal is allowed for that ship
387- for (i=0 ; i<( int ) Operators.size (); i++) {
387+ for (i=0 ; i<static_cast < int >( Operators.size () ); i++) {
388388 if ( (query_operator_return_type (i) == OPR_AI_GOAL ) && query_sexp_ai_goal_valid (Operators[i].value , n) )
389389 head.add_op (i);
390390 }
@@ -395,14 +395,14 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_ai_goal(int parent_node)
395395 for (w=0 ; w<Wings[z].wave_count ; w++) {
396396 n = Wings[z].ship_index [w];
397397 // add operators if it's an ai-goal and ai-goal is allowed for that ship
398- for (i=0 ; i<( int ) Operators.size (); i++) {
398+ for (i=0 ; i<static_cast < int >( Operators.size () ); i++) {
399399 if ( (query_operator_return_type (i) == OPR_AI_GOAL ) && query_sexp_ai_goal_valid (Operators[i].value , n) )
400400 head.add_op (i);
401401 }
402402 }
403403 // when dealing with the special argument add them all. It's up to the FREDder to ensure invalid orders aren't given
404404 } else if (!strcmp (_model.tree_nodes [child].text , SEXP_ARGUMENT_STRING )) {
405- for (i=0 ; i<( int ) Operators.size (); i++) {
405+ for (i=0 ; i<static_cast < int >( Operators.size () ); i++) {
406406 if (query_operator_return_type (i) == OPR_AI_GOAL ) {
407407 head.add_op (i);
408408 }
@@ -433,7 +433,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_docker_point(int parent_node, int a
433433
434434 Assertion (parent_node >= 0 , " Invalid parent node" );
435435 Assertion (!stricmp (_model.tree_nodes [parent_node].text , " ai-dock" ) || !stricmp (_model.tree_nodes [parent_node].text , " set-docked" ) ||
436- get_operator_const (_model.tree_nodes [parent_node].text ) >= ( int ) First_available_operator_id, " Invalid node type" );
436+ get_operator_const (_model.tree_nodes [parent_node].text ) >= static_cast < int >( First_available_operator_id) , " Invalid node type" );
437437
438438 if (!stricmp (_model.tree_nodes [parent_node].text , " ai-dock" ))
439439 {
@@ -456,7 +456,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_docker_point(int parent_node, int a
456456 sh = ship_name_lookup (_model.tree_nodes [z].text , 1 );
457457 }
458458 // for Lua sexps
459- else if (get_operator_const (_model.tree_nodes [parent_node].text ) >= ( int ) First_available_operator_id)
459+ else if (get_operator_const (_model.tree_nodes [parent_node].text ) >= static_cast < int >( First_available_operator_id) )
460460 {
461461 int this_index = get_dynamic_parameter_index (_model.tree_nodes [parent_node].text , arg_num);
462462
@@ -712,7 +712,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_ship_wing_wholeteam()
712712 int i;
713713 sexp_list_item head;
714714
715- for (i = 0 ; i < ( int ) Iff_info.size (); i++)
715+ for (i = 0 ; i < static_cast < int >( Iff_info.size () ); i++)
716716 head.add_data (Iff_info[i].iff_name );
717717
718718 head.add_list (get_listing_opf_ship_wing ());
@@ -725,7 +725,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_ship_wing_shiponteam_point()
725725 int i;
726726 sexp_list_item head;
727727
728- for (i = 0 ; i < ( int ) Iff_info.size (); i++)
728+ for (i = 0 ; i < static_cast < int >( Iff_info.size () ); i++)
729729 {
730730 char tmp[NAME_LENGTH + 7 ];
731731 sprintf (tmp, " <any %s>" , Iff_info[i].iff_name );
@@ -915,7 +915,7 @@ sexp_list_item *SexpTreeOPF::get_listing_opf_medal_name()
915915 int i;
916916 sexp_list_item head;
917917
918- for (i = 0 ; i < ( int ) Medals.size (); i++)
918+ for (i = 0 ; i < static_cast < int >( Medals.size () ); i++)
919919 {
920920 // don't add Rank or the Ace badges
921921 if ((i == Rank_medal_index) || (Medals[i].kills_needed > 0 ))
@@ -1925,7 +1925,7 @@ sexp_list_item *SexpTreeOPF::get_container_modifiers(int con_data_node) const
19251925
19261926 list = get_map_container_modifiers (con_data_node);
19271927 } else {
1928- UNREACHABLE (" Unknown container type %d" , ( int ) p_container->type );
1928+ UNREACHABLE (" Unknown container type %d" , static_cast < int >( p_container->type ) );
19291929 }
19301930
19311931 if (list) {
@@ -1964,15 +1964,15 @@ sexp_list_item *SexpTreeOPF::get_map_container_modifiers(int con_data_node) cons
19641964 Assertion (container.is_map (),
19651965 " Found map modifier for non-map container %s with type %d. Please report!" ,
19661966 _model.tree_nodes [con_data_node].text ,
1967- ( int ) container.type );
1967+ static_cast < int >( container.type ) );
19681968
19691969 int type = SEXPT_VALID | SEXPT_MODIFIER ;
19701970 if (any (container.type & ContainerType::STRING_KEYS )) {
19711971 type |= SEXPT_STRING ;
19721972 } else if (any (container.type & ContainerType::NUMBER_KEYS )) {
19731973 type |= SEXPT_NUMBER ;
19741974 } else {
1975- UNREACHABLE (" Unknown map container key type %d" , ( int ) container.type );
1975+ UNREACHABLE (" Unknown map container key type %d" , static_cast < int >( container.type ) );
19761976 }
19771977
19781978 for (const auto &kv_pair : container.map_data ) {
@@ -2012,7 +2012,7 @@ sexp_list_item *SexpTreeOPF::check_for_dynamic_sexp_enum(int opf)
20122012
20132013 int item = opf - First_available_opf_id;
20142014
2015- if (item < ( int ) Dynamic_enums.size ()) {
2015+ if (item < static_cast < int >( Dynamic_enums.size () )) {
20162016
20172017 for (const SCP_string& enum_item : Dynamic_enums[item].list ) {
20182018 head.add_data (enum_item.c_str ());
@@ -2811,7 +2811,7 @@ int SexpTreeOPF::query_default_argument_available(int op, int i) const
28112811
28122812 default :
28132813 if (!Dynamic_enums.empty ()) {
2814- if ((type - First_available_opf_id) < ( int ) Dynamic_enums.size ()) {
2814+ if ((type - First_available_opf_id) < static_cast < int >( Dynamic_enums.size () )) {
28152815 return 1 ;
28162816 } else {
28172817 UNREACHABLE (" Unhandled SEXP argument type!" );
@@ -2903,10 +2903,10 @@ int SexpTreeOPF::get_default_value(sexp_list_item* item, char* text_buf, int op,
29032903 temp = 100 ;
29042904 break ;
29052905 case 11 :
2906- temp = ( int ) EMP_DEFAULT_INTENSITY ;
2906+ temp = static_cast < int >( EMP_DEFAULT_INTENSITY ) ;
29072907 break ;
29082908 case 12 :
2909- temp = ( int ) EMP_DEFAULT_TIME ;
2909+ temp = static_cast < int >( EMP_DEFAULT_TIME ) ;
29102910 break ;
29112911 default :
29122912 temp = 0 ;
0 commit comments